@zkpassport/ui 0.16.2 → 0.17.0-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/esm/index.js CHANGED
@@ -1,4 +1,11 @@
1
- import x1 from'qrcode';import {ZKPassport}from'@zkpassport/sdk';export{ASEAN_COUNTRIES,EEA_COUNTRIES,EU_COUNTRIES,MERCOSUR_COUNTRIES,NullifierType,ProofType,ProofTypeLength,SANCTIONED_COUNTRIES,SCHENGEN_COUNTRIES,ZKPassport}from'@zkpassport/sdk';var Y,k,Me,P,Ce,Ze,Se,ae,Q,I,Re,pe,se,ie,F={},$=[],u1=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,J=Array.isArray;function S(e,t){for(var r in t)e[r]=t[r];return e}function ce(e){e&&e.parentNode&&e.parentNode.removeChild(e);}function X(e,t,r){var a,s,n,l={};for(n in t)n=="key"?a=t[n]:n=="ref"?s=t[n]:l[n]=t[n];if(arguments.length>2&&(l.children=arguments.length>3?Y.call(arguments,2):r),typeof e=="function"&&e.defaultProps!=null)for(n in e.defaultProps)l[n]===void 0&&(l[n]=e.defaultProps[n]);return j(e,l,a,s,null)}function j(e,t,r,a,s){var n={type:e,props:t,key:r,ref:a,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:s??++Me,__i:-1,__u:0};return s==null&&k.vnode!=null&&k.vnode(n),n}function M(e){return e.children}function K(e,t){this.props=e,this.context=t;}function H(e,t){if(t==null)return e.__?H(e.__,e.__i+1):null;for(var r;t<e.__k.length;t++)if((r=e.__k[t])!=null&&r.__e!=null)return r.__e;return typeof e.type=="function"?H(e):null}function f1(e){if(e.__P&&e.__d){var t=e.__v,r=t.__e,a=[],s=[],n=S({},t);n.__v=t.__v+1,k.vnode&&k.vnode(n),de(e.__P,n,t,e.__n,e.__P.namespaceURI,32&t.__u?[r]:null,a,r??H(t),!!(32&t.__u),s),n.__v=t.__v,n.__.__k[n.__i]=n,Ee(a,n,s),t.__e=t.__=null,n.__e!=r&&Le(n);}}function Le(e){if((e=e.__)!=null&&e.__c!=null)return e.__e=e.__c.base=null,e.__k.some(function(t){if(t!=null&&t.__e!=null)return e.__e=e.__c.base=t.__e}),Le(e)}function xe(e){(!e.__d&&(e.__d=true)&&P.push(e)&&!W.__r++||Ce!=k.debounceRendering)&&((Ce=k.debounceRendering)||Ze)(W);}function W(){try{for(var e,t=1;P.length;)P.length>t&&P.sort(Se),e=P.shift(),t=P.length,f1(e);}finally{P.length=W.__r=0;}}function Ne(e,t,r,a,s,n,l,p,u,i,f){var o,c,_,h,b,z,m,v=a&&a.__k||$,Z=t.length;for(u=h1(r,t,v,u,Z),o=0;o<Z;o++)(_=r.__k[o])!=null&&(c=_.__i!=-1&&v[_.__i]||F,_.__i=o,z=de(e,_,c,s,n,l,p,u,i,f),h=_.__e,_.ref&&c.ref!=_.ref&&(c.ref&&_e(c.ref,null,_),f.push(_.ref,_.__c||h,_)),b==null&&h!=null&&(b=h),(m=!!(4&_.__u))||c.__k===_.__k?(u=Pe(_,u,e,m),m&&c.__e&&(c.__e=null)):typeof _.type=="function"&&z!==void 0?u=z:h&&(u=h.nextSibling),_.__u&=-7);return r.__e=b,u}function h1(e,t,r,a,s){var n,l,p,u,i,f=r.length,o=f,c=0;for(e.__k=new Array(s),n=0;n<s;n++)(l=t[n])!=null&&typeof l!="boolean"&&typeof l!="function"?(typeof l=="string"||typeof l=="number"||typeof l=="bigint"||l.constructor==String?l=e.__k[n]=j(null,l,null,null,null):J(l)?l=e.__k[n]=j(M,{children:l},null,null,null):l.constructor===void 0&&l.__b>0?l=e.__k[n]=j(l.type,l.props,l.key,l.ref?l.ref:null,l.__v):e.__k[n]=l,u=n+c,l.__=e,l.__b=e.__b+1,p=null,(i=l.__i=v1(l,r,u,o))!=-1&&(o--,(p=r[i])&&(p.__u|=2)),p==null||p.__v==null?(i==-1&&(s>f?c--:s<f&&c++),typeof l.type!="function"&&(l.__u|=4)):i!=u&&(i==u-1?c--:i==u+1?c++:(i>u?c--:c++,l.__u|=4))):e.__k[n]=null;if(o)for(n=0;n<f;n++)(p=r[n])!=null&&(2&p.__u)==0&&(p.__e==a&&(a=H(p)),He(p,p));return a}function Pe(e,t,r,a){var s,n;if(typeof e.type=="function"){for(s=e.__k,n=0;s&&n<s.length;n++)s[n]&&(s[n].__=e,t=Pe(s[n],t,r,a));return t}e.__e!=t&&(a&&(t&&e.type&&!t.parentNode&&(t=H(e)),r.insertBefore(e.__e,t||null)),t=e.__e);do t=t&&t.nextSibling;while(t!=null&&t.nodeType==8);return t}function v1(e,t,r,a){var s,n,l,p=e.key,u=e.type,i=t[r],f=i!=null&&(2&i.__u)==0;if(i===null&&p==null||f&&p==i.key&&u==i.type)return r;if(a>(f?1:0)){for(s=r-1,n=r+1;s>=0||n<t.length;)if((i=t[l=s>=0?s--:n++])!=null&&(2&i.__u)==0&&p==i.key&&u==i.type)return l}return -1}function be(e,t,r){t[0]=="-"?e.setProperty(t,r??""):e[t]=r==null?"":typeof r!="number"||u1.test(t)?r:r+"px";}function G(e,t,r,a,s){var n,l;e:if(t=="style")if(typeof r=="string")e.style.cssText=r;else {if(typeof a=="string"&&(e.style.cssText=a=""),a)for(t in a)r&&t in r||be(e.style,t,"");if(r)for(t in r)a&&r[t]==a[t]||be(e.style,t,r[t]);}else if(t[0]=="o"&&t[1]=="n")n=t!=(t=t.replace(Re,"$1")),l=t.toLowerCase(),t=l in e||t=="onFocusOut"||t=="onFocusIn"?l.slice(2):t.slice(2),e.l||(e.l={}),e.l[t+n]=r,r?a?r[I]=a[I]:(r[I]=pe,e.addEventListener(t,n?ie:se,n)):e.removeEventListener(t,n?ie:se,n);else {if(s=="http://www.w3.org/2000/svg")t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(t!="width"&&t!="height"&&t!="href"&&t!="list"&&t!="form"&&t!="tabIndex"&&t!="download"&&t!="rowSpan"&&t!="colSpan"&&t!="role"&&t!="popover"&&t in e)try{e[t]=r??"";break e}catch{}typeof r=="function"||(r==null||r===false&&t[4]!="-"?e.removeAttribute(t):e.setAttribute(t,t=="popover"&&r==1?"":r));}}function we(e){return function(t){if(this.l){var r=this.l[t.type+e];if(t[Q]==null)t[Q]=pe++;else if(t[Q]<r[I])return;return r(k.event?k.event(t):t)}}}function de(e,t,r,a,s,n,l,p,u,i){var f,o,c,_,h,b,z,m,v,Z,L,A,oe,q,V,w=t.type;if(t.constructor!==void 0)return null;128&r.__u&&(u=!!(32&r.__u),n=[p=t.__e=r.__e]),(f=k.__b)&&f(t);e:if(typeof w=="function")try{if(m=t.props,v=w.prototype&&w.prototype.render,Z=(f=w.contextType)&&a[f.__c],L=f?Z?Z.props.value:f.__:a,r.__c?z=(o=t.__c=r.__c).__=o.__E:(v?t.__c=o=new w(m,L):(t.__c=o=new K(m,L),o.constructor=w,o.render=m1),Z&&Z.sub(o),o.state||(o.state={}),o.__n=a,c=o.__d=!0,o.__h=[],o._sb=[]),v&&o.__s==null&&(o.__s=o.state),v&&w.getDerivedStateFromProps!=null&&(o.__s==o.state&&(o.__s=S({},o.__s)),S(o.__s,w.getDerivedStateFromProps(m,o.__s))),_=o.props,h=o.state,o.__v=t,c)v&&w.getDerivedStateFromProps==null&&o.componentWillMount!=null&&o.componentWillMount(),v&&o.componentDidMount!=null&&o.__h.push(o.componentDidMount);else {if(v&&w.getDerivedStateFromProps==null&&m!==_&&o.componentWillReceiveProps!=null&&o.componentWillReceiveProps(m,L),t.__v==r.__v||!o.__e&&o.shouldComponentUpdate!=null&&o.shouldComponentUpdate(m,o.__s,L)===!1){t.__v!=r.__v&&(o.props=m,o.state=o.__s,o.__d=!1),t.__e=r.__e,t.__k=r.__k,t.__k.some(function(N){N&&(N.__=t);}),$.push.apply(o.__h,o._sb),o._sb=[],o.__h.length&&l.push(o);break e}o.componentWillUpdate!=null&&o.componentWillUpdate(m,o.__s,L),v&&o.componentDidUpdate!=null&&o.__h.push(function(){o.componentDidUpdate(_,h,b);});}if(o.context=L,o.props=m,o.__P=e,o.__e=!1,A=k.__r,oe=0,v)o.state=o.__s,o.__d=!1,A&&A(t),f=o.render(o.props,o.state,o.context),$.push.apply(o.__h,o._sb),o._sb=[];else do o.__d=!1,A&&A(t),f=o.render(o.props,o.state,o.context),o.state=o.__s;while(o.__d&&++oe<25);o.state=o.__s,o.getChildContext!=null&&(a=S(S({},a),o.getChildContext())),v&&!c&&o.getSnapshotBeforeUpdate!=null&&(b=o.getSnapshotBeforeUpdate(_,h)),q=f!=null&&f.type===M&&f.key==null?Ae(f.props.children):f,p=Ne(e,J(q)?q:[q],t,r,a,s,n,l,p,u,i),o.base=t.__e,t.__u&=-161,o.__h.length&&l.push(o),z&&(o.__E=o.__=null);}catch(N){if(t.__v=null,u||n!=null)if(N.then){for(t.__u|=u?160:128;p&&p.nodeType==8&&p.nextSibling;)p=p.nextSibling;n[n.indexOf(p)]=null,t.__e=p;}else {for(V=n.length;V--;)ce(n[V]);le(t);}else t.__e=r.__e,t.__k=r.__k,N.then||le(t);k.__e(N,t,r);}else n==null&&t.__v==r.__v?(t.__k=r.__k,t.__e=r.__e):p=t.__e=k1(r.__e,t,r,a,s,n,l,u,i);return (f=k.diffed)&&f(t),128&t.__u?void 0:p}function le(e){e&&(e.__c&&(e.__c.__e=true),e.__k&&e.__k.some(le));}function Ee(e,t,r){for(var a=0;a<r.length;a++)_e(r[a],r[++a],r[++a]);k.__c&&k.__c(t,e),e.some(function(s){try{e=s.__h,s.__h=[],e.some(function(n){n.call(s);});}catch(n){k.__e(n,s.__v);}});}function Ae(e){return typeof e!="object"||e==null||e.__b>0?e:J(e)?e.map(Ae):e.constructor!==void 0?null:S({},e)}function k1(e,t,r,a,s,n,l,p,u){var i,f,o,c,_,h,b,z=r.props||F,m=t.props,v=t.type;if(v=="svg"?s="http://www.w3.org/2000/svg":v=="math"?s="http://www.w3.org/1998/Math/MathML":s||(s="http://www.w3.org/1999/xhtml"),n!=null){for(i=0;i<n.length;i++)if((_=n[i])&&"setAttribute"in _==!!v&&(v?_.localName==v:_.nodeType==3)){e=_,n[i]=null;break}}if(e==null){if(v==null)return document.createTextNode(m);e=document.createElementNS(s,v,m.is&&m),p&&(k.__m&&k.__m(t,n),p=false),n=null;}if(v==null)z===m||p&&e.data==m||(e.data=m);else {if(n=v=="textarea"&&m.defaultValue!=null?null:n&&Y.call(e.childNodes),!p&&n!=null)for(z={},i=0;i<e.attributes.length;i++)z[(_=e.attributes[i]).name]=_.value;for(i in z)_=z[i],i=="dangerouslySetInnerHTML"?o=_:i=="children"||i in m||i=="value"&&"defaultValue"in m||i=="checked"&&"defaultChecked"in m||G(e,i,null,_,s);for(i in m)_=m[i],i=="children"?c=_:i=="dangerouslySetInnerHTML"?f=_:i=="value"?h=_:i=="checked"?b=_:p&&typeof _!="function"||z[i]===_||G(e,i,_,z[i],s);if(f)p||o&&(f.__html==o.__html||f.__html==e.innerHTML)||(e.innerHTML=f.__html),t.__k=[];else if(o&&(e.innerHTML=""),Ne(t.type=="template"?e.content:e,J(c)?c:[c],t,r,a,v=="foreignObject"?"http://www.w3.org/1999/xhtml":s,n,l,n?n[0]:r.__k&&H(r,0),p,u),n!=null)for(i=n.length;i--;)ce(n[i]);p&&v!="textarea"||(i="value",v=="progress"&&h==null?e.removeAttribute("value"):h!=null&&(h!==e[i]||v=="progress"&&!h||v=="option"&&h!=z[i])&&G(e,i,h,z[i],s),i="checked",b!=null&&b!=e[i]&&G(e,i,b,z[i],s));}return e}function _e(e,t,r){try{if(typeof e=="function"){var a=typeof e.__u=="function";a&&e.__u(),a&&t==null||(e.__u=e(t));}else e.current=t;}catch(s){k.__e(s,r);}}function He(e,t,r){var a,s;if(k.unmount&&k.unmount(e),(a=e.ref)&&(a.current&&a.current!=e.__e||_e(a,null,t)),(a=e.__c)!=null){if(a.componentWillUnmount)try{a.componentWillUnmount();}catch(n){k.__e(n,t);}a.base=a.__P=null;}if(a=e.__k)for(s=0;s<a.length;s++)a[s]&&He(a[s],t,r||typeof e.type!="function");r||ce(e.__e),e.__c=e.__=e.__e=void 0;}function m1(e,t,r){return this.constructor(e,r)}function ee(e,t,r){var a,s,n,l;t==document&&(t=document.documentElement),k.__&&k.__(e,t),s=(a="undefined"=="function")?null:t.__k,n=[],l=[],de(t,e=(t).__k=X(M,null,[e]),s||F,F,t.namespaceURI,s?null:t.firstChild?Y.call(t.childNodes):null,n,s?s.__e:t.firstChild,a,l),Ee(n,e,l);}Y=$.slice,k={__e:function(e,t,r,a){for(var s,n,l;t=t.__;)if((s=t.__c)&&!s.__)try{if((n=s.constructor)&&n.getDerivedStateFromError!=null&&(s.setState(n.getDerivedStateFromError(e)),l=s.__d),s.componentDidCatch!=null&&(s.componentDidCatch(e,a||{}),l=s.__d),l)return s.__E=s}catch(p){e=p;}throw e}},Me=0,K.prototype.setState=function(e,t){var r;r=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=S({},this.state),typeof e=="function"&&(e=e(S({},r),this.props)),e&&S(r,e),e!=null&&this.__v&&(t&&this._sb.push(t),xe(this));},K.prototype.forceUpdate=function(e){this.__v&&(this.__e=true,e&&this.__h.push(e),xe(this));},K.prototype.render=M,P=[],Ze=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Se=function(e,t){return e.__v.__b-t.__v.__b},W.__r=0,ae=Math.random().toString(8),Q="__d"+ae,I="__a"+ae,Re=/(PointerCapture)$|Capture$/i,pe=0,se=we(false),ie=we(true);var O,g,ue,Oe,D=0,Ge=[],y=k,qe=y.__b,Te=y.__r,Ie=y.diffed,De=y.__c,Ue=y.unmount,Be=y.__;function re(e,t){y.__h&&y.__h(g,e,D||t),D=0;var r=g.__H||(g.__H={__:[],__h:[]});return e>=r.__.length&&r.__.push({}),r.__[e]}function U(e){return D=1,g1(Fe,e)}function g1(e,t,r){var a=re(O++,2);if(a.t=e,!a.__c&&(a.__=[Fe(void 0,t),function(p){var u=a.__N?a.__N[0]:a.__[0],i=a.t(u,p);u!==i&&(a.__N=[i,a.__[1]],a.__c.setState({}));}],a.__c=g,!g.__f)){var s=function(p,u,i){if(!a.__c.__H)return true;var f=a.__c.__H.__.filter(function(c){return c.__c});if(f.every(function(c){return !c.__N}))return !n||n.call(this,p,u,i);var o=a.__c.props!==p;return f.some(function(c){if(c.__N){var _=c.__[0];c.__=c.__N,c.__N=void 0,_!==c.__[0]&&(o=true);}}),n&&n.call(this,p,u,i)||o};g.__f=true;var n=g.shouldComponentUpdate,l=g.componentWillUpdate;g.componentWillUpdate=function(p,u,i){if(this.__e){var f=n;n=void 0,s(p,u,i),n=f;}l&&l.call(this,p,u,i);},g.shouldComponentUpdate=s;}return a.__N||a.__}function ne(e,t){var r=re(O++,3);!y.__s&&ve(r.__H,t)&&(r.__=e,r.u=t,g.__H.__h.push(r));}function Qe(e,t){var r=re(O++,4);!y.__s&&ve(r.__H,t)&&(r.__=e,r.u=t,g.__h.push(r));}function he(e){return D=5,je(function(){return {current:e}},[])}function je(e,t){var r=re(O++,7);return ve(r.__H,t)&&(r.__=e(),r.__H=t,r.__h=e),r.__}function Ke(e,t){return D=8,je(function(){return e},t)}function y1(){for(var e;e=Ge.shift();){var t=e.__H;if(e.__P&&t)try{t.__h.some(te),t.__h.some(fe),t.__h=[];}catch(r){t.__h=[],y.__e(r,e.__v);}}}y.__b=function(e){g=null,qe&&qe(e);},y.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),Be&&Be(e,t);},y.__r=function(e){Te&&Te(e),O=0;var t=(g=e.__c).__H;t&&(ue===g?(t.__h=[],g.__h=[],t.__.some(function(r){r.__N&&(r.__=r.__N),r.u=r.__N=void 0;})):(t.__h.some(te),t.__h.some(fe),t.__h=[],O=0)),ue=g;},y.diffed=function(e){Ie&&Ie(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(Ge.push(t)!==1&&Oe===y.requestAnimationFrame||((Oe=y.requestAnimationFrame)||z1)(y1)),t.__H.__.some(function(r){r.u&&(r.__H=r.u),r.u=void 0;})),ue=g=null;},y.__c=function(e,t){t.some(function(r){try{r.__h.some(te),r.__h=r.__h.filter(function(a){return !a.__||fe(a)});}catch(a){t.some(function(s){s.__h&&(s.__h=[]);}),t=[],y.__e(a,r.__v);}}),De&&De(e,t);},y.unmount=function(e){Ue&&Ue(e);var t,r=e.__c;r&&r.__H&&(r.__H.__.some(function(a){try{te(a);}catch(s){t=s;}}),r.__H=void 0,t&&y.__e(t,r.__v));};var Ve=typeof requestAnimationFrame=="function";function z1(e){var t,r=function(){clearTimeout(a),Ve&&cancelAnimationFrame(t),setTimeout(e);},a=setTimeout(r,35);Ve&&(t=requestAnimationFrame(r));}function te(e){var t=g,r=e.__c;typeof r=="function"&&(e.__c=void 0,r()),g=t;}function fe(e){var t=g;e.__c=e.__(),g=t;}function ve(e,t){return !e||e.length!==t.length||t.some(function(r,a){return r!==e[a]})}function Fe(e,t){return typeof t=="function"?t(e):t}var $e="https://zkpassport.id/r",We="https://apps.apple.com/us/app/zkpassport/id6477371975",Ye="https://play.google.com/store/apps/details?id=app.zkpassport.zkpassport",ke='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30 30" fill="none" aria-hidden="true"><path d="M15.0417 29.516C23.0399 29.516 29.5237 23.0338 29.5237 15.0378C29.5237 7.04166 23.0399 0.559547 15.0417 0.559547C7.04352 0.559547 0.559692 7.04166 0.559692 15.0378C0.559692 23.0338 7.04352 29.516 15.0417 29.516Z" fill="#2139A3"/><path d="M15.0417 0C23.349 0 30.0834 6.73263 30.0834 15.0377C30.0834 23.3429 23.349 30.0755 15.0417 30.0755C6.73441 30.0755 0 23.3429 0 15.0377C0 6.73263 6.73441 0 15.0417 0ZM15.0417 1.60869C7.62309 1.60869 1.60911 7.62108 1.60911 15.0377C1.60911 22.4544 7.62309 28.4668 15.0417 28.4668C22.4603 28.4668 28.4743 22.4544 28.4743 15.0377C28.4743 7.62108 22.4603 1.60869 15.0417 1.60869ZM15.0592 3.09498C21.6662 3.09498 27.0226 8.44173 27.0226 15.0377C27.0226 21.6338 21.6662 26.9805 15.0592 26.9805C8.45221 26.9805 3.09579 21.6338 3.09579 15.0377C3.09579 8.44173 8.45221 3.09498 15.0592 3.09498ZM9.96458 22.0322L6.92138 22.0322C8.39067 23.7337 10.3865 24.9694 12.6564 25.4872C11.5835 24.7598 10.6605 23.5567 9.96458 22.0322ZM23.197 22.0322L20.1538 22.0322C19.4579 23.5567 18.5349 24.7598 17.4621 25.4874C19.7319 24.9694 21.7277 23.7337 23.197 22.0322ZM14.3421 22.032L11.2161 22.0321C12.0187 23.8592 13.1229 25.1125 14.3421 25.4638L14.3421 22.032ZM18.8674 22.0321L15.7413 22.032L15.7414 25.4638C16.9606 25.1125 18.0648 23.8591 18.8674 22.0321ZM25.7572 15.9821L21.5259 15.982C21.4396 17.8044 21.1057 19.5076 20.5786 20.9831L23.9963 20.983C24.9699 19.5278 25.5963 17.8215 25.7572 15.9821ZM8.59253 15.982L4.36123 15.9821C4.5221 17.8215 5.14847 19.5278 6.1221 20.983L9.53983 20.9831C9.01269 19.5076 8.67877 17.8044 8.59253 15.982ZM20.1638 15.9821L15.7413 15.982V20.9829L19.2733 20.983C19.7636 19.5382 20.0831 17.8314 20.1638 15.9821ZM14.3421 15.982L9.91967 15.9821C10.0003 17.8314 10.3198 19.5382 10.8101 20.983L14.3421 20.9829V15.982ZM24.2843 9.54718L20.7326 9.54709C21.2388 11.1259 21.5307 12.9383 21.5474 14.8629L25.7969 14.8629L25.7969 14.8605C25.7653 12.9205 25.2174 11.1057 24.2843 9.54718ZM9.38584 9.54709L5.83411 9.54718C4.9006 11.1063 4.35262 12.922 4.32152 14.8629L8.57108 14.8629L8.57113 14.8531C8.58872 12.9322 8.88051 11.1232 9.38584 9.54709ZM19.4086 9.54708L15.7413 9.54722V14.8629L20.183 14.8629C20.1655 12.9105 19.8822 11.0944 19.4086 9.54708ZM14.3421 9.54722L10.6748 9.54708C10.2012 11.0944 9.91791 12.9105 9.90041 14.8629L14.3421 14.8629V9.54722ZM17.462 4.5883L17.5252 4.6316C18.6751 5.43583 19.6492 6.78889 20.3507 8.49789H23.5684C22.073 6.56232 19.9294 5.15119 17.462 4.5883ZM12.6563 4.58812L12.6442 4.59108C10.182 5.15582 8.04296 6.5655 6.54996 8.49789H9.76772C10.4821 6.75769 11.479 5.38655 12.6563 4.58812ZM15.7414 4.64663L15.7413 8.49807L19.0424 8.49792C18.2293 6.4439 17.0518 5.02425 15.7414 4.64663ZM11.0411 8.49792L14.3421 8.49807L14.3421 4.64662C13.0317 5.02423 11.8541 6.44388 11.0411 8.49792Z" fill="url(#zkp-mark-grad)"/><defs><linearGradient id="zkp-mark-grad" x1="15.0417" y1="0" x2="15.0417" y2="30.0755" gradientUnits="userSpaceOnUse"><stop stop-color="#F2DCB0"/><stop offset="1" stop-color="#F6D38F"/></linearGradient></defs></svg>',Je=`
1
+ var f8=Object.create;var Ac=Object.defineProperty;var p8=Object.getOwnPropertyDescriptor;var h8=Object.getOwnPropertyNames;var m8=Object.getPrototypeOf,g8=Object.prototype.hasOwnProperty;var y8=(t,e,r)=>e in t?Ac(t,e,{enumerable:true,configurable:true,writable:true,value:r}):t[e]=r;var _e=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(e,r)=>(typeof require<"u"?require:e)[r]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')});var se=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),Vh=(t,e)=>{for(var r in e)Ac(t,r,{get:e[r],enumerable:true});},b8=(t,e,r,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of h8(e))!g8.call(t,n)&&n!==r&&Ac(t,n,{get:()=>e[n],enumerable:!(i=p8(e,n))||i.enumerable});return t};var tt=(t,e,r)=>(r=t!=null?f8(m8(t)):{},b8(e||!t||!t.__esModule?Ac(r,"default",{value:t,enumerable:true}):r,t));var f=(t,e,r)=>y8(t,typeof e!="symbol"?e+"":e,r);var D2=se((E7,N2)=>{N2.exports=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then};});var Ni=se(wn=>{var Nd,P8=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];wn.getSymbolSize=function(e){if(!e)throw new Error('"version" cannot be null or undefined');if(e<1||e>40)throw new Error('"version" should be in range from 1 to 40');return e*4+17};wn.getSymbolTotalCodewords=function(e){return P8[e]};wn.getBCHDigit=function(t){let e=0;for(;t!==0;)e++,t>>>=1;return e};wn.setToSJISFunction=function(e){if(typeof e!="function")throw new Error('"toSJISFunc" is not a valid function.');Nd=e;};wn.isKanjiModeEnabled=function(){return typeof Nd<"u"};wn.toSJIS=function(e){return Nd(e)};});var Fc=se(Ut=>{Ut.L={bit:1};Ut.M={bit:0};Ut.Q={bit:3};Ut.H={bit:2};function N8(t){if(typeof t!="string")throw new Error("Param is not a string");switch(t.toLowerCase()){case "l":case "low":return Ut.L;case "m":case "medium":return Ut.M;case "q":case "quartile":return Ut.Q;case "h":case "high":return Ut.H;default:throw new Error("Unknown EC Level: "+t)}}Ut.isValid=function(e){return e&&typeof e.bit<"u"&&e.bit>=0&&e.bit<4};Ut.from=function(e,r){if(Ut.isValid(e))return e;try{return N8(e)}catch{return r}};});var M2=se((k7,O2)=>{function R2(){this.buffer=[],this.length=0;}R2.prototype={get:function(t){let e=Math.floor(t/8);return (this.buffer[e]>>>7-t%8&1)===1},put:function(t,e){for(let r=0;r<e;r++)this.putBit((t>>>e-r-1&1)===1);},getLengthInBits:function(){return this.length},putBit:function(t){let e=Math.floor(this.length/8);this.buffer.length<=e&&this.buffer.push(0),t&&(this.buffer[e]|=128>>>this.length%8),this.length++;}};O2.exports=R2;});var U2=se((P7,F2)=>{function da(t){if(!t||t<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=t,this.data=new Uint8Array(t*t),this.reservedBit=new Uint8Array(t*t);}da.prototype.set=function(t,e,r,i){let n=t*this.size+e;this.data[n]=r,i&&(this.reservedBit[n]=true);};da.prototype.get=function(t,e){return this.data[t*this.size+e]};da.prototype.xor=function(t,e,r){this.data[t*this.size+e]^=r;};da.prototype.isReserved=function(t,e){return this.reservedBit[t*this.size+e]};F2.exports=da;});var L2=se(Uc=>{var D8=Ni().getSymbolSize;Uc.getRowColCoords=function(e){if(e===1)return [];let r=Math.floor(e/7)+2,i=D8(e),n=i===145?26:Math.ceil((i-13)/(2*r-2))*2,o=[i-7];for(let s=1;s<r-1;s++)o[s]=o[s-1]-n;return o.push(6),o.reverse()};Uc.getPositions=function(e){let r=[],i=Uc.getRowColCoords(e),n=i.length;for(let o=0;o<n;o++)for(let s=0;s<n;s++)o===0&&s===0||o===0&&s===n-1||o===n-1&&s===0||r.push([i[o],i[s]]);return r};});var q2=se(K2=>{var R8=Ni().getSymbolSize,H2=7;K2.getPositions=function(e){let r=R8(e);return [[0,0],[r-H2,0],[0,r-H2]]};});var G2=se(we=>{we.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};var In={N1:3,N2:3,N3:40,N4:10};we.isValid=function(e){return e!=null&&e!==""&&!isNaN(e)&&e>=0&&e<=7};we.from=function(e){return we.isValid(e)?parseInt(e,10):void 0};we.getPenaltyN1=function(e){let r=e.size,i=0,n=0,o=0,s=null,a=null;for(let l=0;l<r;l++){n=o=0,s=a=null;for(let c=0;c<r;c++){let d=e.get(l,c);d===s?n++:(n>=5&&(i+=In.N1+(n-5)),s=d,n=1),d=e.get(c,l),d===a?o++:(o>=5&&(i+=In.N1+(o-5)),a=d,o=1);}n>=5&&(i+=In.N1+(n-5)),o>=5&&(i+=In.N1+(o-5));}return i};we.getPenaltyN2=function(e){let r=e.size,i=0;for(let n=0;n<r-1;n++)for(let o=0;o<r-1;o++){let s=e.get(n,o)+e.get(n,o+1)+e.get(n+1,o)+e.get(n+1,o+1);(s===4||s===0)&&i++;}return i*In.N2};we.getPenaltyN3=function(e){let r=e.size,i=0,n=0,o=0;for(let s=0;s<r;s++){n=o=0;for(let a=0;a<r;a++)n=n<<1&2047|e.get(s,a),a>=10&&(n===1488||n===93)&&i++,o=o<<1&2047|e.get(a,s),a>=10&&(o===1488||o===93)&&i++;}return i*In.N3};we.getPenaltyN4=function(e){let r=0,i=e.data.length;for(let o=0;o<i;o++)r+=e.data[o];return Math.abs(Math.ceil(r*100/i/5)-10)*In.N4};function O8(t,e,r){switch(t){case we.Patterns.PATTERN000:return (e+r)%2===0;case we.Patterns.PATTERN001:return e%2===0;case we.Patterns.PATTERN010:return r%3===0;case we.Patterns.PATTERN011:return (e+r)%3===0;case we.Patterns.PATTERN100:return (Math.floor(e/2)+Math.floor(r/3))%2===0;case we.Patterns.PATTERN101:return e*r%2+e*r%3===0;case we.Patterns.PATTERN110:return (e*r%2+e*r%3)%2===0;case we.Patterns.PATTERN111:return (e*r%3+(e+r)%2)%2===0;default:throw new Error("bad maskPattern:"+t)}}we.applyMask=function(e,r){let i=r.size;for(let n=0;n<i;n++)for(let o=0;o<i;o++)r.isReserved(o,n)||r.xor(o,n,O8(e,o,n));};we.getBestMask=function(e,r){let i=Object.keys(we.Patterns).length,n=0,o=1/0;for(let s=0;s<i;s++){r(s),we.applyMask(s,e);let a=we.getPenaltyN1(e)+we.getPenaltyN2(e)+we.getPenaltyN3(e)+we.getPenaltyN4(e);we.applyMask(s,e),a<o&&(o=a,n=s);}return n};});var Rd=se(Dd=>{var Di=Fc(),Lc=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],Hc=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];Dd.getBlocksCount=function(e,r){switch(r){case Di.L:return Lc[(e-1)*4+0];case Di.M:return Lc[(e-1)*4+1];case Di.Q:return Lc[(e-1)*4+2];case Di.H:return Lc[(e-1)*4+3];default:return}};Dd.getTotalCodewordsCount=function(e,r){switch(r){case Di.L:return Hc[(e-1)*4+0];case Di.M:return Hc[(e-1)*4+1];case Di.Q:return Hc[(e-1)*4+2];case Di.H:return Hc[(e-1)*4+3];default:return}};});var z2=se(qc=>{var ua=new Uint8Array(512),Kc=new Uint8Array(256);(function(){let e=1;for(let r=0;r<255;r++)ua[r]=e,Kc[e]=r,e<<=1,e&256&&(e^=285);for(let r=255;r<512;r++)ua[r]=ua[r-255];})();qc.log=function(e){if(e<1)throw new Error("log("+e+")");return Kc[e]};qc.exp=function(e){return ua[e]};qc.mul=function(e,r){return e===0||r===0?0:ua[Kc[e]+Kc[r]]};});var $2=se(fa=>{var Od=z2();fa.mul=function(e,r){let i=new Uint8Array(e.length+r.length-1);for(let n=0;n<e.length;n++)for(let o=0;o<r.length;o++)i[n+o]^=Od.mul(e[n],r[o]);return i};fa.mod=function(e,r){let i=new Uint8Array(e);for(;i.length-r.length>=0;){let n=i[0];for(let s=0;s<r.length;s++)i[s]^=Od.mul(r[s],n);let o=0;for(;o<i.length&&i[o]===0;)o++;i=i.slice(o);}return i};fa.generateECPolynomial=function(e){let r=new Uint8Array([1]);for(let i=0;i<e;i++)r=fa.mul(r,new Uint8Array([1,Od.exp(i)]));return r};});var X2=se((U7,j2)=>{var V2=$2();function Md(t){this.genPoly=void 0,this.degree=t,this.degree&&this.initialize(this.degree);}Md.prototype.initialize=function(e){this.degree=e,this.genPoly=V2.generateECPolynomial(this.degree);};Md.prototype.encode=function(e){if(!this.genPoly)throw new Error("Encoder not initialized");let r=new Uint8Array(e.length+this.degree);r.set(e);let i=V2.mod(r,this.genPoly),n=this.degree-i.length;if(n>0){let o=new Uint8Array(this.degree);return o.set(i,n),o}return i};j2.exports=Md;});var Fd=se(W2=>{W2.isValid=function(e){return !isNaN(e)&&e>=1&&e<=40};});var Ud=se(ei=>{var Z2="[0-9]+",M8="[A-Z $%*+\\-./:]+",pa="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";pa=pa.replace(/u/g,"\\u");var F8="(?:(?![A-Z0-9 $%*+\\-./:]|"+pa+`)(?:.|[\r
2
+ ]))+`;ei.KANJI=new RegExp(pa,"g");ei.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g");ei.BYTE=new RegExp(F8,"g");ei.NUMERIC=new RegExp(Z2,"g");ei.ALPHANUMERIC=new RegExp(M8,"g");var U8=new RegExp("^"+pa+"$"),L8=new RegExp("^"+Z2+"$"),H8=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");ei.testKanji=function(e){return U8.test(e)};ei.testNumeric=function(e){return L8.test(e)};ei.testAlphanumeric=function(e){return H8.test(e)};});var Ri=se(Ne=>{var K8=Fd(),Ld=Ud();Ne.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]};Ne.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]};Ne.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]};Ne.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]};Ne.MIXED={bit:-1};Ne.getCharCountIndicator=function(e,r){if(!e.ccBits)throw new Error("Invalid mode: "+e);if(!K8.isValid(r))throw new Error("Invalid version: "+r);return r>=1&&r<10?e.ccBits[0]:r<27?e.ccBits[1]:e.ccBits[2]};Ne.getBestModeForData=function(e){return Ld.testNumeric(e)?Ne.NUMERIC:Ld.testAlphanumeric(e)?Ne.ALPHANUMERIC:Ld.testKanji(e)?Ne.KANJI:Ne.BYTE};Ne.toString=function(e){if(e&&e.id)return e.id;throw new Error("Invalid mode")};Ne.isValid=function(e){return e&&e.bit&&e.ccBits};function q8(t){if(typeof t!="string")throw new Error("Param is not a string");switch(t.toLowerCase()){case "numeric":return Ne.NUMERIC;case "alphanumeric":return Ne.ALPHANUMERIC;case "kanji":return Ne.KANJI;case "byte":return Ne.BYTE;default:throw new Error("Unknown mode: "+t)}}Ne.from=function(e,r){if(Ne.isValid(e))return e;try{return q8(e)}catch{return r}};});var tm=se(vn=>{var Gc=Ni(),G8=Rd(),Y2=Fc(),Oi=Ri(),Hd=Fd(),J2=7973,Q2=Gc.getBCHDigit(J2);function z8(t,e,r){for(let i=1;i<=40;i++)if(e<=vn.getCapacity(i,r,t))return i}function em(t,e){return Oi.getCharCountIndicator(t,e)+4}function $8(t,e){let r=0;return t.forEach(function(i){let n=em(i.mode,e);r+=n+i.getBitsLength();}),r}function V8(t,e){for(let r=1;r<=40;r++)if($8(t,r)<=vn.getCapacity(r,e,Oi.MIXED))return r}vn.from=function(e,r){return Hd.isValid(e)?parseInt(e,10):r};vn.getCapacity=function(e,r,i){if(!Hd.isValid(e))throw new Error("Invalid QR Code version");typeof i>"u"&&(i=Oi.BYTE);let n=Gc.getSymbolTotalCodewords(e),o=G8.getTotalCodewordsCount(e,r),s=(n-o)*8;if(i===Oi.MIXED)return s;let a=s-em(i,e);switch(i){case Oi.NUMERIC:return Math.floor(a/10*3);case Oi.ALPHANUMERIC:return Math.floor(a/11*2);case Oi.KANJI:return Math.floor(a/13);case Oi.BYTE:default:return Math.floor(a/8)}};vn.getBestVersionForData=function(e,r){let i,n=Y2.from(r,Y2.M);if(Array.isArray(e)){if(e.length>1)return V8(e,n);if(e.length===0)return 1;i=e[0];}else i=e;return z8(i.mode,i.getLength(),n)};vn.getEncodedBits=function(e){if(!Hd.isValid(e)||e<7)throw new Error("Invalid QR Code version");let r=e<<12;for(;Gc.getBCHDigit(r)-Q2>=0;)r^=J2<<Gc.getBCHDigit(r)-Q2;return e<<12|r};});var om=se(nm=>{var Kd=Ni(),im=1335,j8=21522,rm=Kd.getBCHDigit(im);nm.getEncodedBits=function(e,r){let i=e.bit<<3|r,n=i<<10;for(;Kd.getBCHDigit(n)-rm>=0;)n^=im<<Kd.getBCHDigit(n)-rm;return (i<<10|n)^j8};});var am=se((z7,sm)=>{var X8=Ri();function Lo(t){this.mode=X8.NUMERIC,this.data=t.toString();}Lo.getBitsLength=function(e){return 10*Math.floor(e/3)+(e%3?e%3*3+1:0)};Lo.prototype.getLength=function(){return this.data.length};Lo.prototype.getBitsLength=function(){return Lo.getBitsLength(this.data.length)};Lo.prototype.write=function(e){let r,i,n;for(r=0;r+3<=this.data.length;r+=3)i=this.data.substr(r,3),n=parseInt(i,10),e.put(n,10);let o=this.data.length-r;o>0&&(i=this.data.substr(r),n=parseInt(i,10),e.put(n,o*3+1));};sm.exports=Lo;});var lm=se(($7,cm)=>{var W8=Ri(),qd=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];function Ho(t){this.mode=W8.ALPHANUMERIC,this.data=t;}Ho.getBitsLength=function(e){return 11*Math.floor(e/2)+6*(e%2)};Ho.prototype.getLength=function(){return this.data.length};Ho.prototype.getBitsLength=function(){return Ho.getBitsLength(this.data.length)};Ho.prototype.write=function(e){let r;for(r=0;r+2<=this.data.length;r+=2){let i=qd.indexOf(this.data[r])*45;i+=qd.indexOf(this.data[r+1]),e.put(i,11);}this.data.length%2&&e.put(qd.indexOf(this.data[r]),6);};cm.exports=Ho;});var um=se((V7,dm)=>{var Z8=Ri();function Ko(t){this.mode=Z8.BYTE,typeof t=="string"?this.data=new TextEncoder().encode(t):this.data=new Uint8Array(t);}Ko.getBitsLength=function(e){return e*8};Ko.prototype.getLength=function(){return this.data.length};Ko.prototype.getBitsLength=function(){return Ko.getBitsLength(this.data.length)};Ko.prototype.write=function(t){for(let e=0,r=this.data.length;e<r;e++)t.put(this.data[e],8);};dm.exports=Ko;});var pm=se((j7,fm)=>{var Y8=Ri(),Q8=Ni();function qo(t){this.mode=Y8.KANJI,this.data=t;}qo.getBitsLength=function(e){return e*13};qo.prototype.getLength=function(){return this.data.length};qo.prototype.getBitsLength=function(){return qo.getBitsLength(this.data.length)};qo.prototype.write=function(t){let e;for(e=0;e<this.data.length;e++){let r=Q8.toSJIS(this.data[e]);if(r>=33088&&r<=40956)r-=33088;else if(r>=57408&&r<=60351)r-=49472;else throw new Error("Invalid SJIS character: "+this.data[e]+`
3
+ Make sure your charset is UTF-8`);r=(r>>>8&255)*192+(r&255),t.put(r,13);}};fm.exports=qo;});var hm=se((X7,Gd)=>{var ha={single_source_shortest_paths:function(t,e,r){var i={},n={};n[e]=0;var o=ha.PriorityQueue.make();o.push(e,0);for(var s,a,l,c,d,u,h,y,b;!o.empty();){s=o.pop(),a=s.value,c=s.cost,d=t[a]||{};for(l in d)d.hasOwnProperty(l)&&(u=d[l],h=c+u,y=n[l],b=typeof n[l]>"u",(b||y>h)&&(n[l]=h,o.push(l,h),i[l]=a));}if(typeof r<"u"&&typeof n[r]>"u"){var x=["Could not find a path from ",e," to ",r,"."].join("");throw new Error(x)}return i},extract_shortest_path_from_predecessor_list:function(t,e){for(var r=[],i=e,n;i;)r.push(i),n=t[i],i=t[i];return r.reverse(),r},find_path:function(t,e,r){var i=ha.single_source_shortest_paths(t,e,r);return ha.extract_shortest_path_from_predecessor_list(i,r)},PriorityQueue:{make:function(t){var e=ha.PriorityQueue,r={},i;t=t||{};for(i in e)e.hasOwnProperty(i)&&(r[i]=e[i]);return r.queue=[],r.sorter=t.sorter||e.default_sorter,r},default_sorter:function(t,e){return t.cost-e.cost},push:function(t,e){var r={value:t,cost:e};this.queue.push(r),this.queue.sort(this.sorter);},pop:function(){return this.queue.shift()},empty:function(){return this.queue.length===0}}};typeof Gd<"u"&&(Gd.exports=ha);});var _m=se(Go=>{var be=Ri(),ym=am(),bm=lm(),Sm=um(),xm=pm(),ma=Ud(),zc=Ni(),J8=hm();function mm(t){return unescape(encodeURIComponent(t)).length}function ga(t,e,r){let i=[],n;for(;(n=t.exec(r))!==null;)i.push({data:n[0],index:n.index,mode:e,length:n[0].length});return i}function Am(t){let e=ga(ma.NUMERIC,be.NUMERIC,t),r=ga(ma.ALPHANUMERIC,be.ALPHANUMERIC,t),i,n;return zc.isKanjiModeEnabled()?(i=ga(ma.BYTE,be.BYTE,t),n=ga(ma.KANJI,be.KANJI,t)):(i=ga(ma.BYTE_KANJI,be.BYTE,t),n=[]),e.concat(r,i,n).sort(function(s,a){return s.index-a.index}).map(function(s){return {data:s.data,mode:s.mode,length:s.length}})}function zd(t,e){switch(e){case be.NUMERIC:return ym.getBitsLength(t);case be.ALPHANUMERIC:return bm.getBitsLength(t);case be.KANJI:return xm.getBitsLength(t);case be.BYTE:return Sm.getBitsLength(t)}}function eS(t){return t.reduce(function(e,r){let i=e.length-1>=0?e[e.length-1]:null;return i&&i.mode===r.mode?(e[e.length-1].data+=r.data,e):(e.push(r),e)},[])}function tS(t){let e=[];for(let r=0;r<t.length;r++){let i=t[r];switch(i.mode){case be.NUMERIC:e.push([i,{data:i.data,mode:be.ALPHANUMERIC,length:i.length},{data:i.data,mode:be.BYTE,length:i.length}]);break;case be.ALPHANUMERIC:e.push([i,{data:i.data,mode:be.BYTE,length:i.length}]);break;case be.KANJI:e.push([i,{data:i.data,mode:be.BYTE,length:mm(i.data)}]);break;case be.BYTE:e.push([{data:i.data,mode:be.BYTE,length:mm(i.data)}]);}}return e}function rS(t,e){let r={},i={start:{}},n=["start"];for(let o=0;o<t.length;o++){let s=t[o],a=[];for(let l=0;l<s.length;l++){let c=s[l],d=""+o+l;a.push(d),r[d]={node:c,lastCount:0},i[d]={};for(let u=0;u<n.length;u++){let h=n[u];r[h]&&r[h].node.mode===c.mode?(i[h][d]=zd(r[h].lastCount+c.length,c.mode)-zd(r[h].lastCount,c.mode),r[h].lastCount+=c.length):(r[h]&&(r[h].lastCount=c.length),i[h][d]=zd(c.length,c.mode)+4+be.getCharCountIndicator(c.mode,e));}}n=a;}for(let o=0;o<n.length;o++)i[n[o]].end=0;return {map:i,table:r}}function gm(t,e){let r,i=be.getBestModeForData(t);if(r=be.from(e,i),r!==be.BYTE&&r.bit<i.bit)throw new Error('"'+t+'" cannot be encoded with mode '+be.toString(r)+`.
4
+ Suggested mode is: `+be.toString(i));switch(r===be.KANJI&&!zc.isKanjiModeEnabled()&&(r=be.BYTE),r){case be.NUMERIC:return new ym(t);case be.ALPHANUMERIC:return new bm(t);case be.KANJI:return new xm(t);case be.BYTE:return new Sm(t)}}Go.fromArray=function(e){return e.reduce(function(r,i){return typeof i=="string"?r.push(gm(i,null)):i.data&&r.push(gm(i.data,i.mode)),r},[])};Go.fromString=function(e,r){let i=Am(e,zc.isKanjiModeEnabled()),n=tS(i),o=rS(n,r),s=J8.find_path(o.map,"start","end"),a=[];for(let l=1;l<s.length-1;l++)a.push(o.table[s[l]].node);return Go.fromArray(eS(a))};Go.rawSplit=function(e){return Go.fromArray(Am(e,zc.isKanjiModeEnabled()))};});var wm=se(Cm=>{var Vc=Ni(),$d=Fc(),iS=M2(),nS=U2(),oS=L2(),sS=q2(),Xd=G2(),Wd=Rd(),aS=X2(),$c=tm(),cS=om(),lS=Ri(),Vd=_m();function dS(t,e){let r=t.size,i=sS.getPositions(e);for(let n=0;n<i.length;n++){let o=i[n][0],s=i[n][1];for(let a=-1;a<=7;a++)if(!(o+a<=-1||r<=o+a))for(let l=-1;l<=7;l++)s+l<=-1||r<=s+l||(a>=0&&a<=6&&(l===0||l===6)||l>=0&&l<=6&&(a===0||a===6)||a>=2&&a<=4&&l>=2&&l<=4?t.set(o+a,s+l,true,true):t.set(o+a,s+l,false,true));}}function uS(t){let e=t.size;for(let r=8;r<e-8;r++){let i=r%2===0;t.set(r,6,i,true),t.set(6,r,i,true);}}function fS(t,e){let r=oS.getPositions(e);for(let i=0;i<r.length;i++){let n=r[i][0],o=r[i][1];for(let s=-2;s<=2;s++)for(let a=-2;a<=2;a++)s===-2||s===2||a===-2||a===2||s===0&&a===0?t.set(n+s,o+a,true,true):t.set(n+s,o+a,false,true);}}function pS(t,e){let r=t.size,i=$c.getEncodedBits(e),n,o,s;for(let a=0;a<18;a++)n=Math.floor(a/3),o=a%3+r-8-3,s=(i>>a&1)===1,t.set(n,o,s,true),t.set(o,n,s,true);}function jd(t,e,r){let i=t.size,n=cS.getEncodedBits(e,r),o,s;for(o=0;o<15;o++)s=(n>>o&1)===1,o<6?t.set(o,8,s,true):o<8?t.set(o+1,8,s,true):t.set(i-15+o,8,s,true),o<8?t.set(8,i-o-1,s,true):o<9?t.set(8,15-o-1+1,s,true):t.set(8,15-o-1,s,true);t.set(i-8,8,1,true);}function hS(t,e){let r=t.size,i=-1,n=r-1,o=7,s=0;for(let a=r-1;a>0;a-=2)for(a===6&&a--;;){for(let l=0;l<2;l++)if(!t.isReserved(n,a-l)){let c=false;s<e.length&&(c=(e[s]>>>o&1)===1),t.set(n,a-l,c),o--,o===-1&&(s++,o=7);}if(n+=i,n<0||r<=n){n-=i,i=-i;break}}}function mS(t,e,r){let i=new iS;r.forEach(function(l){i.put(l.mode.bit,4),i.put(l.getLength(),lS.getCharCountIndicator(l.mode,t)),l.write(i);});let n=Vc.getSymbolTotalCodewords(t),o=Wd.getTotalCodewordsCount(t,e),s=(n-o)*8;for(i.getLengthInBits()+4<=s&&i.put(0,4);i.getLengthInBits()%8!==0;)i.putBit(0);let a=(s-i.getLengthInBits())/8;for(let l=0;l<a;l++)i.put(l%2?17:236,8);return gS(i,t,e)}function gS(t,e,r){let i=Vc.getSymbolTotalCodewords(e),n=Wd.getTotalCodewordsCount(e,r),o=i-n,s=Wd.getBlocksCount(e,r),a=i%s,l=s-a,c=Math.floor(i/s),d=Math.floor(o/s),u=d+1,h=c-d,y=new aS(h),b=0,x=new Array(s),m=new Array(s),A=0,_=new Uint8Array(t.buffer);for(let O=0;O<s;O++){let U=O<l?d:u;x[O]=_.slice(b,b+U),m[O]=y.encode(x[O]),b+=U,A=Math.max(A,U);}let w=new Uint8Array(i),I=0,N,H;for(N=0;N<A;N++)for(H=0;H<s;H++)N<x[H].length&&(w[I++]=x[H][N]);for(N=0;N<h;N++)for(H=0;H<s;H++)w[I++]=m[H][N];return w}function yS(t,e,r,i){let n;if(Array.isArray(t))n=Vd.fromArray(t);else if(typeof t=="string"){let c=e;if(!c){let d=Vd.rawSplit(t);c=$c.getBestVersionForData(d,r);}n=Vd.fromString(t,c||40);}else throw new Error("Invalid data");let o=$c.getBestVersionForData(n,r);if(!o)throw new Error("The amount of data is too big to be stored in a QR Code");if(!e)e=o;else if(e<o)throw new Error(`
5
+ The chosen QR Code version cannot contain this amount of data.
6
+ Minimum version required to store current data is: `+o+`.
7
+ `);let s=mS(e,r,n),a=Vc.getSymbolSize(e),l=new nS(a);return dS(l,e),uS(l),fS(l,e),jd(l,r,0),e>=7&&pS(l,e),hS(l,s),isNaN(i)&&(i=Xd.getBestMask(l,jd.bind(null,l,r))),Xd.applyMask(i,l),jd(l,r,i),{modules:l,version:e,errorCorrectionLevel:r,maskPattern:i,segments:n}}Cm.create=function(e,r){if(typeof e>"u"||e==="")throw new Error("No input text");let i=$d.M,n,o;return typeof r<"u"&&(i=$d.from(r.errorCorrectionLevel,$d.M),n=$c.from(r.version),o=Xd.from(r.maskPattern),r.toSJISFunc&&Vc.setToSJISFunction(r.toSJISFunc)),yS(e,n,i,o)};});var Zd=se(En=>{function Im(t){if(typeof t=="number"&&(t=t.toString()),typeof t!="string")throw new Error("Color should be defined as hex string");let e=t.slice().replace("#","").split("");if(e.length<3||e.length===5||e.length>8)throw new Error("Invalid hex color: "+t);(e.length===3||e.length===4)&&(e=Array.prototype.concat.apply([],e.map(function(i){return [i,i]}))),e.length===6&&e.push("F","F");let r=parseInt(e.join(""),16);return {r:r>>24&255,g:r>>16&255,b:r>>8&255,a:r&255,hex:"#"+e.slice(0,6).join("")}}En.getOptions=function(e){e||(e={}),e.color||(e.color={});let r=typeof e.margin>"u"||e.margin===null||e.margin<0?4:e.margin,i=e.width&&e.width>=21?e.width:void 0,n=e.scale||4;return {width:i,scale:i?4:n,margin:r,color:{dark:Im(e.color.dark||"#000000ff"),light:Im(e.color.light||"#ffffffff")},type:e.type,rendererOpts:e.rendererOpts||{}}};En.getScale=function(e,r){return r.width&&r.width>=e+r.margin*2?r.width/(e+r.margin*2):r.scale};En.getImageWidth=function(e,r){let i=En.getScale(e,r);return Math.floor((e+r.margin*2)*i)};En.qrToImageData=function(e,r,i){let n=r.modules.size,o=r.modules.data,s=En.getScale(n,i),a=Math.floor((n+i.margin*2)*s),l=i.margin*s,c=[i.color.light,i.color.dark];for(let d=0;d<a;d++)for(let u=0;u<a;u++){let h=(d*a+u)*4,y=i.color.light;if(d>=l&&u>=l&&d<a-l&&u<a-l){let b=Math.floor((d-l)/s),x=Math.floor((u-l)/s);y=c[o[b*n+x]?1:0];}e[h++]=y.r,e[h++]=y.g,e[h++]=y.b,e[h]=y.a;}};});var vm=se(jc=>{var Yd=Zd();function bS(t,e,r){t.clearRect(0,0,e.width,e.height),e.style||(e.style={}),e.height=r,e.width=r,e.style.height=r+"px",e.style.width=r+"px";}function SS(){try{return document.createElement("canvas")}catch{throw new Error("You need to specify a canvas element")}}jc.render=function(e,r,i){let n=i,o=r;typeof n>"u"&&(!r||!r.getContext)&&(n=r,r=void 0),r||(o=SS()),n=Yd.getOptions(n);let s=Yd.getImageWidth(e.modules.size,n),a=o.getContext("2d"),l=a.createImageData(s,s);return Yd.qrToImageData(l.data,e,n),bS(a,o,s),a.putImageData(l,0,0),o};jc.renderToDataURL=function(e,r,i){let n=i;typeof n>"u"&&(!r||!r.getContext)&&(n=r,r=void 0),n||(n={});let o=jc.render(e,r,n),s=n.type||"image/png",a=n.rendererOpts||{};return o.toDataURL(s,a.quality)};});var Tm=se(Bm=>{var xS=Zd();function Em(t,e){let r=t.a/255,i=e+'="'+t.hex+'"';return r<1?i+" "+e+'-opacity="'+r.toFixed(2).slice(1)+'"':i}function Qd(t,e,r){let i=t+e;return typeof r<"u"&&(i+=" "+r),i}function AS(t,e,r){let i="",n=0,o=false,s=0;for(let a=0;a<t.length;a++){let l=Math.floor(a%e),c=Math.floor(a/e);!l&&!o&&(o=true),t[a]?(s++,a>0&&l>0&&t[a-1]||(i+=o?Qd("M",l+r,.5+c+r):Qd("m",n,0),n=0,o=false),l+1<e&&t[a+1]||(i+=Qd("h",s),s=0)):n++;}return i}Bm.render=function(e,r,i){let n=xS.getOptions(r),o=e.modules.size,s=e.modules.data,a=o+n.margin*2,l=n.color.light.a?"<path "+Em(n.color.light,"fill")+' d="M0 0h'+a+"v"+a+'H0z"/>':"",c="<path "+Em(n.color.dark,"stroke")+' d="'+AS(s,o,n.margin)+'"/>',d='viewBox="0 0 '+a+" "+a+'"',h='<svg xmlns="http://www.w3.org/2000/svg" '+(n.width?'width="'+n.width+'" height="'+n.width+'" ':"")+d+' shape-rendering="crispEdges">'+l+c+`</svg>
8
+ `;return typeof i=="function"&&i(null,h),h};});var Pm=se(ya=>{var _S=D2(),Jd=wm(),km=vm(),CS=Tm();function eu(t,e,r,i,n){let o=[].slice.call(arguments,1),s=o.length,a=typeof o[s-1]=="function";if(!a&&!_S())throw new Error("Callback required as last argument");if(a){if(s<2)throw new Error("Too few arguments provided");s===2?(n=r,r=e,e=i=void 0):s===3&&(e.getContext&&typeof n>"u"?(n=i,i=void 0):(n=i,i=r,r=e,e=void 0));}else {if(s<1)throw new Error("Too few arguments provided");return s===1?(r=e,e=i=void 0):s===2&&!e.getContext&&(i=r,r=e,e=void 0),new Promise(function(l,c){try{let d=Jd.create(r,i);l(t(d,e,i));}catch(d){c(d);}})}try{let l=Jd.create(r,i);n(null,t(l,e,i));}catch(l){n(l);}}ya.create=Jd.create;ya.toCanvas=eu.bind(null,km.render);ya.toDataURL=eu.bind(null,km.renderToDataURL);ya.toString=eu.bind(null,function(t,e,r){return CS.render(t,r)});});var wg=se(es=>{var ex="[object ArrayBuffer]",oi=class t{static isArrayBuffer(e){return Object.prototype.toString.call(e)===ex}static toArrayBuffer(e){return this.isArrayBuffer(e)?e:e.byteLength===e.buffer.byteLength||e.byteOffset===0&&e.byteLength===e.buffer.byteLength?e.buffer:this.toUint8Array(e.buffer).slice(e.byteOffset,e.byteOffset+e.byteLength).buffer}static toUint8Array(e){return this.toView(e,Uint8Array)}static toView(e,r){if(e.constructor===r)return e;if(this.isArrayBuffer(e))return new r(e);if(this.isArrayBufferView(e))return new r(e.buffer,e.byteOffset,e.byteLength);throw new TypeError("The provided value is not of type '(ArrayBuffer or ArrayBufferView)'")}static isBufferSource(e){return this.isArrayBufferView(e)||this.isArrayBuffer(e)}static isArrayBufferView(e){return ArrayBuffer.isView(e)||e&&this.isArrayBuffer(e.buffer)}static isEqual(e,r){let i=t.toUint8Array(e),n=t.toUint8Array(r);if(i.length!==n.byteLength)return false;for(let o=0;o<i.length;o++)if(i[o]!==n[o])return false;return true}static concat(...e){let r;Array.isArray(e[0])&&!(e[1]instanceof Function)||Array.isArray(e[0])&&e[1]instanceof Function?r=e[0]:e[e.length-1]instanceof Function?r=e.slice(0,e.length-1):r=e;let i=0;for(let s of r)i+=s.byteLength;let n=new Uint8Array(i),o=0;for(let s of r){let a=this.toUint8Array(s);n.set(a,o),o+=a.length;}return e[e.length-1]instanceof Function?this.toView(n,e[e.length-1]):n.buffer}},vu="string",tx=/^[0-9a-f\s]+$/i,rx=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/,ix=/^[a-zA-Z0-9-_]+$/,p1=class{static fromString(e){let r=unescape(encodeURIComponent(e)),i=new Uint8Array(r.length);for(let n=0;n<r.length;n++)i[n]=r.charCodeAt(n);return i.buffer}static toString(e){let r=oi.toUint8Array(e),i="";for(let o=0;o<r.length;o++)i+=String.fromCharCode(r[o]);return decodeURIComponent(escape(i))}},Ht=class{static toString(e,r=false){let i=oi.toArrayBuffer(e),n=new DataView(i),o="";for(let s=0;s<i.byteLength;s+=2){let a=n.getUint16(s,r);o+=String.fromCharCode(a);}return o}static fromString(e,r=false){let i=new ArrayBuffer(e.length*2),n=new DataView(i);for(let o=0;o<e.length;o++)n.setUint16(o*2,e.charCodeAt(o),r);return i}},h1=class t{static isHex(e){return typeof e===vu&&tx.test(e)}static isBase64(e){return typeof e===vu&&rx.test(e)}static isBase64Url(e){return typeof e===vu&&ix.test(e)}static ToString(e,r="utf8"){let i=oi.toUint8Array(e);switch(r.toLowerCase()){case "utf8":return this.ToUtf8String(i);case "binary":return this.ToBinary(i);case "hex":return this.ToHex(i);case "base64":return this.ToBase64(i);case "base64url":return this.ToBase64Url(i);case "utf16le":return Ht.toString(i,true);case "utf16":case "utf16be":return Ht.toString(i);default:throw new Error(`Unknown type of encoding '${r}'`)}}static FromString(e,r="utf8"){if(!e)return new ArrayBuffer(0);switch(r.toLowerCase()){case "utf8":return this.FromUtf8String(e);case "binary":return this.FromBinary(e);case "hex":return this.FromHex(e);case "base64":return this.FromBase64(e);case "base64url":return this.FromBase64Url(e);case "utf16le":return Ht.fromString(e,true);case "utf16":case "utf16be":return Ht.fromString(e);default:throw new Error(`Unknown type of encoding '${r}'`)}}static ToBase64(e){let r=oi.toUint8Array(e);if(typeof btoa<"u"){let i=this.ToString(r,"binary");return btoa(i)}else return Buffer.from(r).toString("base64")}static FromBase64(e){let r=this.formatString(e);if(!r)return new ArrayBuffer(0);if(!t.isBase64(r))throw new TypeError("Argument 'base64Text' is not Base64 encoded");return typeof atob<"u"?this.FromBinary(atob(r)):new Uint8Array(Buffer.from(r,"base64")).buffer}static FromBase64Url(e){let r=this.formatString(e);if(!r)return new ArrayBuffer(0);if(!t.isBase64Url(r))throw new TypeError("Argument 'base64url' is not Base64Url encoded");return this.FromBase64(this.Base64Padding(r.replace(/\-/g,"+").replace(/\_/g,"/")))}static ToBase64Url(e){return this.ToBase64(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/\=/g,"")}static FromUtf8String(e,r=t.DEFAULT_UTF8_ENCODING){switch(r){case "ascii":return this.FromBinary(e);case "utf8":return p1.fromString(e);case "utf16":case "utf16be":return Ht.fromString(e);case "utf16le":case "usc2":return Ht.fromString(e,true);default:throw new Error(`Unknown type of encoding '${r}'`)}}static ToUtf8String(e,r=t.DEFAULT_UTF8_ENCODING){switch(r){case "ascii":return this.ToBinary(e);case "utf8":return p1.toString(e);case "utf16":case "utf16be":return Ht.toString(e);case "utf16le":case "usc2":return Ht.toString(e,true);default:throw new Error(`Unknown type of encoding '${r}'`)}}static FromBinary(e){let r=e.length,i=new Uint8Array(r);for(let n=0;n<r;n++)i[n]=e.charCodeAt(n);return i.buffer}static ToBinary(e){let r=oi.toUint8Array(e),i="";for(let n=0;n<r.length;n++)i+=String.fromCharCode(r[n]);return i}static ToHex(e){let r=oi.toUint8Array(e),i="",n=r.length;for(let o=0;o<n;o++){let s=r[o];s<16&&(i+="0"),i+=s.toString(16);}return i}static FromHex(e){let r=this.formatString(e);if(!r)return new ArrayBuffer(0);if(!t.isHex(r))throw new TypeError("Argument 'hexString' is not HEX encoded");r.length%2&&(r=`0${r}`);let i=new Uint8Array(r.length/2);for(let n=0;n<r.length;n=n+2){let o=r.slice(n,n+2);i[n/2]=parseInt(o,16);}return i.buffer}static ToUtf16String(e,r=false){return Ht.toString(e,r)}static FromUtf16String(e,r=false){return Ht.fromString(e,r)}static Base64Padding(e){let r=4-e.length%4;if(r<4)for(let i=0;i<r;i++)e+="=";return e}static formatString(e){return e?.replace(/[\n\r\t ]/g,"")||""}};h1.DEFAULT_UTF8_ENCODING="utf8";function nx(t,...e){let r=arguments[0];for(let i=1;i<arguments.length;i++){let n=arguments[i];for(let o in n)r[o]=n[o];}return r}function ox(...t){let e=t.map(n=>n.byteLength).reduce((n,o)=>n+o),r=new Uint8Array(e),i=0;return t.map(n=>new Uint8Array(n)).forEach(n=>{for(let o of n)r[i++]=o;}),r.buffer}function sx(t,e){if(!(t&&e)||t.byteLength!==e.byteLength)return false;let r=new Uint8Array(t),i=new Uint8Array(e);for(let n=0;n<t.byteLength;n++)if(r[n]!==i[n])return false;return true}es.BufferSourceConverter=oi;es.Convert=h1;es.assign=nx;es.combine=ox;es.isEqual=sx;});var Gy=se($1=>{$1.byteLength=CA;$1.toByteArray=IA;$1.fromByteArray=BA;var qr=[],Zt=[],_A=typeof Uint8Array<"u"?Uint8Array:Array,uf="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(so=0,Ky=uf.length;so<Ky;++so)qr[so]=uf[so],Zt[uf.charCodeAt(so)]=so;var so,Ky;Zt[45]=62;Zt[95]=63;function qy(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");r===-1&&(r=e);var i=r===e?0:4-r%4;return [r,i]}function CA(t){var e=qy(t),r=e[0],i=e[1];return (r+i)*3/4-i}function wA(t,e,r){return (e+r)*3/4-r}function IA(t){var e,r=qy(t),i=r[0],n=r[1],o=new _A(wA(t,i,n)),s=0,a=n>0?i-4:i,l;for(l=0;l<a;l+=4)e=Zt[t.charCodeAt(l)]<<18|Zt[t.charCodeAt(l+1)]<<12|Zt[t.charCodeAt(l+2)]<<6|Zt[t.charCodeAt(l+3)],o[s++]=e>>16&255,o[s++]=e>>8&255,o[s++]=e&255;return n===2&&(e=Zt[t.charCodeAt(l)]<<2|Zt[t.charCodeAt(l+1)]>>4,o[s++]=e&255),n===1&&(e=Zt[t.charCodeAt(l)]<<10|Zt[t.charCodeAt(l+1)]<<4|Zt[t.charCodeAt(l+2)]>>2,o[s++]=e>>8&255,o[s++]=e&255),o}function vA(t){return qr[t>>18&63]+qr[t>>12&63]+qr[t>>6&63]+qr[t&63]}function EA(t,e,r){for(var i,n=[],o=e;o<r;o+=3)i=(t[o]<<16&16711680)+(t[o+1]<<8&65280)+(t[o+2]&255),n.push(vA(i));return n.join("")}function BA(t){for(var e,r=t.length,i=r%3,n=[],o=16383,s=0,a=r-i;s<a;s+=o)n.push(EA(t,s,s+o>a?a:s+o));return i===1?(e=t[r-1],n.push(qr[e>>2]+qr[e<<4&63]+"==")):i===2&&(e=(t[r-2]<<8)+t[r-1],n.push(qr[e>>10]+qr[e>>4&63]+qr[e<<2&63]+"=")),n.join("")}});var zy=se(ff=>{ff.read=function(t,e,r,i,n){var o,s,a=n*8-i-1,l=(1<<a)-1,c=l>>1,d=-7,u=r?n-1:0,h=r?-1:1,y=t[e+u];for(u+=h,o=y&(1<<-d)-1,y>>=-d,d+=a;d>0;o=o*256+t[e+u],u+=h,d-=8);for(s=o&(1<<-d)-1,o>>=-d,d+=i;d>0;s=s*256+t[e+u],u+=h,d-=8);if(o===0)o=1-c;else {if(o===l)return s?NaN:(y?-1:1)*(1/0);s=s+Math.pow(2,i),o=o-c;}return (y?-1:1)*s*Math.pow(2,o-i)};ff.write=function(t,e,r,i,n,o){var s,a,l,c=o*8-n-1,d=(1<<c)-1,u=d>>1,h=n===23?Math.pow(2,-24)-Math.pow(2,-77):0,y=i?0:o-1,b=i?1:-1,x=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=d):(s=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-s))<1&&(s--,l*=2),s+u>=1?e+=h/l:e+=h*Math.pow(2,1-u),e*l>=2&&(s++,l/=2),s+u>=d?(a=0,s=d):s+u>=1?(a=(e*l-1)*Math.pow(2,n),s=s+u):(a=e*Math.pow(2,u-1)*Math.pow(2,n),s=0));n>=8;t[r+y]=a&255,y+=b,a/=256,n-=8);for(s=s<<n|a,c+=n;c>0;t[r+y]=s&255,y+=b,s/=256,c-=8);t[r+y-b]|=x*128;};});var X1=se(ms=>{var pf=Gy(),ps=zy(),$y=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;ms.Buffer=R;ms.SlowBuffer=RA;ms.INSPECT_MAX_BYTES=50;var V1=2147483647;ms.kMaxLength=V1;R.TYPED_ARRAY_SUPPORT=TA();!R.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function TA(){try{let t=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(t,e),t.foo()===42}catch{return false}}Object.defineProperty(R.prototype,"parent",{enumerable:true,get:function(){if(R.isBuffer(this))return this.buffer}});Object.defineProperty(R.prototype,"offset",{enumerable:true,get:function(){if(R.isBuffer(this))return this.byteOffset}});function mi(t){if(t>V1)throw new RangeError('The value "'+t+'" is invalid for option "size"');let e=new Uint8Array(t);return Object.setPrototypeOf(e,R.prototype),e}function R(t,e,r){if(typeof t=="number"){if(typeof e=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return yf(t)}return Wy(t,e,r)}R.poolSize=8192;function Wy(t,e,r){if(typeof t=="string")return PA(t,e);if(ArrayBuffer.isView(t))return NA(t);if(t==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(Gr(t,ArrayBuffer)||t&&Gr(t.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(Gr(t,SharedArrayBuffer)||t&&Gr(t.buffer,SharedArrayBuffer)))return mf(t,e,r);if(typeof t=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let i=t.valueOf&&t.valueOf();if(i!=null&&i!==t)return R.from(i,e,r);let n=DA(t);if(n)return n;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof t[Symbol.toPrimitive]=="function")return R.from(t[Symbol.toPrimitive]("string"),e,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}R.from=function(t,e,r){return Wy(t,e,r)};Object.setPrototypeOf(R.prototype,Uint8Array.prototype);Object.setPrototypeOf(R,Uint8Array);function Zy(t){if(typeof t!="number")throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function kA(t,e,r){return Zy(t),t<=0?mi(t):e!==void 0?typeof r=="string"?mi(t).fill(e,r):mi(t).fill(e):mi(t)}R.alloc=function(t,e,r){return kA(t,e,r)};function yf(t){return Zy(t),mi(t<0?0:bf(t)|0)}R.allocUnsafe=function(t){return yf(t)};R.allocUnsafeSlow=function(t){return yf(t)};function PA(t,e){if((typeof e!="string"||e==="")&&(e="utf8"),!R.isEncoding(e))throw new TypeError("Unknown encoding: "+e);let r=Yy(t,e)|0,i=mi(r),n=i.write(t,e);return n!==r&&(i=i.slice(0,n)),i}function hf(t){let e=t.length<0?0:bf(t.length)|0,r=mi(e);for(let i=0;i<e;i+=1)r[i]=t[i]&255;return r}function NA(t){if(Gr(t,Uint8Array)){let e=new Uint8Array(t);return mf(e.buffer,e.byteOffset,e.byteLength)}return hf(t)}function mf(t,e,r){if(e<0||t.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(t.byteLength<e+(r||0))throw new RangeError('"length" is outside of buffer bounds');let i;return e===void 0&&r===void 0?i=new Uint8Array(t):r===void 0?i=new Uint8Array(t,e):i=new Uint8Array(t,e,r),Object.setPrototypeOf(i,R.prototype),i}function DA(t){if(R.isBuffer(t)){let e=bf(t.length)|0,r=mi(e);return r.length===0||t.copy(r,0,0,e),r}if(t.length!==void 0)return typeof t.length!="number"||xf(t.length)?mi(0):hf(t);if(t.type==="Buffer"&&Array.isArray(t.data))return hf(t.data)}function bf(t){if(t>=V1)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+V1.toString(16)+" bytes");return t|0}function RA(t){return +t!=t&&(t=0),R.alloc(+t)}R.isBuffer=function(e){return e!=null&&e._isBuffer===true&&e!==R.prototype};R.compare=function(e,r){if(Gr(e,Uint8Array)&&(e=R.from(e,e.offset,e.byteLength)),Gr(r,Uint8Array)&&(r=R.from(r,r.offset,r.byteLength)),!R.isBuffer(e)||!R.isBuffer(r))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===r)return 0;let i=e.length,n=r.length;for(let o=0,s=Math.min(i,n);o<s;++o)if(e[o]!==r[o]){i=e[o],n=r[o];break}return i<n?-1:n<i?1:0};R.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 true;default:return false}};R.concat=function(e,r){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(e.length===0)return R.alloc(0);let i;if(r===void 0)for(r=0,i=0;i<e.length;++i)r+=e[i].length;let n=R.allocUnsafe(r),o=0;for(i=0;i<e.length;++i){let s=e[i];if(Gr(s,Uint8Array))o+s.length>n.length?(R.isBuffer(s)||(s=R.from(s)),s.copy(n,o)):Uint8Array.prototype.set.call(n,s,o);else if(R.isBuffer(s))s.copy(n,o);else throw new TypeError('"list" argument must be an Array of Buffers');o+=s.length;}return n};function Yy(t,e){if(R.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||Gr(t,ArrayBuffer))return t.byteLength;if(typeof t!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);let r=t.length,i=arguments.length>2&&arguments[2]===true;if(!i&&r===0)return 0;let n=false;for(;;)switch(e){case "ascii":case "latin1":case "binary":return r;case "utf8":case "utf-8":return gf(t).length;case "ucs2":case "ucs-2":case "utf16le":case "utf-16le":return r*2;case "hex":return r>>>1;case "base64":return s3(t).length;default:if(n)return i?-1:gf(t).length;e=(""+e).toLowerCase(),n=true;}}R.byteLength=Yy;function OA(t,e,r){let i=false;if((e===void 0||e<0)&&(e=0),e>this.length||((r===void 0||r>this.length)&&(r=this.length),r<=0)||(r>>>=0,e>>>=0,r<=e))return "";for(t||(t="utf8");;)switch(t){case "hex":return $A(this,e,r);case "utf8":case "utf-8":return Jy(this,e,r);case "ascii":return GA(this,e,r);case "latin1":case "binary":return zA(this,e,r);case "base64":return KA(this,e,r);case "ucs2":case "ucs-2":case "utf16le":case "utf-16le":return VA(this,e,r);default:if(i)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),i=true;}}R.prototype._isBuffer=true;function ao(t,e,r){let i=t[e];t[e]=t[r],t[r]=i;}R.prototype.swap16=function(){let e=this.length;if(e%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let r=0;r<e;r+=2)ao(this,r,r+1);return this};R.prototype.swap32=function(){let e=this.length;if(e%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let r=0;r<e;r+=4)ao(this,r,r+3),ao(this,r+1,r+2);return this};R.prototype.swap64=function(){let e=this.length;if(e%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let r=0;r<e;r+=8)ao(this,r,r+7),ao(this,r+1,r+6),ao(this,r+2,r+5),ao(this,r+3,r+4);return this};R.prototype.toString=function(){let e=this.length;return e===0?"":arguments.length===0?Jy(this,0,e):OA.apply(this,arguments)};R.prototype.toLocaleString=R.prototype.toString;R.prototype.equals=function(e){if(!R.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e?true:R.compare(this,e)===0};R.prototype.inspect=function(){let e="",r=ms.INSPECT_MAX_BYTES;return e=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(e+=" ... "),"<Buffer "+e+">"};$y&&(R.prototype[$y]=R.prototype.inspect);R.prototype.compare=function(e,r,i,n,o){if(Gr(e,Uint8Array)&&(e=R.from(e,e.offset,e.byteLength)),!R.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(r===void 0&&(r=0),i===void 0&&(i=e?e.length:0),n===void 0&&(n=0),o===void 0&&(o=this.length),r<0||i>e.length||n<0||o>this.length)throw new RangeError("out of range index");if(n>=o&&r>=i)return 0;if(n>=o)return -1;if(r>=i)return 1;if(r>>>=0,i>>>=0,n>>>=0,o>>>=0,this===e)return 0;let s=o-n,a=i-r,l=Math.min(s,a),c=this.slice(n,o),d=e.slice(r,i);for(let u=0;u<l;++u)if(c[u]!==d[u]){s=c[u],a=d[u];break}return s<a?-1:a<s?1:0};function Qy(t,e,r,i,n){if(t.length===0)return -1;if(typeof r=="string"?(i=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,xf(r)&&(r=n?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(n)return -1;r=t.length-1;}else if(r<0)if(n)r=0;else return -1;if(typeof e=="string"&&(e=R.from(e,i)),R.isBuffer(e))return e.length===0?-1:Vy(t,e,r,i,n);if(typeof e=="number")return e=e&255,typeof Uint8Array.prototype.indexOf=="function"?n?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):Vy(t,[e],r,i,n);throw new TypeError("val must be string, number or Buffer")}function Vy(t,e,r,i,n){let o=1,s=t.length,a=e.length;if(i!==void 0&&(i=String(i).toLowerCase(),i==="ucs2"||i==="ucs-2"||i==="utf16le"||i==="utf-16le")){if(t.length<2||e.length<2)return -1;o=2,s/=2,a/=2,r/=2;}function l(d,u){return o===1?d[u]:d.readUInt16BE(u*o)}let c;if(n){let d=-1;for(c=r;c<s;c++)if(l(t,c)===l(e,d===-1?0:c-d)){if(d===-1&&(d=c),c-d+1===a)return d*o}else d!==-1&&(c-=c-d),d=-1;}else for(r+a>s&&(r=s-a),c=r;c>=0;c--){let d=true;for(let u=0;u<a;u++)if(l(t,c+u)!==l(e,u)){d=false;break}if(d)return c}return -1}R.prototype.includes=function(e,r,i){return this.indexOf(e,r,i)!==-1};R.prototype.indexOf=function(e,r,i){return Qy(this,e,r,i,true)};R.prototype.lastIndexOf=function(e,r,i){return Qy(this,e,r,i,false)};function MA(t,e,r,i){r=Number(r)||0;let n=t.length-r;i?(i=Number(i),i>n&&(i=n)):i=n;let o=e.length;i>o/2&&(i=o/2);let s;for(s=0;s<i;++s){let a=parseInt(e.substr(s*2,2),16);if(xf(a))return s;t[r+s]=a;}return s}function FA(t,e,r,i){return j1(gf(e,t.length-r),t,r,i)}function UA(t,e,r,i){return j1(ZA(e),t,r,i)}function LA(t,e,r,i){return j1(s3(e),t,r,i)}function HA(t,e,r,i){return j1(YA(e,t.length-r),t,r,i)}R.prototype.write=function(e,r,i,n){if(r===void 0)n="utf8",i=this.length,r=0;else if(i===void 0&&typeof r=="string")n=r,i=this.length,r=0;else if(isFinite(r))r=r>>>0,isFinite(i)?(i=i>>>0,n===void 0&&(n="utf8")):(n=i,i=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let o=this.length-r;if((i===void 0||i>o)&&(i=o),e.length>0&&(i<0||r<0)||r>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let s=false;for(;;)switch(n){case "hex":return MA(this,e,r,i);case "utf8":case "utf-8":return FA(this,e,r,i);case "ascii":case "latin1":case "binary":return UA(this,e,r,i);case "base64":return LA(this,e,r,i);case "ucs2":case "ucs-2":case "utf16le":case "utf-16le":return HA(this,e,r,i);default:if(s)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),s=true;}};R.prototype.toJSON=function(){return {type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function KA(t,e,r){return e===0&&r===t.length?pf.fromByteArray(t):pf.fromByteArray(t.slice(e,r))}function Jy(t,e,r){r=Math.min(t.length,r);let i=[],n=e;for(;n<r;){let o=t[n],s=null,a=o>239?4:o>223?3:o>191?2:1;if(n+a<=r){let l,c,d,u;switch(a){case 1:o<128&&(s=o);break;case 2:l=t[n+1],(l&192)===128&&(u=(o&31)<<6|l&63,u>127&&(s=u));break;case 3:l=t[n+1],c=t[n+2],(l&192)===128&&(c&192)===128&&(u=(o&15)<<12|(l&63)<<6|c&63,u>2047&&(u<55296||u>57343)&&(s=u));break;case 4:l=t[n+1],c=t[n+2],d=t[n+3],(l&192)===128&&(c&192)===128&&(d&192)===128&&(u=(o&15)<<18|(l&63)<<12|(c&63)<<6|d&63,u>65535&&u<1114112&&(s=u));}}s===null?(s=65533,a=1):s>65535&&(s-=65536,i.push(s>>>10&1023|55296),s=56320|s&1023),i.push(s),n+=a;}return qA(i)}var jy=4096;function qA(t){let e=t.length;if(e<=jy)return String.fromCharCode.apply(String,t);let r="",i=0;for(;i<e;)r+=String.fromCharCode.apply(String,t.slice(i,i+=jy));return r}function GA(t,e,r){let i="";r=Math.min(t.length,r);for(let n=e;n<r;++n)i+=String.fromCharCode(t[n]&127);return i}function zA(t,e,r){let i="";r=Math.min(t.length,r);for(let n=e;n<r;++n)i+=String.fromCharCode(t[n]);return i}function $A(t,e,r){let i=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>i)&&(r=i);let n="";for(let o=e;o<r;++o)n+=QA[t[o]];return n}function VA(t,e,r){let i=t.slice(e,r),n="";for(let o=0;o<i.length-1;o+=2)n+=String.fromCharCode(i[o]+i[o+1]*256);return n}R.prototype.slice=function(e,r){let i=this.length;e=~~e,r=r===void 0?i:~~r,e<0?(e+=i,e<0&&(e=0)):e>i&&(e=i),r<0?(r+=i,r<0&&(r=0)):r>i&&(r=i),r<e&&(r=e);let n=this.subarray(e,r);return Object.setPrototypeOf(n,R.prototype),n};function Je(t,e,r){if(t%1!==0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}R.prototype.readUintLE=R.prototype.readUIntLE=function(e,r,i){e=e>>>0,r=r>>>0,i||Je(e,r,this.length);let n=this[e],o=1,s=0;for(;++s<r&&(o*=256);)n+=this[e+s]*o;return n};R.prototype.readUintBE=R.prototype.readUIntBE=function(e,r,i){e=e>>>0,r=r>>>0,i||Je(e,r,this.length);let n=this[e+--r],o=1;for(;r>0&&(o*=256);)n+=this[e+--r]*o;return n};R.prototype.readUint8=R.prototype.readUInt8=function(e,r){return e=e>>>0,r||Je(e,1,this.length),this[e]};R.prototype.readUint16LE=R.prototype.readUInt16LE=function(e,r){return e=e>>>0,r||Je(e,2,this.length),this[e]|this[e+1]<<8};R.prototype.readUint16BE=R.prototype.readUInt16BE=function(e,r){return e=e>>>0,r||Je(e,2,this.length),this[e]<<8|this[e+1]};R.prototype.readUint32LE=R.prototype.readUInt32LE=function(e,r){return e=e>>>0,r||Je(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216};R.prototype.readUint32BE=R.prototype.readUInt32BE=function(e,r){return e=e>>>0,r||Je(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])};R.prototype.readBigUInt64LE=Ji(function(e){e=e>>>0,hs(e,"offset");let r=this[e],i=this[e+7];(r===void 0||i===void 0)&&p0(e,this.length-8);let n=r+this[++e]*2**8+this[++e]*2**16+this[++e]*2**24,o=this[++e]+this[++e]*2**8+this[++e]*2**16+i*2**24;return BigInt(n)+(BigInt(o)<<BigInt(32))});R.prototype.readBigUInt64BE=Ji(function(e){e=e>>>0,hs(e,"offset");let r=this[e],i=this[e+7];(r===void 0||i===void 0)&&p0(e,this.length-8);let n=r*2**24+this[++e]*2**16+this[++e]*2**8+this[++e],o=this[++e]*2**24+this[++e]*2**16+this[++e]*2**8+i;return (BigInt(n)<<BigInt(32))+BigInt(o)});R.prototype.readIntLE=function(e,r,i){e=e>>>0,r=r>>>0,i||Je(e,r,this.length);let n=this[e],o=1,s=0;for(;++s<r&&(o*=256);)n+=this[e+s]*o;return o*=128,n>=o&&(n-=Math.pow(2,8*r)),n};R.prototype.readIntBE=function(e,r,i){e=e>>>0,r=r>>>0,i||Je(e,r,this.length);let n=r,o=1,s=this[e+--n];for(;n>0&&(o*=256);)s+=this[e+--n]*o;return o*=128,s>=o&&(s-=Math.pow(2,8*r)),s};R.prototype.readInt8=function(e,r){return e=e>>>0,r||Je(e,1,this.length),this[e]&128?(255-this[e]+1)*-1:this[e]};R.prototype.readInt16LE=function(e,r){e=e>>>0,r||Je(e,2,this.length);let i=this[e]|this[e+1]<<8;return i&32768?i|4294901760:i};R.prototype.readInt16BE=function(e,r){e=e>>>0,r||Je(e,2,this.length);let i=this[e+1]|this[e]<<8;return i&32768?i|4294901760:i};R.prototype.readInt32LE=function(e,r){return e=e>>>0,r||Je(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24};R.prototype.readInt32BE=function(e,r){return e=e>>>0,r||Je(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]};R.prototype.readBigInt64LE=Ji(function(e){e=e>>>0,hs(e,"offset");let r=this[e],i=this[e+7];(r===void 0||i===void 0)&&p0(e,this.length-8);let n=this[e+4]+this[e+5]*2**8+this[e+6]*2**16+(i<<24);return (BigInt(n)<<BigInt(32))+BigInt(r+this[++e]*2**8+this[++e]*2**16+this[++e]*2**24)});R.prototype.readBigInt64BE=Ji(function(e){e=e>>>0,hs(e,"offset");let r=this[e],i=this[e+7];(r===void 0||i===void 0)&&p0(e,this.length-8);let n=(r<<24)+this[++e]*2**16+this[++e]*2**8+this[++e];return (BigInt(n)<<BigInt(32))+BigInt(this[++e]*2**24+this[++e]*2**16+this[++e]*2**8+i)});R.prototype.readFloatLE=function(e,r){return e=e>>>0,r||Je(e,4,this.length),ps.read(this,e,true,23,4)};R.prototype.readFloatBE=function(e,r){return e=e>>>0,r||Je(e,4,this.length),ps.read(this,e,false,23,4)};R.prototype.readDoubleLE=function(e,r){return e=e>>>0,r||Je(e,8,this.length),ps.read(this,e,true,52,8)};R.prototype.readDoubleBE=function(e,r){return e=e>>>0,r||Je(e,8,this.length),ps.read(this,e,false,52,8)};function At(t,e,r,i,n,o){if(!R.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>n||e<o)throw new RangeError('"value" argument is out of bounds');if(r+i>t.length)throw new RangeError("Index out of range")}R.prototype.writeUintLE=R.prototype.writeUIntLE=function(e,r,i,n){if(e=+e,r=r>>>0,i=i>>>0,!n){let a=Math.pow(2,8*i)-1;At(this,e,r,i,a,0);}let o=1,s=0;for(this[r]=e&255;++s<i&&(o*=256);)this[r+s]=e/o&255;return r+i};R.prototype.writeUintBE=R.prototype.writeUIntBE=function(e,r,i,n){if(e=+e,r=r>>>0,i=i>>>0,!n){let a=Math.pow(2,8*i)-1;At(this,e,r,i,a,0);}let o=i-1,s=1;for(this[r+o]=e&255;--o>=0&&(s*=256);)this[r+o]=e/s&255;return r+i};R.prototype.writeUint8=R.prototype.writeUInt8=function(e,r,i){return e=+e,r=r>>>0,i||At(this,e,r,1,255,0),this[r]=e&255,r+1};R.prototype.writeUint16LE=R.prototype.writeUInt16LE=function(e,r,i){return e=+e,r=r>>>0,i||At(this,e,r,2,65535,0),this[r]=e&255,this[r+1]=e>>>8,r+2};R.prototype.writeUint16BE=R.prototype.writeUInt16BE=function(e,r,i){return e=+e,r=r>>>0,i||At(this,e,r,2,65535,0),this[r]=e>>>8,this[r+1]=e&255,r+2};R.prototype.writeUint32LE=R.prototype.writeUInt32LE=function(e,r,i){return e=+e,r=r>>>0,i||At(this,e,r,4,4294967295,0),this[r+3]=e>>>24,this[r+2]=e>>>16,this[r+1]=e>>>8,this[r]=e&255,r+4};R.prototype.writeUint32BE=R.prototype.writeUInt32BE=function(e,r,i){return e=+e,r=r>>>0,i||At(this,e,r,4,4294967295,0),this[r]=e>>>24,this[r+1]=e>>>16,this[r+2]=e>>>8,this[r+3]=e&255,r+4};function e3(t,e,r,i,n){o3(e,i,n,t,r,7);let o=Number(e&BigInt(4294967295));t[r++]=o,o=o>>8,t[r++]=o,o=o>>8,t[r++]=o,o=o>>8,t[r++]=o;let s=Number(e>>BigInt(32)&BigInt(4294967295));return t[r++]=s,s=s>>8,t[r++]=s,s=s>>8,t[r++]=s,s=s>>8,t[r++]=s,r}function t3(t,e,r,i,n){o3(e,i,n,t,r,7);let o=Number(e&BigInt(4294967295));t[r+7]=o,o=o>>8,t[r+6]=o,o=o>>8,t[r+5]=o,o=o>>8,t[r+4]=o;let s=Number(e>>BigInt(32)&BigInt(4294967295));return t[r+3]=s,s=s>>8,t[r+2]=s,s=s>>8,t[r+1]=s,s=s>>8,t[r]=s,r+8}R.prototype.writeBigUInt64LE=Ji(function(e,r=0){return e3(this,e,r,BigInt(0),BigInt("0xffffffffffffffff"))});R.prototype.writeBigUInt64BE=Ji(function(e,r=0){return t3(this,e,r,BigInt(0),BigInt("0xffffffffffffffff"))});R.prototype.writeIntLE=function(e,r,i,n){if(e=+e,r=r>>>0,!n){let l=Math.pow(2,8*i-1);At(this,e,r,i,l-1,-l);}let o=0,s=1,a=0;for(this[r]=e&255;++o<i&&(s*=256);)e<0&&a===0&&this[r+o-1]!==0&&(a=1),this[r+o]=(e/s>>0)-a&255;return r+i};R.prototype.writeIntBE=function(e,r,i,n){if(e=+e,r=r>>>0,!n){let l=Math.pow(2,8*i-1);At(this,e,r,i,l-1,-l);}let o=i-1,s=1,a=0;for(this[r+o]=e&255;--o>=0&&(s*=256);)e<0&&a===0&&this[r+o+1]!==0&&(a=1),this[r+o]=(e/s>>0)-a&255;return r+i};R.prototype.writeInt8=function(e,r,i){return e=+e,r=r>>>0,i||At(this,e,r,1,127,-128),e<0&&(e=255+e+1),this[r]=e&255,r+1};R.prototype.writeInt16LE=function(e,r,i){return e=+e,r=r>>>0,i||At(this,e,r,2,32767,-32768),this[r]=e&255,this[r+1]=e>>>8,r+2};R.prototype.writeInt16BE=function(e,r,i){return e=+e,r=r>>>0,i||At(this,e,r,2,32767,-32768),this[r]=e>>>8,this[r+1]=e&255,r+2};R.prototype.writeInt32LE=function(e,r,i){return e=+e,r=r>>>0,i||At(this,e,r,4,2147483647,-2147483648),this[r]=e&255,this[r+1]=e>>>8,this[r+2]=e>>>16,this[r+3]=e>>>24,r+4};R.prototype.writeInt32BE=function(e,r,i){return e=+e,r=r>>>0,i||At(this,e,r,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[r]=e>>>24,this[r+1]=e>>>16,this[r+2]=e>>>8,this[r+3]=e&255,r+4};R.prototype.writeBigInt64LE=Ji(function(e,r=0){return e3(this,e,r,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});R.prototype.writeBigInt64BE=Ji(function(e,r=0){return t3(this,e,r,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function r3(t,e,r,i,n,o){if(r+i>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function i3(t,e,r,i,n){return e=+e,r=r>>>0,n||r3(t,e,r,4),ps.write(t,e,r,i,23,4),r+4}R.prototype.writeFloatLE=function(e,r,i){return i3(this,e,r,true,i)};R.prototype.writeFloatBE=function(e,r,i){return i3(this,e,r,false,i)};function n3(t,e,r,i,n){return e=+e,r=r>>>0,n||r3(t,e,r,8),ps.write(t,e,r,i,52,8),r+8}R.prototype.writeDoubleLE=function(e,r,i){return n3(this,e,r,true,i)};R.prototype.writeDoubleBE=function(e,r,i){return n3(this,e,r,false,i)};R.prototype.copy=function(e,r,i,n){if(!R.isBuffer(e))throw new TypeError("argument should be a Buffer");if(i||(i=0),!n&&n!==0&&(n=this.length),r>=e.length&&(r=e.length),r||(r=0),n>0&&n<i&&(n=i),n===i||e.length===0||this.length===0)return 0;if(r<0)throw new RangeError("targetStart out of bounds");if(i<0||i>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-r<n-i&&(n=e.length-r+i);let o=n-i;return this===e&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(r,i,n):Uint8Array.prototype.set.call(e,this.subarray(i,n),r),o};R.prototype.fill=function(e,r,i,n){if(typeof e=="string"){if(typeof r=="string"?(n=r,r=0,i=this.length):typeof i=="string"&&(n=i,i=this.length),n!==void 0&&typeof n!="string")throw new TypeError("encoding must be a string");if(typeof n=="string"&&!R.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(e.length===1){let s=e.charCodeAt(0);(n==="utf8"&&s<128||n==="latin1")&&(e=s);}}else typeof e=="number"?e=e&255:typeof e=="boolean"&&(e=Number(e));if(r<0||this.length<r||this.length<i)throw new RangeError("Out of range index");if(i<=r)return this;r=r>>>0,i=i===void 0?this.length:i>>>0,e||(e=0);let o;if(typeof e=="number")for(o=r;o<i;++o)this[o]=e;else {let s=R.isBuffer(e)?e:R.from(e,n),a=s.length;if(a===0)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(o=0;o<i-r;++o)this[o+r]=s[o%a];}return this};var fs={};function Sf(t,e,r){fs[t]=class extends r{constructor(){super(),Object.defineProperty(this,"message",{value:e.apply(this,arguments),writable:true,configurable:true}),this.name=`${this.name} [${t}]`,this.stack,delete this.name;}get code(){return t}set code(n){Object.defineProperty(this,"code",{configurable:true,enumerable:true,value:n,writable:true});}toString(){return `${this.name} [${t}]: ${this.message}`}};}Sf("ERR_BUFFER_OUT_OF_BOUNDS",function(t){return t?`${t} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError);Sf("ERR_INVALID_ARG_TYPE",function(t,e){return `The "${t}" argument must be of type number. Received type ${typeof e}`},TypeError);Sf("ERR_OUT_OF_RANGE",function(t,e,r){let i=`The value of "${t}" is out of range.`,n=r;return Number.isInteger(r)&&Math.abs(r)>2**32?n=Xy(String(r)):typeof r=="bigint"&&(n=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(n=Xy(n)),n+="n"),i+=` It must be ${e}. Received ${n}`,i},RangeError);function Xy(t){let e="",r=t.length,i=t[0]==="-"?1:0;for(;r>=i+4;r-=3)e=`_${t.slice(r-3,r)}${e}`;return `${t.slice(0,r)}${e}`}function jA(t,e,r){hs(e,"offset"),(t[e]===void 0||t[e+r]===void 0)&&p0(e,t.length-(r+1));}function o3(t,e,r,i,n,o){if(t>r||t<e){let s=typeof e=="bigint"?"n":"",a;throw e===0||e===BigInt(0)?a=`>= 0${s} and < 2${s} ** ${(o+1)*8}${s}`:a=`>= -(2${s} ** ${(o+1)*8-1}${s}) and < 2 ** ${(o+1)*8-1}${s}`,new fs.ERR_OUT_OF_RANGE("value",a,t)}jA(i,n,o);}function hs(t,e){if(typeof t!="number")throw new fs.ERR_INVALID_ARG_TYPE(e,"number",t)}function p0(t,e,r){throw Math.floor(t)!==t?(hs(t,r),new fs.ERR_OUT_OF_RANGE("offset","an integer",t)):e<0?new fs.ERR_BUFFER_OUT_OF_BOUNDS:new fs.ERR_OUT_OF_RANGE("offset",`>= ${0} and <= ${e}`,t)}var XA=/[^+/0-9A-Za-z-_]/g;function WA(t){if(t=t.split("=")[0],t=t.trim().replace(XA,""),t.length<2)return "";for(;t.length%4!==0;)t=t+"=";return t}function gf(t,e){e=e||1/0;let r,i=t.length,n=null,o=[];for(let s=0;s<i;++s){if(r=t.charCodeAt(s),r>55295&&r<57344){if(!n){if(r>56319){(e-=3)>-1&&o.push(239,191,189);continue}else if(s+1===i){(e-=3)>-1&&o.push(239,191,189);continue}n=r;continue}if(r<56320){(e-=3)>-1&&o.push(239,191,189),n=r;continue}r=(n-55296<<10|r-56320)+65536;}else n&&(e-=3)>-1&&o.push(239,191,189);if(n=null,r<128){if((e-=1)<0)break;o.push(r);}else if(r<2048){if((e-=2)<0)break;o.push(r>>6|192,r&63|128);}else if(r<65536){if((e-=3)<0)break;o.push(r>>12|224,r>>6&63|128,r&63|128);}else if(r<1114112){if((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,r&63|128);}else throw new Error("Invalid code point")}return o}function ZA(t){let e=[];for(let r=0;r<t.length;++r)e.push(t.charCodeAt(r)&255);return e}function YA(t,e){let r,i,n,o=[];for(let s=0;s<t.length&&!((e-=2)<0);++s)r=t.charCodeAt(s),i=r>>8,n=r%256,o.push(n),o.push(i);return o}function s3(t){return pf.toByteArray(WA(t))}function j1(t,e,r,i){let n;for(n=0;n<i&&!(n+r>=e.length||n>=t.length);++n)e[n+r]=t[n];return n}function Gr(t,e){return t instanceof e||t!=null&&t.constructor!=null&&t.constructor.name!=null&&t.constructor.name===e.name}function xf(t){return t!==t}var QA=(function(){let t="0123456789abcdef",e=new Array(256);for(let r=0;r<16;++r){let i=r*16;for(let n=0;n<16;++n)e[i+n]=t[r]+t[n];}return e})();function Ji(t){return typeof BigInt>"u"?JA:t}function JA(){throw new Error("BigInt not supported")}});var Z4=se((k$,W4)=>{var Gs=1e3,zs=Gs*60,$s=zs*60,_o=$s*24,UC=_o*7,LC=_o*365.25;W4.exports=function(t,e){e=e||{};var r=typeof t;if(r==="string"&&t.length>0)return HC(t);if(r==="number"&&isFinite(t))return e.long?qC(t):KC(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))};function HC(t){if(t=String(t),!(t.length>100)){var e=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(t);if(e){var r=parseFloat(e[1]),i=(e[2]||"ms").toLowerCase();switch(i){case "years":case "year":case "yrs":case "yr":case "y":return r*LC;case "weeks":case "week":case "w":return r*UC;case "days":case "day":case "d":return r*_o;case "hours":case "hour":case "hrs":case "hr":case "h":return r*$s;case "minutes":case "minute":case "mins":case "min":case "m":return r*zs;case "seconds":case "second":case "secs":case "sec":case "s":return r*Gs;case "milliseconds":case "millisecond":case "msecs":case "msec":case "ms":return r;default:return}}}}function KC(t){var e=Math.abs(t);return e>=_o?Math.round(t/_o)+"d":e>=$s?Math.round(t/$s)+"h":e>=zs?Math.round(t/zs)+"m":e>=Gs?Math.round(t/Gs)+"s":t+"ms"}function qC(t){var e=Math.abs(t);return e>=_o?vl(t,e,_o,"day"):e>=$s?vl(t,e,$s,"hour"):e>=zs?vl(t,e,zs,"minute"):e>=Gs?vl(t,e,Gs,"second"):t+" ms"}function vl(t,e,r,i){var n=e>=r*1.5;return Math.round(t/r)+" "+i+(n?"s":"")}});var Q4=se((P$,Y4)=>{function GC(t){r.debug=r,r.default=r,r.coerce=l,r.disable=s,r.enable=n,r.enabled=a,r.humanize=Z4(),r.destroy=c,Object.keys(t).forEach(d=>{r[d]=t[d];}),r.names=[],r.skips=[],r.formatters={};function e(d){let u=0;for(let h=0;h<d.length;h++)u=(u<<5)-u+d.charCodeAt(h),u|=0;return r.colors[Math.abs(u)%r.colors.length]}r.selectColor=e;function r(d){let u,h=null,y,b;function x(...m){if(!x.enabled)return;let A=x,_=Number(new Date),w=_-(u||_);A.diff=w,A.prev=u,A.curr=_,u=_,m[0]=r.coerce(m[0]),typeof m[0]!="string"&&m.unshift("%O");let I=0;m[0]=m[0].replace(/%([a-zA-Z%])/g,(H,O)=>{if(H==="%%")return "%";I++;let U=r.formatters[O];if(typeof U=="function"){let F=m[I];H=U.call(A,F),m.splice(I,1),I--;}return H}),r.formatArgs.call(A,m),(A.log||r.log).apply(A,m);}return x.namespace=d,x.useColors=r.useColors(),x.color=r.selectColor(d),x.extend=i,x.destroy=r.destroy,Object.defineProperty(x,"enabled",{enumerable:true,configurable:false,get:()=>h!==null?h:(y!==r.namespaces&&(y=r.namespaces,b=r.enabled(d)),b),set:m=>{h=m;}}),typeof r.init=="function"&&r.init(x),x}function i(d,u){let h=r(this.namespace+(typeof u>"u"?":":u)+d);return h.log=this.log,h}function n(d){r.save(d),r.namespaces=d,r.names=[],r.skips=[];let u=(typeof d=="string"?d:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(let h of u)h[0]==="-"?r.skips.push(h.slice(1)):r.names.push(h);}function o(d,u){let h=0,y=0,b=-1,x=0;for(;h<d.length;)if(y<u.length&&(u[y]===d[h]||u[y]==="*"))u[y]==="*"?(b=y,x=h,y++):(h++,y++);else if(b!==-1)y=b+1,x++,h=x;else return false;for(;y<u.length&&u[y]==="*";)y++;return y===u.length}function s(){let d=[...r.names,...r.skips.map(u=>"-"+u)].join(",");return r.enable(""),d}function a(d){for(let u of r.skips)if(o(d,u))return false;for(let u of r.names)if(o(d,u))return true;return false}function l(d){return d instanceof Error?d.stack||d.message:d}function c(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");}return r.enable(r.load()),r}Y4.exports=GC;});var G0=se((Bt,El)=>{Bt.formatArgs=$C;Bt.save=VC;Bt.load=jC;Bt.useColors=zC;Bt.storage=XC();Bt.destroy=(()=>{let t=false;return ()=>{t||(t=true,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."));}})();Bt.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function zC(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return true;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return false;let t;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(t=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(t[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function $C(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+El.exports.humanize(this.diff),!this.useColors)return;let e="color: "+this.color;t.splice(1,0,e,"color: inherit");let r=0,i=0;t[0].replace(/%[a-zA-Z%]/g,n=>{n!=="%%"&&(r++,n==="%c"&&(i=r));}),t.splice(i,0,e);}Bt.log=console.debug||console.log||(()=>{});function VC(t){try{t?Bt.storage.setItem("debug",t):Bt.storage.removeItem("debug");}catch{}}function jC(){let t;try{t=Bt.storage.getItem("debug")||Bt.storage.getItem("DEBUG");}catch{}return !t&&typeof process<"u"&&"env"in process&&(t=process.env.DEBUG),t}function XC(){try{return localStorage}catch{}}El.exports=Q4()(Bt);var{formatters:WC}=El.exports;WC.j=function(t){try{return JSON.stringify(t)}catch(e){return "[UnexpectedJSONParseError]: "+e.message}};});var cb=se((L$,ab)=>{ab.exports={};});var x5=se((oj,vv)=>{vv.exports=[["AF","AFG","004","ISO 3166-2:AF"],["AL","ALB","008","ISO 3166-2:AL"],["DZ","DZA","012","ISO 3166-2:DZ"],["AS","ASM","016","ISO 3166-2:AS"],["AD","AND","020","ISO 3166-2:AD"],["AO","AGO","024","ISO 3166-2:AO"],["AI","AIA","660","ISO 3166-2:AI"],["AQ","ATA","010","ISO 3166-2:AQ"],["AG","ATG","028","ISO 3166-2:AG"],["AR","ARG","032","ISO 3166-2:AR"],["AM","ARM","051","ISO 3166-2:AM"],["AW","ABW","533","ISO 3166-2:AW"],["AU","AUS","036","ISO 3166-2:AU"],["AT","AUT","040","ISO 3166-2:AT"],["AZ","AZE","031","ISO 3166-2:AZ"],["BS","BHS","044","ISO 3166-2:BS"],["BH","BHR","048","ISO 3166-2:BH"],["BD","BGD","050","ISO 3166-2:BD"],["BB","BRB","052","ISO 3166-2:BB"],["BY","BLR","112","ISO 3166-2:BY"],["BE","BEL","056","ISO 3166-2:BE"],["BZ","BLZ","084","ISO 3166-2:BZ"],["BJ","BEN","204","ISO 3166-2:BJ"],["BM","BMU","060","ISO 3166-2:BM"],["BT","BTN","064","ISO 3166-2:BT"],["BO","BOL","068","ISO 3166-2:BO"],["BA","BIH","070","ISO 3166-2:BA"],["BW","BWA","072","ISO 3166-2:BW"],["BV","BVT","074","ISO 3166-2:BV"],["BR","BRA","076","ISO 3166-2:BR"],["IO","IOT","086","ISO 3166-2:IO"],["BN","BRN","096","ISO 3166-2:BN"],["BG","BGR","100","ISO 3166-2:BG"],["BF","BFA","854","ISO 3166-2:BF"],["BI","BDI","108","ISO 3166-2:BI"],["KH","KHM","116","ISO 3166-2:KH"],["CM","CMR","120","ISO 3166-2:CM"],["CA","CAN","124","ISO 3166-2:CA"],["CV","CPV","132","ISO 3166-2:CV"],["KY","CYM","136","ISO 3166-2:KY"],["CF","CAF","140","ISO 3166-2:CF"],["TD","TCD","148","ISO 3166-2:TD"],["CL","CHL","152","ISO 3166-2:CL"],["CN","CHN","156","ISO 3166-2:CN"],["CX","CXR","162","ISO 3166-2:CX"],["CC","CCK","166","ISO 3166-2:CC"],["CO","COL","170","ISO 3166-2:CO"],["KM","COM","174","ISO 3166-2:KM"],["CG","COG","178","ISO 3166-2:CG"],["CD","COD","180","ISO 3166-2:CD"],["CK","COK","184","ISO 3166-2:CK"],["CR","CRI","188","ISO 3166-2:CR"],["CI","CIV","384","ISO 3166-2:CI"],["HR","HRV","191","ISO 3166-2:HR"],["CU","CUB","192","ISO 3166-2:CU"],["CY","CYP","196","ISO 3166-2:CY"],["CZ","CZE","203","ISO 3166-2:CZ"],["DK","DNK","208","ISO 3166-2:DK"],["DJ","DJI","262","ISO 3166-2:DJ"],["DM","DMA","212","ISO 3166-2:DM"],["DO","DOM","214","ISO 3166-2:DO"],["EC","ECU","218","ISO 3166-2:EC"],["EG","EGY","818","ISO 3166-2:EG"],["SV","SLV","222","ISO 3166-2:SV"],["GQ","GNQ","226","ISO 3166-2:GQ"],["ER","ERI","232","ISO 3166-2:ER"],["EE","EST","233","ISO 3166-2:EE"],["ET","ETH","231","ISO 3166-2:ET"],["FK","FLK","238","ISO 3166-2:FK"],["FO","FRO","234","ISO 3166-2:FO"],["FJ","FJI","242","ISO 3166-2:FJ"],["FI","FIN","246","ISO 3166-2:FI"],["FR","FRA","250","ISO 3166-2:FR"],["GF","GUF","254","ISO 3166-2:GF"],["PF","PYF","258","ISO 3166-2:PF"],["TF","ATF","260","ISO 3166-2:TF"],["GA","GAB","266","ISO 3166-2:GA"],["GM","GMB","270","ISO 3166-2:GM"],["GE","GEO","268","ISO 3166-2:GE"],["DE","DEU","276","ISO 3166-2:DE"],["GH","GHA","288","ISO 3166-2:GH"],["GI","GIB","292","ISO 3166-2:GI"],["GR","GRC","300","ISO 3166-2:GR"],["GL","GRL","304","ISO 3166-2:GL"],["GD","GRD","308","ISO 3166-2:GD"],["GP","GLP","312","ISO 3166-2:GP"],["GU","GUM","316","ISO 3166-2:GU"],["GT","GTM","320","ISO 3166-2:GT"],["GN","GIN","324","ISO 3166-2:GN"],["GW","GNB","624","ISO 3166-2:GW"],["GY","GUY","328","ISO 3166-2:GY"],["HT","HTI","332","ISO 3166-2:HT"],["HM","HMD","334","ISO 3166-2:HM"],["VA","VAT","336","ISO 3166-2:VA"],["HN","HND","340","ISO 3166-2:HN"],["HK","HKG","344","ISO 3166-2:HK"],["HU","HUN","348","ISO 3166-2:HU"],["IS","ISL","352","ISO 3166-2:IS"],["IN","IND","356","ISO 3166-2:IN"],["ID","IDN","360","ISO 3166-2:ID"],["IR","IRN","364","ISO 3166-2:IR"],["IQ","IRQ","368","ISO 3166-2:IQ"],["IE","IRL","372","ISO 3166-2:IE"],["IL","ISR","376","ISO 3166-2:IL"],["IT","ITA","380","ISO 3166-2:IT"],["JM","JAM","388","ISO 3166-2:JM"],["JP","JPN","392","ISO 3166-2:JP"],["JO","JOR","400","ISO 3166-2:JO"],["KZ","KAZ","398","ISO 3166-2:KZ"],["KE","KEN","404","ISO 3166-2:KE"],["KI","KIR","296","ISO 3166-2:KI"],["KP","PRK","408","ISO 3166-2:KP"],["KR","KOR","410","ISO 3166-2:KR"],["KW","KWT","414","ISO 3166-2:KW"],["KG","KGZ","417","ISO 3166-2:KG"],["LA","LAO","418","ISO 3166-2:LA"],["LV","LVA","428","ISO 3166-2:LV"],["LB","LBN","422","ISO 3166-2:LB"],["LS","LSO","426","ISO 3166-2:LS"],["LR","LBR","430","ISO 3166-2:LR"],["LY","LBY","434","ISO 3166-2:LY"],["LI","LIE","438","ISO 3166-2:LI"],["LT","LTU","440","ISO 3166-2:LT"],["LU","LUX","442","ISO 3166-2:LU"],["MO","MAC","446","ISO 3166-2:MO"],["MG","MDG","450","ISO 3166-2:MG"],["MW","MWI","454","ISO 3166-2:MW"],["MY","MYS","458","ISO 3166-2:MY"],["MV","MDV","462","ISO 3166-2:MV"],["ML","MLI","466","ISO 3166-2:ML"],["MT","MLT","470","ISO 3166-2:MT"],["MH","MHL","584","ISO 3166-2:MH"],["MQ","MTQ","474","ISO 3166-2:MQ"],["MR","MRT","478","ISO 3166-2:MR"],["MU","MUS","480","ISO 3166-2:MU"],["YT","MYT","175","ISO 3166-2:YT"],["MX","MEX","484","ISO 3166-2:MX"],["FM","FSM","583","ISO 3166-2:FM"],["MD","MDA","498","ISO 3166-2:MD"],["MC","MCO","492","ISO 3166-2:MC"],["MN","MNG","496","ISO 3166-2:MN"],["MS","MSR","500","ISO 3166-2:MS"],["MA","MAR","504","ISO 3166-2:MA"],["MZ","MOZ","508","ISO 3166-2:MZ"],["MM","MMR","104","ISO 3166-2:MM"],["NA","NAM","516","ISO 3166-2:NA"],["NR","NRU","520","ISO 3166-2:NR"],["NP","NPL","524","ISO 3166-2:NP"],["NL","NLD","528","ISO 3166-2:NL"],["NC","NCL","540","ISO 3166-2:NC"],["NZ","NZL","554","ISO 3166-2:NZ"],["NI","NIC","558","ISO 3166-2:NI"],["NE","NER","562","ISO 3166-2:NE"],["NG","NGA","566","ISO 3166-2:NG"],["NU","NIU","570","ISO 3166-2:NU"],["NF","NFK","574","ISO 3166-2:NF"],["MP","MNP","580","ISO 3166-2:MP"],["MK","MKD","807","ISO 3166-2:MK"],["NO","NOR","578","ISO 3166-2:NO"],["OM","OMN","512","ISO 3166-2:OM"],["PK","PAK","586","ISO 3166-2:PK"],["PW","PLW","585","ISO 3166-2:PW"],["PS","PSE","275","ISO 3166-2:PS"],["PA","PAN","591","ISO 3166-2:PA"],["PG","PNG","598","ISO 3166-2:PG"],["PY","PRY","600","ISO 3166-2:PY"],["PE","PER","604","ISO 3166-2:PE"],["PH","PHL","608","ISO 3166-2:PH"],["PN","PCN","612","ISO 3166-2:PN"],["PL","POL","616","ISO 3166-2:PL"],["PT","PRT","620","ISO 3166-2:PT"],["PR","PRI","630","ISO 3166-2:PR"],["QA","QAT","634","ISO 3166-2:QA"],["RE","REU","638","ISO 3166-2:RE"],["RO","ROU","642","ISO 3166-2:RO"],["RU","RUS","643","ISO 3166-2:RU"],["RW","RWA","646","ISO 3166-2:RW"],["SH","SHN","654","ISO 3166-2:SH"],["KN","KNA","659","ISO 3166-2:KN"],["LC","LCA","662","ISO 3166-2:LC"],["PM","SPM","666","ISO 3166-2:PM"],["VC","VCT","670","ISO 3166-2:VC"],["WS","WSM","882","ISO 3166-2:WS"],["SM","SMR","674","ISO 3166-2:SM"],["ST","STP","678","ISO 3166-2:ST"],["SA","SAU","682","ISO 3166-2:SA"],["SN","SEN","686","ISO 3166-2:SN"],["SC","SYC","690","ISO 3166-2:SC"],["SL","SLE","694","ISO 3166-2:SL"],["SG","SGP","702","ISO 3166-2:SG"],["SK","SVK","703","ISO 3166-2:SK"],["SI","SVN","705","ISO 3166-2:SI"],["SB","SLB","090","ISO 3166-2:SB"],["SO","SOM","706","ISO 3166-2:SO"],["ZA","ZAF","710","ISO 3166-2:ZA"],["GS","SGS","239","ISO 3166-2:GS"],["ES","ESP","724","ISO 3166-2:ES"],["LK","LKA","144","ISO 3166-2:LK"],["SD","SDN","729","ISO 3166-2:SD"],["SR","SUR","740","ISO 3166-2:SR"],["SJ","SJM","744","ISO 3166-2:SJ"],["SZ","SWZ","748","ISO 3166-2:SZ"],["SE","SWE","752","ISO 3166-2:SE"],["CH","CHE","756","ISO 3166-2:CH"],["SY","SYR","760","ISO 3166-2:SY"],["TW","TWN","158","ISO 3166-2:TW"],["TJ","TJK","762","ISO 3166-2:TJ"],["TZ","TZA","834","ISO 3166-2:TZ"],["TH","THA","764","ISO 3166-2:TH"],["TL","TLS","626","ISO 3166-2:TL"],["TG","TGO","768","ISO 3166-2:TG"],["TK","TKL","772","ISO 3166-2:TK"],["TO","TON","776","ISO 3166-2:TO"],["TT","TTO","780","ISO 3166-2:TT"],["TN","TUN","788","ISO 3166-2:TN"],["TR","TUR","792","ISO 3166-2:TR"],["TM","TKM","795","ISO 3166-2:TM"],["TC","TCA","796","ISO 3166-2:TC"],["TV","TUV","798","ISO 3166-2:TV"],["UG","UGA","800","ISO 3166-2:UG"],["UA","UKR","804","ISO 3166-2:UA"],["AE","ARE","784","ISO 3166-2:AE"],["GB","GBR","826","ISO 3166-2:GB"],["US","USA","840","ISO 3166-2:US"],["UM","UMI","581","ISO 3166-2:UM"],["UY","URY","858","ISO 3166-2:UY"],["UZ","UZB","860","ISO 3166-2:UZ"],["VU","VUT","548","ISO 3166-2:VU"],["VE","VEN","862","ISO 3166-2:VE"],["VN","VNM","704","ISO 3166-2:VN"],["VG","VGB","092","ISO 3166-2:VG"],["VI","VIR","850","ISO 3166-2:VI"],["WF","WLF","876","ISO 3166-2:WF"],["EH","ESH","732","ISO 3166-2:EH"],["YE","YEM","887","ISO 3166-2:YE"],["ZM","ZMB","894","ISO 3166-2:ZM"],["ZW","ZWE","716","ISO 3166-2:ZW"],["AX","ALA","248","ISO 3166-2:AX"],["BQ","BES","535","ISO 3166-2:BQ"],["CW","CUW","531","ISO 3166-2:CW"],["GG","GGY","831","ISO 3166-2:GG"],["IM","IMN","833","ISO 3166-2:IM"],["JE","JEY","832","ISO 3166-2:JE"],["ME","MNE","499","ISO 3166-2:ME"],["BL","BLM","652","ISO 3166-2:BL"],["MF","MAF","663","ISO 3166-2:MF"],["RS","SRB","688","ISO 3166-2:RS"],["SX","SXM","534","ISO 3166-2:SX"],["SS","SSD","728","ISO 3166-2:SS"],["XK","XKK","983","ISO 3166-2:XK"]];});var A5=se((sj,Ev)=>{Ev.exports=["br","cy","dv","sw","eu","af","am","ha","ku","ml","mt","no","ps","sd","so","sq","ta","tg","tt","ug","ur","vi","ar","az","be","bg","bn","bs","ca","cs","da","de","el","en","es","et","fa","fi","fr","ga","gl","he","hi","hr","hu","hy","id","is","it","ja","ka","kk","km","ko","ky","lt","lv","mk","mn","mr","ms","nb","nl","nn","pl","pt","ro","ru","sk","sl","sr","sv","th","tk","tr","uk","uz","zh"];});var _5=se(cd=>{cd.remove=Bv;var ad=[{base:" ",chars:"\xA0"},{base:"0",chars:"\u07C0"},{base:"A",chars:"\u24B6\uFF21\xC0\xC1\xC2\u1EA6\u1EA4\u1EAA\u1EA8\xC3\u0100\u0102\u1EB0\u1EAE\u1EB4\u1EB2\u0226\u01E0\xC4\u01DE\u1EA2\xC5\u01FA\u01CD\u0200\u0202\u1EA0\u1EAC\u1EB6\u1E00\u0104\u023A\u2C6F"},{base:"AA",chars:"\uA732"},{base:"AE",chars:"\xC6\u01FC\u01E2"},{base:"AO",chars:"\uA734"},{base:"AU",chars:"\uA736"},{base:"AV",chars:"\uA738\uA73A"},{base:"AY",chars:"\uA73C"},{base:"B",chars:"\u24B7\uFF22\u1E02\u1E04\u1E06\u0243\u0181"},{base:"C",chars:"\u24B8\uFF23\uA73E\u1E08\u0106C\u0108\u010A\u010C\xC7\u0187\u023B"},{base:"D",chars:"\u24B9\uFF24\u1E0A\u010E\u1E0C\u1E10\u1E12\u1E0E\u0110\u018A\u0189\u1D05\uA779"},{base:"Dh",chars:"\xD0"},{base:"DZ",chars:"\u01F1\u01C4"},{base:"Dz",chars:"\u01F2\u01C5"},{base:"E",chars:"\u025B\u24BA\uFF25\xC8\xC9\xCA\u1EC0\u1EBE\u1EC4\u1EC2\u1EBC\u0112\u1E14\u1E16\u0114\u0116\xCB\u1EBA\u011A\u0204\u0206\u1EB8\u1EC6\u0228\u1E1C\u0118\u1E18\u1E1A\u0190\u018E\u1D07"},{base:"F",chars:"\uA77C\u24BB\uFF26\u1E1E\u0191\uA77B"},{base:"G",chars:"\u24BC\uFF27\u01F4\u011C\u1E20\u011E\u0120\u01E6\u0122\u01E4\u0193\uA7A0\uA77D\uA77E\u0262"},{base:"H",chars:"\u24BD\uFF28\u0124\u1E22\u1E26\u021E\u1E24\u1E28\u1E2A\u0126\u2C67\u2C75\uA78D"},{base:"I",chars:"\u24BE\uFF29\xCC\xCD\xCE\u0128\u012A\u012C\u0130\xCF\u1E2E\u1EC8\u01CF\u0208\u020A\u1ECA\u012E\u1E2C\u0197"},{base:"J",chars:"\u24BF\uFF2A\u0134\u0248\u0237"},{base:"K",chars:"\u24C0\uFF2B\u1E30\u01E8\u1E32\u0136\u1E34\u0198\u2C69\uA740\uA742\uA744\uA7A2"},{base:"L",chars:"\u24C1\uFF2C\u013F\u0139\u013D\u1E36\u1E38\u013B\u1E3C\u1E3A\u0141\u023D\u2C62\u2C60\uA748\uA746\uA780"},{base:"LJ",chars:"\u01C7"},{base:"Lj",chars:"\u01C8"},{base:"M",chars:"\u24C2\uFF2D\u1E3E\u1E40\u1E42\u2C6E\u019C\u03FB"},{base:"N",chars:"\uA7A4\u0220\u24C3\uFF2E\u01F8\u0143\xD1\u1E44\u0147\u1E46\u0145\u1E4A\u1E48\u019D\uA790\u1D0E"},{base:"NJ",chars:"\u01CA"},{base:"Nj",chars:"\u01CB"},{base:"O",chars:"\u24C4\uFF2F\xD2\xD3\xD4\u1ED2\u1ED0\u1ED6\u1ED4\xD5\u1E4C\u022C\u1E4E\u014C\u1E50\u1E52\u014E\u022E\u0230\xD6\u022A\u1ECE\u0150\u01D1\u020C\u020E\u01A0\u1EDC\u1EDA\u1EE0\u1EDE\u1EE2\u1ECC\u1ED8\u01EA\u01EC\xD8\u01FE\u0186\u019F\uA74A\uA74C"},{base:"OE",chars:"\u0152"},{base:"OI",chars:"\u01A2"},{base:"OO",chars:"\uA74E"},{base:"OU",chars:"\u0222"},{base:"P",chars:"\u24C5\uFF30\u1E54\u1E56\u01A4\u2C63\uA750\uA752\uA754"},{base:"Q",chars:"\u24C6\uFF31\uA756\uA758\u024A"},{base:"R",chars:"\u24C7\uFF32\u0154\u1E58\u0158\u0210\u0212\u1E5A\u1E5C\u0156\u1E5E\u024C\u2C64\uA75A\uA7A6\uA782"},{base:"S",chars:"\u24C8\uFF33\u1E9E\u015A\u1E64\u015C\u1E60\u0160\u1E66\u1E62\u1E68\u0218\u015E\u2C7E\uA7A8\uA784"},{base:"T",chars:"\u24C9\uFF34\u1E6A\u0164\u1E6C\u021A\u0162\u1E70\u1E6E\u0166\u01AC\u01AE\u023E\uA786"},{base:"Th",chars:"\xDE"},{base:"TZ",chars:"\uA728"},{base:"U",chars:"\u24CA\uFF35\xD9\xDA\xDB\u0168\u1E78\u016A\u1E7A\u016C\xDC\u01DB\u01D7\u01D5\u01D9\u1EE6\u016E\u0170\u01D3\u0214\u0216\u01AF\u1EEA\u1EE8\u1EEE\u1EEC\u1EF0\u1EE4\u1E72\u0172\u1E76\u1E74\u0244"},{base:"V",chars:"\u24CB\uFF36\u1E7C\u1E7E\u01B2\uA75E\u0245"},{base:"VY",chars:"\uA760"},{base:"W",chars:"\u24CC\uFF37\u1E80\u1E82\u0174\u1E86\u1E84\u1E88\u2C72"},{base:"X",chars:"\u24CD\uFF38\u1E8A\u1E8C"},{base:"Y",chars:"\u24CE\uFF39\u1EF2\xDD\u0176\u1EF8\u0232\u1E8E\u0178\u1EF6\u1EF4\u01B3\u024E\u1EFE"},{base:"Z",chars:"\u24CF\uFF3A\u0179\u1E90\u017B\u017D\u1E92\u1E94\u01B5\u0224\u2C7F\u2C6B\uA762"},{base:"a",chars:"\u24D0\uFF41\u1E9A\xE0\xE1\xE2\u1EA7\u1EA5\u1EAB\u1EA9\xE3\u0101\u0103\u1EB1\u1EAF\u1EB5\u1EB3\u0227\u01E1\xE4\u01DF\u1EA3\xE5\u01FB\u01CE\u0201\u0203\u1EA1\u1EAD\u1EB7\u1E01\u0105\u2C65\u0250\u0251"},{base:"aa",chars:"\uA733"},{base:"ae",chars:"\xE6\u01FD\u01E3"},{base:"ao",chars:"\uA735"},{base:"au",chars:"\uA737"},{base:"av",chars:"\uA739\uA73B"},{base:"ay",chars:"\uA73D"},{base:"b",chars:"\u24D1\uFF42\u1E03\u1E05\u1E07\u0180\u0183\u0253\u0182"},{base:"c",chars:"\uFF43\u24D2\u0107\u0109\u010B\u010D\xE7\u1E09\u0188\u023C\uA73F\u2184"},{base:"d",chars:"\u24D3\uFF44\u1E0B\u010F\u1E0D\u1E11\u1E13\u1E0F\u0111\u018C\u0256\u0257\u018B\u13E7\u0501\uA7AA"},{base:"dh",chars:"\xF0"},{base:"dz",chars:"\u01F3\u01C6"},{base:"e",chars:"\u24D4\uFF45\xE8\xE9\xEA\u1EC1\u1EBF\u1EC5\u1EC3\u1EBD\u0113\u1E15\u1E17\u0115\u0117\xEB\u1EBB\u011B\u0205\u0207\u1EB9\u1EC7\u0229\u1E1D\u0119\u1E19\u1E1B\u0247\u01DD"},{base:"f",chars:"\u24D5\uFF46\u1E1F\u0192"},{base:"ff",chars:"\uFB00"},{base:"fi",chars:"\uFB01"},{base:"fl",chars:"\uFB02"},{base:"ffi",chars:"\uFB03"},{base:"ffl",chars:"\uFB04"},{base:"g",chars:"\u24D6\uFF47\u01F5\u011D\u1E21\u011F\u0121\u01E7\u0123\u01E5\u0260\uA7A1\uA77F\u1D79"},{base:"h",chars:"\u24D7\uFF48\u0125\u1E23\u1E27\u021F\u1E25\u1E29\u1E2B\u1E96\u0127\u2C68\u2C76\u0265"},{base:"hv",chars:"\u0195"},{base:"i",chars:"\u24D8\uFF49\xEC\xED\xEE\u0129\u012B\u012D\xEF\u1E2F\u1EC9\u01D0\u0209\u020B\u1ECB\u012F\u1E2D\u0268\u0131"},{base:"j",chars:"\u24D9\uFF4A\u0135\u01F0\u0249"},{base:"k",chars:"\u24DA\uFF4B\u1E31\u01E9\u1E33\u0137\u1E35\u0199\u2C6A\uA741\uA743\uA745\uA7A3"},{base:"l",chars:"\u24DB\uFF4C\u0140\u013A\u013E\u1E37\u1E39\u013C\u1E3D\u1E3B\u017F\u0142\u019A\u026B\u2C61\uA749\uA781\uA747\u026D"},{base:"lj",chars:"\u01C9"},{base:"m",chars:"\u24DC\uFF4D\u1E3F\u1E41\u1E43\u0271\u026F"},{base:"n",chars:"\u24DD\uFF4E\u01F9\u0144\xF1\u1E45\u0148\u1E47\u0146\u1E4B\u1E49\u019E\u0272\u0149\uA791\uA7A5\u043B\u0509"},{base:"nj",chars:"\u01CC"},{base:"o",chars:"\u24DE\uFF4F\xF2\xF3\xF4\u1ED3\u1ED1\u1ED7\u1ED5\xF5\u1E4D\u022D\u1E4F\u014D\u1E51\u1E53\u014F\u022F\u0231\xF6\u022B\u1ECF\u0151\u01D2\u020D\u020F\u01A1\u1EDD\u1EDB\u1EE1\u1EDF\u1EE3\u1ECD\u1ED9\u01EB\u01ED\xF8\u01FF\uA74B\uA74D\u0275\u0254\u1D11"},{base:"oe",chars:"\u0153"},{base:"oi",chars:"\u01A3"},{base:"oo",chars:"\uA74F"},{base:"ou",chars:"\u0223"},{base:"p",chars:"\u24DF\uFF50\u1E55\u1E57\u01A5\u1D7D\uA751\uA753\uA755\u03C1"},{base:"q",chars:"\u24E0\uFF51\u024B\uA757\uA759"},{base:"r",chars:"\u24E1\uFF52\u0155\u1E59\u0159\u0211\u0213\u1E5B\u1E5D\u0157\u1E5F\u024D\u027D\uA75B\uA7A7\uA783"},{base:"s",chars:"\u24E2\uFF53\u015B\u1E65\u015D\u1E61\u0161\u1E67\u1E63\u1E69\u0219\u015F\u023F\uA7A9\uA785\u1E9B\u0282"},{base:"ss",chars:"\xDF"},{base:"t",chars:"\u24E3\uFF54\u1E6B\u1E97\u0165\u1E6D\u021B\u0163\u1E71\u1E6F\u0167\u01AD\u0288\u2C66\uA787"},{base:"th",chars:"\xFE"},{base:"tz",chars:"\uA729"},{base:"u",chars:"\u24E4\uFF55\xF9\xFA\xFB\u0169\u1E79\u016B\u1E7B\u016D\xFC\u01DC\u01D8\u01D6\u01DA\u1EE7\u016F\u0171\u01D4\u0215\u0217\u01B0\u1EEB\u1EE9\u1EEF\u1EED\u1EF1\u1EE5\u1E73\u0173\u1E77\u1E75\u0289"},{base:"v",chars:"\u24E5\uFF56\u1E7D\u1E7F\u028B\uA75F\u028C"},{base:"vy",chars:"\uA761"},{base:"w",chars:"\u24E6\uFF57\u1E81\u1E83\u0175\u1E87\u1E85\u1E98\u1E89\u2C73"},{base:"x",chars:"\u24E7\uFF58\u1E8B\u1E8D"},{base:"y",chars:"\u24E8\uFF59\u1EF3\xFD\u0177\u1EF9\u0233\u1E8F\xFF\u1EF7\u1E99\u1EF5\u01B4\u024F\u1EFF"},{base:"z",chars:"\u24E9\uFF5A\u017A\u1E91\u017C\u017E\u1E93\u1E95\u01B6\u0225\u0240\u2C6C\uA763"}],kh={};for(bc=0;bc<ad.length;bc+=1)for(Th=ad[bc].chars,sd=0;sd<Th.length;sd+=1)kh[Th[sd]]=ad[bc].base;var Th,sd,bc;function Bv(t){return t.replace(/[^\u0000-\u007e]/g,function(e){return kh[e]||e})}cd.replacementList=ad;cd.diacriticsMap=kh;});var Mh=se(ve=>{var Tv=x5(),kv=A5(),Pv=_5().remove,na={},ld={},dd={},xc={},Dh={};Tv.forEach(function(t){let e=t;ld[e[0]]=e[1],dd[e[1]]=e[0],xc[e[2]]=e[0],Dh[e[0]]=e[2];});function C5(t){return ("000"+(t||"")).slice(-3)}function Sc(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function Nv(t,e){return Object.keys(t).reduce(function(r,i){let n=t[i];return r[i]=e(n,i),r},{})}function w5(t,e){switch(t){case "official":return Array.isArray(e)?e[0]:e;case "all":return typeof e=="string"?[e]:e;case "alias":return Array.isArray(e)?e[1]||e[0]:e;default:throw new TypeError("LocaleNameType must be one of these: all, official, alias!")}}ve.registerLocale=function(t){if(!t.locale)throw new TypeError("Missing localeData.locale");if(!t.countries)throw new TypeError("Missing localeData.countries");na[t.locale]=t.countries;};function Rh(t){return dd[t]}ve.alpha3ToAlpha2=Rh;function Oh(t){return ld[t]}ve.alpha2ToAlpha3=Oh;function Dv(t){return Dh[Rh(t)]}ve.alpha3ToNumeric=Dv;function Rv(t){return Dh[t]}ve.alpha2ToNumeric=Rv;function Ph(t){let e=C5(t);return Oh(xc[e])}ve.numericToAlpha3=Ph;function Nh(t){let e=C5(t);return xc[e]}ve.numericToAlpha2=Nh;function Ov(t){if(typeof t=="string"){if(/^[0-9]*$/.test(t))return Ph(t);if(t.length===2)return Oh(t.toUpperCase());if(t.length===3)return t.toUpperCase()}if(typeof t=="number")return Ph(t)}ve.toAlpha3=Ov;function I5(t){if(typeof t=="string"){if(/^[0-9]*$/.test(t))return Nh(t);if(t.length===2)return t.toUpperCase();if(t.length===3)return Rh(t.toUpperCase())}if(typeof t=="number")return Nh(t)}ve.toAlpha2=I5;ve.getName=function(t,e,r={}){"select"in r||(r.select="official");try{let n=na[e.toLowerCase()][I5(t)];return w5(r.select,n)}catch{return}};ve.getNames=function(t,e={}){"select"in e||(e.select="official");let r=na[t.toLowerCase()];return r===void 0?{}:Nv(r,function(i){return w5(e.select,i)})};ve.getAlpha2Code=function(t,e){let r=n=>n.toLowerCase(),i=(n,o)=>r(n)===r(o);try{let n=na[e.toLowerCase()];for(let o in n)if(Sc(n,o)){if(typeof n[o]=="string"&&i(n[o],t))return o;if(Array.isArray(n[o])){for(let s of n[o])if(i(s,t))return o}}return}catch{return}};ve.getSimpleAlpha2Code=function(t,e){let r=n=>Pv(n.toLowerCase()),i=(n,o)=>r(n)===r(o);try{let n=na[e.toLowerCase()];for(let o in n)if(Sc(n,o)){if(typeof n[o]=="string"&&i(n[o],t))return o;if(Array.isArray(n[o])){for(let s of n[o])if(i(s,t))return o}}return}catch{return}};ve.getAlpha2Codes=function(){return ld};ve.getAlpha3Code=function(t,e){let r=ve.getAlpha2Code(t,e);if(r)return ve.toAlpha3(r)};ve.getSimpleAlpha3Code=function(t,e){let r=ve.getSimpleAlpha2Code(t,e);if(r)return ve.toAlpha3(r)};ve.getAlpha3Codes=function(){return dd};ve.getNumericCodes=function(){return xc};ve.langs=function(){return Object.keys(na)};ve.getSupportedLanguages=function(){return kv};ve.isValid=function(t){if(!t)return false;let e=t.toString().toUpperCase();return Sc(dd,e)||Sc(ld,e)||Sc(xc,e)};});var E5=se((dj,v5)=>{v5.exports={};});var T5=se((uj,B5)=>{B5.exports={};});var P5=se((fj,k5)=>{k5.exports={};});var Fh=se((pj,N5)=>{N5.exports={};});var Tc,Ae,Yh,Pi,jh,Qh,Jh,Sd,Cc,aa,e2,Cd,xd,Ad,vc={},Ec=[],A8=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,kc=Array.isArray;function Jr(t,e){for(var r in e)t[r]=e[r];return t}function wd(t){t&&t.parentNode&&t.parentNode.removeChild(t);}function Pc(t,e,r){var i,n,o,s={};for(o in e)o=="key"?i=e[o]:o=="ref"?n=e[o]:s[o]=e[o];if(arguments.length>2&&(s.children=arguments.length>3?Tc.call(arguments,2):r),typeof t=="function"&&t.defaultProps!=null)for(o in t.defaultProps)s[o]===void 0&&(s[o]=t.defaultProps[o]);return wc(t,s,i,n,null)}function wc(t,e,r,i,n){var o={type:t,props:e,key:r,ref:i,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:n??++Yh,__i:-1,__u:0};return n==null&&Ae.vnode!=null&&Ae.vnode(o),o}function ar(t){return t.children}function Ic(t,e){this.props=t,this.context=e;}function Oo(t,e){if(e==null)return t.__?Oo(t.__,t.__i+1):null;for(var r;e<t.__k.length;e++)if((r=t.__k[e])!=null&&r.__e!=null)return r.__e;return typeof t.type=="function"?Oo(t):null}function _8(t){if(t.__P&&t.__d){var e=t.__v,r=e.__e,i=[],n=[],o=Jr({},e);o.__v=e.__v+1,Ae.vnode&&Ae.vnode(o),Id(t.__P,o,e,t.__n,t.__P.namespaceURI,32&e.__u?[r]:null,i,r??Oo(e),!!(32&e.__u),n),o.__v=e.__v,o.__.__k[o.__i]=o,n2(i,o,n),e.__e=e.__=null,o.__e!=r&&t2(o);}}function t2(t){if((t=t.__)!=null&&t.__c!=null)return t.__e=t.__c.base=null,t.__k.some(function(e){if(e!=null&&e.__e!=null)return t.__e=t.__c.base=e.__e}),t2(t)}function Xh(t){(!t.__d&&(t.__d=true)&&Pi.push(t)&&!Bc.__r++||jh!=Ae.debounceRendering)&&((jh=Ae.debounceRendering)||Qh)(Bc);}function Bc(){try{for(var t,e=1;Pi.length;)Pi.length>e&&Pi.sort(Jh),t=Pi.shift(),e=Pi.length,_8(t);}finally{Pi.length=Bc.__r=0;}}function r2(t,e,r,i,n,o,s,a,l,c,d){var u,h,y,b,x,m,A,_=i&&i.__k||Ec,w=e.length;for(l=C8(r,e,_,l,w),u=0;u<w;u++)(y=r.__k[u])!=null&&(h=y.__i!=-1&&_[y.__i]||vc,y.__i=u,m=Id(t,y,h,n,o,s,a,l,c,d),b=y.__e,y.ref&&h.ref!=y.ref&&(h.ref&&vd(h.ref,null,y),d.push(y.ref,y.__c||b,y)),x==null&&b!=null&&(x=b),(A=!!(4&y.__u))||h.__k===y.__k?(l=i2(y,l,t,A),A&&h.__e&&(h.__e=null)):typeof y.type=="function"&&m!==void 0?l=m:b&&(l=b.nextSibling),y.__u&=-7);return r.__e=x,l}function C8(t,e,r,i,n){var o,s,a,l,c,d=r.length,u=d,h=0;for(t.__k=new Array(n),o=0;o<n;o++)(s=e[o])!=null&&typeof s!="boolean"&&typeof s!="function"?(typeof s=="string"||typeof s=="number"||typeof s=="bigint"||s.constructor==String?s=t.__k[o]=wc(null,s,null,null,null):kc(s)?s=t.__k[o]=wc(ar,{children:s},null,null,null):s.constructor===void 0&&s.__b>0?s=t.__k[o]=wc(s.type,s.props,s.key,s.ref?s.ref:null,s.__v):t.__k[o]=s,l=o+h,s.__=t,s.__b=t.__b+1,a=null,(c=s.__i=w8(s,r,l,u))!=-1&&(u--,(a=r[c])&&(a.__u|=2)),a==null||a.__v==null?(c==-1&&(n>d?h--:n<d&&h++),typeof s.type!="function"&&(s.__u|=4)):c!=l&&(c==l-1?h--:c==l+1?h++:(c>l?h--:h++,s.__u|=4))):t.__k[o]=null;if(u)for(o=0;o<d;o++)(a=r[o])!=null&&(2&a.__u)==0&&(a.__e==i&&(i=Oo(a)),s2(a,a));return i}function i2(t,e,r,i){var n,o;if(typeof t.type=="function"){for(n=t.__k,o=0;n&&o<n.length;o++)n[o]&&(n[o].__=t,e=i2(n[o],e,r,i));return e}t.__e!=e&&(i&&(e&&t.type&&!e.parentNode&&(e=Oo(t)),r.insertBefore(t.__e,e||null)),e=t.__e);do e=e&&e.nextSibling;while(e!=null&&e.nodeType==8);return e}function w8(t,e,r,i){var n,o,s,a=t.key,l=t.type,c=e[r],d=c!=null&&(2&c.__u)==0;if(c===null&&a==null||d&&a==c.key&&l==c.type)return r;if(i>(d?1:0)){for(n=r-1,o=r+1;n>=0||o<e.length;)if((c=e[s=n>=0?n--:o++])!=null&&(2&c.__u)==0&&a==c.key&&l==c.type)return s}return -1}function Wh(t,e,r){e[0]=="-"?t.setProperty(e,r??""):t[e]=r==null?"":typeof r!="number"||A8.test(e)?r:r+"px";}function _c(t,e,r,i,n){var o,s;e:if(e=="style")if(typeof r=="string")t.style.cssText=r;else {if(typeof i=="string"&&(t.style.cssText=i=""),i)for(e in i)r&&e in r||Wh(t.style,e,"");if(r)for(e in r)i&&r[e]==i[e]||Wh(t.style,e,r[e]);}else if(e[0]=="o"&&e[1]=="n")o=e!=(e=e.replace(e2,"$1")),s=e.toLowerCase(),e=s in t||e=="onFocusOut"||e=="onFocusIn"?s.slice(2):e.slice(2),t.l||(t.l={}),t.l[e+o]=r,r?i?r[aa]=i[aa]:(r[aa]=Cd,t.addEventListener(e,o?Ad:xd,o)):t.removeEventListener(e,o?Ad:xd,o);else {if(n=="http://www.w3.org/2000/svg")e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(e!="width"&&e!="height"&&e!="href"&&e!="list"&&e!="form"&&e!="tabIndex"&&e!="download"&&e!="rowSpan"&&e!="colSpan"&&e!="role"&&e!="popover"&&e in t)try{t[e]=r??"";break e}catch{}typeof r=="function"||(r==null||r===false&&e[4]!="-"?t.removeAttribute(e):t.setAttribute(e,e=="popover"&&r==1?"":r));}}function Zh(t){return function(e){if(this.l){var r=this.l[e.type+t];if(e[Cc]==null)e[Cc]=Cd++;else if(e[Cc]<r[aa])return;return r(Ae.event?Ae.event(e):e)}}}function Id(t,e,r,i,n,o,s,a,l,c){var d,u,h,y,b,x,m,A,_,w,I,N,H,O,U,F=e.type;if(e.constructor!==void 0)return null;128&r.__u&&(l=!!(32&r.__u),o=[a=e.__e=r.__e]),(d=Ae.__b)&&d(e);e:if(typeof F=="function")try{if(A=e.props,_=F.prototype&&F.prototype.render,w=(d=F.contextType)&&i[d.__c],I=d?w?w.props.value:d.__:i,r.__c?m=(u=e.__c=r.__c).__=u.__E:(_?e.__c=u=new F(A,I):(e.__c=u=new Ic(A,I),u.constructor=F,u.render=v8),w&&w.sub(u),u.state||(u.state={}),u.__n=i,h=u.__d=!0,u.__h=[],u._sb=[]),_&&u.__s==null&&(u.__s=u.state),_&&F.getDerivedStateFromProps!=null&&(u.__s==u.state&&(u.__s=Jr({},u.__s)),Jr(u.__s,F.getDerivedStateFromProps(A,u.__s))),y=u.props,b=u.state,u.__v=e,h)_&&F.getDerivedStateFromProps==null&&u.componentWillMount!=null&&u.componentWillMount(),_&&u.componentDidMount!=null&&u.__h.push(u.componentDidMount);else {if(_&&F.getDerivedStateFromProps==null&&A!==y&&u.componentWillReceiveProps!=null&&u.componentWillReceiveProps(A,I),e.__v==r.__v||!u.__e&&u.shouldComponentUpdate!=null&&u.shouldComponentUpdate(A,u.__s,I)===!1){e.__v!=r.__v&&(u.props=A,u.state=u.__s,u.__d=!1),e.__e=r.__e,e.__k=r.__k,e.__k.some(function(T){T&&(T.__=e);}),Ec.push.apply(u.__h,u._sb),u._sb=[],u.__h.length&&s.push(u);break e}u.componentWillUpdate!=null&&u.componentWillUpdate(A,u.__s,I),_&&u.componentDidUpdate!=null&&u.__h.push(function(){u.componentDidUpdate(y,b,x);});}if(u.context=I,u.props=A,u.__P=t,u.__e=!1,N=Ae.__r,H=0,_)u.state=u.__s,u.__d=!1,N&&N(e),d=u.render(u.props,u.state,u.context),Ec.push.apply(u.__h,u._sb),u._sb=[];else do u.__d=!1,N&&N(e),d=u.render(u.props,u.state,u.context),u.state=u.__s;while(u.__d&&++H<25);u.state=u.__s,u.getChildContext!=null&&(i=Jr(Jr({},i),u.getChildContext())),_&&!h&&u.getSnapshotBeforeUpdate!=null&&(x=u.getSnapshotBeforeUpdate(y,b)),O=d!=null&&d.type===ar&&d.key==null?o2(d.props.children):d,a=r2(t,kc(O)?O:[O],e,r,i,n,o,s,a,l,c),u.base=e.__e,e.__u&=-161,u.__h.length&&s.push(u),m&&(u.__E=u.__=null);}catch(T){if(e.__v=null,l||o!=null)if(T.then){for(e.__u|=l?160:128;a&&a.nodeType==8&&a.nextSibling;)a=a.nextSibling;o[o.indexOf(a)]=null,e.__e=a;}else {for(U=o.length;U--;)wd(o[U]);_d(e);}else e.__e=r.__e,e.__k=r.__k,T.then||_d(e);Ae.__e(T,e,r);}else o==null&&e.__v==r.__v?(e.__k=r.__k,e.__e=r.__e):a=e.__e=I8(r.__e,e,r,i,n,o,s,l,c);return (d=Ae.diffed)&&d(e),128&e.__u?void 0:a}function _d(t){t&&(t.__c&&(t.__c.__e=true),t.__k&&t.__k.some(_d));}function n2(t,e,r){for(var i=0;i<r.length;i++)vd(r[i],r[++i],r[++i]);Ae.__c&&Ae.__c(e,t),t.some(function(n){try{t=n.__h,n.__h=[],t.some(function(o){o.call(n);});}catch(o){Ae.__e(o,n.__v);}});}function o2(t){return typeof t!="object"||t==null||t.__b>0?t:kc(t)?t.map(o2):t.constructor!==void 0?null:Jr({},t)}function I8(t,e,r,i,n,o,s,a,l){var c,d,u,h,y,b,x,m=r.props||vc,A=e.props,_=e.type;if(_=="svg"?n="http://www.w3.org/2000/svg":_=="math"?n="http://www.w3.org/1998/Math/MathML":n||(n="http://www.w3.org/1999/xhtml"),o!=null){for(c=0;c<o.length;c++)if((y=o[c])&&"setAttribute"in y==!!_&&(_?y.localName==_:y.nodeType==3)){t=y,o[c]=null;break}}if(t==null){if(_==null)return document.createTextNode(A);t=document.createElementNS(n,_,A.is&&A),a&&(Ae.__m&&Ae.__m(e,o),a=false),o=null;}if(_==null)m===A||a&&t.data==A||(t.data=A);else {if(o=_=="textarea"&&A.defaultValue!=null?null:o&&Tc.call(t.childNodes),!a&&o!=null)for(m={},c=0;c<t.attributes.length;c++)m[(y=t.attributes[c]).name]=y.value;for(c in m)y=m[c],c=="dangerouslySetInnerHTML"?u=y:c=="children"||c in A||c=="value"&&"defaultValue"in A||c=="checked"&&"defaultChecked"in A||_c(t,c,null,y,n);for(c in A)y=A[c],c=="children"?h=y:c=="dangerouslySetInnerHTML"?d=y:c=="value"?b=y:c=="checked"?x=y:a&&typeof y!="function"||m[c]===y||_c(t,c,y,m[c],n);if(d)a||u&&(d.__html==u.__html||d.__html==t.innerHTML)||(t.innerHTML=d.__html),e.__k=[];else if(u&&(t.innerHTML=""),r2(e.type=="template"?t.content:t,kc(h)?h:[h],e,r,i,_=="foreignObject"?"http://www.w3.org/1999/xhtml":n,o,s,o?o[0]:r.__k&&Oo(r,0),a,l),o!=null)for(c=o.length;c--;)wd(o[c]);a&&_!="textarea"||(c="value",_=="progress"&&b==null?t.removeAttribute("value"):b!=null&&(b!==t[c]||_=="progress"&&!b||_=="option"&&b!=m[c])&&_c(t,c,b,m[c],n),c="checked",x!=null&&x!=t[c]&&_c(t,c,x,m[c],n));}return t}function vd(t,e,r){try{if(typeof t=="function"){var i=typeof t.__u=="function";i&&t.__u(),i&&e==null||(t.__u=t(e));}else t.current=e;}catch(n){Ae.__e(n,r);}}function s2(t,e,r){var i,n;if(Ae.unmount&&Ae.unmount(t),(i=t.ref)&&(i.current&&i.current!=t.__e||vd(i,null,e)),(i=t.__c)!=null){if(i.componentWillUnmount)try{i.componentWillUnmount();}catch(o){Ae.__e(o,e);}i.base=i.__P=null;}if(i=t.__k)for(n=0;n<i.length;n++)i[n]&&s2(i[n],e,r||typeof t.type!="function");r||wd(t.__e),t.__c=t.__=t.__e=void 0;}function v8(t,e,r){return this.constructor(t,r)}function Nc(t,e,r){var i,n,o,s;e==document&&(e=document.documentElement),Ae.__&&Ae.__(t,e),n=(i="undefined"=="function")?null:e.__k,o=[],s=[],Id(e,t=(e).__k=Pc(ar,null,[t]),n||vc,vc,e.namespaceURI,n?null:e.firstChild?Tc.call(e.childNodes):null,o,n?n.__e:e.firstChild,i,s),n2(o,t,s);}Tc=Ec.slice,Ae={__e:function(t,e,r,i){for(var n,o,s;e=e.__;)if((n=e.__c)&&!n.__)try{if((o=n.constructor)&&o.getDerivedStateFromError!=null&&(n.setState(o.getDerivedStateFromError(t)),s=n.__d),n.componentDidCatch!=null&&(n.componentDidCatch(t,i||{}),s=n.__d),s)return n.__E=n}catch(a){t=a;}throw t}},Yh=0,Ic.prototype.setState=function(t,e){var r;r=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=Jr({},this.state),typeof t=="function"&&(t=t(Jr({},r),this.props)),t&&Jr(r,t),t!=null&&this.__v&&(e&&this._sb.push(e),Xh(this));},Ic.prototype.forceUpdate=function(t){this.__v&&(this.__e=true,t&&this.__h.push(t),Xh(this));},Ic.prototype.render=ar,Pi=[],Qh=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Jh=function(t,e){return t.__v.__b-e.__v.__b},Bc.__r=0,Sd=Math.random().toString(8),Cc="__d"+Sd,aa="__a"+Sd,e2=/(PointerCapture)$|Capture$/i,Cd=0,xd=Zh(false),Ad=Zh(true);var Mo,Te,Ed,a2,ca=0,m2=[],ke=Ae,c2=ke.__b,l2=ke.__r,d2=ke.diffed,u2=ke.__c,f2=ke.unmount,p2=ke.__;function Rc(t,e){ke.__h&&ke.__h(Te,t,ca||e),ca=0;var r=Te.__H||(Te.__H={__:[],__h:[]});return t>=r.__.length&&r.__.push({}),r.__[t]}function cr(t){return ca=1,E8(b2,t)}function E8(t,e,r){var i=Rc(Mo++,2);if(i.t=t,!i.__c&&(i.__=[b2(void 0,e),function(a){var l=i.__N?i.__N[0]:i.__[0],c=i.t(l,a);l!==c&&(i.__N=[c,i.__[1]],i.__c.setState({}));}],i.__c=Te,!Te.__f)){var n=function(a,l,c){if(!i.__c.__H)return true;var d=i.__c.__H.__.filter(function(h){return h.__c});if(d.every(function(h){return !h.__N}))return !o||o.call(this,a,l,c);var u=i.__c.props!==a;return d.some(function(h){if(h.__N){var y=h.__[0];h.__=h.__N,h.__N=void 0,y!==h.__[0]&&(u=true);}}),o&&o.call(this,a,l,c)||u};Te.__f=true;var o=Te.shouldComponentUpdate,s=Te.componentWillUpdate;Te.componentWillUpdate=function(a,l,c){if(this.__e){var d=o;o=void 0,n(a,l,c),o=d;}s&&s.call(this,a,l,c);},Te.shouldComponentUpdate=n;}return i.__N||i.__}function Oc(t,e){var r=Rc(Mo++,3);!ke.__s&&kd(r.__H,e)&&(r.__=t,r.u=e,Te.__H.__h.push(r));}function g2(t,e){var r=Rc(Mo++,4);!ke.__s&&kd(r.__H,e)&&(r.__=t,r.u=e,Te.__h.push(r));}function Fo(t){return ca=5,y2(function(){return {current:t}},[])}function y2(t,e){var r=Rc(Mo++,7);return kd(r.__H,e)&&(r.__=t(),r.__H=e,r.__h=t),r.__}function Td(t,e){return ca=8,y2(function(){return t},e)}function B8(){for(var t;t=m2.shift();){var e=t.__H;if(t.__P&&e)try{e.__h.some(Dc),e.__h.some(Bd),e.__h=[];}catch(r){e.__h=[],ke.__e(r,t.__v);}}}ke.__b=function(t){Te=null,c2&&c2(t);},ke.__=function(t,e){t&&e.__k&&e.__k.__m&&(t.__m=e.__k.__m),p2&&p2(t,e);},ke.__r=function(t){l2&&l2(t),Mo=0;var e=(Te=t.__c).__H;e&&(Ed===Te?(e.__h=[],Te.__h=[],e.__.some(function(r){r.__N&&(r.__=r.__N),r.u=r.__N=void 0;})):(e.__h.some(Dc),e.__h.some(Bd),e.__h=[],Mo=0)),Ed=Te;},ke.diffed=function(t){d2&&d2(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(m2.push(e)!==1&&a2===ke.requestAnimationFrame||((a2=ke.requestAnimationFrame)||T8)(B8)),e.__H.__.some(function(r){r.u&&(r.__H=r.u),r.u=void 0;})),Ed=Te=null;},ke.__c=function(t,e){e.some(function(r){try{r.__h.some(Dc),r.__h=r.__h.filter(function(i){return !i.__||Bd(i)});}catch(i){e.some(function(n){n.__h&&(n.__h=[]);}),e=[],ke.__e(i,r.__v);}}),u2&&u2(t,e);},ke.unmount=function(t){f2&&f2(t);var e,r=t.__c;r&&r.__H&&(r.__H.__.some(function(i){try{Dc(i);}catch(n){e=n;}}),r.__H=void 0,e&&ke.__e(e,r.__v));};var h2=typeof requestAnimationFrame=="function";function T8(t){var e,r=function(){clearTimeout(i),h2&&cancelAnimationFrame(e),setTimeout(t);},i=setTimeout(r,35);h2&&(e=requestAnimationFrame(r));}function Dc(t){var e=Te,r=t.__c;typeof r=="function"&&(t.__c=void 0,r()),Te=e;}function Bd(t){var e=Te;t.__c=t.__(),Te=e;}function kd(t,e){return !t||t.length!==e.length||e.some(function(r,i){return r!==t[i]})}function b2(t,e){return typeof e=="function"?e(t):e}var S2="https://zkpassport.id/r",x2="https://apps.apple.com/us/app/zkpassport/id6477371975",A2="https://play.google.com/store/apps/details?id=app.zkpassport.zkpassport",la='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30 30" fill="none" aria-hidden="true"><path d="M15.0417 29.516C23.0399 29.516 29.5237 23.0338 29.5237 15.0378C29.5237 7.04166 23.0399 0.559547 15.0417 0.559547C7.04352 0.559547 0.559692 7.04166 0.559692 15.0378C0.559692 23.0338 7.04352 29.516 15.0417 29.516Z" fill="#2139A3"/><path d="M15.0417 0C23.349 0 30.0834 6.73263 30.0834 15.0377C30.0834 23.3429 23.349 30.0755 15.0417 30.0755C6.73441 30.0755 0 23.3429 0 15.0377C0 6.73263 6.73441 0 15.0417 0ZM15.0417 1.60869C7.62309 1.60869 1.60911 7.62108 1.60911 15.0377C1.60911 22.4544 7.62309 28.4668 15.0417 28.4668C22.4603 28.4668 28.4743 22.4544 28.4743 15.0377C28.4743 7.62108 22.4603 1.60869 15.0417 1.60869ZM15.0592 3.09498C21.6662 3.09498 27.0226 8.44173 27.0226 15.0377C27.0226 21.6338 21.6662 26.9805 15.0592 26.9805C8.45221 26.9805 3.09579 21.6338 3.09579 15.0377C3.09579 8.44173 8.45221 3.09498 15.0592 3.09498ZM9.96458 22.0322L6.92138 22.0322C8.39067 23.7337 10.3865 24.9694 12.6564 25.4872C11.5835 24.7598 10.6605 23.5567 9.96458 22.0322ZM23.197 22.0322L20.1538 22.0322C19.4579 23.5567 18.5349 24.7598 17.4621 25.4874C19.7319 24.9694 21.7277 23.7337 23.197 22.0322ZM14.3421 22.032L11.2161 22.0321C12.0187 23.8592 13.1229 25.1125 14.3421 25.4638L14.3421 22.032ZM18.8674 22.0321L15.7413 22.032L15.7414 25.4638C16.9606 25.1125 18.0648 23.8591 18.8674 22.0321ZM25.7572 15.9821L21.5259 15.982C21.4396 17.8044 21.1057 19.5076 20.5786 20.9831L23.9963 20.983C24.9699 19.5278 25.5963 17.8215 25.7572 15.9821ZM8.59253 15.982L4.36123 15.9821C4.5221 17.8215 5.14847 19.5278 6.1221 20.983L9.53983 20.9831C9.01269 19.5076 8.67877 17.8044 8.59253 15.982ZM20.1638 15.9821L15.7413 15.982V20.9829L19.2733 20.983C19.7636 19.5382 20.0831 17.8314 20.1638 15.9821ZM14.3421 15.982L9.91967 15.9821C10.0003 17.8314 10.3198 19.5382 10.8101 20.983L14.3421 20.9829V15.982ZM24.2843 9.54718L20.7326 9.54709C21.2388 11.1259 21.5307 12.9383 21.5474 14.8629L25.7969 14.8629L25.7969 14.8605C25.7653 12.9205 25.2174 11.1057 24.2843 9.54718ZM9.38584 9.54709L5.83411 9.54718C4.9006 11.1063 4.35262 12.922 4.32152 14.8629L8.57108 14.8629L8.57113 14.8531C8.58872 12.9322 8.88051 11.1232 9.38584 9.54709ZM19.4086 9.54708L15.7413 9.54722V14.8629L20.183 14.8629C20.1655 12.9105 19.8822 11.0944 19.4086 9.54708ZM14.3421 9.54722L10.6748 9.54708C10.2012 11.0944 9.91791 12.9105 9.90041 14.8629L14.3421 14.8629V9.54722ZM17.462 4.5883L17.5252 4.6316C18.6751 5.43583 19.6492 6.78889 20.3507 8.49789H23.5684C22.073 6.56232 19.9294 5.15119 17.462 4.5883ZM12.6563 4.58812L12.6442 4.59108C10.182 5.15582 8.04296 6.5655 6.54996 8.49789H9.76772C10.4821 6.75769 11.479 5.38655 12.6563 4.58812ZM15.7414 4.64663L15.7413 8.49807L19.0424 8.49792C18.2293 6.4439 17.0518 5.02425 15.7414 4.64663ZM11.0411 8.49792L14.3421 8.49807L14.3421 4.64662C13.0317 5.02423 11.8541 6.44388 11.0411 8.49792Z" fill="url(#zkp-mark-grad)"/><defs><linearGradient id="zkp-mark-grad" x1="15.0417" y1="0" x2="15.0417" y2="30.0755" gradientUnits="userSpaceOnUse"><stop stop-color="#F2DCB0"/><stop offset="1" stop-color="#F6D38F"/></linearGradient></defs></svg>',_2=`
2
9
  <svg width="100%" height="100%" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg" aria-hidden="true">
3
10
  <defs>
4
11
  <linearGradient id="zkp-spin-mark-grad" x1="15.0417" y1="0" x2="15.0417" y2="30.0755" gradientUnits="userSpaceOnUse">
@@ -11,7 +18,7 @@ import x1 from'qrcode';import {ZKPassport}from'@zkpassport/sdk';export{ASEAN_COU
11
18
  <path d="M15.0417 0C23.349 0 30.0834 6.73263 30.0834 15.0377C30.0834 23.3429 23.349 30.0755 15.0417 30.0755C6.73441 30.0755 0 23.3429 0 15.0377C0 6.73263 6.73441 0 15.0417 0ZM15.0417 1.60869C7.62309 1.60869 1.60911 7.62108 1.60911 15.0377C1.60911 22.4544 7.62309 28.4668 15.0417 28.4668C22.4603 28.4668 28.4743 22.4544 28.4743 15.0377C28.4743 7.62108 22.4603 1.60869 15.0417 1.60869ZM15.0592 3.09498C21.6662 3.09498 27.0226 8.44173 27.0226 15.0377C27.0226 21.6338 21.6662 26.9805 15.0592 26.9805C8.45221 26.9805 3.09579 21.6338 3.09579 15.0377C3.09579 8.44173 8.45221 3.09498 15.0592 3.09498ZM9.96458 22.0322L6.92138 22.0322C8.39067 23.7337 10.3865 24.9694 12.6564 25.4872C11.5835 24.7598 10.6605 23.5567 9.96458 22.0322ZM23.197 22.0322L20.1538 22.0322C19.4579 23.5567 18.5349 24.7598 17.4621 25.4874C19.7319 24.9694 21.7277 23.7337 23.197 22.0322ZM14.3421 22.032L11.2161 22.0321C12.0187 23.8592 13.1229 25.1125 14.3421 25.4638L14.3421 22.032ZM18.8674 22.0321L15.7413 22.032L15.7414 25.4638C16.9606 25.1125 18.0648 23.8591 18.8674 22.0321ZM25.7572 15.9821L21.5259 15.982C21.4396 17.8044 21.1057 19.5076 20.5786 20.9831L23.9963 20.983C24.9699 19.5278 25.5963 17.8215 25.7572 15.9821ZM8.59253 15.982L4.36123 15.9821C4.5221 17.8215 5.14847 19.5278 6.1221 20.983L9.53983 20.9831C9.01269 19.5076 8.67877 17.8044 8.59253 15.982ZM20.1638 15.9821L15.7413 15.982V20.9829L19.2733 20.983C19.7636 19.5382 20.0831 17.8314 20.1638 15.9821ZM14.3421 15.982L9.91967 15.9821C10.0003 17.8314 10.3198 19.5382 10.8101 20.983L14.3421 20.9829V15.982ZM24.2843 9.54718L20.7326 9.54709C21.2388 11.1259 21.5307 12.9383 21.5474 14.8629L25.7969 14.8629L25.7969 14.8605C25.7653 12.9205 25.2174 11.1057 24.2843 9.54718ZM9.38584 9.54709L5.83411 9.54718C4.9006 11.1063 4.35262 12.922 4.32152 14.8629L8.57108 14.8629L8.57113 14.8531C8.58872 12.9322 8.88051 11.1232 9.38584 9.54709ZM19.4086 9.54708L15.7413 9.54722V14.8629L20.183 14.8629C20.1655 12.9105 19.8822 11.0944 19.4086 9.54708ZM14.3421 9.54722L10.6748 9.54708C10.2012 11.0944 9.91791 12.9105 9.90041 14.8629L14.3421 14.8629V9.54722ZM17.462 4.5883L17.5252 4.6316C18.6751 5.43583 19.6492 6.78889 20.3507 8.49789H23.5684C22.073 6.56232 19.9294 5.15119 17.462 4.5883ZM12.6563 4.58812L12.6442 4.59108C10.182 5.15582 8.04296 6.5655 6.54996 8.49789H9.76772C10.4821 6.75769 11.479 5.38655 12.6563 4.58812ZM15.7414 4.64663L15.7413 8.49807L19.0424 8.49792C18.2293 6.4439 17.0518 5.02425 15.7414 4.64663ZM11.0411 8.49792L14.3421 8.49807L14.3421 4.64662C13.0317 5.02423 11.8541 6.44388 11.0411 8.49792Z" fill="url(#zkp-spin-mark-grad)"/>
12
19
  </g>
13
20
  <circle class="zkp-spinner-arc" cx="50" cy="50" r="27" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-dasharray="42 128"/>
14
- </svg>`,Xe='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M3 7V5a2 2 0 0 1 2-2h2"/><path d="M17 3h2a2 2 0 0 1 2 2v2"/><path d="M21 17v2a2 2 0 0 1-2 2h-2"/><path d="M7 21H5a2 2 0 0 1-2-2v-2"/><line x1="7" y1="12" x2="17" y2="12"/></svg>',e1='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z"/></svg>',t1='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/><polyline points="7 10 12 15 17 10"/><line x1="12" y1="15" x2="12" y2="3"/></svg>',me='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round"><polyline points="20 6 9 17 4 12"/></svg>',r1='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><line x1="6" y1="6" x2="18" y2="18"/><line x1="6" y1="18" x2="18" y2="6"/></svg>',n1='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="5" y="2" width="14" height="20" rx="2.5" ry="2.5"/><line x1="11" y1="18" x2="13" y2="18"/></svg>',o1='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="23 4 23 10 17 10"/><polyline points="1 20 1 14 7 14"/><path d="M3.51 9a9 9 0 0 1 14.85-3.36L23 10M1 14l4.64 4.36A9 9 0 0 0 20.49 15"/></svg>',a1={ariaLabel:"Download on the App Store",svg:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 119.66407 40" role="img" aria-hidden="true"><path d="M110.13477,0H9.53468c-.3667,0-.729,0-1.09473.002-.30615.002-.60986.00781-.91895.0127A13.21476,13.21476,0,0,0,5.5171.19141a6.66509,6.66509,0,0,0-1.90088.627A6.43779,6.43779,0,0,0,1.99757,1.99707,6.25844,6.25844,0,0,0,.81935,3.61816a6.60119,6.60119,0,0,0-.625,1.90332,12.993,12.993,0,0,0-.1792,2.002C.00587,7.83008.00489,8.1377,0,8.44434V31.5586c.00489.3105.00587.6113.01515.9219a12.99232,12.99232,0,0,0,.1792,2.0019,6.58756,6.58756,0,0,0,.625,1.9043A6.20778,6.20778,0,0,0,1.99757,38.001a6.27445,6.27445,0,0,0,1.61865,1.1787,6.70082,6.70082,0,0,0,1.90088.6308,13.45514,13.45514,0,0,0,2.0039.1768c.30909.0068.6128.0107.91895.0107C8.80567,40,9.168,40,9.53468,40H110.13477c.3594,0,.7246,0,1.084-.002.3047,0,.6172-.0039.9219-.0107a13.279,13.279,0,0,0,2-.1768,6.80432,6.80432,0,0,0,1.9082-.6308,6.27742,6.27742,0,0,0,1.6172-1.1787,6.39482,6.39482,0,0,0,1.1816-1.6143,6.60413,6.60413,0,0,0,.6191-1.9043,13.50643,13.50643,0,0,0,.1856-2.0019c.0039-.3106.0039-.6114.0039-.9219.0078-.3633.0078-.7246.0078-1.0938V9.53613c0-.36621,0-.72949-.0078-1.09179,0-.30664,0-.61426-.0039-.9209a13.5071,13.5071,0,0,0-.1856-2.002,6.6177,6.6177,0,0,0-.6191-1.90332,6.46619,6.46619,0,0,0-2.7988-2.7998,6.76754,6.76754,0,0,0-1.9082-.627,13.04394,13.04394,0,0,0-2-.17676c-.3047-.00488-.6172-.01074-.9219-.01269-.3594-.002-.7246-.002-1.084-.002Z" fill="#a6a6a6"/><path d="M8.44483,39.125c-.30468,0-.602-.0039-.90429-.0107a12.68714,12.68714,0,0,1-1.86914-.1631,5.88381,5.88381,0,0,1-1.65674-.5479,5.40573,5.40573,0,0,1-1.397-1.0166,5.32082,5.32082,0,0,1-1.02051-1.3965,5.72186,5.72186,0,0,1-.543-1.6572,12.41351,12.41351,0,0,1-.1665-1.875c-.00634-.2109-.01464-.9131-.01464-.9131V8.44434S.88185,7.75293.8877,7.5498a12.37039,12.37039,0,0,1,.16553-1.87207,5.7555,5.7555,0,0,1,.54346-1.6621A5.37349,5.37349,0,0,1,2.61183,2.61768,5.56543,5.56543,0,0,1,4.01417,1.59521a5.82309,5.82309,0,0,1,1.65332-.54394A12.58589,12.58589,0,0,1,7.543.88721L8.44532.875H111.21387l.9131.0127a12.38493,12.38493,0,0,1,1.8584.16259,5.93833,5.93833,0,0,1,1.6709.54785,5.59374,5.59374,0,0,1,2.415,2.41993,5.76267,5.76267,0,0,1,.5352,1.64892,12.995,12.995,0,0,1,.1738,1.88721c.0029.2832.0029.5874.0029.89014.0079.375.0079.73193.0079,1.09179V30.4648c0,.3633,0,.7178-.0079,1.0752,0,.3252,0,.6231-.0039.9297a12.73126,12.73126,0,0,1-.1709,1.8535,5.739,5.739,0,0,1-.54,1.67,5.48029,5.48029,0,0,1-1.0156,1.3857,5.4129,5.4129,0,0,1-1.3994,1.0225,5.86168,5.86168,0,0,1-1.668.5498,12.54218,12.54218,0,0,1-1.8692.1631c-.2929.0068-.5996.0107-.8974.0107l-1.084.002Z"/><path d="M24.76888,20.30068a4.94881,4.94881,0,0,1,2.35656-4.15206,5.06566,5.06566,0,0,0-3.99116-2.15768c-1.67924-.17626-3.30719,1.00483-4.1629,1.00483-.87227,0-2.18977-.98733-3.6085-.95814a5.31529,5.31529,0,0,0-4.47292,2.72787c-1.934,3.34842-.49141,8.26947,1.3612,10.97608.9269,1.32535,2.01018,2.8058,3.42763,2.7533,1.38706-.05753,1.9051-.88448,3.5794-.88448,1.65876,0,2.14479.88448,3.591.8511,1.48838-.02416,2.42613-1.33124,3.32051-2.66914a10.962,10.962,0,0,0,1.51842-3.09251A4.78205,4.78205,0,0,1,24.76888,20.30068Z" fill="#fff"/><path d="M22.03725,12.21089a4.87248,4.87248,0,0,0,1.11452-3.49062,4.95746,4.95746,0,0,0-3.20758,1.65961,4.63634,4.63634,0,0,0-1.14371,3.36139A4.09905,4.09905,0,0,0,22.03725,12.21089Z" fill="#fff"/><path d="M42.30227,27.13965h-4.7334l-1.13672,3.35645H34.42727l4.4834-12.418h2.083l4.4834,12.418H43.438ZM38.0591,25.59082h3.752l-1.84961-5.44727h-.05176Z" fill="#fff"/><path d="M55.15969,25.96973c0,2.81348-1.50586,4.62109-3.77832,4.62109a3.0693,3.0693,0,0,1-2.84863-1.584h-.043v4.48438h-1.8584V21.44238H48.4302v1.50586h.03418a3.21162,3.21162,0,0,1,2.88281-1.60059C53.645,21.34766,55.15969,23.16406,55.15969,25.96973Zm-1.91016,0c0-1.833-.94727-3.03809-2.39258-3.03809-1.41992,0-2.375,1.23047-2.375,3.03809,0,1.82422.95508,3.0459,2.375,3.0459C52.30227,29.01563,53.24953,27.81934,53.24953,25.96973Z" fill="#fff"/><path d="M65.12453,25.96973c0,2.81348-1.50586,4.62109-3.77832,4.62109a3.0693,3.0693,0,0,1-2.84863-1.584h-.043v4.48438h-1.8584V21.44238H58.395v1.50586h.03418A3.21162,3.21162,0,0,1,61.312,21.34766C63.60988,21.34766,65.12453,23.16406,65.12453,25.96973Zm-1.91016,0c0-1.833-.94727-3.03809-2.39258-3.03809-1.41992,0-2.375,1.23047-2.375,3.03809,0,1.82422.95508,3.0459,2.375,3.0459C62.26711,29.01563,63.21438,27.81934,63.21438,25.96973Z" fill="#fff"/><path d="M71.71047,27.03613c.1377,1.23145,1.334,2.04,2.96875,2.04,1.56641,0,2.69336-.80859,2.69336-1.91895,0-.96387-.67969-1.541-2.28906-1.93652l-1.60937-.3877c-2.28027-.55078-3.33887-1.61719-3.33887-3.34766,0-2.14258,1.86719-3.61426,4.51855-3.61426,2.624,0,4.42285,1.47168,4.4834,3.61426h-1.876c-.1123-1.23926-1.13672-1.9873-2.63379-1.9873s-2.52148.75684-2.52148,1.8584c0,.87793.6543,1.39453,2.25488,1.79l1.36816.33594c2.54785.60254,3.60645,1.626,3.60645,3.44238,0,2.32324-1.85059,3.77832-4.79395,3.77832-2.75391,0-4.61328-1.4209-4.7334-3.667Z" fill="#fff"/><path d="M83.34621,19.2998v2.14258h1.72168v1.47168H83.34621v4.99121c0,.77539.34473,1.13672,1.10156,1.13672a5.80752,5.80752,0,0,0,.61133-.043v1.46289a5.10351,5.10351,0,0,1-1.03223.08594c-1.833,0-2.54785-.68848-2.54785-2.44434V22.91406H80.16262V21.44238H81.479V19.2998Z" fill="#fff"/><path d="M86.065,25.96973c0-2.84863,1.67773-4.63867,4.29395-4.63867,2.625,0,4.29492,1.79,4.29492,4.63867,0,2.85645-1.66113,4.63867-4.29492,4.63867C87.72609,30.6084,86.065,28.82617,86.065,25.96973Zm6.69531,0c0-1.9541-.89551-3.10742-2.40137-3.10742s-2.40039,1.16211-2.40039,3.10742c0,1.96191.89453,3.10645,2.40039,3.10645S92.76027,27.93164,92.76027,25.96973Z" fill="#fff"/><path d="M96.18606,21.44238h1.77246v1.541h.043a2.1594,2.1594,0,0,1,2.17773-1.63574,2.86616,2.86616,0,0,1,.63672.06934v1.73828a2.59794,2.59794,0,0,0-.835-.1123,1.87264,1.87264,0,0,0-1.93652,2.083v5.37012h-1.8584Z" fill="#fff"/><path d="M109.3843,27.83691c-.25,1.64355-1.85059,2.77148-3.89844,2.77148-2.63379,0-4.26855-1.76465-4.26855-4.5957,0-2.83984,1.64355-4.68164,4.19043-4.68164,2.50488,0,4.08008,1.7207,4.08008,4.46582v.63672h-6.39453v.1123a2.358,2.358,0,0,0,2.43555,2.56445,2.04834,2.04834,0,0,0,2.09082-1.27344Zm-6.28223-2.70215h4.52637a2.1773,2.1773,0,0,0-2.2207-2.29785A2.292,2.292,0,0,0,103.10207,25.13477Z" fill="#fff"/><path d="M37.82619,8.731a2.63964,2.63964,0,0,1,2.80762,2.96484c0,1.90625-1.03027,3.002-2.80762,3.002H35.67092V8.731Zm-1.22852,5.123h1.125a1.87588,1.87588,0,0,0,1.96777-2.146,1.881,1.881,0,0,0-1.96777-2.13379h-1.125Z" fill="#fff"/><path d="M41.68068,12.44434a2.13323,2.13323,0,1,1,4.24707,0,2.13358,2.13358,0,1,1-4.24707,0Zm3.333,0c0-.97607-.43848-1.54687-1.208-1.54687-.77246,0-1.207.5708-1.207,1.54688,0,.98389.43457,1.55029,1.207,1.55029C44.57522,13.99463,45.01369,13.42432,45.01369,12.44434Z" fill="#fff"/><path d="M51.57326,14.69775h-.92187l-.93066-3.31641h-.07031l-.92676,3.31641h-.91309l-1.24121-4.50293h.90137l.80664,3.436h.06641l.92578-3.436h.85254l.92578,3.436h.07031l.80273-3.436h.88867Z" fill="#fff"/><path d="M53.85354,10.19482H54.709v.71533h.06641a1.348,1.348,0,0,1,1.34375-.80225,1.46456,1.46456,0,0,1,1.55859,1.6748v2.915h-.88867V12.00586c0-.72363-.31445-1.0835-.97168-1.0835a1.03294,1.03294,0,0,0-1.0752,1.14111v2.63428h-.88867Z" fill="#fff"/><path d="M59.09377,8.437h.88867v6.26074h-.88867Z" fill="#fff"/><path d="M61.21779,12.44434a2.13346,2.13346,0,1,1,4.24756,0,2.1338,2.1338,0,1,1-4.24756,0Zm3.333,0c0-.97607-.43848-1.54687-1.208-1.54687-.77246,0-1.207.5708-1.207,1.54688,0,.98389.43457,1.55029,1.207,1.55029C64.11232,13.99463,64.5508,13.42432,64.5508,12.44434Z" fill="#fff"/><path d="M66.4009,13.42432c0-.81055.60352-1.27783,1.6748-1.34424l1.21973-.07031v-.38867c0-.47559-.31445-.74414-.92187-.74414-.49609,0-.83984.18213-.93848.50049h-.86035c.09082-.77344.81836-1.26953,1.83984-1.26953,1.12891,0,1.76563.562,1.76563,1.51318v3.07666h-.85547v-.63281h-.07031a1.515,1.515,0,0,1-1.35254.707A1.36026,1.36026,0,0,1,66.4009,13.42432Zm2.89453-.38477v-.37646l-1.09961.07031c-.62012.0415-.90137.25244-.90137.64941,0,.40527.35156.64111.835.64111A1.0615,1.0615,0,0,0,69.29543,13.03955Z" fill="#fff"/><path d="M71.34816,12.44434c0-1.42285.73145-2.32422,1.86914-2.32422a1.484,1.484,0,0,1,1.38086.79h.06641V8.437h.88867v6.26074h-.85156v-.71143h-.07031a1.56284,1.56284,0,0,1-1.41406.78564C72.0718,14.772,71.34816,13.87061,71.34816,12.44434Zm.918,0c0,.95508.4502,1.52979,1.20313,1.52979.749,0,1.21191-.583,1.21191-1.52588,0-.93848-.46777-1.52979-1.21191-1.52979C72.72121,10.91846,72.26613,11.49707,72.26613,12.44434Z" fill="#fff"/><path d="M79.23,12.44434a2.13323,2.13323,0,1,1,4.24707,0,2.13358,2.13358,0,1,1-4.24707,0Zm3.333,0c0-.97607-.43848-1.54687-1.208-1.54687-.77246,0-1.207.5708-1.207,1.54688,0,.98389.43457,1.55029,1.207,1.55029C82.12453,13.99463,82.563,13.42432,82.563,12.44434Z" fill="#fff"/><path d="M84.66945,10.19482h.85547v.71533h.06641a1.348,1.348,0,0,1,1.34375-.80225,1.46456,1.46456,0,0,1,1.55859,1.6748v2.915H87.605V12.00586c0-.72363-.31445-1.0835-.97168-1.0835a1.03294,1.03294,0,0,0-1.0752,1.14111v2.63428h-.88867Z" fill="#fff"/><path d="M93.51516,9.07373v1.1416h.97559v.74854h-.97559V13.2793c0,.47168.19434.67822.63672.67822a2.96657,2.96657,0,0,0,.33887-.02051v.74023a2.9155,2.9155,0,0,1-.4834.04541c-.98828,0-1.38184-.34766-1.38184-1.21582v-2.543h-.71484v-.74854h.71484V9.07373Z" fill="#fff"/><path d="M95.70461,8.437h.88086v2.48145h.07031a1.3856,1.3856,0,0,1,1.373-.80664,1.48339,1.48339,0,0,1,1.55078,1.67871v2.90723H98.69v-2.688c0-.71924-.335-1.0835-.96289-1.0835a1.05194,1.05194,0,0,0-1.13379,1.1416v2.62988h-.88867Z" fill="#fff"/><path d="M104.76125,13.48193a1.828,1.828,0,0,1-1.95117,1.30273A2.04531,2.04531,0,0,1,100.73,12.46045a2.07685,2.07685,0,0,1,2.07617-2.35254c1.25293,0,2.00879.856,2.00879,2.27V12.688h-3.17969v.0498a1.1902,1.1902,0,0,0,1.19922,1.29,1.07934,1.07934,0,0,0,1.07129-.5459Zm-3.126-1.45117h2.27441a1.08647,1.08647,0,0,0-1.1084-1.1665A1.15162,1.15162,0,0,0,101.63527,12.03076Z" fill="#fff"/></svg>'},s1={ariaLabel:"Get it on Google Play",svg:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 238.96 70.87" role="img" aria-hidden="true"><rect x="-.11" width="239.17" height="70.87" rx="8.86" ry="8.86"/><path fill="#a6a6a6" d="M230.21,1.42c4.1,0,7.44,3.34,7.44,7.44v53.15c0,4.1-3.34,7.44-7.44,7.44H8.75c-4.1,0-7.44-3.34-7.44-7.44V8.86C1.31,4.76,4.65,1.42,8.75,1.42h221.46M230.21,0H8.75C3.88,0-.11,3.99-.11,8.86v53.15c0,4.87,3.99,8.86,8.86,8.86h221.46c4.87,0,8.86-3.99,8.86-8.86V8.86c0-4.87-3.99-8.86-8.86-8.86h0Z"/><g fill="#fff" stroke="#fff" stroke-miterlimit="10" stroke-width="0.2"><path d="M83.9,18.15c0,1.48-.44,2.67-1.32,3.55-1,1.05-2.3,1.57-3.9,1.57s-2.84-.53-3.91-1.59c-1.07-1.06-1.61-2.38-1.61-3.96s.54-2.89,1.61-3.96c1.07-1.06,2.38-1.6,3.91-1.6.76,0,1.49.15,2.18.44.69.3,1.25.69,1.66,1.19l-.93.94c-.7-.84-1.67-1.26-2.91-1.26-1.12,0-2.09.39-2.9,1.18s-1.22,1.81-1.22,3.06.41,2.28,1.22,3.06c.82.79,1.78,1.18,2.9,1.18,1.19,0,2.18-.4,2.97-1.19.51-.52.81-1.23.89-2.15h-3.86v-1.28h5.15c.05.28.07.54.07.8Z"/><path d="M92.07,13.71h-4.84v3.37h4.37v1.28h-4.37v3.37h4.84v1.31h-6.21v-10.63h6.21v1.31h0Z"/><path d="M97.83,23.03h-1.37v-9.32h-2.97v-1.31h7.3v1.31h-2.97s0,9.32,0,9.32Z"/><path d="M106.08,23.03v-10.63h1.36v10.63h-1.36Z"/><path d="M113.51,23.03h-1.37v-9.32h-2.97v-1.31h7.3v1.31h-2.97s0,9.32,0,9.32Z"/><path d="M130.3,21.66c-1.05,1.08-2.34,1.61-3.9,1.61s-2.85-.54-3.9-1.61c-1.05-1.07-1.57-2.39-1.57-3.94s.52-2.87,1.57-3.94c1.04-1.08,2.34-1.61,3.9-1.61s2.84.54,3.89,1.62c1.05,1.08,1.57,2.39,1.57,3.93s-.52,2.87-1.57,3.94ZM123.52,20.77c.79.8,1.75,1.19,2.89,1.19s2.1-.4,2.89-1.19c.79-.8,1.18-1.81,1.18-3.05s-.4-2.26-1.18-3.05c-.78-.8-1.75-1.19-2.89-1.19s-2.1.4-2.89,1.19c-.78.8-1.18,1.81-1.18,3.05s.4,2.26,1.18,3.05Z"/><path d="M133.79,23.03v-10.63h1.66l5.17,8.27h.06l-.06-2.05v-6.22h1.37v10.63h-1.43l-5.41-8.67h-.06l.06,2.05v6.62h-1.37,0Z"/></g><path fill="#fff" d="M120.61,38.54c-4.17,0-7.56,3.17-7.56,7.53s3.4,7.53,7.56,7.53,7.56-3.2,7.56-7.53-3.4-7.53-7.56-7.53ZM120.61,50.64c-2.28,0-4.25-1.88-4.25-4.57s1.97-4.57,4.25-4.57,4.25,1.85,4.25,4.57-1.97,4.57-4.25,4.57ZM104.11,38.54c-4.17,0-7.56,3.17-7.56,7.53s3.4,7.53,7.56,7.53,7.56-3.2,7.56-7.53-3.4-7.53-7.56-7.53ZM104.11,50.64c-2.28,0-4.25-1.88-4.25-4.57s1.97-4.57,4.25-4.57,4.25,1.85,4.25,4.57-1.97,4.57-4.25,4.57ZM84.48,40.85v3.2h7.65c-.23,1.8-.83,3.11-1.74,4.03-1.11,1.11-2.85,2.34-5.91,2.34-4.71,0-8.39-3.8-8.39-8.51s3.68-8.51,8.39-8.51c2.54,0,4.4,1,5.76,2.28l2.26-2.26c-1.91-1.83-4.45-3.22-8.02-3.22-6.45,0-11.87,5.25-11.87,11.7s5.42,11.7,11.87,11.7c3.48,0,6.11-1.14,8.16-3.28,2.11-2.11,2.77-5.08,2.77-7.48,0-.74-.06-1.43-.17-2h-10.76,0ZM164.75,43.33c-.63-1.68-2.54-4.8-6.45-4.8s-7.11,3.05-7.11,7.53c0,4.22,3.2,7.53,7.48,7.53,3.45,0,5.45-2.11,6.28-3.34l-2.57-1.71c-.86,1.26-2.03,2.08-3.71,2.08s-2.88-.77-3.65-2.28l10.08-4.17-.34-.86h0ZM154.47,45.84c-.09-2.91,2.26-4.4,3.94-4.4,1.31,0,2.43.66,2.8,1.6l-6.74,2.8ZM146.28,53.15h3.31v-22.15h-3.31v22.15ZM140.86,40.22h-.11c-.74-.88-2.17-1.68-3.97-1.68-3.77,0-7.22,3.31-7.22,7.56s3.45,7.51,7.22,7.51c1.8,0,3.22-.8,3.97-1.71h.11v1.08c0,2.88-1.54,4.42-4.03,4.42-2.03,0-3.28-1.46-3.8-2.68l-2.88,1.2c.83,2,3.03,4.45,6.68,4.45,3.88,0,7.16-2.28,7.16-7.85v-13.53h-3.14v1.23ZM137.06,50.64c-2.28,0-4.2-1.91-4.2-4.54s1.91-4.6,4.2-4.6,4.03,1.94,4.03,4.6-1.77,4.54-4.03,4.54ZM180.26,31h-7.92v22.15h3.31v-8.39h4.62c3.66,0,7.27-2.65,7.27-6.88s-3.6-6.88-7.27-6.88ZM180.34,41.68h-4.7v-7.59h4.7c2.47,0,3.87,2.05,3.87,3.8s-1.4,3.8-3.87,3.8h0ZM200.77,38.5c-2.39,0-4.87,1.05-5.9,3.39l2.94,1.23c.63-1.23,1.79-1.62,3.02-1.62,1.71,0,3.45,1.03,3.48,2.85v.23c-.6-.34-1.88-.86-3.45-.86-3.16,0-6.38,1.74-6.38,4.99,0,2.96,2.59,4.87,5.5,4.87,2.22,0,3.45-1,4.22-2.16h.11v1.71h3.19v-8.49c0-3.93-2.94-6.13-6.73-6.13h0ZM200.38,50.63c-1.08,0-2.59-.54-2.59-1.88,0-1.71,1.88-2.37,3.5-2.37,1.45,0,2.14.31,3.02.74-.26,2.05-2.02,3.5-3.93,3.5ZM219.12,38.98l-3.79,9.6h-.11l-3.93-9.6h-3.56l5.9,13.42-3.36,7.47h3.45l9.09-20.89h-3.68ZM189.35,53.15h3.31v-22.15h-3.31v22.15Z"/><path fill="#ea4335" d="M36.6,34.41l-18.86,20.02s0,0,0,.01c.58,2.17,2.56,3.77,4.92,3.77.94,0,1.83-.26,2.58-.7l.06-.04,21.23-12.25-9.94-10.82Z"/><path fill="#fbbc04" d="M55.68,31h-.02s-9.17-5.33-9.17-5.33l-10.33,9.19,10.36,10.36,9.12-5.26c1.6-.86,2.68-2.55,2.68-4.49s-1.07-3.61-2.65-4.47h0Z"/><path fill="#4285f4" d="M17.73,16.44c-.11.42-.17.86-.17,1.31v35.38c0,.45.06.89.17,1.31l19.51-19.51-19.51-18.49Z"/><path fill="#34a853" d="M36.74,35.43l9.76-9.76-21.21-12.3c-.77-.46-1.67-.73-2.63-.73-2.36,0-4.34,1.6-4.92,3.78h0s19,19,19,19h0Z"/></svg>'};var i1=`@layer zkpassport {
21
+ </svg>`,C2='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M3 7V5a2 2 0 0 1 2-2h2"/><path d="M17 3h2a2 2 0 0 1 2 2v2"/><path d="M21 17v2a2 2 0 0 1-2 2h-2"/><path d="M7 21H5a2 2 0 0 1-2-2v-2"/><line x1="7" y1="12" x2="17" y2="12"/></svg>',w2='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z"/></svg>',I2='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/><polyline points="7 10 12 15 17 10"/><line x1="12" y1="15" x2="12" y2="3"/></svg>',Uo='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round"><polyline points="20 6 9 17 4 12"/></svg>',v2='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><line x1="6" y1="6" x2="18" y2="18"/><line x1="6" y1="18" x2="18" y2="6"/></svg>',E2='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="5" y="2" width="14" height="20" rx="2.5" ry="2.5"/><line x1="11" y1="18" x2="13" y2="18"/></svg>',B2='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="23 4 23 10 17 10"/><polyline points="1 20 1 14 7 14"/><path d="M3.51 9a9 9 0 0 1 14.85-3.36L23 10M1 14l4.64 4.36A9 9 0 0 0 20.49 15"/></svg>',T2={ariaLabel:"Download on the App Store",svg:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 119.66407 40" role="img" aria-hidden="true"><path d="M110.13477,0H9.53468c-.3667,0-.729,0-1.09473.002-.30615.002-.60986.00781-.91895.0127A13.21476,13.21476,0,0,0,5.5171.19141a6.66509,6.66509,0,0,0-1.90088.627A6.43779,6.43779,0,0,0,1.99757,1.99707,6.25844,6.25844,0,0,0,.81935,3.61816a6.60119,6.60119,0,0,0-.625,1.90332,12.993,12.993,0,0,0-.1792,2.002C.00587,7.83008.00489,8.1377,0,8.44434V31.5586c.00489.3105.00587.6113.01515.9219a12.99232,12.99232,0,0,0,.1792,2.0019,6.58756,6.58756,0,0,0,.625,1.9043A6.20778,6.20778,0,0,0,1.99757,38.001a6.27445,6.27445,0,0,0,1.61865,1.1787,6.70082,6.70082,0,0,0,1.90088.6308,13.45514,13.45514,0,0,0,2.0039.1768c.30909.0068.6128.0107.91895.0107C8.80567,40,9.168,40,9.53468,40H110.13477c.3594,0,.7246,0,1.084-.002.3047,0,.6172-.0039.9219-.0107a13.279,13.279,0,0,0,2-.1768,6.80432,6.80432,0,0,0,1.9082-.6308,6.27742,6.27742,0,0,0,1.6172-1.1787,6.39482,6.39482,0,0,0,1.1816-1.6143,6.60413,6.60413,0,0,0,.6191-1.9043,13.50643,13.50643,0,0,0,.1856-2.0019c.0039-.3106.0039-.6114.0039-.9219.0078-.3633.0078-.7246.0078-1.0938V9.53613c0-.36621,0-.72949-.0078-1.09179,0-.30664,0-.61426-.0039-.9209a13.5071,13.5071,0,0,0-.1856-2.002,6.6177,6.6177,0,0,0-.6191-1.90332,6.46619,6.46619,0,0,0-2.7988-2.7998,6.76754,6.76754,0,0,0-1.9082-.627,13.04394,13.04394,0,0,0-2-.17676c-.3047-.00488-.6172-.01074-.9219-.01269-.3594-.002-.7246-.002-1.084-.002Z" fill="#a6a6a6"/><path d="M8.44483,39.125c-.30468,0-.602-.0039-.90429-.0107a12.68714,12.68714,0,0,1-1.86914-.1631,5.88381,5.88381,0,0,1-1.65674-.5479,5.40573,5.40573,0,0,1-1.397-1.0166,5.32082,5.32082,0,0,1-1.02051-1.3965,5.72186,5.72186,0,0,1-.543-1.6572,12.41351,12.41351,0,0,1-.1665-1.875c-.00634-.2109-.01464-.9131-.01464-.9131V8.44434S.88185,7.75293.8877,7.5498a12.37039,12.37039,0,0,1,.16553-1.87207,5.7555,5.7555,0,0,1,.54346-1.6621A5.37349,5.37349,0,0,1,2.61183,2.61768,5.56543,5.56543,0,0,1,4.01417,1.59521a5.82309,5.82309,0,0,1,1.65332-.54394A12.58589,12.58589,0,0,1,7.543.88721L8.44532.875H111.21387l.9131.0127a12.38493,12.38493,0,0,1,1.8584.16259,5.93833,5.93833,0,0,1,1.6709.54785,5.59374,5.59374,0,0,1,2.415,2.41993,5.76267,5.76267,0,0,1,.5352,1.64892,12.995,12.995,0,0,1,.1738,1.88721c.0029.2832.0029.5874.0029.89014.0079.375.0079.73193.0079,1.09179V30.4648c0,.3633,0,.7178-.0079,1.0752,0,.3252,0,.6231-.0039.9297a12.73126,12.73126,0,0,1-.1709,1.8535,5.739,5.739,0,0,1-.54,1.67,5.48029,5.48029,0,0,1-1.0156,1.3857,5.4129,5.4129,0,0,1-1.3994,1.0225,5.86168,5.86168,0,0,1-1.668.5498,12.54218,12.54218,0,0,1-1.8692.1631c-.2929.0068-.5996.0107-.8974.0107l-1.084.002Z"/><path d="M24.76888,20.30068a4.94881,4.94881,0,0,1,2.35656-4.15206,5.06566,5.06566,0,0,0-3.99116-2.15768c-1.67924-.17626-3.30719,1.00483-4.1629,1.00483-.87227,0-2.18977-.98733-3.6085-.95814a5.31529,5.31529,0,0,0-4.47292,2.72787c-1.934,3.34842-.49141,8.26947,1.3612,10.97608.9269,1.32535,2.01018,2.8058,3.42763,2.7533,1.38706-.05753,1.9051-.88448,3.5794-.88448,1.65876,0,2.14479.88448,3.591.8511,1.48838-.02416,2.42613-1.33124,3.32051-2.66914a10.962,10.962,0,0,0,1.51842-3.09251A4.78205,4.78205,0,0,1,24.76888,20.30068Z" fill="#fff"/><path d="M22.03725,12.21089a4.87248,4.87248,0,0,0,1.11452-3.49062,4.95746,4.95746,0,0,0-3.20758,1.65961,4.63634,4.63634,0,0,0-1.14371,3.36139A4.09905,4.09905,0,0,0,22.03725,12.21089Z" fill="#fff"/><path d="M42.30227,27.13965h-4.7334l-1.13672,3.35645H34.42727l4.4834-12.418h2.083l4.4834,12.418H43.438ZM38.0591,25.59082h3.752l-1.84961-5.44727h-.05176Z" fill="#fff"/><path d="M55.15969,25.96973c0,2.81348-1.50586,4.62109-3.77832,4.62109a3.0693,3.0693,0,0,1-2.84863-1.584h-.043v4.48438h-1.8584V21.44238H48.4302v1.50586h.03418a3.21162,3.21162,0,0,1,2.88281-1.60059C53.645,21.34766,55.15969,23.16406,55.15969,25.96973Zm-1.91016,0c0-1.833-.94727-3.03809-2.39258-3.03809-1.41992,0-2.375,1.23047-2.375,3.03809,0,1.82422.95508,3.0459,2.375,3.0459C52.30227,29.01563,53.24953,27.81934,53.24953,25.96973Z" fill="#fff"/><path d="M65.12453,25.96973c0,2.81348-1.50586,4.62109-3.77832,4.62109a3.0693,3.0693,0,0,1-2.84863-1.584h-.043v4.48438h-1.8584V21.44238H58.395v1.50586h.03418A3.21162,3.21162,0,0,1,61.312,21.34766C63.60988,21.34766,65.12453,23.16406,65.12453,25.96973Zm-1.91016,0c0-1.833-.94727-3.03809-2.39258-3.03809-1.41992,0-2.375,1.23047-2.375,3.03809,0,1.82422.95508,3.0459,2.375,3.0459C62.26711,29.01563,63.21438,27.81934,63.21438,25.96973Z" fill="#fff"/><path d="M71.71047,27.03613c.1377,1.23145,1.334,2.04,2.96875,2.04,1.56641,0,2.69336-.80859,2.69336-1.91895,0-.96387-.67969-1.541-2.28906-1.93652l-1.60937-.3877c-2.28027-.55078-3.33887-1.61719-3.33887-3.34766,0-2.14258,1.86719-3.61426,4.51855-3.61426,2.624,0,4.42285,1.47168,4.4834,3.61426h-1.876c-.1123-1.23926-1.13672-1.9873-2.63379-1.9873s-2.52148.75684-2.52148,1.8584c0,.87793.6543,1.39453,2.25488,1.79l1.36816.33594c2.54785.60254,3.60645,1.626,3.60645,3.44238,0,2.32324-1.85059,3.77832-4.79395,3.77832-2.75391,0-4.61328-1.4209-4.7334-3.667Z" fill="#fff"/><path d="M83.34621,19.2998v2.14258h1.72168v1.47168H83.34621v4.99121c0,.77539.34473,1.13672,1.10156,1.13672a5.80752,5.80752,0,0,0,.61133-.043v1.46289a5.10351,5.10351,0,0,1-1.03223.08594c-1.833,0-2.54785-.68848-2.54785-2.44434V22.91406H80.16262V21.44238H81.479V19.2998Z" fill="#fff"/><path d="M86.065,25.96973c0-2.84863,1.67773-4.63867,4.29395-4.63867,2.625,0,4.29492,1.79,4.29492,4.63867,0,2.85645-1.66113,4.63867-4.29492,4.63867C87.72609,30.6084,86.065,28.82617,86.065,25.96973Zm6.69531,0c0-1.9541-.89551-3.10742-2.40137-3.10742s-2.40039,1.16211-2.40039,3.10742c0,1.96191.89453,3.10645,2.40039,3.10645S92.76027,27.93164,92.76027,25.96973Z" fill="#fff"/><path d="M96.18606,21.44238h1.77246v1.541h.043a2.1594,2.1594,0,0,1,2.17773-1.63574,2.86616,2.86616,0,0,1,.63672.06934v1.73828a2.59794,2.59794,0,0,0-.835-.1123,1.87264,1.87264,0,0,0-1.93652,2.083v5.37012h-1.8584Z" fill="#fff"/><path d="M109.3843,27.83691c-.25,1.64355-1.85059,2.77148-3.89844,2.77148-2.63379,0-4.26855-1.76465-4.26855-4.5957,0-2.83984,1.64355-4.68164,4.19043-4.68164,2.50488,0,4.08008,1.7207,4.08008,4.46582v.63672h-6.39453v.1123a2.358,2.358,0,0,0,2.43555,2.56445,2.04834,2.04834,0,0,0,2.09082-1.27344Zm-6.28223-2.70215h4.52637a2.1773,2.1773,0,0,0-2.2207-2.29785A2.292,2.292,0,0,0,103.10207,25.13477Z" fill="#fff"/><path d="M37.82619,8.731a2.63964,2.63964,0,0,1,2.80762,2.96484c0,1.90625-1.03027,3.002-2.80762,3.002H35.67092V8.731Zm-1.22852,5.123h1.125a1.87588,1.87588,0,0,0,1.96777-2.146,1.881,1.881,0,0,0-1.96777-2.13379h-1.125Z" fill="#fff"/><path d="M41.68068,12.44434a2.13323,2.13323,0,1,1,4.24707,0,2.13358,2.13358,0,1,1-4.24707,0Zm3.333,0c0-.97607-.43848-1.54687-1.208-1.54687-.77246,0-1.207.5708-1.207,1.54688,0,.98389.43457,1.55029,1.207,1.55029C44.57522,13.99463,45.01369,13.42432,45.01369,12.44434Z" fill="#fff"/><path d="M51.57326,14.69775h-.92187l-.93066-3.31641h-.07031l-.92676,3.31641h-.91309l-1.24121-4.50293h.90137l.80664,3.436h.06641l.92578-3.436h.85254l.92578,3.436h.07031l.80273-3.436h.88867Z" fill="#fff"/><path d="M53.85354,10.19482H54.709v.71533h.06641a1.348,1.348,0,0,1,1.34375-.80225,1.46456,1.46456,0,0,1,1.55859,1.6748v2.915h-.88867V12.00586c0-.72363-.31445-1.0835-.97168-1.0835a1.03294,1.03294,0,0,0-1.0752,1.14111v2.63428h-.88867Z" fill="#fff"/><path d="M59.09377,8.437h.88867v6.26074h-.88867Z" fill="#fff"/><path d="M61.21779,12.44434a2.13346,2.13346,0,1,1,4.24756,0,2.1338,2.1338,0,1,1-4.24756,0Zm3.333,0c0-.97607-.43848-1.54687-1.208-1.54687-.77246,0-1.207.5708-1.207,1.54688,0,.98389.43457,1.55029,1.207,1.55029C64.11232,13.99463,64.5508,13.42432,64.5508,12.44434Z" fill="#fff"/><path d="M66.4009,13.42432c0-.81055.60352-1.27783,1.6748-1.34424l1.21973-.07031v-.38867c0-.47559-.31445-.74414-.92187-.74414-.49609,0-.83984.18213-.93848.50049h-.86035c.09082-.77344.81836-1.26953,1.83984-1.26953,1.12891,0,1.76563.562,1.76563,1.51318v3.07666h-.85547v-.63281h-.07031a1.515,1.515,0,0,1-1.35254.707A1.36026,1.36026,0,0,1,66.4009,13.42432Zm2.89453-.38477v-.37646l-1.09961.07031c-.62012.0415-.90137.25244-.90137.64941,0,.40527.35156.64111.835.64111A1.0615,1.0615,0,0,0,69.29543,13.03955Z" fill="#fff"/><path d="M71.34816,12.44434c0-1.42285.73145-2.32422,1.86914-2.32422a1.484,1.484,0,0,1,1.38086.79h.06641V8.437h.88867v6.26074h-.85156v-.71143h-.07031a1.56284,1.56284,0,0,1-1.41406.78564C72.0718,14.772,71.34816,13.87061,71.34816,12.44434Zm.918,0c0,.95508.4502,1.52979,1.20313,1.52979.749,0,1.21191-.583,1.21191-1.52588,0-.93848-.46777-1.52979-1.21191-1.52979C72.72121,10.91846,72.26613,11.49707,72.26613,12.44434Z" fill="#fff"/><path d="M79.23,12.44434a2.13323,2.13323,0,1,1,4.24707,0,2.13358,2.13358,0,1,1-4.24707,0Zm3.333,0c0-.97607-.43848-1.54687-1.208-1.54687-.77246,0-1.207.5708-1.207,1.54688,0,.98389.43457,1.55029,1.207,1.55029C82.12453,13.99463,82.563,13.42432,82.563,12.44434Z" fill="#fff"/><path d="M84.66945,10.19482h.85547v.71533h.06641a1.348,1.348,0,0,1,1.34375-.80225,1.46456,1.46456,0,0,1,1.55859,1.6748v2.915H87.605V12.00586c0-.72363-.31445-1.0835-.97168-1.0835a1.03294,1.03294,0,0,0-1.0752,1.14111v2.63428h-.88867Z" fill="#fff"/><path d="M93.51516,9.07373v1.1416h.97559v.74854h-.97559V13.2793c0,.47168.19434.67822.63672.67822a2.96657,2.96657,0,0,0,.33887-.02051v.74023a2.9155,2.9155,0,0,1-.4834.04541c-.98828,0-1.38184-.34766-1.38184-1.21582v-2.543h-.71484v-.74854h.71484V9.07373Z" fill="#fff"/><path d="M95.70461,8.437h.88086v2.48145h.07031a1.3856,1.3856,0,0,1,1.373-.80664,1.48339,1.48339,0,0,1,1.55078,1.67871v2.90723H98.69v-2.688c0-.71924-.335-1.0835-.96289-1.0835a1.05194,1.05194,0,0,0-1.13379,1.1416v2.62988h-.88867Z" fill="#fff"/><path d="M104.76125,13.48193a1.828,1.828,0,0,1-1.95117,1.30273A2.04531,2.04531,0,0,1,100.73,12.46045a2.07685,2.07685,0,0,1,2.07617-2.35254c1.25293,0,2.00879.856,2.00879,2.27V12.688h-3.17969v.0498a1.1902,1.1902,0,0,0,1.19922,1.29,1.07934,1.07934,0,0,0,1.07129-.5459Zm-3.126-1.45117h2.27441a1.08647,1.08647,0,0,0-1.1084-1.1665A1.15162,1.15162,0,0,0,101.63527,12.03076Z" fill="#fff"/></svg>'},k2={ariaLabel:"Get it on Google Play",svg:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 238.96 70.87" role="img" aria-hidden="true"><rect x="-.11" width="239.17" height="70.87" rx="8.86" ry="8.86"/><path fill="#a6a6a6" d="M230.21,1.42c4.1,0,7.44,3.34,7.44,7.44v53.15c0,4.1-3.34,7.44-7.44,7.44H8.75c-4.1,0-7.44-3.34-7.44-7.44V8.86C1.31,4.76,4.65,1.42,8.75,1.42h221.46M230.21,0H8.75C3.88,0-.11,3.99-.11,8.86v53.15c0,4.87,3.99,8.86,8.86,8.86h221.46c4.87,0,8.86-3.99,8.86-8.86V8.86c0-4.87-3.99-8.86-8.86-8.86h0Z"/><g fill="#fff" stroke="#fff" stroke-miterlimit="10" stroke-width="0.2"><path d="M83.9,18.15c0,1.48-.44,2.67-1.32,3.55-1,1.05-2.3,1.57-3.9,1.57s-2.84-.53-3.91-1.59c-1.07-1.06-1.61-2.38-1.61-3.96s.54-2.89,1.61-3.96c1.07-1.06,2.38-1.6,3.91-1.6.76,0,1.49.15,2.18.44.69.3,1.25.69,1.66,1.19l-.93.94c-.7-.84-1.67-1.26-2.91-1.26-1.12,0-2.09.39-2.9,1.18s-1.22,1.81-1.22,3.06.41,2.28,1.22,3.06c.82.79,1.78,1.18,2.9,1.18,1.19,0,2.18-.4,2.97-1.19.51-.52.81-1.23.89-2.15h-3.86v-1.28h5.15c.05.28.07.54.07.8Z"/><path d="M92.07,13.71h-4.84v3.37h4.37v1.28h-4.37v3.37h4.84v1.31h-6.21v-10.63h6.21v1.31h0Z"/><path d="M97.83,23.03h-1.37v-9.32h-2.97v-1.31h7.3v1.31h-2.97s0,9.32,0,9.32Z"/><path d="M106.08,23.03v-10.63h1.36v10.63h-1.36Z"/><path d="M113.51,23.03h-1.37v-9.32h-2.97v-1.31h7.3v1.31h-2.97s0,9.32,0,9.32Z"/><path d="M130.3,21.66c-1.05,1.08-2.34,1.61-3.9,1.61s-2.85-.54-3.9-1.61c-1.05-1.07-1.57-2.39-1.57-3.94s.52-2.87,1.57-3.94c1.04-1.08,2.34-1.61,3.9-1.61s2.84.54,3.89,1.62c1.05,1.08,1.57,2.39,1.57,3.93s-.52,2.87-1.57,3.94ZM123.52,20.77c.79.8,1.75,1.19,2.89,1.19s2.1-.4,2.89-1.19c.79-.8,1.18-1.81,1.18-3.05s-.4-2.26-1.18-3.05c-.78-.8-1.75-1.19-2.89-1.19s-2.1.4-2.89,1.19c-.78.8-1.18,1.81-1.18,3.05s.4,2.26,1.18,3.05Z"/><path d="M133.79,23.03v-10.63h1.66l5.17,8.27h.06l-.06-2.05v-6.22h1.37v10.63h-1.43l-5.41-8.67h-.06l.06,2.05v6.62h-1.37,0Z"/></g><path fill="#fff" d="M120.61,38.54c-4.17,0-7.56,3.17-7.56,7.53s3.4,7.53,7.56,7.53,7.56-3.2,7.56-7.53-3.4-7.53-7.56-7.53ZM120.61,50.64c-2.28,0-4.25-1.88-4.25-4.57s1.97-4.57,4.25-4.57,4.25,1.85,4.25,4.57-1.97,4.57-4.25,4.57ZM104.11,38.54c-4.17,0-7.56,3.17-7.56,7.53s3.4,7.53,7.56,7.53,7.56-3.2,7.56-7.53-3.4-7.53-7.56-7.53ZM104.11,50.64c-2.28,0-4.25-1.88-4.25-4.57s1.97-4.57,4.25-4.57,4.25,1.85,4.25,4.57-1.97,4.57-4.25,4.57ZM84.48,40.85v3.2h7.65c-.23,1.8-.83,3.11-1.74,4.03-1.11,1.11-2.85,2.34-5.91,2.34-4.71,0-8.39-3.8-8.39-8.51s3.68-8.51,8.39-8.51c2.54,0,4.4,1,5.76,2.28l2.26-2.26c-1.91-1.83-4.45-3.22-8.02-3.22-6.45,0-11.87,5.25-11.87,11.7s5.42,11.7,11.87,11.7c3.48,0,6.11-1.14,8.16-3.28,2.11-2.11,2.77-5.08,2.77-7.48,0-.74-.06-1.43-.17-2h-10.76,0ZM164.75,43.33c-.63-1.68-2.54-4.8-6.45-4.8s-7.11,3.05-7.11,7.53c0,4.22,3.2,7.53,7.48,7.53,3.45,0,5.45-2.11,6.28-3.34l-2.57-1.71c-.86,1.26-2.03,2.08-3.71,2.08s-2.88-.77-3.65-2.28l10.08-4.17-.34-.86h0ZM154.47,45.84c-.09-2.91,2.26-4.4,3.94-4.4,1.31,0,2.43.66,2.8,1.6l-6.74,2.8ZM146.28,53.15h3.31v-22.15h-3.31v22.15ZM140.86,40.22h-.11c-.74-.88-2.17-1.68-3.97-1.68-3.77,0-7.22,3.31-7.22,7.56s3.45,7.51,7.22,7.51c1.8,0,3.22-.8,3.97-1.71h.11v1.08c0,2.88-1.54,4.42-4.03,4.42-2.03,0-3.28-1.46-3.8-2.68l-2.88,1.2c.83,2,3.03,4.45,6.68,4.45,3.88,0,7.16-2.28,7.16-7.85v-13.53h-3.14v1.23ZM137.06,50.64c-2.28,0-4.2-1.91-4.2-4.54s1.91-4.6,4.2-4.6,4.03,1.94,4.03,4.6-1.77,4.54-4.03,4.54ZM180.26,31h-7.92v22.15h3.31v-8.39h4.62c3.66,0,7.27-2.65,7.27-6.88s-3.6-6.88-7.27-6.88ZM180.34,41.68h-4.7v-7.59h4.7c2.47,0,3.87,2.05,3.87,3.8s-1.4,3.8-3.87,3.8h0ZM200.77,38.5c-2.39,0-4.87,1.05-5.9,3.39l2.94,1.23c.63-1.23,1.79-1.62,3.02-1.62,1.71,0,3.45,1.03,3.48,2.85v.23c-.6-.34-1.88-.86-3.45-.86-3.16,0-6.38,1.74-6.38,4.99,0,2.96,2.59,4.87,5.5,4.87,2.22,0,3.45-1,4.22-2.16h.11v1.71h3.19v-8.49c0-3.93-2.94-6.13-6.73-6.13h0ZM200.38,50.63c-1.08,0-2.59-.54-2.59-1.88,0-1.71,1.88-2.37,3.5-2.37,1.45,0,2.14.31,3.02.74-.26,2.05-2.02,3.5-3.93,3.5ZM219.12,38.98l-3.79,9.6h-.11l-3.93-9.6h-3.56l5.9,13.42-3.36,7.47h3.45l9.09-20.89h-3.68ZM189.35,53.15h3.31v-22.15h-3.31v22.15Z"/><path fill="#ea4335" d="M36.6,34.41l-18.86,20.02s0,0,0,.01c.58,2.17,2.56,3.77,4.92,3.77.94,0,1.83-.26,2.58-.7l.06-.04,21.23-12.25-9.94-10.82Z"/><path fill="#fbbc04" d="M55.68,31h-.02s-9.17-5.33-9.17-5.33l-10.33,9.19,10.36,10.36,9.12-5.26c1.6-.86,2.68-2.55,2.68-4.49s-1.07-3.61-2.65-4.47h0Z"/><path fill="#4285f4" d="M17.73,16.44c-.11.42-.17.86-.17,1.31v35.38c0,.45.06.89.17,1.31l19.51-19.51-19.51-18.49Z"/><path fill="#34a853" d="M36.74,35.43l9.76-9.76-21.21-12.3c-.77-.46-1.67-.73-2.63-.73-2.36,0-4.34,1.6-4.92,3.78h0s19,19,19,19h0Z"/></svg>'};var P2=`@layer zkpassport {
15
22
  .zkp-card {
16
23
  --zkp-bg: #ffffff;
17
24
  --zkp-fg: #111827;
@@ -38,8 +45,10 @@ import x1 from'qrcode';import {ZKPassport}from'@zkpassport/sdk';export{ASEAN_COU
38
45
  background: var(--zkp-bg);
39
46
  color: var(--zkp-fg);
40
47
  font-family: ui-sans-serif, system-ui, sans-serif;
48
+ text-align: left;
41
49
  font-size: 14px;
42
50
  line-height: 1.4;
51
+ min-height: 460px;
43
52
  }
44
53
 
45
54
  .zkp-card[data-theme="dark"] {
@@ -77,6 +86,19 @@ import x1 from'qrcode';import {ZKPassport}from'@zkpassport/sdk';export{ASEAN_COU
77
86
  font: inherit;
78
87
  cursor: pointer;
79
88
  }
89
+ .zkp-card button:focus-visible,
90
+ .zkp-card a:focus-visible,
91
+ .zkp-card input:focus-visible {
92
+ outline: 2px solid var(--zkp-brand);
93
+ outline-offset: 2px;
94
+ }
95
+ @media (prefers-reduced-motion: reduce) {
96
+ .zkp-card,
97
+ .zkp-card * {
98
+ animation: none !important;
99
+ transition: none !important;
100
+ }
101
+ }
80
102
 
81
103
  /* Header */
82
104
  .zkp-header {
@@ -250,11 +272,15 @@ import x1 from'qrcode';import {ZKPassport}from'@zkpassport/sdk';export{ASEAN_COU
250
272
  opacity: 0.65;
251
273
  }
252
274
  .zkp-qr-slot[data-state="generating"] .zkp-qr,
275
+ .zkp-qr-slot[data-state="local-proving"] .zkp-qr,
276
+ .zkp-qr-slot[data-state="save-offer"] .zkp-qr,
253
277
  .zkp-qr-slot[data-state="success"] .zkp-qr,
254
278
  .zkp-qr-slot[data-state="error"] .zkp-qr {
255
279
  opacity: 0.35;
256
280
  }
257
281
  .zkp-qr-slot[data-state="generating"] .zkp-qr-logo,
282
+ .zkp-qr-slot[data-state="local-proving"] .zkp-qr-logo,
283
+ .zkp-qr-slot[data-state="save-offer"] .zkp-qr-logo,
258
284
  .zkp-qr-slot[data-state="success"] .zkp-qr-logo,
259
285
  .zkp-qr-slot[data-state="error"] .zkp-qr-logo {
260
286
  opacity: 0;
@@ -262,6 +288,8 @@ import x1 from'qrcode';import {ZKPassport}from'@zkpassport/sdk';export{ASEAN_COU
262
288
  .zkp-qr-slot[data-state="connecting"] .zkp-overlay,
263
289
  .zkp-qr-slot[data-state="scanned"] .zkp-overlay,
264
290
  .zkp-qr-slot[data-state="generating"] .zkp-overlay,
291
+ .zkp-qr-slot[data-state="local-proving"] .zkp-overlay,
292
+ .zkp-qr-slot[data-state="save-offer"] .zkp-overlay,
265
293
  .zkp-qr-slot[data-state="success"] .zkp-overlay,
266
294
  .zkp-qr-slot[data-state="error"] .zkp-overlay {
267
295
  display: block;
@@ -435,28 +463,303 @@ import x1 from'qrcode';import {ZKPassport}from'@zkpassport/sdk';export{ASEAN_COU
435
463
  overflow: hidden;
436
464
  }
437
465
 
438
- /* Open-in-app deep link (mobile only, waiting state) */
466
+ /* Open-in-app deep link (mobile: primary action; shown via .zkp-open-app-block) */
439
467
  .zkp-open-app {
440
- display: none;
441
- margin: 16px 0 0;
442
- padding: 12px 16px;
443
- border-radius: 10px;
444
- background: var(--zkp-accent);
445
- color: var(--zkp-bg);
446
- font-size: 15px;
447
- font-weight: 600;
448
- text-align: center;
449
- text-decoration: none;
450
- box-shadow: 0 4px 12px rgba(17, 24, 39, 0.18);
451
- transition: transform 150ms ease;
468
+ display: none !important;
469
+ margin: 16px 0 0 !important;
470
+ padding: 16px !important;
471
+ border-radius: 8px !important;
472
+ background: var(--zkp-brand) !important;
473
+ color: var(--zkp-bg) !important;
474
+ font-size: 13px !important;
475
+ font-weight: 700 !important;
476
+ letter-spacing: 0.09em !important;
477
+ text-transform: uppercase !important;
478
+ text-align: center !important;
479
+ text-decoration: none !important;
480
+ transition: transform 150ms ease !important;
452
481
  }
453
482
  .zkp-open-app:active {
454
483
  transform: translateY(1px);
455
484
  }
456
- @media (hover: none) and (pointer: coarse) {
457
- .zkp-card[data-state="waiting"] .zkp-open-app {
458
- display: block;
485
+ .zkp-open-app-block {
486
+ display: block !important;
487
+ margin-top: 0 !important;
488
+ width: 100% !important;
489
+ box-sizing: border-box !important;
490
+ }
491
+ /* Mobile-first waiting screen: open-app primary, QR behind a toggle */
492
+ .zkp-open-app-hero {
493
+ display: flex;
494
+ flex-direction: column;
495
+ align-items: stretch;
496
+ gap: 12px;
497
+ padding: 8px 0 4px;
498
+ }
499
+ .zkp-open-app-loading {
500
+ display: flex;
501
+ }
502
+ .zkp-qr-reveal {
503
+ appearance: none !important;
504
+ -webkit-appearance: none !important;
505
+ border: none !important;
506
+ background: none !important;
507
+ padding: 4px !important;
508
+ cursor: pointer !important;
509
+ font-size: 12.5px !important;
510
+ color: var(--zkp-muted) !important;
511
+ text-decoration: underline !important;
512
+ text-underline-offset: 3px !important;
513
+ }
514
+ .zkp-inapp-hint {
515
+ margin: 0;
516
+ font-size: 12px;
517
+ line-height: 1.5;
518
+ text-align: center;
519
+ color: var(--zkp-muted);
520
+ }
521
+
522
+ /* Intro screen */
523
+ .zkp-intro {
524
+ display: flex;
525
+ flex-direction: column;
526
+ flex: 1;
527
+ gap: 16px;
528
+ margin-top: 18px;
529
+ animation: zkp-screen-in 240ms ease;
530
+ }
531
+ .zkp-screen {
532
+ display: flex;
533
+ flex-direction: column;
534
+ flex: 1;
535
+ animation: zkp-screen-in 240ms ease;
536
+ }
537
+ @keyframes zkp-screen-in {
538
+ from {
539
+ opacity: 0;
540
+ transform: translateY(4px);
541
+ }
542
+ to {
543
+ opacity: 1;
544
+ transform: none;
545
+ }
546
+ }
547
+ .zkp-intro > .zkp-divider {
548
+ margin: 2px 0;
549
+ }
550
+ /* Passport data-page style micro-label */
551
+ .zkp-eyebrow {
552
+ margin: 0 0 6px;
553
+ font-size: 11px;
554
+ font-weight: 600;
555
+ letter-spacing: 0.08em;
556
+ text-transform: uppercase;
557
+ color: var(--zkp-muted);
558
+ padding-bottom: 1rem;
559
+ }
560
+ .zkp-intro-request {
561
+ padding: 16px;
562
+ border: 1px solid var(--zkp-border);
563
+ border-radius: 12px;
564
+ background: var(--zkp-surface);
565
+ }
566
+ .zkp-skel-rows {
567
+ display: flex;
568
+ flex-direction: column;
569
+ gap: 12px;
570
+ }
571
+ .zkp-skel-row {
572
+ height: 12px;
573
+ border-radius: 6px;
574
+ background: color-mix(in srgb, var(--zkp-muted) 25%, transparent);
575
+ animation: zkp-skel-pulse 1.4s ease-in-out infinite;
576
+ }
577
+ .zkp-skel-row-detail {
578
+ height: 9px;
579
+ margin-left: 25px;
580
+ opacity: 0.7;
581
+ }
582
+ @keyframes zkp-skel-pulse {
583
+ 0%,
584
+ 100% {
585
+ opacity: 0.55;
459
586
  }
587
+ 50% {
588
+ opacity: 1;
589
+ }
590
+ }
591
+ .zkp-intro-list {
592
+ margin: 0;
593
+ padding: 0;
594
+ list-style: none;
595
+ display: flex;
596
+ flex-direction: column;
597
+ gap: 14px;
598
+ }
599
+ .zkp-intro-list li {
600
+ display: flex;
601
+ align-items: flex-start;
602
+ gap: 10px;
603
+ }
604
+ .zkp-intro-list-hint {
605
+ font-size: 12px;
606
+ line-height: 1.45;
607
+ color: var(--zkp-muted);
608
+ margin-top: 5px;
609
+ text-align: center;
610
+ }
611
+ .zkp-intro-item {
612
+ display: flex;
613
+ flex-direction: column;
614
+ gap: 3px;
615
+ min-width: 0;
616
+ }
617
+ .zkp-intro-item-title {
618
+ font-size: 14px;
619
+ font-weight: 600;
620
+ line-height: 1.35;
621
+ color: var(--zkp-fg);
622
+ }
623
+ .zkp-intro-item-detail {
624
+ font-size: 12px;
625
+ line-height: 1.4;
626
+ color: var(--zkp-muted);
627
+ }
628
+ .zkp-intro-check {
629
+ flex: none;
630
+ display: inline-flex;
631
+ width: 15px;
632
+ height: 15px;
633
+ margin-top: 2px;
634
+ color: var(--zkp-brand);
635
+ }
636
+ .zkp-intro-check svg {
637
+ width: 100%;
638
+ height: 100%;
639
+ }
640
+ .zkp-intro-explainer {
641
+ margin: 0;
642
+ font-size: 13px;
643
+ line-height: 1.5;
644
+ color: var(--zkp-muted);
645
+ }
646
+ .zkp-intro-footer {
647
+ display: flex;
648
+ flex-direction: column;
649
+ gap: 10px;
650
+ margin-top: auto;
651
+ padding-top: 4px;
652
+ text-align: center;
653
+ }
654
+ .zkp-intro-footer .zkp-divider {
655
+ margin-bottom: 4px;
656
+ }
657
+ .zkp-intro-footer-note {
658
+ margin: 0;
659
+ font-size: 11.5px;
660
+ line-height: 1.55;
661
+ color: var(--zkp-muted);
662
+ }
663
+ /* Passport-label style privacy assurances */
664
+ .zkp-privacy-strip {
665
+ display: flex;
666
+ align-items: center;
667
+ justify-content: center;
668
+ gap: 10px;
669
+ font-size: 10.5px;
670
+ font-weight: 600;
671
+ letter-spacing: 0.1em;
672
+ text-transform: uppercase;
673
+ color: var(--zkp-brand);
674
+ }
675
+ .zkp-privacy-dot {
676
+ color: var(--zkp-muted);
677
+ letter-spacing: 0;
678
+ }
679
+ .zkp-intro-question {
680
+ display: flex;
681
+ flex-direction: column;
682
+ align-items: center;
683
+ text-align: center;
684
+ gap: 8px;
685
+ padding-top: 6px;
686
+ }
687
+ .zkp-chip-symbol {
688
+ width: 54px;
689
+ color: var(--zkp-brand);
690
+ }
691
+ .zkp-chip-symbol svg {
692
+ width: 100%;
693
+ height: auto;
694
+ display: block;
695
+ }
696
+ .zkp-intro-question-hint {
697
+ margin: 0;
698
+ max-width: 340px;
699
+ font-size: 12.5px;
700
+ line-height: 1.45;
701
+ color: var(--zkp-muted);
702
+ }
703
+ .zkp-intro-question .zkp-intro-continue {
704
+ margin-top: 6px;
705
+ }
706
+
707
+ .zkp-intro-question-text {
708
+ margin: 4px 0 0;
709
+ font-size: 15px;
710
+ font-weight: 600;
711
+ color: var(--zkp-fg);
712
+ }
713
+ .zkp-intro-continue {
714
+ appearance: none !important;
715
+ -webkit-appearance: none !important;
716
+ -webkit-tap-highlight-color: transparent !important;
717
+ display: block !important;
718
+ width: 100% !important;
719
+ padding: 16px !important;
720
+ border: none !important;
721
+ border-radius: 8px !important;
722
+ background: var(--zkp-brand) !important;
723
+ color: var(--zkp-bg) !important;
724
+ font-size: 13px !important;
725
+ font-weight: 700 !important;
726
+ letter-spacing: 0.09em !important;
727
+ text-transform: uppercase !important;
728
+ text-align: center !important;
729
+ cursor: pointer !important;
730
+ transition:
731
+ filter 150ms ease,
732
+ transform 150ms ease !important;
733
+ }
734
+ .zkp-intro-continue:hover {
735
+ filter: brightness(1.08) !important;
736
+ }
737
+ .zkp-intro-continue:active {
738
+ transform: translateY(1px) !important;
739
+ filter: brightness(0.95) !important;
740
+ }
741
+ /* Dark --zkp-brand is a muted accent tint and makes the CTA read as
742
+ disabled; the primary action gets its own saturated fill */
743
+ .zkp-card[data-theme="dark"] .zkp-intro-continue {
744
+ background: #4a68dd !important;
745
+ color: #ffffff !important;
746
+ }
747
+ @media (prefers-color-scheme: dark) {
748
+ .zkp-card[data-theme="auto"] .zkp-intro-continue {
749
+ background: #4a68dd !important;
750
+ color: #ffffff !important;
751
+ }
752
+ }
753
+
754
+ .zkp-intro-link {
755
+ align-self: center !important;
756
+ padding: 4px 8px !important;
757
+ border: none !important;
758
+ background: transparent !important;
759
+ color: var(--zkp-muted) !important;
760
+ font-size: 13px !important;
761
+ text-decoration: underline !important;
762
+ cursor: pointer !important;
460
763
  }
461
764
 
462
765
  /* Retry */
@@ -564,6 +867,269 @@ import x1 from'qrcode';import {ZKPassport}from'@zkpassport/sdk';export{ASEAN_COU
564
867
  }
565
868
  }
566
869
  }
567
- `;function l1(e){let[t,r]=U("preparing"),[a,s]=U(null),[n,l]=U(null),[p,u]=U(0),i=he(e);i.current=e;let f=he(null);f.current===null&&(f.current=new ZKPassport(e.domain)),ne(()=>{let c=false,_=false;r("preparing"),s(null),l(null);let{domain:h,theme:b,query:z,onReady:m,onRetryClicked:v,onBridgeConnect:Z,onRequestReceived:L,onGeneratingProof:A,onProofGenerated:oe,onResult:q,onReject:V,onError:w,...N}=i.current,ze=()=>{_||(_=true,R(i.current.onReady));},E=T=>(...x)=>{if(!c)try{T(...x);}catch(C){console.error(C),r("error");}};return f.current.request(N).then(T=>{if(c)return;let x;try{x=z(T);}catch(C){console.error(C),r("error");return}x.onBridgeConnect(E(()=>{r(C=>C==="preparing"||C==="connecting"?"waiting":C),ze(),R(i.current.onBridgeConnect);})),x.onRequestReceived(E(()=>{r("scanned"),R(i.current.onRequestReceived);})),x.onGeneratingProof(E(()=>{r("generating"),R(i.current.onGeneratingProof);})),x.onProofGenerated(E(C=>{R(i.current.onProofGenerated,C);})),x.onResult(E(C=>{r(C.verified?"success":"error"),R(i.current.onResult,C);})),x.onReject(E(()=>{r("error"),R(i.current.onReject);})),x.onError(E(C=>{r("error"),R(i.current.onError,C);}));try{x.requestReceived()?r("scanned"):x.isBridgeConnected()?(r("waiting"),ze()):r("connecting");}catch(C){console.error(C),r("error");}s(x.url);try{l(w1(x.url));}catch(C){console.error(C),r("error");}}).catch(T=>{c||(console.error(T),r("error"));}),()=>{c=true;}},[p]);let o=Ke(()=>{R(i.current.onRetryClicked),u(c=>c+1);},[]);return {state:t,url:a,qrSvg:n,retry:o}}function w1(e){let t=x1.create(e,{errorCorrectionLevel:"Q"}),r=t.modules.size,a=t.modules.data,s=100/r,n=o=>o.toFixed(3),l=[[0,0],[0,r-7],[r-7,0]],p=(o,c)=>l.some(([_,h])=>o>=_&&o<_+7&&c>=h&&c<h+7),u="",i=s*.47;for(let o=0;o<r;o++)for(let c=0;c<r;c++){if(!a[o*r+c]||p(o,c))continue;let _=(c+.5)*s,h=(o+.5)*s;u+=`<circle cx="${n(_)}" cy="${n(h)}" r="${n(i)}"/>`;}let f="";for(let[o,c]of l){let _=(c+3.5)*s,h=(o+3.5)*s;f+=`<circle cx="${n(_)}" cy="${n(h)}" r="${n(s*3)}" fill="none" stroke="currentColor" stroke-width="${n(s)}"/><circle cx="${n(_)}" cy="${n(h)}" r="${n(s*1.5)}"/>`;}return `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" shape-rendering="geometricPrecision" fill="currentColor">${f}${u}</svg>`}function R(e,...t){if(e)try{e(...t);}catch{}}var M1=0;function d(e,t,r,a,s,n){t||(t={});var l,p,u=t;if("ref"in u)for(p in u={},t)p=="ref"?l=t[p]:u[p]=t[p];var i={type:e,props:u,key:r,ref:l,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--M1,__i:-1,__u:0,__source:s,__self:n};if(typeof e=="function"&&(l=e.defaultProps))for(p in l)u[p]===void 0&&(u[p]=l[p]);return k.vnode&&k.vnode(i),i}function ye({options:e,controlRef:t}){Qe(L1,[]);let{state:r,url:a,qrSvg:s,retry:n}=l1(e);ne(()=>{if(t)return t.current={retry:n},()=>{t.current=null;}},[n,t]);let l=e.display?.header??true,p=e.display?.steps??true,u=e.display?.appLinks??true,i=e.name??e.domain??"",f=e.logo??"",o=r==="scanned"||r==="generating"||r==="success"||r==="error",c=S1(r),_=Z1(r),h=r==="waiting"||r==="scanned";return d("div",{className:"zkp-card","data-state":r,"data-theme":e.theme??"auto",children:[h?d("button",{type:"button",className:"zkp-restart","aria-label":"Restart verification",title:"Restart verification",onClick:n,dangerouslySetInnerHTML:{__html:o1}}):null,l?d(M,{children:[d("div",{className:"zkp-header",children:[d("div",{className:"zkp-header-icons",children:[d("div",{className:"zkp-zkp-icon",dangerouslySetInnerHTML:{__html:ke}}),f?d(M,{children:[d("div",{className:"zkp-header-dots",children:[d("span",{}),d("span",{}),d("span",{})]}),d("div",{className:"zkp-app-icon-slot",children:d("img",{className:"zkp-app-icon",src:f,alt:i?`${i} icon`:""})})]}):null]}),d("p",{className:"zkp-title",children:[d("strong",{children:i||"This app"})," uses ",d("strong",{children:"ZKPassport"})," to verify identity without compromising your privacy."]})]}),d("div",{className:"zkp-divider zkp-divider-header"})]}):null,d(R1,{state:r,qrSvg:s,caption:_}),r==="waiting"&&a?d("a",{className:"zkp-open-app",href:a,children:"Open in ZKPassport App"}):null,p?d(M,{children:[d("div",{className:"zkp-divider zkp-divider-top"}),d("div",{className:"zkp-steps",children:[d(B,{status:c[0],icon:o?null:t1,children:[d("a",{href:$e,target:"_blank",rel:"noopener noreferrer",children:"Download"})," the ZKPassport mobile app."]}),d(B,{status:c[1],icon:o?null:Xe,children:"Scan this QR code with the ZKPassport app."}),d(B,{status:c[2],icon:o?null:e1,children:"Approve the request on your phone."}),d("div",{className:`zkp-collapse${o?"":" zkp-collapse-out"}`,children:d(M,{children:[d(B,{status:c[3],icon:null,children:"Generate proof on your device."}),d(B,{status:c[4],icon:null,children:"Verify the proof."})]})})]})]}):null,u?d("div",{className:`zkp-collapse${o?" zkp-collapse-out":""}`,children:d("div",{className:"zkp-collapse-inner",children:[d("div",{className:"zkp-divider zkp-divider-bottom"}),d("div",{className:"zkp-footer",children:[d("span",{className:"zkp-footer-label",children:"ZKPassport App"}),d("div",{className:"zkp-store-buttons",children:[d(p1,{href:We,badge:a1}),d(p1,{href:Ye,badge:s1})]})]})]})}):null,r==="error"?d("div",{className:"zkp-result-actions",children:d("button",{type:"button",className:"zkp-retry",onClick:n,children:"Try again"})}):null]})}function Z1(e){switch(e){case "scanned":return "Approve the request on your phone";case "generating":return "Generating proof\u2026";case "success":return "Verification complete";case "error":return "Something went wrong";default:return ""}}function S1(e){switch(e){case "scanned":return ["done","done","current","pending","pending"];case "generating":return ["done","done","done","current","pending"];case "success":return ["done","done","done","done","done"];default:return ["pending","pending","pending","pending","pending"]}}function R1({state:e,qrSvg:t,caption:r}){return d("div",{className:"zkp-qr-slot","data-state":e,children:[d("div",{className:"zkp-skeleton"}),d("div",{className:"zkp-qr",dangerouslySetInnerHTML:t?{__html:t}:void 0}),t?d("div",{className:"zkp-qr-logo",dangerouslySetInnerHTML:{__html:ke}}):null,d("div",{className:"zkp-overlay",children:[d("div",{className:"zkp-overlay-body",children:[e==="connecting"||e==="generating"?d("div",{className:"zkp-spinner",dangerouslySetInnerHTML:{__html:Je}}):null,e==="scanned"?d("div",{className:"zkp-scanned-phone",dangerouslySetInnerHTML:{__html:n1}}):null,e==="success"?d("div",{className:"zkp-check",dangerouslySetInnerHTML:{__html:me}}):null,e==="error"?d("div",{className:"zkp-error-icon",dangerouslySetInnerHTML:{__html:r1}}):null]}),r?d("div",{className:"zkp-overlay-caption",children:r},e):null]})]})}function B({status:e,icon:t,children:r}){return d("div",{className:"zkp-step","data-status":e,"data-mode":t?"icon":"progress",children:[d("div",{className:"zkp-step-marker",dangerouslySetInnerHTML:{__html:t??me}}),d("div",{className:"zkp-step-text",children:r})]})}function p1({href:e,badge:t}){return d("a",{className:"zkp-store-button",href:e,target:"_blank",rel:"noopener noreferrer","aria-label":t.ariaLabel,dangerouslySetInnerHTML:{__html:t.svg}})}var c1="data-zkpassport-ui",ge=false;function L1(){if(ge||typeof document>"u")return;if(document.querySelector(`style[${c1}]`)){ge=true;return}let e=document.createElement("style");e.setAttribute(c1,""),e.textContent=i1,document.head.appendChild(e),ge=true;}function pt(e,t){if(typeof document>"u"||typeof window>"u")throw new Error("@zkpassport/ui: mount() requires a browser environment.");if(!(e instanceof HTMLElement))throw new Error("@zkpassport/ui: mount() requires an HTMLElement as the first argument.");let r=document.createElement("div");e.appendChild(r);let a={current:null},s=t;return ee(X(ye,{options:s,controlRef:a}),r),{update(n){s=n,ee(X(ye,{options:s,controlRef:a}),r);},retry(){a.current?.retry();},unmount(){ee(null,r),r.parentNode&&r.parentNode.removeChild(r);}}}
568
- export{pt as mount};//# sourceMappingURL=index.js.map
870
+ `;var Pd=new Set;function Mc(t,e){if(Pd.has(e)||typeof document>"u")return;let r=`style[data-zkpassport-ui="${e}"]`,i=document.querySelector(r);if(i){i.textContent!==t&&(i.textContent=t),Pd.add(e);return}let n=document.createElement("style");n.setAttribute("data-zkpassport-ui",e),n.textContent=t,document.head.appendChild(n),Pd.add(e);}var W5=tt(Pm(),1);function tu(t){return t instanceof Uint8Array||ArrayBuffer.isView(t)&&t.constructor.name==="Uint8Array"&&"BYTES_PER_ELEMENT"in t&&t.BYTES_PER_ELEMENT===1}function Mi(t,e=""){if(typeof t!="number"){let r=e&&`"${e}" `;throw new TypeError(`${r}expected number, got ${typeof t}`)}if(!Number.isSafeInteger(t)||t<0){let r=e&&`"${e}" `;throw new RangeError(`${r}expected integer >= 0, got ${t}`)}}function kt(t,e,r=""){let i=tu(t),n=t?.length,o=e!==void 0;if(!i||o&&n!==e){let s=r&&`"${r}" `,a=o?` of length ${e}`:"",l=i?`length=${n}`:`type=${typeof t}`,c=s+"expected Uint8Array"+a+", got "+l;throw i?new RangeError(c):new TypeError(c)}return t}function Xc(t){if(typeof t!="function"||typeof t.create!="function")throw new TypeError("Hash must wrapped by utils.createHasher");if(Mi(t.outputLen),Mi(t.blockLen),t.outputLen<1)throw new Error('"outputLen" must be >= 1');if(t.blockLen<1)throw new Error('"blockLen" must be >= 1')}function ri(t,e=true){if(t.destroyed)throw new Error("Hash instance has been destroyed");if(e&&t.finished)throw new Error("Hash#digest() has already been called")}function zo(t,e){kt(t,void 0,"digestInto() output");let r=e.outputLen;if(t.length<r)throw new RangeError('"digestInto() output" expected to be of length >='+r)}function Xe(...t){for(let e=0;e<t.length;e++)t[e].fill(0);}function ii(t){return new DataView(t.buffer,t.byteOffset,t.byteLength)}function lr(t,e){return t<<32-e|t>>>e}function Wc(t,e){return t<<e|t>>>32-e>>>0}var Dm=typeof Uint8Array.from([]).toHex=="function"&&typeof Uint8Array.fromHex=="function",wS=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));function Bn(t){if(kt(t),Dm)return t.toHex();let e="";for(let r=0;r<t.length;r++)e+=wS[t[r]];return e}var ti={_0:48,_9:57,A:65,F:70,a:97,f:102};function Nm(t){if(t>=ti._0&&t<=ti._9)return t-ti._0;if(t>=ti.A&&t<=ti.F)return t-(ti.A-10);if(t>=ti.a&&t<=ti.f)return t-(ti.a-10)}function Tn(t){if(typeof t!="string")throw new TypeError("hex string expected, got "+typeof t);if(Dm)try{return Uint8Array.fromHex(t)}catch(n){throw n instanceof SyntaxError?new RangeError(n.message):n}let e=t.length,r=e/2;if(e%2)throw new RangeError("hex string expected, got unpadded hex of length "+e);let i=new Uint8Array(r);for(let n=0,o=0;n<r;n++,o+=2){let s=Nm(t.charCodeAt(o)),a=Nm(t.charCodeAt(o+1));if(s===void 0||a===void 0){let l=t[o]+t[o+1];throw new RangeError('hex string expected, got non-hex character "'+l+'" at index '+o)}i[n]=s*16+a;}return i}function Rm(...t){let e=0;for(let i=0;i<t.length;i++){let n=t[i];kt(n),e+=n.length;}let r=new Uint8Array(e);for(let i=0,n=0;i<t.length;i++){let o=t[i];r.set(o,n),n+=o.length;}return r}function ni(t,e={}){let r=(n,o)=>t(o).update(n).digest(),i=t(void 0);return r.outputLen=i.outputLen,r.blockLen=i.blockLen,r.canXOF=i.canXOF,r.create=n=>t(n),Object.assign(r,e),Object.freeze(r)}function Om(t=32){Mi(t,"bytesLength");let e=typeof globalThis=="object"?globalThis.crypto:null;if(typeof e?.getRandomValues!="function")throw new Error("crypto.getRandomValues must be defined");if(t>65536)throw new RangeError(`"bytesLength" expected <= 65536, got ${t}`);return e.getRandomValues(new Uint8Array(t))}var ba=t=>({oid:Uint8Array.from([6,9,96,134,72,1,101,3,4,2,t])});function Zc(t,e,r){return t&e^~t&r}function Yc(t,e,r){return t&e^t&r^e&r}var kn=class{constructor(e,r,i,n){f(this,"blockLen");f(this,"outputLen");f(this,"canXOF",false);f(this,"padOffset");f(this,"isLE");f(this,"buffer");f(this,"view");f(this,"finished",false);f(this,"length",0);f(this,"pos",0);f(this,"destroyed",false);this.blockLen=e,this.outputLen=r,this.padOffset=i,this.isLE=n,this.buffer=new Uint8Array(e),this.view=ii(this.buffer);}update(e){ri(this),kt(e);let{view:r,buffer:i,blockLen:n}=this,o=e.length;for(let s=0;s<o;){let a=Math.min(n-this.pos,o-s);if(a===n){let l=ii(e);for(;n<=o-s;s+=n)this.process(l,s);continue}i.set(e.subarray(s,s+a),this.pos),this.pos+=a,s+=a,this.pos===n&&(this.process(r,0),this.pos=0);}return this.length+=e.length,this.roundClean(),this}digestInto(e){ri(this),zo(e,this),this.finished=true;let{buffer:r,view:i,blockLen:n,isLE:o}=this,{pos:s}=this;r[s++]=128,Xe(this.buffer.subarray(s)),this.padOffset>n-s&&(this.process(i,0),s=0);for(let u=s;u<n;u++)r[u]=0;i.setBigUint64(n-8,BigInt(this.length*8),o),this.process(i,0);let a=ii(e),l=this.outputLen;if(l%4)throw new Error("_sha2: outputLen must be aligned to 32bit");let c=l/4,d=this.get();if(c>d.length)throw new Error("_sha2: outputLen bigger than state");for(let u=0;u<c;u++)a.setUint32(4*u,d[u],o);}digest(){let{buffer:e,outputLen:r}=this;this.digestInto(e);let i=e.slice(0,r);return this.destroy(),i}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());let{blockLen:r,buffer:i,length:n,finished:o,destroyed:s,pos:a}=this;return e.destroyed=s,e.finished=o,e.length=n,e.pos=a,n%r&&e.buffer.set(i),e}clone(){return this._cloneInto()}},kr=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),Pr=Uint32Array.from([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]),We=Uint32Array.from([3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]),He=Uint32Array.from([1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209]);var Qc=BigInt(4294967295),Mm=BigInt(32);function ru(t,e=false){return e?{h:Number(t&Qc),l:Number(t>>Mm&Qc)}:{h:Number(t>>Mm&Qc)|0,l:Number(t&Qc)|0}}function Fm(t,e=false){let r=t.length,i=new Uint32Array(r),n=new Uint32Array(r);for(let o=0;o<r;o++){let{h:s,l:a}=ru(t[o],e);[i[o],n[o]]=[s,a];}return [i,n]}var iu=(t,e,r)=>t>>>r,nu=(t,e,r)=>t<<32-r|e>>>r,dr=(t,e,r)=>t>>>r|e<<32-r,ur=(t,e,r)=>t<<32-r|e>>>r,Sa=(t,e,r)=>t<<64-r|e>>>r-32,xa=(t,e,r)=>t>>>r-32|e<<64-r,Um=(t,e)=>e,Lm=(t,e)=>t;function Pt(t,e,r,i){let n=(e>>>0)+(i>>>0);return {h:t+r+(n/2**32|0)|0,l:n|0}}var Aa=(t,e,r)=>(t>>>0)+(e>>>0)+(r>>>0),_a=(t,e,r,i)=>e+r+i+(t/2**32|0)|0,Hm=(t,e,r,i)=>(t>>>0)+(e>>>0)+(r>>>0)+(i>>>0),Km=(t,e,r,i,n)=>e+r+i+n+(t/2**32|0)|0,qm=(t,e,r,i,n)=>(t>>>0)+(e>>>0)+(r>>>0)+(i>>>0)+(n>>>0),Gm=(t,e,r,i,n,o)=>e+r+i+n+o+(t/2**32|0)|0;var IS=Uint32Array.from([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),Fi=new Uint32Array(64),Jc=class extends kn{constructor(e){super(64,e,8,false);}get(){let{A:e,B:r,C:i,D:n,E:o,F:s,G:a,H:l}=this;return [e,r,i,n,o,s,a,l]}set(e,r,i,n,o,s,a,l){this.A=e|0,this.B=r|0,this.C=i|0,this.D=n|0,this.E=o|0,this.F=s|0,this.G=a|0,this.H=l|0;}process(e,r){for(let u=0;u<16;u++,r+=4)Fi[u]=e.getUint32(r,false);for(let u=16;u<64;u++){let h=Fi[u-15],y=Fi[u-2],b=lr(h,7)^lr(h,18)^h>>>3,x=lr(y,17)^lr(y,19)^y>>>10;Fi[u]=x+Fi[u-7]+b+Fi[u-16]|0;}let{A:i,B:n,C:o,D:s,E:a,F:l,G:c,H:d}=this;for(let u=0;u<64;u++){let h=lr(a,6)^lr(a,11)^lr(a,25),y=d+h+Zc(a,l,c)+IS[u]+Fi[u]|0,x=(lr(i,2)^lr(i,13)^lr(i,22))+Yc(i,n,o)|0;d=c,c=l,l=a,a=s+y|0,s=o,o=n,n=i,i=y+x|0;}i=i+this.A|0,n=n+this.B|0,o=o+this.C|0,s=s+this.D|0,a=a+this.E|0,l=l+this.F|0,c=c+this.G|0,d=d+this.H|0,this.set(i,n,o,s,a,l,c,d);}roundClean(){Xe(Fi);}destroy(){this.destroyed=true,this.set(0,0,0,0,0,0,0,0),Xe(this.buffer);}},ou=class extends Jc{constructor(){super(32);f(this,"A",kr[0]|0);f(this,"B",kr[1]|0);f(this,"C",kr[2]|0);f(this,"D",kr[3]|0);f(this,"E",kr[4]|0);f(this,"F",kr[5]|0);f(this,"G",kr[6]|0);f(this,"H",kr[7]|0);}},su=class extends Jc{constructor(){super(28);f(this,"A",Pr[0]|0);f(this,"B",Pr[1]|0);f(this,"C",Pr[2]|0);f(this,"D",Pr[3]|0);f(this,"E",Pr[4]|0);f(this,"F",Pr[5]|0);f(this,"G",Pr[6]|0);f(this,"H",Pr[7]|0);}},$m=Fm(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(t=>BigInt(t))),vS=$m[0],ES=$m[1],Ui=new Uint32Array(80),Li=new Uint32Array(80),e1=class extends kn{constructor(e){super(128,e,16,false);}get(){let{Ah:e,Al:r,Bh:i,Bl:n,Ch:o,Cl:s,Dh:a,Dl:l,Eh:c,El:d,Fh:u,Fl:h,Gh:y,Gl:b,Hh:x,Hl:m}=this;return [e,r,i,n,o,s,a,l,c,d,u,h,y,b,x,m]}set(e,r,i,n,o,s,a,l,c,d,u,h,y,b,x,m){this.Ah=e|0,this.Al=r|0,this.Bh=i|0,this.Bl=n|0,this.Ch=o|0,this.Cl=s|0,this.Dh=a|0,this.Dl=l|0,this.Eh=c|0,this.El=d|0,this.Fh=u|0,this.Fl=h|0,this.Gh=y|0,this.Gl=b|0,this.Hh=x|0,this.Hl=m|0;}process(e,r){for(let w=0;w<16;w++,r+=4)Ui[w]=e.getUint32(r),Li[w]=e.getUint32(r+=4);for(let w=16;w<80;w++){let I=Ui[w-15]|0,N=Li[w-15]|0,H=dr(I,N,1)^dr(I,N,8)^iu(I,N,7),O=ur(I,N,1)^ur(I,N,8)^nu(I,N,7),U=Ui[w-2]|0,F=Li[w-2]|0,T=dr(U,F,19)^Sa(U,F,61)^iu(U,F,6),C=ur(U,F,19)^xa(U,F,61)^nu(U,F,6),E=Hm(O,C,Li[w-7],Li[w-16]),v=Km(E,H,T,Ui[w-7],Ui[w-16]);Ui[w]=v|0,Li[w]=E|0;}let{Ah:i,Al:n,Bh:o,Bl:s,Ch:a,Cl:l,Dh:c,Dl:d,Eh:u,El:h,Fh:y,Fl:b,Gh:x,Gl:m,Hh:A,Hl:_}=this;for(let w=0;w<80;w++){let I=dr(u,h,14)^dr(u,h,18)^Sa(u,h,41),N=ur(u,h,14)^ur(u,h,18)^xa(u,h,41),H=u&y^~u&x,O=h&b^~h&m,U=qm(_,N,O,ES[w],Li[w]),F=Gm(U,A,I,H,vS[w],Ui[w]),T=U|0,C=dr(i,n,28)^Sa(i,n,34)^Sa(i,n,39),E=ur(i,n,28)^xa(i,n,34)^xa(i,n,39),v=i&o^i&a^o&a,B=n&s^n&l^s&l;A=x|0,_=m|0,x=y|0,m=b|0,y=u|0,b=h|0,{h:u,l:h}=Pt(c|0,d|0,F|0,T|0),c=a|0,d=l|0,a=o|0,l=s|0,o=i|0,s=n|0;let D=Aa(T,E,B);i=_a(D,F,C,v),n=D|0;}(({h:i,l:n}=Pt(this.Ah|0,this.Al|0,i|0,n|0))),{h:o,l:s}=Pt(this.Bh|0,this.Bl|0,o|0,s|0),{h:a,l}=Pt(this.Ch|0,this.Cl|0,a|0,l|0),{h:c,l:d}=Pt(this.Dh|0,this.Dl|0,c|0,d|0),{h:u,l:h}=Pt(this.Eh|0,this.El|0,u|0,h|0),{h:y,l:b}=Pt(this.Fh|0,this.Fl|0,y|0,b|0),{h:x,l:m}=Pt(this.Gh|0,this.Gl|0,x|0,m|0),{h:A,l:_}=Pt(this.Hh|0,this.Hl|0,A|0,_|0),this.set(i,n,o,s,a,l,c,d,u,h,y,b,x,m,A,_);}roundClean(){Xe(Ui,Li);}destroy(){this.destroyed=true,Xe(this.buffer),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);}},au=class extends e1{constructor(){super(64);f(this,"Ah",He[0]|0);f(this,"Al",He[1]|0);f(this,"Bh",He[2]|0);f(this,"Bl",He[3]|0);f(this,"Ch",He[4]|0);f(this,"Cl",He[5]|0);f(this,"Dh",He[6]|0);f(this,"Dl",He[7]|0);f(this,"Eh",He[8]|0);f(this,"El",He[9]|0);f(this,"Fh",He[10]|0);f(this,"Fl",He[11]|0);f(this,"Gh",He[12]|0);f(this,"Gl",He[13]|0);f(this,"Hh",He[14]|0);f(this,"Hl",He[15]|0);}},cu=class extends e1{constructor(){super(48);f(this,"Ah",We[0]|0);f(this,"Al",We[1]|0);f(this,"Bh",We[2]|0);f(this,"Bl",We[3]|0);f(this,"Ch",We[4]|0);f(this,"Cl",We[5]|0);f(this,"Dh",We[6]|0);f(this,"Dl",We[7]|0);f(this,"Eh",We[8]|0);f(this,"El",We[9]|0);f(this,"Fh",We[10]|0);f(this,"Fl",We[11]|0);f(this,"Gh",We[12]|0);f(this,"Gl",We[13]|0);f(this,"Hh",We[14]|0);f(this,"Hl",We[15]|0);}};var rt=ni(()=>new ou,ba(1)),Nr=ni(()=>new su,ba(4)),$o=ni(()=>new au,ba(3)),Vo=ni(()=>new cu,ba(2));var Se=(t,e,r)=>kt(t,e,r),du=Mi,Ca=Bn,Lt=(...t)=>Rm(...t),jo=t=>Tn(t),wa=tu,Ia=t=>Om(t),r1=BigInt(0),lu=BigInt(1);function fr(t,e=""){if(typeof t!="boolean"){let r=e&&`"${e}" `;throw new TypeError(r+"expected boolean, got type="+typeof t)}return t}function i1(t){if(typeof t=="bigint"){if(!t1(t))throw new RangeError("positive bigint expected, got "+t)}else du(t);return t}function Pn(t,e=""){if(typeof t!="number"){let r=e&&`"${e}" `;throw new TypeError(r+"expected number, got type="+typeof t)}if(!Number.isSafeInteger(t)){let r=e&&`"${e}" `;throw new RangeError(r+"expected safe integer, got "+t)}}function va(t){let e=i1(t).toString(16);return e.length&1?"0"+e:e}function Vm(t){if(typeof t!="string")throw new TypeError("hex string expected, got "+typeof t);return t===""?r1:BigInt("0x"+t)}function Xo(t){return Vm(Bn(t))}function Nn(t){return Vm(Bn(o1(kt(t)).reverse()))}function n1(t,e){if(Mi(e),e===0)throw new RangeError("zero length");t=i1(t);let r=t.toString(16);if(r.length>e*2)throw new RangeError("number too large");return Tn(r.padStart(e*2,"0"))}function uu(t,e){return n1(t,e).reverse()}function o1(t){return Uint8Array.from(Se(t))}var t1=t=>typeof t=="bigint"&&r1<=t;function BS(t,e,r){return t1(t)&&t1(e)&&t1(r)&&e<=t&&t<r}function Wo(t,e,r,i){if(!BS(e,r,i))throw new RangeError("expected valid "+t+": "+r+" <= n < "+i+", got "+e)}function Zo(t){if(t<r1)throw new Error("expected non-negative bigint, got "+t);let e;for(e=0;t>r1;t>>=lu,e+=1);return e}var Ea=t=>(lu<<BigInt(t))-lu;function jm(t,e,r){if(Mi(t,"hashLen"),Mi(e,"qByteLen"),typeof r!="function")throw new TypeError("hmacFn must be a function");let i=m=>new Uint8Array(m),n=Uint8Array.of(),o=Uint8Array.of(0),s=Uint8Array.of(1),a=1e3,l=i(t),c=i(t),d=0,u=()=>{l.fill(1),c.fill(0),d=0;},h=(...m)=>r(c,Lt(l,...m)),y=(m=n)=>{c=h(o,m),l=h(),m.length!==0&&(c=h(s,m),l=h());},b=()=>{if(d++>=a)throw new Error("drbg: tried max amount of iterations");let m=0,A=[];for(;m<e;){l=h();let _=l.slice();A.push(_),m+=l.length;}return Lt(...A)};return (m,A)=>{u(),y(m);let _;for(;(_=A(b()))===void 0;)y();return u(),_}}function Dr(t,e={},r={}){if(Object.prototype.toString.call(t)!=="[object Object]")throw new TypeError("expected valid options object");function i(o,s,a){if(!a&&s!=="function"&&!Object.hasOwn(t,o))throw new TypeError(`param "${o}" is invalid: expected own property`);let l=t[o];if(a&&l===void 0)return;let c=typeof l;if(c!==s||l===null)throw new TypeError(`param "${o}" is invalid: expected ${s}, got ${c}`)}let n=(o,s)=>Object.entries(o).forEach(([a,l])=>i(a,l,s));n(e,false),n(r,true);}var ft=BigInt(0),De=BigInt(1),Dn=BigInt(2),Ym=BigInt(3),Qm=BigInt(4),Jm=BigInt(5),TS=BigInt(7),eg=BigInt(8),kS=BigInt(9),tg=BigInt(16);function pr(t,e){if(e<=ft)throw new Error("mod: expected positive modulus, got "+e);let r=t%e;return r>=ft?r:e+r}function Xm(t,e){if(t===ft)throw new Error("invert: expected non-zero number");if(e<=ft)throw new Error("invert: expected positive modulus, got "+e);let r=pr(t,e),i=e,n=ft,s=De;for(;r!==ft;){let c=i/r,d=i-r*c,u=n-s*c;i=r,r=d,n=s,s=u;}if(i!==De)throw new Error("invert: does not exist");return pr(n,e)}function fu(t,e,r){let i=t;if(!i.eql(i.sqr(e),r))throw new Error("Cannot find square root")}function rg(t,e){let r=t,i=(r.ORDER+De)/Qm,n=r.pow(e,i);return fu(r,n,e),n}function PS(t,e){let r=t,i=(r.ORDER-Jm)/eg,n=r.mul(e,Dn),o=r.pow(n,i),s=r.mul(e,o),a=r.mul(r.mul(s,Dn),o),l=r.mul(s,r.sub(a,r.ONE));return fu(r,l,e),l}function NS(t){let e=Yo(t),r=ig(t),i=r(e,e.neg(e.ONE)),n=r(e,i),o=r(e,e.neg(i)),s=(t+TS)/tg;return((a,l)=>{let c=a,d=c.pow(l,s),u=c.mul(d,i),h=c.mul(d,n),y=c.mul(d,o),b=c.eql(c.sqr(u),l),x=c.eql(c.sqr(h),l);d=c.cmov(d,u,b),u=c.cmov(y,h,x);let m=c.eql(c.sqr(u),l),A=c.cmov(d,u,m);return fu(c,A,l),A})}function ig(t){if(t<Ym)throw new Error("sqrt is not defined for small field");let e=t-De,r=0;for(;e%Dn===ft;)e/=Dn,r++;let i=Dn,n=Yo(t);for(;Wm(n,i)===1;)if(i++>1e3)throw new Error("Cannot find square root: probably non-prime P");if(r===1)return rg;let o=n.pow(i,e),s=(e+De)/Dn;return function(l,c){let d=l;if(d.is0(c))return c;if(Wm(d,c)!==1)throw new Error("Cannot find square root");let u=r,h=d.mul(d.ONE,o),y=d.pow(c,e),b=d.pow(c,s);for(;!d.eql(y,d.ONE);){if(d.is0(y))return d.ZERO;let x=1,m=d.sqr(y);for(;!d.eql(m,d.ONE);)if(x++,m=d.sqr(m),x===u)throw new Error("Cannot find square root");let A=De<<BigInt(u-x-1),_=d.pow(h,A);u=x,h=d.sqr(_),y=d.mul(y,h),b=d.mul(b,_);}return b}}function DS(t){return t%Qm===Ym?rg:t%eg===Jm?PS:t%tg===kS?NS(t):ig(t)}var RS=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function pu(t){let e={ORDER:"bigint",BYTES:"number",BITS:"number"},r=RS.reduce((i,n)=>(i[n]="function",i),e);if(Dr(t,r),Pn(t.BYTES,"BYTES"),Pn(t.BITS,"BITS"),t.BYTES<1||t.BITS<1)throw new Error("invalid field: expected BYTES/BITS > 0");if(t.ORDER<=De)throw new Error("invalid field: expected ORDER > 1, got "+t.ORDER);return t}function OS(t,e,r){let i=t;if(r<ft)throw new Error("invalid exponent, negatives unsupported");if(r===ft)return i.ONE;if(r===De)return e;let n=i.ONE,o=e;for(;r>ft;)r&De&&(n=i.mul(n,o)),o=i.sqr(o),r>>=De;return n}function a1(t,e,r=false){let i=t,n=new Array(e.length).fill(r?i.ZERO:void 0),o=e.reduce((a,l,c)=>i.is0(l)?a:(n[c]=a,i.mul(a,l)),i.ONE),s=i.inv(o);return e.reduceRight((a,l,c)=>i.is0(l)?a:(n[c]=i.mul(a,n[c]),i.mul(a,l)),s),n}function Wm(t,e){let r=t,i=(r.ORDER-De)/Dn,n=r.pow(e,i),o=r.eql(n,r.ONE),s=r.eql(n,r.ZERO),a=r.eql(n,r.neg(r.ONE));if(!o&&!s&&!a)throw new Error("invalid Legendre symbol result");return o?1:s?0:-1}function MS(t,e){if(e!==void 0&&du(e),t<=ft)throw new Error("invalid n length: expected positive n, got "+t);if(e!==void 0&&e<1)throw new Error("invalid n length: expected positive bit length, got "+e);let r=Zo(t);if(e!==void 0&&e<r)throw new Error(`invalid n length: expected bit length (${r}) >= n.length (${e})`);let i=e!==void 0?e:r,n=Math.ceil(i/8);return {nBitLength:i,nByteLength:n}}var Zm=new WeakMap,s1=class{constructor(e,r={}){f(this,"ORDER");f(this,"BITS");f(this,"BYTES");f(this,"isLE");f(this,"ZERO",ft);f(this,"ONE",De);f(this,"_lengths");f(this,"_mod");if(e<=De)throw new Error("invalid field: expected ORDER > 1, got "+e);let i;this.isLE=false,r!=null&&typeof r=="object"&&(typeof r.BITS=="number"&&(i=r.BITS),typeof r.sqrt=="function"&&Object.defineProperty(this,"sqrt",{value:r.sqrt,enumerable:true}),typeof r.isLE=="boolean"&&(this.isLE=r.isLE),r.allowedLengths&&(this._lengths=Object.freeze(r.allowedLengths.slice())),typeof r.modFromBytes=="boolean"&&(this._mod=r.modFromBytes));let{nBitLength:n,nByteLength:o}=MS(e,i);if(o>2048)throw new Error("invalid field: expected ORDER of <= 2048 bytes");this.ORDER=e,this.BITS=n,this.BYTES=o,Object.freeze(this);}create(e){return pr(e,this.ORDER)}isValid(e){if(typeof e!="bigint")throw new TypeError("invalid field element: expected bigint, got "+typeof e);return ft<=e&&e<this.ORDER}is0(e){return e===ft}isValidNot0(e){return !this.is0(e)&&this.isValid(e)}isOdd(e){return (e&De)===De}neg(e){return pr(-e,this.ORDER)}eql(e,r){return e===r}sqr(e){return pr(e*e,this.ORDER)}add(e,r){return pr(e+r,this.ORDER)}sub(e,r){return pr(e-r,this.ORDER)}mul(e,r){return pr(e*r,this.ORDER)}pow(e,r){return OS(this,e,r)}div(e,r){return pr(e*Xm(r,this.ORDER),this.ORDER)}sqrN(e){return e*e}addN(e,r){return e+r}subN(e,r){return e-r}mulN(e,r){return e*r}inv(e){return Xm(e,this.ORDER)}sqrt(e){let r=Zm.get(this);return r||Zm.set(this,r=DS(this.ORDER)),r(this,e)}toBytes(e){return this.isLE?uu(e,this.BYTES):n1(e,this.BYTES)}fromBytes(e,r=false){Se(e);let{_lengths:i,BYTES:n,isLE:o,ORDER:s,_mod:a}=this;if(i){if(e.length<1||!i.includes(e.length)||e.length>n)throw new Error("Field.fromBytes: expected "+i+" bytes, got "+e.length);let c=new Uint8Array(n);c.set(e,o?0:c.length-e.length),e=c;}if(e.length!==n)throw new Error("Field.fromBytes: expected "+n+" bytes, got "+e.length);let l=o?Nn(e):Xo(e);if(a&&(l=pr(l,s)),!r&&!this.isValid(l))throw new Error("invalid field element: outside of range 0..ORDER");return l}invertBatch(e){return a1(this,e)}cmov(e,r,i){return fr(i,"condition"),i?r:e}};Object.freeze(s1.prototype);function Yo(t,e={}){return new s1(t,e)}function ng(t){if(typeof t!="bigint")throw new Error("field order must be bigint");if(t<=De)throw new Error("field order must be greater than 1");let e=Zo(t-De);return Math.ceil(e/8)}function hu(t){let e=ng(t);return e+Math.ceil(e/2)}function og(t,e,r=false){Se(t);let i=t.length,n=ng(e),o=Math.max(hu(e),16);if(i<o||i>1024)throw new Error("expected "+o+"-1024 bytes of input, got "+i);let s=r?Nn(t):Xo(t),a=pr(s,e-De)+De;return r?uu(a,n):n1(a,n)}var Qo=BigInt(0),Rn=BigInt(1);function Ba(t,e){let r=e.negate();return t?r:e}function On(t,e){let r=a1(t.Fp,e.map(i=>i.Z));return e.map((i,n)=>t.fromAffine(i.toAffine(r[n])))}function lg(t,e){if(!Number.isSafeInteger(t)||t<=0||t>e)throw new Error("invalid window size, expected [1.."+e+"], got W="+t)}function mu(t,e){lg(t,e);let r=Math.ceil(e/t)+1,i=2**(t-1),n=2**t,o=Ea(t),s=BigInt(t);return {windows:r,windowSize:i,mask:o,maxNumber:n,shiftBy:s}}function sg(t,e,r){let{windowSize:i,mask:n,maxNumber:o,shiftBy:s}=r,a=Number(t&n),l=t>>s;a>i&&(a-=o,l+=Rn);let c=e*i,d=c+Math.abs(a)-1,u=a===0,h=a<0,y=e%2!==0;return {nextN:l,offset:d,isZero:u,isNeg:h,isNegF:y,offsetF:c}}var gu=new WeakMap,dg=new WeakMap;function yu(t){return dg.get(t)||1}function ag(t){if(t!==Qo)throw new Error("invalid wNAF")}var Jo=class{constructor(e,r){f(this,"BASE");f(this,"ZERO");f(this,"Fn");f(this,"bits");this.BASE=e.BASE,this.ZERO=e.ZERO,this.Fn=e.Fn,this.bits=r;}_unsafeLadder(e,r,i=this.ZERO){let n=e;for(;r>Qo;)r&Rn&&(i=i.add(n)),n=n.double(),r>>=Rn;return i}precomputeWindow(e,r){let{windows:i,windowSize:n}=mu(r,this.bits),o=[],s=e,a=s;for(let l=0;l<i;l++){a=s,o.push(a);for(let c=1;c<n;c++)a=a.add(s),o.push(a);s=a.double();}return o}wNAF(e,r,i){if(!this.Fn.isValid(i))throw new Error("invalid scalar");let n=this.ZERO,o=this.BASE,s=mu(e,this.bits);for(let a=0;a<s.windows;a++){let{nextN:l,offset:c,isZero:d,isNeg:u,isNegF:h,offsetF:y}=sg(i,a,s);i=l,d?o=o.add(Ba(h,r[y])):n=n.add(Ba(u,r[c]));}return ag(i),{p:n,f:o}}wNAFUnsafe(e,r,i,n=this.ZERO){let o=mu(e,this.bits);for(let s=0;s<o.windows&&i!==Qo;s++){let{nextN:a,offset:l,isZero:c,isNeg:d}=sg(i,s,o);if(i=a,!c){let u=r[l];n=n.add(d?u.negate():u);}}return ag(i),n}getPrecomputes(e,r,i){let n=gu.get(r);return n||(n=this.precomputeWindow(r,e),e!==1&&(typeof i=="function"&&(n=i(n)),gu.set(r,n))),n}cached(e,r,i){let n=yu(e);return this.wNAF(n,this.getPrecomputes(n,e,i),r)}unsafe(e,r,i,n){let o=yu(e);return o===1?this._unsafeLadder(e,r,n):this.wNAFUnsafe(o,this.getPrecomputes(o,e,i),r,n)}createCache(e,r){lg(r,this.bits),dg.set(e,r),gu.delete(e);}hasCache(e){return yu(e)!==1}};function ug(t,e,r,i){let n=e,o=t.ZERO,s=t.ZERO;for(;r>Qo||i>Qo;)r&Rn&&(o=o.add(n)),i&Rn&&(s=s.add(n)),n=n.double(),r>>=Rn,i>>=Rn;return {p1:o,p2:s}}function cg(t,e,r){if(e){if(e.ORDER!==t)throw new Error("Field.ORDER must match order: Fp == p, Fn == n");return pu(e),e}else return Yo(t,{isLE:r})}function c1(t,e,r={},i){if(i===void 0&&(i=t==="edwards"),!e||typeof e!="object")throw new Error(`expected valid ${t} CURVE object`);for(let l of ["p","n","h"]){let c=e[l];if(!(typeof c=="bigint"&&c>Qo))throw new Error(`CURVE.${l} must be positive bigint`)}let n=cg(e.p,r.Fp,i),o=cg(e.n,r.Fn,i),a=["Gx","Gy","a",t==="weierstrass"?"b":"d"];for(let l of a)if(!n.isValid(e[l]))throw new Error(`CURVE.${l} must be valid field element of CURVE.Fp`);return e=Object.freeze(Object.assign({},e)),{CURVE:e,Fp:n,Fn:o}}function l1(t,e){return function(i){let n=t(i);return {secretKey:n,publicKey:e(n)}}}var d1=class{constructor(e,r){f(this,"oHash");f(this,"iHash");f(this,"blockLen");f(this,"outputLen");f(this,"canXOF",false);f(this,"finished",false);f(this,"destroyed",false);if(Xc(e),kt(r,void 0,"key"),this.iHash=e.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;let i=this.blockLen,n=new Uint8Array(i);n.set(r.length>i?e.create().update(r).digest():r);for(let o=0;o<n.length;o++)n[o]^=54;this.iHash.update(n),this.oHash=e.create();for(let o=0;o<n.length;o++)n[o]^=106;this.oHash.update(n),Xe(n);}update(e){return ri(this),this.iHash.update(e),this}digestInto(e){ri(this),zo(e,this),this.finished=true;let r=e.subarray(0,this.outputLen);this.iHash.digestInto(r),this.oHash.update(r),this.oHash.digestInto(r),this.destroy();}digest(){let e=new Uint8Array(this.oHash.outputLen);return this.digestInto(e),e}_cloneInto(e){e||(e=Object.create(Object.getPrototypeOf(this),{}));let{oHash:r,iHash:i,finished:n,destroyed:o,blockLen:s,outputLen:a}=this;return e=e,e.finished=n,e.destroyed=o,e.blockLen=s,e.outputLen=a,e.oHash=r._cloneInto(e.oHash),e.iHash=i._cloneInto(e.iHash),e}clone(){return this._cloneInto()}destroy(){this.destroyed=true,this.oHash.destroy(),this.iHash.destroy();}},fg=(()=>{let t=((e,r,i)=>new d1(e,r).update(i).digest());return t.create=(e,r)=>new d1(e,r),t})();var pg=(t,e)=>(t+(t>=0?e:-e)/hg)/e;function FS(t,e,r){Wo("scalar",t,Rr,r);let[[i,n],[o,s]]=e,a=pg(s*t,r),l=pg(-n*t,r),c=t-a*i-l*o,d=-a*n-l*s,u=c<Rr,h=d<Rr;u&&(c=-c),h&&(d=-d);let y=Ea(Math.ceil(Zo(r)/2))+Hi;if(c<Rr||c>=y||d<Rr||d>=y)throw new Error("splitScalar (endomorphism): failed for k");return {k1neg:u,k1:c,k2neg:h,k2:d}}function Su(t){if(!["compact","recovered","der"].includes(t))throw new Error('Signature format must be "compact", "recovered", or "der"');return t}function bu(t,e){Dr(t);let r={};for(let i of Object.keys(e))r[i]=t[i]===void 0?e[i]:t[i];return fr(r.lowS,"lowS"),fr(r.prehash,"prehash"),r.format!==void 0&&Su(r.format),r}var xu=class extends Error{constructor(e=""){super(e);}},hr={Err:xu,_tlv:{encode:(t,e)=>{let{Err:r}=hr;if(Pn(t,"tag"),t<0||t>255)throw new r("tlv.encode: wrong tag");if(typeof e!="string")throw new TypeError('"data" expected string, got type='+typeof e);if(e.length&1)throw new r("tlv.encode: unpadded data");let i=e.length/2,n=va(i);if(n.length/2&128)throw new r("tlv.encode: long form length too big");let o=i>127?va(n.length/2|128):"";return va(t)+o+n+e},decode(t,e){let{Err:r}=hr;e=Se(e,void 0,"DER data");let i=0;if(t<0||t>255)throw new r("tlv.encode: wrong tag");if(e.length<2||e[i++]!==t)throw new r("tlv.decode: wrong tlv");let n=e[i++],o=!!(n&128),s=0;if(!o)s=n;else {let l=n&127;if(!l)throw new r("tlv.decode(long): indefinite length not supported");if(l>4)throw new r("tlv.decode(long): byte length is too big");let c=e.subarray(i,i+l);if(c.length!==l)throw new r("tlv.decode: length bytes not complete");if(c[0]===0)throw new r("tlv.decode(long): zero leftmost byte");for(let d of c)s=s<<8|d;if(i+=l,s<128)throw new r("tlv.decode(long): not minimal encoding")}let a=e.subarray(i,i+s);if(a.length!==s)throw new r("tlv.decode: wrong value length");return {v:a,l:e.subarray(i+s)}}},_int:{encode(t){let{Err:e}=hr;if(i1(t),t<Rr)throw new e("integer: negative integers are not allowed");let r=va(t);if(Number.parseInt(r[0],16)&8&&(r="00"+r),r.length&1)throw new e("unexpected DER parsing assertion: unpadded hex");return r},decode(t){let{Err:e}=hr;if(t.length<1)throw new e("invalid signature integer: empty");if(t[0]&128)throw new e("invalid signature integer: negative");if(t.length>1&&t[0]===0&&!(t[1]&128))throw new e("invalid signature integer: unnecessary leading zero");return Xo(t)}},toSig(t){let{Err:e,_int:r,_tlv:i}=hr,n=Se(t,void 0,"signature"),{v:o,l:s}=i.decode(48,n);if(s.length)throw new e("invalid signature: left bytes after parsing");let{v:a,l}=i.decode(2,o),{v:c,l:d}=i.decode(2,l);if(d.length)throw new e("invalid signature: left bytes after parsing");return {r:r.decode(a),s:r.decode(c)}},hexFromSig(t){let{_tlv:e,_int:r}=hr,i=e.encode(2,r.encode(t.r)),n=e.encode(2,r.encode(t.s)),o=i+n;return e.encode(48,o)}};Object.freeze(hr._tlv);Object.freeze(hr._int);Object.freeze(hr);var Rr=BigInt(0),Hi=BigInt(1),hg=BigInt(2),u1=BigInt(3),US=BigInt(4);function Re(t,e={}){let r=c1("weierstrass",t,e),i=r.Fp,n=r.Fn,o=r.CURVE,{h:s,n:a}=o;Dr(e,{},{allowInfinityPoint:"boolean",clearCofactor:"function",isTorsionFree:"function",fromBytes:"function",toBytes:"function",endo:"object"});let{endo:l,allowInfinityPoint:c}=e;if(l&&(!i.is0(o.a)||typeof l.beta!="bigint"||!Array.isArray(l.basises)))throw new Error('invalid endo: expected "beta": bigint and "basises": array');let d=gg(i,n);function u(){if(!i.isOdd)throw new Error("compression is not supported: Field does not have .isOdd()")}function h(E,v,B){if(c&&v.is0())return Uint8Array.of(0);let{x:D,y:P}=v.toAffine(),L=i.toBytes(D);if(fr(B,"isCompressed"),B){u();let K=!i.isOdd(P);return Lt(mg(K),L)}else return Lt(Uint8Array.of(4),L,i.toBytes(P))}function y(E){Se(E,void 0,"Point");let{publicKey:v,publicKeyUncompressed:B}=d,D=E.length,P=E[0],L=E.subarray(1);if(c&&D===1&&P===0)return {x:i.ZERO,y:i.ZERO};if(D===v&&(P===2||P===3)){let K=i.fromBytes(L);if(!i.isValid(K))throw new Error("bad point: is not on curve, wrong x");let z=m(K),q;try{q=i.sqrt(z);}catch(ee){let V=ee instanceof Error?": "+ee.message:"";throw new Error("bad point: is not on curve, sqrt error"+V)}u();let Y=i.isOdd(q);return (P&1)===1!==Y&&(q=i.neg(q)),{x:K,y:q}}else if(D===B&&P===4){let K=i.BYTES,z=i.fromBytes(L.subarray(0,K)),q=i.fromBytes(L.subarray(K,K*2));if(!A(z,q))throw new Error("bad point: is not on curve");return {x:z,y:q}}else throw new Error(`bad point: got length ${D}, expected compressed=${v} or uncompressed=${B}`)}let b=e.toBytes===void 0?h:e.toBytes,x=e.fromBytes===void 0?y:e.fromBytes;function m(E){let v=i.sqr(E),B=i.mul(v,E);return i.add(i.add(B,i.mul(E,o.a)),o.b)}function A(E,v){let B=i.sqr(v),D=m(E);return i.eql(B,D)}if(!A(o.Gx,o.Gy))throw new Error("bad curve params: generator point");let _=i.mul(i.pow(o.a,u1),US),w=i.mul(i.sqr(o.b),BigInt(27));if(i.is0(i.add(_,w)))throw new Error("bad curve params: a or b");function I(E,v,B=false){if(!i.isValid(v)||B&&i.is0(v))throw new Error(`bad point coordinate ${E}`);return v}function N(E){if(!(E instanceof U))throw new Error("Weierstrass Point expected")}function H(E){if(!l||!l.basises)throw new Error("no endo");return FS(E,l.basises,n.ORDER)}function O(E,v,B,D,P){return B=new U(i.mul(B.X,E),B.Y,B.Z),v=Ba(D,v),B=Ba(P,B),v.add(B)}let C=class C{constructor(v,B,D){f(this,"X");f(this,"Y");f(this,"Z");this.X=I("x",v),this.Y=I("y",B,true),this.Z=I("z",D),Object.freeze(this);}static CURVE(){return o}static fromAffine(v){let{x:B,y:D}=v||{};if(!v||!i.isValid(B)||!i.isValid(D))throw new Error("invalid affine point");if(v instanceof C)throw new Error("projective point not allowed");return i.is0(B)&&i.is0(D)?C.ZERO:new C(B,D,i.ONE)}static fromBytes(v){let B=C.fromAffine(x(Se(v,void 0,"point")));return B.assertValidity(),B}static fromHex(v){return C.fromBytes(jo(v))}get x(){return this.toAffine().x}get y(){return this.toAffine().y}precompute(v=8,B=true){return T.createCache(this,v),B||this.multiply(u1),this}assertValidity(){let v=this;if(v.is0()){if(e.allowInfinityPoint&&i.is0(v.X)&&i.eql(v.Y,i.ONE)&&i.is0(v.Z))return;throw new Error("bad point: ZERO")}let{x:B,y:D}=v.toAffine();if(!i.isValid(B)||!i.isValid(D))throw new Error("bad point: x or y not field elements");if(!A(B,D))throw new Error("bad point: equation left != right");if(!v.isTorsionFree())throw new Error("bad point: not in prime-order subgroup")}hasEvenY(){let{y:v}=this.toAffine();if(!i.isOdd)throw new Error("Field doesn't support isOdd");return !i.isOdd(v)}equals(v){N(v);let{X:B,Y:D,Z:P}=this,{X:L,Y:K,Z:z}=v,q=i.eql(i.mul(B,z),i.mul(L,P)),Y=i.eql(i.mul(D,z),i.mul(K,P));return q&&Y}negate(){return new C(this.X,i.neg(this.Y),this.Z)}double(){let{a:v,b:B}=o,D=i.mul(B,u1),{X:P,Y:L,Z:K}=this,z=i.ZERO,q=i.ZERO,Y=i.ZERO,Q=i.mul(P,P),ee=i.mul(L,L),V=i.mul(K,K),ue=i.mul(P,L);return ue=i.add(ue,ue),Y=i.mul(P,K),Y=i.add(Y,Y),z=i.mul(v,Y),q=i.mul(D,V),q=i.add(z,q),z=i.sub(ee,q),q=i.add(ee,q),q=i.mul(z,q),z=i.mul(ue,z),Y=i.mul(D,Y),V=i.mul(v,V),ue=i.sub(Q,V),ue=i.mul(v,ue),ue=i.add(ue,Y),Y=i.add(Q,Q),Q=i.add(Y,Q),Q=i.add(Q,V),Q=i.mul(Q,ue),q=i.add(q,Q),V=i.mul(L,K),V=i.add(V,V),Q=i.mul(V,ue),z=i.sub(z,Q),Y=i.mul(V,ee),Y=i.add(Y,Y),Y=i.add(Y,Y),new C(z,q,Y)}add(v){N(v);let{X:B,Y:D,Z:P}=this,{X:L,Y:K,Z:z}=v,q=i.ZERO,Y=i.ZERO,Q=i.ZERO,ee=o.a,V=i.mul(o.b,u1),ue=i.mul(B,L),$=i.mul(D,K),Z=i.mul(P,z),ae=i.add(B,D),re=i.add(L,K);ae=i.mul(ae,re),re=i.add(ue,$),ae=i.sub(ae,re),re=i.add(B,P);let me=i.add(L,z);return re=i.mul(re,me),me=i.add(ue,Z),re=i.sub(re,me),me=i.add(D,P),q=i.add(K,z),me=i.mul(me,q),q=i.add($,Z),me=i.sub(me,q),Q=i.mul(ee,re),q=i.mul(V,Z),Q=i.add(q,Q),q=i.sub($,Q),Q=i.add($,Q),Y=i.mul(q,Q),$=i.add(ue,ue),$=i.add($,ue),Z=i.mul(ee,Z),re=i.mul(V,re),$=i.add($,Z),Z=i.sub(ue,Z),Z=i.mul(ee,Z),re=i.add(re,Z),ue=i.mul($,re),Y=i.add(Y,ue),ue=i.mul(me,re),q=i.mul(ae,q),q=i.sub(q,ue),ue=i.mul(ae,$),Q=i.mul(me,Q),Q=i.add(Q,ue),new C(q,Y,Q)}subtract(v){return N(v),this.add(v.negate())}is0(){return this.equals(C.ZERO)}multiply(v){let{endo:B}=e;if(!n.isValidNot0(v))throw new RangeError("invalid scalar: out of range");let D,P,L=K=>T.cached(this,K,z=>On(C,z));if(B){let{k1neg:K,k1:z,k2neg:q,k2:Y}=H(v),{p:Q,f:ee}=L(z),{p:V,f:ue}=L(Y);P=ee.add(ue),D=O(B.beta,Q,V,K,q);}else {let{p:K,f:z}=L(v);D=K,P=z;}return On(C,[D,P])[0]}multiplyUnsafe(v){let{endo:B}=e,D=this,P=v;if(!n.isValid(P))throw new RangeError("invalid scalar: out of range");if(P===Rr||D.is0())return C.ZERO;if(P===Hi)return D;if(T.hasCache(this))return this.multiply(P);if(B){let{k1neg:L,k1:K,k2neg:z,k2:q}=H(P),{p1:Y,p2:Q}=ug(C,D,K,q);return O(B.beta,Y,Q,L,z)}else return T.unsafe(D,P)}toAffine(v){let B=this,D=v,{X:P,Y:L,Z:K}=B;if(i.eql(K,i.ONE))return {x:P,y:L};let z=B.is0();D==null&&(D=z?i.ONE:i.inv(K));let q=i.mul(P,D),Y=i.mul(L,D),Q=i.mul(K,D);if(z)return {x:i.ZERO,y:i.ZERO};if(!i.eql(Q,i.ONE))throw new Error("invZ was invalid");return {x:q,y:Y}}isTorsionFree(){let{isTorsionFree:v}=e;return s===Hi?true:v?v(C,this):T.unsafe(this,a).is0()}clearCofactor(){let{clearCofactor:v}=e;return s===Hi?this:v?v(C,this):this.multiplyUnsafe(s)}isSmallOrder(){return s===Hi?this.is0():this.clearCofactor().is0()}toBytes(v=true){return fr(v,"isCompressed"),this.assertValidity(),b(C,this,v)}toHex(v=true){return Ca(this.toBytes(v))}toString(){return `<Point ${this.is0()?"ZERO":this.toHex()}>`}};f(C,"BASE",new C(o.Gx,o.Gy,i.ONE)),f(C,"ZERO",new C(i.ZERO,i.ONE,i.ZERO)),f(C,"Fp",i),f(C,"Fn",n);let U=C,F=n.BITS,T=new Jo(U,e.endo?Math.ceil(F/2):F);return F>=8&&U.BASE.precompute(8),Object.freeze(U.prototype),Object.freeze(U),U}function mg(t){return Uint8Array.of(t?2:3)}function gg(t,e){return {secretKey:e.BYTES,publicKey:1+t.BYTES,publicKeyUncompressed:1+2*t.BYTES,publicKeyHasPrefix:true,signature:2*e.BYTES}}function LS(t,e={}){let{Fn:r}=t,i=e.randomBytes===void 0?Ia:e.randomBytes,n=Object.assign(gg(t.Fp,r),{seed:Math.max(hu(r.ORDER),16)});function o(y){try{let b=r.fromBytes(y);return r.isValidNot0(b)}catch{return false}}function s(y,b){let{publicKey:x,publicKeyUncompressed:m}=n;try{let A=y.length;return b===!0&&A!==x||b===!1&&A!==m?!1:!!t.fromBytes(y)}catch{return false}}function a(y){return y=y===void 0?i(n.seed):y,og(Se(y,n.seed,"seed"),r.ORDER)}function l(y,b=true){return t.BASE.multiply(r.fromBytes(y)).toBytes(b)}function c(y){let{secretKey:b,publicKey:x,publicKeyUncompressed:m}=n,A=r._lengths;if(!wa(y))return;let _=Se(y,void 0,"key").length,w=_===x||_===m,I=_===b||!!A?.includes(_);if(!(w&&I))return w}function d(y,b,x=true){if(c(y)===true)throw new Error("first arg must be private key");if(c(b)===false)throw new Error("second arg must be public key");let m=r.fromBytes(y);return t.fromBytes(b).multiply(m).toBytes(x)}let u={isValidSecretKey:o,isValidPublicKey:s,randomSecretKey:a},h=l1(a,l);return Object.freeze(u),Object.freeze(n),Object.freeze({getPublicKey:l,getSharedSecret:d,keygen:h,Point:t,utils:u,lengths:n})}function Oe(t,e,r={}){let i=e;Xc(i),Dr(r,{},{hmac:"function",lowS:"boolean",randomBytes:"function",bits2int:"function",bits2int_modN:"function"}),r=Object.assign({},r);let n=r.randomBytes===void 0?Ia:r.randomBytes,o=r.hmac===void 0?(D,P)=>fg(i,D,P):r.hmac,{Fp:s,Fn:a}=t,{ORDER:l,BITS:c}=a,{keygen:d,getPublicKey:u,getSharedSecret:h,utils:y,lengths:b}=LS(t,r),x={prehash:true,lowS:typeof r.lowS=="boolean"?r.lowS:true,format:"compact",extraEntropy:false},m=l*hg+Hi<s.ORDER;function A(D){let P=l>>Hi;return D>P}function _(D,P){if(!a.isValidNot0(P))throw new Error(`invalid signature ${D}: out of range 1..Point.Fn.ORDER`);return P}function w(){if(m)throw new Error('"recovered" sig type is not supported for cofactor >2 curves')}function I(D,P){Su(P);let L=b.signature,K=P==="compact"?L:P==="recovered"?L+1:void 0;return Se(D,K)}class N{constructor(P,L,K){f(this,"r");f(this,"s");f(this,"recovery");if(this.r=_("r",P),this.s=_("s",L),K!=null){if(w(),![0,1,2,3].includes(K))throw new Error("invalid recovery id");this.recovery=K;}Object.freeze(this);}static fromBytes(P,L=x.format){I(P,L);let K;if(L==="der"){let{r:Q,s:ee}=hr.toSig(Se(P));return new N(Q,ee)}L==="recovered"&&(K=P[0],L="compact",P=P.subarray(1));let z=b.signature/2,q=P.subarray(0,z),Y=P.subarray(z,z*2);return new N(a.fromBytes(q),a.fromBytes(Y),K)}static fromHex(P,L){return this.fromBytes(jo(P),L)}assertRecovery(){let{recovery:P}=this;if(P==null)throw new Error("invalid recovery id: must be present");return P}addRecoveryBit(P){return new N(this.r,this.s,P)}recoverPublicKey(P){let{r:L,s:K}=this,z=this.assertRecovery(),q=z===2||z===3?L+l:L;if(!s.isValid(q))throw new Error("invalid recovery id: sig.r+curve.n != R.x");let Y=s.toBytes(q),Q=t.fromBytes(Lt(mg((z&1)===0),Y)),ee=a.inv(q),V=O(Se(P,void 0,"msgHash")),ue=a.create(-V*ee),$=a.create(K*ee),Z=t.BASE.multiplyUnsafe(ue).add(Q.multiplyUnsafe($));if(Z.is0())throw new Error("invalid recovery: point at infinify");return Z.assertValidity(),Z}hasHighS(){return A(this.s)}toBytes(P=x.format){if(Su(P),P==="der")return jo(hr.hexFromSig(this));let{r:L,s:K}=this,z=a.toBytes(L),q=a.toBytes(K);return P==="recovered"?(w(),Lt(Uint8Array.of(this.assertRecovery()),z,q)):Lt(z,q)}toHex(P){return Ca(this.toBytes(P))}}Object.freeze(N.prototype),Object.freeze(N);let H=r.bits2int===void 0?function(P){if(P.length>8192)throw new Error("input is too large");let L=Xo(P),K=P.length*8-c;return K>0?L>>BigInt(K):L}:r.bits2int,O=r.bits2int_modN===void 0?function(P){return a.create(H(P))}:r.bits2int_modN,U=Ea(c);function F(D){return Wo("num < 2^"+c,D,Rr,U),a.toBytes(D)}function T(D,P){return Se(D,void 0,"message"),P?Se(i(D),void 0,"prehashed message"):D}function C(D,P,L){let{lowS:K,prehash:z,extraEntropy:q}=bu(L,x);D=T(D,z);let Y=O(D),Q=a.fromBytes(P);if(!a.isValidNot0(Q))throw new Error("invalid private key");let ee=[F(Q),F(Y)];if(q!=null&&q!==false){let Z=q===true?n(b.secretKey):q;ee.push(Se(Z,void 0,"extraEntropy"));}let V=Lt(...ee),ue=Y;function $(Z){let ae=H(Z);if(!a.isValidNot0(ae))return;let re=a.inv(ae),me=t.BASE.multiply(ae).toAffine(),ot=a.create(me.x);if(ot===Rr)return;let ye=a.create(re*a.create(ue+ot*Q));if(ye===Rr)return;let xe=(me.x===ot?0:2)|Number(me.y&Hi),Qr=ye;return K&&A(ye)&&(Qr=a.neg(ye),xe^=1),new N(ot,Qr,m?void 0:xe)}return {seed:V,k2sig:$}}function E(D,P,L={}){let{seed:K,k2sig:z}=C(D,P,L);return jm(i.outputLen,a.BYTES,o)(K,z).toBytes(L.format)}function v(D,P,L,K={}){let{lowS:z,prehash:q,format:Y}=bu(K,x);if(L=Se(L,void 0,"publicKey"),P=T(P,q),!wa(D)){let Q=D instanceof N?", use sig.toBytes()":"";throw new Error("verify expects Uint8Array signature"+Q)}I(D,Y);try{let Q=N.fromBytes(D,Y),ee=t.fromBytes(L);if(z&&Q.hasHighS())return !1;let{r:V,s:ue}=Q,$=O(P),Z=a.inv(ue),ae=a.create($*Z),re=a.create(V*Z),me=t.BASE.multiplyUnsafe(ae).add(ee.multiplyUnsafe(re));return me.is0()?!1:a.create(me.x)===V}catch{return false}}function B(D,P,L={}){let{prehash:K}=bu(L,x);return P=T(P,K),N.fromBytes(D,"recovered").recoverPublicKey(P).toBytes()}return Object.freeze({keygen:d,getPublicKey:u,getSharedSecret:h,utils:y,lengths:b,Point:t,sign:E,verify:v,recoverPublicKey:B,Signature:N,hash:i})}var HS={p:BigInt("0xffffffff00000001000000000000000000000000ffffffffffffffffffffffff"),n:BigInt("0xffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551"),h:BigInt(1),a:BigInt("0xffffffff00000001000000000000000000000000fffffffffffffffffffffffc"),b:BigInt("0x5ac635d8aa3a93e7b3ebbd55769886bc651d06b0cc53b0f63bce3c3e27d2604b"),Gx:BigInt("0x6b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c296"),Gy:BigInt("0x4fe342e2fe1a7f9b8ee7eb4a7c0f9e162bce33576b315ececbb6406837bf51f5")},KS={p:BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffeffffffff0000000000000000ffffffff"),n:BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffc7634d81f4372ddf581a0db248b0a77aecec196accc52973"),h:BigInt(1),a:BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffeffffffff0000000000000000fffffffc"),b:BigInt("0xb3312fa7e23ee7e4988e056be3f82d19181d9c6efe8141120314088f5013875ac656398d8a2ed19d2a85c8edd3ec2aef"),Gx:BigInt("0xaa87ca22be8b05378eb1c71ef320ad746e1d3b628ba79b9859f741e082542a385502f25dbf55296c3a545e3872760ab7"),Gy:BigInt("0x3617de4a96262c6f5d9e98bf9292dc29f8f41dbd289a147ce9da3113b5f0b8c00a60b1ce1d7e819d7a431d7c90ea0e5f")},qS={p:BigInt("0x1ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),n:BigInt("0x01fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa51868783bf2f966b7fcc0148f709a5d03bb5c9b8899c47aebb6fb71e91386409"),h:BigInt(1),a:BigInt("0x1fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc"),b:BigInt("0x0051953eb9618e1c9a1f929a21a0b68540eea2da725b99b315f3b8b489918ef109e156193951ec7e937b1652c0bd3bb1bf073573df883d2c34f1ef451fd46b503f00"),Gx:BigInt("0x00c6858e06b70404e9cd9e3ecb662395b4429c648139053fb521f828af606b4d3dbaa14b5e77efe75928fe1dc127a2ffa8de3348b3c1856a429bf97e7e31c2e5bd66"),Gy:BigInt("0x011839296a789a3bc0045c8a5fb42c7d1bd998f54449579b446817afbd17273e662c97ee72995ef42640c550b9013fad0761353c7086a272c24088be94769fd16650")};var GS=Re(HS),st=Oe(GS,rt);var zS=Re(KS),at=Oe(zS,Vo);var $S=Re(qS),ct=Oe($S,$o);var Ta=Uint32Array.from([1732584193,4023233417,2562383102,271733878,3285377520]),Ki=new Uint32Array(80),Au=class extends kn{constructor(){super(64,20,8,false);f(this,"A",Ta[0]|0);f(this,"B",Ta[1]|0);f(this,"C",Ta[2]|0);f(this,"D",Ta[3]|0);f(this,"E",Ta[4]|0);}get(){let{A:r,B:i,C:n,D:o,E:s}=this;return [r,i,n,o,s]}set(r,i,n,o,s){this.A=r|0,this.B=i|0,this.C=n|0,this.D=o|0,this.E=s|0;}process(r,i){for(let c=0;c<16;c++,i+=4)Ki[c]=r.getUint32(i,false);for(let c=16;c<80;c++)Ki[c]=Wc(Ki[c-3]^Ki[c-8]^Ki[c-14]^Ki[c-16],1);let{A:n,B:o,C:s,D:a,E:l}=this;for(let c=0;c<80;c++){let d,u;c<20?(d=Zc(o,s,a),u=1518500249):c<40?(d=o^s^a,u=1859775393):c<60?(d=Yc(o,s,a),u=2400959708):(d=o^s^a,u=3395469782);let h=Wc(n,5)+d+l+u+Ki[c]|0;l=a,a=s,s=Wc(o,30),o=n,n=h;}n=n+this.A|0,o=o+this.B|0,s=s+this.C|0,a=a+this.D|0,l=l+this.E|0,this.set(n,o,s,a,l);}roundClean(){Xe(Ki);}destroy(){this.destroyed=true,this.set(0,0,0,0,0),Xe(this.buffer);}},Mn=ni(()=>new Au);var Fn=Uint8Array.from([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9,12,5,1,15,14,13,4,10,0,7,6,3,9,2,8,11,13,11,7,14,12,1,3,9,5,0,15,4,8,6,2,10,6,15,14,9,11,3,0,8,12,2,13,7,1,4,10,5,10,2,8,4,7,6,1,5,15,11,9,14,3,12,13,0,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9]);var yg=new Uint32Array(8),_u=class{constructor(e,r,i,n,o,s,a={}){f(this,"canXOF",false);f(this,"finished",false);f(this,"length",0);f(this,"pos",0);f(this,"destroyed",false);f(this,"buffer");f(this,"view");f(this,"salt");f(this,"blockLen");f(this,"outputLen");f(this,"lengthFlag");f(this,"counterLen");f(this,"constants");let{salt:l}=a;if(this.blockLen=e,this.outputLen=r,this.lengthFlag=i,this.counterLen=n,this.buffer=new Uint8Array(e),this.view=ii(this.buffer),l!==void 0){let c=l;kt(c,4*o,"salt");let d=this.salt=new Uint32Array(o),u=ii(c);this.constants=s.slice();for(let h=0,y=0;h<d.length;h++,y+=4)d[h]=u.getUint32(y,false),this.constants[h]^=d[h];}else this.salt=yg,this.constants=s;}update(e){ri(this),kt(e);let{view:r,buffer:i,blockLen:n}=this,o=e.length,s;for(let a=0;a<o;){let l=Math.min(n-this.pos,o-a);if(l===n){for(s||(s=ii(e));n<=o-a;a+=n)this.length+=n,this.compress(s,a);continue}i.set(e.subarray(a,a+l),this.pos),this.pos+=l,a+=l,this.pos===n&&(this.length+=n,this.compress(r,0,true),this.pos=0);}return this}destroy(){this.destroyed=true,this.salt!==yg&&Xe(this.salt,this.constants);}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());let{buffer:r,length:i,finished:n,destroyed:o,constants:s,salt:a,pos:l}=this;return e.buffer.set(r),e.constants=s.slice(),e.destroyed=o,e.finished=n,e.length=i,e.pos=l,e.salt=a.slice(),e}clone(){return this._cloneInto()}digestInto(e){ri(this),zo(e,this),this.finished=true;let{buffer:r,blockLen:i,counterLen:n,lengthFlag:o,view:s}=this;Xe(r.subarray(this.pos));let a=BigInt((this.length+this.pos)*8),l=i-n-1;r[this.pos]|=128,this.length+=this.pos,this.pos>l&&(this.compress(s,0),Xe(r),this.pos=0),r[l]|=o,s.setBigUint64(i-8,a,false),this.compress(s,0,this.pos!==0),Xe(r);let c=ii(e),d=this.get();for(let u=0;u<this.outputLen/4;++u)c.setUint32(u*4,d[u]);}digest(){let{buffer:e,outputLen:r}=this;this.digestInto(e);let i=e.slice(0,r);return this.destroy(),i}},ka=Uint32Array.from([608135816,2242054355,320440878,57701188,2752067618,698298832,137296536,3964562569,1160258022,953160567,3193202383,887688300,3232508343,3380367581,1065670069,3041331479,2450970073,2306472731,3509652390,2564797868,805139163,3491422135,3101798381,1780907670,3128725573,4046225305,614570311,3012652279,134345442,2240740374,1667834072,1901547113]);var VS=He.slice();var j=new Uint32Array(32),Ze=new Uint32Array(32);function jS(){let t=[];for(let e=0,r=0;e<16;e++,r+=16)for(let i=1;i<16;i+=2)t.push(ka[Fn[r+i]*2+0]),t.push(ka[Fn[r+i]*2+1]),t.push(ka[Fn[r+i-1]*2+0]),t.push(ka[Fn[r+i-1]*2+1]);return new Uint32Array(t)}var f1=jS();function qi(t,e,r,i,n,o){let s=2*Fn[o],a=n[s+1]^f1[o*2+1],l=n[s]^f1[o*2],c=j[2*t+1],d=j[2*t],u=j[2*e+1],h=j[2*e],y=j[2*r+1],b=j[2*r],x=j[2*i+1],m=j[2*i],A=Aa(c,u,a);d=_a(A,d,h,l)>>>0,c=(A|0)>>>0,{Dh:m,Dl:x}={Dh:m^d,Dl:x^c},{Dh:m,Dl:x}={Dh:Um(m,x),Dl:Lm(m)},{h:b,l:y}=Pt(b,y,m,x),{Bh:h,Bl:u}={Bh:h^b,Bl:u^y},{Bh:h,Bl:u}={Bh:dr(h,u,25),Bl:ur(h,u,25)},j[2*t+1]=c,j[2*t]=d,j[2*e+1]=u,j[2*e]=h,j[2*r+1]=y,j[2*r]=b,j[2*i+1]=x,j[2*i]=m;}function Gi(t,e,r,i,n,o){let s=2*Fn[o],a=n[s+1]^f1[o*2+1],l=n[s]^f1[o*2],c=j[2*t+1],d=j[2*t],u=j[2*e+1],h=j[2*e],y=j[2*r+1],b=j[2*r],x=j[2*i+1],m=j[2*i],A=Aa(c,u,a);d=_a(A,d,h,l),c=A|0,{Dh:m,Dl:x}={Dh:m^d,Dl:x^c},{Dh:m,Dl:x}={Dh:dr(m,x,16),Dl:ur(m,x,16)},{h:b,l:y}=Pt(b,y,m,x),{Bh:h,Bl:u}={Bh:h^b,Bl:u^y},{Bh:h,Bl:u}={Bh:dr(h,u,11),Bl:ur(h,u,11)},j[2*t+1]=c,j[2*t]=d,j[2*e+1]=u,j[2*e]=h,j[2*r+1]=y,j[2*r]=b,j[2*i+1]=x,j[2*i]=m;}var Cu=class extends _u{constructor(r,i,n,o={}){super(128,r,n,16,8,ka,o);f(this,"v0l");f(this,"v0h");f(this,"v1l");f(this,"v1h");f(this,"v2l");f(this,"v2h");f(this,"v3l");f(this,"v3h");f(this,"v4l");f(this,"v4h");f(this,"v5l");f(this,"v5h");f(this,"v6l");f(this,"v6h");f(this,"v7l");f(this,"v7h");this.v0l=i[0]|0,this.v0h=i[1]|0,this.v1l=i[2]|0,this.v1h=i[3]|0,this.v2l=i[4]|0,this.v2h=i[5]|0,this.v3l=i[6]|0,this.v3h=i[7]|0,this.v4l=i[8]|0,this.v4h=i[9]|0,this.v5l=i[10]|0,this.v5h=i[11]|0,this.v6l=i[12]|0,this.v6h=i[13]|0,this.v7l=i[14]|0,this.v7h=i[15]|0;}get(){let{v0l:r,v0h:i,v1l:n,v1h:o,v2l:s,v2h:a,v3l:l,v3h:c,v4l:d,v4h:u,v5l:h,v5h:y,v6l:b,v6h:x,v7l:m,v7h:A}=this;return [r,i,n,o,s,a,l,c,d,u,h,y,b,x,m,A]}set(r,i,n,o,s,a,l,c,d,u,h,y,b,x,m,A){this.v0l=r|0,this.v0h=i|0,this.v1l=n|0,this.v1h=o|0,this.v2l=s|0,this.v2h=a|0,this.v3l=l|0,this.v3h=c|0,this.v4l=d|0,this.v4h=u|0,this.v5l=h|0,this.v5h=y|0,this.v6l=b|0,this.v6h=x|0,this.v7l=m|0,this.v7h=A|0;}destroy(){super.destroy(),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);}compress(r,i,n=true){for(let o=0;o<32;o++,i+=4)Ze[o]=r.getUint32(i,false);if(this.get().forEach((o,s)=>j[s]=o),j.set(this.constants.subarray(0,16),16),n){let{h:o,l:s}=ru(BigInt(this.length*8));j[24]=(j[24]^o)>>>0,j[25]=(j[25]^s)>>>0,j[26]=(j[26]^o)>>>0,j[27]=(j[27]^s)>>>0;}for(let o=0,s=0;o<16;o++)qi(0,4,8,12,Ze,s++),Gi(0,4,8,12,Ze,s++),qi(1,5,9,13,Ze,s++),Gi(1,5,9,13,Ze,s++),qi(2,6,10,14,Ze,s++),Gi(2,6,10,14,Ze,s++),qi(3,7,11,15,Ze,s++),Gi(3,7,11,15,Ze,s++),qi(0,5,10,15,Ze,s++),Gi(0,5,10,15,Ze,s++),qi(1,6,11,12,Ze,s++),Gi(1,6,11,12,Ze,s++),qi(2,7,8,13,Ze,s++),Gi(2,7,8,13,Ze,s++),qi(3,4,9,14,Ze,s++),Gi(3,4,9,14,Ze,s++);this.v0l^=j[0]^j[16]^this.salt[0],this.v0h^=j[1]^j[17]^this.salt[1],this.v1l^=j[2]^j[18]^this.salt[2],this.v1h^=j[3]^j[19]^this.salt[3],this.v2l^=j[4]^j[20]^this.salt[4],this.v2h^=j[5]^j[21]^this.salt[5],this.v3l^=j[6]^j[22]^this.salt[6],this.v3h^=j[7]^j[23]^this.salt[7],this.v4l^=j[8]^j[24]^this.salt[0],this.v4h^=j[9]^j[25]^this.salt[1],this.v5l^=j[10]^j[26]^this.salt[2],this.v5h^=j[11]^j[27]^this.salt[3],this.v6l^=j[12]^j[28]^this.salt[4],this.v6h^=j[13]^j[29]^this.salt[5],this.v7l^=j[14]^j[30]^this.salt[6],this.v7h^=j[15]^j[31]^this.salt[7],Xe(j,Ze);}};var wu=class extends Cu{constructor(e={}){super(64,VS,1,e);}};var bg=ni(t=>new wu(t));var zi=BigInt(0),Ye=BigInt(1),Iu=BigInt(2),XS=BigInt(8);function WS(t,e,r,i){let n=t.sqr(r),o=t.sqr(i),s=t.add(t.mul(e.a,n),o),a=t.add(t.ONE,t.mul(e.d,t.mul(n,o)));return t.eql(s,a)}function Sg(t,e={}){let r=e,i=c1("edwards",t,r,r.FpFnLE),{Fp:n,Fn:o}=i,s=i.CURVE,{h:a}=s;Dr(r,{},{uvRatio:"function"});let l=Iu<<BigInt(o.BYTES*8)-Ye,c=m=>n.create(m),d=r.uvRatio===void 0?(m,A)=>{try{return {isValid:!0,value:n.sqrt(n.div(m,A))}}catch{return {isValid:false,value:zi}}}:r.uvRatio;if(!WS(n,s,s.Gx,s.Gy))throw new Error("bad curve params: generator point");function u(m,A,_=false){let w=_?Ye:zi;return Wo("coordinate "+m,A,w,l),A}function h(m){if(!(m instanceof y))throw new Error("EdwardsPoint expected")}let x=class x{constructor(A,_,w,I){f(this,"X");f(this,"Y");f(this,"Z");f(this,"T");this.X=u("x",A),this.Y=u("y",_),this.Z=u("z",w,true),this.T=u("t",I),Object.freeze(this);}static CURVE(){return s}static fromAffine(A){if(A instanceof x)throw new Error("extended point not allowed");let{x:_,y:w}=A||{};return u("x",_),u("y",w),new x(_,w,Ye,c(_*w))}static fromBytes(A,_=false){let w=n.BYTES,{a:I,d:N}=s;A=o1(Se(A,w,"point")),fr(_,"zip215");let H=o1(A),O=A[w-1];H[w-1]=O&-129;let U=Nn(H),F=_?l:n.ORDER;Wo("point.y",U,zi,F);let T=c(U*U),C=c(T-Ye),E=c(N*T-I),{isValid:v,value:B}=d(C,E);if(!v)throw new Error("bad point: invalid y coordinate");let D=(B&Ye)===Ye,P=(O&128)!==0;if(!_&&B===zi&&P)throw new Error("bad point: x=0 and x_0=1");return P!==D&&(B=c(-B)),x.fromAffine({x:B,y:U})}static fromHex(A,_=false){return x.fromBytes(jo(A),_)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}precompute(A=8,_=true){return b.createCache(this,A),_||this.multiply(Iu),this}assertValidity(){let A=this,{a:_,d:w}=s;if(A.is0())throw new Error("bad point: ZERO");let{X:I,Y:N,Z:H,T:O}=A,U=c(I*I),F=c(N*N),T=c(H*H),C=c(T*T),E=c(U*_),v=c(T*c(E+F)),B=c(C+c(w*c(U*F)));if(v!==B)throw new Error("bad point: equation left != right (1)");let D=c(I*N),P=c(H*O);if(D!==P)throw new Error("bad point: equation left != right (2)")}equals(A){h(A);let{X:_,Y:w,Z:I}=this,{X:N,Y:H,Z:O}=A,U=c(_*O),F=c(N*I),T=c(w*O),C=c(H*I);return U===F&&T===C}is0(){return this.equals(x.ZERO)}negate(){return new x(c(-this.X),this.Y,this.Z,c(-this.T))}double(){let{a:A}=s,{X:_,Y:w,Z:I}=this,N=c(_*_),H=c(w*w),O=c(Iu*c(I*I)),U=c(A*N),F=_+w,T=c(c(F*F)-N-H),C=U+H,E=C-O,v=U-H,B=c(T*E),D=c(C*v),P=c(T*v),L=c(E*C);return new x(B,D,L,P)}add(A){h(A);let{a:_,d:w}=s,{X:I,Y:N,Z:H,T:O}=this,{X:U,Y:F,Z:T,T:C}=A,E=c(I*U),v=c(N*F),B=c(O*w*C),D=c(H*T),P=c((I+N)*(U+F)-E-v),L=D-B,K=D+B,z=c(v-_*E),q=c(P*L),Y=c(K*z),Q=c(P*z),ee=c(L*K);return new x(q,Y,ee,Q)}subtract(A){return h(A),this.add(A.negate())}multiply(A){if(!o.isValidNot0(A))throw new RangeError("invalid scalar: expected 1 <= sc < curve.n");let{p:_,f:w}=b.cached(this,A,I=>On(x,I));return On(x,[_,w])[0]}multiplyUnsafe(A){if(!o.isValid(A))throw new RangeError("invalid scalar: expected 0 <= sc < curve.n");return A===zi?x.ZERO:this.is0()||A===Ye?this:b.unsafe(this,A,_=>On(x,_))}isSmallOrder(){return this.clearCofactor().is0()}isTorsionFree(){return b.unsafe(this,s.n).is0()}toAffine(A){let _=this,w=A,{X:I,Y:N,Z:H}=_,O=_.is0();w==null&&(w=O?XS:n.inv(H));let U=c(I*w),F=c(N*w),T=n.mul(H,w);if(O)return {x:zi,y:Ye};if(T!==Ye)throw new Error("invZ was invalid");return {x:U,y:F}}clearCofactor(){return a===Ye?this:this.multiplyUnsafe(a)}toBytes(){let{x:A,y:_}=this.toAffine(),w=n.toBytes(_);return w[w.length-1]|=A&Ye?128:0,w}toHex(){return Ca(this.toBytes())}toString(){return `<Point ${this.is0()?"ZERO":this.toHex()}>`}};f(x,"BASE",new x(s.Gx,s.Gy,Ye,c(s.Gx*s.Gy))),f(x,"ZERO",new x(zi,Ye,Ye,zi)),f(x,"Fp",n),f(x,"Fn",o);let y=x,b=new Jo(y,o.BITS);return o.BITS>=8&&y.BASE.precompute(8),Object.freeze(y.prototype),Object.freeze(y),y}function xg(t,e,r={}){if(typeof e!="function")throw new Error('"hash" function param is required');let i=e,n=r;Dr(n,{},{adjustScalarBytes:"function",randomBytes:"function",domain:"function",prehash:"function",zip215:"boolean",mapToCurve:"function"});let{prehash:o}=n,{BASE:s,Fp:a,Fn:l}=t,c=i.outputLen,d=2*a.BYTES;if(c!==void 0&&(Pn(c,"hash.outputLen"),c!==d))throw new Error(`hash.outputLen must be ${d}, got ${c}`);let u=n.randomBytes===void 0?Ia:n.randomBytes,h=n.adjustScalarBytes===void 0?E=>E:n.adjustScalarBytes,y=n.domain===void 0?(E,v,B)=>{if(fr(B,"phflag"),v.length||B)throw new Error("Contexts/pre-hash are not supported");return E}:n.domain;function b(E){return l.create(Nn(E))}function x(E){let v=O.secretKey;Se(E,O.secretKey,"secretKey");let B=Se(i(E),2*v,"hashedSecretKey"),D=h(B.slice(0,v)),P=B.slice(v,2*v),L=b(D);return {head:D,prefix:P,scalar:L}}function m(E){let{head:v,prefix:B,scalar:D}=x(E),P=s.multiply(D),L=P.toBytes();return {head:v,prefix:B,scalar:D,point:P,pointBytes:L}}function A(E){return m(E).pointBytes}function _(E=Uint8Array.of(),...v){let B=Lt(...v);return b(i(y(B,Se(E,void 0,"context"),!!o)))}function w(E,v,B={}){E=Se(E,void 0,"message"),o&&(E=o(E));let{prefix:D,scalar:P,pointBytes:L}=m(v),K=_(B.context,D,E),z=s.multiply(K).toBytes(),q=_(B.context,z,L,E),Y=l.create(K+q*P);if(!l.isValid(Y))throw new Error("sign failed: invalid s");let Q=Lt(z,l.toBytes(Y));return Se(Q,O.signature,"result")}let I={zip215:n.zip215};function N(E,v,B,D=I){let{context:P}=D,L=D.zip215===void 0?!!I.zip215:D.zip215,K=O.signature;E=Se(E,K,"signature"),v=Se(v,void 0,"message"),B=Se(B,O.publicKey,"publicKey"),L!==void 0&&fr(L,"zip215"),o&&(v=o(v));let z=K/2,q=E.subarray(0,z),Y=Nn(E.subarray(z,K)),Q,ee,V;try{Q=t.fromBytes(B,L),ee=t.fromBytes(q,L),V=s.multiplyUnsafe(Y);}catch{return false}if(!L&&Q.isSmallOrder())return false;let ue=_(P,q,B,v);return ee.add(Q.multiplyUnsafe(ue)).subtract(V).clearCofactor().is0()}let H=a.BYTES,O={secretKey:H,publicKey:H,signature:2*H,seed:H};function U(E){return E=E===void 0?u(O.seed):E,Se(E,O.seed,"seed")}function F(E){return wa(E)&&E.length===O.secretKey}function T(E,v){try{return !!t.fromBytes(E,v===void 0?I.zip215:v)}catch{return false}}let C={getExtendedPublicKey:m,randomSecretKey:U,isValidSecretKey:F,isValidPublicKey:T,toMontgomery(E){let{y:v}=t.fromBytes(E),B=O.publicKey,D=B===32;if(!D&&B!==57)throw new Error("only defined for 25519 and 448");let P=D?a.div(Ye+v,Ye-v):a.div(v-Ye,v+Ye);return a.toBytes(P)},toMontgomerySecret(E){let v=O.secretKey;Se(E,v);let B=i(E.subarray(0,v));return h(B).subarray(0,v)}};return Object.freeze(O),Object.freeze(C),Object.freeze({keygen:l1(U,A),getPublicKey:A,sign:w,verify:N,utils:C,Point:t,lengths:O})}var ZS={p:BigInt("0x30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000001"),n:BigInt("0x060c89ce5c263405370a08b6d0302b0bab3eedb83920ee0a677297dc392126f1"),h:BigInt(8),a:BigInt("168700"),d:BigInt("168696"),Gx:BigInt("0xbb77a6ad63e739b4eacb2e09d6277c12ab8d8010534e0b62893f3f6bb957051"),Gy:BigInt("0x25797203f7a0b24925572e1cd16bf9edfce0051fb9e133774b3c257a872d7d8b")},Nt=xg(Sg(ZS),bg);var YS={p:BigInt("0xa9fb57dba1eea9bc3e660a909d838d726e3bf623d52620282013481d1f6e5377"),a:BigInt("0x7d5a0975fc2c3057eef67530417affe7fb8055c126dc5c6ce94a4b44f330b5d9"),b:BigInt("0x26dc5c6ce94a4b44f330b5d9bbd77cbf958416295cf7e1ce6bccdc18ff8c07b6"),n:BigInt("0xa9fb57dba1eea9bc3e660a909d838d718c397aa3b561a6f7901e0e82974856a7"),Gx:BigInt("0x8bd2aeb9cb7e57cb2c4b482ffc81b7afb9de27e1e3bd23c23a4453bd9ace3262"),Gy:BigInt("0x547ef835c3dac4fd97f8461a14611dc9c27745132ded8e545c1d54c72f046997"),h:BigInt(1)},Ag=Oe(Re(YS),rt),QS={p:BigInt("0x8cb91e82a3386d280f5d6f7e50e641df152f7109ed5456b412b1da197fb71123acd3a729901d1a71874700133107ec53"),a:BigInt("0x7bc382c63d8c150c3c72080ace05afa0c2bea28e4fb22787139165efba91f90f8aa5814a503ad4eb04a8c7dd22ce2826"),b:BigInt("0x04a8c7dd22ce28268b39b55416f0447c2fb77de107dcd2a62e880ea53eeb62d57cb4390295dbc9943ab78696fa504c11"),n:BigInt("0x8cb91e82a3386d280f5d6f7e50e641df152f7109ed5456b31f166e6cac0425a7cf3ab6af6b7fc3103b883202e9046565"),Gx:BigInt("0x1d1c64f068cf45ffa2a63a81b7c13f6b8847a3e77ef14fe3db7fcafe0cbd10e8e826e03436d646aaef87b2e247d4af1e"),Gy:BigInt("0x8abe1d7520f9c2a45cb1eb8e95cfd55262b70b29feec5864e19c054ff99129280e4646217791811142820341263c5315"),h:BigInt(1)},_g=Oe(Re(QS),Vo),JS={p:BigInt("0xaadd9db8dbe9c48b3fd4e6ae33c9fc07cb308db3b3c9d20ed6639cca703308717d4d9b009bc66842aecda12ae6a380e62881ff2f2d82c68528aa6056583a48f3"),a:BigInt("0x7830a3318b603b89e2327145ac234cc594cbdd8d3df91610a83441caea9863bc2ded5d5aa8253aa10a2ef1c98b9ac8b57f1117a72bf2c7b9e7c1ac4d77fc94ca"),b:BigInt("0x3df91610a83441caea9863bc2ded5d5aa8253aa10a2ef1c98b9ac8b57f1117a72bf2c7b9e7c1ac4d77fc94cadc083e67984050b75ebae5dd2809bd638016f723"),n:BigInt("0xaadd9db8dbe9c48b3fd4e6ae33c9fc07cb308db3b3c9d20ed6639cca70330870553e5c414ca92619418661197fac10471db1d381085ddaddb58796829ca90069"),Gx:BigInt("0x81aee4bdd82ed9645a21322e9c4c6a9385ed9f70b5d916c1b43b62eef4d0098eff3b1f78e2d0d48d50d1687b93b97d5f7c6d5047406a5e688b352209bcb9f822"),Gy:BigInt("0x7dde385d566332ecc0eabfa9cf7822fdf209f70024a57b1aa000c55b881f8111b2dcde494a5f485e5bca4bd88a2763aed1ca2b2fa8f0540678cd1e0f3ad80892"),h:BigInt(1)},Cg=Oe(Re(JS),$o);var Lr={};Vh(Lr,{Any:()=>Mr,BaseBlock:()=>Pe,BaseStringBlock:()=>Ra,BitString:()=>yr,BmpString:()=>qn,Boolean:()=>Ln,CharacterString:()=>Yn,Choice:()=>rs,Constructed:()=>Me,DATE:()=>Ha,DEFAULT_MAX_CONTENT_LENGTH:()=>Mg,DEFAULT_MAX_DEPTH:()=>Rg,DEFAULT_MAX_NODES:()=>Og,DateTime:()=>qa,Duration:()=>Ga,EndOfContent:()=>Oa,Enumerated:()=>Hn,GeneralString:()=>Zn,GeneralizedTime:()=>Qn,GraphicString:()=>Wn,HexBlock:()=>Ur,IA5String:()=>Xn,Integer:()=>li,Null:()=>mr,NumericString:()=>zn,ObjectIdentifier:()=>Kn,OctetString:()=>gr,Primitive:()=>ci,PrintableString:()=>$n,RawData:()=>Tu,RelativeObjectIdentifier:()=>La,Repeated:()=>Jn,Sequence:()=>lt,Set:()=>pt,TIME:()=>za,TeletexString:()=>Vn,TimeOfDay:()=>Ka,UTCTime:()=>ji,UniversalString:()=>Gn,Utf8String:()=>Kt,ValueBlock:()=>Qe,VideotexString:()=>jn,ViewWriter:()=>ts,VisibleString:()=>Vi,compareSchema:()=>si,fromBER:()=>ui,verifySchema:()=>vx});var de=tt(wg());function Un(t,e){let r=0;if(t.length===1)return t[0];for(let i=t.length-1;i>=0;i--)r+=t[t.length-1-i]*Math.pow(2,e*i);return r}function $i(t,e,r=-1){let i=r,n=t,o=0,s=Math.pow(2,e);for(let a=1;a<8;a++){if(t<s){let l;if(i<0)l=new ArrayBuffer(a),o=a;else {if(i<a)return new ArrayBuffer(0);l=new ArrayBuffer(i),o=i;}let c=new Uint8Array(l);for(let d=a-1;d>=0;d--){let u=Math.pow(2,d*e);c[o-d-1]=Math.floor(n/u),n-=c[o-d-1]*u;}return l}s*=Math.pow(2,e);}return new ArrayBuffer(0)}function m1(...t){let e=0,r=0;for(let o of t)e+=o.length;let i=new ArrayBuffer(e),n=new Uint8Array(i);for(let o of t)n.set(o,r),r+=o.length;return n}function Eu(){let t=new Uint8Array(this.valueHex);if(this.valueHex.byteLength>=2){let a=t[0]===255&&t[1]&128,l=t[0]===0&&(t[1]&128)===0;(a||l)&&this.warnings.push("Needlessly long format");}let e=new ArrayBuffer(this.valueHex.byteLength),r=new Uint8Array(e);for(let a=0;a<this.valueHex.byteLength;a++)r[a]=0;r[0]=t[0]&128;let i=Un(r,8),n=new ArrayBuffer(this.valueHex.byteLength),o=new Uint8Array(n);for(let a=0;a<this.valueHex.byteLength;a++)o[a]=t[a];return o[0]&=127,Un(o,8)-i}function Ig(t){let e=t<0?t*-1:t,r=128;for(let i=1;i<8;i++){if(e<=r){if(t<0){let s=r-e,a=$i(s,8,i),l=new Uint8Array(a);return l[0]|=128,a}let n=$i(e,8,i),o=new Uint8Array(n);if(o[0]&128){let s=n.slice(0),a=new Uint8Array(s);n=new ArrayBuffer(n.byteLength+1),o=new Uint8Array(n);for(let l=0;l<s.byteLength;l++)o[l+1]=a[l];o[0]=0;}return n}r*=Math.pow(2,8);}return new ArrayBuffer(0)}function vg(t,e){if(t.byteLength!==e.byteLength)return false;let r=new Uint8Array(t),i=new Uint8Array(e);for(let n=0;n<r.length;n++)if(r[n]!==i[n])return false;return true}function St(t,e){let r=t.toString(10);if(e<r.length)return "";let i=e-r.length,n=new Array(i);for(let s=0;s<i;s++)n[s]="0";return n.join("").concat(r)}function g1(){if(typeof BigInt>"u")throw new Error("BigInt is not defined. Your environment doesn't implement BigInt.")}function ku(t){let e=0,r=0;for(let n=0;n<t.length;n++){let o=t[n];e+=o.byteLength;}let i=new Uint8Array(e);for(let n=0;n<t.length;n++){let o=t[n];i.set(new Uint8Array(o),r),r+=o.byteLength;}return i.buffer}function di(t,e,r,i){return e instanceof Uint8Array?e.byteLength?r<0?(t.error="Wrong parameter: inputOffset less than zero",false):i<0?(t.error="Wrong parameter: inputLength less than zero",false):e.byteLength-r-i<0?(t.error="End of input reached before message was fully decoded (inconsistent offset and length values)",false):true:(t.error="Wrong parameter: inputBuffer has zero length",false):(t.error="Wrong parameter: inputBuffer must be 'Uint8Array'",false)}var ts=class{constructor(){this.items=[];}write(e){this.items.push(e);}final(){return ku(this.items)}},Pa=[new Uint8Array([1])],Eg="0123456789",Bu="name",Bg="valueHexView",cx="isHexOnly",lx="idBlock",dx="tagClass",ux="tagNumber",fx="isConstructed",px="fromBER",hx="toBER",mx="local",xt="",Fr=new ArrayBuffer(0),P1=new Uint8Array(0),Da="EndOfContent",kg="OCTET STRING",Pg="BIT STRING";function Ur(t){var e;return e=class extends t{get valueHex(){return this.valueHexView.slice().buffer}set valueHex(i){this.valueHexView=new Uint8Array(i);}constructor(...i){var n;super(...i);let o=i[0]||{};this.isHexOnly=(n=o.isHexOnly)!==null&&n!==void 0?n:false,this.valueHexView=o.valueHex?de.BufferSourceConverter.toUint8Array(o.valueHex):P1;}fromBER(i,n,o,s){let a=i instanceof ArrayBuffer?new Uint8Array(i):i;if(!di(this,a,n,o))return -1;let l=n+o;return this.valueHexView=a.subarray(n,l),this.valueHexView.length?(this.blockLength=o,l):(this.warnings.push("Zero buffer length"),n)}toBER(i=false){return this.isHexOnly?i?new ArrayBuffer(this.valueHexView.byteLength):this.valueHexView.byteLength===this.valueHexView.buffer.byteLength?this.valueHexView.buffer:this.valueHexView.slice().buffer:(this.error="Flag 'isHexOnly' is not set, abort",Fr)}toJSON(){return {...super.toJSON(),isHexOnly:this.isHexOnly,valueHex:de.Convert.ToHex(this.valueHexView)}}},e.NAME="hexBlock",e}var ai=class{static blockName(){return this.NAME}get valueBeforeDecode(){return this.valueBeforeDecodeView.slice().buffer}set valueBeforeDecode(e){this.valueBeforeDecodeView=new Uint8Array(e);}constructor({blockLength:e=0,error:r=xt,warnings:i=[],valueBeforeDecode:n=P1}={}){this.blockLength=e,this.error=r,this.warnings=i,this.valueBeforeDecodeView=de.BufferSourceConverter.toUint8Array(n);}toJSON(){return {blockName:this.constructor.NAME,blockLength:this.blockLength,error:this.error,warnings:this.warnings,valueBeforeDecode:de.Convert.ToHex(this.valueBeforeDecodeView)}}};ai.NAME="baseBlock";var Qe=class extends ai{fromBER(e,r,i,n){throw TypeError("User need to make a specific function in a class which extends 'ValueBlock'")}toBER(e,r){throw TypeError("User need to make a specific function in a class which extends 'ValueBlock'")}};Qe.NAME="valueBlock";var y1=class extends Ur(ai){constructor({idBlock:e={}}={}){var r,i,n,o;super(),e?(this.isHexOnly=(r=e.isHexOnly)!==null&&r!==void 0?r:false,this.valueHexView=e.valueHex?de.BufferSourceConverter.toUint8Array(e.valueHex):P1,this.tagClass=(i=e.tagClass)!==null&&i!==void 0?i:-1,this.tagNumber=(n=e.tagNumber)!==null&&n!==void 0?n:-1,this.isConstructed=(o=e.isConstructed)!==null&&o!==void 0?o:false):(this.tagClass=-1,this.tagNumber=-1,this.isConstructed=false);}toBER(e=false){let r=0;switch(this.tagClass){case 1:r|=0;break;case 2:r|=64;break;case 3:r|=128;break;case 4:r|=192;break;default:return this.error="Unknown tag class",Fr}if(this.isConstructed&&(r|=32),this.tagNumber<31&&!this.isHexOnly){let n=new Uint8Array(1);if(!e){let o=this.tagNumber;o&=31,r|=o,n[0]=r;}return n.buffer}if(!this.isHexOnly){let n=$i(this.tagNumber,7),o=new Uint8Array(n),s=n.byteLength,a=new Uint8Array(s+1);if(a[0]=r|31,!e){for(let l=0;l<s-1;l++)a[l+1]=o[l]|128;a[s]=o[s-1];}return a.buffer}let i=new Uint8Array(this.valueHexView.byteLength+1);if(i[0]=r|31,!e){let n=this.valueHexView;for(let o=0;o<n.length-1;o++)i[o+1]=n[o]|128;i[this.valueHexView.byteLength]=n[n.length-1];}return i.buffer}fromBER(e,r,i){let n=de.BufferSourceConverter.toUint8Array(e);if(!di(this,n,r,i))return -1;let o=n.subarray(r,r+i);if(o.length===0)return this.error="Zero buffer length",-1;switch(o[0]&192){case 0:this.tagClass=1;break;case 64:this.tagClass=2;break;case 128:this.tagClass=3;break;case 192:this.tagClass=4;break;default:return this.error="Unknown tag class",-1}this.isConstructed=(o[0]&32)===32,this.isHexOnly=false;let a=o[0]&31;if(a!==31)this.tagNumber=a,this.blockLength=1;else {let l=0;for(;;){let d=l+1;if(d>=o.length)return this.error="End of input reached before message was fully decoded",-1;if(l++,(o[d]&128)===0)break}this.blockLength=l+1;let c=this.valueHexView=new Uint8Array(l);for(let d=0;d<l;d++)c[d]=o[d+1]&127;this.blockLength<=9?this.tagNumber=Un(c,7):(this.isHexOnly=true,this.warnings.push("Tag too long, represented as hex-coded"));}if(this.tagClass===1&&this.isConstructed)switch(this.tagNumber){case 1:case 2:case 5:case 6:case 9:case 13:case 14:case 23:case 24:case 31:case 32:case 33:case 34:return this.error="Constructed encoding used for primitive type",-1}return r+this.blockLength}toJSON(){return {...super.toJSON(),tagClass:this.tagClass,tagNumber:this.tagNumber,isConstructed:this.isConstructed}}};y1.NAME="identificationBlock";var b1=class extends ai{constructor({lenBlock:e={}}={}){var r,i,n;super(),this.isIndefiniteForm=(r=e.isIndefiniteForm)!==null&&r!==void 0?r:false,this.longFormUsed=(i=e.longFormUsed)!==null&&i!==void 0?i:false,this.length=(n=e.length)!==null&&n!==void 0?n:0;}fromBER(e,r,i){let n=de.BufferSourceConverter.toUint8Array(e);if(!di(this,n,r,i))return -1;let o=n.subarray(r,r+i);if(o.length===0)return this.error="Zero buffer length",-1;if(o[0]===255)return this.error="Length block 0xFF is reserved by standard",-1;if(this.isIndefiniteForm=o[0]===128,this.isIndefiniteForm)return this.blockLength=1,r+this.blockLength;if(this.longFormUsed=!!(o[0]&128),this.longFormUsed===false)return this.length=o[0],this.blockLength=1,r+this.blockLength;let s=o[0]&127;if(s>8)return this.error="Too big integer",-1;if(s+1>o.length)return this.error="End of input reached before message was fully decoded",-1;let a=r+1,l=n.subarray(a,a+s);return l[s-1]===0&&this.warnings.push("Needlessly long encoded length"),this.length=Un(l,8),this.longFormUsed&&this.length<=127&&this.warnings.push("Unnecessary usage of long length form"),this.blockLength=s+1,r+this.blockLength}toBER(e=false){let r,i;if(this.length>127&&(this.longFormUsed=true),this.isIndefiniteForm)return r=new ArrayBuffer(1),e===false&&(i=new Uint8Array(r),i[0]=128),r;if(this.longFormUsed){let n=$i(this.length,8);if(n.byteLength>127)return this.error="Too big length",Fr;if(r=new ArrayBuffer(n.byteLength+1),e)return r;let o=new Uint8Array(n);i=new Uint8Array(r),i[0]=n.byteLength|128;for(let s=0;s<n.byteLength;s++)i[s+1]=o[s];return r}return r=new ArrayBuffer(1),e===false&&(i=new Uint8Array(r),i[0]=this.length),r}toJSON(){return {...super.toJSON(),isIndefiniteForm:this.isIndefiniteForm,longFormUsed:this.longFormUsed,length:this.length}}};b1.NAME="lengthBlock";var X={},Pe=class extends ai{constructor({name:e=xt,optional:r=false,primitiveSchema:i,...n}={},o){super(n),this.name=e,this.optional=r,i&&(this.primitiveSchema=i),this.idBlock=new y1(n),this.lenBlock=new b1(n),this.valueBlock=o?new o(n):new Qe(n);}fromBER(e,r,i,n){let o=this.valueBlock.fromBER(e,r,this.lenBlock.isIndefiniteForm?i:this.lenBlock.length,n);return o===-1?(this.error=this.valueBlock.error,o):(this.idBlock.error.length||(this.blockLength+=this.idBlock.blockLength),this.lenBlock.error.length||(this.blockLength+=this.lenBlock.blockLength),this.valueBlock.error.length||(this.blockLength+=this.valueBlock.blockLength),o)}toBER(e,r){let i=r||new ts;r||Ng(this);let n=this.idBlock.toBER(e);if(i.write(n),this.lenBlock.isIndefiniteForm)i.write(new Uint8Array([128]).buffer),this.valueBlock.toBER(e,i),i.write(new ArrayBuffer(2));else {let o=this.valueBlock.toBER(e);this.lenBlock.length=o.byteLength;let s=this.lenBlock.toBER(e);i.write(s),i.write(o);}return r?Fr:i.final()}toJSON(){let e={...super.toJSON(),idBlock:this.idBlock.toJSON(),lenBlock:this.lenBlock.toJSON(),valueBlock:this.valueBlock.toJSON(),name:this.name,optional:this.optional};return this.primitiveSchema&&(e.primitiveSchema=this.primitiveSchema.toJSON()),e}toString(e="ascii"){return e==="ascii"?this.onAsciiEncoding():de.Convert.ToHex(this.toBER())}onAsciiEncoding(){let e=this.constructor.NAME,r=de.Convert.ToHex(this.valueBlock.valueBeforeDecodeView);return `${e} : ${r}`}isEqual(e){if(this===e)return true;if(!(e instanceof this.constructor))return false;let r=this.toBER(),i=e.toBER();return vg(r,i)}};Pe.NAME="BaseBlock";function Ng(t){var e;if(t instanceof X.Constructed)for(let r of t.valueBlock.value)Ng(r)&&(t.lenBlock.isIndefiniteForm=true);return !!(!((e=t.lenBlock)===null||e===void 0)&&e.isIndefiniteForm)}var Ra=class extends Pe{getValue(){return this.valueBlock.value}setValue(e){this.valueBlock.value=e;}constructor({value:e=xt,...r}={},i){super(r,i),e&&this.fromString(e);}fromBER(e,r,i){let n=this.valueBlock.fromBER(e,r,this.lenBlock.isIndefiniteForm?i:this.lenBlock.length);return n===-1?(this.error=this.valueBlock.error,n):(this.fromBuffer(this.valueBlock.valueHexView),this.idBlock.error.length||(this.blockLength+=this.idBlock.blockLength),this.lenBlock.error.length||(this.blockLength+=this.lenBlock.blockLength),this.valueBlock.error.length||(this.blockLength+=this.valueBlock.blockLength),n)}onAsciiEncoding(){return `${this.constructor.NAME} : '${this.valueBlock.value}'`}};Ra.NAME="BaseStringBlock";var S1=class extends Ur(Qe){constructor({isHexOnly:e=true,...r}={}){super(r),this.isHexOnly=e;}};S1.NAME="PrimitiveValueBlock";var Dg,ci=class extends Pe{constructor(e={}){super(e,S1),this.idBlock.isConstructed=false;}};Dg=ci;X.Primitive=Dg;ci.NAME="PRIMITIVE";var Rg=100,Og=1e4,Mg=16*1024*1024,gx="Maximum ASN.1 nesting depth exceeded",yx="Maximum ASN.1 node count exceeded",bx="Maximum ASN.1 content length exceeded";function $a(t={}){var e,r,i;return {depth:0,maxDepth:(e=t.maxDepth)!==null&&e!==void 0?e:Rg,nodesCount:0,maxNodes:(r=t.maxNodes)!==null&&r!==void 0?r:Og,maxContentLength:(i=t.maxContentLength)!==null&&i!==void 0?i:Mg}}function Sx(t){let e=new Pe({},Qe);return e.error=t,{offset:-1,result:e}}function xx(t){if(t.nodesCount+=1,t.nodesCount>t.maxNodes)return yx}function Ax(t,e){if(t>e.maxContentLength)return bx}function Pu(t,e,r,i){let n=i.depth+1;if(n>i.maxDepth)return Sx(gx);i.depth=n;try{return N1(t,e,r,i)}finally{i.depth-=1;}}function _x(t,e){if(t instanceof e)return t;let r=new e;return r.idBlock=t.idBlock,r.lenBlock=t.lenBlock,r.warnings=t.warnings,r.valueBeforeDecodeView=t.valueBeforeDecodeView,r}function N1(t,e=0,r=t.length,i=$a()){let n=e,o=new Pe({},Qe),s=new ai;if(!di(s,t,e,r))return o.error=s.error,{offset:-1,result:o};if(!t.subarray(e,e+r).length)return o.error="Zero buffer length",{offset:-1,result:o};let l=xx(i);if(l)return o.error=l,{offset:-1,result:o};let c=o.idBlock.fromBER(t,e,r);if(o.idBlock.warnings.length&&o.warnings.concat(o.idBlock.warnings),c===-1)return o.error=o.idBlock.error,{offset:-1,result:o};if(e=c,r-=o.idBlock.blockLength,c=o.lenBlock.fromBER(t,e,r),o.lenBlock.warnings.length&&o.warnings.concat(o.lenBlock.warnings),c===-1)return o.error=o.lenBlock.error,{offset:-1,result:o};e=c,r-=o.lenBlock.blockLength;let d=o.lenBlock.isIndefiniteForm?r:o.lenBlock.length,u=Ax(d,i);if(u)return o.error=u,{offset:-1,result:o};if(!o.idBlock.isConstructed&&o.lenBlock.isIndefiniteForm)return o.error="Indefinite length form used for primitive encoding form",{offset:-1,result:o};let h=Pe;switch(o.idBlock.tagClass){case 1:if(o.idBlock.tagNumber>=37&&o.idBlock.isHexOnly===false)return o.error="UNIVERSAL 37 and upper tags are reserved by ASN.1 standard",{offset:-1,result:o};switch(o.idBlock.tagNumber){case 0:if(o.idBlock.isConstructed&&o.lenBlock.length>0)return o.error="Type [UNIVERSAL 0] is reserved",{offset:-1,result:o};h=X.EndOfContent;break;case 1:h=X.Boolean;break;case 2:h=X.Integer;break;case 3:h=X.BitString;break;case 4:h=X.OctetString;break;case 5:h=X.Null;break;case 6:h=X.ObjectIdentifier;break;case 10:h=X.Enumerated;break;case 12:h=X.Utf8String;break;case 13:h=X.RelativeObjectIdentifier;break;case 14:h=X.TIME;break;case 15:return o.error="[UNIVERSAL 15] is reserved by ASN.1 standard",{offset:-1,result:o};case 16:h=X.Sequence;break;case 17:h=X.Set;break;case 18:h=X.NumericString;break;case 19:h=X.PrintableString;break;case 20:h=X.TeletexString;break;case 21:h=X.VideotexString;break;case 22:h=X.IA5String;break;case 23:h=X.UTCTime;break;case 24:h=X.GeneralizedTime;break;case 25:h=X.GraphicString;break;case 26:h=X.VisibleString;break;case 27:h=X.GeneralString;break;case 28:h=X.UniversalString;break;case 29:h=X.CharacterString;break;case 30:h=X.BmpString;break;case 31:h=X.DATE;break;case 32:h=X.TimeOfDay;break;case 33:h=X.DateTime;break;case 34:h=X.Duration;break;default:{let y=o.idBlock.isConstructed?new X.Constructed:new X.Primitive;y.idBlock=o.idBlock,y.lenBlock=o.lenBlock,y.warnings=o.warnings,o=y;}}break;default:h=o.idBlock.isConstructed?X.Constructed:X.Primitive;}return o=_x(o,h),c=o.fromBER(t,e,d,i),o.valueBeforeDecodeView=t.subarray(n,n+o.blockLength),{offset:c,result:o}}function ui(t,e={}){if(!t.byteLength){let r=new Pe({},Qe);return r.error="Input buffer has zero length",{offset:-1,result:r}}return N1(de.BufferSourceConverter.toUint8Array(t).slice(),0,t.byteLength,$a(e))}function Cx(t,e){return t?1:e}var Or=class extends Qe{constructor({value:e=[],isIndefiniteForm:r=false,...i}={}){super(i),this.value=e,this.isIndefiniteForm=r;}fromBER(e,r,i,n){let o=de.BufferSourceConverter.toUint8Array(e),s=n??$a();if(!di(this,o,r,i))return -1;if(this.valueBeforeDecodeView=o.subarray(r,r+i),this.valueBeforeDecodeView.length===0)return this.warnings.push("Zero buffer length"),r;let a=r;for(;Cx(this.isIndefiniteForm,i)>0;){let l=Pu(o,a,i,s);if(l.offset===-1)return this.error=l.result.error,this.warnings.concat(l.result.warnings),-1;if(a=l.offset,this.blockLength+=l.result.blockLength,i-=l.result.blockLength,this.value.push(l.result),this.isIndefiniteForm&&l.result.constructor.NAME===Da)break}return this.isIndefiniteForm&&(this.value[this.value.length-1].constructor.NAME===Da?this.value.pop():this.warnings.push("No EndOfContent block encoded")),a}toBER(e,r){let i=r||new ts;for(let n=0;n<this.value.length;n++)this.value[n].toBER(e,i);return r?Fr:i.final()}toJSON(){let e={...super.toJSON(),isIndefiniteForm:this.isIndefiniteForm,value:[]};for(let r of this.value)e.value.push(r.toJSON());return e}};Or.NAME="ConstructedValueBlock";var Fg,Me=class extends Pe{constructor(e={}){super(e,Or),this.idBlock.isConstructed=true;}fromBER(e,r,i,n){this.valueBlock.isIndefiniteForm=this.lenBlock.isIndefiniteForm;let o=this.valueBlock.fromBER(e,r,this.lenBlock.isIndefiniteForm?i:this.lenBlock.length,n);return o===-1?(this.error=this.valueBlock.error,o):(this.idBlock.error.length||(this.blockLength+=this.idBlock.blockLength),this.lenBlock.error.length||(this.blockLength+=this.lenBlock.blockLength),this.valueBlock.error.length||(this.blockLength+=this.valueBlock.blockLength),o)}onAsciiEncoding(){let e=[];for(let i of this.valueBlock.value)e.push(i.toString("ascii").split(`
871
+ `).map(n=>` ${n}`).join(`
872
+ `));let r=this.idBlock.tagClass===3?`[${this.idBlock.tagNumber}]`:this.constructor.NAME;return e.length?`${r} :
873
+ ${e.join(`
874
+ `)}`:`${r} :`}};Fg=Me;X.Constructed=Fg;Me.NAME="CONSTRUCTED";var x1=class extends Qe{fromBER(e,r,i){return r}toBER(e){return Fr}};x1.override="EndOfContentValueBlock";var Ug,Oa=class extends Pe{constructor(e={}){super(e,x1),this.idBlock.tagClass=1,this.idBlock.tagNumber=0;}};Ug=Oa;X.EndOfContent=Ug;Oa.NAME=Da;var Lg,mr=class extends Pe{constructor(e={}){super(e,Qe),this.idBlock.tagClass=1,this.idBlock.tagNumber=5;}fromBER(e,r,i){return this.lenBlock.length>0&&this.warnings.push("Non-zero length of value block for Null type"),this.idBlock.error.length||(this.blockLength+=this.idBlock.blockLength),this.lenBlock.error.length||(this.blockLength+=this.lenBlock.blockLength),this.blockLength+=i,r+i>e.byteLength?(this.error="End of input reached before message was fully decoded (inconsistent offset and length values)",-1):r+i}toBER(e,r){let i=new ArrayBuffer(2);if(!e){let n=new Uint8Array(i);n[0]=5,n[1]=0;}return r&&r.write(i),i}onAsciiEncoding(){return `${this.constructor.NAME}`}};Lg=mr;X.Null=Lg;mr.NAME="NULL";var A1=class extends Ur(Qe){get value(){for(let e of this.valueHexView)if(e>0)return true;return false}set value(e){this.valueHexView[0]=e?255:0;}constructor({value:e,...r}={}){super(r),r.valueHex?this.valueHexView=de.BufferSourceConverter.toUint8Array(r.valueHex):this.valueHexView=new Uint8Array(1),e&&(this.value=e);}fromBER(e,r,i){let n=de.BufferSourceConverter.toUint8Array(e);return di(this,n,r,i)?(this.valueHexView=n.subarray(r,r+i),i>1&&this.warnings.push("Boolean value encoded in more then 1 octet"),this.isHexOnly=true,Eu.call(this),this.blockLength=i,r+i):-1}toBER(){return this.valueHexView.slice()}toJSON(){return {...super.toJSON(),value:this.value}}};A1.NAME="BooleanValueBlock";var Hg,Ln=class extends Pe{getValue(){return this.valueBlock.value}setValue(e){this.valueBlock.value=e;}constructor(e={}){super(e,A1),this.idBlock.tagClass=1,this.idBlock.tagNumber=1;}onAsciiEncoding(){return `${this.constructor.NAME} : ${this.getValue}`}};Hg=Ln;X.Boolean=Hg;Ln.NAME="BOOLEAN";var _1=class extends Ur(Or){constructor({isConstructed:e=false,...r}={}){super(r),this.isConstructed=e;}fromBER(e,r,i,n){let o=0;if(this.isConstructed){if(this.isHexOnly=false,o=Or.prototype.fromBER.call(this,e,r,i,n),o===-1)return o;for(let s=0;s<this.value.length;s++){let a=this.value[s].constructor.NAME;if(a===Da){if(this.isIndefiniteForm)break;return this.error="EndOfContent is unexpected, OCTET STRING may consists of OCTET STRINGs only",-1}if(a!==kg)return this.error="OCTET STRING may consists of OCTET STRINGs only",-1}}else this.isHexOnly=true,o=super.fromBER(e,r,i),this.blockLength=i;return o}toBER(e,r){return this.isConstructed?Or.prototype.toBER.call(this,e,r):e?new ArrayBuffer(this.valueHexView.byteLength):this.valueHexView.slice().buffer}toJSON(){return {...super.toJSON(),isConstructed:this.isConstructed}}};_1.NAME="OctetStringValueBlock";var Nu,gr=class extends Pe{constructor({idBlock:e={},lenBlock:r={},...i}={}){var n,o;(n=i.isConstructed)!==null&&n!==void 0||(i.isConstructed=!!(!((o=i.value)===null||o===void 0)&&o.length)),super({idBlock:{isConstructed:i.isConstructed,...e},lenBlock:{...r,isIndefiniteForm:!!i.isIndefiniteForm},...i},_1),this.idBlock.tagClass=1,this.idBlock.tagNumber=4;}fromBER(e,r,i,n){if(this.valueBlock.isConstructed=this.idBlock.isConstructed,this.valueBlock.isIndefiniteForm=this.lenBlock.isIndefiniteForm,i===0)return this.idBlock.error.length===0&&(this.blockLength+=this.idBlock.blockLength),this.lenBlock.error.length===0&&(this.blockLength+=this.lenBlock.blockLength),r;if(!this.valueBlock.isConstructed){let s=(e instanceof ArrayBuffer?new Uint8Array(e):e).subarray(r,r+i);try{if(s.byteLength){let a=n??$a(),l=Pu(s,0,s.byteLength,a);l.offset!==-1&&l.offset===i&&(this.valueBlock.value=[l.result]);}}catch{}}return super.fromBER(e,r,i,n)}onAsciiEncoding(){if(this.valueBlock.isConstructed||this.valueBlock.value&&this.valueBlock.value.length)return Me.prototype.onAsciiEncoding.call(this);let e=this.constructor.NAME,r=de.Convert.ToHex(this.valueBlock.valueHexView);return `${e} : ${r}`}getValue(){if(!this.idBlock.isConstructed)return this.valueBlock.valueHexView.slice().buffer;let e=[];for(let r of this.valueBlock.value)r instanceof Nu&&e.push(r.valueBlock.valueHexView);return de.BufferSourceConverter.concat(e)}};Nu=gr;X.OctetString=Nu;gr.NAME=kg;var C1=class extends Ur(Or){constructor({unusedBits:e=0,isConstructed:r=false,...i}={}){super(i),this.unusedBits=e,this.isConstructed=r,this.blockLength=this.valueHexView.byteLength;}fromBER(e,r,i,n){if(!i)return r;let o=-1;if(this.isConstructed){if(o=Or.prototype.fromBER.call(this,e,r,i,n),o===-1)return o;for(let l of this.value){let c=l.constructor.NAME;if(c===Da){if(this.isIndefiniteForm)break;return this.error="EndOfContent is unexpected, BIT STRING may consists of BIT STRINGs only",-1}if(c!==Pg)return this.error="BIT STRING may consists of BIT STRINGs only",-1;let d=l.valueBlock;if(this.unusedBits>0&&d.unusedBits>0)return this.error='Using of "unused bits" inside constructive BIT STRING allowed for least one only',-1;this.unusedBits=d.unusedBits;}return o}let s=de.BufferSourceConverter.toUint8Array(e);if(!di(this,s,r,i))return -1;let a=s.subarray(r,r+i);if(this.unusedBits=a[0],this.unusedBits>7)return this.error="Unused bits for BitString must be in range 0-7",-1;if(!this.unusedBits){let l=a.subarray(1);try{if(l.byteLength){let c=n??$a(),d=Pu(l,0,l.byteLength,c);d.offset!==-1&&d.offset===i-1&&(this.value=[d.result]);}}catch{}}return this.valueHexView=a.subarray(1),this.blockLength=a.length,r+i}toBER(e,r){if(this.isConstructed)return Or.prototype.toBER.call(this,e,r);if(e)return new ArrayBuffer(this.valueHexView.byteLength+1);if(!this.valueHexView.byteLength){let n=new Uint8Array(1);return n[0]=0,n.buffer}let i=new Uint8Array(this.valueHexView.length+1);return i[0]=this.unusedBits,i.set(this.valueHexView,1),i.buffer}toJSON(){return {...super.toJSON(),unusedBits:this.unusedBits,isConstructed:this.isConstructed}}};C1.NAME="BitStringValueBlock";var Kg,yr=class extends Pe{constructor({idBlock:e={},lenBlock:r={},...i}={}){var n,o;(n=i.isConstructed)!==null&&n!==void 0||(i.isConstructed=!!(!((o=i.value)===null||o===void 0)&&o.length)),super({idBlock:{isConstructed:i.isConstructed,...e},lenBlock:{...r,isIndefiniteForm:!!i.isIndefiniteForm},...i},C1),this.idBlock.tagClass=1,this.idBlock.tagNumber=3;}fromBER(e,r,i,n){return this.valueBlock.isConstructed=this.idBlock.isConstructed,this.valueBlock.isIndefiniteForm=this.lenBlock.isIndefiniteForm,super.fromBER(e,r,i,n)}onAsciiEncoding(){if(this.valueBlock.isConstructed||this.valueBlock.value&&this.valueBlock.value.length)return Me.prototype.onAsciiEncoding.call(this);{let e=[],r=this.valueBlock.valueHexView;for(let s of r)e.push(s.toString(2).padStart(8,"0"));let i=e.join(""),n=this.constructor.NAME,o=i.substring(0,i.length-this.valueBlock.unusedBits);return `${n} : ${o}`}}};Kg=yr;X.BitString=Kg;yr.NAME=Pg;var qg;function wx(t,e){let r=new Uint8Array([0]),i=new Uint8Array(t),n=new Uint8Array(e),o=i.slice(0),s=o.length-1,a=n.slice(0),l=a.length-1,c=0,d=l<s?s:l,u=0;for(let h=d;h>=0;h--,u++) true===u<a.length?c=o[s-u]+a[l-u]+r[0]:c=o[s-u]+r[0],r[0]=c/10,true===u>=o.length?o=m1(new Uint8Array([c%10]),o):o[s-u]=c%10;return r[0]>0&&(o=m1(r,o)),o}function Tg(t){if(t>=Pa.length)for(let e=Pa.length;e<=t;e++){let r=new Uint8Array([0]),i=Pa[e-1].slice(0);for(let n=i.length-1;n>=0;n--){let o=new Uint8Array([(i[n]<<1)+r[0]]);r[0]=o[0]/10,i[n]=o[0]%10;}r[0]>0&&(i=m1(r,i)),Pa.push(i);}return Pa[t]}function Ix(t,e){let r=0,i=new Uint8Array(t),n=new Uint8Array(e),o=i.slice(0),s=o.length-1,a=n.slice(0),l=a.length-1,c,d=0;for(let u=l;u>=0;u--,d++)c=o[s-d]-a[l-d]-r,true===c<0?(r=1,o[s-d]=c+10):(r=0,o[s-d]=c);if(r>0)for(let u=s-l+1;u>=0;u--,d++)if(c=o[s-d]-r,c<0)r=1,o[s-d]=c+10;else {r=0,o[s-d]=c;break}return o.slice()}var Ma=class extends Ur(Qe){setValueHex(){this.valueHexView.length>=4?(this.warnings.push("Too big Integer for decoding, hex only"),this.isHexOnly=true,this._valueDec=0):(this.isHexOnly=false,this.valueHexView.length>0&&(this._valueDec=Eu.call(this)));}constructor({value:e,...r}={}){super(r),this._valueDec=0,r.valueHex&&this.setValueHex(),e!==void 0&&(this.valueDec=e);}set valueDec(e){this._valueDec=e,this.isHexOnly=false,this.valueHexView=new Uint8Array(Ig(e));}get valueDec(){return this._valueDec}fromDER(e,r,i,n=0){let o=this.fromBER(e,r,i);if(o===-1)return o;let s=this.valueHexView;return s[0]===0&&(s[1]&128)!==0?this.valueHexView=s.subarray(1):n!==0&&s.length<n&&(n-s.length>1&&(n=s.length+1),this.valueHexView=s.subarray(n-s.length)),o}toDER(e=false){let r=this.valueHexView;switch(true){case (r[0]&128)!==0:{let i=new Uint8Array(this.valueHexView.length+1);i[0]=0,i.set(r,1),this.valueHexView=i;}break;case(r[0]===0&&(r[1]&128)===0):this.valueHexView=this.valueHexView.subarray(1);break}return this.toBER(e)}fromBER(e,r,i){let n=super.fromBER(e,r,i);return n===-1||this.setValueHex(),n}toBER(e){return e?new ArrayBuffer(this.valueHexView.length):this.valueHexView.slice().buffer}toJSON(){return {...super.toJSON(),valueDec:this.valueDec}}toString(){let e=this.valueHexView.length*8-1,r=new Uint8Array(this.valueHexView.length*8/3),i=0,n,o=this.valueHexView,s="",a=false;for(let l=o.byteLength-1;l>=0;l--){n=o[l];for(let c=0;c<8;c++)(n&1)===1&&(i===e?(r=Ix(Tg(i),r),s="-"):r=wx(r,Tg(i))),i++,n>>=1;}for(let l=0;l<r.length;l++)r[l]&&(a=true),a&&(s+=Eg.charAt(r[l]));return a===false&&(s+=Eg.charAt(0)),s}};qg=Ma;Ma.NAME="IntegerValueBlock";Object.defineProperty(qg.prototype,"valueHex",{set:function(t){this.valueHexView=new Uint8Array(t),this.setValueHex();},get:function(){return this.valueHexView.slice().buffer}});var Na,li=class extends Pe{constructor(e={}){super(e,Ma),this.idBlock.tagClass=1,this.idBlock.tagNumber=2;}toBigInt(){return g1(),BigInt(this.valueBlock.toString())}static fromBigInt(e){g1();let r=BigInt(e),i=new ts,n=r.toString(16).replace(/^-/,""),o=new Uint8Array(de.Convert.FromHex(n));if(r<0){let a=new Uint8Array(o.length+(o[0]&128?1:0));a[0]|=128;let c=BigInt(`0x${de.Convert.ToHex(a)}`)+r,d=de.BufferSourceConverter.toUint8Array(de.Convert.FromHex(c.toString(16)));d[0]|=128,i.write(d);}else o[0]&128&&i.write(new Uint8Array([0])),i.write(o);return new Na({valueHex:i.final()})}convertToDER(){let e=new Na({valueHex:this.valueBlock.valueHexView});return e.valueBlock.toDER(),e}convertFromDER(){return new Na({valueHex:this.valueBlock.valueHexView[0]===0?this.valueBlock.valueHexView.subarray(1):this.valueBlock.valueHexView})}onAsciiEncoding(){return `${this.constructor.NAME} : ${this.valueBlock.toString()}`}};Na=li;X.Integer=Na;li.NAME="INTEGER";var Gg,Hn=class extends li{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=10;}};Gg=Hn;X.Enumerated=Gg;Hn.NAME="ENUMERATED";var Fa=class extends Ur(Qe){constructor({valueDec:e=-1,isFirstSid:r=false,...i}={}){super(i),this.valueDec=e,this.isFirstSid=r;}fromBER(e,r,i){if(!i)return r;let n=de.BufferSourceConverter.toUint8Array(e);if(!di(this,n,r,i))return -1;let o=n.subarray(r,r+i);this.valueHexView=new Uint8Array(i);for(let a=0;a<i&&(this.valueHexView[a]=o[a]&127,this.blockLength++,(o[a]&128)!==0);a++);let s=new Uint8Array(this.blockLength);for(let a=0;a<this.blockLength;a++)s[a]=this.valueHexView[a];return this.valueHexView=s,(o[this.blockLength-1]&128)!==0?(this.error="End of input reached before message was fully decoded",-1):(this.valueHexView[0]===0&&this.warnings.push("Needlessly long format of SID encoding"),this.blockLength<=8?this.valueDec=Un(this.valueHexView,7):(this.isHexOnly=true,this.warnings.push("Too big SID for decoding, hex only")),r+this.blockLength)}set valueBigInt(e){g1();let r=BigInt(e).toString(2);for(;r.length%7;)r="0"+r;let i=new Uint8Array(r.length/7);for(let n=0;n<i.length;n++)i[n]=parseInt(r.slice(n*7,n*7+7),2)+(n+1<i.length?128:0);this.fromBER(i.buffer,0,i.length);}toBER(e){if(this.isHexOnly){if(e)return new ArrayBuffer(this.valueHexView.byteLength);let n=this.valueHexView,o=new Uint8Array(this.blockLength);for(let s=0;s<this.blockLength-1;s++)o[s]=n[s]|128;return o[this.blockLength-1]=n[this.blockLength-1],o.buffer}let r=$i(this.valueDec,7);if(r.byteLength===0)return this.error="Error during encoding SID value",Fr;let i=new Uint8Array(r.byteLength);if(!e){let n=new Uint8Array(r),o=r.byteLength-1;for(let s=0;s<o;s++)i[s]=n[s]|128;i[o]=n[o];}return i}toString(){let e="";if(this.isHexOnly)e=de.Convert.ToHex(this.valueHexView);else if(this.isFirstSid){let r=this.valueDec;this.valueDec<=39?e="0.":this.valueDec<=79?(e="1.",r-=40):(e="2.",r-=80),e+=r.toString();}else e=this.valueDec.toString();return e}toJSON(){return {...super.toJSON(),valueDec:this.valueDec,isFirstSid:this.isFirstSid}}};Fa.NAME="sidBlock";var w1=class extends Qe{constructor({value:e=xt,...r}={}){super(r),this.value=[],e&&this.fromString(e);}fromBER(e,r,i){let n=r;for(;i>0;){let o=new Fa;if(n=o.fromBER(e,n,i),n===-1)return this.blockLength=0,this.error=o.error,n;this.value.length===0&&(o.isFirstSid=true),this.blockLength+=o.blockLength,i-=o.blockLength,this.value.push(o);}return n}toBER(e){let r=[];for(let i=0;i<this.value.length;i++){let n=this.value[i].toBER(e);if(n.byteLength===0)return this.error=this.value[i].error,Fr;r.push(n);}return ku(r)}fromString(e){this.value=[];let r=0,i=0,n="",o=false;do if(i=e.indexOf(".",r),i===-1?n=e.substring(r):n=e.substring(r,i),r=i+1,o){let s=this.value[0],a=0;switch(s.valueDec){case 0:break;case 1:a=40;break;case 2:a=80;break;default:this.value=[];return}let l=parseInt(n,10);if(isNaN(l))return;s.valueDec=l+a,o=false;}else {let s=new Fa;if(n>Number.MAX_SAFE_INTEGER){g1();let a=BigInt(n);s.valueBigInt=a;}else if(s.valueDec=parseInt(n,10),isNaN(s.valueDec))return;this.value.length||(s.isFirstSid=true,o=true),this.value.push(s);}while(i!==-1)}toString(){let e="",r=false;for(let i=0;i<this.value.length;i++){r=this.value[i].isHexOnly;let n=this.value[i].toString();i!==0&&(e=`${e}.`),r?(n=`{${n}}`,this.value[i].isFirstSid?e=`2.{${n} - 80}`:e+=n):e+=n;}return e}toJSON(){let e={...super.toJSON(),value:this.toString(),sidArray:[]};for(let r=0;r<this.value.length;r++)e.sidArray.push(this.value[r].toJSON());return e}};w1.NAME="ObjectIdentifierValueBlock";var zg,Kn=class extends Pe{getValue(){return this.valueBlock.toString()}setValue(e){this.valueBlock.fromString(e);}constructor(e={}){super(e,w1),this.idBlock.tagClass=1,this.idBlock.tagNumber=6;}onAsciiEncoding(){return `${this.constructor.NAME} : ${this.valueBlock.toString()||"empty"}`}toJSON(){return {...super.toJSON(),value:this.getValue()}}};zg=Kn;X.ObjectIdentifier=zg;Kn.NAME="OBJECT IDENTIFIER";var Ua=class extends Ur(ai){constructor({valueDec:e=0,...r}={}){super(r),this.valueDec=e;}fromBER(e,r,i){if(i===0)return r;let n=de.BufferSourceConverter.toUint8Array(e);if(!di(this,n,r,i))return -1;let o=n.subarray(r,r+i);this.valueHexView=new Uint8Array(i);for(let a=0;a<i&&(this.valueHexView[a]=o[a]&127,this.blockLength++,(o[a]&128)!==0);a++);let s=new Uint8Array(this.blockLength);for(let a=0;a<this.blockLength;a++)s[a]=this.valueHexView[a];return this.valueHexView=s,(o[this.blockLength-1]&128)!==0?(this.error="End of input reached before message was fully decoded",-1):(this.valueHexView[0]===0&&this.warnings.push("Needlessly long format of SID encoding"),this.blockLength<=8?this.valueDec=Un(this.valueHexView,7):(this.isHexOnly=true,this.warnings.push("Too big SID for decoding, hex only")),r+this.blockLength)}toBER(e){if(this.isHexOnly){if(e)return new ArrayBuffer(this.valueHexView.byteLength);let n=this.valueHexView,o=new Uint8Array(this.blockLength);for(let s=0;s<this.blockLength-1;s++)o[s]=n[s]|128;return o[this.blockLength-1]=n[this.blockLength-1],o.buffer}let r=$i(this.valueDec,7);if(r.byteLength===0)return this.error="Error during encoding SID value",Fr;let i=new Uint8Array(r.byteLength);if(!e){let n=new Uint8Array(r),o=r.byteLength-1;for(let s=0;s<o;s++)i[s]=n[s]|128;i[o]=n[o];}return i.buffer}toString(){let e="";return this.isHexOnly?e=de.Convert.ToHex(this.valueHexView):e=this.valueDec.toString(),e}toJSON(){return {...super.toJSON(),valueDec:this.valueDec}}};Ua.NAME="relativeSidBlock";var I1=class extends Qe{constructor({value:e=xt,...r}={}){super(r),this.value=[],e&&this.fromString(e);}fromBER(e,r,i){let n=r;for(;i>0;){let o=new Ua;if(n=o.fromBER(e,n,i),n===-1)return this.blockLength=0,this.error=o.error,n;this.blockLength+=o.blockLength,i-=o.blockLength,this.value.push(o);}return n}toBER(e,r){let i=[];for(let n=0;n<this.value.length;n++){let o=this.value[n].toBER(e);if(o.byteLength===0)return this.error=this.value[n].error,Fr;i.push(o);}return ku(i)}fromString(e){this.value=[];let r=0,i=0,n="";do{i=e.indexOf(".",r),i===-1?n=e.substring(r):n=e.substring(r,i),r=i+1;let o=new Ua;if(o.valueDec=parseInt(n,10),isNaN(o.valueDec))return true;this.value.push(o);}while(i!==-1);return true}toString(){let e="",r=false;for(let i=0;i<this.value.length;i++){r=this.value[i].isHexOnly;let n=this.value[i].toString();i!==0&&(e=`${e}.`),r&&(n=`{${n}}`),e+=n;}return e}toJSON(){let e={...super.toJSON(),value:this.toString(),sidArray:[]};for(let r=0;r<this.value.length;r++)e.sidArray.push(this.value[r].toJSON());return e}};I1.NAME="RelativeObjectIdentifierValueBlock";var $g,La=class extends Pe{getValue(){return this.valueBlock.toString()}setValue(e){this.valueBlock.fromString(e);}constructor(e={}){super(e,I1),this.idBlock.tagClass=1,this.idBlock.tagNumber=13;}onAsciiEncoding(){return `${this.constructor.NAME} : ${this.valueBlock.toString()||"empty"}`}toJSON(){return {...super.toJSON(),value:this.getValue()}}};$g=La;X.RelativeObjectIdentifier=$g;La.NAME="RelativeObjectIdentifier";var Vg,lt=class extends Me{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=16;}};Vg=lt;X.Sequence=Vg;lt.NAME="SEQUENCE";var jg,pt=class extends Me{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=17;}};jg=pt;X.Set=jg;pt.NAME="SET";var v1=class extends Ur(Qe){constructor({...e}={}){super(e),this.isHexOnly=true,this.value=xt;}toJSON(){return {...super.toJSON(),value:this.value}}};v1.NAME="StringValueBlock";var E1=class extends v1{};E1.NAME="SimpleStringValueBlock";var ht=class extends Ra{constructor({...e}={}){super(e,E1);}fromBuffer(e){this.valueBlock.value=String.fromCharCode.apply(null,de.BufferSourceConverter.toUint8Array(e));}fromString(e){let r=e.length,i=this.valueBlock.valueHexView=new Uint8Array(r);for(let n=0;n<r;n++)i[n]=e.charCodeAt(n);this.valueBlock.value=e;}};ht.NAME="SIMPLE STRING";var B1=class extends ht{fromBuffer(e){this.valueBlock.valueHexView=de.BufferSourceConverter.toUint8Array(e);try{this.valueBlock.value=de.Convert.ToUtf8String(e);}catch(r){this.warnings.push(`Error during "decodeURIComponent": ${r}, using raw string`),this.valueBlock.value=de.Convert.ToBinary(e);}}fromString(e){this.valueBlock.valueHexView=new Uint8Array(de.Convert.FromUtf8String(e)),this.valueBlock.value=e;}};B1.NAME="Utf8StringValueBlock";var Xg,Kt=class extends B1{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=12;}};Xg=Kt;X.Utf8String=Xg;Kt.NAME="UTF8String";var T1=class extends ht{fromBuffer(e){this.valueBlock.value=de.Convert.ToUtf16String(e),this.valueBlock.valueHexView=de.BufferSourceConverter.toUint8Array(e);}fromString(e){this.valueBlock.value=e,this.valueBlock.valueHexView=new Uint8Array(de.Convert.FromUtf16String(e));}};T1.NAME="BmpStringValueBlock";var Wg,qn=class extends T1{constructor({...e}={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=30;}};Wg=qn;X.BmpString=Wg;qn.NAME="BMPString";var k1=class extends ht{fromBuffer(e){let r=ArrayBuffer.isView(e)?e.slice().buffer:e.slice(0),i=new Uint8Array(r);for(let n=0;n<i.length;n+=4)i[n]=i[n+3],i[n+1]=i[n+2],i[n+2]=0,i[n+3]=0;this.valueBlock.value=String.fromCharCode.apply(null,new Uint32Array(r));}fromString(e){let r=e.length,i=this.valueBlock.valueHexView=new Uint8Array(r*4);for(let n=0;n<r;n++){let o=$i(e.charCodeAt(n),8),s=new Uint8Array(o);if(s.length>4)continue;let a=4-s.length;for(let l=s.length-1;l>=0;l--)i[n*4+l+a]=s[l];}this.valueBlock.value=e;}};k1.NAME="UniversalStringValueBlock";var Zg,Gn=class extends k1{constructor({...e}={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=28;}};Zg=Gn;X.UniversalString=Zg;Gn.NAME="UniversalString";var Yg,zn=class extends ht{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=18;}};Yg=zn;X.NumericString=Yg;zn.NAME="NumericString";var Qg,$n=class extends ht{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=19;}};Qg=$n;X.PrintableString=Qg;$n.NAME="PrintableString";var Jg,Vn=class extends ht{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=20;}};Jg=Vn;X.TeletexString=Jg;Vn.NAME="TeletexString";var ey,jn=class extends ht{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=21;}};ey=jn;X.VideotexString=ey;jn.NAME="VideotexString";var ty,Xn=class extends ht{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=22;}};ty=Xn;X.IA5String=ty;Xn.NAME="IA5String";var ry,Wn=class extends ht{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=25;}};ry=Wn;X.GraphicString=ry;Wn.NAME="GraphicString";var iy,Vi=class extends ht{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=26;}};iy=Vi;X.VisibleString=iy;Vi.NAME="VisibleString";var ny,Zn=class extends ht{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=27;}};ny=Zn;X.GeneralString=ny;Zn.NAME="GeneralString";var oy,Yn=class extends ht{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=29;}};oy=Yn;X.CharacterString=oy;Yn.NAME="CharacterString";var sy,ji=class extends Vi{constructor({value:e,valueDate:r,...i}={}){if(super(i),this.year=0,this.month=0,this.day=0,this.hour=0,this.minute=0,this.second=0,e){this.fromString(e),this.valueBlock.valueHexView=new Uint8Array(e.length);for(let n=0;n<e.length;n++)this.valueBlock.valueHexView[n]=e.charCodeAt(n);}r&&(this.fromDate(r),this.valueBlock.valueHexView=new Uint8Array(this.toBuffer())),this.idBlock.tagClass=1,this.idBlock.tagNumber=23;}fromBuffer(e){this.fromString(String.fromCharCode.apply(null,de.BufferSourceConverter.toUint8Array(e)));}toBuffer(){let e=this.toString(),r=new ArrayBuffer(e.length),i=new Uint8Array(r);for(let n=0;n<e.length;n++)i[n]=e.charCodeAt(n);return r}fromDate(e){this.year=e.getUTCFullYear(),this.month=e.getUTCMonth()+1,this.day=e.getUTCDate(),this.hour=e.getUTCHours(),this.minute=e.getUTCMinutes(),this.second=e.getUTCSeconds();}toDate(){return new Date(Date.UTC(this.year,this.month-1,this.day,this.hour,this.minute,this.second))}fromString(e){let i=/(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})Z/ig.exec(e);if(i===null){this.error="Wrong input string for conversion";return}let n=parseInt(i[1],10);n>=50?this.year=1900+n:this.year=2e3+n,this.month=parseInt(i[2],10),this.day=parseInt(i[3],10),this.hour=parseInt(i[4],10),this.minute=parseInt(i[5],10),this.second=parseInt(i[6],10);}toString(e="iso"){if(e==="iso"){let r=new Array(7);return r[0]=St(this.year<2e3?this.year-1900:this.year-2e3,2),r[1]=St(this.month,2),r[2]=St(this.day,2),r[3]=St(this.hour,2),r[4]=St(this.minute,2),r[5]=St(this.second,2),r[6]="Z",r.join("")}return super.toString(e)}onAsciiEncoding(){return `${this.constructor.NAME} : ${this.toDate().toISOString()}`}toJSON(){return {...super.toJSON(),year:this.year,month:this.month,day:this.day,hour:this.hour,minute:this.minute,second:this.second}}};sy=ji;X.UTCTime=sy;ji.NAME="UTCTime";var ay,Qn=class extends ji{constructor(e={}){var r;super(e),(r=this.millisecond)!==null&&r!==void 0||(this.millisecond=0),this.idBlock.tagClass=1,this.idBlock.tagNumber=24;}fromDate(e){super.fromDate(e),this.millisecond=e.getUTCMilliseconds();}toDate(){let e=Date.UTC(this.year,this.month-1,this.day,this.hour,this.minute,this.second,this.millisecond);return new Date(e)}fromString(e){let r=false,i="",n="",o=0,s,a=0,l=0;if(e[e.length-1]==="Z")i=e.substring(0,e.length-1),r=true;else {let u=new Number(e[e.length-1]);if(isNaN(u.valueOf()))throw new Error("Wrong input string for conversion");i=e;}if(r){if(i.indexOf("+")!==-1)throw new Error("Wrong input string for conversion");if(i.indexOf("-")!==-1)throw new Error("Wrong input string for conversion")}else {let u=1,h=i.indexOf("+"),y="";if(h===-1&&(h=i.indexOf("-"),u=-1),h!==-1){if(y=i.substring(h+1),i=i.substring(0,h),y.length!==2&&y.length!==4)throw new Error("Wrong input string for conversion");let b=parseInt(y.substring(0,2),10);if(isNaN(b.valueOf()))throw new Error("Wrong input string for conversion");if(a=u*b,y.length===4){if(b=parseInt(y.substring(2,4),10),isNaN(b.valueOf()))throw new Error("Wrong input string for conversion");l=u*b;}}}let c=i.indexOf(".");if(c===-1&&(c=i.indexOf(",")),c!==-1){let u=new Number(`0${i.substring(c)}`);if(isNaN(u.valueOf()))throw new Error("Wrong input string for conversion");o=u.valueOf(),n=i.substring(0,c);}else n=i;switch(true){case n.length===8:if(s=/(\d{4})(\d{2})(\d{2})/ig,c!==-1)throw new Error("Wrong input string for conversion");break;case n.length===10:if(s=/(\d{4})(\d{2})(\d{2})(\d{2})/ig,c!==-1){let u=60*o;this.minute=Math.floor(u),u=60*(u-this.minute),this.second=Math.floor(u),u=1e3*(u-this.second),this.millisecond=Math.floor(u);}break;case n.length===12:if(s=/(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})/ig,c!==-1){let u=60*o;this.second=Math.floor(u),u=1e3*(u-this.second),this.millisecond=Math.floor(u);}break;case n.length===14:if(s=/(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})/ig,c!==-1){let u=1e3*o;this.millisecond=Math.floor(u);}break;default:throw new Error("Wrong input string for conversion")}let d=s.exec(n);if(d===null)throw new Error("Wrong input string for conversion");for(let u=1;u<d.length;u++)switch(u){case 1:this.year=parseInt(d[u],10);break;case 2:this.month=parseInt(d[u],10);break;case 3:this.day=parseInt(d[u],10);break;case 4:this.hour=parseInt(d[u],10)+a;break;case 5:this.minute=parseInt(d[u],10)+l;break;case 6:this.second=parseInt(d[u],10);break;default:throw new Error("Wrong input string for conversion")}if(r===false){let u=new Date(this.year,this.month,this.day,this.hour,this.minute,this.second,this.millisecond);this.year=u.getUTCFullYear(),this.month=u.getUTCMonth(),this.day=u.getUTCDay(),this.hour=u.getUTCHours(),this.minute=u.getUTCMinutes(),this.second=u.getUTCSeconds(),this.millisecond=u.getUTCMilliseconds();}}toString(e="iso"){if(e==="iso"){let r=[];return r.push(St(this.year,4)),r.push(St(this.month,2)),r.push(St(this.day,2)),r.push(St(this.hour,2)),r.push(St(this.minute,2)),r.push(St(this.second,2)),this.millisecond!==0&&(r.push("."),r.push(St(this.millisecond,3))),r.push("Z"),r.join("")}return super.toString(e)}toJSON(){return {...super.toJSON(),millisecond:this.millisecond}}};ay=Qn;X.GeneralizedTime=ay;Qn.NAME="GeneralizedTime";var cy,Ha=class extends Kt{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=31;}};cy=Ha;X.DATE=cy;Ha.NAME="DATE";var ly,Ka=class extends Kt{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=32;}};ly=Ka;X.TimeOfDay=ly;Ka.NAME="TimeOfDay";var dy,qa=class extends Kt{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=33;}};dy=qa;X.DateTime=dy;qa.NAME="DateTime";var uy,Ga=class extends Kt{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=34;}};uy=Ga;X.Duration=uy;Ga.NAME="Duration";var fy,za=class extends Kt{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=14;}};fy=za;X.TIME=fy;za.NAME="TIME";var Mr=class{constructor({name:e=xt,optional:r=false}={}){this.name=e,this.optional=r;}},rs=class extends Mr{constructor({value:e=[],...r}={}){super(r),this.value=e;}},Jn=class extends Mr{constructor({value:e=new Mr,local:r=false,...i}={}){super(i),this.value=e,this.local=r;}},Tu=class{get data(){return this.dataView.slice().buffer}set data(e){this.dataView=de.BufferSourceConverter.toUint8Array(e);}constructor({data:e=P1}={}){this.dataView=de.BufferSourceConverter.toUint8Array(e);}fromBER(e,r,i){let n=r+i;return this.dataView=de.BufferSourceConverter.toUint8Array(e).subarray(r,n),n}toBER(e){return this.dataView.slice().buffer}};function si(t,e,r){if(r instanceof rs){for(let o of r.value)if(si(t,e,o).verified)return {verified:true,result:t};{let o={verified:false,result:{error:"Wrong values for Choice type"}};return r.hasOwnProperty(Bu)&&(o.name=r.name),o}}if(r instanceof Mr)return r.hasOwnProperty(Bu)&&(t[r.name]=e),{verified:true,result:t};if(!(t instanceof Object))return {verified:false,result:{error:"Wrong root object"}};if(!(e instanceof Object))return {verified:false,result:{error:"Wrong ASN.1 data"}};if(!(r instanceof Object))return {verified:false,result:{error:"Wrong ASN.1 schema"}};if(!(lx in r))return {verified:false,result:{error:"Wrong ASN.1 schema"}};if(!(px in r.idBlock))return {verified:false,result:{error:"Wrong ASN.1 schema"}};if(!(hx in r.idBlock))return {verified:false,result:{error:"Wrong ASN.1 schema"}};let i=r.idBlock.toBER(false);if(i.byteLength===0)return {verified:false,result:{error:"Error encoding idBlock for ASN.1 schema"}};if(r.idBlock.fromBER(i,0,i.byteLength)===-1)return {verified:false,result:{error:"Error decoding idBlock for ASN.1 schema"}};if(r.idBlock.hasOwnProperty(dx)===false)return {verified:false,result:{error:"Wrong ASN.1 schema"}};if(r.idBlock.tagClass!==e.idBlock.tagClass)return {verified:false,result:t};if(r.idBlock.hasOwnProperty(ux)===false)return {verified:false,result:{error:"Wrong ASN.1 schema"}};if(r.idBlock.tagNumber!==e.idBlock.tagNumber)return {verified:false,result:t};if(r.idBlock.hasOwnProperty(fx)===false)return {verified:false,result:{error:"Wrong ASN.1 schema"}};if(r.idBlock.isConstructed!==e.idBlock.isConstructed)return {verified:false,result:t};if(!(cx in r.idBlock))return {verified:false,result:{error:"Wrong ASN.1 schema"}};if(r.idBlock.isHexOnly!==e.idBlock.isHexOnly)return {verified:false,result:t};if(r.idBlock.isHexOnly){if(!(Bg in r.idBlock))return {verified:false,result:{error:"Wrong ASN.1 schema"}};let o=r.idBlock.valueHexView,s=e.idBlock.valueHexView;if(o.length!==s.length)return {verified:false,result:t};for(let a=0;a<o.length;a++)if(o[a]!==s[1])return {verified:false,result:t}}if(r.name&&(r.name=r.name.replace(/^\s+|\s+$/g,xt),r.name&&(t[r.name]=e)),r instanceof X.Constructed){let o=0,s={verified:false,result:{error:"Unknown error"}},a=r.valueBlock.value.length;if(a>0&&r.valueBlock.value[0]instanceof Jn&&(a=e.valueBlock.value.length),a===0)return {verified:true,result:t};if(e.valueBlock.value.length===0&&r.valueBlock.value.length!==0){let l=true;for(let c=0;c<r.valueBlock.value.length;c++)l=l&&(r.valueBlock.value[c].optional||false);return l?{verified:true,result:t}:(r.name&&(r.name=r.name.replace(/^\s+|\s+$/g,xt),r.name&&delete t[r.name]),t.error="Inconsistent object length",{verified:false,result:t})}for(let l=0;l<a;l++)if(l-o>=e.valueBlock.value.length){if(r.valueBlock.value[l].optional===false){let c={verified:false,result:t};return t.error="Inconsistent length between ASN.1 data and schema",r.name&&(r.name=r.name.replace(/^\s+|\s+$/g,xt),r.name&&(delete t[r.name],c.name=r.name)),c}}else if(r.valueBlock.value[0]instanceof Jn){if(s=si(t,e.valueBlock.value[l],r.valueBlock.value[0].value),s.verified===false)if(r.valueBlock.value[0].optional)o++;else return r.name&&(r.name=r.name.replace(/^\s+|\s+$/g,xt),r.name&&delete t[r.name]),s;if(Bu in r.valueBlock.value[0]&&r.valueBlock.value[0].name.length>0){let c={};mx in r.valueBlock.value[0]&&r.valueBlock.value[0].local?c=e:c=t,typeof c[r.valueBlock.value[0].name]>"u"&&(c[r.valueBlock.value[0].name]=[]),c[r.valueBlock.value[0].name].push(e.valueBlock.value[l]);}}else if(s=si(t,e.valueBlock.value[l-o],r.valueBlock.value[l]),s.verified===false)if(r.valueBlock.value[l].optional)o++;else return r.name&&(r.name=r.name.replace(/^\s+|\s+$/g,xt),r.name&&delete t[r.name]),s;if(s.verified===false){let l={verified:false,result:t};return r.name&&(r.name=r.name.replace(/^\s+|\s+$/g,xt),r.name&&(delete t[r.name],l.name=r.name)),l}return {verified:true,result:t}}if(r.primitiveSchema&&Bg in e.valueBlock){let o=N1(e.valueBlock.valueHexView);if(o.offset===-1){let s={verified:false,result:o.result};return r.name&&(r.name=r.name.replace(/^\s+|\s+$/g,xt),r.name&&(delete t[r.name],s.name=r.name)),s}return si(t,o.result,r.primitiveSchema)}return {verified:true,result:t}}function vx(t,e){if(!(e instanceof Object))return {verified:false,result:{error:"Wrong ASN.1 schema type"}};let r=N1(de.BufferSourceConverter.toUint8Array(t));return r.offset===-1?{verified:false,result:r.result}:si(r.result,r.result,e)}var Ex="[object ArrayBuffer]",Bx="[object SharedArrayBuffer]";function py(t){return Object.prototype.toString.call(t)}function Tx(t){if(ArrayBuffer.isView(t))return true;if(!t||typeof t!="object")return false;let e=t;return typeof e.byteOffset=="number"&&typeof e.byteLength=="number"&&D1(e.buffer)}function Du(t){return py(t)===Ex}function hy(t){return typeof SharedArrayBuffer<"u"&&py(t)===Bx}function D1(t){return Du(t)||hy(t)}function my(t){return Tx(t)}function fi(t){return D1(t)||my(t)}function Ru(t){if(!fi(t))throw new TypeError("Expected ArrayBuffer, SharedArrayBuffer, or ArrayBufferView")}function qt(t){return Ru(t),D1(t)?new Uint8Array(t):new Uint8Array(t.buffer,t.byteOffset,t.byteLength)}function Ke(t){if(Ru(t),Du(t))return t;let e=new ArrayBuffer(t.byteLength);return new Uint8Array(e).set(qt(t)),e}function Ou(t,e,r={}){let i=qt(t),n=qt(e);if(!r.constantTime&&i.byteLength!==n.byteLength)return false;let o=Math.max(i.byteLength,n.byteLength),s=i.byteLength^n.byteLength;for(let a=0;a<o;a++)s|=(i[a]??0)^(n[a]??0);return s===0}var k;(function(t){t[t.Sequence=0]="Sequence",t[t.Set=1]="Set",t[t.Choice=2]="Choice";})(k||(k={}));var S;(function(t){t[t.Any=1]="Any",t[t.Boolean=2]="Boolean",t[t.OctetString=3]="OctetString",t[t.BitString=4]="BitString",t[t.Integer=5]="Integer",t[t.Enumerated=6]="Enumerated",t[t.ObjectIdentifier=7]="ObjectIdentifier",t[t.Utf8String=8]="Utf8String",t[t.BmpString=9]="BmpString",t[t.UniversalString=10]="UniversalString",t[t.NumericString=11]="NumericString",t[t.PrintableString=12]="PrintableString",t[t.TeletexString=13]="TeletexString",t[t.VideotexString=14]="VideotexString",t[t.IA5String=15]="IA5String",t[t.GraphicString=16]="GraphicString",t[t.VisibleString=17]="VisibleString",t[t.GeneralString=18]="GeneralString",t[t.CharacterString=19]="CharacterString",t[t.UTCTime=20]="UTCTime",t[t.GeneralizedTime=21]="GeneralizedTime",t[t.DATE=22]="DATE",t[t.TimeOfDay=23]="TimeOfDay",t[t.DateTime=24]="DateTime",t[t.Duration=25]="Duration",t[t.TIME=26]="TIME",t[t.Null=27]="Null";})(S||(S={}));var pi=class{constructor(e,r=0){f(this,"unusedBits",0);f(this,"value",new ArrayBuffer(0));if(e)if(typeof e=="number")this.fromNumber(e);else if(fi(e))this.unusedBits=r,this.value=Ke(e);else throw TypeError("Unsupported type of 'params' argument for BitString")}fromASN(e){if(!(e instanceof yr))throw new TypeError("Argument 'asn' is not instance of ASN.1 BitString");return this.unusedBits=e.valueBlock.unusedBits,this.value=Ke(e.valueBlock.valueHex),this}toASN(){return new yr({unusedBits:this.unusedBits,valueHex:this.value})}toSchema(e){return new yr({name:e})}toNumber(){let e="",r=new Uint8Array(this.value);for(let i of r)e+=i.toString(2).padStart(8,"0");return e=e.split("").reverse().join(""),this.unusedBits&&(e=e.slice(this.unusedBits).padStart(this.unusedBits,"0")),parseInt(e,2)}fromNumber(e){let r=e.toString(2),i=r.length+7>>3;this.unusedBits=(i<<3)-r.length;let n=new Uint8Array(i);r=r.padStart(i<<3,"0").split("").reverse().join("");let o=0;for(;o<i;)n[o]=parseInt(r.slice(o<<3,(o<<3)+8),2),o++;this.value=n.buffer;}};var oe=class{constructor(e){f(this,"buffer");typeof e=="number"?this.buffer=new ArrayBuffer(e):fi(e)?this.buffer=Ke(e):Array.isArray(e)?this.buffer=new Uint8Array(e).buffer:this.buffer=new ArrayBuffer(0);}get byteLength(){return this.buffer.byteLength}get byteOffset(){return 0}fromASN(e){if(!(e instanceof gr))throw new TypeError("Argument 'asn' is not instance of ASN.1 OctetString");return this.buffer=Ke(e.valueBlock.valueHex),this}toASN(){return new gr({valueHex:this.buffer})}toSchema(e){return new gr({name:e})}};var Nx={fromASN:t=>t instanceof mr?null:Ke(t.valueBeforeDecodeView),toASN:t=>{if(t===null)return new mr;let e=ui(t);if(e.result.error)throw new Error(e.result.error);return e.result}},Dx={fromASN:t=>t.valueBlock.valueHexView.byteLength>=4?t.valueBlock.toString():t.valueBlock.valueDec,toASN:t=>new li({value:+t})},Rx={fromASN:t=>t.valueBlock.valueDec,toASN:t=>new Hn({value:t})},fe={fromASN:t=>Ke(t.valueBlock.valueHexView),toASN:t=>new li({valueHex:t})};var Ox={fromASN:t=>Ke(t.valueBlock.valueHexView),toASN:t=>new yr({valueHex:t})},Mx={fromASN:t=>t.valueBlock.toString(),toASN:t=>new Kn({value:t})},Fx={fromASN:t=>t.valueBlock.value,toASN:t=>new Ln({value:t})},is={fromASN:t=>Ke(t.valueBlock.valueHexView),toASN:t=>new gr({valueHex:t})},gy={fromASN:t=>new oe(t.getValue()),toASN:t=>t.toASN()};function Gt(t){return {fromASN:e=>e.valueBlock.value,toASN:e=>new t({value:e})}}var Ux=Gt(Kt),Lx=Gt(qn),Hx=Gt(Gn),Kx=Gt(zn),qx=Gt($n),Gx=Gt(Vn),zx=Gt(jn),$x=Gt(Xn),Vx=Gt(Wn),jx=Gt(Vi),Xx=Gt(Zn),Wx=Gt(Yn),Zx={fromASN:t=>t.toDate(),toASN:t=>new ji({valueDate:t})},Yx={fromASN:t=>t.toDate(),toASN:t=>new Qn({valueDate:t})},Qx={fromASN:()=>null,toASN:()=>new mr};function Xi(t){switch(t){case S.Any:return Nx;case S.BitString:return Ox;case S.BmpString:return Lx;case S.Boolean:return Fx;case S.CharacterString:return Wx;case S.Enumerated:return Rx;case S.GeneralString:return Xx;case S.GeneralizedTime:return Yx;case S.GraphicString:return Vx;case S.IA5String:return $x;case S.Integer:return Dx;case S.Null:return Qx;case S.NumericString:return Kx;case S.ObjectIdentifier:return Mx;case S.OctetString:return is;case S.PrintableString:return qx;case S.TeletexString:return Gx;case S.UTCTime:return Zx;case S.UniversalString:return Hx;case S.Utf8String:return Ux;case S.VideotexString:return zx;case S.VisibleString:return jx;default:return null}}function zt(t){return typeof t=="function"&&t.prototype?t.prototype.toASN&&t.prototype.fromASN?true:zt(t.prototype):!!(t&&typeof t=="object"&&"toASN"in t&&"fromASN"in t)}function Fu(t){if(t){let e=Object.getPrototypeOf(t);return e?.prototype?.constructor===Array?true:Fu(e)}return false}function yy(t,e){if(!(t&&e)||t.byteLength!==e.byteLength)return false;let r=new Uint8Array(t),i=new Uint8Array(e);for(let n=0;n<t.byteLength;n++)if(r[n]!==i[n])return false;return true}var R1=class{constructor(){f(this,"items",new WeakMap);}has(e){return this.items.has(e)}get(e,r=false){let i=this.items.get(e);if(!i)throw new Error(`Cannot get schema for '${e.prototype.constructor.name}' target`);if(r&&!i.schema)throw new Error(`Schema '${e.prototype.constructor.name}' doesn't contain ASN.1 schema. Call 'AsnSchemaStorage.cache'.`);return i}cache(e){let r=this.get(e);r.schema||(r.schema=this.create(e,true));}createDefault(e){let r={type:k.Sequence,items:{}},i=this.findParentSchema(e);return i&&(Object.assign(r,i),r.items=Object.assign({},r.items,i.items)),r}create(e,r){let i=this.items.get(e)||this.createDefault(e),n=[];for(let o in i.items){let s=i.items[o],a=r?o:"",l;if(typeof s.type=="number"){let d=S[s.type],u=Lr[d];if(!u)throw new Error(`Cannot get ASN1 class by name '${d}'`);l=new u({name:a});}else zt(s.type)?l=new s.type().toSchema(a):s.optional?this.get(s.type).type===k.Choice?l=new Mr({name:a}):(l=this.create(s.type,false),l.name=a):l=new Mr({name:a});let c=!!s.optional||s.defaultValue!==void 0;if(s.repeated){l.name="";let d=s.repeated==="set"?pt:lt;l=new d({name:"",value:[new Jn({name:a,value:l})]});}if(s.context!==null&&s.context!==void 0)if(s.implicit)if(typeof s.type=="number"||zt(s.type)){let d=s.repeated?Me:ci;n.push(new d({name:a,optional:c,idBlock:{tagClass:3,tagNumber:s.context}}));}else {this.cache(s.type);let d=!!s.repeated,u=d?l:this.get(s.type,true).schema;u="valueBlock"in u?u.valueBlock.value:u.value,n.push(new Me({name:d?"":a,optional:c,idBlock:{tagClass:3,tagNumber:s.context},value:u}));}else n.push(new Me({optional:c,idBlock:{tagClass:3,tagNumber:s.context},value:[l]}));else l.optional=c,n.push(l);}switch(i.type){case k.Sequence:return new lt({value:n,name:""});case k.Set:return new pt({value:n,name:""});case k.Choice:return new rs({value:n,name:""});default:throw new Error("Unsupported ASN1 type in use")}}set(e,r){return this.items.set(e,r),this}findParentSchema(e){let r=Object.getPrototypeOf(e);return r?this.items.get(r)||this.findParentSchema(r):null}};var Fe=new R1;var M=t=>e=>{let r;Fe.has(e)?r=Fe.get(e):(r=Fe.createDefault(e),Fe.set(e,r)),Object.assign(r,t);};var g=t=>(e,r)=>{let i;Fe.has(e.constructor)?i=Fe.get(e.constructor):(i=Fe.createDefault(e.constructor),Fe.set(e.constructor,i));let n=Object.assign({},t);if(typeof n.type=="number"&&!n.converter){let o=Xi(t.type);if(!o)throw new Error(`Cannot get default converter for property '${r}' of ${e.constructor.name}`);n.converter=o;}n.raw=t.raw,i.items[r]=n;};var Wi=class extends Error{constructor(){super(...arguments);f(this,"schemas",[]);}};var ns=class{static parse(e,r,i){let n=ui(Ke(e),i?.berOptions);if(n.result.error)throw new Error(n.result.error);return this.fromASN(n.result,r,i)}static fromASN(e,r,i){try{if(zt(r))return new r().fromASN(e);let n=Fe.get(r);Fe.cache(r);let o=n.schema,s=this.handleChoiceTypes(e,n,r,o,i);if(s?.result)return s.result;s?.targetSchema&&(o=s.targetSchema);let a=this.handleSequenceTypes(e,n,r,o),l=new r;return Fu(r)?this.handleArrayTypes(e,n,r,i):(this.processSchemaItems(n,a,l,i),l)}catch(n){throw n instanceof Wi&&n.schemas.push(r.name),n}}static handleChoiceTypes(e,r,i,n,o){if(e.constructor===Me&&r.type===k.Choice&&e.idBlock.tagClass===3)for(let s in r.items){let a=r.items[s];if(a.context===e.idBlock.tagNumber&&a.implicit&&typeof a.type=="function"&&Fe.has(a.type)){let l=Fe.get(a.type);if(l&&l.type===k.Sequence){let c=new lt;if("value"in e.valueBlock&&Array.isArray(e.valueBlock.value)&&"value"in c.valueBlock){c.valueBlock.value=e.valueBlock.value;let d=this.fromASN(c,a.type,o),u=new i;return u[s]=d,{result:u}}}}}else if(e.constructor===Me&&r.type!==k.Choice){let s=new Me({idBlock:{tagClass:3,tagNumber:e.idBlock.tagNumber},value:r.schema.valueBlock.value});for(let a in r.items)delete e[a];return {targetSchema:s}}return null}static handleSequenceTypes(e,r,i,n){if(r.type===k.Sequence){let o=si({},e,n);if(!o.verified)throw new Wi(`Data does not match to ${i.name} ASN1 schema.${o.result.error?` ${o.result.error}`:""}`);return o}else {let o=si({},e,n);if(!o.verified)throw new Wi(`Data does not match to ${i.name} ASN1 schema.${o.result.error?` ${o.result.error}`:""}`);return o}}static processRepeatedField(e,r,i){let n=e.slice(r);if(n.length===1&&n[0].constructor.name==="Sequence"){let o=n[0];o.valueBlock&&o.valueBlock.value&&Array.isArray(o.valueBlock.value)&&(n=o.valueBlock.value);}if(typeof i.type=="number"){let o=Xi(i.type);if(!o)throw new Error(`No converter for ASN.1 type ${i.type}`);return n.filter(s=>s&&s.valueBlock).map(s=>{try{return o.fromASN(s)}catch{return}}).filter(s=>s!==void 0)}else return n.filter(o=>o&&o.valueBlock).map(o=>{try{return this.fromASN(o,i.type)}catch{return}}).filter(o=>o!==void 0)}static processPrimitiveField(e,r){let i=Xi(r.type);if(!i)throw new Error(`No converter for ASN.1 type ${r.type}`);return i.fromASN(e)}static isOptionalChoiceField(e){return e.optional&&typeof e.type=="function"&&Fe.has(e.type)&&Fe.get(e.type).type===k.Choice}static processOptionalChoiceField(e,r){try{return {processed:!0,value:this.fromASN(e,r.type)}}catch(i){if(i instanceof Wi&&/Wrong values for Choice type/.test(i.message))return {processed:false};throw i}}static handleArrayTypes(e,r,i,n){if(!("value"in e.valueBlock&&Array.isArray(e.valueBlock.value)))throw new Error("Cannot get items from the ASN.1 parsed value. ASN.1 object is not constructed.");let o=r.itemType;if(typeof o=="number"){let s=Xi(o);if(!s)throw new Error(`Cannot get default converter for array item of ${i.name} ASN1 schema`);return i.from(e.valueBlock.value,a=>s.fromASN(a))}else return i.from(e.valueBlock.value,s=>this.fromASN(s,o,n))}static processSchemaItems(e,r,i,n){for(let o in e.items){let s=r.result[o];if(!s)continue;let a=e.items[o],l=a.type,c;typeof l=="number"||zt(l)?c=this.processPrimitiveSchemaItem(s,a,l,n):c=this.processComplexSchemaItem(s,a,l,n),c&&typeof c=="object"&&"value"in c&&"raw"in c?(i[o]=c.value,i[`${o}Raw`]=c.raw):i[o]=c;}}static processPrimitiveSchemaItem(e,r,i,n){let o=r.converter??(zt(i)?new i:null);if(!o)throw new Error("Converter is empty");return r.repeated?this.processRepeatedPrimitiveItem(e,r,o,n):this.processSinglePrimitiveItem(e,r,i,o,n)}static processRepeatedPrimitiveItem(e,r,i,n){if(r.implicit){let o=r.repeated==="sequence"?lt:pt,s=new o;s.valueBlock=e.valueBlock;let a=ui(s.toBER(false),n?.berOptions);if(a.offset===-1)throw new Error(`Cannot parse the child item. ${a.result.error}`);if(!("value"in a.result.valueBlock&&Array.isArray(a.result.valueBlock.value)))throw new Error("Cannot get items from the ASN.1 parsed value. ASN.1 object is not constructed.");let l=a.result.valueBlock.value;return Array.from(l,c=>i.fromASN(c))}else return Array.from(e,o=>i.fromASN(o))}static processSinglePrimitiveItem(e,r,i,n,o){let s=e;if(r.implicit){let a;if(zt(i))a=new i().toSchema("");else {let l=S[i],c=Lr[l];if(!c)throw new Error(`Cannot get '${l}' class from asn1js module`);a=new c;}a.valueBlock=s.valueBlock,s=ui(a.toBER(false),o?.berOptions).result;}return n.fromASN(s)}static processComplexSchemaItem(e,r,i,n){if(r.repeated){if(!Array.isArray(e))throw new Error("Cannot get list of items from the ASN.1 parsed value. ASN.1 value should be iterable.");return Array.from(e,o=>this.fromASN(o,i,n))}else {let o=this.handleImplicitTagging(e,r,i);if(this.isOptionalChoiceField(r))try{return this.fromASN(o,i,n)}catch(s){if(s instanceof Wi&&/Wrong values for Choice type/.test(s.message))return;throw s}else {let s=this.fromASN(o,i,n);return r.raw?{value:s,raw:e.valueBeforeDecodeView}:s}}}static handleImplicitTagging(e,r,i){if(r.implicit&&typeof r.context=="number"){let n=Fe.get(i);if(n.type===k.Sequence){let o=new lt;if("value"in e.valueBlock&&Array.isArray(e.valueBlock.value)&&"value"in o.valueBlock)return o.valueBlock.value=e.valueBlock.value,o}else if(n.type===k.Set){let o=new pt;if("value"in e.valueBlock&&Array.isArray(e.valueBlock.value)&&"value"in o.valueBlock)return o.valueBlock.value=e.valueBlock.value,o}}return e}};var os=class t{static serialize(e){return e instanceof Pe?e.toBER(false):this.toASN(e).toBER(false)}static toASN(e){if(e&&typeof e=="object"&&zt(e))return e.toASN();if(!(e&&typeof e=="object"))throw new TypeError("Parameter 1 should be type of Object.");let r=e.constructor,i=Fe.get(r);Fe.cache(r);let n=[];if(i.itemType){if(!Array.isArray(e))throw new TypeError("Parameter 1 should be type of Array.");if(typeof i.itemType=="number"){let s=Xi(i.itemType);if(!s)throw new Error(`Cannot get default converter for array item of ${r.name} ASN1 schema`);n=e.map(a=>s.toASN(a));}else n=e.map(s=>this.toAsnItem({type:i.itemType},"[]",r,s));}else for(let s in i.items){let a=i.items[s],l=e[s];if(l===void 0||a.defaultValue===l||typeof a.defaultValue=="object"&&typeof l=="object"&&yy(this.serialize(a.defaultValue),this.serialize(l)))continue;let c=t.toAsnItem(a,s,r,l);if(typeof a.context=="number")if(a.implicit)if(!a.repeated&&(typeof a.type=="number"||zt(a.type))){let d={};d.valueHex=c instanceof mr?Ke(c.valueBeforeDecodeView):c.valueBlock.toBER(),n.push(new ci({optional:a.optional,idBlock:{tagClass:3,tagNumber:a.context},...d}));}else n.push(new Me({optional:a.optional,idBlock:{tagClass:3,tagNumber:a.context},value:c.valueBlock.value}));else n.push(new Me({optional:a.optional,idBlock:{tagClass:3,tagNumber:a.context},value:[c]}));else a.repeated?n=n.concat(c):n.push(c);}let o;switch(i.type){case k.Sequence:o=new lt({value:n});break;case k.Set:o=new pt({value:n});break;case k.Choice:if(!n[0])throw new Error(`Schema '${r.name}' has wrong data. Choice cannot be empty.`);o=n[0];break}return o}static toAsnItem(e,r,i,n){let o;if(typeof e.type=="number"){let s=e.converter;if(!s)throw new Error(`Property '${r}' doesn't have converter for type ${S[e.type]} in schema '${i.name}'`);if(e.repeated){if(!Array.isArray(n))throw new TypeError("Parameter 'objProp' should be type of Array.");let a=Array.from(n,c=>s.toASN(c)),l=e.repeated==="sequence"?lt:pt;o=new l({value:a});}else o=s.toASN(n);}else if(e.repeated){if(!Array.isArray(n))throw new TypeError("Parameter 'objProp' should be type of Array.");let s=Array.from(n,l=>this.toASN(l)),a=e.repeated==="sequence"?lt:pt;o=new a({value:s});}else o=this.toASN(n);return o}};var te=class extends Array{constructor(e=[]){if(typeof e=="number")super(e);else {super();for(let r of e)this.push(r);}}};var $t=class t{static serialize(e){return os.serialize(e)}static parse(e,r,i){return ns.parse(e,r,i)}static toString(e,r){let i=fi(e)?Ke(e):t.serialize(e),n=ui(i,r?.berOptions);if(n.offset===-1)throw new Error(`Cannot decode ASN.1 data. ${n.result.error}`);return n.result.toString()}};function p(t,e,r,i){var n=arguments.length,o=n<3?e:i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,r,i);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(n<3?s(o):n>3?s(e,r,o):s(e,r))||o);return n>3&&o&&Object.defineProperty(e,r,o),o}var ss={};Vh(ss,{decode:()=>Lu,encode:()=>Uu,format:()=>_y,formats:()=>Cy,hex:()=>dA,is:()=>xy,normalize:()=>Va,parse:()=>Ay});var eA=/^[0-9a-f]$/i,tA=[" "," ",`
875
+ `,"\r",":","-","."];function rA(t){return t.separators==="none"?[]:!t.separators||t.separators==="common"?tA:t.separators}function iA(t){if(!t)throw new TypeError("Hex separators must be non-empty strings")}function nA(t,e,r){for(let i of r)if(t.startsWith(i,e))return i}function oA(t){let e=/[A-F]/.test(t),r=/[a-f]/.test(t);return e&&!r?"upper":"lower"}function sA(t){let e=/\r\n|\n/.exec(t);if(e)return e[0]===`\r
876
+ `?`\r
877
+ `:`
878
+ `}function by(t){return t.replace(/[^0-9a-f]/gi,"")}function aA(t){let e=t.match(/[0-9A-Fa-f]+|[^0-9A-Fa-f]+/g)??[];if(e.length<3)return;let r=e.filter((s,a)=>a%2===0),i=e.filter((s,a)=>a%2===1),n=i[0];if(!n||i.some(s=>s!==n)||r.some(s=>s.length===0||s.length%2!==0))return;let o=r[0]?.length??0;if(o&&!r.slice(0,-1).some(s=>s.length!==o)&&!((r[r.length-1]?.length??0)>o))return {size:o/2,separator:n}}function cA(t){let e=t.trim(),r=/^0x/i.test(e)?"0x":"",i=r?e.slice(2):e,n=sA(i),o=i.split(/\r\n|\n/).filter(c=>c.length>0),s=o[0]?.trim()??"",a=aA(s),l={case:oA(e),prefix:r};if(a&&(l.group=a),n&&o.length>1){let c=by(o[0]??"").length/2;c>0&&o.slice(0,-1).every(d=>by(d).length/2===c)&&(l.line={bytesPerLine:c,separator:n});}return l}function lA(t,e){let r=e.allowPrefix??true,i=[...rA(e)].sort((a,l)=>l.length-a.length);for(let a of i)iA(a);let n=t.trim();if(/^0x/i.test(n)){if(!r)throw new TypeError("Hexadecimal text must not include a 0x prefix");n=n.slice(2);}let o="",s=false;for(let a=0;a<n.length;){let l=n[a]??"";if(eA.test(l)){o+=l,s=false,a+=1;continue}let c=nA(n,a,i);if(!c)throw new TypeError("Input is not valid hexadecimal text");if(e.strict&&(s||o.length===0))throw new TypeError("Hexadecimal text contains misplaced separators");s=true,a+=c.length;}if(e.strict&&s&&o.length>0)throw new TypeError("Hexadecimal text must not end with a separator");if(o.length%2!==0){if(!e.allowOddLength)throw new TypeError("Hexadecimal text must contain an even number of characters");o=`0${o}`;}return o.toLowerCase()}function Sy(t,e){if(!e)return t.join("");if(!Number.isInteger(e.size)||e.size<1)throw new RangeError("Hex group size must be a positive integer");let r=[];for(let i=0;i<t.length;i+=e.size)r.push(t.slice(i,i+e.size).join(""));return r.join(e.separator)}function Va(t,e={}){return lA(t,e)}function xy(t,e={}){if(typeof t!="string")return false;try{return Va(t,e),!0}catch{return false}}function Uu(t,e={}){let r=qt(t),i=e.case??"lower",n=Array.from(r,s=>{let a=s.toString(16).padStart(2,"0");return i==="upper"?a.toUpperCase():a}),o="";if(e.line){let s=e.line.bytesPerLine;if(!Number.isInteger(s)||s<1)throw new RangeError("Hex bytesPerLine must be a positive integer");let a=e.line.separator??`
879
+ `,l=[];for(let c=0;c<n.length;c+=s)l.push(Sy(n.slice(c,c+s),e.group));o=l.join(a);}else o=Sy(n,e.group);return `${e.prefix??""}${o}`}function Lu(t,e={}){let r=Va(t,e),i=new Uint8Array(r.length/2);for(let n=0;n<r.length;n+=2)i[n/2]=Number.parseInt(r.slice(n,n+2),16);return i}function Ay(t,e={}){let r=Va(t,e);return {bytes:Lu(r),format:cA(t),normalized:r}}function _y(t,e){return Uu(t,e)}var Cy={compact:Object.freeze({}),upper:Object.freeze({case:"upper"}),colon:Object.freeze({group:{size:1,separator:":"}}),colonUpper:Object.freeze({case:"upper",group:{size:1,separator:":"}}),groupsOf4:Object.freeze({group:{size:4,separator:" "}}),prefixed:Object.freeze({prefix:"0x"})},dA={encode:Uu,decode:Lu,format:_y,formats:Cy,is:xy,normalize:Va,parse:Ay};var ja=class{static isIPv4(e){return /^(\d{1,3}\.){3}\d{1,3}$/.test(e)}static parseIPv4(e){let r=e.split(".");if(r.length!==4)throw new Error("Invalid IPv4 address");return r.map(i=>{let n=parseInt(i,10);if(isNaN(n)||n<0||n>255)throw new Error("Invalid IPv4 address part");return n})}static parseIPv6(e){let i=this.expandIPv6(e).split(":");if(i.length!==8)throw new Error("Invalid IPv6 address");return i.reduce((n,o)=>{let s=parseInt(o,16);if(isNaN(s)||s<0||s>65535)throw new Error("Invalid IPv6 address part");return n.push(s>>8&255),n.push(s&255),n},[])}static expandIPv6(e){if(!e.includes("::"))return e;let r=e.split("::");if(r.length>2)throw new Error("Invalid IPv6 address");let i=r[0]?r[0].split(":"):[],n=r[1]?r[1].split(":"):[],o=8-(i.length+n.length);if(o<0)throw new Error("Invalid IPv6 address");return [...i,...Array(o).fill("0"),...n].join(":")}static formatIPv6(e){let r=[];for(let i=0;i<16;i+=2)r.push((e[i]<<8|e[i+1]).toString(16));return this.compressIPv6(r.join(":"))}static compressIPv6(e){let r=e.split(":"),i=-1,n=0,o=-1,s=0;for(let a=0;a<r.length;a++)r[a]==="0"?(o===-1&&(o=a),s++):(s>n&&(i=o,n=s),o=-1,s=0);if(s>n&&(i=o,n=s),n>1){let a=r.slice(0,i).join(":"),l=r.slice(i+n).join(":");return `${a}::${l}`}return e}static parseCIDR(e){let[r,i]=e.split("/"),n=parseInt(i,10);if(this.isIPv4(r)){if(n<0||n>32)throw new Error("Invalid IPv4 prefix length");return [this.parseIPv4(r),n]}else {if(n<0||n>128)throw new Error("Invalid IPv6 prefix length");return [this.parseIPv6(r),n]}}static decodeIP(e){if(e.length===64&&parseInt(e,16)===0)return "::/0";if(e.length!==16)return e;let r=parseInt(e.slice(8),16).toString(2).split("").reduce((n,o)=>n+ +o,0),i=e.slice(0,8).replace(/(.{2})/g,n=>`${parseInt(n,16)}.`);return i=i.slice(0,-1),`${i}/${r}`}static toString(e){let r=new Uint8Array(e);if(r.length===4)return Array.from(r).join(".");if(r.length===16)return this.formatIPv6(r);if(r.length===8||r.length===32){let i=r.length/2,n=r.slice(0,i),o=r.slice(i);if(r.every(l=>l===0))return r.length===8?"0.0.0.0/0":"::/0";let a=o.reduce((l,c)=>l+(c.toString(2).match(/1/g)||[]).length,0);return r.length===8?`${Array.from(n).join(".")}/${a}`:`${this.formatIPv6(n)}/${a}`}return this.decodeIP(ss.encode(e))}static fromString(e){if(e.includes("/")){let[i,n]=this.parseCIDR(e),o=new Uint8Array(i.length),s=n;for(let l=0;l<o.length;l++)s>=8?(o[l]=255,s-=8):s>0&&(o[l]=255<<8-s,s=0);let a=new Uint8Array(i.length*2);return a.set(i,0),a.set(o,i.length),a.buffer}let r=this.isIPv4(e)?this.parseIPv4(e):this.parseIPv6(e);return new Uint8Array(r).buffer}};var Hu,Ku,qu,Vt=class{constructor(e={}){f(this,"teletexString");f(this,"printableString");f(this,"universalString");f(this,"utf8String");f(this,"bmpString");Object.assign(this,e);}toString(){return this.bmpString||this.printableString||this.teletexString||this.universalString||this.utf8String||""}};p([g({type:S.TeletexString})],Vt.prototype,"teletexString",void 0);p([g({type:S.PrintableString})],Vt.prototype,"printableString",void 0);p([g({type:S.UniversalString})],Vt.prototype,"universalString",void 0);p([g({type:S.Utf8String})],Vt.prototype,"utf8String",void 0);p([g({type:S.BmpString})],Vt.prototype,"bmpString",void 0);Vt=p([M({type:k.Choice})],Vt);var as=class extends Vt{constructor(r={}){super(r);f(this,"ia5String");f(this,"anyValue");Object.assign(this,r);}toString(){return this.ia5String||(this.anyValue?ss.encode(this.anyValue):super.toString())}};p([g({type:S.IA5String})],as.prototype,"ia5String",void 0);p([g({type:S.Any})],as.prototype,"anyValue",void 0);as=p([M({type:k.Choice})],as);var Xa=class{constructor(e={}){f(this,"type","");f(this,"value",new as);Object.assign(this,e);}};p([g({type:S.ObjectIdentifier})],Xa.prototype,"type",void 0);p([g({type:as})],Xa.prototype,"value",void 0);var Wa=Hu=class extends te{constructor(e){super(e),Object.setPrototypeOf(this,Hu.prototype);}};Wa=Hu=p([M({type:k.Set,itemType:Xa})],Wa);var Gu=Ku=class extends te{constructor(e){super(e),Object.setPrototypeOf(this,Ku.prototype);}};Gu=Ku=p([M({type:k.Sequence,itemType:Wa})],Gu);var mt=qu=class extends Gu{constructor(e){super(e),Object.setPrototypeOf(this,qu.prototype);}};mt=qu=p([M({type:k.Sequence})],mt);var mA={fromASN:t=>ja.toString(is.fromASN(t)),toASN:t=>is.toASN(ja.fromString(t))},Za=class{constructor(e={}){f(this,"typeId","");f(this,"value",new ArrayBuffer(0));Object.assign(this,e);}};p([g({type:S.ObjectIdentifier})],Za.prototype,"typeId",void 0);p([g({type:S.Any,context:0})],Za.prototype,"value",void 0);var Ya=class{constructor(e={}){f(this,"nameAssigner");f(this,"partyName",new Vt);Object.assign(this,e);}};p([g({type:Vt,optional:true,context:0,implicit:true})],Ya.prototype,"nameAssigner",void 0);p([g({type:Vt,context:1,implicit:true})],Ya.prototype,"partyName",void 0);var ce=class{constructor(e={}){f(this,"otherName");f(this,"rfc822Name");f(this,"dNSName");f(this,"x400Address");f(this,"directoryName");f(this,"ediPartyName");f(this,"uniformResourceIdentifier");f(this,"iPAddress");f(this,"registeredID");Object.assign(this,e);}};p([g({type:Za,context:0,implicit:true})],ce.prototype,"otherName",void 0);p([g({type:S.IA5String,context:1,implicit:true})],ce.prototype,"rfc822Name",void 0);p([g({type:S.IA5String,context:2,implicit:true})],ce.prototype,"dNSName",void 0);p([g({type:S.Any,context:3,implicit:true})],ce.prototype,"x400Address",void 0);p([g({type:mt,context:4,implicit:false})],ce.prototype,"directoryName",void 0);p([g({type:Ya,context:5})],ce.prototype,"ediPartyName",void 0);p([g({type:S.IA5String,context:6,implicit:true})],ce.prototype,"uniformResourceIdentifier",void 0);p([g({type:S.OctetString,context:7,implicit:true,converter:mA})],ce.prototype,"iPAddress",void 0);p([g({type:S.ObjectIdentifier,context:8,implicit:true})],ce.prototype,"registeredID",void 0);ce=p([M({type:k.Choice})],ce);var zu,to=class{constructor(e={}){f(this,"accessMethod","");f(this,"accessLocation",new ce);Object.assign(this,e);}};p([g({type:S.ObjectIdentifier})],to.prototype,"accessMethod",void 0);p([g({type:ce})],to.prototype,"accessLocation",void 0);var Iy=zu=class extends te{constructor(e){super(e),Object.setPrototypeOf(this,zu.prototype);}};Iy=zu=p([M({type:k.Sequence,itemType:to})],Iy);var Qa=class extends oe{},cs=class{constructor(e={}){f(this,"keyIdentifier");f(this,"authorityCertIssuer");f(this,"authorityCertSerialNumber");e&&Object.assign(this,e);}};p([g({type:Qa,context:0,optional:true,implicit:true})],cs.prototype,"keyIdentifier",void 0);p([g({type:ce,context:1,optional:true,implicit:true,repeated:"sequence"})],cs.prototype,"authorityCertIssuer",void 0);p([g({type:S.Integer,context:2,optional:true,implicit:true,converter:fe})],cs.prototype,"authorityCertSerialNumber",void 0);var M1=class{constructor(e={}){f(this,"cA",false);f(this,"pathLenConstraint");Object.assign(this,e);}};p([g({type:S.Boolean,defaultValue:false})],M1.prototype,"cA",void 0);p([g({type:S.Integer,optional:true})],M1.prototype,"pathLenConstraint",void 0);var $u,qe=$u=class extends te{constructor(e){super(e),Object.setPrototypeOf(this,$u.prototype);}};qe=$u=p([M({type:k.Sequence,itemType:ce})],qe);var Vu,vy=Vu=class extends qe{constructor(e){super(e),Object.setPrototypeOf(this,Vu.prototype);}};vy=Vu=p([M({type:k.Sequence})],vy);var ju,hi=class{constructor(e={}){f(this,"ia5String");f(this,"visibleString");f(this,"bmpString");f(this,"utf8String");Object.assign(this,e);}toString(){return this.ia5String||this.visibleString||this.bmpString||this.utf8String||""}};p([g({type:S.IA5String})],hi.prototype,"ia5String",void 0);p([g({type:S.VisibleString})],hi.prototype,"visibleString",void 0);p([g({type:S.BmpString})],hi.prototype,"bmpString",void 0);p([g({type:S.Utf8String})],hi.prototype,"utf8String",void 0);hi=p([M({type:k.Choice})],hi);var Ja=class{constructor(e={}){f(this,"organization",new hi);f(this,"noticeNumbers",[]);Object.assign(this,e);}};p([g({type:hi})],Ja.prototype,"organization",void 0);p([g({type:S.Integer,repeated:"sequence"})],Ja.prototype,"noticeNumbers",void 0);var e0=class{constructor(e={}){f(this,"noticeRef");f(this,"explicitText");Object.assign(this,e);}};p([g({type:Ja,optional:true})],e0.prototype,"noticeRef",void 0);p([g({type:hi,optional:true})],e0.prototype,"explicitText",void 0);var F1=class{constructor(e={}){f(this,"cPSuri");f(this,"userNotice");Object.assign(this,e);}};p([g({type:S.IA5String})],F1.prototype,"cPSuri",void 0);p([g({type:e0})],F1.prototype,"userNotice",void 0);F1=p([M({type:k.Choice})],F1);var t0=class{constructor(e={}){f(this,"policyQualifierId","");f(this,"qualifier",new ArrayBuffer(0));Object.assign(this,e);}};p([g({type:S.ObjectIdentifier})],t0.prototype,"policyQualifierId",void 0);p([g({type:S.Any})],t0.prototype,"qualifier",void 0);var r0=class{constructor(e={}){f(this,"policyIdentifier","");f(this,"policyQualifiers");Object.assign(this,e);}};p([g({type:S.ObjectIdentifier})],r0.prototype,"policyIdentifier",void 0);p([g({type:t0,repeated:"sequence",optional:true})],r0.prototype,"policyQualifiers",void 0);var Ey=ju=class extends te{constructor(e){super(e),Object.setPrototypeOf(this,ju.prototype);}};Ey=ju=p([M({type:k.Sequence,itemType:r0})],Ey);var i0=class{constructor(e=0){f(this,"value");this.value=e;}};p([g({type:S.Integer})],i0.prototype,"value",void 0);i0=p([M({type:k.Choice})],i0);var By=class extends i0{};By=p([M({type:k.Choice})],By);var Xu,br;(function(t){t[t.unused=1]="unused",t[t.keyCompromise=2]="keyCompromise",t[t.cACompromise=4]="cACompromise",t[t.affiliationChanged=8]="affiliationChanged",t[t.superseded=16]="superseded",t[t.cessationOfOperation=32]="cessationOfOperation",t[t.certificateHold=64]="certificateHold",t[t.privilegeWithdrawn=128]="privilegeWithdrawn",t[t.aACompromise=256]="aACompromise";})(br||(br={}));var n0=class extends pi{toJSON(){let e=[],r=this.toNumber();return r&br.aACompromise&&e.push("aACompromise"),r&br.affiliationChanged&&e.push("affiliationChanged"),r&br.cACompromise&&e.push("cACompromise"),r&br.certificateHold&&e.push("certificateHold"),r&br.cessationOfOperation&&e.push("cessationOfOperation"),r&br.keyCompromise&&e.push("keyCompromise"),r&br.privilegeWithdrawn&&e.push("privilegeWithdrawn"),r&br.superseded&&e.push("superseded"),r&br.unused&&e.push("unused"),e}toString(){return `[${this.toJSON().join(", ")}]`}},ro=class{constructor(e={}){f(this,"fullName");f(this,"nameRelativeToCRLIssuer");Object.assign(this,e);}};p([g({type:ce,context:0,repeated:"sequence",implicit:true})],ro.prototype,"fullName",void 0);p([g({type:Wa,context:1,implicit:true})],ro.prototype,"nameRelativeToCRLIssuer",void 0);ro=p([M({type:k.Choice})],ro);var Qi=class{constructor(e={}){f(this,"distributionPoint");f(this,"reasons");f(this,"cRLIssuer");Object.assign(this,e);}};p([g({type:ro,context:0,optional:true})],Qi.prototype,"distributionPoint",void 0);p([g({type:n0,context:1,optional:true,implicit:true})],Qi.prototype,"reasons",void 0);p([g({type:ce,context:2,optional:true,repeated:"sequence",implicit:true})],Qi.prototype,"cRLIssuer",void 0);var U1=Xu=class extends te{constructor(e){super(e),Object.setPrototypeOf(this,Xu.prototype);}};U1=Xu=p([M({type:k.Sequence,itemType:Qi})],U1);var Wu,Ty=Wu=class extends U1{constructor(e){super(e),Object.setPrototypeOf(this,Wu.prototype);}};Ty=Wu=p([M({type:k.Sequence,itemType:Qi})],Ty);var io=class io{constructor(e={}){f(this,"distributionPoint");f(this,"onlyContainsUserCerts",io.ONLY);f(this,"onlyContainsCACerts",io.ONLY);f(this,"onlySomeReasons");f(this,"indirectCRL",io.ONLY);f(this,"onlyContainsAttributeCerts",io.ONLY);Object.assign(this,e);}};f(io,"ONLY",false);var jt=io;p([g({type:ro,context:0,optional:true})],jt.prototype,"distributionPoint",void 0);p([g({type:S.Boolean,context:1,defaultValue:jt.ONLY,implicit:true})],jt.prototype,"onlyContainsUserCerts",void 0);p([g({type:S.Boolean,context:2,defaultValue:jt.ONLY,implicit:true})],jt.prototype,"onlyContainsCACerts",void 0);p([g({type:n0,context:3,optional:true,implicit:true})],jt.prototype,"onlySomeReasons",void 0);p([g({type:S.Boolean,context:4,defaultValue:jt.ONLY,implicit:true})],jt.prototype,"indirectCRL",void 0);p([g({type:S.Boolean,context:5,defaultValue:jt.ONLY,implicit:true})],jt.prototype,"onlyContainsAttributeCerts",void 0);var o0;(function(t){t[t.unspecified=0]="unspecified",t[t.keyCompromise=1]="keyCompromise",t[t.cACompromise=2]="cACompromise",t[t.affiliationChanged=3]="affiliationChanged",t[t.superseded=4]="superseded",t[t.cessationOfOperation=5]="cessationOfOperation",t[t.certificateHold=6]="certificateHold",t[t.removeFromCRL=8]="removeFromCRL",t[t.privilegeWithdrawn=9]="privilegeWithdrawn",t[t.aACompromise=10]="aACompromise";})(o0||(o0={}));var Zu=class{constructor(e=o0.unspecified){f(this,"reason",o0.unspecified);this.reason=e;}toJSON(){return o0[this.reason]}toString(){return this.toJSON()}};p([g({type:S.Enumerated})],Zu.prototype,"reason",void 0);Zu=p([M({type:k.Choice})],Zu);var Yu,ky=Yu=class extends te{constructor(e){super(e),Object.setPrototypeOf(this,Yu.prototype);}};ky=Yu=p([M({type:k.Sequence,itemType:S.ObjectIdentifier})],ky);var Qu=class{constructor(e=new ArrayBuffer(0)){f(this,"value");this.value=e;}};p([g({type:S.Integer,converter:fe})],Qu.prototype,"value",void 0);Qu=p([M({type:k.Choice})],Qu);var Ju=class{constructor(e){f(this,"value",new Date);e&&(this.value=e);}};p([g({type:S.GeneralizedTime})],Ju.prototype,"value",void 0);Ju=p([M({type:k.Choice})],Ju);var ef,Py=ef=class extends qe{constructor(e){super(e),Object.setPrototypeOf(this,ef.prototype);}};Py=ef=p([M({type:k.Sequence})],Py);var Ny;(function(t){t[t.digitalSignature=1]="digitalSignature",t[t.nonRepudiation=2]="nonRepudiation",t[t.keyEncipherment=4]="keyEncipherment",t[t.dataEncipherment=8]="dataEncipherment",t[t.keyAgreement=16]="keyAgreement",t[t.keyCertSign=32]="keyCertSign",t[t.cRLSign=64]="cRLSign",t[t.encipherOnly=128]="encipherOnly",t[t.decipherOnly=256]="decipherOnly";})(Ny||(Ny={}));var tf,ls=class{constructor(e={}){f(this,"base",new ce);f(this,"minimum",0);f(this,"maximum");Object.assign(this,e);}};p([g({type:ce})],ls.prototype,"base",void 0);p([g({type:S.Integer,context:0,defaultValue:0,implicit:true})],ls.prototype,"minimum",void 0);p([g({type:S.Integer,context:1,optional:true,implicit:true})],ls.prototype,"maximum",void 0);var L1=tf=class extends te{constructor(e){super(e),Object.setPrototypeOf(this,tf.prototype);}};L1=tf=p([M({type:k.Sequence,itemType:ls})],L1);var H1=class{constructor(e={}){f(this,"permittedSubtrees");f(this,"excludedSubtrees");Object.assign(this,e);}};p([g({type:L1,context:0,optional:true,implicit:true})],H1.prototype,"permittedSubtrees",void 0);p([g({type:L1,context:1,optional:true,implicit:true})],H1.prototype,"excludedSubtrees",void 0);var K1=class{constructor(e={}){f(this,"requireExplicitPolicy");f(this,"inhibitPolicyMapping");Object.assign(this,e);}};p([g({type:S.Integer,context:0,implicit:true,optional:true,converter:fe})],K1.prototype,"requireExplicitPolicy",void 0);p([g({type:S.Integer,context:1,implicit:true,optional:true,converter:fe})],K1.prototype,"inhibitPolicyMapping",void 0);var rf,s0=class{constructor(e={}){f(this,"issuerDomainPolicy","");f(this,"subjectDomainPolicy","");Object.assign(this,e);}};p([g({type:S.ObjectIdentifier})],s0.prototype,"issuerDomainPolicy",void 0);p([g({type:S.ObjectIdentifier})],s0.prototype,"subjectDomainPolicy",void 0);var Dy=rf=class extends te{constructor(e){super(e),Object.setPrototypeOf(this,rf.prototype);}};Dy=rf=p([M({type:k.Sequence,itemType:s0})],Dy);var nf,Ry=nf=class extends qe{constructor(e){super(e),Object.setPrototypeOf(this,nf.prototype);}};Ry=nf=p([M({type:k.Sequence})],Ry);var Hr=class{constructor(e={}){f(this,"type","");f(this,"values",[]);Object.assign(this,e);}};p([g({type:S.ObjectIdentifier})],Hr.prototype,"type",void 0);p([g({type:S.Any,repeated:"set"})],Hr.prototype,"values",void 0);var of,Oy=of=class extends te{constructor(e){super(e),Object.setPrototypeOf(this,of.prototype);}};Oy=of=p([M({type:k.Sequence,itemType:Hr})],Oy);var Sr=class extends Qa{};var a0=class{constructor(e={}){f(this,"notBefore");f(this,"notAfter");Object.assign(this,e);}};p([g({type:S.GeneralizedTime,context:0,implicit:true,optional:true})],a0.prototype,"notBefore",void 0);p([g({type:S.GeneralizedTime,context:1,implicit:true,optional:true})],a0.prototype,"notAfter",void 0);var c0;(function(t){t[t.keyUpdateAllowed=1]="keyUpdateAllowed",t[t.newExtensions=2]="newExtensions",t[t.pKIXCertificate=4]="pKIXCertificate";})(c0||(c0={}));var q1=class extends pi{toJSON(){let e=[],r=this.toNumber();return r&c0.pKIXCertificate&&e.push("pKIXCertificate"),r&c0.newExtensions&&e.push("newExtensions"),r&c0.keyUpdateAllowed&&e.push("keyUpdateAllowed"),e}toString(){return `[${this.toJSON().join(", ")}]`}},G1=class{constructor(e={}){f(this,"entrustVers","");f(this,"entrustInfoFlags",new q1);Object.assign(this,e);}};p([g({type:S.GeneralString})],G1.prototype,"entrustVers",void 0);p([g({type:q1})],G1.prototype,"entrustInfoFlags",void 0);var sf,My=sf=class extends te{constructor(e){super(e),Object.setPrototypeOf(this,sf.prototype);}};My=sf=p([M({type:k.Sequence,itemType:to})],My);var W=class t{constructor(e={}){f(this,"algorithm","");f(this,"parameters");Object.assign(this,e);}isEqual(e){return e instanceof t&&e.algorithm==this.algorithm&&(e.parameters&&this.parameters&&Ou(e.parameters,this.parameters)||e.parameters===this.parameters)}};p([g({type:S.ObjectIdentifier})],W.prototype,"algorithm",void 0);p([g({type:S.Any,optional:true})],W.prototype,"parameters",void 0);var no=class{constructor(e={}){f(this,"algorithm",new W);f(this,"subjectPublicKey",new ArrayBuffer(0));Object.assign(this,e);}};p([g({type:W})],no.prototype,"algorithm",void 0);p([g({type:S.BitString})],no.prototype,"subjectPublicKey",void 0);var Ue=class{constructor(e){f(this,"utcTime");f(this,"generalTime");if(e)if(typeof e=="string"||typeof e=="number"||e instanceof Date){let r=new Date(e);r.setMilliseconds(0),r.getUTCFullYear()>2049?this.generalTime=r:this.utcTime=r;}else Object.assign(this,e);}getTime(){let e=this.utcTime||this.generalTime;if(!e)throw new Error("Cannot get time from CHOICE object");return e}};p([g({type:S.UTCTime})],Ue.prototype,"utcTime",void 0);p([g({type:S.GeneralizedTime})],Ue.prototype,"generalTime",void 0);Ue=p([M({type:k.Choice})],Ue);var oo=class{constructor(e){f(this,"notBefore",new Ue(new Date));f(this,"notAfter",new Ue(new Date));e&&(this.notBefore=new Ue(e.notBefore),this.notAfter=new Ue(e.notAfter));}};p([g({type:Ue})],oo.prototype,"notBefore",void 0);p([g({type:Ue})],oo.prototype,"notAfter",void 0);var af,z1=class z1{constructor(e={}){f(this,"extnID","");f(this,"critical",z1.CRITICAL);f(this,"extnValue",new oe);Object.assign(this,e);}};f(z1,"CRITICAL",false);var Kr=z1;p([g({type:S.ObjectIdentifier})],Kr.prototype,"extnID",void 0);p([g({type:S.Boolean,defaultValue:Kr.CRITICAL})],Kr.prototype,"critical",void 0);p([g({type:oe})],Kr.prototype,"extnValue",void 0);var ds=af=class extends te{constructor(e){super(e),Object.setPrototypeOf(this,af.prototype);}};ds=af=p([M({type:k.Sequence,itemType:Kr})],ds);var l0;(function(t){t[t.v1=0]="v1",t[t.v2=1]="v2",t[t.v3=2]="v3";})(l0||(l0={}));var gt=class{constructor(e={}){f(this,"version",l0.v1);f(this,"serialNumber",new ArrayBuffer(0));f(this,"signature",new W);f(this,"issuer",new mt);f(this,"validity",new oo);f(this,"subject",new mt);f(this,"subjectPublicKeyInfo",new no);f(this,"issuerUniqueID");f(this,"subjectUniqueID");f(this,"extensions");Object.assign(this,e);}};p([g({type:S.Integer,context:0,defaultValue:l0.v1})],gt.prototype,"version",void 0);p([g({type:S.Integer,converter:fe})],gt.prototype,"serialNumber",void 0);p([g({type:W})],gt.prototype,"signature",void 0);p([g({type:mt})],gt.prototype,"issuer",void 0);p([g({type:oo})],gt.prototype,"validity",void 0);p([g({type:mt})],gt.prototype,"subject",void 0);p([g({type:no})],gt.prototype,"subjectPublicKeyInfo",void 0);p([g({type:S.BitString,context:1,implicit:true,optional:true})],gt.prototype,"issuerUniqueID",void 0);p([g({type:S.BitString,context:2,implicit:true,optional:true})],gt.prototype,"subjectUniqueID",void 0);p([g({type:ds,context:3,optional:true})],gt.prototype,"extensions",void 0);var Dt=class{constructor(e={}){f(this,"tbsCertificate",new gt);f(this,"tbsCertificateRaw");f(this,"signatureAlgorithm",new W);f(this,"signatureValue",new ArrayBuffer(0));Object.assign(this,e);}};p([g({type:gt,raw:true})],Dt.prototype,"tbsCertificate",void 0);p([g({type:W})],Dt.prototype,"signatureAlgorithm",void 0);p([g({type:S.BitString})],Dt.prototype,"signatureValue",void 0);var us=class{constructor(e={}){f(this,"userCertificate",new ArrayBuffer(0));f(this,"revocationDate",new Ue);f(this,"crlEntryExtensions");Object.assign(this,e);}};p([g({type:S.Integer,converter:fe})],us.prototype,"userCertificate",void 0);p([g({type:Ue})],us.prototype,"revocationDate",void 0);p([g({type:Kr,optional:true,repeated:"sequence"})],us.prototype,"crlEntryExtensions",void 0);var Xt=class{constructor(e={}){f(this,"version");f(this,"signature",new W);f(this,"issuer",new mt);f(this,"thisUpdate",new Ue);f(this,"nextUpdate");f(this,"revokedCertificates");f(this,"crlExtensions");Object.assign(this,e);}};p([g({type:S.Integer,optional:true})],Xt.prototype,"version",void 0);p([g({type:W})],Xt.prototype,"signature",void 0);p([g({type:mt})],Xt.prototype,"issuer",void 0);p([g({type:Ue})],Xt.prototype,"thisUpdate",void 0);p([g({type:Ue,optional:true})],Xt.prototype,"nextUpdate",void 0);p([g({type:us,repeated:"sequence",optional:true})],Xt.prototype,"revokedCertificates",void 0);p([g({type:Kr,optional:true,context:0,repeated:"sequence"})],Xt.prototype,"crlExtensions",void 0);var d0=class{constructor(e={}){f(this,"tbsCertList",new Xt);f(this,"tbsCertListRaw");f(this,"signatureAlgorithm",new W);f(this,"signature",new ArrayBuffer(0));Object.assign(this,e);}};p([g({type:Xt,raw:true})],d0.prototype,"tbsCertList",void 0);p([g({type:W})],d0.prototype,"signatureAlgorithm",void 0);p([g({type:S.BitString})],d0.prototype,"signature",void 0);var u0=class{constructor(e){this.zero=BigInt(0),this.one=BigInt(1),this.prime=e;}e(e){return typeof e=="bigint"?e%this.prime:BigInt(e)%this.prime}add(e,r){return (e+r)%this.prime}sub(e,r){return (this.prime+e-r)%this.prime}mul(e,r){return e*r%this.prime}square(e){return e*e%this.prime}div(e,r){return e/r%this.prime}};var f0=class{constructor(e,r){this.params=e,this.primeField=r;}getT(){return this.params.t}sbox(e){return e.map(r=>this.sboxP(r))}sboxP(e){let r=this.primeField.square(e);if(this.params.d==3)return this.primeField.mul(r,e);if(this.params.d==5)return this.primeField.mul(this.primeField.square(r),e);if(this.params.d==7)return this.primeField.mul(this.primeField.square(r),this.primeField.mul(r,e));throw new Error("Invalid d paramter, must be 3, 5 or 7")}matmulExternal(e){let r=this.params.t;if(r==2){let i=this.primeField.add(e[0],e[1]);e[0]=this.primeField.add(e[0],i),e[1]=this.primeField.add(e[1],i);}else if(r==3){let i=this.primeField.add(this.primeField.add(e[0],e[1]),e[2]);e[0]=this.primeField.add(e[0],i),e[1]=this.primeField.add(e[1],i),e[2]=this.primeField.add(e[2],i);}else if(r==4||r==8||r==12||r==16||r==20||r==24){let i=r/4;for(let n=0;n<i;n++){let o=n*4,s=e[o];s=this.primeField.add(s,e[o+1]);let a=e[o+2];a=this.primeField.add(a,e[o+3]);let l=e[o+1];l=this.primeField.add(l,l),l=this.primeField.add(l,a);let c=e[o+3];c=this.primeField.add(c,c),c=this.primeField.add(c,s);let d=a;d=this.primeField.add(d,d),d=this.primeField.add(d,d),d=this.primeField.add(d,c);let u=s;u=this.primeField.add(u,u),u=this.primeField.add(u,u),u=this.primeField.add(u,l);let h=c;h=this.primeField.add(h,u);let y=l;y=this.primeField.add(y,d),e[o]=h,e[o+1]=u,e[o+2]=y,e[o+3]=d;}if(r>4){let n=[this.primeField.zero,this.primeField.zero,this.primeField.zero,this.primeField.zero];for(let o=0;o<4;o++){n[o]=e[o];for(let s=1;s<i;s++)n[o]=this.primeField.add(n[o],e[4*s+o]);}for(let o=0;o<e.length;o++)e[o]=this.primeField.add(e[o],n[o%4]);}}else throw new Error("Invalid t parameter, must be 2, 3, 4, 8, 12, 16, 20 or 24");return e}matmulInternal(e){let r=this.params.t;if(r==2){let i=this.primeField.add(e[0],e[1]);e[0]=this.primeField.add(e[0],i),e[1]=this.primeField.add(this.primeField.add(e[1],e[1]),i);}else if(r==3){let i=this.primeField.add(this.primeField.add(e[0],e[1]),e[2]);e[0]=this.primeField.add(e[0],i),e[1]=this.primeField.add(e[1],i),e[2]=this.primeField.add(this.primeField.add(e[2],e[2]),i);}else if(r==4||r==8||r==12||r==16||r==20||r==24){let i=e[0];for(let n=1;n<r;n++)i=this.primeField.add(i,e[n]);for(let n=0;n<e.length;n++)e[n]=this.primeField.add(this.primeField.mul(this.params.mat_internal_diag_m_1[n],e[n]),i);}else throw new Error("Invalid t parameter, must be 2, 3, 4, 8, 12, 16, 20 or 24");return e}permute(e){let r=this.params.t;if(e.length!=r)throw new Error("Invalid input length");let i=e;this.matmulExternal(i);for(let o=0;o<this.params.rounds_f_beginning;o++)i=this.addRc(i,this.params.round_constants[o]),i=this.sbox(i),this.matmulExternal(i);let n=this.params.rounds_f_beginning+this.params.rounds_p;for(let o=this.params.rounds_f_beginning;o<n;o++)i[0]=this.primeField.add(i[0],this.params.round_constants[o][0]),i[0]=this.sboxP(i[0]),this.matmulInternal(i);for(let o=n;o<this.params.rounds;o++)i=this.addRc(i,this.params.round_constants[o]),i=this.sbox(i),this.matmulExternal(i);return i}addRc(e,r){return e.map((i,n)=>this.primeField.add(i,r[n]))}};function cf(t,e,r,i,n,o,s){let a=r/2,l=r+i;return {t,d:e,rounds_f_beginning:a,rounds_p:i,rounds_f_end:a,rounds:l,mat_internal_diag_m_1:n,_mat_internal:o,round_constants:s}}var Fy=[BigInt("0x10dc6e9c006ea38b04b1e03b4bd9490c0d03f98929ca1d7fb56821fd19d3b6e7"),BigInt("0x0c28145b6a44df3e0149b3d0a30b3bb599df9756d4dd9b84a86b38cfb45a740b"),BigInt("0x00544b8338791518b2c7645a50392798b21f75bb60e3596170067d00141cac15"),BigInt("0x222c01175718386f2e2e82eb122789e352e105a3b8fa852613bc534433ee428b")],Uy=[[BigInt("0x10dc6e9c006ea38b04b1e03b4bd9490c0d03f98929ca1d7fb56821fd19d3b6e8"),BigInt("0x0000000000000000000000000000000000000000000000000000000000000001"),BigInt("0x0000000000000000000000000000000000000000000000000000000000000001"),BigInt("0x0000000000000000000000000000000000000000000000000000000000000001")],[BigInt("0x0000000000000000000000000000000000000000000000000000000000000001"),BigInt("0x0c28145b6a44df3e0149b3d0a30b3bb599df9756d4dd9b84a86b38cfb45a740c"),BigInt("0x0000000000000000000000000000000000000000000000000000000000000001"),BigInt("0x0000000000000000000000000000000000000000000000000000000000000001")],[BigInt("0x0000000000000000000000000000000000000000000000000000000000000001"),BigInt("0x0000000000000000000000000000000000000000000000000000000000000001"),BigInt("0x00544b8338791518b2c7645a50392798b21f75bb60e3596170067d00141cac16"),BigInt("0x0000000000000000000000000000000000000000000000000000000000000001")],[BigInt("0x0000000000000000000000000000000000000000000000000000000000000001"),BigInt("0x0000000000000000000000000000000000000000000000000000000000000001"),BigInt("0x0000000000000000000000000000000000000000000000000000000000000001"),BigInt("0x222c01175718386f2e2e82eb122789e352e105a3b8fa852613bc534433ee428c")]],Ly=[[BigInt("0x19b849f69450b06848da1d39bd5e4a4302bb86744edc26238b0878e269ed23e5"),BigInt("0x265ddfe127dd51bd7239347b758f0a1320eb2cc7450acc1dad47f80c8dcf34d6"),BigInt("0x199750ec472f1809e0f66a545e1e51624108ac845015c2aa3dfc36bab497d8aa"),BigInt("0x157ff3fe65ac7208110f06a5f74302b14d743ea25067f0ffd032f787c7f1cdf8")],[BigInt("0x2e49c43c4569dd9c5fd35ac45fca33f10b15c590692f8beefe18f4896ac94902"),BigInt("0x0e35fb89981890520d4aef2b6d6506c3cb2f0b6973c24fa82731345ffa2d1f1e"),BigInt("0x251ad47cb15c4f1105f109ae5e944f1ba9d9e7806d667ffec6fe723002e0b996"),BigInt("0x13da07dc64d428369873e97160234641f8beb56fdd05e5f3563fa39d9c22df4e")],[BigInt("0x0c009b84e650e6d23dc00c7dccef7483a553939689d350cd46e7b89055fd4738"),BigInt("0x011f16b1c63a854f01992e3956f42d8b04eb650c6d535eb0203dec74befdca06"),BigInt("0x0ed69e5e383a688f209d9a561daa79612f3f78d0467ad45485df07093f367549"),BigInt("0x04dba94a7b0ce9e221acad41472b6bbe3aec507f5eb3d33f463672264c9f789b")],[BigInt("0x0a3f2637d840f3a16eb094271c9d237b6036757d4bb50bf7ce732ff1d4fa28e8"),BigInt("0x259a666f129eea198f8a1c502fdb38fa39b1f075569564b6e54a485d1182323f"),BigInt("0x28bf7459c9b2f4c6d8e7d06a4ee3a47f7745d4271038e5157a32fdf7ede0d6a1"),BigInt("0x0a1ca941f057037526ea200f489be8d4c37c85bbcce6a2aeec91bd6941432447")],[BigInt("0x0c6f8f958be0e93053d7fd4fc54512855535ed1539f051dcb43a26fd926361cf"),BigInt("0x0000000000000000000000000000000000000000000000000000000000000000"),BigInt("0x0000000000000000000000000000000000000000000000000000000000000000"),BigInt("0x0000000000000000000000000000000000000000000000000000000000000000")],[BigInt("0x123106a93cd17578d426e8128ac9d90aa9e8a00708e296e084dd57e69caaf811"),BigInt("0x0000000000000000000000000000000000000000000000000000000000000000"),BigInt("0x0000000000000000000000000000000000000000000000000000000000000000"),BigInt("0x0000000000000000000000000000000000000000000000000000000000000000")],[BigInt("0x26e1ba52ad9285d97dd3ab52f8e840085e8fa83ff1e8f1877b074867cd2dee75"),BigInt("0x0000000000000000000000000000000000000000000000000000000000000000"),BigInt("0x0000000000000000000000000000000000000000000000000000000000000000"),BigInt("0x0000000000000000000000000000000000000000000000000000000000000000")],[BigInt("0x1cb55cad7bd133de18a64c5c47b9c97cbe4d8b7bf9e095864471537e6a4ae2c5"),BigInt("0x0000000000000000000000000000000000000000000000000000000000000000"),BigInt("0x0000000000000000000000000000000000000000000000000000000000000000"),BigInt("0x0000000000000000000000000000000000000000000000000000000000000000")],[BigInt("0x1dcd73e46acd8f8e0e2c7ce04bde7f6d2a53043d5060a41c7143f08e6e9055d0"),BigInt("0x0000000000000000000000000000000000000000000000000000000000000000"),BigInt("0x0000000000000000000000000000000000000000000000000000000000000000"),BigInt("0x0000000000000000000000000000000000000000000000000000000000000000")],[BigInt("0x011003e32f6d9c66f5852f05474a4def0cda294a0eb4e9b9b12b9bb4512e5574"),BigInt("0x0000000000000000000000000000000000000000000000000000000000000000"),BigInt("0x0000000000000000000000000000000000000000000000000000000000000000"),BigInt("0x0000000000000000000000000000000000000000000000000000000000000000")],[BigInt("0x2b1e809ac1d10ab29ad5f20d03a57dfebadfe5903f58bafed7c508dd2287ae8c"),BigInt("0x0000000000000000000000000000000000000000000000000000000000000000"),BigInt("0x0000000000000000000000000000000000000000000000000000000000000000"),BigInt("0x0000000000000000000000000000000000000000000000000000000000000000")],[BigInt("0x2539de1785b735999fb4dac35ee17ed0ef995d05ab2fc5faeaa69ae87bcec0a5"),BigInt("0x0000000000000000000000000000000000000000000000000000000000000000"),BigInt("0x0000000000000000000000000000000000000000000000000000000000000000"),BigInt("0x0000000000000000000000000000000000000000000000000000000000000000")],[BigInt("0x0c246c5a2ef8ee0126497f222b3e0a0ef4e1c3d41c86d46e43982cb11d77951d"),BigInt("0x0000000000000000000000000000000000000000000000000000000000000000"),BigInt("0x0000000000000000000000000000000000000000000000000000000000000000"),BigInt("0x0000000000000000000000000000000000000000000000000000000000000000")],[BigInt("0x192089c4974f68e95408148f7c0632edbb09e6a6ad1a1c2f3f0305f5d03b527b"),BigInt("0x0000000000000000000000000000000000000000000000000000000000000000"),BigInt("0x0000000000000000000000000000000000000000000000000000000000000000"),BigInt("0x0000000000000000000000000000000000000000000000000000000000000000")],[BigInt("0x1eae0ad8ab68b2f06a0ee36eeb0d0c058529097d91096b756d8fdc2fb5a60d85"),BigInt("0x0000000000000000000000000000000000000000000000000000000000000000"),BigInt("0x0000000000000000000000000000000000000000000000000000000000000000"),BigInt("0x0000000000000000000000000000000000000000000000000000000000000000")],[BigInt("0x179190e5d0e22179e46f8282872abc88db6e2fdc0dee99e69768bd98c5d06bfb"),BigInt("0x0000000000000000000000000000000000000000000000000000000000000000"),BigInt("0x0000000000000000000000000000000000000000000000000000000000000000"),BigInt("0x0000000000000000000000000000000000000000000000000000000000000000")],[BigInt("0x29bb9e2c9076732576e9a81c7ac4b83214528f7db00f31bf6cafe794a9b3cd1c"),BigInt("0x0000000000000000000000000000000000000000000000000000000000000000"),BigInt("0x0000000000000000000000000000000000000000000000000000000000000000"),BigInt("0x0000000000000000000000000000000000000000000000000000000000000000")],[BigInt("0x225d394e42207599403efd0c2464a90d52652645882aac35b10e590e6e691e08"),BigInt("0x0000000000000000000000000000000000000000000000000000000000000000"),BigInt("0x0000000000000000000000000000000000000000000000000000000000000000"),BigInt("0x0000000000000000000000000000000000000000000000000000000000000000")],[BigInt("0x064760623c25c8cf753d238055b444532be13557451c087de09efd454b23fd59"),BigInt("0x0000000000000000000000000000000000000000000000000000000000000000"),BigInt("0x0000000000000000000000000000000000000000000000000000000000000000"),BigInt("0x0000000000000000000000000000000000000000000000000000000000000000")],[BigInt("0x10ba3a0e01df92e87f301c4b716d8a394d67f4bf42a75c10922910a78f6b5b87"),BigInt("0x0000000000000000000000000000000000000000000000000000000000000000"),BigInt("0x0000000000000000000000000000000000000000000000000000000000000000"),BigInt("0x0000000000000000000000000000000000000000000000000000000000000000")],[BigInt("0x0e070bf53f8451b24f9c6e96b0c2a801cb511bc0c242eb9d361b77693f21471c"),BigInt("0x0000000000000000000000000000000000000000000000000000000000000000"),BigInt("0x0000000000000000000000000000000000000000000000000000000000000000"),BigInt("0x0000000000000000000000000000000000000000000000000000000000000000")],[BigInt("0x1b94cd61b051b04dd39755ff93821a73ccd6cb11d2491d8aa7f921014de252fb"),BigInt("0x0000000000000000000000000000000000000000000000000000000000000000"),BigInt("0x0000000000000000000000000000000000000000000000000000000000000000"),BigInt("0x0000000000000000000000000000000000000000000000000000000000000000")],[BigInt("0x1d7cb39bafb8c744e148787a2e70230f9d4e917d5713bb050487b5aa7d74070b"),BigInt("0x0000000000000000000000000000000000000000000000000000000000000000"),BigInt("0x0000000000000000000000000000000000000000000000000000000000000000"),BigInt("0x0000000000000000000000000000000000000000000000000000000000000000")],[BigInt("0x2ec93189bd1ab4f69117d0fe980c80ff8785c2961829f701bb74ac1f303b17db"),BigInt("0x0000000000000000000000000000000000000000000000000000000000000000"),BigInt("0x0000000000000000000000000000000000000000000000000000000000000000"),BigInt("0x0000000000000000000000000000000000000000000000000000000000000000")],[BigInt("0x2db366bfdd36d277a692bb825b86275beac404a19ae07a9082ea46bd83517926"),BigInt("0x0000000000000000000000000000000000000000000000000000000000000000"),BigInt("0x0000000000000000000000000000000000000000000000000000000000000000"),BigInt("0x0000000000000000000000000000000000000000000000000000000000000000")],[BigInt("0x062100eb485db06269655cf186a68532985275428450359adc99cec6960711b8"),BigInt("0x0000000000000000000000000000000000000000000000000000000000000000"),BigInt("0x0000000000000000000000000000000000000000000000000000000000000000"),BigInt("0x0000000000000000000000000000000000000000000000000000000000000000")],[BigInt("0x0761d33c66614aaa570e7f1e8244ca1120243f92fa59e4f900c567bf41f5a59b"),BigInt("0x0000000000000000000000000000000000000000000000000000000000000000"),BigInt("0x0000000000000000000000000000000000000000000000000000000000000000"),BigInt("0x0000000000000000000000000000000000000000000000000000000000000000")],[BigInt("0x20fc411a114d13992c2705aa034e3f315d78608a0f7de4ccf7a72e494855ad0d"),BigInt("0x0000000000000000000000000000000000000000000000000000000000000000"),BigInt("0x0000000000000000000000000000000000000000000000000000000000000000"),BigInt("0x0000000000000000000000000000000000000000000000000000000000000000")],[BigInt("0x25b5c004a4bdfcb5add9ec4e9ab219ba102c67e8b3effb5fc3a30f317250bc5a"),BigInt("0x0000000000000000000000000000000000000000000000000000000000000000"),BigInt("0x0000000000000000000000000000000000000000000000000000000000000000"),BigInt("0x0000000000000000000000000000000000000000000000000000000000000000")],[BigInt("0x23b1822d278ed632a494e58f6df6f5ed038b186d8474155ad87e7dff62b37f4b"),BigInt("0x0000000000000000000000000000000000000000000000000000000000000000"),BigInt("0x0000000000000000000000000000000000000000000000000000000000000000"),BigInt("0x0000000000000000000000000000000000000000000000000000000000000000")],[BigInt("0x22734b4c5c3f9493606c4ba9012499bf0f14d13bfcfcccaa16102a29cc2f69e0"),BigInt("0x0000000000000000000000000000000000000000000000000000000000000000"),BigInt("0x0000000000000000000000000000000000000000000000000000000000000000"),BigInt("0x0000000000000000000000000000000000000000000000000000000000000000")],[BigInt("0x26c0c8fe09eb30b7e27a74dc33492347e5bdff409aa3610254413d3fad795ce5"),BigInt("0x0000000000000000000000000000000000000000000000000000000000000000"),BigInt("0x0000000000000000000000000000000000000000000000000000000000000000"),BigInt("0x0000000000000000000000000000000000000000000000000000000000000000")],[BigInt("0x070dd0ccb6bd7bbae88eac03fa1fbb26196be3083a809829bbd626df348ccad9"),BigInt("0x0000000000000000000000000000000000000000000000000000000000000000"),BigInt("0x0000000000000000000000000000000000000000000000000000000000000000"),BigInt("0x0000000000000000000000000000000000000000000000000000000000000000")],[BigInt("0x12b6595bdb329b6fb043ba78bb28c3bec2c0a6de46d8c5ad6067c4ebfd4250da"),BigInt("0x0000000000000000000000000000000000000000000000000000000000000000"),BigInt("0x0000000000000000000000000000000000000000000000000000000000000000"),BigInt("0x0000000000000000000000000000000000000000000000000000000000000000")],[BigInt("0x248d97d7f76283d63bec30e7a5876c11c06fca9b275c671c5e33d95bb7e8d729"),BigInt("0x0000000000000000000000000000000000000000000000000000000000000000"),BigInt("0x0000000000000000000000000000000000000000000000000000000000000000"),BigInt("0x0000000000000000000000000000000000000000000000000000000000000000")],[BigInt("0x1a306d439d463b0816fc6fd64cc939318b45eb759ddde4aa106d15d9bd9baaaa"),BigInt("0x0000000000000000000000000000000000000000000000000000000000000000"),BigInt("0x0000000000000000000000000000000000000000000000000000000000000000"),BigInt("0x0000000000000000000000000000000000000000000000000000000000000000")],[BigInt("0x28a8f8372e3c38daced7c00421cb4621f4f1b54ddc27821b0d62d3d6ec7c56cf"),BigInt("0x0000000000000000000000000000000000000000000000000000000000000000"),BigInt("0x0000000000000000000000000000000000000000000000000000000000000000"),BigInt("0x0000000000000000000000000000000000000000000000000000000000000000")],[BigInt("0x0094975717f9a8a8bb35152f24d43294071ce320c829f388bc852183e1e2ce7e"),BigInt("0x0000000000000000000000000000000000000000000000000000000000000000"),BigInt("0x0000000000000000000000000000000000000000000000000000000000000000"),BigInt("0x0000000000000000000000000000000000000000000000000000000000000000")],[BigInt("0x04d5ee4c3aa78f7d80fde60d716480d3593f74d4f653ae83f4103246db2e8d65"),BigInt("0x0000000000000000000000000000000000000000000000000000000000000000"),BigInt("0x0000000000000000000000000000000000000000000000000000000000000000"),BigInt("0x0000000000000000000000000000000000000000000000000000000000000000")],[BigInt("0x2a6cf5e9aa03d4336349ad6fb8ed2269c7bef54b8822cc76d08495c12efde187"),BigInt("0x0000000000000000000000000000000000000000000000000000000000000000"),BigInt("0x0000000000000000000000000000000000000000000000000000000000000000"),BigInt("0x0000000000000000000000000000000000000000000000000000000000000000")],[BigInt("0x2304d31eaab960ba9274da43e19ddeb7f792180808fd6e43baae48d7efcba3f3"),BigInt("0x0000000000000000000000000000000000000000000000000000000000000000"),BigInt("0x0000000000000000000000000000000000000000000000000000000000000000"),BigInt("0x0000000000000000000000000000000000000000000000000000000000000000")],[BigInt("0x03fd9ac865a4b2a6d5e7009785817249bff08a7e0726fcb4e1c11d39d199f0b0"),BigInt("0x0000000000000000000000000000000000000000000000000000000000000000"),BigInt("0x0000000000000000000000000000000000000000000000000000000000000000"),BigInt("0x0000000000000000000000000000000000000000000000000000000000000000")],[BigInt("0x00b7258ded52bbda2248404d55ee5044798afc3a209193073f7954d4d63b0b64"),BigInt("0x0000000000000000000000000000000000000000000000000000000000000000"),BigInt("0x0000000000000000000000000000000000000000000000000000000000000000"),BigInt("0x0000000000000000000000000000000000000000000000000000000000000000")],[BigInt("0x159f81ada0771799ec38fca2d4bf65ebb13d3a74f3298db36272c5ca65e92d9a"),BigInt("0x0000000000000000000000000000000000000000000000000000000000000000"),BigInt("0x0000000000000000000000000000000000000000000000000000000000000000"),BigInt("0x0000000000000000000000000000000000000000000000000000000000000000")],[BigInt("0x1ef90e67437fbc8550237a75bc28e3bb9000130ea25f0c5471e144cf4264431f"),BigInt("0x0000000000000000000000000000000000000000000000000000000000000000"),BigInt("0x0000000000000000000000000000000000000000000000000000000000000000"),BigInt("0x0000000000000000000000000000000000000000000000000000000000000000")],[BigInt("0x1e65f838515e5ff0196b49aa41a2d2568df739bc176b08ec95a79ed82932e30d"),BigInt("0x0000000000000000000000000000000000000000000000000000000000000000"),BigInt("0x0000000000000000000000000000000000000000000000000000000000000000"),BigInt("0x0000000000000000000000000000000000000000000000000000000000000000")],[BigInt("0x2b1b045def3a166cec6ce768d079ba74b18c844e570e1f826575c1068c94c33f"),BigInt("0x0000000000000000000000000000000000000000000000000000000000000000"),BigInt("0x0000000000000000000000000000000000000000000000000000000000000000"),BigInt("0x0000000000000000000000000000000000000000000000000000000000000000")],[BigInt("0x0832e5753ceb0ff6402543b1109229c165dc2d73bef715e3f1c6e07c168bb173"),BigInt("0x0000000000000000000000000000000000000000000000000000000000000000"),BigInt("0x0000000000000000000000000000000000000000000000000000000000000000"),BigInt("0x0000000000000000000000000000000000000000000000000000000000000000")],[BigInt("0x02f614e9cedfb3dc6b762ae0a37d41bab1b841c2e8b6451bc5a8e3c390b6ad16"),BigInt("0x0000000000000000000000000000000000000000000000000000000000000000"),BigInt("0x0000000000000000000000000000000000000000000000000000000000000000"),BigInt("0x0000000000000000000000000000000000000000000000000000000000000000")],[BigInt("0x0e2427d38bd46a60dd640b8e362cad967370ebb777bedff40f6a0be27e7ed705"),BigInt("0x0000000000000000000000000000000000000000000000000000000000000000"),BigInt("0x0000000000000000000000000000000000000000000000000000000000000000"),BigInt("0x0000000000000000000000000000000000000000000000000000000000000000")],[BigInt("0x0493630b7c670b6deb7c84d414e7ce79049f0ec098c3c7c50768bbe29214a53a"),BigInt("0x0000000000000000000000000000000000000000000000000000000000000000"),BigInt("0x0000000000000000000000000000000000000000000000000000000000000000"),BigInt("0x0000000000000000000000000000000000000000000000000000000000000000")],[BigInt("0x22ead100e8e482674decdab17066c5a26bb1515355d5461a3dc06cc85327cea9"),BigInt("0x0000000000000000000000000000000000000000000000000000000000000000"),BigInt("0x0000000000000000000000000000000000000000000000000000000000000000"),BigInt("0x0000000000000000000000000000000000000000000000000000000000000000")],[BigInt("0x25b3e56e655b42cdaae2626ed2554d48583f1ae35626d04de5084e0b6d2a6f16"),BigInt("0x0000000000000000000000000000000000000000000000000000000000000000"),BigInt("0x0000000000000000000000000000000000000000000000000000000000000000"),BigInt("0x0000000000000000000000000000000000000000000000000000000000000000")],[BigInt("0x1e32752ada8836ef5837a6cde8ff13dbb599c336349e4c584b4fdc0a0cf6f9d0"),BigInt("0x0000000000000000000000000000000000000000000000000000000000000000"),BigInt("0x0000000000000000000000000000000000000000000000000000000000000000"),BigInt("0x0000000000000000000000000000000000000000000000000000000000000000")],[BigInt("0x2fa2a871c15a387cc50f68f6f3c3455b23c00995f05078f672a9864074d412e5"),BigInt("0x0000000000000000000000000000000000000000000000000000000000000000"),BigInt("0x0000000000000000000000000000000000000000000000000000000000000000"),BigInt("0x0000000000000000000000000000000000000000000000000000000000000000")],[BigInt("0x2f569b8a9a4424c9278e1db7311e889f54ccbf10661bab7fcd18e7c7a7d83505"),BigInt("0x0000000000000000000000000000000000000000000000000000000000000000"),BigInt("0x0000000000000000000000000000000000000000000000000000000000000000"),BigInt("0x0000000000000000000000000000000000000000000000000000000000000000")],[BigInt("0x044cb455110a8fdd531ade530234c518a7df93f7332ffd2144165374b246b43d"),BigInt("0x0000000000000000000000000000000000000000000000000000000000000000"),BigInt("0x0000000000000000000000000000000000000000000000000000000000000000"),BigInt("0x0000000000000000000000000000000000000000000000000000000000000000")],[BigInt("0x227808de93906d5d420246157f2e42b191fe8c90adfe118178ddc723a5319025"),BigInt("0x0000000000000000000000000000000000000000000000000000000000000000"),BigInt("0x0000000000000000000000000000000000000000000000000000000000000000"),BigInt("0x0000000000000000000000000000000000000000000000000000000000000000")],[BigInt("0x02fcca2934e046bc623adead873579865d03781ae090ad4a8579d2e7a6800355"),BigInt("0x0000000000000000000000000000000000000000000000000000000000000000"),BigInt("0x0000000000000000000000000000000000000000000000000000000000000000"),BigInt("0x0000000000000000000000000000000000000000000000000000000000000000")],[BigInt("0x0ef915f0ac120b876abccceb344a1d36bad3f3c5ab91a8ddcbec2e060d8befac"),BigInt("0x0000000000000000000000000000000000000000000000000000000000000000"),BigInt("0x0000000000000000000000000000000000000000000000000000000000000000"),BigInt("0x0000000000000000000000000000000000000000000000000000000000000000")],[BigInt("0x1797130f4b7a3e1777eb757bc6f287f6ab0fb85f6be63b09f3b16ef2b1405d38"),BigInt("0x0a76225dc04170ae3306c85abab59e608c7f497c20156d4d36c668555decc6e5"),BigInt("0x1fffb9ec1992d66ba1e77a7b93209af6f8fa76d48acb664796174b5326a31a5c"),BigInt("0x25721c4fc15a3f2853b57c338fa538d85f8fbba6c6b9c6090611889b797b9c5f")],[BigInt("0x0c817fd42d5f7a41215e3d07ba197216adb4c3790705da95eb63b982bfcaf75a"),BigInt("0x13abe3f5239915d39f7e13c2c24970b6df8cf86ce00a22002bc15866e52b5a96"),BigInt("0x2106feea546224ea12ef7f39987a46c85c1bc3dc29bdbd7a92cd60acb4d391ce"),BigInt("0x21ca859468a746b6aaa79474a37dab49f1ca5a28c748bc7157e1b3345bb0f959")],[BigInt("0x05ccd6255c1e6f0c5cf1f0df934194c62911d14d0321662a8f1a48999e34185b"),BigInt("0x0f0e34a64b70a626e464d846674c4c8816c4fb267fe44fe6ea28678cb09490a4"),BigInt("0x0558531a4e25470c6157794ca36d0e9647dbfcfe350d64838f5b1a8a2de0d4bf"),BigInt("0x09d3dca9173ed2faceea125157683d18924cadad3f655a60b72f5864961f1455")],[BigInt("0x0328cbd54e8c0913493f866ed03d218bf23f92d68aaec48617d4c722e5bd4335"),BigInt("0x2bf07216e2aff0a223a487b1a7094e07e79e7bcc9798c648ee3347dd5329d34b"),BigInt("0x1daf345a58006b736499c583cb76c316d6f78ed6a6dffc82111e11a63fe412df"),BigInt("0x176563472456aaa746b694c60e1823611ef39039b2edc7ff391e6f2293d2c404")]];var bA=new u0(BigInt("21888242871839275222246405745257275088548364400416034343698204186575808495617")),lf=null;function Wt(){return lf||(lf=new f0(cf(4,5,8,56,Fy,Uy,Ly),bA)),lf}Wt().primeField;Wt().permute.bind(Wt());var Hy;(function(t){t[t.ABSORB=0]="ABSORB",t[t.SQUEEZE=1]="SQUEEZE";})(Hy||(Hy={}));var SA=Wt().primeField,xA=Wt().permute.bind(Wt()),xr;(function(t){t[t.ABSORB=0]="ABSORB",t[t.SQUEEZE=1]="SQUEEZE";})(xr||(xr={}));var df=class t{constructor(e=0n){this.rate=Wt().getT()-1,this.t=Wt().getT(),this.state=new Array(this.t).fill(0n),this.state[this.rate]=e,this.cache=new Array(this.rate).fill(0n),this.cacheSize=0,this.mode=xr.ABSORB;}async performDuplex(){for(let e=this.cacheSize;e<this.rate;e++)this.cache[e]=0n;for(let e=0;e<this.rate;e++)this.state[e]=SA.add(this.state[e],this.cache[e]);return this.state=xA(this.state),await Promise.resolve(),this.state.slice(0,this.rate)}async absorb(e){this.mode===xr.ABSORB&&this.cacheSize===this.rate?(await this.performDuplex(),this.cache[0]=e,this.cacheSize=1):this.mode===xr.ABSORB&&this.cacheSize<this.rate?(this.cache[this.cacheSize]=e,this.cacheSize+=1):this.mode===xr.SQUEEZE&&(this.cache[0]=e,this.cacheSize=1,this.mode=xr.ABSORB);}async squeeze(){if(this.mode===xr.SQUEEZE&&this.cacheSize===0&&(this.mode=xr.ABSORB,this.cacheSize=0),this.mode===xr.ABSORB){let r=await this.performDuplex();this.mode=xr.SQUEEZE;for(let i=0;i<this.rate;i++)this.cache[i]=r[i];this.cacheSize=this.rate;}let e=this.cache[0];for(let r=1;r<this.cacheSize;r++)this.cache[r-1]=this.cache[r];return this.cacheSize-=1,this.cache[this.cacheSize]=0n,e}static async hashInternal(e,r,i){let n=(BigInt(e.length)<<64n)+BigInt(r-1),o=new t(n),s=100;for(let l=0;l<e.length;l+=s){let c=e.slice(l,Math.min(l+s,e.length));for(let d of c)await o.absorb(d);}i&&await o.absorb(1n);let a=[];for(let l=0;l<r;l++)a.push(await o.squeeze());return a}static async hashFixedLength(e,r=1){return this.hashInternal(e,r,false)}static async hashVariableLength(e,r=1){return this.hashInternal(e,r,true)}};async function Ee(t){return (await df.hashFixedLength(t))[0]}Wt().primeField;tt(X1(),1);tt(X1(),1);var a3="1.2.840.10045.4.1",c3="1.2.840.10045.4.3.1",l3="1.2.840.10045.4.3.2",d3="1.2.840.10045.4.3.3",u3="1.2.840.10045.4.3.4";function h0(t){return new W({algorithm:t})}h0(a3);h0(c3);h0(l3);h0(d3);h0(u3);var m0=class{constructor(e={}){f(this,"fieldType");f(this,"parameters");Object.assign(this,e);}};p([g({type:S.ObjectIdentifier})],m0.prototype,"fieldType",void 0);p([g({type:S.Any})],m0.prototype,"parameters",void 0);m0=p([M({type:k.Sequence})],m0);var Af=class extends oe{};var gs=class{constructor(e={}){f(this,"a");f(this,"b");f(this,"seed");Object.assign(this,e);}};p([g({type:S.OctetString})],gs.prototype,"a",void 0);p([g({type:S.OctetString})],gs.prototype,"b",void 0);p([g({type:S.BitString,optional:true})],gs.prototype,"seed",void 0);gs=p([M({type:k.Sequence})],gs);var _f;(function(t){t[t.ecpVer1=1]="ecpVer1";})(_f||(_f={}));var zr=class{constructor(e={}){f(this,"version",_f.ecpVer1);f(this,"fieldID");f(this,"curve");f(this,"base");f(this,"order");f(this,"cofactor");Object.assign(this,e);}};p([g({type:S.Integer})],zr.prototype,"version",void 0);p([g({type:m0})],zr.prototype,"fieldID",void 0);p([g({type:gs})],zr.prototype,"curve",void 0);p([g({type:Af})],zr.prototype,"base",void 0);p([g({type:S.Integer,converter:fe})],zr.prototype,"order",void 0);p([g({type:S.Integer,optional:true})],zr.prototype,"cofactor",void 0);zr=p([M({type:k.Sequence})],zr);var en=class{constructor(e={}){f(this,"namedCurve");f(this,"implicitCurve");f(this,"specifiedCurve");Object.assign(this,e);}};p([g({type:S.ObjectIdentifier})],en.prototype,"namedCurve",void 0);p([g({type:S.Null})],en.prototype,"implicitCurve",void 0);p([g({type:zr})],en.prototype,"specifiedCurve",void 0);en=p([M({type:k.Choice})],en);var ys=class{constructor(e={}){f(this,"version",1);f(this,"privateKey",new oe);f(this,"parameters");f(this,"publicKey");Object.assign(this,e);}};p([g({type:S.Integer})],ys.prototype,"version",void 0);p([g({type:oe})],ys.prototype,"privateKey",void 0);p([g({type:en,context:0,optional:true})],ys.prototype,"parameters",void 0);p([g({type:S.BitString,context:1,optional:true})],ys.prototype,"publicKey",void 0);var W1=class{constructor(e={}){f(this,"r",new ArrayBuffer(0));f(this,"s",new ArrayBuffer(0));Object.assign(this,e);}};p([g({type:S.Integer,converter:fe})],W1.prototype,"r",void 0);p([g({type:S.Integer,converter:fe})],W1.prototype,"s",void 0);var _t="1.2.840.113549.1.1",f3=`${_t}.1`,p3=`${_t}.7`,h3=`${_t}.9`,m3=`${_t}.10`,g3=`${_t}.2`,y3=`${_t}.4`,b3=`${_t}.5`;var S3=`${_t}.12`,x3=`${_t}.13`,Cf=`${_t}.15`,wf=`${_t}.16`,A3="1.3.14.3.2.26",_3="2.16.840.1.101.3.4.2.4",C3="2.16.840.1.101.3.4.2.1",w3="2.16.840.1.101.3.4.2.2",I3="2.16.840.1.101.3.4.2.3",v3="2.16.840.1.101.3.4.2.5",E3="2.16.840.1.101.3.4.2.6",B3="1.2.840.113549.2.2",T3="1.2.840.113549.2.5",bs=`${_t}.8`;function Ge(t){return new W({algorithm:t,parameters:null})}Ge(B3);Ge(T3);var gi=Ge(A3);Ge(_3);Ge(C3);Ge(w3);Ge(I3);Ge(v3);Ge(E3);var Z1=new W({algorithm:bs,parameters:$t.serialize(gi)}),If=new W({algorithm:h3,parameters:$t.serialize(is.toASN(new Uint8Array([218,57,163,238,94,107,75,13,50,85,191,239,149,96,24,144,175,216,7,9]).buffer))});Ge(f3);Ge(g3);Ge(y3);Ge(b3);Ge(Cf);Ge(wf);Ge(S3);Ge(x3);Ge(Cf);Ge(wf);var Ss=class{constructor(e={}){f(this,"hashAlgorithm",new W(gi));f(this,"maskGenAlgorithm",new W({algorithm:bs,parameters:$t.serialize(gi)}));f(this,"pSourceAlgorithm",new W(If));Object.assign(this,e);}};p([g({type:W,context:0,defaultValue:gi})],Ss.prototype,"hashAlgorithm",void 0);p([g({type:W,context:1,defaultValue:Z1})],Ss.prototype,"maskGenAlgorithm",void 0);p([g({type:W,context:2,defaultValue:If})],Ss.prototype,"pSourceAlgorithm",void 0);new W({algorithm:p3,parameters:$t.serialize(new Ss)});var tn=class{constructor(e={}){f(this,"hashAlgorithm",new W(gi));f(this,"maskGenAlgorithm",new W({algorithm:bs,parameters:$t.serialize(gi)}));f(this,"saltLength",20);f(this,"trailerField",1);Object.assign(this,e);}};p([g({type:W,context:0,defaultValue:gi})],tn.prototype,"hashAlgorithm",void 0);p([g({type:W,context:1,defaultValue:Z1})],tn.prototype,"maskGenAlgorithm",void 0);p([g({type:S.Integer,context:2,defaultValue:20})],tn.prototype,"saltLength",void 0);p([g({type:S.Integer,context:3,defaultValue:1})],tn.prototype,"trailerField",void 0);new W({algorithm:m3,parameters:$t.serialize(new tn)});var Y1=class{constructor(e={}){f(this,"digestAlgorithm",new W);f(this,"digest",new oe);Object.assign(this,e);}};p([g({type:W})],Y1.prototype,"digestAlgorithm",void 0);p([g({type:oe})],Y1.prototype,"digest",void 0);var vf,xs=class{constructor(e={}){f(this,"prime",new ArrayBuffer(0));f(this,"exponent",new ArrayBuffer(0));f(this,"coefficient",new ArrayBuffer(0));Object.assign(this,e);}};p([g({type:S.Integer,converter:fe})],xs.prototype,"prime",void 0);p([g({type:S.Integer,converter:fe})],xs.prototype,"exponent",void 0);p([g({type:S.Integer,converter:fe})],xs.prototype,"coefficient",void 0);var Q1=vf=class extends te{constructor(e){super(e),Object.setPrototypeOf(this,vf.prototype);}};Q1=vf=p([M({type:k.Sequence,itemType:xs})],Q1);var Yt=class{constructor(e={}){f(this,"version",0);f(this,"modulus",new ArrayBuffer(0));f(this,"publicExponent",new ArrayBuffer(0));f(this,"privateExponent",new ArrayBuffer(0));f(this,"prime1",new ArrayBuffer(0));f(this,"prime2",new ArrayBuffer(0));f(this,"exponent1",new ArrayBuffer(0));f(this,"exponent2",new ArrayBuffer(0));f(this,"coefficient",new ArrayBuffer(0));f(this,"otherPrimeInfos");Object.assign(this,e);}};p([g({type:S.Integer})],Yt.prototype,"version",void 0);p([g({type:S.Integer,converter:fe})],Yt.prototype,"modulus",void 0);p([g({type:S.Integer,converter:fe})],Yt.prototype,"publicExponent",void 0);p([g({type:S.Integer,converter:fe})],Yt.prototype,"privateExponent",void 0);p([g({type:S.Integer,converter:fe})],Yt.prototype,"prime1",void 0);p([g({type:S.Integer,converter:fe})],Yt.prototype,"prime2",void 0);p([g({type:S.Integer,converter:fe})],Yt.prototype,"exponent1",void 0);p([g({type:S.Integer,converter:fe})],Yt.prototype,"exponent2",void 0);p([g({type:S.Integer,converter:fe})],Yt.prototype,"coefficient",void 0);p([g({type:Q1,optional:true})],Yt.prototype,"otherPrimeInfos",void 0);var g0=class{constructor(e={}){f(this,"modulus",new ArrayBuffer(0));f(this,"publicExponent",new ArrayBuffer(0));Object.assign(this,e);}};p([g({type:S.Integer,converter:fe})],g0.prototype,"modulus",void 0);p([g({type:S.Integer,converter:fe})],g0.prototype,"publicExponent",void 0);var Ar=class{constructor(e={}){f(this,"issuer",new mt);f(this,"serialNumber",new ArrayBuffer(0));Object.assign(this,e);}};p([g({type:mt})],Ar.prototype,"issuer",void 0);p([g({type:S.Integer,converter:fe})],Ar.prototype,"serialNumber",void 0);var co=class{constructor(e={}){f(this,"subjectKeyIdentifier");f(this,"issuerAndSerialNumber");Object.assign(this,e);}};p([g({type:Sr,context:0,implicit:true})],co.prototype,"subjectKeyIdentifier",void 0);p([g({type:Ar})],co.prototype,"issuerAndSerialNumber",void 0);co=p([M({type:k.Choice})],co);var dt;(function(t){t[t.v0=0]="v0",t[t.v1=1]="v1",t[t.v2=2]="v2",t[t.v3=3]="v3",t[t.v4=4]="v4",t[t.v5=5]="v5";})(dt||(dt={}));var ut=class extends W{};ut=p([M({type:k.Sequence})],ut);var y0=class extends W{};y0=p([M({type:k.Sequence})],y0);var Ct=class extends W{};Ct=p([M({type:k.Sequence})],Ct);var b0=class extends W{};b0=p([M({type:k.Sequence})],b0);var k3=class extends W{};k3=p([M({type:k.Sequence})],k3);var J1=class extends W{};J1=p([M({type:k.Sequence})],J1);var yt=class{constructor(e={}){f(this,"attrType","");f(this,"attrValues",[]);Object.assign(this,e);}};p([g({type:S.ObjectIdentifier})],yt.prototype,"attrType",void 0);p([g({type:S.Any,repeated:"set"})],yt.prototype,"attrValues",void 0);var Ef,Qt=class{constructor(e={}){f(this,"version",dt.v0);f(this,"sid",new co);f(this,"digestAlgorithm",new ut);f(this,"signedAttrs");f(this,"signedAttrsRaw");f(this,"signatureAlgorithm",new y0);f(this,"signature",new oe);f(this,"unsignedAttrs");Object.assign(this,e);}};p([g({type:S.Integer})],Qt.prototype,"version",void 0);p([g({type:co})],Qt.prototype,"sid",void 0);p([g({type:ut})],Qt.prototype,"digestAlgorithm",void 0);p([g({type:yt,repeated:"set",context:0,implicit:true,optional:true,raw:true})],Qt.prototype,"signedAttrs",void 0);p([g({type:y0})],Qt.prototype,"signatureAlgorithm",void 0);p([g({type:oe})],Qt.prototype,"signature",void 0);p([g({type:yt,repeated:"set",context:1,implicit:true,optional:true})],Qt.prototype,"unsignedAttrs",void 0);var S0=Ef=class extends te{constructor(e){super(e),Object.setPrototypeOf(this,Ef.prototype);}};S0=Ef=p([M({type:k.Set,itemType:Qt})],S0);var P3=class extends Qt{};P3=p([M({type:k.Sequence})],P3);var N3=class extends Ue{};N3=p([M({type:k.Choice})],N3);var x0=class{constructor(e={}){f(this,"acIssuer",new ce);f(this,"acSerial",0);f(this,"attrs",[]);Object.assign(this,e);}};p([g({type:ce})],x0.prototype,"acIssuer",void 0);p([g({type:S.Integer})],x0.prototype,"acSerial",void 0);p([g({type:Hr,repeated:"sequence"})],x0.prototype,"attrs",void 0);var Bf,A0=Bf=class extends te{constructor(e){super(e),Object.setPrototypeOf(this,Bf.prototype);}};A0=Bf=p([M({type:k.Sequence,itemType:S.ObjectIdentifier})],A0);var As=class{constructor(e={}){f(this,"pathLenConstraint");f(this,"permittedAttrs");f(this,"excludedAttrs");f(this,"permitUnSpecified",true);Object.assign(this,e);}};p([g({type:S.Integer,optional:true})],As.prototype,"pathLenConstraint",void 0);p([g({type:A0,implicit:true,context:0,optional:true})],As.prototype,"permittedAttrs",void 0);p([g({type:A0,implicit:true,context:1,optional:true})],As.prototype,"excludedAttrs",void 0);p([g({type:S.Boolean,defaultValue:true})],As.prototype,"permitUnSpecified",void 0);var Jt=class{constructor(e={}){f(this,"issuer",new qe);f(this,"serial",new ArrayBuffer(0));f(this,"issuerUID",new ArrayBuffer(0));Object.assign(this,e);}};p([g({type:qe})],Jt.prototype,"issuer",void 0);p([g({type:S.Integer,converter:fe})],Jt.prototype,"serial",void 0);p([g({type:S.BitString,optional:true})],Jt.prototype,"issuerUID",void 0);var Tf;(function(t){t[t.publicKey=0]="publicKey",t[t.publicKeyCert=1]="publicKeyCert",t[t.otherObjectTypes=2]="otherObjectTypes";})(Tf||(Tf={}));var er=class{constructor(e={}){f(this,"digestedObjectType",Tf.publicKey);f(this,"otherObjectTypeID");f(this,"digestAlgorithm",new W);f(this,"objectDigest",new ArrayBuffer(0));Object.assign(this,e);}};p([g({type:S.Enumerated})],er.prototype,"digestedObjectType",void 0);p([g({type:S.ObjectIdentifier,optional:true})],er.prototype,"otherObjectTypeID",void 0);p([g({type:W})],er.prototype,"digestAlgorithm",void 0);p([g({type:S.BitString})],er.prototype,"objectDigest",void 0);var lo=class{constructor(e={}){f(this,"issuerName");f(this,"baseCertificateID");f(this,"objectDigestInfo");Object.assign(this,e);}};p([g({type:qe,optional:true})],lo.prototype,"issuerName",void 0);p([g({type:Jt,context:0,implicit:true,optional:true})],lo.prototype,"baseCertificateID",void 0);p([g({type:er,context:1,implicit:true,optional:true})],lo.prototype,"objectDigestInfo",void 0);var uo=class{constructor(e={}){f(this,"v1Form");f(this,"v2Form");Object.assign(this,e);}};p([g({type:ce,repeated:"sequence"})],uo.prototype,"v1Form",void 0);p([g({type:lo,context:0,implicit:true})],uo.prototype,"v2Form",void 0);uo=p([M({type:k.Choice})],uo);var fo=class{constructor(e={}){f(this,"notBeforeTime",new Date);f(this,"notAfterTime",new Date);Object.assign(this,e);}};p([g({type:S.GeneralizedTime})],fo.prototype,"notBeforeTime",void 0);p([g({type:S.GeneralizedTime})],fo.prototype,"notAfterTime",void 0);var rn=class{constructor(e={}){f(this,"baseCertificateID");f(this,"entityName");f(this,"objectDigestInfo");Object.assign(this,e);}};p([g({type:Jt,implicit:true,context:0,optional:true})],rn.prototype,"baseCertificateID",void 0);p([g({type:qe,implicit:true,context:1,optional:true})],rn.prototype,"entityName",void 0);p([g({type:er,implicit:true,context:2,optional:true})],rn.prototype,"objectDigestInfo",void 0);var kf;(function(t){t[t.v2=1]="v2";})(kf||(kf={}));var wt=class{constructor(e={}){f(this,"version",kf.v2);f(this,"holder",new rn);f(this,"issuer",new uo);f(this,"signature",new W);f(this,"serialNumber",new ArrayBuffer(0));f(this,"attrCertValidityPeriod",new fo);f(this,"attributes",[]);f(this,"issuerUniqueID");f(this,"extensions");Object.assign(this,e);}};p([g({type:S.Integer})],wt.prototype,"version",void 0);p([g({type:rn})],wt.prototype,"holder",void 0);p([g({type:uo})],wt.prototype,"issuer",void 0);p([g({type:W})],wt.prototype,"signature",void 0);p([g({type:S.Integer,converter:fe})],wt.prototype,"serialNumber",void 0);p([g({type:fo})],wt.prototype,"attrCertValidityPeriod",void 0);p([g({type:Hr,repeated:"sequence"})],wt.prototype,"attributes",void 0);p([g({type:S.BitString,optional:true})],wt.prototype,"issuerUniqueID",void 0);p([g({type:ds,optional:true})],wt.prototype,"extensions",void 0);var po=class{constructor(e={}){f(this,"acinfo",new wt);f(this,"signatureAlgorithm",new W);f(this,"signatureValue",new ArrayBuffer(0));Object.assign(this,e);}};p([g({type:wt})],po.prototype,"acinfo",void 0);p([g({type:W})],po.prototype,"signatureAlgorithm",void 0);p([g({type:S.BitString})],po.prototype,"signatureValue",void 0);var _0;(function(t){t[t.unmarked=1]="unmarked",t[t.unclassified=2]="unclassified",t[t.restricted=4]="restricted",t[t.confidential=8]="confidential",t[t.secret=16]="secret",t[t.topSecret=32]="topSecret";})(_0||(_0={}));var _s=class extends pi{};var Cs=class{constructor(e={}){f(this,"type","");f(this,"value",new ArrayBuffer(0));Object.assign(this,e);}};p([g({type:S.ObjectIdentifier,implicit:true,context:0})],Cs.prototype,"type",void 0);p([g({type:S.Any,implicit:true,context:1})],Cs.prototype,"value",void 0);var C0=class{constructor(e={}){f(this,"policyId","");f(this,"classList",new _s(_0.unclassified));f(this,"securityCategories");Object.assign(this,e);}};p([g({type:S.ObjectIdentifier})],C0.prototype,"policyId",void 0);p([g({type:_s,defaultValue:new _s(_0.unclassified)})],C0.prototype,"classList",void 0);p([g({type:Cs,repeated:"set"})],C0.prototype,"securityCategories",void 0);var ws=class{constructor(e={}){f(this,"cotets");f(this,"oid");f(this,"string");Object.assign(this,e);}};p([g({type:oe})],ws.prototype,"cotets",void 0);p([g({type:S.ObjectIdentifier})],ws.prototype,"oid",void 0);p([g({type:S.Utf8String})],ws.prototype,"string",void 0);var el=class{constructor(e={}){f(this,"policyAuthority");f(this,"values",[]);Object.assign(this,e);}};p([g({type:qe,implicit:true,context:0,optional:true})],el.prototype,"policyAuthority",void 0);p([g({type:ws,repeated:"sequence"})],el.prototype,"values",void 0);var Pf,Is=class{constructor(e={}){f(this,"targetCertificate",new Jt);f(this,"targetName");f(this,"certDigestInfo");Object.assign(this,e);}};p([g({type:Jt})],Is.prototype,"targetCertificate",void 0);p([g({type:ce,optional:true})],Is.prototype,"targetName",void 0);p([g({type:er,optional:true})],Is.prototype,"certDigestInfo",void 0);var vs=class{constructor(e={}){f(this,"targetName");f(this,"targetGroup");f(this,"targetCert");Object.assign(this,e);}};p([g({type:ce,context:0,implicit:true})],vs.prototype,"targetName",void 0);p([g({type:ce,context:1,implicit:true})],vs.prototype,"targetGroup",void 0);p([g({type:Is,context:2,implicit:true})],vs.prototype,"targetCert",void 0);vs=p([M({type:k.Choice})],vs);var tl=Pf=class extends te{constructor(e){super(e),Object.setPrototypeOf(this,Pf.prototype);}};tl=Pf=p([M({type:k.Sequence,itemType:vs})],tl);var Nf,D3=Nf=class extends te{constructor(e){super(e),Object.setPrototypeOf(this,Nf.prototype);}};D3=Nf=p([M({type:k.Sequence,itemType:tl})],D3);var rl=class{constructor(e={}){f(this,"roleAuthority");f(this,"roleName");Object.assign(this,e);}};p([g({type:qe,implicit:true,context:0,optional:true})],rl.prototype,"roleAuthority",void 0);p([g({type:ce,implicit:true,context:1})],rl.prototype,"roleName",void 0);var I0=class{constructor(e={}){f(this,"service",new ce);f(this,"ident",new ce);f(this,"authInfo");Object.assign(this,e);}};p([g({type:ce})],I0.prototype,"service",void 0);p([g({type:ce})],I0.prototype,"ident",void 0);p([g({type:oe,optional:true})],I0.prototype,"authInfo",void 0);var Df,v0=class{constructor(e={}){f(this,"otherCertFormat","");f(this,"otherCert",new ArrayBuffer(0));Object.assign(this,e);}};p([g({type:S.ObjectIdentifier})],v0.prototype,"otherCertFormat",void 0);p([g({type:S.Any})],v0.prototype,"otherCert",void 0);var Es=class{constructor(e={}){f(this,"certificate");f(this,"v2AttrCert");f(this,"other");Object.assign(this,e);}};p([g({type:Dt})],Es.prototype,"certificate",void 0);p([g({type:po,context:2,implicit:true})],Es.prototype,"v2AttrCert",void 0);p([g({type:v0,context:3,implicit:true})],Es.prototype,"other",void 0);Es=p([M({type:k.Choice})],Es);var Bs=Df=class extends te{constructor(e){super(e),Object.setPrototypeOf(this,Df.prototype);}};Bs=Df=p([M({type:k.Set,itemType:Es})],Bs);var E0=class{constructor(e={}){f(this,"contentType","");f(this,"content",new ArrayBuffer(0));Object.assign(this,e);}};p([g({type:S.ObjectIdentifier})],E0.prototype,"contentType",void 0);p([g({type:S.Any,context:0})],E0.prototype,"content",void 0);var B0=class{constructor(e={}){f(this,"single");f(this,"any");Object.assign(this,e);}};p([g({type:oe})],B0.prototype,"single",void 0);p([g({type:S.Any})],B0.prototype,"any",void 0);B0=p([M({type:k.Choice})],B0);var ho=class{constructor(e={}){f(this,"eContentType","");f(this,"eContent");Object.assign(this,e);}};p([g({type:S.ObjectIdentifier})],ho.prototype,"eContentType",void 0);p([g({type:B0,context:0,optional:true})],ho.prototype,"eContent",void 0);var T0=class{constructor(e={}){f(this,"value");f(this,"constructedValue");Object.assign(this,e);}};p([g({type:oe,context:0,implicit:true,optional:true})],T0.prototype,"value",void 0);p([g({type:oe,converter:gy,context:0,implicit:true,optional:true,repeated:"sequence"})],T0.prototype,"constructedValue",void 0);T0=p([M({type:k.Choice})],T0);var nn=class{constructor(e={}){f(this,"contentType","");f(this,"contentEncryptionAlgorithm",new b0);f(this,"encryptedContent");Object.assign(this,e);}};p([g({type:S.ObjectIdentifier})],nn.prototype,"contentType",void 0);p([g({type:b0})],nn.prototype,"contentEncryptionAlgorithm",void 0);p([g({type:T0,optional:true})],nn.prototype,"encryptedContent",void 0);var on=class{constructor(e={}){f(this,"keyAttrId","");f(this,"keyAttr");Object.assign(this,e);}};p([g({type:S.ObjectIdentifier})],on.prototype,"keyAttrId",void 0);p([g({type:S.Any,optional:true})],on.prototype,"keyAttr",void 0);var Rf,Ts=class{constructor(e={}){f(this,"subjectKeyIdentifier",new Sr);f(this,"date");f(this,"other");Object.assign(this,e);}};p([g({type:Sr})],Ts.prototype,"subjectKeyIdentifier",void 0);p([g({type:S.GeneralizedTime,optional:true})],Ts.prototype,"date",void 0);p([g({type:on,optional:true})],Ts.prototype,"other",void 0);var ks=class{constructor(e={}){f(this,"rKeyId");f(this,"issuerAndSerialNumber");Object.assign(this,e);}};p([g({type:Ts,context:0,implicit:true,optional:true})],ks.prototype,"rKeyId",void 0);p([g({type:Ar,optional:true})],ks.prototype,"issuerAndSerialNumber",void 0);ks=p([M({type:k.Choice})],ks);var k0=class{constructor(e={}){f(this,"rid",new ks);f(this,"encryptedKey",new oe);Object.assign(this,e);}};p([g({type:ks})],k0.prototype,"rid",void 0);p([g({type:oe})],k0.prototype,"encryptedKey",void 0);var il=Rf=class extends te{constructor(e){super(e),Object.setPrototypeOf(this,Rf.prototype);}};il=Rf=p([M({type:k.Sequence,itemType:k0})],il);var P0=class{constructor(e={}){f(this,"algorithm",new W);f(this,"publicKey",new ArrayBuffer(0));Object.assign(this,e);}};p([g({type:W})],P0.prototype,"algorithm",void 0);p([g({type:S.BitString})],P0.prototype,"publicKey",void 0);var mo=class{constructor(e={}){f(this,"subjectKeyIdentifier");f(this,"originatorKey");f(this,"issuerAndSerialNumber");Object.assign(this,e);}};p([g({type:Sr,context:0,implicit:true,optional:true})],mo.prototype,"subjectKeyIdentifier",void 0);p([g({type:P0,context:1,implicit:true,optional:true})],mo.prototype,"originatorKey",void 0);p([g({type:Ar,optional:true})],mo.prototype,"issuerAndSerialNumber",void 0);mo=p([M({type:k.Choice})],mo);var yi=class{constructor(e={}){f(this,"version",dt.v3);f(this,"originator",new mo);f(this,"ukm");f(this,"keyEncryptionAlgorithm",new Ct);f(this,"recipientEncryptedKeys",new il);Object.assign(this,e);}};p([g({type:S.Integer})],yi.prototype,"version",void 0);p([g({type:mo,context:0})],yi.prototype,"originator",void 0);p([g({type:oe,context:1,optional:true})],yi.prototype,"ukm",void 0);p([g({type:Ct})],yi.prototype,"keyEncryptionAlgorithm",void 0);p([g({type:il})],yi.prototype,"recipientEncryptedKeys",void 0);var Ps=class{constructor(e={}){f(this,"subjectKeyIdentifier");f(this,"issuerAndSerialNumber");Object.assign(this,e);}};p([g({type:Sr,context:0,implicit:true})],Ps.prototype,"subjectKeyIdentifier",void 0);p([g({type:Ar})],Ps.prototype,"issuerAndSerialNumber",void 0);Ps=p([M({type:k.Choice})],Ps);var sn=class{constructor(e={}){f(this,"version",dt.v0);f(this,"rid",new Ps);f(this,"keyEncryptionAlgorithm",new Ct);f(this,"encryptedKey",new oe);Object.assign(this,e);}};p([g({type:S.Integer})],sn.prototype,"version",void 0);p([g({type:Ps})],sn.prototype,"rid",void 0);p([g({type:Ct})],sn.prototype,"keyEncryptionAlgorithm",void 0);p([g({type:oe})],sn.prototype,"encryptedKey",void 0);var go=class{constructor(e={}){f(this,"keyIdentifier",new oe);f(this,"date");f(this,"other");Object.assign(this,e);}};p([g({type:oe})],go.prototype,"keyIdentifier",void 0);p([g({type:S.GeneralizedTime,optional:true})],go.prototype,"date",void 0);p([g({type:on,optional:true})],go.prototype,"other",void 0);var an=class{constructor(e={}){f(this,"version",dt.v4);f(this,"kekid",new go);f(this,"keyEncryptionAlgorithm",new Ct);f(this,"encryptedKey",new oe);Object.assign(this,e);}};p([g({type:S.Integer})],an.prototype,"version",void 0);p([g({type:go})],an.prototype,"kekid",void 0);p([g({type:Ct})],an.prototype,"keyEncryptionAlgorithm",void 0);p([g({type:oe})],an.prototype,"encryptedKey",void 0);var cn=class{constructor(e={}){f(this,"version",dt.v0);f(this,"keyDerivationAlgorithm");f(this,"keyEncryptionAlgorithm",new Ct);f(this,"encryptedKey",new oe);Object.assign(this,e);}};p([g({type:S.Integer})],cn.prototype,"version",void 0);p([g({type:J1,context:0,optional:true})],cn.prototype,"keyDerivationAlgorithm",void 0);p([g({type:Ct})],cn.prototype,"keyEncryptionAlgorithm",void 0);p([g({type:oe})],cn.prototype,"encryptedKey",void 0);var N0=class{constructor(e={}){f(this,"oriType","");f(this,"oriValue",new ArrayBuffer(0));Object.assign(this,e);}};p([g({type:S.ObjectIdentifier})],N0.prototype,"oriType",void 0);p([g({type:S.Any})],N0.prototype,"oriValue",void 0);var bi=class{constructor(e={}){f(this,"ktri");f(this,"kari");f(this,"kekri");f(this,"pwri");f(this,"ori");Object.assign(this,e);}};p([g({type:sn,optional:true})],bi.prototype,"ktri",void 0);p([g({type:yi,context:1,implicit:true,optional:true})],bi.prototype,"kari",void 0);p([g({type:an,context:2,implicit:true,optional:true})],bi.prototype,"kekri",void 0);p([g({type:cn,context:3,implicit:true,optional:true})],bi.prototype,"pwri",void 0);p([g({type:N0,context:4,implicit:true,optional:true})],bi.prototype,"ori",void 0);bi=p([M({type:k.Choice})],bi);var Of,D0=Of=class extends te{constructor(e){super(e),Object.setPrototypeOf(this,Of.prototype);}};D0=Of=p([M({type:k.Set,itemType:bi})],D0);var Mf,Ns=class{constructor(e={}){f(this,"otherRevInfoFormat","");f(this,"otherRevInfo",new ArrayBuffer(0));Object.assign(this,e);}};p([g({type:S.ObjectIdentifier})],Ns.prototype,"otherRevInfoFormat",void 0);p([g({type:S.Any})],Ns.prototype,"otherRevInfo",void 0);var nl=class{constructor(e={}){f(this,"other",new Ns);Object.assign(this,e);}};p([g({type:Ns,context:1,implicit:true})],nl.prototype,"other",void 0);nl=p([M({type:k.Choice})],nl);var Ds=Mf=class extends te{constructor(e){super(e),Object.setPrototypeOf(this,Mf.prototype);}};Ds=Mf=p([M({type:k.Set,itemType:nl})],Ds);var Rs=class{constructor(e={}){f(this,"certs");f(this,"crls");Object.assign(this,e);}};p([g({type:Bs,context:0,implicit:true,optional:true})],Rs.prototype,"certs",void 0);p([g({type:Ds,context:1,implicit:true,optional:true})],Rs.prototype,"crls",void 0);var Ff,Uf=Ff=class extends te{constructor(e){super(e),Object.setPrototypeOf(this,Ff.prototype);}};Uf=Ff=p([M({type:k.Set,itemType:yt})],Uf);var yo=class{constructor(e={}){f(this,"version",dt.v0);f(this,"originatorInfo");f(this,"recipientInfos",new D0);f(this,"encryptedContentInfo",new nn);f(this,"unprotectedAttrs");Object.assign(this,e);}};p([g({type:S.Integer})],yo.prototype,"version",void 0);p([g({type:Rs,context:0,implicit:true,optional:true})],yo.prototype,"originatorInfo",void 0);p([g({type:D0})],yo.prototype,"recipientInfos",void 0);p([g({type:nn})],yo.prototype,"encryptedContentInfo",void 0);p([g({type:Uf,context:1,implicit:true,optional:true})],yo.prototype,"unprotectedAttrs",void 0);var Lf,ol=Lf=class extends te{constructor(e){super(e),Object.setPrototypeOf(this,Lf.prototype);}};ol=Lf=p([M({type:k.Set,itemType:ut})],ol);var Si=class{constructor(e={}){f(this,"version",dt.v0);f(this,"digestAlgorithms",new ol);f(this,"encapContentInfo",new ho);f(this,"certificates");f(this,"crls");f(this,"signerInfos",new S0);Object.assign(this,e);}};p([g({type:S.Integer})],Si.prototype,"version",void 0);p([g({type:ol})],Si.prototype,"digestAlgorithms",void 0);p([g({type:ho})],Si.prototype,"encapContentInfo",void 0);p([g({type:Bs,context:0,implicit:true,optional:true})],Si.prototype,"certificates",void 0);p([g({type:Ds,context:1,implicit:true,optional:true})],Si.prototype,"crls",void 0);p([g({type:S0})],Si.prototype,"signerInfos",void 0);var o_=Nt.Point.Fp;o_.ORDER;var s_=Nt.Point.CURVE().n,a_=8n,c_=s_/a_,Os=Yo(c_,{BITS:249});Nt.Point.Fp;var ln={x:5299619240641551281634865583518297030282874472190772894086521144482721001553n,y:16950150798460657717958625567821834550301663161624707787222815936182638968203n};Nt.Point.fromAffine(ln);Nt.Point.fromAffine(ln);new TextEncoder().encode("FROST_2_NONCE_COMBINER");var z3=Object.defineProperty,h_=Object.getOwnPropertyDescriptor,m_=(t=>typeof _e<"u"?_e:typeof Proxy<"u"?new Proxy(t,{get:(e,r)=>(typeof _e<"u"?_e:e)[r]}):t)(function(t){if(typeof _e<"u")return _e.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')}),$3=(t,e)=>()=>(t&&(e=t(t=0)),e),g_=(t,e)=>{for(var r in e)z3(t,r,{get:e[r],enumerable:true});},It=(t,e,r,i)=>{for(var n=i>1?void 0:i?h_(e,r):e,o=t.length-1,s;o>=0;o--)(s=t[o])&&(n=(i?s(e,r,n):s(n))||n);return i&&n&&z3(e,r,n),n},xi,R0,hl=$3(()=>{xi={"P-192":{a:0xfffffffffffffffffffffffffffffffefffffffffffffffcn,b:0x64210519e59c80e70fa7e9ab72243049feb8deecc146b9b1n,n:0xffffffffffffffffffffffff99def836146bc9b1b4d22831n,p:0xfffffffffffffffffffffffffffffffeffffffffffffffffn},"P-224":{a:0xfffffffffffffffffffffffffffffffefffffffffffffffffffffffen,b:0xb4050a850c04b3abf54132565044b0b7d7bfd8ba270b39432355ffb4n,n:0xffffffffffffffffffffffffffff16a2e0b8f03e13dd29455c5c2a3dn,p:0xffffffffffffffffffffffffffffffff000000000000000000000001n},"P-256":{a:st.Point.CURVE().a,b:st.Point.CURVE().b,n:st.Point.CURVE().n,p:st.Point.CURVE().p},"P-384":{a:at.Point.CURVE().a,b:at.Point.CURVE().b,n:at.Point.CURVE().n,p:at.Point.CURVE().p},"P-521":{a:ct.Point.CURVE().a,b:ct.Point.CURVE().b,n:ct.Point.CURVE().n,p:ct.Point.CURVE().p}},R0={brainpoolP160r1:{a:0x340e7be2a280eb74e2be61bada745d97e8f7c300n,b:0x1e589a8595423412134faa2dbdec95c8d8675e58n,n:0xe95e4a5f737059dc60df5991d45029409e60fc09n,p:0xe95e4a5f737059dc60dfc7ad95b3d8139515620fn},brainpoolP160t1:{a:0xe95e4a5f737059dc60dfc7ad95b3d8139515620cn,b:0x7a556b6dae535b7b51ed2c4d7daa7a0b5c55f380n,n:0xe95e4a5f737059dc60df5991d45029409e60fc09n,p:0xe95e4a5f737059dc60dfc7ad95b3d8139515620fn},brainpoolP192r1:{a:0x6a91174076b1e0e19c39c031fe8685c1cae040e5c69a28efn,b:0x469a28ef7c28cca3dc721d044f4496bcca7ef4146fbf25c9n,n:0xc302f41d932a36cda7a3462f9e9e916b5be8f1029ac4acc1n,p:0xc302f41d932a36cda7a3463093d18db78fce476de1a86297n},brainpoolP192t1:{a:0xc302f41d932a36cda7a3463093d18db78fce476de1a86294n,b:0x13d56ffaec78681e68f9deb43b35bec2fb68542e27897b79n,n:0xc302f41d932a36cda7a3462f9e9e916b5be8f1029ac4acc1n,p:0xc302f41d932a36cda7a3463093d18db78fce476de1a86297n},brainpoolP224r1:{a:0x68a5e62ca9ce6c1c299803a6c1530b514e182ad8b0042a59cad29f43n,b:0x2580f63ccfe44138870713b1a92369e33e2135d266dbb372386c400bn,n:0xd7c134aa264366862a18302575d0fb98d116bc4b6ddebca3a5a7939fn,p:0xd7c134aa264366862a18302575d1d787b09f075797da89f57ec8c0ffn},brainpoolP224t1:{a:0xd7c134aa264366862a18302575d1d787b09f075797da89f57ec8c0fcn,b:0x4b337d934104cd7bef271bf60ced1ed20da14c08b3bb64f18a60888dn,n:0xd7c134aa264366862a18302575d0fb98d116bc4b6ddebca3a5a7939fn,p:0xd7c134aa264366862a18302575d1d787b09f075797da89f57ec8c0ffn},brainpoolP256r1:{a:0x7d5a0975fc2c3057eef67530417affe7fb8055c126dc5c6ce94a4b44f330b5d9n,b:0x26dc5c6ce94a4b44f330b5d9bbd77cbf958416295cf7e1ce6bccdc18ff8c07b6n,n:0xa9fb57dba1eea9bc3e660a909d838d718c397aa3b561a6f7901e0e82974856a7n,p:0xa9fb57dba1eea9bc3e660a909d838d726e3bf623d52620282013481d1f6e5377n},brainpoolP256t1:{a:0xa9fb57dba1eea9bc3e660a909d838d726e3bf623d52620282013481d1f6e5374n,b:0x662c61c430d84ea4fe66a7733d0b76b7bf93ebc4af2f49256ae58101fee92b04n,n:0xa9fb57dba1eea9bc3e660a909d838d718c397aa3b561a6f7901e0e82974856a7n,p:0xa9fb57dba1eea9bc3e660a909d838d726e3bf623d52620282013481d1f6e5377n},brainpoolP320r1:{a:0x3ee30b568fbab0f883ccebd46d3f3bb8a2a73513f5eb79da66190eb085ffa9f492f375a97d860eb4n,b:0x520883949dfdbc42d3ad198640688a6fe13f41349554b49acc31dccd884539816f5eb4ac8fb1f1a6n,n:0xd35e472036bc4fb7e13c785ed201e065f98fcfa5b68f12a32d482ec7ee8658e98691555b44c59311n,p:0xd35e472036bc4fb7e13c785ed201e065f98fcfa6f6f40def4f92b9ec7893ec28fcd412b1f1b32e27n},brainpoolP320t1:{a:0xd35e472036bc4fb7e13c785ed201e065f98fcfa6f6f40def4f92b9ec7893ec28fcd412b1f1b32e24n,b:0xa7f561e038eb1ed560b3d147db782013064c19f27ed27c6780aaf77fb8a547ceb5b4fef422340353n,n:0xd35e472036bc4fb7e13c785ed201e065f98fcfa5b68f12a32d482ec7ee8658e98691555b44c59311n,p:0xd35e472036bc4fb7e13c785ed201e065f98fcfa6f6f40def4f92b9ec7893ec28fcd412b1f1b32e27n},brainpoolP384r1:{a:0x7bc382c63d8c150c3c72080ace05afa0c2bea28e4fb22787139165efba91f90f8aa5814a503ad4eb04a8c7dd22ce2826n,b:0x4a8c7dd22ce28268b39b55416f0447c2fb77de107dcd2a62e880ea53eeb62d57cb4390295dbc9943ab78696fa504c11n,n:0x8cb91e82a3386d280f5d6f7e50e641df152f7109ed5456b31f166e6cac0425a7cf3ab6af6b7fc3103b883202e9046565n,p:0x8cb91e82a3386d280f5d6f7e50e641df152f7109ed5456b412b1da197fb71123acd3a729901d1a71874700133107ec53n},brainpoolP384t1:{a:0x8cb91e82a3386d280f5d6f7e50e641df152f7109ed5456b412b1da197fb71123acd3a729901d1a71874700133107ec50n,b:0x7f519eada7bda81bd826dba647910f8c4b9346ed8ccdc64e4b1abd11756dce1d2074aa263b88805ced70355a33b471een,n:0x8cb91e82a3386d280f5d6f7e50e641df152f7109ed5456b31f166e6cac0425a7cf3ab6af6b7fc3103b883202e9046565n,p:0x8cb91e82a3386d280f5d6f7e50e641df152f7109ed5456b412b1da197fb71123acd3a729901d1a71874700133107ec53n},brainpoolP512r1:{a:0x7830a3318b603b89e2327145ac234cc594cbdd8d3df91610a83441caea9863bc2ded5d5aa8253aa10a2ef1c98b9ac8b57f1117a72bf2c7b9e7c1ac4d77fc94can,b:0x3df91610a83441caea9863bc2ded5d5aa8253aa10a2ef1c98b9ac8b57f1117a72bf2c7b9e7c1ac4d77fc94cadc083e67984050b75ebae5dd2809bd638016f723n,n:0xaadd9db8dbe9c48b3fd4e6ae33c9fc07cb308db3b3c9d20ed6639cca70330870553e5c414ca92619418661197fac10471db1d381085ddaddb58796829ca90069n,p:0xaadd9db8dbe9c48b3fd4e6ae33c9fc07cb308db3b3c9d20ed6639cca703308717d4d9b009bc66842aecda12ae6a380e62881ff2f2d82c68528aa6056583a48f3n},brainpoolP512t1:{a:0xaadd9db8dbe9c48b3fd4e6ae33c9fc07cb308db3b3c9d20ed6639cca703308717d4d9b009bc66842aecda12ae6a380e62881ff2f2d82c68528aa6056583a48f3n,b:0x7cbbbcf9441cfab76e1890e46884eae321f70c0bcb4981527897504bec3e36a62bcdfa2304976540f6450085f2dae145c22553b465763689180ea2571867423en,n:0xaadd9db8dbe9c48b3fd4e6ae33c9fc07cb308db3b3c9d20ed6639cca70330870553e5c414ca92619418661197fac10471db1d381085ddaddb58796829ca90069n,p:0xaadd9db8dbe9c48b3fd4e6ae33c9fc07cb308db3b3c9d20ed6639cca703308717d4d9b009bc66842aecda12ae6a380e62881ff2f2d82c68528aa6056583a48f3n}};}),B_={};g_(B_,{verifyDscSignature:()=>U_,verifyDscSignatureWithTbs:()=>L_,verifyECDSASignature:()=>jf,verifyRSASignature:()=>Xf});function V3(t){return t<=192?["SHA-1","SHA-224","SHA-256","SHA-384","SHA-512"]:t<=256?["SHA-256","SHA-1","SHA-224","SHA-384","SHA-512"]:t<=384?["SHA-384","SHA-256","SHA-512","SHA-1","SHA-224"]:["SHA-512","SHA-384","SHA-256","SHA-1","SHA-224"]}function T_(t,e){if(t.length===e*2||t[0]!==48)return t;let r=t[1]===t.length-2?1:2,i=t[r];if(t[r+1]!==2||i!==t.length-r-1)return t;let n=t[r+2],o=t.slice(r+3,r+3+n);if(t[r+3+n]!==2)return t;let s=t[r+3+n+1],a=t.slice(r+3+n+2,r+3+n+2+s);for(;o.length>0&&o[0]===0;)o=o.slice(1);for(;a.length>0&&a[0]===0;)a=a.slice(1);let l=new Uint8Array(e),c=new Uint8Array(e);l.set(o,e-o.length),c.set(a,e-a.length);let d=new Uint8Array(e*2);return d.set(l,0),d.set(c,e),d}function jf(t,e,r){let i=X3[r.curve];if(!i)return false;try{let n=Math.ceil(r.key_size/8),o=T_(e,n),s=Buffer.from(r.public_key_x.replace("0x",""),"hex"),a=Buffer.from(r.public_key_y.replace("0x",""),"hex"),l=new Uint8Array(n),c=new Uint8Array(n);l.set(s,n-s.length),c.set(a,n-a.length);let d=new Uint8Array(1+n*2);return d[0]=4,d.set(l,1),d.set(c,1+n),i.verify(o,t,d,{prehash:!1,lowS:!1})}catch{return false}}async function Xf(t,e,r,i,n,o){try{if(W3.includes(n)){let s=P_();if(s)return await N_(t,r,i,n,o,s)}return D_(e,r,i,n,o)}catch{return false}}function k_(t){if(t===0)return new Uint8Array([0]);let e=[];for(;t>0;)e.unshift(t&255),t=t>>>8;return new Uint8Array(e)}function P_(){return typeof globalThis<"u"&&globalThis.crypto?.subtle?globalThis.crypto.subtle:typeof globalThis<"u"&&globalThis.crypto?.webcrypto?.subtle?globalThis.crypto.webcrypto.subtle:null}async function N_(t,e,r,i,n,o){let s=new Uint8Array(Buffer.from(r.modulus.replace("0x",""),"hex")),a=k_(r.exponent),l={kty:"RSA",n:O3(s),e:O3(a),alg:n?`PS${i.replace("SHA-","")}`:`RS${i.replace("SHA-","")}`,ext:true},c=n?{name:"RSA-PSS",hash:{name:i}}:{name:"RSASSA-PKCS1-v1_5",hash:{name:i}},d=n?{name:"RSA-PSS",saltLength:j3(i)}:{name:"RSASSA-PKCS1-v1_5"};try{let u=await o.importKey("jwk",l,c,!1,["verify"]),h=new Uint8Array(e).buffer,y=new Uint8Array(t).buffer;return await o.verify(d,u,h,y)}catch{return false}}function O3(t){return Buffer.from(t).toString("base64").replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function j3(t){switch(t){case "SHA-1":return 20;case "SHA-224":return 28;case "SHA-256":return 32;case "SHA-384":return 48;case "SHA-512":return 64;default:return 32}}function D_(t,e,r,i,n){try{let o=BigInt(r.modulus),s=BigInt(r.exponent),a=Math.ceil(r.key_size/8);if(e.length!==a)if(e.length<a){let h=new Uint8Array(a);h.set(e,a-e.length),e=h;}else return !1;let l=BigInt(0);for(let h of e)l=l<<BigInt(8)|BigInt(h);if(l>=o)return !1;let c=R_(l,s,o),d=new Uint8Array(a),u=c;for(let h=a-1;h>=0;h--)d[h]=Number(u&BigInt(255)),u=u>>BigInt(8);return n?M_(d,t,i,r.key_size):O_(d,t,i)}catch{return false}}function R_(t,e,r){if(r===BigInt(1))return BigInt(0);let i=BigInt(1);for(t=t%r;e>BigInt(0);)e%BigInt(2)===BigInt(1)&&(i=i*t%r),e=e>>BigInt(1),t=t*t%r;return i}function O_(t,e,r){if(t[0]!==0||t[1]!==1)return false;let i=2;for(;i<t.length&&t[i]===255;)i++;if(i-2<Y3||i>=t.length||t[i]!==0)return false;i++;let n=t.slice(i),o=Z3[r];if(M3(n,e,o))return true;let s=Q3[r];return !!M3(n,e,s)}function M3(t,e,r){if(t.length!==r.length+e.length)return false;let i=0;for(let n=0;n<r.length;n++)i|=t[n]^r[n];for(let n=0;n<e.length;n++)i|=t[r.length+n]^e[n];return i===0}function M_(t,e,r,i){let n=ml[r],o=j3(r),s=i-1,a=Math.ceil(s/8);if(a<o+2)return false;let l=t.length>a?t.slice(t.length-a):t;if(l.length<a||l[a-1]!==188)return false;let c=a-o-1,d=l.slice(0,c),u=l.slice(c,c+o),h=255>>8*a-s;if((d[0]&~h)!==0)return false;let y=F_(u,c,n),b=new Uint8Array(c);for(let N=0;N<c;N++)b[N]=d[N]^y[N];b[0]&=h;let x=-1;for(let N=0;N<c;N++)if(b[N]===1){x=N;break}else if(b[N]!==0)return false;if(x===-1)return false;let m=c-x-1;if(m<0)return false;let A=b.slice(x+1),_=new Uint8Array(8+o+m);_.set(e,8),m>0&&_.set(A,8+o);let w=n(_);if(u.length!==w.length)return false;let I=0;for(let N=0;N<u.length;N++)I|=u[N]^w[N];return I===0}function F_(t,e,r){let i=r(new Uint8Array(0)).length,n=new Uint8Array(e),o=0;for(let s=0;o<e;s++){let a=new Uint8Array(4);a[0]=s>>24&255,a[1]=s>>16&255,a[2]=s>>8&255,a[3]=s&255;let l=new Uint8Array(t.length+4);l.set(t),l.set(a,t.length);let c=r(l),d=Math.min(i,e-o);n.set(c.slice(0,d),o),o+=d;}return n}async function U_(t,e){let r=t.tbs.bytes.toUInt8Array(),i=t.signature.toUInt8Array(),n=e.public_key.type==="EC",o=e.signature_algorithm==="RSA-PSS",s=e.public_key.key_size,a=V3(s);for(let l of a){let c=ml[l];if(!c)continue;let d=c(r);if(n){let u=e.public_key;if(jf(d,i,u))return true}else {let u=e.public_key;if(await Xf(r,d,i,u,l,o))return true}}return false}async function L_(t,e,r){let i=r.public_key.type==="EC",n=r.signature_algorithm==="RSA-PSS",o=r.public_key.key_size,s=V3(o);for(let a of s){let l=ml[a];if(!l)continue;let c=l(t);if(i){let d=r.public_key;if(jf(c,e,d))return true}else {let d=r.public_key;if(await Xf(t,c,e,d,a,n))return true}}return false}var ml,F3,U3,L3,H3,K3,q3,X3,W3,Z3,Y3,Q3,H_=$3(()=>{hl(),ml={"SHA-1":Mn,"SHA-224":Nr,"SHA-256":rt,"SHA-384":Vo,"SHA-512":$o},F3={p:R0.brainpoolP224r1.p,a:R0.brainpoolP224r1.a,b:R0.brainpoolP224r1.b,n:R0.brainpoolP224r1.n,h:BigInt(1),Gx:BigInt("0xd9029ad2c7e5cf4340823b2a87dc68c9e4ce3174c1e6efdee12c07d"),Gy:BigInt("0x58aa56f772c0726f24c6b89e4ecdac24354b9e99caa3f6d3761402cd")},U3=Oe(Re(F3),Nr),L3={p:xi["P-192"].p,a:xi["P-192"].a,b:xi["P-192"].b,n:xi["P-192"].n,h:BigInt(1),Gx:BigInt("0x188da80eb03090f67cbf20eb43a18800f4ff0afd82ff1012"),Gy:BigInt("0x07192b95ffc8da78631011ed6b24cdd573f977a11e794811")},H3=Oe(Re(L3),Mn),K3={p:xi["P-224"].p,a:xi["P-224"].a,b:xi["P-224"].b,n:xi["P-224"].n,h:BigInt(1),Gx:BigInt("0xb70e0cbd6bb4bf7f321390b94a03c1d356c21122343280d6115c1d21"),Gy:BigInt("0xbd376388b5f723fb4c22dfe6cd4375a05a07476444d5819985007e34")},q3=Oe(Re(K3),Nr),X3={"P-192":H3,"P-224":q3,"P-256":st,"P-384":at,"P-521":ct,brainpoolP224r1:U3,brainpoolP256r1:Ag,brainpoolP384r1:_g,brainpoolP512r1:Cg},W3=["SHA-256","SHA-384","SHA-512"],Z3={"SHA-1":new Uint8Array([48,33,48,9,6,5,43,14,3,2,26,5,0,4,20]),"SHA-224":new Uint8Array([48,45,48,13,6,9,96,134,72,1,101,3,4,2,4,5,0,4,28]),"SHA-256":new Uint8Array([48,49,48,13,6,9,96,134,72,1,101,3,4,2,1,5,0,4,32]),"SHA-384":new Uint8Array([48,65,48,13,6,9,96,134,72,1,101,3,4,2,2,5,0,4,48]),"SHA-512":new Uint8Array([48,81,48,13,6,9,96,134,72,1,101,3,4,2,3,5,0,4,64])},Y3=8,Q3={"SHA-1":new Uint8Array([48,31,48,7,6,5,43,14,3,2,26,4,20]),"SHA-224":new Uint8Array([48,43,48,11,6,9,96,134,72,1,101,3,4,2,4,4,28]),"SHA-256":new Uint8Array([48,47,48,11,6,9,96,134,72,1,101,3,4,2,1,4,32]),"SHA-384":new Uint8Array([48,63,48,11,6,9,96,134,72,1,101,3,4,2,2,4,48]),"SHA-512":new Uint8Array([48,79,48,11,6,9,96,134,72,1,101,3,4,2,3,4,64])};});var ul=class ze{constructor(e){this.bytes=ze.convertToBytes(e);}static convertToBytes(e){if(typeof e=="bigint"||typeof e=="number"){let r=e.toString(16),i=r.padStart(Math.ceil(r.length/2)*2,"0");return new Uint8Array(i.match(/.{1,2}/g)?.map(n=>parseInt(n,16))||[])}if(e instanceof Uint8Array)return new Uint8Array(e);if(Buffer.isBuffer(e))return new Uint8Array(e);if(Array.isArray(e)){if(!e.every(r=>typeof r=="number"&&r>=0&&r<=255))throw new Error("Invalid byte array: values must be between 0 and 255");return new Uint8Array(e)}if(e instanceof ArrayBuffer)return new Uint8Array(e);if(typeof e=="string"){if(ze.isHexString(e)){let r=e.startsWith("0x")?e.slice(2):e,i=r.padStart(Math.ceil(r.length/2)*2,"0");return new Uint8Array(i.match(/.{1,2}/g)?.map(n=>parseInt(n,16))||[])}try{let r=BigInt(e);return ze.convertToBytes(r)}catch{return new Uint8Array(Buffer.from(e,"ascii"))}}throw new Error("Unsupported data type")}static isHexString(e){let r=e.startsWith("0x")?e.slice(2):e;return /^[0-9a-fA-F]*$/.test(r)}static from(e){return new ze(e)}static fromHex(e){if(!ze.isHexString(e))throw new Error("Invalid hex string");return new ze(e.startsWith("0x")?e:"0x"+e)}static fromBuffer(e){return new ze(e)}static fromBase64(e){let r=atob(e);return new ze(Uint8Array.from(r,i=>i.charCodeAt(0)))}static empty(){return new ze(new Uint8Array(0))}static zero(e){return new ze(new Uint8Array(e))}toBigInt(){return BigInt("0x"+this.toHex().slice(2))}toUInt8Array(){return new Uint8Array(this.bytes)}toNumberArray(){return Array.from(this.bytes)}toHex(){return "0x"+Array.from(this.bytes).map(e=>e.toString(16).padStart(2,"0")).join("")}toBuffer(){return Buffer.from(this.bytes)}toString(e="hex"){return e==="hex"?this.toHex().slice(2):Buffer.from(this.bytes).toString(e)}toBase64(){return btoa(String.fromCharCode(...this.bytes))}toJSON(){return this.toHex()}[Symbol.for("nodejs.util.inspect.custom")](){return `Binary(${this.toHex()})`}[Symbol.toPrimitive](e){switch(e){case "number":return Number(this.toBigInt());case "string":return `Binary(${this.toHex()})`;default:return this.toBigInt()}}valueOf(){return this.toBigInt()}get length(){return this.bytes.length}*[Symbol.iterator](){yield*this.bytes;}equals(e){return this.length!==e.length?false:this.bytes.every((r,i)=>r===e.bytes[i])}slice(e,r){return new ze(this.bytes.slice(e,r))}concat(e){return new ze([...this.toNumberArray(),...e.toNumberArray()])}[Symbol.for("+")](e){return this.concat(e)}compare(e){let r=Math.min(this.length,e.length);for(let i=0;i<r;i++){let n=this.bytes[i]-e.bytes[i];if(n!==0)return n}return this.length-e.length}xor(e){if(this.length!==e.length)throw new Error("Binary instances must be of equal length for XOR operation");let r=new Uint8Array(this.length);for(let i=0;i<this.length;i++)r[i]=this.bytes[i]^e.bytes[i];return new ze(r)}and(e){if(this.length!==e.length)throw new Error("Binary instances must be of equal length for AND operation");let r=new Uint8Array(this.length);for(let i=0;i<this.length;i++)r[i]=this.bytes[i]&e.bytes[i];return new ze(r)}or(e){if(this.length!==e.length)throw new Error("Binary instances must be of equal length for OR operation");let r=new Uint8Array(this.length);for(let i=0;i<this.length;i++)r[i]=this.bytes[i]|e.bytes[i];return new ze(r)}not(){let e=new Uint8Array(this.length);for(let r=0;r<this.length;r++)e[r]=~this.bytes[r]&255;return new ze(e)}padStart(e,r=0){if(this.length>=e)return this;let i=new Uint8Array(e);return i.fill(r,0,e-this.length),i.set(this.bytes,e-this.length),new ze(i)}padEnd(e,r=0){if(this.length>=e)return this;let i=new Uint8Array(e);return i.set(this.bytes),i.fill(r,this.length),new ze(i)}};var sl=0n,K_=BigInt("0x2523648240000001ba344d80000000086121000000000013a700000000000012"),q_=class O0{constructor(e,r){this.zeroes=[],this.layers=[],this.leaves=[],this.depth=e,this.hash=r;}static async create(e,r){return new O0(e,r)}get root(){return this.layers[this.depth]&&this.layers[this.depth][0]!==void 0?this.layers[this.depth][0]:this.zeroes[this.depth-1]??sl}async initializeAndSort(e){let r=Array.from(new Set(e.map(i=>BigInt(i)))).sort((i,n)=>i<n?-1:i>n?1:0);await this.initialize(r);}async initialize(e){let r=1<<this.depth;if(e.length>r)throw new Error(`Too many leaves for depth ${this.depth}: ${e.length} > ${r}`);e.unshift(0n),e.push(K_),this.leaves=e,await this.computeZeroes();let i=new Array(r);for(let n=0;n<r;n+=1)i[n]=e[n]??sl;this.layers=new Array(this.depth+1),this.layers[0]=i;for(let n=0;n<this.depth;n+=1){let o=this.layers[n],s=new Array(Math.ceil(o.length/2));for(let a=0;a<o.length;a+=2){let l=o[a]??this.zeroes[n],c=o[a+1]??this.zeroes[n];s[a>>1]=await this.hash([l,c]);}this.layers[n+1]=s;}}exists(e){let{exists:r}=this.findBoundaries(e);return r}createMembershipProof(e){let{exists:r,index:i}=this.findBoundaries(e);if(!r||i===null)throw new Error("Leaf not found");let n=[],o=i;for(let s=0;s<this.depth;s+=1){let a=o&1,l=a?o-1:o+1,c=this.layers[s][l]??this.zeroes[s];n.push(c),o>>=1;}return {root:this.root,leaf:e,leafIndex:i,siblings:n}}static async verifyMembershipProof(e,r){let i=e.leaf,n=e.leafIndex;for(let o=0;o<e.siblings.length;o+=1){let s=e.siblings[o],a=(n&1)===1;n>>=1,i=await r(a?[s,i]:[i,s]);}return i===e.root}createNonMembershipProof(e){let{exists:r,leftIndex:i,rightIndex:n}=this.findBoundaries(e);if(r)throw new Error("Target exists; use membership proof");let o=i!==null?{leaf:this.leaves[i],proof:this.createMembershipProof(this.leaves[i])}:void 0,s=n!==null?{leaf:this.leaves[n],proof:this.createMembershipProof(this.leaves[n])}:void 0;return {root:this.root,target:e,left:o,right:s}}static async verifyNonMembershipProof(e,r){return !(!e.left&&!e.right||e.left&&(!await O0.verifyMembershipProof(e.left.proof,r)||e.left.proof.root!==e.root||!(e.left.leaf<e.target))||e.right&&(!await O0.verifyMembershipProof(e.right.proof,r)||e.right.proof.root!==e.root||!(e.target<e.right.leaf))||e.left&&e.right&&(e.left.leaf>e.target||e.right.leaf<e.target||!(e.left.leaf<e.right.leaf)))}findBoundaries(e){let r=this.leaves.length;if(r===0)return {exists:false,index:null,leftIndex:null,rightIndex:null};let i=0,n=r;for(;i<n;){let c=i+n>>1;this.leaves[c]<e?i=c+1:n=c;}let o=i,s=o<r&&this.leaves[o]===e,a=o-1>=0?o-1:null,l=(s?o+1:o)<r?s?o+1:o:null;return {exists:s,index:s?o:null,leftIndex:a,rightIndex:l}}async computeZeroes(){this.zeroes=new Array(this.depth);let e=sl;for(let r=0;r<this.depth;r+=1)e=await this.hash([e,e]),this.zeroes[r]=e;}serialize(){return this.layers.map(e=>e.map(r=>`0x${r.toString(16).padStart(64,"0")}`))}async loadFromSerialized(e){if(!Array.isArray(e)||e.length===0)throw new Error("Invalid serialized tree: empty payload");let r=this.depth+1;if(e.length!==r)throw new Error(`Serialized tree depth mismatch: expected ${r} layers, got ${e.length}`);for(let o=0;o<e.length;o+=1){let s=e[o];if(!Array.isArray(s))throw new Error(`Invalid serialized tree: layer ${o} is not an array`);this.layers[o]=s.map(a=>BigInt(a));}for(let o=0;o<=this.depth;o+=1){let s=1<<this.depth-o,a=this.layers[o]?.length;if(a!==s)throw new Error(`Invalid serialized tree: layer ${o} length ${a} !== expected ${s}`)}if(this.layers[this.depth][0]===void 0)throw new Error("Invalid serialized tree: missing root");await this.computeZeroes();let i=this.layers[0],n=i.length;for(;n>0&&i[n-1]===sl;)n-=1;this.leaves=i.slice(0,n);}static async fromSerialized(e,r){let i=new O0(e.length-1,r);return await i.loadFromSerialized(e),i}};async function _r(t){return Ee(t.map(e=>BigInt(e)))}function z_(t){return BigInt("0x"+Buffer.from(t).toString("hex"))}function So(t,e){return t.concat(Array(e-t.length).fill(0))}function J3(t,e){return Array(e-t.length).fill(0).concat(t)}function M0(t,e,r=0){for(let i=r;i<t.length;i++)if(t.slice(i,i+e.length).every((n,o)=>n===e[o]))return i;return -1}function xo(t,e){let r=BigInt(0);for(let i=0;i<e;i++)r*=BigInt(256),r+=BigInt(t[i]);return r}function $_(t,e){let r=BigInt(0);for(let i=0;i<Math.min(e,t.length);i++)r*=BigInt(2),r+=BigInt(t[i]);return r}function e4(t,e){if(t.length===0)return [];let r=Math.ceil(t.length/e),i=new Array(r),n=t.length%e||e,o=0;for(let s=r-1;s>=0;s--){let a=s===r-1?n:e,l=0n;for(let d=0;d<a;d++)l=l<<8n|BigInt(t[o++]);let c=l.toString(16);i[s]="0x"+(c.length%2?"0":"")+c;}return i}function Ms(t){let e=[];for(let r=0;r<t.length;r++)e.push(BigInt(t.charCodeAt(r)));return e.map(r=>`0x${r.toString(16)}`)}var G3={ethereum:1,base:8453,arbitrum:42161,optimism:10,polygon:137,celo:42220,gnosis:100,scroll:534352,linea:59144,world_chain:480,ethereum_sepolia:11155111,base_sepolia:84532,arbitrum_sepolia:421614,polygon_amoy:80002,celo_sepolia:11142220,gnosis_chiado:10200,scroll_sepolia:534351,linea_sepolia:59141,world_chain_sepolia:4801,local:31337};function V_(t){if(!G3[t])throw new Error(`Unsupported chain: ${t}`);return G3[t]}function pe(t,e){return (typeof t=="string"||typeof t=="number")&&(t=new Date(t)),(typeof e=="string"||typeof e=="number")&&(e=new Date(e)),t.getFullYear()===e.getFullYear()&&t.getMonth()===e.getMonth()&&t.getDate()===e.getDate()}function dn(t){return typeof t=="string"||typeof t=="number"?new Date(t):t}function Wf(t){for(let e in t){let r=t[e];if((e==="birthdate"||e==="expiry_date")&&r&&typeof r=="object"){if("eq"in r&&r.eq&&(r.eq.expected=dn(r.eq.expected)),"gte"in r&&r.gte&&(r.gte.expected=dn(r.gte.expected)),"gt"in r&&r.gt&&(r.gt.expected=dn(r.gt.expected)),"lte"in r&&r.lte&&(r.lte.expected=dn(r.lte.expected)),"lt"in r&&r.lt&&(r.lt.expected=dn(r.lt.expected)),"range"in r&&r.range&&Array.isArray(r.range.expected)){let[i,n]=r.range.expected;r.range.expected=[dn(i),dn(n)];}"disclose"in r&&r.disclose&&(r.disclose.result=dn(r.disclose.result));}}return t}function Ie(t,e){return Tn(t.toString(16).padStart(e*2,"0"))}async function Us(t,e=3){let r;for(let i=0;i<=e;i++)try{return await t()}catch(n){if(r=n,i===e)throw n;let o=Math.min(100*Math.pow(2,i),5e3);await new Promise(s=>setTimeout(s,o));}throw r}var Le=(t=>(t[t.NON_SALTED=0]="NON_SALTED",t[t.SALTED=1]="SALTED",t[t.NON_SALTED_MOCK=2]="NON_SALTED_MOCK",t[t.SALTED_MOCK=3]="SALTED_MOCK",t[t.NONE=4]="NONE",t))(Le||{});function t4(t){return BigInt(t.publicInputs[0])}function r4(t){return BigInt(t.publicInputs[1])}function j_(){return 2}function i4(t){return BigInt(t.publicInputs[t.publicInputs.length-2])}function n4(t){return BigInt(t.publicInputs[t.publicInputs.length-1])}function X_(){return 2}function bo(t){return t==="D<<"?"DEU":t}function Hf(t){return t.replace(/^<+|<+$/g,"").replace(/</g," ")}function Ce(t){return t.replace(/<+/g," ").replace(/</g," ").replace(/\s+/g," ").replace(/[áàâäãå]/g,"a").replace(/[éèêë]/g,"e").replace(/[íìîï]/g,"i").replace(/[óòôöõ]/g,"o").replace(/[úùûü]/g,"u").replace(/[ñ]/g,"n").replace(/[ç]/g,"c").replace(/[æ]/g,"ae").replace(/[œ]/g,"oe").replace(/[ø]/g,"o").replace(/[æ]/g,"ae").replace(/[œ]/g,"oe").replace(/[ø]/g,"o").replace(/[^a-zA-Z ]/g,"").trim()}function Kf(t){return t.startsWith("P")?"passport":t==="IR"||t==="AR"?"residence_permit":t.startsWith("I")?"id_card":"other"}var Zf=class dl{constructor(e){this.issuingCountry=e.issuingCountry,this.nationality=e.nationality,this.documentType=e.documentType,this.documentNumber=e.documentNumber,this.dateOfExpiry=e.dateOfExpiry,this.dateOfBirth=e.dateOfBirth,this.name=e.name,this.gender=e.gender,this.firstName=e.firstName,this.lastName=e.lastName;}static fromDisclosedBytes(e,r){let i={issuingCountry:new Uint8Array(e.slice(2,5)),nationality:new Uint8Array(e.slice(r==="id_card"?45:54,r==="id_card"?48:57)),documentType:new Uint8Array(e.slice(0,2)),documentNumber:new Uint8Array(e.slice(r==="id_card"?5:44,r==="id_card"?14:53)),dateOfExpiry:new Uint8Array(e.slice(r==="id_card"?38:65,r==="id_card"?44:71)),dateOfBirth:new Uint8Array(e.slice(r==="id_card"?30:57,r==="id_card"?36:63)),name:new Uint8Array(e.slice(r==="id_card"?60:5,r==="id_card"?90:44)),gender:new Uint8Array(e.slice(r==="id_card"?37:64,r==="id_card"?38:65))},n=new TextDecoder,o=y=>n.decode(y).replace(/\0/g,""),s=i.name&&i.name.length>0?o(i.name):"",a=s.indexOf("<<"),l=a>=0?s.substring(0,a):"",c=a>=0?s.substring(a+2):"",d=c.indexOf("<"),u=d>=0?c.substring(0,d):c,h=c+" "+l;return new dl({issuingCountry:bo(o(i.issuingCountry)),nationality:bo(o(i.nationality)),documentType:Kf(o(i.documentType)),documentNumber:Hf(o(i.documentNumber)),dateOfExpiry:Fs(i.dateOfExpiry),dateOfBirth:Fs(i.dateOfBirth),name:Ce(h),firstName:Ce(u),lastName:Ce(l),gender:o(i.gender)})}static fromFlagsProof(e){let r=e.publicInputs.slice(3,93).map(y=>parseInt(y,16)),i={issuingCountry:new Uint8Array(r.slice(0,3)),nationality:new Uint8Array(r.slice(3,6)),documentType:new Uint8Array(r.slice(6,8)),documentNumber:new Uint8Array(r.slice(8,17)),dateOfExpiry:new Uint8Array(r.slice(17,23)),dateOfBirth:new Uint8Array(r.slice(23,29)),name:new Uint8Array(r.slice(29,68)),gender:new Uint8Array(r.slice(68,69))},n=new TextDecoder,o=y=>n.decode(y).replace(/\0/g,""),s=i.name&&i.name.length>0?o(i.name):"",a=s.indexOf("<<"),l=a>0?s.substring(0,a):"",c=a>0?s.substring(a+2):"",d=c.indexOf("<"),u=d>=0?c.substring(0,d):c,h=c+" "+l;return new dl({issuingCountry:bo(o(i.issuingCountry)),nationality:bo(o(i.nationality)),documentType:Kf(o(i.documentType)),documentNumber:Hf(o(i.documentNumber)),dateOfExpiry:Fs(i.dateOfExpiry),dateOfBirth:Fs(i.dateOfBirth),name:Ce(h),firstName:Ce(u),lastName:Ce(l),gender:o(i.gender)})}static fromBytesProof(e,r){let i=e.publicInputs.slice(93,182).map(b=>parseInt(b,16)),n={issuingCountry:new Uint8Array(i.slice(2,5)),nationality:new Uint8Array(i.slice(r==="id_card"?45:54,r==="id_card"?48:57)),documentType:new Uint8Array(i.slice(0,2)),documentNumber:new Uint8Array(i.slice(r==="id_card"?5:44,r==="id_card"?14:53)),dateOfExpiry:new Uint8Array(i.slice(r==="id_card"?38:65,r==="id_card"?44:71)),dateOfBirth:new Uint8Array(i.slice(r==="id_card"?30:57,r==="id_card"?36:63)),name:new Uint8Array(i.slice(r==="id_card"?60:5,r==="id_card"?90:44)),gender:new Uint8Array(i.slice(r==="id_card"?37:64,r==="id_card"?38:65))},o=new TextDecoder,s=b=>o.decode(b).replace(/\0/g,""),a=n.name&&n.name.length>0?s(n.name):"",l=a.indexOf("<<"),c=l>=0?a.substring(0,l):"",d=l>=0?a.substring(l+2):"",u=d.indexOf("<"),h=u>=0?d.substring(0,u):d,y=d+" "+c;return new dl({issuingCountry:bo(s(n.issuingCountry)),nationality:bo(s(n.nationality)),documentType:Kf(s(n.documentType)),documentNumber:Hf(s(n.documentNumber)),dateOfExpiry:Fs(n.dateOfExpiry),dateOfBirth:Fs(n.dateOfBirth),name:Ce(y),firstName:Ce(h),lastName:Ce(c),gender:s(n.gender)})}};function Fs(t){let e=new TextDecoder().decode(t).replace(/\0/g,""),r=parseInt(e.substring(0,2)),i=parseInt(e.substring(2,4))-1,n=parseInt(e.substring(4,6)),o=new Date().getFullYear(),s=Math.floor(o/100)*100,a=s-100,l=r+(r+s>o+10?a:s);return new Date(Date.UTC(l,i,n,0,0,0,0))}async function Yf(t,e){return await Ee([BigInt(0),BigInt(ie[0].standard),$_(t,253),...e4(new Uint8Array(e),31).map(r=>BigInt(r))])}async function o4(t,e){let r=rt(new Uint8Array([0,...Ie(ie[0].evm,2),...t.map(i=>Number(i)),...e.map(i=>Number(i))]));return xo(r,31)}function s4(t){return t.minAge}function a4(t){return t.maxAge}async function Qf(t,e){return await Ee([BigInt(1),BigInt(ie[1].standard),BigInt(t),BigInt(e)])}async function c4(t,e){let r=rt(new Uint8Array([1,...Ie(ie[1].evm,2),t,e]));return xo(r,31)}function W_(t){return t.charCodeAt(0)*65536+t.charCodeAt(1)*256+t.charCodeAt(2)}async function Ai(t,e,r=false){let i=e.map(o=>W_(o)),n=So(r?i.sort((o,s)=>o-s):i,200).map(o=>BigInt(o));return await Ee([BigInt(t),BigInt(ie[t].standard),...n])}async function F0(t,e,r=false){r&&e.sort((o,s)=>o.localeCompare(s));let i=e.map(o=>Array.from(new TextEncoder().encode(o))).flat(),n=rt(new Uint8Array([t,...Ie(ie[t].evm,2),...So(i,600)]));return xo(n,31)}var Ao=Math.floor(Math.abs(Date.UTC(1900,0,1,0,0,0))/1e3);function fl(t){return new Date(t.minDateTimestamp*1e3)}function pl(t){return new Date(t.maxDateTimestamp*1e3)}function l4(t,e=Ao){return fl(t).getTime()===0?new Date(0):new Date(fl(t).getTime()+e*1e3)}function d4(t,e=Ao){return pl(t).getTime()===0?new Date(0):new Date(pl(t).getTime()+e*1e3)}async function U0(t,e,r,i=Ao){return await Ee([BigInt(t),BigInt(ie[t].standard),t===2&&e!==0?BigInt(e)+BigInt(i):BigInt(e),t===2&&r!==0?BigInt(r)+BigInt(i):BigInt(r)])}async function Jf(t,e,r,i=Ao){let n=rt(new Uint8Array([t,...Ie(ie[t].evm,2),...Ie(t===2&&e!==0?e+i:e,8),...Ie(t===2&&r!==0?r+i:r,8)]));return xo(n,31)}function u4(t){return BigInt(t.publicInputs[0])}function f4(t){return BigInt(t.publicInputs[1])}function Z_(){return 2}var Y_=(t=>(t[t.USER_ADDRESS=1]="USER_ADDRESS",t[t.CHAIN_ID=2]="CHAIN_ID",t[t.CUSTOM_DATA=3]="CUSTOM_DATA",t))(Y_||{});function L0(t){let e=[];if(t.user_address&&t.user_address.length>0){let r=ul.fromHex(t.user_address).toNumberArray();e=[...e,1,...J3([r.length],2),...r];}if(t.chain){let r=V_(t.chain),i=ul.fromHex(r.toString(16)).toNumberArray();e=[...e,2,0,i.length,...i];}if(t.custom_data&&t.custom_data.length>0){let r=new TextEncoder().encode(t.custom_data);e=[...e,3,r.length>>8&255,r.length&255,...r];}if(e.length>509)throw new Error(`Data is too long: ${e.length} > 509`);return e}async function ep(t,e=509){let r=So(t,e);return await Ee([BigInt(8),BigInt(ie[8].standard),...e4(new Uint8Array(r),31).map(i=>BigInt(i))])}async function p4(t,e=509){let r=So(t,e),i=rt(new Uint8Array([8,...Ie(ie[8].evm,2),...r]));return xo(i,31)}var h4=8544227306600425492560068004835614964118871262589609739238120993689090208159n,m4=0x24d9929b248be7eeecaa98e105c034a50539610f3fdd4cb9c8983ef4100d615dn;async function tp(t,e,r,i){return await Ee([BigInt(10),BigInt(ie[10].standard),t,e,r,r===m4?h4:0n,i])}async function g4(t,e,r,i){let n=rt(new Uint8Array([10,...Ie(ie[10].evm,2),...Ie(t,32),...Ie(e,1),...Ie(r,32),...Ie(r===m4?h4:0n,32),...Ie(i,1)]));return xo(n,31)}function Cr(t){return BigInt(t.publicInputs[t.publicInputs.length-2])}function y4(t){return BigInt(t.publicInputs[t.publicInputs.length-1])}function wr(t){let e=BigInt(t.publicInputs[t.publicInputs.length-3]);if(e===0n)return 0;if(e===1n)return 1;if(e===2n)return 2;if(e===3n)return 3;if(e===4n)return 4;throw new Error("Invalid nullifier type")}function tr(t){return BigInt(t.publicInputs[4])}function rp(t){return BigInt(t.publicInputs[3])}function ip(t){return BigInt(t.publicInputs[2])}function rr(t){return BigInt(t.publicInputs[0])}function np(t){return new Date(Number(BigInt(t.publicInputs[1]))*1e3)}function Ls(t){return t.startsWith("data_check_integrity")?X_():t.startsWith("sig_check_id_data")?Z_():t.startsWith("sig_check_dsc")?j_():t.startsWith("oprf_auth")?3:t.startsWith("outer")?8+(Number(t.substring(t.lastIndexOf("_")+1))-3):8}function b4(t){let e=t.endsWith("evm")?3:2;switch(t){case "compare_age":return ie[1].standard+e;case "compare_age_evm":return ie[1].evm+e;case "compare_birthdate":return ie[2].standard+e;case "compare_birthdate_evm":return ie[2].evm+e;case "compare_expiry":return ie[3].standard+e;case "compare_expiry_evm":return ie[3].evm+e;case "disclose_bytes":return ie[0].standard+e;case "disclose_bytes_evm":return ie[0].evm+e;case "inclusion_check_issuing_country":return ie[6].standard+e;case "inclusion_check_issuing_country_evm":return ie[6].evm+e;case "inclusion_check_nationality":return ie[4].standard+e;case "inclusion_check_nationality_evm":return ie[4].evm+e;case "exclusion_check_issuing_country":return ie[7].standard+e;case "exclusion_check_issuing_country_evm":return ie[7].evm+e;case "exclusion_check_nationality":return ie[5].standard+e;case "exclusion_check_nationality_evm":return ie[5].evm+e;case "bind":return ie[8].standard+e;case "bind_evm":return ie[8].evm+e;case "exclusion_check_sanctions":return ie[9].standard+e;case "exclusion_check_sanctions_evm":return ie[9].evm+e;case "facematch":return ie[10].standard+e;case "facematch_evm":return ie[10].evm+e;default:throw new Error(`Unknown circuit name: ${t}`)}}var le=(t=>(t[t.DISCLOSE=0]="DISCLOSE",t[t.AGE=1]="AGE",t[t.BIRTHDATE=2]="BIRTHDATE",t[t.EXPIRY_DATE=3]="EXPIRY_DATE",t[t.NATIONALITY_INCLUSION=4]="NATIONALITY_INCLUSION",t[t.NATIONALITY_EXCLUSION=5]="NATIONALITY_EXCLUSION",t[t.ISSUING_COUNTRY_INCLUSION=6]="ISSUING_COUNTRY_INCLUSION",t[t.ISSUING_COUNTRY_EXCLUSION=7]="ISSUING_COUNTRY_EXCLUSION",t[t.BIND=8]="BIND",t[t.SANCTIONS_EXCLUSION=9]="SANCTIONS_EXCLUSION",t[t.FACEMATCH=10]="FACEMATCH",t))(le||{}),ie={0:{evm:180,standard:4},1:{evm:2,standard:2},2:{evm:16,standard:2},3:{evm:16,standard:2},4:{evm:600,standard:200},5:{evm:600,standard:200},6:{evm:600,standard:200},7:{evm:600,standard:200},8:{evm:509,standard:17},9:{evm:33,standard:2},10:{evm:98,standard:5}};hl();var S4=["North Korea","Iran","Iraq","Libya","Somalia","Sudan","Syrian Arab Republic","Yemen"],gl=["Austria","Belgium","Bulgaria","Croatia","Cyprus","Czech Republic","Denmark","Estonia","Finland","France","Germany","Greece","Hungary","Ireland","Italy","Latvia","Lithuania","Luxembourg","Malta","Netherlands","Poland","Portugal","Romania","Slovakia","Slovenia","Spain","Sweden"],x4=[...gl,"Iceland","Liechtenstein","Norway"],A4=[...gl.filter(t=>t!=="Cyprus"&&t!=="Ireland"),"Switzerland","Iceland","Liechtenstein","Norway"],_4=["Brunei Darussalam","Cambodia","Indonesia","Lao People's Democratic Republic","Malaysia","Myanmar","Philippines","Singapore","Thailand","Vietnam"],C4=["Argentina","Brazil","Chile","Colombia","Paraguay","Uruguay"];hl();var zf=class extends te{constructor(t){super(t),Object.setPrototypeOf(this,zf.prototype);}};zf=It([M({type:k.Set,itemType:yt})],zf);var $f=class{constructor(t={}){this.number=1,this.hash=new ArrayBuffer(0),Object.assign(this,t);}};It([g({type:S.Integer})],$f.prototype,"number",2),It([g({type:S.OctetString})],$f.prototype,"hash",2);var Vf=class{constructor(t={}){this.ldsVersion="",this.unicodeVersion="",Object.assign(this,t);}};It([g({type:S.PrintableString})],Vf.prototype,"ldsVersion",2),It([g({type:S.PrintableString})],Vf.prototype,"unicodeVersion",2);var qf=class{constructor(t){this.value="",t&&(typeof t=="string"?this.value=t:Object.assign(this,t));}};It([g({type:S.ObjectIdentifier})],qf.prototype,"value",2),qf=It([M({type:k.Choice})],qf);var al=class{constructor(t={}){this.version=1,this.hashAlgorithm=new ut,this.dataGroups=[],Object.assign(this,t);}};It([g({type:S.Integer})],al.prototype,"version",2),It([g({type:ut})],al.prototype,"hashAlgorithm",2),It([g({type:$f,repeated:"sequence"})],al.prototype,"dataGroups",2),It([g({type:Vf,optional:true})],al.prototype,"versionInfo",2);var cl=class{constructor(t={}){this.version=0,this.certificates=[],Object.assign(this,t);}};It([g({type:S.Integer})],cl.prototype,"version",2),It([g({type:Dt,repeated:"set"})],cl.prototype,"certificates",2),cl=It([M({type:k.Sequence})],cl);hl();function w4(t){let e=t?.mrz,r=e.length==90?60:5,i=M0(e.split(""),["<","<"],r)+2,n=false;i>0&&i<e.length&&e[i]==="<"&&(i=M0(e.split(""),["<"],r)+1,n=true);let o=M0(e.split(""),["<"],i);return [i-(n?1:2),o]}function I4(t){let e=t?.mrz,r=w4(t)[1]+1,i=M0(e.split(""),["<"],r);return [r-1,i]}function Q_(t){let e=t?.mrz,r=I4(t)[1]+1,i=M0(e.split(""),["<"],r);return [r-1,i]}function J_(t){let e=(t?.mrz).length==90;return [e?60:5,e?90:44]}function eC(t){let e=(t?.mrz).length==90;return [e?30:57,e?36:63]}function tC(t){let e=(t?.mrz).length==90;return [e?5:44,e?14:53]}function rC(t){let e=(t?.mrz).length==90;return [e?45:54,e?48:57]}function iC(t){let e=t?.mrz;return bo(e.slice(...rC(t)))}var nC=["https://eu.node0.zkp.oprf.taceo.network","https://eu.node1.zkp.oprf.taceo.network","https://eu.node2.zkp.oprf.taceo.network"],v4="1";Nt.Point.fromAffine(ln);Os.ORDER;async function E4(t,e){let r=nC,i;for(let n of r)try{let o=await fetch(`${n}/oprf_pub/${t}`);if(!o.ok)throw new Error(`OPRF node returned ${o.status}`);let{key:s}=await o.json();return {x:BigInt(s[0]),y:BigInt(s[1])}}catch(o){i=o instanceof Error?o:new Error(String(o));}throw new Error(`Failed to fetch OPRF public key for key ID ${t}: ${i?.message}`)}async function B4(t){return Ee([t.x,t.y])}var op=class T4{constructor(e){this.tree=e;}static async create(){let e=await Us(()=>fetch("https://cdn.zkpassport.id/sanctions/all_sanctions_tree.json.gz",{headers:{"Accept-Encoding":"gzip"}})).then(i=>i.json()),r=await q_.fromSerialized(e,_r);return new T4(r)}getRootHash(){return Buffer.from(this.tree.root.toString(16).padStart(64,"0"),"hex")}getRoot(){return `0x${this.tree.root.toString(16).padStart(64,"0")}`}async getSanctionsMerkleProofs(e,r){let{name1Hash:i,name2Hash:n,name3Hash:o,name1AndDOBHash:s,name2AndDOBHash:a,name3AndDOBHash:l,name1AndYobHash:c,name2AndYobHash:d,name3AndYobHash:u,documentNumberAndNationalityHash:h}=await sC(e),y=r?this.tree.createNonMembershipProof(i):this.tree.createNonMembershipProof(1n),b=r?this.tree.createNonMembershipProof(n):this.tree.createNonMembershipProof(1n),x=r?this.tree.createNonMembershipProof(o):this.tree.createNonMembershipProof(1n),m=this.tree.createNonMembershipProof(s),A=this.tree.createNonMembershipProof(a),_=this.tree.createNonMembershipProof(l),w=this.tree.createNonMembershipProof(c),I=this.tree.createNonMembershipProof(d),N=this.tree.createNonMembershipProof(u),H=this.tree.createNonMembershipProof(h),O=this.getRoot(),U={name_proofs:[y,b,x],name_and_dob_proofs:[m,A,_],name_and_yob_proofs:[w,I,N],passport_no_and_nationality_proof:H};return {proofs:{name_proofs:U.name_proofs.map(F=>ll(F)),name_and_dob_proofs:U.name_and_dob_proofs.map(F=>ll(F)),name_and_yob_proofs:U.name_and_yob_proofs.map(F=>ll(F)),passport_no_and_nationality_proof:ll(U.passport_no_and_nationality_proof)},root:O}}async getSanctionsEvmParameterCommitment(e){let r=this.getRootHash(),i=Array.from(r).map(s=>Number(s)),n=J3(i,32),o=rt(new Uint8Array([9,...Ie(ie[9].evm,2),...n,e?1:0]));return xo(o,31)}async getSanctionsParameterCommitment(e){let r=this.getRootHash();return await Ee([BigInt(9),BigInt(ie[9].standard),BigInt(`0x${r.toString("hex")}`),e?1n:0n])}};function ll(t){let e=t.left?.proof,r=t.right?.proof;return {left:{leaf:`0x${e?.leaf.toString(16).padStart(64,"0")}`,leaf_index:`0x${e?.leafIndex.toString(16).padStart(64,"0")}`,sibling_path:e?.siblings.map(i=>`0x${i.toString(16).padStart(64,"0")}`)??[]},right:{leaf:`0x${r?.leaf.toString(16).padStart(64,"0")}`,leaf_index:`0x${r?.leafIndex.toString(16).padStart(64,"0")}`,sibling_path:r?.siblings.map(i=>`0x${i.toString(16).padStart(64,"0")}`)??[]}}}function Gf(t){let e=t,r=t.match(/[A-Z]<<[A-Z]/)?.index??-1;return r<0&&(r=t.match(/[A-Z]<[A-Z]/)?.index??-1,r>=0&&(e=t.slice(0,r+1)+"<<"+t.slice(r+2,-1))),e}function oC(t){let[e,r]=J_(t),i=Math.min(w4(t)[1],r);i<0&&(i=r);let n=t.mrz.slice(e,i).padEnd(39,"<"),o=i===r?r:Math.min(I4(t)[1],r);o<0&&(o=r);let s=t.mrz.slice(e,o).padEnd(39,"<"),a=o===r?r:Math.min(Q_(t)[1],r);a<0&&(a=r);let l=t.mrz.slice(e,a).padEnd(39,"<");return [Gf(n),Gf(s),Gf(l)]}async function sC(t){let[e,r,i]=oC(t),n=Ms(e),o=Ms(r),s=Ms(i),a=await _r(n),l=await _r(o),c=await _r(s),d=Ms(t.mrz.slice(...eC(t))),u=Ms(t.mrz.slice(...tC(t))),h=Ms(iC(t)),y=[...n,...d],b=[...n,...d.slice(0,2)],x=[...o,...d],m=[...o,...d.slice(0,2)],A=[...s,...d],_=[...s,...d.slice(0,2)],w=[...u,...h],I=await _r(y),N=await _r(b),H=await _r(x),O=await _r(m),U=await _r(A),F=await _r(_),T=await _r(w);return {name1Hash:a,name2Hash:l,name3Hash:c,name1AndDOBHash:I,name1AndYobHash:N,name2AndDOBHash:H,name2AndYobHash:O,name3AndDOBHash:U,name3AndYobHash:F,documentNumberAndNationalityHash:T}}function Hs(t){if(!t)return 0n;let e=rt(new TextEncoder().encode(t)).slice(0,31);return z_(Array.from(e))}function H0(t){return Hs(t)}function aC(t,e=0){let r=[];for(let i=e;i<t.length;i+=32){let n=new Uint8Array(32),o=Math.min(i+32,t.length);for(let s=0;s<o-i;s++)n[s]=t[i+s];r.push(Buffer.from(n));}return r.map(i=>i.toString("hex"))}function cC(t,e){return t.slice(0,e)}function lC(t,e){return t.slice(e)}function Ks(t,e,r=0){let i=aC(Buffer.from(t,"hex"),r),n=lC(i,e),o=cC(i,e);return {proof:n,publicInputs:o.map(s=>s.startsWith("0x")?s:`0x${s}`)}}function k4(t){return BigInt(t.publicInputs[0])}function P4(t){return BigInt(t.publicInputs[1])}function N4(t){return new Date(Number(BigInt(t.publicInputs[2]))*1e3)}function sp(t){return BigInt(t.publicInputs[3])}function ap(t){return BigInt(t.publicInputs[4])}function D4(t){let e=BigInt(t.publicInputs[t.publicInputs.length-3]);if(e===0n)return 0;if(e===1n)return 1;if(e===2n)return 2;if(e===3n)return 3;if(e===4n)return 4;throw new Error("Invalid nullifier type")}function R4(t){return BigInt(t.publicInputs[t.publicInputs.length-2])}function O4(t){return BigInt(t.publicInputs[t.publicInputs.length-1])}function cp(t){return t.publicInputs.slice(5,t.publicInputs.length-3).map(BigInt)}if(typeof window>"u")try{let t=m_("crypto");crypto=t;}catch{}H_();var Ro=tt(X1(),1);var dC=Object.defineProperty,uC=Object.getOwnPropertyDescriptor,fC=(t=>typeof _e<"u"?_e:typeof Proxy<"u"?new Proxy(t,{get:(e,r)=>(typeof _e<"u"?_e:e)[r]}):t)(function(t){if(typeof _e<"u")return _e.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')}),L4=(t,e)=>()=>(t&&(e=t(t=0)),e),vt=(t,e,r,i)=>{for(var n=i>1?void 0:i?uC(e,r):e,o=t.length-1,s;o>=0;o--)(s=t[o])&&(n=(i?s(e,r,n):s(n))||n);return i&&n&&dC(e,r,n),n},_i,K0,Sl=L4(()=>{_i={"P-192":{a:0xfffffffffffffffffffffffffffffffefffffffffffffffcn,b:0x64210519e59c80e70fa7e9ab72243049feb8deecc146b9b1n,n:0xffffffffffffffffffffffff99def836146bc9b1b4d22831n,p:0xfffffffffffffffffffffffffffffffeffffffffffffffffn},"P-224":{a:0xfffffffffffffffffffffffffffffffefffffffffffffffffffffffen,b:0xb4050a850c04b3abf54132565044b0b7d7bfd8ba270b39432355ffb4n,n:0xffffffffffffffffffffffffffff16a2e0b8f03e13dd29455c5c2a3dn,p:0xffffffffffffffffffffffffffffffff000000000000000000000001n},"P-256":{a:st.Point.CURVE().a,b:st.Point.CURVE().b,n:st.Point.CURVE().n,p:st.Point.CURVE().p},"P-384":{a:at.Point.CURVE().a,b:at.Point.CURVE().b,n:at.Point.CURVE().n,p:at.Point.CURVE().p},"P-521":{a:ct.Point.CURVE().a,b:ct.Point.CURVE().b,n:ct.Point.CURVE().n,p:ct.Point.CURVE().p}},K0={brainpoolP160r1:{a:0x340e7be2a280eb74e2be61bada745d97e8f7c300n,b:0x1e589a8595423412134faa2dbdec95c8d8675e58n,n:0xe95e4a5f737059dc60df5991d45029409e60fc09n,p:0xe95e4a5f737059dc60dfc7ad95b3d8139515620fn},brainpoolP160t1:{a:0xe95e4a5f737059dc60dfc7ad95b3d8139515620cn,b:0x7a556b6dae535b7b51ed2c4d7daa7a0b5c55f380n,n:0xe95e4a5f737059dc60df5991d45029409e60fc09n,p:0xe95e4a5f737059dc60dfc7ad95b3d8139515620fn},brainpoolP192r1:{a:0x6a91174076b1e0e19c39c031fe8685c1cae040e5c69a28efn,b:0x469a28ef7c28cca3dc721d044f4496bcca7ef4146fbf25c9n,n:0xc302f41d932a36cda7a3462f9e9e916b5be8f1029ac4acc1n,p:0xc302f41d932a36cda7a3463093d18db78fce476de1a86297n},brainpoolP192t1:{a:0xc302f41d932a36cda7a3463093d18db78fce476de1a86294n,b:0x13d56ffaec78681e68f9deb43b35bec2fb68542e27897b79n,n:0xc302f41d932a36cda7a3462f9e9e916b5be8f1029ac4acc1n,p:0xc302f41d932a36cda7a3463093d18db78fce476de1a86297n},brainpoolP224r1:{a:0x68a5e62ca9ce6c1c299803a6c1530b514e182ad8b0042a59cad29f43n,b:0x2580f63ccfe44138870713b1a92369e33e2135d266dbb372386c400bn,n:0xd7c134aa264366862a18302575d0fb98d116bc4b6ddebca3a5a7939fn,p:0xd7c134aa264366862a18302575d1d787b09f075797da89f57ec8c0ffn},brainpoolP224t1:{a:0xd7c134aa264366862a18302575d1d787b09f075797da89f57ec8c0fcn,b:0x4b337d934104cd7bef271bf60ced1ed20da14c08b3bb64f18a60888dn,n:0xd7c134aa264366862a18302575d0fb98d116bc4b6ddebca3a5a7939fn,p:0xd7c134aa264366862a18302575d1d787b09f075797da89f57ec8c0ffn},brainpoolP256r1:{a:0x7d5a0975fc2c3057eef67530417affe7fb8055c126dc5c6ce94a4b44f330b5d9n,b:0x26dc5c6ce94a4b44f330b5d9bbd77cbf958416295cf7e1ce6bccdc18ff8c07b6n,n:0xa9fb57dba1eea9bc3e660a909d838d718c397aa3b561a6f7901e0e82974856a7n,p:0xa9fb57dba1eea9bc3e660a909d838d726e3bf623d52620282013481d1f6e5377n},brainpoolP256t1:{a:0xa9fb57dba1eea9bc3e660a909d838d726e3bf623d52620282013481d1f6e5374n,b:0x662c61c430d84ea4fe66a7733d0b76b7bf93ebc4af2f49256ae58101fee92b04n,n:0xa9fb57dba1eea9bc3e660a909d838d718c397aa3b561a6f7901e0e82974856a7n,p:0xa9fb57dba1eea9bc3e660a909d838d726e3bf623d52620282013481d1f6e5377n},brainpoolP320r1:{a:0x3ee30b568fbab0f883ccebd46d3f3bb8a2a73513f5eb79da66190eb085ffa9f492f375a97d860eb4n,b:0x520883949dfdbc42d3ad198640688a6fe13f41349554b49acc31dccd884539816f5eb4ac8fb1f1a6n,n:0xd35e472036bc4fb7e13c785ed201e065f98fcfa5b68f12a32d482ec7ee8658e98691555b44c59311n,p:0xd35e472036bc4fb7e13c785ed201e065f98fcfa6f6f40def4f92b9ec7893ec28fcd412b1f1b32e27n},brainpoolP320t1:{a:0xd35e472036bc4fb7e13c785ed201e065f98fcfa6f6f40def4f92b9ec7893ec28fcd412b1f1b32e24n,b:0xa7f561e038eb1ed560b3d147db782013064c19f27ed27c6780aaf77fb8a547ceb5b4fef422340353n,n:0xd35e472036bc4fb7e13c785ed201e065f98fcfa5b68f12a32d482ec7ee8658e98691555b44c59311n,p:0xd35e472036bc4fb7e13c785ed201e065f98fcfa6f6f40def4f92b9ec7893ec28fcd412b1f1b32e27n},brainpoolP384r1:{a:0x7bc382c63d8c150c3c72080ace05afa0c2bea28e4fb22787139165efba91f90f8aa5814a503ad4eb04a8c7dd22ce2826n,b:0x4a8c7dd22ce28268b39b55416f0447c2fb77de107dcd2a62e880ea53eeb62d57cb4390295dbc9943ab78696fa504c11n,n:0x8cb91e82a3386d280f5d6f7e50e641df152f7109ed5456b31f166e6cac0425a7cf3ab6af6b7fc3103b883202e9046565n,p:0x8cb91e82a3386d280f5d6f7e50e641df152f7109ed5456b412b1da197fb71123acd3a729901d1a71874700133107ec53n},brainpoolP384t1:{a:0x8cb91e82a3386d280f5d6f7e50e641df152f7109ed5456b412b1da197fb71123acd3a729901d1a71874700133107ec50n,b:0x7f519eada7bda81bd826dba647910f8c4b9346ed8ccdc64e4b1abd11756dce1d2074aa263b88805ced70355a33b471een,n:0x8cb91e82a3386d280f5d6f7e50e641df152f7109ed5456b31f166e6cac0425a7cf3ab6af6b7fc3103b883202e9046565n,p:0x8cb91e82a3386d280f5d6f7e50e641df152f7109ed5456b412b1da197fb71123acd3a729901d1a71874700133107ec53n},brainpoolP512r1:{a:0x7830a3318b603b89e2327145ac234cc594cbdd8d3df91610a83441caea9863bc2ded5d5aa8253aa10a2ef1c98b9ac8b57f1117a72bf2c7b9e7c1ac4d77fc94can,b:0x3df91610a83441caea9863bc2ded5d5aa8253aa10a2ef1c98b9ac8b57f1117a72bf2c7b9e7c1ac4d77fc94cadc083e67984050b75ebae5dd2809bd638016f723n,n:0xaadd9db8dbe9c48b3fd4e6ae33c9fc07cb308db3b3c9d20ed6639cca70330870553e5c414ca92619418661197fac10471db1d381085ddaddb58796829ca90069n,p:0xaadd9db8dbe9c48b3fd4e6ae33c9fc07cb308db3b3c9d20ed6639cca703308717d4d9b009bc66842aecda12ae6a380e62881ff2f2d82c68528aa6056583a48f3n},brainpoolP512t1:{a:0xaadd9db8dbe9c48b3fd4e6ae33c9fc07cb308db3b3c9d20ed6639cca703308717d4d9b009bc66842aecda12ae6a380e62881ff2f2d82c68528aa6056583a48f3n,b:0x7cbbbcf9441cfab76e1890e46884eae321f70c0bcb4981527897504bec3e36a62bcdfa2304976540f6450085f2dae145c22553b465763689180ea2571867423en,n:0xaadd9db8dbe9c48b3fd4e6ae33c9fc07cb308db3b3c9d20ed6639cca70330870553e5c414ca92619418661197fac10471db1d381085ddaddb58796829ca90069n,p:0xaadd9db8dbe9c48b3fd4e6ae33c9fc07cb308db3b3c9d20ed6639cca703308717d4d9b009bc66842aecda12ae6a380e62881ff2f2d82c68528aa6056583a48f3n}};}),M4,F4,U4,pC=L4(()=>{Sl(),M4={p:K0.brainpoolP224r1.p,a:K0.brainpoolP224r1.a,b:K0.brainpoolP224r1.b,n:K0.brainpoolP224r1.n,h:BigInt(1),Gx:BigInt("0xd9029ad2c7e5cf4340823b2a87dc68c9e4ce3174c1e6efdee12c07d"),Gy:BigInt("0x58aa56f772c0726f24c6b89e4ecdac24354b9e99caa3f6d3761402cd")},Oe(Re(M4),Nr),F4={p:_i["P-192"].p,a:_i["P-192"].a,b:_i["P-192"].b,n:_i["P-192"].n,h:BigInt(1),Gx:BigInt("0x188da80eb03090f67cbf20eb43a18800f4ff0afd82ff1012"),Gy:BigInt("0x07192b95ffc8da78631011ed6b24cdd573f977a11e794811")},Oe(Re(F4),Mn),U4={p:_i["P-224"].p,a:_i["P-224"].a,b:_i["P-224"].b,n:_i["P-224"].n,h:BigInt(1),Gx:BigInt("0xb70e0cbd6bb4bf7f321390b94a03c1d356c21122343280d6115c1d21"),Gy:BigInt("0xbd376388b5f723fb4c22dfe6cd4375a05a07476444d5819985007e34")},Oe(Re(U4),Nr);});BigInt("0x2523648240000001ba344d80000000086121000000000013a700000000000012");Sl();Sl();var dp=class extends te{constructor(t){super(t),Object.setPrototypeOf(this,dp.prototype);}};dp=vt([M({type:k.Set,itemType:yt})],dp);var up=class{constructor(t={}){this.number=1,this.hash=new ArrayBuffer(0),Object.assign(this,t);}};vt([g({type:S.Integer})],up.prototype,"number",2),vt([g({type:S.OctetString})],up.prototype,"hash",2);var fp=class{constructor(t={}){this.ldsVersion="",this.unicodeVersion="",Object.assign(this,t);}};vt([g({type:S.PrintableString})],fp.prototype,"ldsVersion",2),vt([g({type:S.PrintableString})],fp.prototype,"unicodeVersion",2);var lp=class{constructor(t){this.value="",t&&(typeof t=="string"?this.value=t:Object.assign(this,t));}};vt([g({type:S.ObjectIdentifier})],lp.prototype,"value",2),lp=vt([M({type:k.Choice})],lp);var yl=class{constructor(t={}){this.version=1,this.hashAlgorithm=new ut,this.dataGroups=[],Object.assign(this,t);}};vt([g({type:S.Integer})],yl.prototype,"version",2),vt([g({type:ut})],yl.prototype,"hashAlgorithm",2),vt([g({type:up,repeated:"sequence"})],yl.prototype,"dataGroups",2),vt([g({type:fp,optional:true})],yl.prototype,"versionInfo",2);var bl=class{constructor(t={}){this.version=0,this.certificates=[],Object.assign(this,t);}};vt([g({type:S.Integer})],bl.prototype,"version",2),vt([g({type:Dt,repeated:"set"})],bl.prototype,"certificates",2),bl=vt([M({type:k.Sequence})],bl);Sl();Nt.Point.fromAffine(ln);Os.ORDER;if(typeof window>"u")try{let t=fC("crypto");crypto=t;}catch{}pC();function hC(t){return "0x"+Buffer.from(t).toString("hex").padStart(64,"0")}function H4(t){let e=[];for(let r=0;r<t.length;r+=32)e.push(hC(t.slice(r,r+32)));return e}var mC=(t=>(t[t.USER_ADDRESS=1]="USER_ADDRESS",t[t.CHAIN_ID=2]="CHAIN_ID",t[t.CUSTOM_DATA=3]="CUSTOM_DATA",t))(mC||{});var gC=(t=>(t[t.DISCLOSE=0]="DISCLOSE",t[t.AGE=1]="AGE",t[t.BIRTHDATE=2]="BIRTHDATE",t[t.EXPIRY_DATE=3]="EXPIRY_DATE",t[t.NATIONALITY_INCLUSION=4]="NATIONALITY_INCLUSION",t[t.NATIONALITY_EXCLUSION=5]="NATIONALITY_EXCLUSION",t[t.ISSUING_COUNTRY_INCLUSION=6]="ISSUING_COUNTRY_INCLUSION",t[t.ISSUING_COUNTRY_EXCLUSION=7]="ISSUING_COUNTRY_EXCLUSION",t[t.BIND=8]="BIND",t[t.SANCTIONS_EXCLUSION=9]="SANCTIONS_EXCLUSION",t[t.FACEMATCH=10]="FACEMATCH",t))(gC||{});var yC=Object.defineProperty,bC=Object.getOwnPropertyDescriptor,SC=(t=>typeof _e<"u"?_e:typeof Proxy<"u"?new Proxy(t,{get:(e,r)=>(typeof _e<"u"?_e:e)[r]}):t)(function(t){if(typeof _e<"u")return _e.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')}),V4=(t,e)=>()=>(t&&(e=t(t=0)),e),Et=(t,e,r,i)=>{for(var n=i>1?void 0:i?bC(e,r):e,o=t.length-1,s;o>=0;o--)(s=t[o])&&(n=(i?s(e,r,n):s(n))||n);return i&&n&&yC(e,r,n),n},Ci,q0,Cl=V4(()=>{Ci={"P-192":{a:0xfffffffffffffffffffffffffffffffefffffffffffffffcn,b:0x64210519e59c80e70fa7e9ab72243049feb8deecc146b9b1n,n:0xffffffffffffffffffffffff99def836146bc9b1b4d22831n,p:0xfffffffffffffffffffffffffffffffeffffffffffffffffn},"P-224":{a:0xfffffffffffffffffffffffffffffffefffffffffffffffffffffffen,b:0xb4050a850c04b3abf54132565044b0b7d7bfd8ba270b39432355ffb4n,n:0xffffffffffffffffffffffffffff16a2e0b8f03e13dd29455c5c2a3dn,p:0xffffffffffffffffffffffffffffffff000000000000000000000001n},"P-256":{a:st.Point.CURVE().a,b:st.Point.CURVE().b,n:st.Point.CURVE().n,p:st.Point.CURVE().p},"P-384":{a:at.Point.CURVE().a,b:at.Point.CURVE().b,n:at.Point.CURVE().n,p:at.Point.CURVE().p},"P-521":{a:ct.Point.CURVE().a,b:ct.Point.CURVE().b,n:ct.Point.CURVE().n,p:ct.Point.CURVE().p}},q0={brainpoolP160r1:{a:0x340e7be2a280eb74e2be61bada745d97e8f7c300n,b:0x1e589a8595423412134faa2dbdec95c8d8675e58n,n:0xe95e4a5f737059dc60df5991d45029409e60fc09n,p:0xe95e4a5f737059dc60dfc7ad95b3d8139515620fn},brainpoolP160t1:{a:0xe95e4a5f737059dc60dfc7ad95b3d8139515620cn,b:0x7a556b6dae535b7b51ed2c4d7daa7a0b5c55f380n,n:0xe95e4a5f737059dc60df5991d45029409e60fc09n,p:0xe95e4a5f737059dc60dfc7ad95b3d8139515620fn},brainpoolP192r1:{a:0x6a91174076b1e0e19c39c031fe8685c1cae040e5c69a28efn,b:0x469a28ef7c28cca3dc721d044f4496bcca7ef4146fbf25c9n,n:0xc302f41d932a36cda7a3462f9e9e916b5be8f1029ac4acc1n,p:0xc302f41d932a36cda7a3463093d18db78fce476de1a86297n},brainpoolP192t1:{a:0xc302f41d932a36cda7a3463093d18db78fce476de1a86294n,b:0x13d56ffaec78681e68f9deb43b35bec2fb68542e27897b79n,n:0xc302f41d932a36cda7a3462f9e9e916b5be8f1029ac4acc1n,p:0xc302f41d932a36cda7a3463093d18db78fce476de1a86297n},brainpoolP224r1:{a:0x68a5e62ca9ce6c1c299803a6c1530b514e182ad8b0042a59cad29f43n,b:0x2580f63ccfe44138870713b1a92369e33e2135d266dbb372386c400bn,n:0xd7c134aa264366862a18302575d0fb98d116bc4b6ddebca3a5a7939fn,p:0xd7c134aa264366862a18302575d1d787b09f075797da89f57ec8c0ffn},brainpoolP224t1:{a:0xd7c134aa264366862a18302575d1d787b09f075797da89f57ec8c0fcn,b:0x4b337d934104cd7bef271bf60ced1ed20da14c08b3bb64f18a60888dn,n:0xd7c134aa264366862a18302575d0fb98d116bc4b6ddebca3a5a7939fn,p:0xd7c134aa264366862a18302575d1d787b09f075797da89f57ec8c0ffn},brainpoolP256r1:{a:0x7d5a0975fc2c3057eef67530417affe7fb8055c126dc5c6ce94a4b44f330b5d9n,b:0x26dc5c6ce94a4b44f330b5d9bbd77cbf958416295cf7e1ce6bccdc18ff8c07b6n,n:0xa9fb57dba1eea9bc3e660a909d838d718c397aa3b561a6f7901e0e82974856a7n,p:0xa9fb57dba1eea9bc3e660a909d838d726e3bf623d52620282013481d1f6e5377n},brainpoolP256t1:{a:0xa9fb57dba1eea9bc3e660a909d838d726e3bf623d52620282013481d1f6e5374n,b:0x662c61c430d84ea4fe66a7733d0b76b7bf93ebc4af2f49256ae58101fee92b04n,n:0xa9fb57dba1eea9bc3e660a909d838d718c397aa3b561a6f7901e0e82974856a7n,p:0xa9fb57dba1eea9bc3e660a909d838d726e3bf623d52620282013481d1f6e5377n},brainpoolP320r1:{a:0x3ee30b568fbab0f883ccebd46d3f3bb8a2a73513f5eb79da66190eb085ffa9f492f375a97d860eb4n,b:0x520883949dfdbc42d3ad198640688a6fe13f41349554b49acc31dccd884539816f5eb4ac8fb1f1a6n,n:0xd35e472036bc4fb7e13c785ed201e065f98fcfa5b68f12a32d482ec7ee8658e98691555b44c59311n,p:0xd35e472036bc4fb7e13c785ed201e065f98fcfa6f6f40def4f92b9ec7893ec28fcd412b1f1b32e27n},brainpoolP320t1:{a:0xd35e472036bc4fb7e13c785ed201e065f98fcfa6f6f40def4f92b9ec7893ec28fcd412b1f1b32e24n,b:0xa7f561e038eb1ed560b3d147db782013064c19f27ed27c6780aaf77fb8a547ceb5b4fef422340353n,n:0xd35e472036bc4fb7e13c785ed201e065f98fcfa5b68f12a32d482ec7ee8658e98691555b44c59311n,p:0xd35e472036bc4fb7e13c785ed201e065f98fcfa6f6f40def4f92b9ec7893ec28fcd412b1f1b32e27n},brainpoolP384r1:{a:0x7bc382c63d8c150c3c72080ace05afa0c2bea28e4fb22787139165efba91f90f8aa5814a503ad4eb04a8c7dd22ce2826n,b:0x4a8c7dd22ce28268b39b55416f0447c2fb77de107dcd2a62e880ea53eeb62d57cb4390295dbc9943ab78696fa504c11n,n:0x8cb91e82a3386d280f5d6f7e50e641df152f7109ed5456b31f166e6cac0425a7cf3ab6af6b7fc3103b883202e9046565n,p:0x8cb91e82a3386d280f5d6f7e50e641df152f7109ed5456b412b1da197fb71123acd3a729901d1a71874700133107ec53n},brainpoolP384t1:{a:0x8cb91e82a3386d280f5d6f7e50e641df152f7109ed5456b412b1da197fb71123acd3a729901d1a71874700133107ec50n,b:0x7f519eada7bda81bd826dba647910f8c4b9346ed8ccdc64e4b1abd11756dce1d2074aa263b88805ced70355a33b471een,n:0x8cb91e82a3386d280f5d6f7e50e641df152f7109ed5456b31f166e6cac0425a7cf3ab6af6b7fc3103b883202e9046565n,p:0x8cb91e82a3386d280f5d6f7e50e641df152f7109ed5456b412b1da197fb71123acd3a729901d1a71874700133107ec53n},brainpoolP512r1:{a:0x7830a3318b603b89e2327145ac234cc594cbdd8d3df91610a83441caea9863bc2ded5d5aa8253aa10a2ef1c98b9ac8b57f1117a72bf2c7b9e7c1ac4d77fc94can,b:0x3df91610a83441caea9863bc2ded5d5aa8253aa10a2ef1c98b9ac8b57f1117a72bf2c7b9e7c1ac4d77fc94cadc083e67984050b75ebae5dd2809bd638016f723n,n:0xaadd9db8dbe9c48b3fd4e6ae33c9fc07cb308db3b3c9d20ed6639cca70330870553e5c414ca92619418661197fac10471db1d381085ddaddb58796829ca90069n,p:0xaadd9db8dbe9c48b3fd4e6ae33c9fc07cb308db3b3c9d20ed6639cca703308717d4d9b009bc66842aecda12ae6a380e62881ff2f2d82c68528aa6056583a48f3n},brainpoolP512t1:{a:0xaadd9db8dbe9c48b3fd4e6ae33c9fc07cb308db3b3c9d20ed6639cca703308717d4d9b009bc66842aecda12ae6a380e62881ff2f2d82c68528aa6056583a48f3n,b:0x7cbbbcf9441cfab76e1890e46884eae321f70c0bcb4981527897504bec3e36a62bcdfa2304976540f6450085f2dae145c22553b465763689180ea2571867423en,n:0xaadd9db8dbe9c48b3fd4e6ae33c9fc07cb308db3b3c9d20ed6639cca70330870553e5c414ca92619418661197fac10471db1d381085ddaddb58796829ca90069n,p:0xaadd9db8dbe9c48b3fd4e6ae33c9fc07cb308db3b3c9d20ed6639cca703308717d4d9b009bc66842aecda12ae6a380e62881ff2f2d82c68528aa6056583a48f3n}};}),K4,q4,G4,xC=V4(()=>{Cl(),K4={p:q0.brainpoolP224r1.p,a:q0.brainpoolP224r1.a,b:q0.brainpoolP224r1.b,n:q0.brainpoolP224r1.n,h:BigInt(1),Gx:BigInt("0xd9029ad2c7e5cf4340823b2a87dc68c9e4ce3174c1e6efdee12c07d"),Gy:BigInt("0x58aa56f772c0726f24c6b89e4ecdac24354b9e99caa3f6d3761402cd")},Oe(Re(K4),Nr),q4={p:Ci["P-192"].p,a:Ci["P-192"].a,b:Ci["P-192"].b,n:Ci["P-192"].n,h:BigInt(1),Gx:BigInt("0x188da80eb03090f67cbf20eb43a18800f4ff0afd82ff1012"),Gy:BigInt("0x07192b95ffc8da78631011ed6b24cdd573f977a11e794811")},Oe(Re(q4),Mn),G4={p:Ci["P-224"].p,a:Ci["P-224"].a,b:Ci["P-224"].b,n:Ci["P-224"].n,h:BigInt(1),Gx:BigInt("0xb70e0cbd6bb4bf7f321390b94a03c1d356c21122343280d6115c1d21"),Gy:BigInt("0xbd376388b5f723fb4c22dfe6cd4375a05a07476444d5819985007e34")},Oe(Re(G4),Nr);}),_l=class Ve{constructor(e){this.bytes=Ve.convertToBytes(e);}static convertToBytes(e){if(typeof e=="bigint"||typeof e=="number"){let r=e.toString(16),i=r.padStart(Math.ceil(r.length/2)*2,"0");return new Uint8Array(i.match(/.{1,2}/g)?.map(n=>parseInt(n,16))||[])}if(e instanceof Uint8Array)return new Uint8Array(e);if(Buffer.isBuffer(e))return new Uint8Array(e);if(Array.isArray(e)){if(!e.every(r=>typeof r=="number"&&r>=0&&r<=255))throw new Error("Invalid byte array: values must be between 0 and 255");return new Uint8Array(e)}if(e instanceof ArrayBuffer)return new Uint8Array(e);if(typeof e=="string"){if(Ve.isHexString(e)){let r=e.startsWith("0x")?e.slice(2):e,i=r.padStart(Math.ceil(r.length/2)*2,"0");return new Uint8Array(i.match(/.{1,2}/g)?.map(n=>parseInt(n,16))||[])}try{let r=BigInt(e);return Ve.convertToBytes(r)}catch{return new Uint8Array(Buffer.from(e,"ascii"))}}throw new Error("Unsupported data type")}static isHexString(e){let r=e.startsWith("0x")?e.slice(2):e;return /^[0-9a-fA-F]*$/.test(r)}static from(e){return new Ve(e)}static fromHex(e){if(!Ve.isHexString(e))throw new Error("Invalid hex string");return new Ve(e.startsWith("0x")?e:"0x"+e)}static fromBuffer(e){return new Ve(e)}static fromBase64(e){let r=atob(e);return new Ve(Uint8Array.from(r,i=>i.charCodeAt(0)))}static empty(){return new Ve(new Uint8Array(0))}static zero(e){return new Ve(new Uint8Array(e))}toBigInt(){return BigInt("0x"+this.toHex().slice(2))}toUInt8Array(){return new Uint8Array(this.bytes)}toNumberArray(){return Array.from(this.bytes)}toHex(){return "0x"+Array.from(this.bytes).map(e=>e.toString(16).padStart(2,"0")).join("")}toBuffer(){return Buffer.from(this.bytes)}toString(e="hex"){return e==="hex"?this.toHex().slice(2):Buffer.from(this.bytes).toString(e)}toBase64(){return btoa(String.fromCharCode(...this.bytes))}toJSON(){return this.toHex()}[Symbol.for("nodejs.util.inspect.custom")](){return `Binary(${this.toHex()})`}[Symbol.toPrimitive](e){switch(e){case "number":return Number(this.toBigInt());case "string":return `Binary(${this.toHex()})`;default:return this.toBigInt()}}valueOf(){return this.toBigInt()}get length(){return this.bytes.length}*[Symbol.iterator](){yield*this.bytes;}equals(e){return this.length!==e.length?false:this.bytes.every((r,i)=>r===e.bytes[i])}slice(e,r){return new Ve(this.bytes.slice(e,r))}concat(e){return new Ve([...this.toNumberArray(),...e.toNumberArray()])}[Symbol.for("+")](e){return this.concat(e)}compare(e){let r=Math.min(this.length,e.length);for(let i=0;i<r;i++){let n=this.bytes[i]-e.bytes[i];if(n!==0)return n}return this.length-e.length}xor(e){if(this.length!==e.length)throw new Error("Binary instances must be of equal length for XOR operation");let r=new Uint8Array(this.length);for(let i=0;i<this.length;i++)r[i]=this.bytes[i]^e.bytes[i];return new Ve(r)}and(e){if(this.length!==e.length)throw new Error("Binary instances must be of equal length for AND operation");let r=new Uint8Array(this.length);for(let i=0;i<this.length;i++)r[i]=this.bytes[i]&e.bytes[i];return new Ve(r)}or(e){if(this.length!==e.length)throw new Error("Binary instances must be of equal length for OR operation");let r=new Uint8Array(this.length);for(let i=0;i<this.length;i++)r[i]=this.bytes[i]|e.bytes[i];return new Ve(r)}not(){let e=new Uint8Array(this.length);for(let r=0;r<this.length;r++)e[r]=~this.bytes[r]&255;return new Ve(e)}padStart(e,r=0){if(this.length>=e)return this;let i=new Uint8Array(e);return i.fill(r,0,e-this.length),i.set(this.bytes,e-this.length),new Ve(i)}padEnd(e,r=0){if(this.length>=e)return this;let i=new Uint8Array(e);return i.set(this.bytes),i.fill(r,this.length),new Ve(i)}};function Ir(t,e){if(!t)throw new Error(e)}function qs(t,e){if(t.length===0)return [];let r=Math.ceil(t.length/e),i=new Array(r),n=t.length%e||e,o=0;for(let s=r-1;s>=0;s--){let a=s===r-1?n:e,l=0n;for(let d=0;d<a;d++)l=l<<8n|BigInt(t[o++]);let c=l.toString(16);i[s]="0x"+(c.length%2?"0":"")+c;}return i}var wl=class{constructor(t,e=2){this.depth=t,this.arity=e,this.zeroes=[],this.nodes=[];}get root(){return `0x${this.nodes[this.depth][0].toString(16).padStart(64,"0")}`}get leaves(){return this.nodes[0].slice()}async initialize(t,e=[]){if(e.length>this.arity**this.depth)throw new Error(`The tree cannot contain more than ${this.arity**this.depth} leaves`);if(new Set(e.map(r=>r.toString())).size!==e.length)throw new Error("Duplicate leaves");for(let r=0;r<this.depth;r+=1)this.zeroes.push(t),this.nodes[r]=[],t=await Ee(Array(this.arity).fill(t).map(i=>BigInt(i)));if(this.nodes[this.depth]=[],e.length>0){this.nodes[0]=e;for(let r=0;r<this.depth;r+=1)for(let i=0;i<Math.ceil(this.nodes[r].length/this.arity);i+=1){let n=i*this.arity,o=[];for(let s=0;s<this.arity;s+=1)o.push(this.nodes[r][n+s]??this.zeroes[r]);this.nodes[r+1][i]=await Ee(o.map(s=>BigInt(s)));}}else this.nodes[this.depth][0]=t;}serialize(){return this.nodes.map(t=>t.map(e=>`0x${e.toString(16).padStart(64,"0")}`))}};BigInt("0x2523648240000001ba344d80000000086121000000000013a700000000000012");Cl();Cl();var mp=class extends te{constructor(t){super(t),Object.setPrototypeOf(this,mp.prototype);}};mp=Et([M({type:k.Set,itemType:yt})],mp);var gp=class{constructor(t={}){this.number=1,this.hash=new ArrayBuffer(0),Object.assign(this,t);}};Et([g({type:S.Integer})],gp.prototype,"number",2),Et([g({type:S.OctetString})],gp.prototype,"hash",2);var yp=class{constructor(t={}){this.ldsVersion="",this.unicodeVersion="",Object.assign(this,t);}};Et([g({type:S.PrintableString})],yp.prototype,"ldsVersion",2),Et([g({type:S.PrintableString})],yp.prototype,"unicodeVersion",2);var pp=class{constructor(t){this.value="",t&&(typeof t=="string"?this.value=t:Object.assign(this,t));}};Et([g({type:S.ObjectIdentifier})],pp.prototype,"value",2),pp=Et([M({type:k.Choice})],pp);var xl=class{constructor(t={}){this.version=1,this.hashAlgorithm=new ut,this.dataGroups=[],Object.assign(this,t);}};Et([g({type:S.Integer})],xl.prototype,"version",2),Et([g({type:ut})],xl.prototype,"hashAlgorithm",2),Et([g({type:gp,repeated:"sequence"})],xl.prototype,"dataGroups",2),Et([g({type:yp,optional:true})],xl.prototype,"versionInfo",2);var Al=class{constructor(t={}){this.version=0,this.certificates=[],Object.assign(this,t);}};Et([g({type:S.Integer})],Al.prototype,"version",2),Et([g({type:Dt,repeated:"set"})],Al.prototype,"certificates",2),Al=Et([M({type:k.Sequence})],Al);Cl();Nt.Point.fromAffine(ln);Os.ORDER;if(typeof window>"u")try{let t=SC("crypto");crypto=t;}catch{}xC();var AC="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz",z4=[18,32];function _C(t){if(!(t instanceof Uint8Array))throw new Error("Input must be a Uint8Array");if(t.length===0)return "";let e=0;for(;e<t.length&&t[e]===0;)e++;let r=BigInt(0);for(let n=e;n<t.length;n++)r=r*BigInt(256)+BigInt(t[n]);let i="";for(;r>0n;){let n=Number(r%BigInt(58));i=AC[n]+i,r=r/BigInt(58);}return "1".repeat(e)+i}function bp(t){if(!t||typeof t!="string")throw new Error("Input must be a non-empty hex string");if(!t.match(/^(0x)?[0-9a-fA-F]+$/i))throw new Error("Invalid hex string format");t=t.startsWith("0x")?t.substring(2):t,t.length>64?t=t.substring(t.length-64):t.length<64&&(t=t.padStart(64,"0"));let e=new Uint8Array(34);e[0]=z4[0],e[1]=z4[1];for(let r=0;r<t.length;r+=2){let i=parseInt(t.substring(r,r+2),16);e[2+r/2]=i;}return _C(e)}var CC=16,wC=14,IC=8,vC=12,Il=0n;var EC=1;var un=1,fn=2;function $4(t,e=253){let r=Math.pow(26,2),i=Math.ceil(r/e),n=Array(i).fill(0n),o=65;for(let s of t){let a=(s.charCodeAt(0)-o)*26+s.charCodeAt(1)-o,l=Math.floor(a/e);n[l]|=1n<<BigInt(a%e);}return n}function BC(t){if(t.type==="RSA")return _l.from(t.modulus).toUInt8Array();if(t.type==="EC")return _l.from(t.public_key_x).concat(_l.from(t.public_key_y)).toUInt8Array();throw new Error("Unsupported signature algorithm")}async function TC(t,e){let r=e?.version??0;Ir(r===0||r===1,`Unsupported Packaged Certificates version: ${r}`);let i=e?.tags?$4(e.tags):t?.tags?$4(t.tags):[0n,0n,0n];Ir(i.length===3,"Tags must be exactly 3 fields");let n=e?.type??EC;Ir(n>=0&&n<=255,`Certificate type must fit in a single byte: ${n}`),Ir(t?.country?.length===3,`Country code must be 3 characters: ${t?.country}`);let o=BC(t.public_key);if(r===0)return Ee([...i,BigInt(qs(new Uint8Array([n,t.country.charCodeAt(0),t.country.charCodeAt(1),t.country.charCodeAt(2)]),31)[0]),...qs(o,31).map(s=>BigInt(s))]);if(r===1){Ir(t.fingerprint!==void 0,"Certificate fingerprint required");let s=BigInt(t.fingerprint),a=new Uint8Array(4);return a[0]=t.validity.not_after>>24&255,a[1]=t.validity.not_after>>16&255,a[2]=t.validity.not_after>>8&255,a[3]=t.validity.not_after&255,Ee([...i,BigInt(qs(new Uint8Array([n,t.country.charCodeAt(0),t.country.charCodeAt(1),t.country.charCodeAt(2),...a]),31)[0]),s,...qs(o,31).map(l=>BigInt(l))])}else throw new Error(`Unsupported Packaged Certificates version: ${r}`)}async function kC(t,e=0){let r=await Promise.all(t.map(i=>TC(i,{version:e})));return r.sort((i,n)=>i>n?1:i<n?-1:0),r}async function PC(t,e=0){let r=await kC(t,e),i=new wl(CC,2);return await i.initialize(Il,r),i}async function NC(t){Ir(t.fingerprint!==void 0,"Revocation fingerprint required"),Ir(t.serial!==void 0,"Revocation serial required"),Ir(typeof t.fingerprint=="string"&&t.fingerprint.startsWith("0x"),`Revocation fingerprint must be a 0x-prefixed hex string: ${t.fingerprint}`),Ir(typeof t.serial=="string"&&t.serial.startsWith("0x"),`Revocation serial must be a 0x-prefixed hex string: ${t.serial}`);let e=_l.from(t.serial).toUInt8Array(),r=await Ee(qs(e,31).map(i=>BigInt(i)));return Ee([BigInt(t.fingerprint),r])}async function DC(t){let e=await Promise.all(t.map(r=>NC(r)));return e.sort((r,i)=>r>i?1:r<i?-1:0),e}async function RC(t){let e=await DC(t),r=new wl(wC,2);return await r.initialize(Il,e),r}async function OC(t){let e=t.map(i=>BigInt(i));e.sort((i,n)=>i>n?1:i<n?-1:0);let r=new wl(IC,2);return await r.initialize(Il,e),r}var MC=21888242871839275222246405745257275088548364400416034343698204186575808495617n;function hp(t,e){if(typeof e!="string"||!/^0x[0-9a-fA-F]{1,64}$/.test(e))throw new Error(`${t} must be a 0x-prefixed hex string of at most 64 hex chars: ${e}`);let r=BigInt(e);if(r>=MC)throw new Error(`${t} must be in [0, BN254_FIELD_MODULUS): ${r}`);return r}async function FC(t){let{schemaVersion:e,timestamp:r,certificateRoot:i,revocationRoot:n,masterlistRoot:o}=t;Ir(Number.isInteger(e)&&e>=0&&e<=65535,`Schema version must be an integer that fits in 2 bytes: ${e}`),Ir(Number.isInteger(r)&&r>=0&&r<=4294967295,`Timestamp must be an integer that fits in 4 bytes: ${r}`);let s=hp("certificateRoot",i),a=hp("revocationRoot",n),l=hp("masterlistRoot",o),c=await Ee([s,a,l]),d=new Uint8Array([e>>>8&255,e&255,r>>>24&255,r>>>16&255,r>>>8&255,r&255]),u=BigInt(qs(d,31)[0]);return {certificateRoot:`0x${(await Ee([u,c])).toString(16).padStart(64,"0")}`,stateRoot:`0x${c.toString(16).padStart(64,"0")}`}}async function j4(t){let e=t.version??0,r=await PC(t.certificates,e);if(e===0)return r.root;if(e===1){let i=t,n=await RC(i.revocations??[]),o=await OC(i.masterlists??[]),{certificateRoot:s}=await FC({schemaVersion:e,timestamp:i.timestamp,certificateRoot:r.root,revocationRoot:n.root,masterlistRoot:o.root});return s}else throw new Error(`Unsupported Packaged Certificates schema version: ${e}`)}async function X4(t){let e;if(t.circuits!==void 0)e=t.circuits.map(i=>BigInt(i.vkey_hash));else if(t.hashes!==void 0)e=t.hashes.map(i=>BigInt(i));else throw new Error("Either circuits or hashes must be provided");e.sort((i,n)=>i>n?1:i<n?-1:0);let r=new wl(vC,2);return await r.initialize(Il,e),r.root}var ob=tt(G0(),1);function wi(t){return t.startsWith("0x")?t.slice(2):t}function Rt(t){return typeof t=="bigint"?`0x${t.toString(16).toLowerCase().padStart(64,"0")}`:`0x${wi(t).toLowerCase().padStart(64,"0")}`}var ZC=3,YC="https://certificates.zkpassport.id/mainnet",QC="https://certificates.zkpassport.id/testnet",JC="http://localhost:8000/root",Bl=(t,e,r)=>r?`https://ipfs.zkpassport.id/ipfs/${r}`:(e=Rt(e),t===1||t===8453?`${YC}/${e}.json`:t===11155111?`${QC}/${e}.json`:`${JC}/${e}.json`),Sp="https://circuits2.zkpassport.id/mainnet",xp="https://circuits2.zkpassport.id/testnet",Ap="http://localhost:8000",Tl=(t,{root:e,version:r,cid:i})=>{if(e)return e=Rt(e),t===1?`${Sp}/by-root/${e}/manifest.json`:t===11155111?`${xp}/by-root/${e}/manifest.json`:`${Ap}/by-root/${e}/manifest.json`;if(r)return t===1?`${Sp}/by-version/${r}/manifest.json`:t===11155111?`${xp}/by-version/${r}/manifest.json`:`${Ap}/by-version/${r}/manifest.json`;if(i)return `https://ipfs.zkpassport.id/ipfs/${i}`;throw new Error("No root, version or cid provided")},kl=(t,e,r)=>r?`https://ipfs.zkpassport.id/ipfs/${r}`:(e=Rt(e),t===1?`${Sp}/by-hash/${e}.json`:t===11155111?`${xp}/by-hash/${e}.json`:`${Ap}/by-hash/${e}.json`),Pl=100,J4="0xc3bc16e8",eb="0x06ac4103",tb="0xcb0c82c7",rb="0x76785af8",ew="0x5d8d57a6",ib="0xbb3dd539",nb="0x2aae4296",tw=[{country:"RUS",id_card_support:0,residence_permit_support:0,passport_support:.75},{country:"JPN",id_card_support:0,residence_permit_support:0,passport_support:1},{country:"GBR",id_card_support:0,residence_permit_support:0,passport_support:1},{country:"IDN",id_card_support:0,residence_permit_support:0,passport_support:.5},{country:"NGA",id_card_support:0,residence_permit_support:0,passport_support:.75},{country:"DEU",id_card_support:.5,residence_permit_support:.5,passport_support:1},{country:"EST",id_card_support:.5,residence_permit_support:.5,passport_support:1},{country:"LVA",id_card_support:.5,residence_permit_support:.5,passport_support:1},{country:"SGP",id_card_support:0,residence_permit_support:0,passport_support:1},{country:"VNM",id_card_support:0,residence_permit_support:0,passport_support:1},{country:"TUR",id_card_support:.5,residence_permit_support:0,passport_support:1},{country:"THA",id_card_support:0,residence_permit_support:0,passport_support:1},{country:"BRA",id_card_support:0,residence_permit_support:0,passport_support:1},{country:"ARG",id_card_support:0,residence_permit_support:0,passport_support:1},{country:"AUT",id_card_support:.5,residence_permit_support:0,passport_support:1},{country:"FRA",id_card_support:.5,residence_permit_support:.5,passport_support:1},{country:"PRT",id_card_support:.5,residence_permit_support:.5,passport_support:1},{country:"ESP",id_card_support:.5,residence_permit_support:.5,passport_support:1},{country:"IRL",id_card_support:.5,residence_permit_support:.5,passport_support:1},{country:"ITA",id_card_support:.5,residence_permit_support:.5,passport_support:1},{country:"CHE",id_card_support:0,residence_permit_support:.5,passport_support:1},{country:"BEL",id_card_support:.5,residence_permit_support:.5,passport_support:1},{country:"LUX",id_card_support:.5,residence_permit_support:.5,passport_support:1},{country:"NLD",id_card_support:.5,residence_permit_support:.5,passport_support:1},{country:"POL",id_card_support:.25,residence_permit_support:.25,passport_support:1},{country:"DNK",id_card_support:0,residence_permit_support:.5,passport_support:1},{country:"SWE",id_card_support:.5,residence_permit_support:.5,passport_support:1},{country:"NOR",id_card_support:.5,residence_permit_support:.5,passport_support:1},{country:"SVN",id_card_support:.5,residence_permit_support:.5,passport_support:1},{country:"CZE",id_card_support:.5,residence_permit_support:.5,passport_support:1},{country:"NOR",id_card_support:.5,residence_permit_support:.5,passport_support:1},{country:"LTU",id_card_support:.5,residence_permit_support:.5,passport_support:.5},{country:"FIN",id_card_support:.5,residence_permit_support:.5,passport_support:1},{country:"MEX",id_card_support:0,residence_permit_support:0,passport_support:.5},{country:"IND",id_card_support:0,residence_permit_support:0,passport_support:.25},{country:"PAK",id_card_support:0,residence_permit_support:0,passport_support:.25},{country:"IRN",id_card_support:0,residence_permit_support:0,passport_support:.75},{country:"GRC",id_card_support:.5,residence_permit_support:.5,passport_support:1},{country:"ROU",id_card_support:.5,residence_permit_support:.5,passport_support:1},{country:"KAZ",id_card_support:.25,residence_permit_support:0,passport_support:.5},{country:"BLR",id_card_support:.25,residence_permit_support:0,passport_support:.5},{country:"MAR",id_card_support:0,residence_permit_support:0,passport_support:.75},{country:"DZA",id_card_support:0,residence_permit_support:0,passport_support:.75},{country:"URY",id_card_support:.5,residence_permit_support:0,passport_support:1},{country:"PRY",id_card_support:.5,residence_permit_support:.5,passport_support:1},{country:"CHL",id_card_support:0,residence_permit_support:0,passport_support:1},{country:"PER",id_card_support:0,residence_permit_support:0,passport_support:.5},{country:"ECU",id_card_support:0,residence_permit_support:0,passport_support:.75},{country:"PAN",id_card_support:0,residence_permit_support:0,passport_support:.75},{country:"VEN",id_card_support:0,residence_permit_support:0,passport_support:0},{country:"COL",id_card_support:0,residence_permit_support:0,passport_support:1},{country:"CRI",id_card_support:0,residence_permit_support:0,passport_support:.5},{country:"USA",id_card_support:0,residence_permit_support:0,passport_support:1},{country:"CAN",id_card_support:0,residence_permit_support:0,passport_support:1},{country:"GHA",id_card_support:.25,residence_permit_support:0,passport_support:.5},{country:"SEN",id_card_support:0,residence_permit_support:0,passport_support:.25},{country:"ETH",id_card_support:0,residence_permit_support:0,passport_support:.25},{country:"JOR",id_card_support:0,residence_permit_support:0,passport_support:.25},{country:"OMN",id_card_support:0,residence_permit_support:0,passport_support:1},{country:"CHN",id_card_support:0,residence_permit_support:0,passport_support:1},{country:"KOR",id_card_support:0,residence_permit_support:0,passport_support:1},{country:"PRK",id_card_support:0,residence_permit_support:0,passport_support:.25},{country:"UAE",id_card_support:0,residence_permit_support:0,passport_support:.75},{country:"ARE",id_card_support:0,residence_permit_support:0,passport_support:.75},{country:"ISR",id_card_support:0,residence_permit_support:0,passport_support:.75},{country:"SAU",id_card_support:0,residence_permit_support:0,passport_support:.5},{country:"AUS",id_card_support:0,residence_permit_support:0,passport_support:1},{country:"NZL",id_card_support:0,residence_permit_support:0,passport_support:1},{country:"MYS",id_card_support:0,residence_permit_support:0,passport_support:1},{country:"TWN",id_card_support:0,residence_permit_support:0,passport_support:1},{country:"PHL",id_card_support:0,residence_permit_support:0,passport_support:1},{country:"UZB",id_card_support:0,residence_permit_support:0,passport_support:.75},{country:"UZB",id_card_support:0,residence_permit_support:0,passport_support:.75},{country:"TKM",id_card_support:0,residence_permit_support:0,passport_support:.75},{country:"TJK",id_card_support:0,residence_permit_support:0,passport_support:.75},{country:"GEO",id_card_support:0,residence_permit_support:0,passport_support:1},{country:"ARM",id_card_support:0,residence_permit_support:0,passport_support:.25},{country:"AZE",id_card_support:0,residence_permit_support:0,passport_support:.75},{country:"CYP",id_card_support:.5,residence_permit_support:.5,passport_support:1},{country:"RKS",id_card_support:0,residence_permit_support:0,passport_support:.5},{country:"MNE",id_card_support:0,residence_permit_support:0,passport_support:.75},{country:"ALB",id_card_support:0,residence_permit_support:0,passport_support:.75},{country:"HRV",id_card_support:.5,residence_permit_support:.5,passport_support:1},{country:"SRB",id_card_support:0,residence_permit_support:0,passport_support:.75},{country:"HUN",id_card_support:.5,residence_permit_support:.5,passport_support:1},{country:"MDA",id_card_support:0,residence_permit_support:0,passport_support:0},{country:"UKR",id_card_support:.5,residence_permit_support:0,passport_support:1},{country:"BGR",id_card_support:.5,residence_permit_support:0,passport_support:1},{country:"LIE",id_card_support:0,residence_permit_support:0,passport_support:1},{country:"VAT",id_card_support:0,residence_permit_support:0,passport_support:1},{country:"SMR",id_card_support:0,residence_permit_support:0,passport_support:1},{country:"JAM",id_card_support:0,residence_permit_support:0,passport_support:.25},{country:"SLE",id_card_support:0,residence_permit_support:0,passport_support:.25},{country:"BEN",id_card_support:0,residence_permit_support:0,passport_support:.5},{country:"CMR",id_card_support:0,residence_permit_support:0,passport_support:.5},{country:"KEN",id_card_support:0,residence_permit_support:0,passport_support:.75},{country:"UGA",id_card_support:0,residence_permit_support:0,passport_support:.5},{country:"RWA",id_card_support:0,residence_permit_support:0,passport_support:.5},{country:"TZA",id_card_support:0,residence_permit_support:0,passport_support:.5},{country:"ZWE",id_card_support:0,residence_permit_support:0,passport_support:.25},{country:"BWA",id_card_support:0,residence_permit_support:0,passport_support:.5},{country:"YEM",id_card_support:0,residence_permit_support:0,passport_support:.25},{country:"LBN",id_card_support:0,residence_permit_support:0,passport_support:.5},{country:"QAT",id_card_support:0,residence_permit_support:0,passport_support:.5},{country:"KWT",id_card_support:0,residence_permit_support:0,passport_support:.75},{country:"IRQ",id_card_support:0,residence_permit_support:0,passport_support:.25},{country:"PSE",id_card_support:0,residence_permit_support:0,passport_support:.25},{country:"ISL",id_card_support:.5,residence_permit_support:0,passport_support:1},{country:"MCO",id_card_support:.5,residence_permit_support:0,passport_support:1},{country:"MNG",id_card_support:0,residence_permit_support:0,passport_support:.25},{country:"AND",id_card_support:0,residence_permit_support:0,passport_support:1},{country:"ATG",id_card_support:0,residence_permit_support:0,passport_support:.75},{country:"BHR",id_card_support:0,residence_permit_support:0,passport_support:.25},{country:"BRB",id_card_support:0,residence_permit_support:0,passport_support:.75},{country:"BLZ",id_card_support:0,residence_permit_support:0,passport_support:.25},{country:"BIH",id_card_support:0,residence_permit_support:0,passport_support:1},{country:"BMU",id_card_support:0,residence_permit_support:0,passport_support:.25},{country:"DMA",id_card_support:0,residence_permit_support:0,passport_support:.25},{country:"CIV",id_card_support:0,residence_permit_support:0,passport_support:.5},{country:"NPL",id_card_support:0,residence_permit_support:0,passport_support:.25},{country:"MKD",id_card_support:0,residence_permit_support:0,passport_support:.75},{country:"KNA",id_card_support:0,residence_permit_support:0,passport_support:.25},{country:"VCT",id_card_support:0,residence_permit_support:0,passport_support:.5},{country:"SYC",id_card_support:0,residence_permit_support:0,passport_support:.25},{country:"SYR",id_card_support:0,residence_permit_support:0,passport_support:.25},{country:"BHS",id_card_support:0,residence_permit_support:0,passport_support:.25},{country:"GMB",id_card_support:0,residence_permit_support:0,passport_support:.75},{country:"ZWE",id_card_support:0,residence_permit_support:0,passport_support:.25},{country:"TLS",id_card_support:0,residence_permit_support:0,passport_support:.25}],je=(0, ob.default)("zkpassport:registry"),rw={1:{rpcUrl:"https://eth-mainnet.g.alchemy.com/v2/in6UjcATST36yyKuk83yb1yukKs65u8G",rootRegistry:"0x1D0000020038d6E40E1d98e09fA1bb3A7DAA8B70",registryHelper:"0x8C93bB3a7ED88dA0647Ea53f8cd3f57832a513Cd",packagedCertsUrlGenerator:Bl,circuitManifestUrlGenerator:Tl,packagedCircuitUrlGenerator:kl},8453:{rpcUrl:"https://base-mainnet.g.alchemy.com/v2/in6UjcATST36yyKuk83yb1yukKs65u8G",rootRegistry:"0x1D0000020038d6E40E1d98e09fA1bb3A7DAA8B70",registryHelper:"0xC404C605130F3345E1A2BFdf3BAFABED7234cCa7",packagedCertsUrlGenerator:Bl,circuitManifestUrlGenerator:Tl,packagedCircuitUrlGenerator:kl},11155111:{rpcUrl:"https://eth-sepolia.g.alchemy.com/v2/in6UjcATST36yyKuk83yb1yukKs65u8G",rootRegistry:"0x1D0000020038d6E40E1d98e09fA1bb3A7DAA8B70",registryHelper:"0x6Ee299B1E8049fadc3494f1110A3479f5BE8EC0e",packagedCertsUrlGenerator:Bl,circuitManifestUrlGenerator:Tl,packagedCircuitUrlGenerator:kl},31337:{rpcUrl:"http://localhost:8545",rootRegistry:"0x5FbDB2315678afecb367f032d93F642f64180aa3",registryHelper:"0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512",packagedCertsUrlGenerator:Bl,circuitManifestUrlGenerator:Tl,packagedCircuitUrlGenerator:kl}},Nl=class _p{constructor({rpcUrl:e,rootRegistry:r,chainId:i,registryHelper:n,packagedCertsUrlGenerator:o,circuitManifestUrlGenerator:s,packagedCircuitUrlGenerator:a,retryCount:l}={}){if(i===void 0)throw new Error("chainId is required");this.chainId=i;let c=rw[i];this.rpcUrl=e||c?.rpcUrl,this.rootRegistry=r||c?.rootRegistry,this.registryHelper=n||c?.registryHelper,this.packagedCertsUrlGenerator=o||c?.packagedCertsUrlGenerator,this.circuitManifestUrlGenerator=s||c?.circuitManifestUrlGenerator,this.packagedCircuitUrlGenerator=a||c?.packagedCircuitUrlGenerator,this.retryCount=l||ZC;}async getLatestCertificateRoot(){je("Getting latest certificate root",{registry:this.rootRegistry});let e=await this.rpcRequest(this.rootRegistry,J4+un.toString(16).padStart(64,"0"));if(!e.ok)throw new Error(`Failed to get latest certificate root: ${e.status} ${e.statusText}`);let r=await e.json();if(r.error)throw new Error(`Error from blockchain: ${r.error.message}`);return je(`Got latest certificates root: ${r.result}`),r.result}async isCertificateRootValid(e,r){e=Rt(e);let i=r??Math.floor(Date.now()/1e3),n=await this.rpcRequest(this.rootRegistry,nb+un.toString(16).padStart(64,"0")+wi(e)+i.toString(16).padStart(64,"0"));if(!n.ok)throw new Error(`Error checking if certificate root is valid: ${n.status} ${n.statusText}`);let o=await n.json();if(o.error)throw new Error(`Error from blockchain: ${o.error.message}`);return parseInt(wi(o.result))===1}async getCertificates(e,{validate:r=true,ipfs:i=false}={}){if(e?e=Rt(e):e=await this.getLatestCertificateRoot(),i)throw new Error("IPFS flag not implemented");let n=this.packagedCertsUrlGenerator(this.chainId,e);je("Getting certificates from:",n);let o=await Us(()=>fetch(n),this.retryCount);if(!o.ok)throw new Error(`Failed to get certificates for root ${e}: ${o.status} ${o.statusText}, URL: ${n}`);let s=await o.json();if(s.version||(s.version=0),je(`Got ${s.certificates?.length||0} packaged certificates (schema version ${s.version})`),!s.certificates||!Array.isArray(s.certificates))throw new Error("Invalid certificates returned");let a=s.version===0?s.serialised:s.certificates_serialised;if(!a||!Array.isArray(a))throw new Error("Invalid serialised certificates tree returned");for(let l of s.certificates)l.fingerprint&&(l.fingerprint=Rt(l.fingerprint));if(r&&!await _p.validateCertificates(s,e))throw new Error(`Validation failed for packaged certificates: ${e}`);return s}static async validateCertificates(e,r){try{let i=await j4(e),n=Rt(r),o=i.toLowerCase()===n.toLowerCase();return je(o?`Validated packaged certificates against root ${i}`:`Error validating packaged certificates. Expected: ${n} Got: ${i}`),o}catch(i){return console.error("Error validating circuit manifest:",i),false}}async getHistoricalCertificateRoots(e,r=Pl){if(!this.registryHelper)throw new Error("Historical roots helper address not configured");let i=typeof e=="string"?wi(e):e??1,n=typeof i=="number"?`${eb}${un.toString(16).padStart(64,"0")}${i.toString(16).padStart(64,"0")}${r.toString(16).padStart(64,"0")}`:`${tb}${un.toString(16).padStart(64,"0")}${i.padStart(64,"0")}${r.toString(16).padStart(64,"0")}`;try{let o=await this.rpcRequest(this.registryHelper,n);return this._handleHistoricalRootsResponse(o)}catch(o){throw o instanceof Error?o:new Error(String(o))}}async getAllHistoricalCertificateRoots(e=Pl,r){if(!this.registryHelper)throw new Error("Historical roots helper address is not configured");let i=0,n=false,o=1,s=[];for(;!n;){let{roots:a,isLastPage:l}=await this.getHistoricalCertificateRoots(o,e);if(s.push(...a),n=l,i++,a.length>0&&(o+=a.length),r&&r(i,a,s.length,n),a.length===0)break}return s}async getCertificateRootDetails(e){if(e){je("Getting certificate root details");let i=await this.rpcRequest(this.registryHelper,ib+un.toString(16).padStart(64,"0")+wi(e).padStart(64,"0"));if(!i.ok)throw new Error(`Failed to get certificate root details: ${i.status} ${i.statusText}`);return this._handleRootDetailsResponse(i)}je("Getting latest certificate root details");let r=await this.rpcRequest(this.registryHelper,rb+un.toString(16).padStart(64,"0"));if(!r.ok)throw new Error(`Failed to get latest certificate root details: ${r.status} ${r.statusText}`);return this._handleRootDetailsResponse(r)}async getLatestCircuitRoot(){je("Getting latest circuit root",{registry:this.rootRegistry});let e=await this.rpcRequest(this.rootRegistry,J4+fn.toString(16).padStart(64,"0"));if(!e.ok)throw new Error(`Failed to get latest circuit root: ${e.status} ${e.statusText}`);let r=await e.json();if(r.error)throw new Error(`Error from blockchain: ${r.error.message}`);return je(`Got latest circuit root: ${r.result}`),r.result}async isCircuitRootValid(e,r){e=Rt(e);let i=r??Math.floor(Date.now()/1e3),n=await this.rpcRequest(this.rootRegistry,nb+fn.toString(16).padStart(64,"0")+wi(e)+i.toString(16).padStart(64,"0"));if(!n.ok)throw new Error(`Error checking if circuit root is valid: ${n.status} ${n.statusText}`);let o=await n.json();if(o.error)throw new Error(`Error from blockchain: ${o.error.message}`);return parseInt(wi(o.result))===1}async getCircuitManifest(e,{validate:r=true,ipfs:i=false,version:n=void 0}={}){if(!e&&!n?e=await this.getLatestCircuitRoot():e&&(e=Rt(e)),i)throw new Error("IPFS flag not implemented");let o=this.circuitManifestUrlGenerator(this.chainId,{root:e,version:n});je("Getting circuit manifest from:",o);let s=await Us(()=>fetch(o),this.retryCount);if(!s.ok)throw new Error(`Failed to get circuit manifest for root ${e}: ${s.status} ${s.statusText}, URL: ${o}`);let a=await s.json();if(!a.version||!a.root||!a.circuits)throw new Error("Invalid circuit manifest returned");if(je(`Got circuit manifest for root ${e}`),r&&!await this.validateCircuitManifest(a,e))throw new Error(`Validation failed for circuit manifest: ${e}`);return a}async validateCircuitManifest(e,r){try{let i=Object.values(e.circuits).map(a=>a.hash),n=Rt(await X4({hashes:i})),o=Rt(r||e.root),s=n.toLowerCase()===o.toLowerCase();return je(s?`Validated circuit manifest against root ${n}`:`Error validating circuit manifest. Expected: ${o} Got: ${n}`),s}catch(i){return console.error("Error validating circuit manifest:",i),false}}static async validatePackagedCircuit(e,r){let i=Rt(r||e.vkey_hash),n=H4(ul.fromBase64(e.vkey).toUInt8Array()),o=Rt((await Ee(n.map(BigInt))).toString(16)),s=o===i;return je(s?`Validated packaged circuit against hash ${i}`:`Error validating packaged circuit. Expected: ${i} Got: ${o}`),s}async getPackagedCircuit(e,r,{validate:i=true,ipfs:n=false}={}){if(n)throw new Error("IPFS flag not implemented");let o=r.circuits[e]?.hash||null;if(!o)throw new Error(`Circuit ${e} not found in manifest`);let s=this.packagedCircuitUrlGenerator(this.chainId,o);je("Getting packaged circuit from:",s);let a=await Us(()=>fetch(s),this.retryCount);if(!a.ok)throw new Error(`Failed to get packaged circuit for ${e}: ${a.status} ${a.statusText}`);let l=await a.json();if(!l.name||!l.hash||!l.noir_version||!l.bb_version)throw new Error(`Invalid packaged circuit returned for ${e}`);if(je(`Got packaged circuit for ${e}`),i&&!await _p.validatePackagedCircuit(l,o))throw new Error(`Validation failed for packaged circuit: ${e}`);return l}async getHistoricalCircuitRoots(e,r=Pl){if(!this.registryHelper)throw new Error("Historical roots helper address not configured");let i=typeof e=="string"?wi(e):e??1,n=typeof i=="number"?`${eb}${fn.toString(16).padStart(64,"0")}${i.toString(16).padStart(64,"0")}${r.toString(16).padStart(64,"0")}`:`${tb}${fn.toString(16).padStart(64,"0")}${i.padStart(64,"0")}${r.toString(16).padStart(64,"0")}`;try{let o=await this.rpcRequest(this.registryHelper,n);return this._handleHistoricalRootsResponse(o)}catch(o){throw o instanceof Error?o:new Error(String(o))}}async getAllHistoricalCircuitRoots(e=Pl,r){if(!this.registryHelper)throw new Error("Historical roots helper address is not configured");let i=0,n=false,o=1,s=[];for(;!n;){let{roots:a,isLastPage:l}=await this.getHistoricalCircuitRoots(o,e);if(s.push(...a),n=l,i++,a.length>0&&(o+=a.length),r&&r(i,a,s.length,n),a.length===0)break}return s}async getCircuitRootDetails(e){if(e){je("Getting circuit root details");let i=await this.rpcRequest(this.registryHelper,ib+fn.toString(16).padStart(64,"0")+wi(e).padStart(64,"0"));if(!i.ok)throw new Error(`Failed to get circuit root details: ${i.status} ${i.statusText}`);return this._handleRootDetailsResponse(i)}je("Getting latest circuit root details");let r=await this.rpcRequest(this.registryHelper,rb+fn.toString(16).padStart(64,"0"));if(!r.ok)throw new Error(`Failed to get latest circuit root details: ${r.status} ${r.statusText}`);return this._handleRootDetailsResponse(r)}async getRegistryAddress(e){je(`Getting registry address for ID ${e} from root registry ${this.rootRegistry}`);let r;if(typeof e=="string"&&e.startsWith("0x"))r=`0x${e.substring(2).padStart(64,"0")}`;else if(typeof e=="number")r=`0x${e.toString(16).padStart(64,"0")}`;else throw new Error(`Invalid registry ID: ${e}`);try{let i=await this.rpcRequest(this.rootRegistry,`${ew}${r.slice(2)}`);if(!i.ok)throw new Error(`Error getting address for registry ID ${e}: ${i.status} ${i.statusText}`);let n=await i.json();if(n.error)throw new Error(`Error getting address for registry ID ${e}: ${n.error.message}`);if(n.result==="0x0000000000000000000000000000000000000000000000000000000000000000")throw new Error(`Registry ID ${e} doesn't exist`);let o=`0x${n.result.slice(-40)}`;return je(`Got address for registry ID ${e}: ${o}`),o}catch(i){throw new Error(`Error getting address for registry ID ${e}: ${i}`)}}async isDocumentSupported(e,r,i="passport"){if(r&&!(await this.getCertificates()).certificates.filter(o=>o.country===e).some(o=>Math.floor(r.getTime()/1e3)>=o.validity.not_before))return 0;let n=tw.find(o=>o.country===e);return n?n[`${i}_support`]:0}getRootRegistryAddress(){return this.rootRegistry}getRegistryHelperAddress(){return this.registryHelper}async getCertificateRegistryAddress(){return this.getRegistryAddress(un)}async getCircuitRegistryAddress(){return this.getRegistryAddress(fn)}getUrlForPackagedCertificates(e,r){return this.packagedCertsUrlGenerator(this.chainId,e,r)}getUrlForCircuitManifestByRoot(e){return this.circuitManifestUrlGenerator(this.chainId,{root:e})}getUrlForCircuitManifestByVersion(e){return this.circuitManifestUrlGenerator(this.chainId,{version:e})}getUrlForCircuitManifestByCid(e){return this.circuitManifestUrlGenerator(this.chainId,{cid:e})}getUrlForPackagedCircuits(e,r){return this.packagedCircuitUrlGenerator(this.chainId,e,r)}async rpcRequest(e,r){return Us(()=>fetch(this.rpcUrl,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({jsonrpc:"2.0",id:Math.floor(Math.random()*1e6),method:"eth_call",params:[{to:e,data:r},"latest"]})}),this.retryCount)}async _handleRootDetailsResponse(e){let r=await e.json();if(r.error)throw new Error(`Error from node: ${r.error.message}`);if(r.result){let i=r.result.slice(2),n=parseInt(i.slice(0,64),16),o=`0x${i.slice(64,128)}`,s=new Date(parseInt(i.slice(128,192),16)*1e3),a=parseInt(i.slice(192,256),16),l=a===0?void 0:new Date(a*1e3),c=parseInt(i.slice(256,320),16)===1,d=parseInt(i.slice(320,384),16),u=bp(`0x${i.slice(384,448)}`),h=i.slice(448,512),y=i.slice(512,576),b=i.slice(576,640),x=h===""?void 0:`0x${h}`,m=y===""?void 0:`0x${y}`,A=b===""?void 0:`0x${b}`;return {index:n,root:o,validFrom:s,validTo:l,revoked:c,leaves:d,cid:u,...x!==void 0&&{metadata1:x},...m!==void 0&&{metadata2:m},...A!==void 0&&{metadata3:A},isLatest:l===void 0}}else throw new Error("No result returned from node")}async _handleHistoricalRootsResponse(e){let r=await e.json();if(r.error)throw new Error(r?.error?.message||"Error getting roots");if(r.result){let i=r.result.slice(2),n=parseInt(i.slice(0,64),16),o=parseInt(i.slice(64,128),16)===1,s=i.slice(n*2),a=parseInt(s.slice(0,64),16),l=[],c=10;for(let d=0;d<a;d++){let u=64+d*c*64,h=parseInt(s.slice(u,u+64),16),y=`0x${s.slice(u+64,u+128)}`,b=new Date(parseInt(s.slice(u+128,u+192),16)*1e3),x=parseInt(s.slice(u+192,u+256),16),m=x===0?void 0:new Date(x*1e3),A=parseInt(s.slice(u+256,u+320),16)===1,_=parseInt(s.slice(u+320,u+384),16),w=bp(`0x${s.slice(u+384,u+448)}`),I=s.slice(u+448,u+512),N=s.slice(u+512,u+576),H=s.slice(u+576,u+640),O=I===""?void 0:`0x${I}`,U=N===""?void 0:`0x${N}`,F=H===""?void 0:`0x${H}`;l.push({root:y,validFrom:b,validTo:m,revoked:A,cid:w,leaves:_,...O!==void 0&&{metadata1:O},...U!==void 0&&{metadata2:U},...F!==void 0&&{metadata3:F},isLatest:d===a-1&&o,index:h});}return {roots:l,isLastPage:o}}return {roots:[],isLastPage:true}}};var sb=(t=>typeof _e<"u"?_e:typeof Proxy<"u"?new Proxy(t,{get:(e,r)=>(typeof _e<"u"?_e:e)[r]}):t)(function(t){if(typeof _e<"u")return _e.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')});function iw(){return typeof process<"u"&&process.versions!=null&&typeof window>"u"}async function z0(t,e){if(iw())try{let r=await Promise.resolve().then(()=>tt(cb(),1)).catch(()=>{try{return {default:sb("ws")}}catch{throw new Error("WebSocket implementation 'ws' not found. Please install it with: npm install ws")}}),i=r.default||r.WebSocket||r;return new i(t,{headers:{Origin:e||"nodejs"}})}catch(r){throw console.error("Failed to create WebSocket client:",r),new Error("WebSocket implementation 'ws' not found. Please install it with: npm install ws")}return new WebSocket(t)}var lb=10,db="wss://bridge.zkpassport.id",ub=3e4,Dl="1";var nw=typeof window<"u"?{getRandomValues:t=>window.crypto.getRandomValues(t)}:globalThis.crypto,Cp=typeof window<"u"?window.crypto:typeof globalThis<"u"&&globalThis.crypto?globalThis.crypto:nw;function fb(t){let e=new Uint8Array(t);if(Cp&&typeof Cp.getRandomValues=="function")return Cp.getRandomValues(e),e;throw new Error("No secure random number generator available in this environment. Make sure you're in a secure context that provides crypto APIs.")}function pb(t){try{let e=new URL(t);return `${e.protocol}//${e.host.split(":")[0]}`}catch{return t}}function Vs(t=16){let e=fb(t);return Buffer.from(e).toString("hex")}function hb(t){return t instanceof Uint8Array||ArrayBuffer.isView(t)&&t.constructor.name==="Uint8Array"}function it(t,...e){if(!hb(t))throw new Error("Uint8Array expected");if(e.length>0&&!e.includes(t.length))throw new Error("Uint8Array expected of length "+e+", got length="+t.length)}function $0(t,e=true){if(t.destroyed)throw new Error("Hash instance has been destroyed");if(e&&t.finished)throw new Error("Hash#digest() has already been called")}function wp(t,e){it(t);let r=e.outputLen;if(t.length<r)throw new Error("digestInto() expects output buffer of length at least "+r)}function mb(t){return new Uint8Array(t.buffer,t.byteOffset,t.byteLength)}function vr(t){return new Uint32Array(t.buffer,t.byteOffset,Math.floor(t.byteLength/4))}function Er(...t){for(let e=0;e<t.length;e++)t[e].fill(0);}function js(t){return new DataView(t.buffer,t.byteOffset,t.byteLength)}var sw=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68,aw=typeof Uint8Array.from([]).toHex=="function"&&typeof Uint8Array.fromHex=="function",cw=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));function V0(t){if(it(t),aw)return t.toHex();let e="";for(let r=0;r<t.length;r++)e+=cw[t[r]];return e}function Ip(t){if(typeof t!="string")throw new Error("string expected");return new Uint8Array(new TextEncoder().encode(t))}function Xs(t){if(typeof t=="string")t=Ip(t);else if(hb(t))t=Co(t);else throw new Error("Uint8Array expected, got "+typeof t);return t}function gb(t,e){if(t.length!==e.length)return false;let r=0;for(let i=0;i<t.length;i++)r|=t[i]^e[i];return r===0}var yb=(t,e)=>{function r(i,...n){if(it(i),!sw)throw new Error("Non little-endian hardware is not yet supported");if(t.nonceLength!==void 0){let d=n[0];if(!d)throw new Error("nonce / iv required");t.varSizeNonce?it(d):it(d,t.nonceLength);}let o=t.tagLength;o&&n[1]!==void 0&&it(n[1]);let s=e(i,...n),a=(d,u)=>{if(u!==void 0){if(d!==2)throw new Error("cipher output not supported");it(u);}},l=false;return {encrypt(d,u){if(l)throw new Error("cannot encrypt() twice with same key + nonce");return l=true,it(d),a(s.encrypt.length,u),s.encrypt(d,u)},decrypt(d,u){if(it(d),o&&d.length<o)throw new Error("invalid ciphertext length: smaller than tagLength="+o);return a(s.decrypt.length,u),s.decrypt(d,u)}}}return Object.assign(r,t),r};function bb(t,e,r=true){if(e===void 0)return new Uint8Array(t);if(e.length!==t)throw new Error("invalid output length, expected "+t+", got: "+e.length);if(r&&!j0(e))throw new Error("invalid output, must be aligned");return e}function Rl(t,e,r,i){if(typeof t.setBigUint64=="function")return t.setBigUint64(e,r,i);let n=BigInt(32),o=BigInt(4294967295),s=Number(r>>n&o),a=Number(r&o),l=0,c=4;t.setUint32(e+l,s,i),t.setUint32(e+c,a,i);}function Sb(t,e,r){let i=new Uint8Array(16),n=js(i);return Rl(n,0,BigInt(e),r),Rl(n,8,BigInt(t),r),i}function j0(t){return t.byteOffset%4===0}function Co(t){return Uint8Array.from(t)}var Ii=16,Ep=new Uint8Array(16),$r=vr(Ep),lw=225,dw=(t,e,r,i)=>{let n=i&1;return {s3:r<<31|i>>>1,s2:e<<31|r>>>1,s1:t<<31|e>>>1,s0:t>>>1^lw<<24&-(n&1)}},ir=t=>(t>>>0&255)<<24|(t>>>8&255)<<16|(t>>>16&255)<<8|t>>>24&255|0;function uw(t){t.reverse();let e=t[15]&1,r=0;for(let i=0;i<t.length;i++){let n=t[i];t[i]=n>>>1|r,r=(n&1)<<7;}return t[0]^=-e&225,t}var fw=t=>t>64*1024?8:t>1024?4:2,Ol=class{constructor(e,r){this.blockLen=Ii,this.outputLen=Ii,this.s0=0,this.s1=0,this.s2=0,this.s3=0,this.finished=false,e=Xs(e),it(e,16);let i=js(e),n=i.getUint32(0,false),o=i.getUint32(4,false),s=i.getUint32(8,false),a=i.getUint32(12,false),l=[];for(let b=0;b<128;b++)l.push({s0:ir(n),s1:ir(o),s2:ir(s),s3:ir(a)}),{s0:n,s1:o,s2:s,s3:a}=dw(n,o,s,a);let c=fw(r||1024);if(![1,2,4,8].includes(c))throw new Error("ghash: invalid window size, expected 2, 4 or 8");this.W=c;let u=128/c,h=this.windowSize=2**c,y=[];for(let b=0;b<u;b++)for(let x=0;x<h;x++){let m=0,A=0,_=0,w=0;for(let I=0;I<c;I++){if(!(x>>>c-I-1&1))continue;let{s0:H,s1:O,s2:U,s3:F}=l[c*b+I];m^=H,A^=O,_^=U,w^=F;}y.push({s0:m,s1:A,s2:_,s3:w});}this.t=y;}_updateBlock(e,r,i,n){e^=this.s0,r^=this.s1,i^=this.s2,n^=this.s3;let{W:o,t:s,windowSize:a}=this,l=0,c=0,d=0,u=0,h=(1<<o)-1,y=0;for(let b of [e,r,i,n])for(let x=0;x<4;x++){let m=b>>>8*x&255;for(let A=8/o-1;A>=0;A--){let _=m>>>o*A&h,{s0:w,s1:I,s2:N,s3:H}=s[y*a+_];l^=w,c^=I,d^=N,u^=H,y+=1;}}this.s0=l,this.s1=c,this.s2=d,this.s3=u;}update(e){$0(this),e=Xs(e),it(e);let r=vr(e),i=Math.floor(e.length/Ii),n=e.length%Ii;for(let o=0;o<i;o++)this._updateBlock(r[o*4+0],r[o*4+1],r[o*4+2],r[o*4+3]);return n&&(Ep.set(e.subarray(i*Ii)),this._updateBlock($r[0],$r[1],$r[2],$r[3]),Er($r)),this}destroy(){let{t:e}=this;for(let r of e)r.s0=0,r.s1=0,r.s2=0,r.s3=0;}digestInto(e){$0(this),wp(e,this),this.finished=true;let{s0:r,s1:i,s2:n,s3:o}=this,s=vr(e);return s[0]=r,s[1]=i,s[2]=n,s[3]=o,e}digest(){let e=new Uint8Array(Ii);return this.digestInto(e),this.destroy(),e}},vp=class extends Ol{constructor(e,r){e=Xs(e),it(e);let i=uw(Co(e));super(i,r),Er(i);}update(e){e=Xs(e),$0(this);let r=vr(e),i=e.length%Ii,n=Math.floor(e.length/Ii);for(let o=0;o<n;o++)this._updateBlock(ir(r[o*4+3]),ir(r[o*4+2]),ir(r[o*4+1]),ir(r[o*4+0]));return i&&(Ep.set(e.subarray(n*Ii)),this._updateBlock(ir($r[3]),ir($r[2]),ir($r[1]),ir($r[0])),Er($r)),this}digestInto(e){$0(this),wp(e,this),this.finished=true;let{s0:r,s1:i,s2:n,s3:o}=this,s=vr(e);return s[0]=r,s[1]=i,s[2]=n,s[3]=o,e.reverse()}};function xb(t){let e=(i,n)=>t(n,i.length).update(Xs(i)).digest(),r=t(new Uint8Array(16),0);return e.outputLen=r.outputLen,e.blockLen=r.blockLen,e.create=(i,n)=>t(i,n),e}var Bp=xb((t,e)=>new Ol(t,e));xb((t,e)=>new vp(t,e));var kp=16,hw=4,Ml=new Uint8Array(kp),mw=283;function Pp(t){return t<<1^mw&-(t>>7)}function Ab(t,e){let r=0;for(;e>0;e>>=1)r^=t&-(e&1),t=Pp(t);return r}var gw=(()=>{let t=new Uint8Array(256);for(let r=0,i=1;r<256;r++,i^=Pp(i))t[r]=i;let e=new Uint8Array(256);e[0]=99;for(let r=0;r<255;r++){let i=t[255-r];i|=i<<8,e[t[r]]=(i^i>>4^i>>5^i>>6^i>>7^99)&255;}return Er(t),e})();var yw=t=>t<<24|t>>>8,Tp=t=>t<<8|t>>>24;function bw(t,e){if(t.length!==256)throw new Error("Wrong sbox length");let r=new Uint32Array(256).map((c,d)=>e(t[d])),i=r.map(Tp),n=i.map(Tp),o=n.map(Tp),s=new Uint32Array(256*256),a=new Uint32Array(256*256),l=new Uint16Array(256*256);for(let c=0;c<256;c++)for(let d=0;d<256;d++){let u=c*256+d;s[u]=r[c]^i[d],a[u]=n[c]^o[d],l[u]=t[c]<<8|t[d];}return {sbox:t,sbox2:l,T0:r,T1:i,T2:n,T3:o,T01:s,T23:a}}var Cb=bw(gw,t=>Ab(t,3)<<24|t<<16|t<<8|Ab(t,2));var Sw=(()=>{let t=new Uint8Array(16);for(let e=0,r=1;e<16;e++,r=Pp(r))t[e]=r;return t})();function xw(t){it(t);let e=t.length;if(![16,24,32].includes(e))throw new Error("aes: invalid key size, should be 16, 24 or 32, got "+e);let{sbox2:r}=Cb,i=[];j0(t)||i.push(t=Co(t));let n=vr(t),o=n.length,s=l=>X0(r,l,l,l,l),a=new Uint32Array(e+28);a.set(n);for(let l=o;l<a.length;l++){let c=a[l-1];l%o===0?c=s(yw(c))^Sw[l/o-1]:o>6&&l%o===4&&(c=s(c)),a[l]=a[l-o]^c;}return Er(...i),a}function Fl(t,e,r,i,n,o){return t[r<<8&65280|i>>>8&255]^e[n>>>8&65280|o>>>24&255]}function X0(t,e,r,i,n){return t[e&255|r&65280]|t[i>>>16&255|n>>>16&65280]<<16}function _b(t,e,r,i,n){let{sbox2:o,T01:s,T23:a}=Cb,l=0;e^=t[l++],r^=t[l++],i^=t[l++],n^=t[l++];let c=t.length/4-2;for(let b=0;b<c;b++){let x=t[l++]^Fl(s,a,e,r,i,n),m=t[l++]^Fl(s,a,r,i,n,e),A=t[l++]^Fl(s,a,i,n,e,r),_=t[l++]^Fl(s,a,n,e,r,i);e=x,r=m,i=A,n=_;}let d=t[l++]^X0(o,e,r,i,n),u=t[l++]^X0(o,r,i,n,e),h=t[l++]^X0(o,i,n,e,r),y=t[l++]^X0(o,n,e,r,i);return {s0:d,s1:u,s2:h,s3:y}}function Ul(t,e,r,i,n){it(r,kp),it(i),n=bb(i.length,n);let o=r,s=vr(o),a=js(o),l=vr(i),c=vr(n),d=12,u=i.length,h=a.getUint32(d,e),{s0:y,s1:b,s2:x,s3:m}=_b(t,s[0],s[1],s[2],s[3]);for(let _=0;_+4<=l.length;_+=4)c[_+0]=l[_+0]^y,c[_+1]=l[_+1]^b,c[_+2]=l[_+2]^x,c[_+3]=l[_+3]^m,h=h+1>>>0,a.setUint32(d,h,e),{s0:y,s1:b,s2:x,s3:m}=_b(t,s[0],s[1],s[2],s[3]);let A=kp*Math.floor(l.length/hw);if(A<u){let _=new Uint32Array([y,b,x,m]),w=mb(_);for(let I=A,N=0;I<u;I++,N++)n[I]=i[I]^w[N];Er(_);}return n}function Aw(t,e,r,i,n){let o=n?n.length:0,s=t.create(r,i.length+o);n&&s.update(n);let a=Sb(8*i.length,8*o,e);s.update(i),s.update(a);let l=s.digest();return Er(a),l}var Np=yb({blockSize:16,nonceLength:12,tagLength:16,varSizeNonce:true},function(e,r,i){if(r.length<8)throw new Error("aes/gcm: invalid nonce length");let n=16;function o(a,l,c){let d=Aw(Bp,false,a,c,i);for(let u=0;u<l.length;u++)d[u]^=l[u];return d}function s(){let a=xw(e),l=Ml.slice(),c=Ml.slice();if(Ul(a,false,c,c,l),r.length===12)c.set(r);else {let u=Ml.slice(),h=js(u);Rl(h,8,BigInt(r.length*8),false);let y=Bp.create(l).update(r).update(u);y.digestInto(c),y.destroy();}let d=Ul(a,false,c,Ml);return {xk:a,authKey:l,counter:c,tagMask:d}}return {encrypt(a){let{xk:l,authKey:c,counter:d,tagMask:u}=s(),h=new Uint8Array(a.length+n),y=[l,c,d,u];j0(a)||y.push(a=Co(a)),Ul(l,false,d,a,h.subarray(0,a.length));let b=o(c,u,h.subarray(0,h.length-n));return y.push(b),h.set(b,a.length),Er(...y),h},decrypt(a){let{xk:l,authKey:c,counter:d,tagMask:u}=s(),h=[l,c,u,d];j0(a)||h.push(a=Co(a));let y=a.subarray(0,-n),b=a.subarray(-n),x=o(c,u,y);if(h.push(x),!gb(x,b))throw new Error("aes/gcm: invalid ghash tag");let m=Ul(l,false,d,y);return Er(...h),m}}});var _w={p:0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2fn,n:0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141n,b:7n,Gx:0x79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798n,Gy:0x483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8n},{p:Io,n:Fp,Gx:Cw,Gy:ww,b:Pb}=_w,vo=32,Dp=64,Ot=(t="")=>{throw new Error(t)},Nb=t=>typeof t=="bigint",Db=t=>typeof t=="string",Iw=t=>t instanceof Uint8Array||ArrayBuffer.isView(t)&&t.constructor.name==="Uint8Array",W0=(t,e)=>!Iw(t)||typeof e=="number"&&e>0&&t.length!==e?Ot("Uint8Array expected"):t,Up=t=>new Uint8Array(t),vw=t=>Uint8Array.from(t),Rb=(t,e)=>t.toString(16).padStart(e,"0"),Ob=t=>Array.from(W0(t)).map(e=>Rb(e,2)).join(""),vi={_0:48,_9:57,A:65,F:70,a:97,f:102},wb=t=>{if(t>=vi._0&&t<=vi._9)return t-vi._0;if(t>=vi.A&&t<=vi.F)return t-(vi.A-10);if(t>=vi.a&&t<=vi.f)return t-(vi.a-10)},Mb=t=>{let e="hex invalid";if(!Db(t))return Ot(e);let r=t.length,i=r/2;if(r%2)return Ot(e);let n=Up(i);for(let o=0,s=0;o<i;o++,s+=2){let a=wb(t.charCodeAt(s)),l=wb(t.charCodeAt(s+1));if(a===void 0||l===void 0)return Ot(e);n[o]=a*16+l;}return n},ql=(t,e)=>W0(Db(t)?Mb(t):vw(W0(t)),e),Ew=()=>globalThis?.crypto;var Ib=(...t)=>{let e=Up(t.reduce((i,n)=>i+W0(n).length,0)),r=0;return t.forEach(i=>{e.set(i,r),r+=i.length;}),e},Bw=(t=vo)=>Ew().getRandomValues(Up(t)),Hl=BigInt,Y0=(t,e,r,i="bad number: out of range")=>Nb(t)&&e<=t&&t<r?t:Ot(i),J=(t,e=Io)=>{let r=t%e;return r>=0n?r:e+r};var Tw=(t,e)=>{(t===0n||e<=0n)&&Ot("no inverse n="+t+" mod="+e);let r=J(t,e),i=e,n=0n,s=1n;for(;r!==0n;){let l=i/r,c=i%r,d=n-s*l;i=r,r=c,n=s,s=d;}return i===1n?J(n,e):Ot("no inverse")};var vb=t=>t instanceof hn?t:Ot("Point expected"),Fb=t=>J(J(t*t)*t+Pb),Eb=t=>Y0(t,0n,Io),Ll=t=>Y0(t,1n,Io),kw=t=>Y0(t,1n,Fp),Rp=t=>(t&1n)===0n,Ub=t=>Uint8Array.of(t),Pw=t=>Ub(Rp(t)?2:3),Nw=t=>{let e=Fb(Ll(t)),r=1n;for(let i=e,n=(Io+1n)/4n;n>0n;n>>=1n)n&1n&&(r=r*i%Io),i=i*i%Io;return J(r*r)===e?r:Ot("sqrt invalid")},Vr=class Vr{constructor(e,r,i){f(this,"px");f(this,"py");f(this,"pz");this.px=Eb(e),this.py=Ll(r),this.pz=Eb(i),Object.freeze(this);}static fromBytes(e){W0(e);let r,i=e[0],n=e.subarray(1),o=Bb(n,0,vo),s=e.length;if(s===vo+1&&[2,3].includes(i)){let a=Nw(o),l=Rp(a);Rp(Hl(i))!==l&&(a=J(-a)),r=new Vr(o,a,1n);}return s===Dp+1&&i===4&&(r=new Vr(o,Bb(n,vo,Dp),1n)),r?r.assertValidity():Ot("bad point: not on curve")}equals(e){let{px:r,py:i,pz:n}=this,{px:o,py:s,pz:a}=vb(e),l=J(r*a),c=J(o*n),d=J(i*a),u=J(s*n);return l===c&&d===u}is0(){return this.equals(wo)}negate(){return new Vr(this.px,J(-this.py),this.pz)}double(){return this.add(this)}add(e){let{px:r,py:i,pz:n}=this,{px:o,py:s,pz:a}=vb(e),l=0n,c=Pb,d=0n,u=0n,h=0n,y=J(c*3n),b=J(r*o),x=J(i*s),m=J(n*a),A=J(r+i),_=J(o+s);A=J(A*_),_=J(b+x),A=J(A-_),_=J(r+n);let w=J(o+a);return _=J(_*w),w=J(b+m),_=J(_-w),w=J(i+n),d=J(s+a),w=J(w*d),d=J(x+m),w=J(w-d),h=J(l*_),d=J(y*m),h=J(d+h),d=J(x-h),h=J(x+h),u=J(d*h),x=J(b+b),x=J(x+b),m=J(l*m),_=J(y*_),x=J(x+m),m=J(b-m),m=J(l*m),_=J(_+m),b=J(x*_),u=J(u+b),b=J(w*_),d=J(A*d),d=J(d-b),b=J(A*x),h=J(w*h),h=J(h+b),new Vr(d,u,h)}multiply(e,r=true){if(!r&&e===0n)return wo;if(kw(e),e===1n)return this;if(this.equals(pn))return Uw(e).p;let i=wo,n=pn;for(let o=this;e>0n;o=o.double(),e>>=1n)e&1n?i=i.add(o):r&&(n=n.add(o));return i}toAffine(){let{px:e,py:r,pz:i}=this;if(this.equals(wo))return {x:0n,y:0n};if(i===1n)return {x:e,y:r};let n=Tw(i,Io);return J(i*n)!==1n&&Ot("inverse invalid"),{x:J(e*n),y:J(r*n)}}assertValidity(){let{x:e,y:r}=this.toAffine();return Ll(e),Ll(r),J(r*r)===Fb(e)?this:Ot("bad point: not on curve")}toBytes(e=true){let{x:r,y:i}=this.assertValidity().toAffine(),n=Op(r);return e?Ib(Pw(i),n):Ib(Ub(4),n,Op(i))}static fromAffine(e){let{x:r,y:i}=e;return r===0n&&i===0n?wo:new Vr(r,i,1n)}toHex(e){return Ob(this.toBytes(e))}static fromPrivateKey(e){return pn.multiply(Z0(e))}static fromHex(e){return Vr.fromBytes(ql(e))}get x(){return this.toAffine().x}get y(){return this.toAffine().y}toRawBytes(e){return this.toBytes(e)}};f(Vr,"BASE"),f(Vr,"ZERO");var hn=Vr,pn=new hn(Cw,ww,1n),wo=new hn(0n,1n,0n);hn.BASE=pn;hn.ZERO=wo;var Lp=t=>Hl("0x"+(Ob(t)||"0")),Bb=(t,e,r)=>Lp(t.subarray(e,r)),Dw=2n**256n,Op=t=>Mb(Rb(Y0(t,0n,Dw),Dp)),Z0=t=>{let e=Nb(t)?t:Lp(ql(t,vo));return Y0(e,1n,Fp,"private key invalid 3")};var Lb=(t,e=true)=>pn.multiply(Z0(t)).toBytes(e);var Hb=(t,e,r=true)=>hn.fromBytes(ql(e)).multiply(Z0(t)).toBytes(r),Rw=t=>{t=ql(t),(t.length<vo+8||t.length>1024)&&Ot("expected 40-1024b");let e=J(Lp(t),Fp-1n);return Op(e+1n)},Ow=()=>Rw(Bw(vo+16));var Kb={normPrivateKeyToScalar:Z0,isValidPrivateKey:t=>{try{return !!Z0(t)}catch{return false}},randomPrivateKey:Ow,precompute:(t=8,e=pn)=>(e.multiply(3n),e)},Kl=8,Mw=256,qb=Math.ceil(Mw/Kl)+1,Mp=2**(Kl-1),Fw=()=>{let t=[],e=pn,r=e;for(let i=0;i<qb;i++){r=e,t.push(r);for(let n=1;n<Mp;n++)r=r.add(e),t.push(r);e=r.double();}return t},Tb,kb=(t,e)=>{let r=e.negate();return t?r:e},Uw=t=>{let e=Tb||(Tb=Fw()),r=wo,i=pn,n=2**Kl,o=n,s=Hl(n-1),a=Hl(Kl);for(let l=0;l<qb;l++){let c=Number(t&s);t>>=a,c>Mp&&(c-=o,t+=1n);let d=l*Mp,u=d,h=d+Math.abs(c)-1,y=l%2!==0,b=c<0;c===0?i=i.add(kb(y,e[u])):r=r.add(kb(b,e[h]));}return {p:r,f:i}};function Lw(t){return t instanceof Uint8Array||ArrayBuffer.isView(t)&&t.constructor.name==="Uint8Array"}function zl(t,...e){if(!Lw(t))throw new Error("Uint8Array expected");if(e.length>0&&!e.includes(t.length))throw new Error("Uint8Array expected of length "+e+", got length="+t.length)}function Hp(t,e=true){if(t.destroyed)throw new Error("Hash instance has been destroyed");if(e&&t.finished)throw new Error("Hash#digest() has already been called")}function Gb(t,e){zl(t);let r=e.outputLen;if(t.length<r)throw new Error("digestInto() expects output buffer of length at least "+r)}function Q0(...t){for(let e=0;e<t.length;e++)t[e].fill(0);}function $l(t){return new DataView(t.buffer,t.byteOffset,t.byteLength)}function Br(t,e){return t<<32-e|t>>>e}function Hw(t){if(typeof t!="string")throw new Error("string expected");return new Uint8Array(new TextEncoder().encode(t))}function Kp(t){return typeof t=="string"&&(t=Hw(t)),zl(t),t}var Gl=class{};function zb(t){let e=i=>t().update(Kp(i)).digest(),r=t();return e.outputLen=r.outputLen,e.blockLen=r.blockLen,e.create=()=>t(),e}function Kw(t,e,r,i){if(typeof t.setBigUint64=="function")return t.setBigUint64(e,r,i);let n=BigInt(32),o=BigInt(4294967295),s=Number(r>>n&o),a=Number(r&o),l=i?4:0,c=i?0:4;t.setUint32(e+l,s,i),t.setUint32(e+c,a,i);}function $b(t,e,r){return t&e^~t&r}function Vb(t,e,r){return t&e^t&r^e&r}var Vl=class extends Gl{constructor(e,r,i,n){super(),this.finished=false,this.length=0,this.pos=0,this.destroyed=false,this.blockLen=e,this.outputLen=r,this.padOffset=i,this.isLE=n,this.buffer=new Uint8Array(e),this.view=$l(this.buffer);}update(e){Hp(this),e=Kp(e),zl(e);let{view:r,buffer:i,blockLen:n}=this,o=e.length;for(let s=0;s<o;){let a=Math.min(n-this.pos,o-s);if(a===n){let l=$l(e);for(;n<=o-s;s+=n)this.process(l,s);continue}i.set(e.subarray(s,s+a),this.pos),this.pos+=a,s+=a,this.pos===n&&(this.process(r,0),this.pos=0);}return this.length+=e.length,this.roundClean(),this}digestInto(e){Hp(this),Gb(e,this),this.finished=true;let{buffer:r,view:i,blockLen:n,isLE:o}=this,{pos:s}=this;r[s++]=128,Q0(this.buffer.subarray(s)),this.padOffset>n-s&&(this.process(i,0),s=0);for(let u=s;u<n;u++)r[u]=0;Kw(i,n-8,BigInt(this.length*8),o),this.process(i,0);let a=$l(e),l=this.outputLen;if(l%4)throw new Error("_sha2: outputLen should be aligned to 32bit");let c=l/4,d=this.get();if(c>d.length)throw new Error("_sha2: outputLen bigger than state");for(let u=0;u<c;u++)a.setUint32(4*u,d[u],o);}digest(){let{buffer:e,outputLen:r}=this;this.digestInto(e);let i=e.slice(0,r);return this.destroy(),i}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());let{blockLen:r,buffer:i,length:n,finished:o,destroyed:s,pos:a}=this;return e.destroyed=s,e.finished=o,e.length=n,e.pos=a,n%r&&e.buffer.set(i),e}clone(){return this._cloneInto()}},Ei=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]);var qw=Uint32Array.from([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),mn=new Uint32Array(64),qp=class extends Vl{constructor(e=32){super(64,e,8,false),this.A=Ei[0]|0,this.B=Ei[1]|0,this.C=Ei[2]|0,this.D=Ei[3]|0,this.E=Ei[4]|0,this.F=Ei[5]|0,this.G=Ei[6]|0,this.H=Ei[7]|0;}get(){let{A:e,B:r,C:i,D:n,E:o,F:s,G:a,H:l}=this;return [e,r,i,n,o,s,a,l]}set(e,r,i,n,o,s,a,l){this.A=e|0,this.B=r|0,this.C=i|0,this.D=n|0,this.E=o|0,this.F=s|0,this.G=a|0,this.H=l|0;}process(e,r){for(let u=0;u<16;u++,r+=4)mn[u]=e.getUint32(r,false);for(let u=16;u<64;u++){let h=mn[u-15],y=mn[u-2],b=Br(h,7)^Br(h,18)^h>>>3,x=Br(y,17)^Br(y,19)^y>>>10;mn[u]=x+mn[u-7]+b+mn[u-16]|0;}let{A:i,B:n,C:o,D:s,E:a,F:l,G:c,H:d}=this;for(let u=0;u<64;u++){let h=Br(a,6)^Br(a,11)^Br(a,25),y=d+h+$b(a,l,c)+qw[u]+mn[u]|0,x=(Br(i,2)^Br(i,13)^Br(i,22))+Vb(i,n,o)|0;d=c,c=l,l=a,a=s+y|0,s=o,o=n,n=i,i=y+x|0;}i=i+this.A|0,n=n+this.B|0,o=o+this.C|0,s=s+this.D|0,a=a+this.E|0,l=l+this.F|0,c=c+this.G|0,d=d+this.H|0,this.set(i,n,o,s,a,l,c,d);}roundClean(){Q0(mn);}destroy(){this.set(0,0,0,0,0,0,0,0),Q0(this.buffer);}};var jb=zb(()=>new qp);async function Xb(t){let r=new TextEncoder().encode(t),i=await jb(r);return new Uint8Array(i).slice(0,12)}function jl(){let t=Kb.randomPrivateKey(),e=Lb(t);return {privateKey:t,publicKey:e}}function Gp(t,e){return Hb(t,e).slice(0,32)}async function J0(t,e,r){let i=await Xb(r),n=Np(e,i),o=Ip(t);return n.encrypt(o)}async function zp(t,e,r){let i=await Xb(r),o=Np(e,i).decrypt(t);return new TextDecoder().decode(o)}var y5=tt(G0(),1);function ea(t){let e=t.length;for(;--e>=0;)t[e]=0;}var Gw=0,D6=1,zw=2,$w=3,Vw=258,hh=29,hc=256,sc=hc+1+hh,Ys=30,mh=19,R6=2*sc+1,Eo=15,$p=16,jw=7,gh=256,O6=16,M6=17,F6=18,oh=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),Jl=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),Xw=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),U6=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Ww=512,Ti=new Array((sc+2)*2);ea(Ti);var ic=new Array(Ys*2);ea(ic);var ac=new Array(Ww);ea(ac);var cc=new Array(Vw-$w+1);ea(cc);var yh=new Array(hh);ea(yh);var ed=new Array(Ys);ea(ed);function Vp(t,e,r,i,n){this.static_tree=t,this.extra_bits=e,this.extra_base=r,this.elems=i,this.max_length=n,this.has_stree=t&&t.length;}var L6,H6,K6;function jp(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e;}var q6=t=>t<256?ac[t]:ac[256+(t>>>7)],lc=(t,e)=>{t.pending_buf[t.pending++]=e&255,t.pending_buf[t.pending++]=e>>>8&255;},Tt=(t,e,r)=>{t.bi_valid>$p-r?(t.bi_buf|=e<<t.bi_valid&65535,lc(t,t.bi_buf),t.bi_buf=e>>$p-t.bi_valid,t.bi_valid+=r-$p):(t.bi_buf|=e<<t.bi_valid&65535,t.bi_valid+=r);},Xr=(t,e,r)=>{Tt(t,r[e*2],r[e*2+1]);},G6=(t,e)=>{let r=0;do r|=t&1,t>>>=1,r<<=1;while(--e>0);return r>>>1},Zw=t=>{t.bi_valid===16?(lc(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=t.bi_buf&255,t.bi_buf>>=8,t.bi_valid-=8);},Yw=(t,e)=>{let r=e.dyn_tree,i=e.max_code,n=e.stat_desc.static_tree,o=e.stat_desc.has_stree,s=e.stat_desc.extra_bits,a=e.stat_desc.extra_base,l=e.stat_desc.max_length,c,d,u,h,y,b,x=0;for(h=0;h<=Eo;h++)t.bl_count[h]=0;for(r[t.heap[t.heap_max]*2+1]=0,c=t.heap_max+1;c<R6;c++)d=t.heap[c],h=r[r[d*2+1]*2+1]+1,h>l&&(h=l,x++),r[d*2+1]=h,!(d>i)&&(t.bl_count[h]++,y=0,d>=a&&(y=s[d-a]),b=r[d*2],t.opt_len+=b*(h+y),o&&(t.static_len+=b*(n[d*2+1]+y)));if(x!==0){do{for(h=l-1;t.bl_count[h]===0;)h--;t.bl_count[h]--,t.bl_count[h+1]+=2,t.bl_count[l]--,x-=2;}while(x>0);for(h=l;h!==0;h--)for(d=t.bl_count[h];d!==0;)u=t.heap[--c],!(u>i)&&(r[u*2+1]!==h&&(t.opt_len+=(h-r[u*2+1])*r[u*2],r[u*2+1]=h),d--);}},z6=(t,e,r)=>{let i=new Array(Eo+1),n=0,o,s;for(o=1;o<=Eo;o++)n=n+r[o-1]<<1,i[o]=n;for(s=0;s<=e;s++){let a=t[s*2+1];a!==0&&(t[s*2]=G6(i[a]++,a));}},Qw=()=>{let t,e,r,i,n,o=new Array(Eo+1);for(r=0,i=0;i<hh-1;i++)for(yh[i]=r,t=0;t<1<<oh[i];t++)cc[r++]=i;for(cc[r-1]=i,n=0,i=0;i<16;i++)for(ed[i]=n,t=0;t<1<<Jl[i];t++)ac[n++]=i;for(n>>=7;i<Ys;i++)for(ed[i]=n<<7,t=0;t<1<<Jl[i]-7;t++)ac[256+n++]=i;for(e=0;e<=Eo;e++)o[e]=0;for(t=0;t<=143;)Ti[t*2+1]=8,t++,o[8]++;for(;t<=255;)Ti[t*2+1]=9,t++,o[9]++;for(;t<=279;)Ti[t*2+1]=7,t++,o[7]++;for(;t<=287;)Ti[t*2+1]=8,t++,o[8]++;for(z6(Ti,sc+1,o),t=0;t<Ys;t++)ic[t*2+1]=5,ic[t*2]=G6(t,5);L6=new Vp(Ti,oh,hc+1,sc,Eo),H6=new Vp(ic,Jl,0,Ys,Eo),K6=new Vp(new Array(0),Xw,0,mh,jw);},$6=t=>{let e;for(e=0;e<sc;e++)t.dyn_ltree[e*2]=0;for(e=0;e<Ys;e++)t.dyn_dtree[e*2]=0;for(e=0;e<mh;e++)t.bl_tree[e*2]=0;t.dyn_ltree[gh*2]=1,t.opt_len=t.static_len=0,t.sym_next=t.matches=0;},V6=t=>{t.bi_valid>8?lc(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0;},Wb=(t,e,r,i)=>{let n=e*2,o=r*2;return t[n]<t[o]||t[n]===t[o]&&i[e]<=i[r]},Xp=(t,e,r)=>{let i=t.heap[r],n=r<<1;for(;n<=t.heap_len&&(n<t.heap_len&&Wb(e,t.heap[n+1],t.heap[n],t.depth)&&n++,!Wb(e,i,t.heap[n],t.depth));)t.heap[r]=t.heap[n],r=n,n<<=1;t.heap[r]=i;},Zb=(t,e,r)=>{let i,n,o=0,s,a;if(t.sym_next!==0)do i=t.pending_buf[t.sym_buf+o++]&255,i+=(t.pending_buf[t.sym_buf+o++]&255)<<8,n=t.pending_buf[t.sym_buf+o++],i===0?Xr(t,n,e):(s=cc[n],Xr(t,s+hc+1,e),a=oh[s],a!==0&&(n-=yh[s],Tt(t,n,a)),i--,s=q6(i),Xr(t,s,r),a=Jl[s],a!==0&&(i-=ed[s],Tt(t,i,a)));while(o<t.sym_next);Xr(t,gh,e);},sh=(t,e)=>{let r=e.dyn_tree,i=e.stat_desc.static_tree,n=e.stat_desc.has_stree,o=e.stat_desc.elems,s,a,l=-1,c;for(t.heap_len=0,t.heap_max=R6,s=0;s<o;s++)r[s*2]!==0?(t.heap[++t.heap_len]=l=s,t.depth[s]=0):r[s*2+1]=0;for(;t.heap_len<2;)c=t.heap[++t.heap_len]=l<2?++l:0,r[c*2]=1,t.depth[c]=0,t.opt_len--,n&&(t.static_len-=i[c*2+1]);for(e.max_code=l,s=t.heap_len>>1;s>=1;s--)Xp(t,r,s);c=o;do s=t.heap[1],t.heap[1]=t.heap[t.heap_len--],Xp(t,r,1),a=t.heap[1],t.heap[--t.heap_max]=s,t.heap[--t.heap_max]=a,r[c*2]=r[s*2]+r[a*2],t.depth[c]=(t.depth[s]>=t.depth[a]?t.depth[s]:t.depth[a])+1,r[s*2+1]=r[a*2+1]=c,t.heap[1]=c++,Xp(t,r,1);while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],Yw(t,e),z6(r,l,t.bl_count);},Yb=(t,e,r)=>{let i,n=-1,o,s=e[1],a=0,l=7,c=4;for(s===0&&(l=138,c=3),e[(r+1)*2+1]=65535,i=0;i<=r;i++)o=s,s=e[(i+1)*2+1],!(++a<l&&o===s)&&(a<c?t.bl_tree[o*2]+=a:o!==0?(o!==n&&t.bl_tree[o*2]++,t.bl_tree[O6*2]++):a<=10?t.bl_tree[M6*2]++:t.bl_tree[F6*2]++,a=0,n=o,s===0?(l=138,c=3):o===s?(l=6,c=3):(l=7,c=4));},Qb=(t,e,r)=>{let i,n=-1,o,s=e[1],a=0,l=7,c=4;for(s===0&&(l=138,c=3),i=0;i<=r;i++)if(o=s,s=e[(i+1)*2+1],!(++a<l&&o===s)){if(a<c)do Xr(t,o,t.bl_tree);while(--a!==0);else o!==0?(o!==n&&(Xr(t,o,t.bl_tree),a--),Xr(t,O6,t.bl_tree),Tt(t,a-3,2)):a<=10?(Xr(t,M6,t.bl_tree),Tt(t,a-3,3)):(Xr(t,F6,t.bl_tree),Tt(t,a-11,7));a=0,n=o,s===0?(l=138,c=3):o===s?(l=6,c=3):(l=7,c=4);}},Jw=t=>{let e;for(Yb(t,t.dyn_ltree,t.l_desc.max_code),Yb(t,t.dyn_dtree,t.d_desc.max_code),sh(t,t.bl_desc),e=mh-1;e>=3&&t.bl_tree[U6[e]*2+1]===0;e--);return t.opt_len+=3*(e+1)+5+5+4,e},eI=(t,e,r,i)=>{let n;for(Tt(t,e-257,5),Tt(t,r-1,5),Tt(t,i-4,4),n=0;n<i;n++)Tt(t,t.bl_tree[U6[n]*2+1],3);Qb(t,t.dyn_ltree,e-1),Qb(t,t.dyn_dtree,r-1);},tI=t=>{let e=4093624447,r;for(r=0;r<=31;r++,e>>>=1)if(e&1&&t.dyn_ltree[r*2]!==0)return 0;if(t.dyn_ltree[18]!==0||t.dyn_ltree[20]!==0||t.dyn_ltree[26]!==0)return 1;for(r=32;r<hc;r++)if(t.dyn_ltree[r*2]!==0)return 1;return 0},Jb=false,rI=t=>{Jb||(Qw(),Jb=true),t.l_desc=new jp(t.dyn_ltree,L6),t.d_desc=new jp(t.dyn_dtree,H6),t.bl_desc=new jp(t.bl_tree,K6),t.bi_buf=0,t.bi_valid=0,$6(t);},j6=(t,e,r,i)=>{Tt(t,(Gw<<1)+(i?1:0),3),V6(t),lc(t,r),lc(t,~r),r&&t.pending_buf.set(t.window.subarray(e,e+r),t.pending),t.pending+=r;},iI=t=>{Tt(t,D6<<1,3),Xr(t,gh,Ti),Zw(t);},nI=(t,e,r,i)=>{let n,o,s=0;t.level>0?(t.strm.data_type===2&&(t.strm.data_type=tI(t)),sh(t,t.l_desc),sh(t,t.d_desc),s=Jw(t),n=t.opt_len+3+7>>>3,o=t.static_len+3+7>>>3,o<=n&&(n=o)):n=o=r+5,r+4<=n&&e!==-1?j6(t,e,r,i):t.strategy===4||o===n?(Tt(t,(D6<<1)+(i?1:0),3),Zb(t,Ti,ic)):(Tt(t,(zw<<1)+(i?1:0),3),eI(t,t.l_desc.max_code+1,t.d_desc.max_code+1,s+1),Zb(t,t.dyn_ltree,t.dyn_dtree)),$6(t),i&&V6(t);},oI=(t,e,r)=>(t.pending_buf[t.sym_buf+t.sym_next++]=e,t.pending_buf[t.sym_buf+t.sym_next++]=e>>8,t.pending_buf[t.sym_buf+t.sym_next++]=r,e===0?t.dyn_ltree[r*2]++:(t.matches++,e--,t.dyn_ltree[(cc[r]+hc+1)*2]++,t.dyn_dtree[q6(e)*2]++),t.sym_next===t.sym_end),sI=rI,aI=j6,cI=nI,lI=oI,dI=iI,uI={_tr_init:sI,_tr_stored_block:aI,_tr_flush_block:cI,_tr_tally:lI,_tr_align:dI},fI=(t,e,r,i)=>{let n=t&65535|0,o=t>>>16&65535|0,s=0;for(;r!==0;){s=r>2e3?2e3:r,r-=s;do n=n+e[i++]|0,o=o+n|0;while(--s);n%=65521,o%=65521;}return n|o<<16|0},dc=fI,pI=()=>{let t,e=[];for(var r=0;r<256;r++){t=r;for(var i=0;i<8;i++)t=t&1?3988292384^t>>>1:t>>>1;e[r]=t;}return e},hI=new Uint32Array(pI()),mI=(t,e,r,i)=>{let n=hI,o=i+r;t^=-1;for(let s=i;s<o;s++)t=t>>>8^n[(t^e[s])&255];return t^-1},et=mI,ko={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},ta={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_UNKNOWN:2,Z_DEFLATED:8},{_tr_init:gI,_tr_stored_block:ah,_tr_flush_block:yI,_tr_tally:bn,_tr_align:bI}=uI,{Z_NO_FLUSH:Sn,Z_PARTIAL_FLUSH:SI,Z_FULL_FLUSH:xI,Z_FINISH:nr,Z_BLOCK:e6,Z_OK:nt,Z_STREAM_END:t6,Z_STREAM_ERROR:Wr,Z_DATA_ERROR:AI,Z_BUF_ERROR:Wp,Z_DEFAULT_COMPRESSION:_I,Z_FILTERED:CI,Z_HUFFMAN_ONLY:Xl,Z_RLE:wI,Z_FIXED:II,Z_DEFAULT_STRATEGY:vI,Z_UNKNOWN:EI,Z_DEFLATED:id}=ta,BI=9,TI=15,kI=8,PI=29,NI=256,ch=NI+1+PI,DI=30,RI=19,OI=2*ch+1,MI=15,he=3,yn=258,Zr=yn+he+1,FI=32,Qs=42,bh=57,lh=69,dh=73,uh=91,fh=103,Bo=113,tc=666,bt=1,ra=2,Po=3,ia=4,UI=3,To=(t,e)=>(t.msg=ko[e],e),r6=t=>t*2-(t>4?9:0),gn=t=>{let e=t.length;for(;--e>=0;)t[e]=0;},LI=t=>{let e,r,i,n=t.w_size;e=t.hash_size,i=e;do r=t.head[--i],t.head[i]=r>=n?r-n:0;while(--e);e=n,i=e;do r=t.prev[--i],t.prev[i]=r>=n?r-n:0;while(--e)},HI=(t,e,r)=>(e<<t.hash_shift^r)&t.hash_mask,xn=HI,Mt=t=>{let e=t.state,r=e.pending;r>t.avail_out&&(r=t.avail_out),r!==0&&(t.output.set(e.pending_buf.subarray(e.pending_out,e.pending_out+r),t.next_out),t.next_out+=r,e.pending_out+=r,t.total_out+=r,t.avail_out-=r,e.pending-=r,e.pending===0&&(e.pending_out=0));},Ft=(t,e)=>{yI(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,Mt(t.strm);},ge=(t,e)=>{t.pending_buf[t.pending++]=e;},ec=(t,e)=>{t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=e&255;},ph=(t,e,r,i)=>{let n=t.avail_in;return n>i&&(n=i),n===0?0:(t.avail_in-=n,e.set(t.input.subarray(t.next_in,t.next_in+n),r),t.state.wrap===1?t.adler=dc(t.adler,e,n,r):t.state.wrap===2&&(t.adler=et(t.adler,e,n,r)),t.next_in+=n,t.total_in+=n,n)},X6=(t,e)=>{let r=t.max_chain_length,i=t.strstart,n,o,s=t.prev_length,a=t.nice_match,l=t.strstart>t.w_size-Zr?t.strstart-(t.w_size-Zr):0,c=t.window,d=t.w_mask,u=t.prev,h=t.strstart+yn,y=c[i+s-1],b=c[i+s];t.prev_length>=t.good_match&&(r>>=2),a>t.lookahead&&(a=t.lookahead);do if(n=e,!(c[n+s]!==b||c[n+s-1]!==y||c[n]!==c[i]||c[++n]!==c[i+1])){i+=2,n++;do;while(c[++i]===c[++n]&&c[++i]===c[++n]&&c[++i]===c[++n]&&c[++i]===c[++n]&&c[++i]===c[++n]&&c[++i]===c[++n]&&c[++i]===c[++n]&&c[++i]===c[++n]&&i<h);if(o=yn-(h-i),i=h-yn,o>s){if(t.match_start=e,s=o,o>=a)break;y=c[i+s-1],b=c[i+s];}}while((e=u[e&d])>l&&--r!==0);return s<=t.lookahead?s:t.lookahead},Js=t=>{let e=t.w_size,r,i,n;do{if(i=t.window_size-t.lookahead-t.strstart,t.strstart>=e+(e-Zr)&&(t.window.set(t.window.subarray(e,e+e-i),0),t.match_start-=e,t.strstart-=e,t.block_start-=e,t.insert>t.strstart&&(t.insert=t.strstart),LI(t),i+=e),t.strm.avail_in===0)break;if(r=ph(t.strm,t.window,t.strstart+t.lookahead,i),t.lookahead+=r,t.lookahead+t.insert>=he)for(n=t.strstart-t.insert,t.ins_h=t.window[n],t.ins_h=xn(t,t.ins_h,t.window[n+1]);t.insert&&(t.ins_h=xn(t,t.ins_h,t.window[n+he-1]),t.prev[n&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=n,n++,t.insert--,!(t.lookahead+t.insert<he)););}while(t.lookahead<Zr&&t.strm.avail_in!==0)},W6=(t,e)=>{let r=t.pending_buf_size-5>t.w_size?t.w_size:t.pending_buf_size-5,i,n,o,s=0,a=t.strm.avail_in;do{if(i=65535,o=t.bi_valid+42>>3,t.strm.avail_out<o||(o=t.strm.avail_out-o,n=t.strstart-t.block_start,i>n+t.strm.avail_in&&(i=n+t.strm.avail_in),i>o&&(i=o),i<r&&(i===0&&e!==nr||e===Sn||i!==n+t.strm.avail_in)))break;s=e===nr&&i===n+t.strm.avail_in?1:0,ah(t,0,0,s),t.pending_buf[t.pending-4]=i,t.pending_buf[t.pending-3]=i>>8,t.pending_buf[t.pending-2]=~i,t.pending_buf[t.pending-1]=~i>>8,Mt(t.strm),n&&(n>i&&(n=i),t.strm.output.set(t.window.subarray(t.block_start,t.block_start+n),t.strm.next_out),t.strm.next_out+=n,t.strm.avail_out-=n,t.strm.total_out+=n,t.block_start+=n,i-=n),i&&(ph(t.strm,t.strm.output,t.strm.next_out,i),t.strm.next_out+=i,t.strm.avail_out-=i,t.strm.total_out+=i);}while(s===0);return a-=t.strm.avail_in,a&&(a>=t.w_size?(t.matches=2,t.window.set(t.strm.input.subarray(t.strm.next_in-t.w_size,t.strm.next_in),0),t.strstart=t.w_size,t.insert=t.strstart):(t.window_size-t.strstart<=a&&(t.strstart-=t.w_size,t.window.set(t.window.subarray(t.w_size,t.w_size+t.strstart),0),t.matches<2&&t.matches++,t.insert>t.strstart&&(t.insert=t.strstart)),t.window.set(t.strm.input.subarray(t.strm.next_in-a,t.strm.next_in),t.strstart),t.strstart+=a,t.insert+=a>t.w_size-t.insert?t.w_size-t.insert:a),t.block_start=t.strstart),t.high_water<t.strstart&&(t.high_water=t.strstart),s?ia:e!==Sn&&e!==nr&&t.strm.avail_in===0&&t.strstart===t.block_start?ra:(o=t.window_size-t.strstart,t.strm.avail_in>o&&t.block_start>=t.w_size&&(t.block_start-=t.w_size,t.strstart-=t.w_size,t.window.set(t.window.subarray(t.w_size,t.w_size+t.strstart),0),t.matches<2&&t.matches++,o+=t.w_size,t.insert>t.strstart&&(t.insert=t.strstart)),o>t.strm.avail_in&&(o=t.strm.avail_in),o&&(ph(t.strm,t.window,t.strstart,o),t.strstart+=o,t.insert+=o>t.w_size-t.insert?t.w_size-t.insert:o),t.high_water<t.strstart&&(t.high_water=t.strstart),o=t.bi_valid+42>>3,o=t.pending_buf_size-o>65535?65535:t.pending_buf_size-o,r=o>t.w_size?t.w_size:o,n=t.strstart-t.block_start,(n>=r||(n||e===nr)&&e!==Sn&&t.strm.avail_in===0&&n<=o)&&(i=n>o?o:n,s=e===nr&&t.strm.avail_in===0&&i===n?1:0,ah(t,t.block_start,i,s),t.block_start+=i,Mt(t.strm)),s?Po:bt)},Zp=(t,e)=>{let r,i;for(;;){if(t.lookahead<Zr){if(Js(t),t.lookahead<Zr&&e===Sn)return bt;if(t.lookahead===0)break}if(r=0,t.lookahead>=he&&(t.ins_h=xn(t,t.ins_h,t.window[t.strstart+he-1]),r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),r!==0&&t.strstart-r<=t.w_size-Zr&&(t.match_length=X6(t,r)),t.match_length>=he)if(i=bn(t,t.strstart-t.match_start,t.match_length-he),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=he){t.match_length--;do t.strstart++,t.ins_h=xn(t,t.ins_h,t.window[t.strstart+he-1]),r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart;while(--t.match_length!==0);t.strstart++;}else t.strstart+=t.match_length,t.match_length=0,t.ins_h=t.window[t.strstart],t.ins_h=xn(t,t.ins_h,t.window[t.strstart+1]);else i=bn(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(i&&(Ft(t,false),t.strm.avail_out===0))return bt}return t.insert=t.strstart<he-1?t.strstart:he-1,e===nr?(Ft(t,true),t.strm.avail_out===0?Po:ia):t.sym_next&&(Ft(t,false),t.strm.avail_out===0)?bt:ra},Ws=(t,e)=>{let r,i,n;for(;;){if(t.lookahead<Zr){if(Js(t),t.lookahead<Zr&&e===Sn)return bt;if(t.lookahead===0)break}if(r=0,t.lookahead>=he&&(t.ins_h=xn(t,t.ins_h,t.window[t.strstart+he-1]),r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),t.prev_length=t.match_length,t.prev_match=t.match_start,t.match_length=he-1,r!==0&&t.prev_length<t.max_lazy_match&&t.strstart-r<=t.w_size-Zr&&(t.match_length=X6(t,r),t.match_length<=5&&(t.strategy===CI||t.match_length===he&&t.strstart-t.match_start>4096)&&(t.match_length=he-1)),t.prev_length>=he&&t.match_length<=t.prev_length){n=t.strstart+t.lookahead-he,i=bn(t,t.strstart-1-t.prev_match,t.prev_length-he),t.lookahead-=t.prev_length-1,t.prev_length-=2;do++t.strstart<=n&&(t.ins_h=xn(t,t.ins_h,t.window[t.strstart+he-1]),r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart);while(--t.prev_length!==0);if(t.match_available=0,t.match_length=he-1,t.strstart++,i&&(Ft(t,false),t.strm.avail_out===0))return bt}else if(t.match_available){if(i=bn(t,0,t.window[t.strstart-1]),i&&Ft(t,false),t.strstart++,t.lookahead--,t.strm.avail_out===0)return bt}else t.match_available=1,t.strstart++,t.lookahead--;}return t.match_available&&(i=bn(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<he-1?t.strstart:he-1,e===nr?(Ft(t,true),t.strm.avail_out===0?Po:ia):t.sym_next&&(Ft(t,false),t.strm.avail_out===0)?bt:ra},KI=(t,e)=>{let r,i,n,o,s=t.window;for(;;){if(t.lookahead<=yn){if(Js(t),t.lookahead<=yn&&e===Sn)return bt;if(t.lookahead===0)break}if(t.match_length=0,t.lookahead>=he&&t.strstart>0&&(n=t.strstart-1,i=s[n],i===s[++n]&&i===s[++n]&&i===s[++n])){o=t.strstart+yn;do;while(i===s[++n]&&i===s[++n]&&i===s[++n]&&i===s[++n]&&i===s[++n]&&i===s[++n]&&i===s[++n]&&i===s[++n]&&n<o);t.match_length=yn-(o-n),t.match_length>t.lookahead&&(t.match_length=t.lookahead);}if(t.match_length>=he?(r=bn(t,1,t.match_length-he),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(r=bn(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),r&&(Ft(t,false),t.strm.avail_out===0))return bt}return t.insert=0,e===nr?(Ft(t,true),t.strm.avail_out===0?Po:ia):t.sym_next&&(Ft(t,false),t.strm.avail_out===0)?bt:ra},qI=(t,e)=>{let r;for(;;){if(t.lookahead===0&&(Js(t),t.lookahead===0)){if(e===Sn)return bt;break}if(t.match_length=0,r=bn(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,r&&(Ft(t,false),t.strm.avail_out===0))return bt}return t.insert=0,e===nr?(Ft(t,true),t.strm.avail_out===0?Po:ia):t.sym_next&&(Ft(t,false),t.strm.avail_out===0)?bt:ra};function jr(t,e,r,i,n){this.good_length=t,this.max_lazy=e,this.nice_length=r,this.max_chain=i,this.func=n;}var rc=[new jr(0,0,0,0,W6),new jr(4,4,8,4,Zp),new jr(4,5,16,8,Zp),new jr(4,6,32,32,Zp),new jr(4,4,16,16,Ws),new jr(8,16,32,32,Ws),new jr(8,16,128,128,Ws),new jr(8,32,128,256,Ws),new jr(32,128,258,1024,Ws),new jr(32,258,258,4096,Ws)],GI=t=>{t.window_size=2*t.w_size,gn(t.head),t.max_lazy_match=rc[t.level].max_lazy,t.good_match=rc[t.level].good_length,t.nice_match=rc[t.level].nice_length,t.max_chain_length=rc[t.level].max_chain,t.strstart=0,t.block_start=0,t.lookahead=0,t.insert=0,t.match_length=t.prev_length=he-1,t.match_available=0,t.ins_h=0;};function zI(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=id,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(OI*2),this.dyn_dtree=new Uint16Array((2*DI+1)*2),this.bl_tree=new Uint16Array((2*RI+1)*2),gn(this.dyn_ltree),gn(this.dyn_dtree),gn(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(MI+1),this.heap=new Uint16Array(2*ch+1),gn(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(2*ch+1),gn(this.depth),this.sym_buf=0,this.lit_bufsize=0,this.sym_next=0,this.sym_end=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0;}var mc=t=>{if(!t)return 1;let e=t.state;return !e||e.strm!==t||e.status!==Qs&&e.status!==bh&&e.status!==lh&&e.status!==dh&&e.status!==uh&&e.status!==fh&&e.status!==Bo&&e.status!==tc?1:0},Z6=t=>{if(mc(t))return To(t,Wr);t.total_in=t.total_out=0,t.data_type=EI;let e=t.state;return e.pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=e.wrap===2?bh:e.wrap?Qs:Bo,t.adler=e.wrap===2?0:1,e.last_flush=-2,gI(e),nt},Y6=t=>{let e=Z6(t);return e===nt&&GI(t.state),e},$I=(t,e)=>mc(t)||t.state.wrap!==2?Wr:(t.state.gzhead=e,nt),Q6=(t,e,r,i,n,o)=>{if(!t)return Wr;let s=1;if(e===_I&&(e=6),i<0?(s=0,i=-i):i>15&&(s=2,i-=16),n<1||n>BI||r!==id||i<8||i>15||e<0||e>9||o<0||o>II||i===8&&s!==1)return To(t,Wr);i===8&&(i=9);let a=new zI;return t.state=a,a.strm=t,a.status=Qs,a.wrap=s,a.gzhead=null,a.w_bits=i,a.w_size=1<<a.w_bits,a.w_mask=a.w_size-1,a.hash_bits=n+7,a.hash_size=1<<a.hash_bits,a.hash_mask=a.hash_size-1,a.hash_shift=~~((a.hash_bits+he-1)/he),a.window=new Uint8Array(a.w_size*2),a.head=new Uint16Array(a.hash_size),a.prev=new Uint16Array(a.w_size),a.lit_bufsize=1<<n+6,a.pending_buf_size=a.lit_bufsize*4,a.pending_buf=new Uint8Array(a.pending_buf_size),a.sym_buf=a.lit_bufsize,a.sym_end=(a.lit_bufsize-1)*3,a.level=e,a.strategy=o,a.method=r,Y6(t)},VI=(t,e)=>Q6(t,e,id,TI,kI,vI),jI=(t,e)=>{if(mc(t)||e>e6||e<0)return t?To(t,Wr):Wr;let r=t.state;if(!t.output||t.avail_in!==0&&!t.input||r.status===tc&&e!==nr)return To(t,t.avail_out===0?Wp:Wr);let i=r.last_flush;if(r.last_flush=e,r.pending!==0){if(Mt(t),t.avail_out===0)return r.last_flush=-1,nt}else if(t.avail_in===0&&r6(e)<=r6(i)&&e!==nr)return To(t,Wp);if(r.status===tc&&t.avail_in!==0)return To(t,Wp);if(r.status===Qs&&r.wrap===0&&(r.status=Bo),r.status===Qs){let n=id+(r.w_bits-8<<4)<<8,o=-1;if(r.strategy>=Xl||r.level<2?o=0:r.level<6?o=1:r.level===6?o=2:o=3,n|=o<<6,r.strstart!==0&&(n|=FI),n+=31-n%31,ec(r,n),r.strstart!==0&&(ec(r,t.adler>>>16),ec(r,t.adler&65535)),t.adler=1,r.status=Bo,Mt(t),r.pending!==0)return r.last_flush=-1,nt}if(r.status===bh){if(t.adler=0,ge(r,31),ge(r,139),ge(r,8),r.gzhead)ge(r,(r.gzhead.text?1:0)+(r.gzhead.hcrc?2:0)+(r.gzhead.extra?4:0)+(r.gzhead.name?8:0)+(r.gzhead.comment?16:0)),ge(r,r.gzhead.time&255),ge(r,r.gzhead.time>>8&255),ge(r,r.gzhead.time>>16&255),ge(r,r.gzhead.time>>24&255),ge(r,r.level===9?2:r.strategy>=Xl||r.level<2?4:0),ge(r,r.gzhead.os&255),r.gzhead.extra&&r.gzhead.extra.length&&(ge(r,r.gzhead.extra.length&255),ge(r,r.gzhead.extra.length>>8&255)),r.gzhead.hcrc&&(t.adler=et(t.adler,r.pending_buf,r.pending,0)),r.gzindex=0,r.status=lh;else if(ge(r,0),ge(r,0),ge(r,0),ge(r,0),ge(r,0),ge(r,r.level===9?2:r.strategy>=Xl||r.level<2?4:0),ge(r,UI),r.status=Bo,Mt(t),r.pending!==0)return r.last_flush=-1,nt}if(r.status===lh){if(r.gzhead.extra){let n=r.pending,o=(r.gzhead.extra.length&65535)-r.gzindex;for(;r.pending+o>r.pending_buf_size;){let a=r.pending_buf_size-r.pending;if(r.pending_buf.set(r.gzhead.extra.subarray(r.gzindex,r.gzindex+a),r.pending),r.pending=r.pending_buf_size,r.gzhead.hcrc&&r.pending>n&&(t.adler=et(t.adler,r.pending_buf,r.pending-n,n)),r.gzindex+=a,Mt(t),r.pending!==0)return r.last_flush=-1,nt;n=0,o-=a;}let s=new Uint8Array(r.gzhead.extra);r.pending_buf.set(s.subarray(r.gzindex,r.gzindex+o),r.pending),r.pending+=o,r.gzhead.hcrc&&r.pending>n&&(t.adler=et(t.adler,r.pending_buf,r.pending-n,n)),r.gzindex=0;}r.status=dh;}if(r.status===dh){if(r.gzhead.name){let n=r.pending,o;do{if(r.pending===r.pending_buf_size){if(r.gzhead.hcrc&&r.pending>n&&(t.adler=et(t.adler,r.pending_buf,r.pending-n,n)),Mt(t),r.pending!==0)return r.last_flush=-1,nt;n=0;}r.gzindex<r.gzhead.name.length?o=r.gzhead.name.charCodeAt(r.gzindex++)&255:o=0,ge(r,o);}while(o!==0);r.gzhead.hcrc&&r.pending>n&&(t.adler=et(t.adler,r.pending_buf,r.pending-n,n)),r.gzindex=0;}r.status=uh;}if(r.status===uh){if(r.gzhead.comment){let n=r.pending,o;do{if(r.pending===r.pending_buf_size){if(r.gzhead.hcrc&&r.pending>n&&(t.adler=et(t.adler,r.pending_buf,r.pending-n,n)),Mt(t),r.pending!==0)return r.last_flush=-1,nt;n=0;}r.gzindex<r.gzhead.comment.length?o=r.gzhead.comment.charCodeAt(r.gzindex++)&255:o=0,ge(r,o);}while(o!==0);r.gzhead.hcrc&&r.pending>n&&(t.adler=et(t.adler,r.pending_buf,r.pending-n,n));}r.status=fh;}if(r.status===fh){if(r.gzhead.hcrc){if(r.pending+2>r.pending_buf_size&&(Mt(t),r.pending!==0))return r.last_flush=-1,nt;ge(r,t.adler&255),ge(r,t.adler>>8&255),t.adler=0;}if(r.status=Bo,Mt(t),r.pending!==0)return r.last_flush=-1,nt}if(t.avail_in!==0||r.lookahead!==0||e!==Sn&&r.status!==tc){let n=r.level===0?W6(r,e):r.strategy===Xl?qI(r,e):r.strategy===wI?KI(r,e):rc[r.level].func(r,e);if((n===Po||n===ia)&&(r.status=tc),n===bt||n===Po)return t.avail_out===0&&(r.last_flush=-1),nt;if(n===ra&&(e===SI?bI(r):e!==e6&&(ah(r,0,0,false),e===xI&&(gn(r.head),r.lookahead===0&&(r.strstart=0,r.block_start=0,r.insert=0))),Mt(t),t.avail_out===0))return r.last_flush=-1,nt}return e!==nr?nt:r.wrap<=0?t6:(r.wrap===2?(ge(r,t.adler&255),ge(r,t.adler>>8&255),ge(r,t.adler>>16&255),ge(r,t.adler>>24&255),ge(r,t.total_in&255),ge(r,t.total_in>>8&255),ge(r,t.total_in>>16&255),ge(r,t.total_in>>24&255)):(ec(r,t.adler>>>16),ec(r,t.adler&65535)),Mt(t),r.wrap>0&&(r.wrap=-r.wrap),r.pending!==0?nt:t6)},XI=t=>{if(mc(t))return Wr;let e=t.state.status;return t.state=null,e===Bo?To(t,AI):nt},WI=(t,e)=>{let r=e.length;if(mc(t))return Wr;let i=t.state,n=i.wrap;if(n===2||n===1&&i.status!==Qs||i.lookahead)return Wr;if(n===1&&(t.adler=dc(t.adler,e,r,0)),i.wrap=0,r>=i.w_size){n===0&&(gn(i.head),i.strstart=0,i.block_start=0,i.insert=0);let l=new Uint8Array(i.w_size);l.set(e.subarray(r-i.w_size,r),0),e=l,r=i.w_size;}let o=t.avail_in,s=t.next_in,a=t.input;for(t.avail_in=r,t.next_in=0,t.input=e,Js(i);i.lookahead>=he;){let l=i.strstart,c=i.lookahead-(he-1);do i.ins_h=xn(i,i.ins_h,i.window[l+he-1]),i.prev[l&i.w_mask]=i.head[i.ins_h],i.head[i.ins_h]=l,l++;while(--c);i.strstart=l,i.lookahead=he-1,Js(i);}return i.strstart+=i.lookahead,i.block_start=i.strstart,i.insert=i.lookahead,i.lookahead=0,i.match_length=i.prev_length=he-1,i.match_available=0,t.next_in=s,t.input=a,t.avail_in=o,i.wrap=n,nt},ZI=VI,YI=Q6,QI=Y6,JI=Z6,e9=$I,t9=jI,r9=XI,i9=WI,n9="pako deflate (from Nodeca project)",nc={deflateInit:ZI,deflateInit2:YI,deflateReset:QI,deflateResetKeep:JI,deflateSetHeader:e9,deflate:t9,deflateEnd:r9,deflateSetDictionary:i9,deflateInfo:n9},o9=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),s9=function(t){let e=Array.prototype.slice.call(arguments,1);for(;e.length;){let r=e.shift();if(r){if(typeof r!="object")throw new TypeError(r+"must be non-object");for(let i in r)o9(r,i)&&(t[i]=r[i]);}}return t},a9=t=>{let e=0;for(let i=0,n=t.length;i<n;i++)e+=t[i].length;let r=new Uint8Array(e);for(let i=0,n=0,o=t.length;i<o;i++){let s=t[i];r.set(s,n),n+=s.length;}return r},nd={assign:s9,flattenChunks:a9},J6=true;try{String.fromCharCode.apply(null,new Uint8Array(1));}catch{J6=false;}var uc=new Uint8Array(256);for(let t=0;t<256;t++)uc[t]=t>=252?6:t>=248?5:t>=240?4:t>=224?3:t>=192?2:1;uc[254]=uc[254]=1;var c9=t=>{if(typeof TextEncoder=="function"&&TextEncoder.prototype.encode)return new TextEncoder().encode(t);let e,r,i,n,o,s=t.length,a=0;for(n=0;n<s;n++)r=t.charCodeAt(n),(r&64512)===55296&&n+1<s&&(i=t.charCodeAt(n+1),(i&64512)===56320&&(r=65536+(r-55296<<10)+(i-56320),n++)),a+=r<128?1:r<2048?2:r<65536?3:4;for(e=new Uint8Array(a),o=0,n=0;o<a;n++)r=t.charCodeAt(n),(r&64512)===55296&&n+1<s&&(i=t.charCodeAt(n+1),(i&64512)===56320&&(r=65536+(r-55296<<10)+(i-56320),n++)),r<128?e[o++]=r:r<2048?(e[o++]=192|r>>>6,e[o++]=128|r&63):r<65536?(e[o++]=224|r>>>12,e[o++]=128|r>>>6&63,e[o++]=128|r&63):(e[o++]=240|r>>>18,e[o++]=128|r>>>12&63,e[o++]=128|r>>>6&63,e[o++]=128|r&63);return e},l9=(t,e)=>{if(e<65534&&t.subarray&&J6)return String.fromCharCode.apply(null,t.length===e?t:t.subarray(0,e));let r="";for(let i=0;i<e;i++)r+=String.fromCharCode(t[i]);return r},d9=(t,e)=>{let r=e||t.length;if(typeof TextDecoder=="function"&&TextDecoder.prototype.decode)return new TextDecoder().decode(t.subarray(0,e));let i,n,o=new Array(r*2);for(n=0,i=0;i<r;){let s=t[i++];if(s<128){o[n++]=s;continue}let a=uc[s];if(a>4){o[n++]=65533,i+=a-1;continue}for(s&=a===2?31:a===3?15:7;a>1&&i<r;)s=s<<6|t[i++]&63,a--;if(a>1){o[n++]=65533;continue}s<65536?o[n++]=s:(s-=65536,o[n++]=55296|s>>10&1023,o[n++]=56320|s&1023);}return l9(o,n)},u9=(t,e)=>{e=e||t.length,e>t.length&&(e=t.length);let r=e-1;for(;r>=0&&(t[r]&192)===128;)r--;return r<0||r===0?e:r+uc[t[r]]>e?r:e},fc={string2buf:c9,buf2string:d9,utf8border:u9};function f9(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0;}var e5=f9,t5=Object.prototype.toString,{Z_NO_FLUSH:p9,Z_SYNC_FLUSH:h9,Z_FULL_FLUSH:m9,Z_FINISH:g9,Z_OK:td,Z_STREAM_END:y9,Z_DEFAULT_COMPRESSION:b9,Z_DEFAULT_STRATEGY:S9,Z_DEFLATED:x9}=ta;function gc(t){this.options=nd.assign({level:b9,method:x9,chunkSize:16384,windowBits:15,memLevel:8,strategy:S9},t||{});let e=this.options;e.raw&&e.windowBits>0?e.windowBits=-e.windowBits:e.gzip&&e.windowBits>0&&e.windowBits<16&&(e.windowBits+=16),this.err=0,this.msg="",this.ended=false,this.chunks=[],this.strm=new e5,this.strm.avail_out=0;let r=nc.deflateInit2(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy);if(r!==td)throw new Error(ko[r]);if(e.header&&nc.deflateSetHeader(this.strm,e.header),e.dictionary){let i;if(typeof e.dictionary=="string"?i=fc.string2buf(e.dictionary):t5.call(e.dictionary)==="[object ArrayBuffer]"?i=new Uint8Array(e.dictionary):i=e.dictionary,r=nc.deflateSetDictionary(this.strm,i),r!==td)throw new Error(ko[r]);this._dict_set=true;}}gc.prototype.push=function(t,e){let r=this.strm,i=this.options.chunkSize,n,o;if(this.ended)return false;for(e===~~e?o=e:o=e===true?g9:p9,typeof t=="string"?r.input=fc.string2buf(t):t5.call(t)==="[object ArrayBuffer]"?r.input=new Uint8Array(t):r.input=t,r.next_in=0,r.avail_in=r.input.length;;){if(r.avail_out===0&&(r.output=new Uint8Array(i),r.next_out=0,r.avail_out=i),(o===h9||o===m9)&&r.avail_out<=6){this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;continue}if(n=nc.deflate(r,o),n===y9)return r.next_out>0&&this.onData(r.output.subarray(0,r.next_out)),n=nc.deflateEnd(this.strm),this.onEnd(n),this.ended=true,n===td;if(r.avail_out===0){this.onData(r.output);continue}if(o>0&&r.next_out>0){this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;continue}if(r.avail_in===0)break}return true};gc.prototype.onData=function(t){this.chunks.push(t);};gc.prototype.onEnd=function(t){t===td&&(this.result=nd.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg;};function Sh(t,e){let r=new gc(e);if(r.push(t,true),r.err)throw r.msg||ko[r.err];return r.result}var w9=Sh,B9={deflate:w9},Wl=16209,T9=16191,k9=function(e,r){let i,n,o,s,a,l,c,d,u,h,y,b,x,m,A,_,w,I,N,H,O,U,F,T,C=e.state;i=e.next_in,F=e.input,n=i+(e.avail_in-5),o=e.next_out,T=e.output,s=o-(r-e.avail_out),a=o+(e.avail_out-257),l=C.dmax,c=C.wsize,d=C.whave,u=C.wnext,h=C.window,y=C.hold,b=C.bits,x=C.lencode,m=C.distcode,A=(1<<C.lenbits)-1,_=(1<<C.distbits)-1;e:do{b<15&&(y+=F[i++]<<b,b+=8,y+=F[i++]<<b,b+=8),w=x[y&A];t:for(;;){if(I=w>>>24,y>>>=I,b-=I,I=w>>>16&255,I===0)T[o++]=w&65535;else if(I&16){N=w&65535,I&=15,I&&(b<I&&(y+=F[i++]<<b,b+=8),N+=y&(1<<I)-1,y>>>=I,b-=I),b<15&&(y+=F[i++]<<b,b+=8,y+=F[i++]<<b,b+=8),w=m[y&_];r:for(;;){if(I=w>>>24,y>>>=I,b-=I,I=w>>>16&255,I&16){if(H=w&65535,I&=15,b<I&&(y+=F[i++]<<b,b+=8,b<I&&(y+=F[i++]<<b,b+=8)),H+=y&(1<<I)-1,H>l){e.msg="invalid distance too far back",C.mode=Wl;break e}if(y>>>=I,b-=I,I=o-s,H>I){if(I=H-I,I>d&&C.sane){e.msg="invalid distance too far back",C.mode=Wl;break e}if(O=0,U=h,u===0){if(O+=c-I,I<N){N-=I;do T[o++]=h[O++];while(--I);O=o-H,U=T;}}else if(u<I){if(O+=c+u-I,I-=u,I<N){N-=I;do T[o++]=h[O++];while(--I);if(O=0,u<N){I=u,N-=I;do T[o++]=h[O++];while(--I);O=o-H,U=T;}}}else if(O+=u-I,I<N){N-=I;do T[o++]=h[O++];while(--I);O=o-H,U=T;}for(;N>2;)T[o++]=U[O++],T[o++]=U[O++],T[o++]=U[O++],N-=3;N&&(T[o++]=U[O++],N>1&&(T[o++]=U[O++]));}else {O=o-H;do T[o++]=T[O++],T[o++]=T[O++],T[o++]=T[O++],N-=3;while(N>2);N&&(T[o++]=T[O++],N>1&&(T[o++]=T[O++]));}}else if((I&64)===0){w=m[(w&65535)+(y&(1<<I)-1)];continue r}else {e.msg="invalid distance code",C.mode=Wl;break e}break}}else if((I&64)===0){w=x[(w&65535)+(y&(1<<I)-1)];continue t}else if(I&32){C.mode=T9;break e}else {e.msg="invalid literal/length code",C.mode=Wl;break e}break}}while(i<n&&o<a);N=b>>3,i-=N,b-=N<<3,y&=(1<<b)-1,e.next_in=i,e.next_out=o,e.avail_in=i<n?5+(n-i):5-(i-n),e.avail_out=o<a?257+(a-o):257-(o-a),C.hold=y,C.bits=b;},Zs=15,i6=852,n6=592,o6=0,Yp=1,s6=2,P9=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),N9=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78]),D9=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),R9=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]),O9=(t,e,r,i,n,o,s,a)=>{let l=a.bits,c=0,d=0,u=0,h=0,y=0,b=0,x=0,m=0,A=0,_=0,w,I,N,H,O,U=null,F,T=new Uint16Array(Zs+1),C=new Uint16Array(Zs+1),E=null,v,B,D;for(c=0;c<=Zs;c++)T[c]=0;for(d=0;d<i;d++)T[e[r+d]]++;for(y=l,h=Zs;h>=1&&T[h]===0;h--);if(y>h&&(y=h),h===0)return n[o++]=1<<24|64<<16|0,n[o++]=1<<24|64<<16|0,a.bits=1,0;for(u=1;u<h&&T[u]===0;u++);for(y<u&&(y=u),m=1,c=1;c<=Zs;c++)if(m<<=1,m-=T[c],m<0)return -1;if(m>0&&(t===o6||h!==1))return -1;for(C[1]=0,c=1;c<Zs;c++)C[c+1]=C[c]+T[c];for(d=0;d<i;d++)e[r+d]!==0&&(s[C[e[r+d]]++]=d);if(t===o6?(U=E=s,F=20):t===Yp?(U=P9,E=N9,F=257):(U=D9,E=R9,F=0),_=0,d=0,c=u,O=o,b=y,x=0,N=-1,A=1<<y,H=A-1,t===Yp&&A>i6||t===s6&&A>n6)return 1;for(;;){v=c-x,s[d]+1<F?(B=0,D=s[d]):s[d]>=F?(B=E[s[d]-F],D=U[s[d]-F]):(B=96,D=0),w=1<<c-x,I=1<<b,u=I;do I-=w,n[O+(_>>x)+I]=v<<24|B<<16|D|0;while(I!==0);for(w=1<<c-1;_&w;)w>>=1;if(w!==0?(_&=w-1,_+=w):_=0,d++,--T[c]===0){if(c===h)break;c=e[r+s[d]];}if(c>y&&(_&H)!==N){for(x===0&&(x=y),O+=u,b=c-x,m=1<<b;b+x<h&&(m-=T[b+x],!(m<=0));)b++,m<<=1;if(A+=1<<b,t===Yp&&A>i6||t===s6&&A>n6)return 1;N=_&H,n[N]=y<<24|b<<16|O-o|0;}}return _!==0&&(n[O+_]=c-x<<24|64<<16|0),a.bits=y,0},oc=O9,M9=0,r5=1,i5=2,{Z_FINISH:a6,Z_BLOCK:F9,Z_TREES:Zl,Z_OK:No,Z_STREAM_END:U9,Z_NEED_DICT:L9,Z_STREAM_ERROR:or,Z_DATA_ERROR:n5,Z_MEM_ERROR:o5,Z_BUF_ERROR:H9,Z_DEFLATED:c6}=ta,od=16180,l6=16181,d6=16182,u6=16183,f6=16184,p6=16185,h6=16186,m6=16187,g6=16188,y6=16189,rd=16190,Bi=16191,Qp=16192,b6=16193,Jp=16194,S6=16195,x6=16196,A6=16197,_6=16198,Yl=16199,Ql=16200,C6=16201,w6=16202,I6=16203,v6=16204,E6=16205,eh=16206,B6=16207,T6=16208,Be=16209,s5=16210,a5=16211,K9=852,q9=592,G9=15,z9=G9,k6=t=>(t>>>24&255)+(t>>>8&65280)+((t&65280)<<8)+((t&255)<<24);function $9(){this.strm=null,this.mode=0,this.last=false,this.wrap=0,this.havedict=false,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0;}var Do=t=>{if(!t)return 1;let e=t.state;return !e||e.strm!==t||e.mode<od||e.mode>a5?1:0},c5=t=>{if(Do(t))return or;let e=t.state;return t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=e.wrap&1),e.mode=od,e.last=0,e.havedict=0,e.flags=-1,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new Int32Array(K9),e.distcode=e.distdyn=new Int32Array(q9),e.sane=1,e.back=-1,No},l5=t=>{if(Do(t))return or;let e=t.state;return e.wsize=0,e.whave=0,e.wnext=0,c5(t)},d5=(t,e)=>{let r;if(Do(t))return or;let i=t.state;return e<0?(r=0,e=-e):(r=(e>>4)+5,e<48&&(e&=15)),e&&(e<8||e>15)?or:(i.window!==null&&i.wbits!==e&&(i.window=null),i.wrap=r,i.wbits=e,l5(t))},u5=(t,e)=>{if(!t)return or;let r=new $9;t.state=r,r.strm=t,r.window=null,r.mode=od;let i=d5(t,e);return i!==No&&(t.state=null),i},V9=t=>u5(t,z9),P6=true,th,rh,j9=t=>{if(P6){th=new Int32Array(512),rh=new Int32Array(32);let e=0;for(;e<144;)t.lens[e++]=8;for(;e<256;)t.lens[e++]=9;for(;e<280;)t.lens[e++]=7;for(;e<288;)t.lens[e++]=8;for(oc(r5,t.lens,0,288,th,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;oc(i5,t.lens,0,32,rh,0,t.work,{bits:5}),P6=false;}t.lencode=th,t.lenbits=9,t.distcode=rh,t.distbits=5;},f5=(t,e,r,i)=>{let n,o=t.state;return o.window===null&&(o.wsize=1<<o.wbits,o.wnext=0,o.whave=0,o.window=new Uint8Array(o.wsize)),i>=o.wsize?(o.window.set(e.subarray(r-o.wsize,r),0),o.wnext=0,o.whave=o.wsize):(n=o.wsize-o.wnext,n>i&&(n=i),o.window.set(e.subarray(r-i,r-i+n),o.wnext),i-=n,i?(o.window.set(e.subarray(r-i,r),0),o.wnext=i,o.whave=o.wsize):(o.wnext+=n,o.wnext===o.wsize&&(o.wnext=0),o.whave<o.wsize&&(o.whave+=n))),0},X9=(t,e)=>{let r,i,n,o,s,a,l,c,d,u,h,y,b,x,m=0,A,_,w,I,N,H,O,U,F=new Uint8Array(4),T,C,E=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(Do(t)||!t.output||!t.input&&t.avail_in!==0)return or;r=t.state,r.mode===Bi&&(r.mode=Qp),s=t.next_out,n=t.output,l=t.avail_out,o=t.next_in,i=t.input,a=t.avail_in,c=r.hold,d=r.bits,u=a,h=l,U=No;e:for(;;)switch(r.mode){case od:if(r.wrap===0){r.mode=Qp;break}for(;d<16;){if(a===0)break e;a--,c+=i[o++]<<d,d+=8;}if(r.wrap&2&&c===35615){r.wbits===0&&(r.wbits=15),r.check=0,F[0]=c&255,F[1]=c>>>8&255,r.check=et(r.check,F,2,0),c=0,d=0,r.mode=l6;break}if(r.head&&(r.head.done=false),!(r.wrap&1)||(((c&255)<<8)+(c>>8))%31){t.msg="incorrect header check",r.mode=Be;break}if((c&15)!==c6){t.msg="unknown compression method",r.mode=Be;break}if(c>>>=4,d-=4,O=(c&15)+8,r.wbits===0&&(r.wbits=O),O>15||O>r.wbits){t.msg="invalid window size",r.mode=Be;break}r.dmax=1<<r.wbits,r.flags=0,t.adler=r.check=1,r.mode=c&512?y6:Bi,c=0,d=0;break;case l6:for(;d<16;){if(a===0)break e;a--,c+=i[o++]<<d,d+=8;}if(r.flags=c,(r.flags&255)!==c6){t.msg="unknown compression method",r.mode=Be;break}if(r.flags&57344){t.msg="unknown header flags set",r.mode=Be;break}r.head&&(r.head.text=c>>8&1),r.flags&512&&r.wrap&4&&(F[0]=c&255,F[1]=c>>>8&255,r.check=et(r.check,F,2,0)),c=0,d=0,r.mode=d6;case d6:for(;d<32;){if(a===0)break e;a--,c+=i[o++]<<d,d+=8;}r.head&&(r.head.time=c),r.flags&512&&r.wrap&4&&(F[0]=c&255,F[1]=c>>>8&255,F[2]=c>>>16&255,F[3]=c>>>24&255,r.check=et(r.check,F,4,0)),c=0,d=0,r.mode=u6;case u6:for(;d<16;){if(a===0)break e;a--,c+=i[o++]<<d,d+=8;}r.head&&(r.head.xflags=c&255,r.head.os=c>>8),r.flags&512&&r.wrap&4&&(F[0]=c&255,F[1]=c>>>8&255,r.check=et(r.check,F,2,0)),c=0,d=0,r.mode=f6;case f6:if(r.flags&1024){for(;d<16;){if(a===0)break e;a--,c+=i[o++]<<d,d+=8;}r.length=c,r.head&&(r.head.extra_len=c),r.flags&512&&r.wrap&4&&(F[0]=c&255,F[1]=c>>>8&255,r.check=et(r.check,F,2,0)),c=0,d=0;}else r.head&&(r.head.extra=null);r.mode=p6;case p6:if(r.flags&1024&&(y=r.length,y>a&&(y=a),y&&(r.head&&(O=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Uint8Array(r.head.extra_len)),r.head.extra.set(i.subarray(o,o+y),O)),r.flags&512&&r.wrap&4&&(r.check=et(r.check,i,y,o)),a-=y,o+=y,r.length-=y),r.length))break e;r.length=0,r.mode=h6;case h6:if(r.flags&2048){if(a===0)break e;y=0;do O=i[o+y++],r.head&&O&&r.length<65536&&(r.head.name+=String.fromCharCode(O));while(O&&y<a);if(r.flags&512&&r.wrap&4&&(r.check=et(r.check,i,y,o)),a-=y,o+=y,O)break e}else r.head&&(r.head.name=null);r.length=0,r.mode=m6;case m6:if(r.flags&4096){if(a===0)break e;y=0;do O=i[o+y++],r.head&&O&&r.length<65536&&(r.head.comment+=String.fromCharCode(O));while(O&&y<a);if(r.flags&512&&r.wrap&4&&(r.check=et(r.check,i,y,o)),a-=y,o+=y,O)break e}else r.head&&(r.head.comment=null);r.mode=g6;case g6:if(r.flags&512){for(;d<16;){if(a===0)break e;a--,c+=i[o++]<<d,d+=8;}if(r.wrap&4&&c!==(r.check&65535)){t.msg="header crc mismatch",r.mode=Be;break}c=0,d=0;}r.head&&(r.head.hcrc=r.flags>>9&1,r.head.done=true),t.adler=r.check=0,r.mode=Bi;break;case y6:for(;d<32;){if(a===0)break e;a--,c+=i[o++]<<d,d+=8;}t.adler=r.check=k6(c),c=0,d=0,r.mode=rd;case rd:if(r.havedict===0)return t.next_out=s,t.avail_out=l,t.next_in=o,t.avail_in=a,r.hold=c,r.bits=d,L9;t.adler=r.check=1,r.mode=Bi;case Bi:if(e===F9||e===Zl)break e;case Qp:if(r.last){c>>>=d&7,d-=d&7,r.mode=eh;break}for(;d<3;){if(a===0)break e;a--,c+=i[o++]<<d,d+=8;}switch(r.last=c&1,c>>>=1,d-=1,c&3){case 0:r.mode=b6;break;case 1:if(j9(r),r.mode=Yl,e===Zl){c>>>=2,d-=2;break e}break;case 2:r.mode=x6;break;case 3:t.msg="invalid block type",r.mode=Be;}c>>>=2,d-=2;break;case b6:for(c>>>=d&7,d-=d&7;d<32;){if(a===0)break e;a--,c+=i[o++]<<d,d+=8;}if((c&65535)!==(c>>>16^65535)){t.msg="invalid stored block lengths",r.mode=Be;break}if(r.length=c&65535,c=0,d=0,r.mode=Jp,e===Zl)break e;case Jp:r.mode=S6;case S6:if(y=r.length,y){if(y>a&&(y=a),y>l&&(y=l),y===0)break e;n.set(i.subarray(o,o+y),s),a-=y,o+=y,l-=y,s+=y,r.length-=y;break}r.mode=Bi;break;case x6:for(;d<14;){if(a===0)break e;a--,c+=i[o++]<<d,d+=8;}if(r.nlen=(c&31)+257,c>>>=5,d-=5,r.ndist=(c&31)+1,c>>>=5,d-=5,r.ncode=(c&15)+4,c>>>=4,d-=4,r.nlen>286||r.ndist>30){t.msg="too many length or distance symbols",r.mode=Be;break}r.have=0,r.mode=A6;case A6:for(;r.have<r.ncode;){for(;d<3;){if(a===0)break e;a--,c+=i[o++]<<d,d+=8;}r.lens[E[r.have++]]=c&7,c>>>=3,d-=3;}for(;r.have<19;)r.lens[E[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,T={bits:r.lenbits},U=oc(M9,r.lens,0,19,r.lencode,0,r.work,T),r.lenbits=T.bits,U){t.msg="invalid code lengths set",r.mode=Be;break}r.have=0,r.mode=_6;case _6:for(;r.have<r.nlen+r.ndist;){for(;m=r.lencode[c&(1<<r.lenbits)-1],A=m>>>24,_=m>>>16&255,w=m&65535,!(A<=d);){if(a===0)break e;a--,c+=i[o++]<<d,d+=8;}if(w<16)c>>>=A,d-=A,r.lens[r.have++]=w;else {if(w===16){for(C=A+2;d<C;){if(a===0)break e;a--,c+=i[o++]<<d,d+=8;}if(c>>>=A,d-=A,r.have===0){t.msg="invalid bit length repeat",r.mode=Be;break}O=r.lens[r.have-1],y=3+(c&3),c>>>=2,d-=2;}else if(w===17){for(C=A+3;d<C;){if(a===0)break e;a--,c+=i[o++]<<d,d+=8;}c>>>=A,d-=A,O=0,y=3+(c&7),c>>>=3,d-=3;}else {for(C=A+7;d<C;){if(a===0)break e;a--,c+=i[o++]<<d,d+=8;}c>>>=A,d-=A,O=0,y=11+(c&127),c>>>=7,d-=7;}if(r.have+y>r.nlen+r.ndist){t.msg="invalid bit length repeat",r.mode=Be;break}for(;y--;)r.lens[r.have++]=O;}}if(r.mode===Be)break;if(r.lens[256]===0){t.msg="invalid code -- missing end-of-block",r.mode=Be;break}if(r.lenbits=9,T={bits:r.lenbits},U=oc(r5,r.lens,0,r.nlen,r.lencode,0,r.work,T),r.lenbits=T.bits,U){t.msg="invalid literal/lengths set",r.mode=Be;break}if(r.distbits=6,r.distcode=r.distdyn,T={bits:r.distbits},U=oc(i5,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,T),r.distbits=T.bits,U){t.msg="invalid distances set",r.mode=Be;break}if(r.mode=Yl,e===Zl)break e;case Yl:r.mode=Ql;case Ql:if(a>=6&&l>=258){t.next_out=s,t.avail_out=l,t.next_in=o,t.avail_in=a,r.hold=c,r.bits=d,k9(t,h),s=t.next_out,n=t.output,l=t.avail_out,o=t.next_in,i=t.input,a=t.avail_in,c=r.hold,d=r.bits,r.mode===Bi&&(r.back=-1);break}for(r.back=0;m=r.lencode[c&(1<<r.lenbits)-1],A=m>>>24,_=m>>>16&255,w=m&65535,!(A<=d);){if(a===0)break e;a--,c+=i[o++]<<d,d+=8;}if(_&&(_&240)===0){for(I=A,N=_,H=w;m=r.lencode[H+((c&(1<<I+N)-1)>>I)],A=m>>>24,_=m>>>16&255,w=m&65535,!(I+A<=d);){if(a===0)break e;a--,c+=i[o++]<<d,d+=8;}c>>>=I,d-=I,r.back+=I;}if(c>>>=A,d-=A,r.back+=A,r.length=w,_===0){r.mode=E6;break}if(_&32){r.back=-1,r.mode=Bi;break}if(_&64){t.msg="invalid literal/length code",r.mode=Be;break}r.extra=_&15,r.mode=C6;case C6:if(r.extra){for(C=r.extra;d<C;){if(a===0)break e;a--,c+=i[o++]<<d,d+=8;}r.length+=c&(1<<r.extra)-1,c>>>=r.extra,d-=r.extra,r.back+=r.extra;}r.was=r.length,r.mode=w6;case w6:for(;m=r.distcode[c&(1<<r.distbits)-1],A=m>>>24,_=m>>>16&255,w=m&65535,!(A<=d);){if(a===0)break e;a--,c+=i[o++]<<d,d+=8;}if((_&240)===0){for(I=A,N=_,H=w;m=r.distcode[H+((c&(1<<I+N)-1)>>I)],A=m>>>24,_=m>>>16&255,w=m&65535,!(I+A<=d);){if(a===0)break e;a--,c+=i[o++]<<d,d+=8;}c>>>=I,d-=I,r.back+=I;}if(c>>>=A,d-=A,r.back+=A,_&64){t.msg="invalid distance code",r.mode=Be;break}r.offset=w,r.extra=_&15,r.mode=I6;case I6:if(r.extra){for(C=r.extra;d<C;){if(a===0)break e;a--,c+=i[o++]<<d,d+=8;}r.offset+=c&(1<<r.extra)-1,c>>>=r.extra,d-=r.extra,r.back+=r.extra;}if(r.offset>r.dmax){t.msg="invalid distance too far back",r.mode=Be;break}r.mode=v6;case v6:if(l===0)break e;if(y=h-l,r.offset>y){if(y=r.offset-y,y>r.whave&&r.sane){t.msg="invalid distance too far back",r.mode=Be;break}y>r.wnext?(y-=r.wnext,b=r.wsize-y):b=r.wnext-y,y>r.length&&(y=r.length),x=r.window;}else x=n,b=s-r.offset,y=r.length;y>l&&(y=l),l-=y,r.length-=y;do n[s++]=x[b++];while(--y);r.length===0&&(r.mode=Ql);break;case E6:if(l===0)break e;n[s++]=r.length,l--,r.mode=Ql;break;case eh:if(r.wrap){for(;d<32;){if(a===0)break e;a--,c|=i[o++]<<d,d+=8;}if(h-=l,t.total_out+=h,r.total+=h,r.wrap&4&&h&&(t.adler=r.check=r.flags?et(r.check,n,h,s-h):dc(r.check,n,h,s-h)),h=l,r.wrap&4&&(r.flags?c:k6(c))!==r.check){t.msg="incorrect data check",r.mode=Be;break}c=0,d=0;}r.mode=B6;case B6:if(r.wrap&&r.flags){for(;d<32;){if(a===0)break e;a--,c+=i[o++]<<d,d+=8;}if(r.wrap&4&&c!==(r.total&4294967295)){t.msg="incorrect length check",r.mode=Be;break}c=0,d=0;}r.mode=T6;case T6:U=U9;break e;case Be:U=n5;break e;case s5:return o5;case a5:default:return or}return t.next_out=s,t.avail_out=l,t.next_in=o,t.avail_in=a,r.hold=c,r.bits=d,(r.wsize||h!==t.avail_out&&r.mode<Be&&(r.mode<eh||e!==a6))&&f5(t,t.output,t.next_out,h-t.avail_out),u-=t.avail_in,h-=t.avail_out,t.total_in+=u,t.total_out+=h,r.total+=h,r.wrap&4&&h&&(t.adler=r.check=r.flags?et(r.check,n,h,t.next_out-h):dc(r.check,n,h,t.next_out-h)),t.data_type=r.bits+(r.last?64:0)+(r.mode===Bi?128:0)+(r.mode===Yl||r.mode===Jp?256:0),(u===0&&h===0||e===a6)&&U===No&&(U=H9),U},W9=t=>{if(Do(t))return or;let e=t.state;return e.window&&(e.window=null),t.state=null,No},Z9=(t,e)=>{if(Do(t))return or;let r=t.state;return (r.wrap&2)===0?or:(r.head=e,e.done=false,No)},Y9=(t,e)=>{let r=e.length,i,n,o;return Do(t)||(i=t.state,i.wrap!==0&&i.mode!==rd)?or:i.mode===rd&&(n=1,n=dc(n,e,r,0),n!==i.check)?n5:(o=f5(t,e,r,r),o?(i.mode=s5,o5):(i.havedict=1,No))},Q9=l5,J9=d5,ev=c5,tv=V9,rv=u5,iv=X9,nv=W9,ov=Z9,sv=Y9,av="pako inflate (from Nodeca project)",ki={inflateReset:Q9,inflateReset2:J9,inflateResetKeep:ev,inflateInit:tv,inflateInit2:rv,inflate:iv,inflateEnd:nv,inflateGetHeader:ov,inflateSetDictionary:sv,inflateInfo:av};function cv(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=false;}var lv=cv,p5=Object.prototype.toString,{Z_NO_FLUSH:dv,Z_FINISH:uv,Z_OK:pc,Z_STREAM_END:ih,Z_NEED_DICT:nh,Z_STREAM_ERROR:fv,Z_DATA_ERROR:N6,Z_MEM_ERROR:pv}=ta;function yc(t){this.options=nd.assign({chunkSize:1024*64,windowBits:15,to:""},t||{});let e=this.options;e.raw&&e.windowBits>=0&&e.windowBits<16&&(e.windowBits=-e.windowBits,e.windowBits===0&&(e.windowBits=-15)),e.windowBits>=0&&e.windowBits<16&&!(t&&t.windowBits)&&(e.windowBits+=32),e.windowBits>15&&e.windowBits<48&&(e.windowBits&15)===0&&(e.windowBits|=15),this.err=0,this.msg="",this.ended=false,this.chunks=[],this.strm=new e5,this.strm.avail_out=0;let r=ki.inflateInit2(this.strm,e.windowBits);if(r!==pc)throw new Error(ko[r]);if(this.header=new lv,ki.inflateGetHeader(this.strm,this.header),e.dictionary&&(typeof e.dictionary=="string"?e.dictionary=fc.string2buf(e.dictionary):p5.call(e.dictionary)==="[object ArrayBuffer]"&&(e.dictionary=new Uint8Array(e.dictionary)),e.raw&&(r=ki.inflateSetDictionary(this.strm,e.dictionary),r!==pc)))throw new Error(ko[r])}yc.prototype.push=function(t,e){let r=this.strm,i=this.options.chunkSize,n=this.options.dictionary,o,s,a;if(this.ended)return false;for(e===~~e?s=e:s=e===true?uv:dv,p5.call(t)==="[object ArrayBuffer]"?r.input=new Uint8Array(t):r.input=t,r.next_in=0,r.avail_in=r.input.length;;){for(r.avail_out===0&&(r.output=new Uint8Array(i),r.next_out=0,r.avail_out=i),o=ki.inflate(r,s),o===nh&&n&&(o=ki.inflateSetDictionary(r,n),o===pc?o=ki.inflate(r,s):o===N6&&(o=nh));r.avail_in>0&&o===ih&&r.state.wrap>0&&t[r.next_in]!==0;)ki.inflateReset(r),o=ki.inflate(r,s);switch(o){case fv:case N6:case nh:case pv:return this.onEnd(o),this.ended=true,false}if(a=r.avail_out,r.next_out&&(r.avail_out===0||o===ih))if(this.options.to==="string"){let l=fc.utf8border(r.output,r.next_out),c=r.next_out-l,d=fc.buf2string(r.output,l);r.next_out=c,r.avail_out=i-c,c&&r.output.set(r.output.subarray(l,l+c),0),this.onData(d);}else this.onData(r.output.length===r.next_out?r.output:r.output.subarray(0,r.next_out));if(!(o===pc&&a===0)){if(o===ih)return o=ki.inflateEnd(this.strm),this.onEnd(o),this.ended=true,true;if(r.avail_in===0)break}}return true};yc.prototype.onData=function(t){this.chunks.push(t);};yc.prototype.onEnd=function(t){t===pc&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=nd.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg;};function xh(t,e){let r=new yc(e);if(r.push(t),r.err)throw r.msg||ko[r.err];return r.result}var gv=xh,xv={inflate:gv},{deflate:Av}=B9,{inflate:_v}=xv;var h5=Av;var Ah=_v;var Cv=(0, y5.default)("bridge"),m5=32*1024,_h=1024*16,wv=1;function g5(t,e){return {jsonrpc:"2.0",id:Vs(16),method:t,params:e}}async function Iv(t,e,r,i){let n=[],o=[];if(e){let s=Buffer.from(h5(JSON.stringify(e))).toString("base64"),a=Math.ceil(s.length/_h),l=Vs(16);for(let c=0;c<a;c++){let d=c*_h,u=Math.min(d+_h,s.length),h=s.slice(d,u),y=JSON.stringify({method:t,params:h,chunk:{id:l,index:c,length:a}}),b=await J0(y,r,i),x=g5("encryptedMessage",{payload:Buffer.from(b).toString("base64")});o.push(x.id),n.push(JSON.stringify(x));}}else {let s=JSON.stringify({method:t,params:e||{}}),a=await J0(s,r,i),l=g5("encryptedMessage",{payload:Buffer.from(a).toString("base64")});o.push(l.id),n.push(JSON.stringify(l));}return {chunks:n,messageIds:o}}async function Ch(t,e,r,i,n){try{let{chunks:o,messageIds:s}=await Iv(t,e,r,i);for(let a of o){if(a.length>m5)throw new Error(`Payload exceeds max size of ${m5} bytes`);n.send(a),o.length>1&&await new Promise(l=>setTimeout(l,wv));}return {success:!0,messageIds:s}}catch(o){return Cv("Error sending encrypted message:",o),{success:false,messageIds:[]}}}var wh=class{constructor(t){f(this,"code");f(this,"reason");f(this,"event");this.code=t.code,this.reason=t.reason,this.event=t.event;}},Ih=class{constructor(t){f(this,"code");f(this,"reason");f(this,"wasConnected");f(this,"wasIntentionalClose");f(this,"willReconnect");f(this,"event");this.code=t.code,this.reason=t.reason,this.wasConnected=t.wasConnected,this.wasIntentionalClose=t.wasIntentionalClose,this.willReconnect=t.willReconnect,this.event=t.event;}};var b5=tt(G0(),1);var vh=class{constructor(t){f(this,"log");f(this,"role");f(this,"origin");f(this,"_bridgeOrigin");f(this,"bridgeId");f(this,"keyPair");f(this,"remotePublicKey");f(this,"sharedSecret");f(this,"websocket");f(this,"secureChannelEstablished",false);f(this,"intentionalClose",false);f(this,"keepalive");f(this,"reconnect");f(this,"reconnectAttempts",0);f(this,"maxReconnectAttempts");f(this,"reconnectTimer");f(this,"pingTimer");f(this,"pingInterval",3e4);f(this,"isReconnecting",false);f(this,"isConnected",false);f(this,"resumedSession",false);f(this,"bridgeUrl");f(this,"validMessagesReceived",0);f(this,"lastMessageTimestamp",0);f(this,"eventListeners");f(this,"incompleteMessages",new Map);f(this,"seenMessageIds",new Set);this.role=t.role,this.origin=t.origin,this._bridgeOrigin=t.domain,this.log=(0, b5.default)(`bridge:${this.role}`),this.bridgeId=t.bridgeId||Vs(16),this.keyPair=t.keyPair,this.reconnect=t.reconnect??true,this.keepalive=t.keepalive??true,this.maxReconnectAttempts=t.reconnectAttempts||lb,this.pingInterval=t.pingInterval||ub,this.bridgeUrl=t.bridgeUrl??db,this.eventListeners={connected:[],"secure-channel-established":[],"raw-message-received":[],"message-received":[],"chunk-received":[],error:[],"failed-to-connect":[],disconnected:[]};}resume(){this.log("Resuming bridge session"),this.secureChannelEstablished=true,this.resumedSession=true;}on(t,e){return this.eventListeners[t].push(e),()=>this.off(t,e)}off(t,e){let r=this.eventListeners[t].indexOf(e);r!==-1&&this.eventListeners[t].splice(r,1);}async emit(t,...e){await Promise.all(this.eventListeners[t].map(async r=>{try{await r(...e);}catch(i){this.log(`Error in ${t} listener:`,i);}}));}setupWebSocketHandlers(t){t.onopen=async()=>{if(this.isConnected=true,this.pingTimer&&clearInterval(this.pingTimer),this.pingTimer=setInterval(()=>{this.websocket&&this.websocket.send(JSON.stringify({method:"ping",params:{},nocache:true}));},this.pingInterval),this.isReconnecting){if(this.log("Reconnected to bridge"),this.resetReconnection(),this.lastMessageTimestamp>0&&this.websocket){let e=this.lastMessageTimestamp-1e3;this.log(`Requesting message replay starting from ${e}`),this.websocket.send(JSON.stringify({method:"replay",params:{timestamp:e}}));}await this.emit("connected",true);}else this.log("Connected to bridge"),this.lastMessageTimestamp===0&&(this.lastMessageTimestamp=Date.now()),await this.emit("connected",false),this.resumedSession&&(this.log("Resumed session, emitting secure channel established event"),await this.emit("secure-channel-established"));},t.onmessage=async e=>{await this.emit("raw-message-received",e.data);try{let r=JSON.parse(e.data);await this.handleWebSocketMessage(r);}catch(r){this.log("Error parsing message:",r),await this.emit("error",`Error parsing message: ${r instanceof Error?r.message:String(r)}`);}},t.onclose=async e=>{let{code:r,reason:i,wasClean:n}=e;if(this.log("[websocket.onclose]",{code:r,reason:i,wasClean:n,readyState:t.readyState}),this.pingTimer&&clearInterval(this.pingTimer),this.isConnected){let o=new Ih({code:e.code,reason:e.reason,wasConnected:this.isConnected,wasIntentionalClose:this.intentionalClose,willReconnect:!this.intentionalClose&&this.isConnected&&this.reconnect,event:e});await this.emit("disconnected",o);}if(this.intentionalClose){this.log("Intentional close, not attempting reconnect"),this._handleCleanup();return}if(!this.isConnected){if(!this.isConnected&&!this.intentionalClose){let s=new wh({code:e.code,reason:e.reason,event:e});await this.emit("failed-to-connect",s);}return}this.log("WebSocket closed"),this.isConnected=false,this.reconnect&&await this.handleReconnect();};}async handleWebSocketMessage(t){if(t.method==="ping"){this.log("Received ping message, responding with pong"),this.websocket?.send(JSON.stringify({method:"pong",params:{},nocache:true}));return}if(t.method!=="pong"){if(!t.id){this.log("Ignoring message with missing id:",t);return}if(this.seenMessageIds.has(t.id)){this.log("Ignoring message with duplicate id:",t.id);return}if(this.seenMessageIds.add(t.id),this.validMessagesReceived+=1,this.lastMessageTimestamp=Date.now(),this.role==="creator"&&t.method==="handshake"&&(this.log("Processing handshake message"),await this.handleHandshake(t)),t.method==="encryptedMessage"){if(this.log("Processing encrypted message"),this.role==="joiner"&&this._bridgeOrigin){let e=t.origin?pb(t.origin):void 0;if(e!==this._bridgeOrigin){this.log(`WARNING: Origin differs from origin in connection string. Expected ${this._bridgeOrigin} but got ${e}`),this.log("Ignoring received message:",t),this.emit("error",`Origin ${e} does not match expected origin ${this._bridgeOrigin}`);return}}await this.handleEncryptedMessage(t);}}}async handleHandshake(t){this.log("Received handshake:",t);try{let e=new Uint8Array(Buffer.from(t.params.pubkey,"hex"));if(this.secureChannelEstablished&&this.remotePublicKey!==e){this.log("Secure channel already established, ignoring handshake"),this.emit("error","Secure channel already established, ignoring handshake"),this.websocket?.send(JSON.stringify({method:"error",params:{message:"Secure channel already established, ignoring handshake"}}));return}if(this.remotePublicKey=e,this.sharedSecret=Gp(this.keyPair.privateKey,e),await zp(Buffer.from(t.params.greeting,"hex"),this.sharedSecret,this.bridgeId)!=="hello")throw new Error("Invalid greeting");this.websocket&&(await Ch("hello",null,this.sharedSecret,this.bridgeId,this.websocket)).messageIds.forEach(n=>this.seenMessageIds.add(n)),this.secureChannelEstablished?this.log("Secure channel already established, sending handshake message again"):(this.secureChannelEstablished=!0,await this.emit("secure-channel-established"));}catch(e){this.log("Error handling handshake:",e),await this.emit("error",`Error handling handshake: ${e instanceof Error?e.message:String(e)}`);}}async handleEncryptedMessage(t){try{if(!this.sharedSecret)throw new Error("Shared secret not available");let e=new Uint8Array(Buffer.from(t.params.payload,"base64")),r=await zp(e,this.sharedSecret,this.bridgeId),i=JSON.parse(r);if(!i.chunk||i.chunk.length==1)if(i.method==="hello"&&!this.secureChannelEstablished)this.log(`Verified origin: ${t.origin}`),this.secureChannelEstablished=!0,await this.emit("secure-channel-established");else {try{if(i.params&&i.params.length>0){this.log("Received compressed single-part message");let n=Buffer.from(i.params,"base64"),o=Ah(n),s=new TextDecoder().decode(o);i.params=JSON.parse(s),delete i.chunk;}}catch(n){if(n!=="incorrect header check")throw console.error("Some error happened data:",n),new Error("Failed to parse data: ");this.log("Received uncompressed single-part message");try{i.params=JSON.parse(i.params);}catch{}}await this.emit("message-received",i);}else {let{index:n,length:o,id:s}=i.chunk;this.log(`Received chunk (${n+1}/${o}) for chunk id ${s}`),this.incompleteMessages.has(s)||this.incompleteMessages.set(s,{chunks:new Array(o),expectedChunks:o,timestamp:Date.now()});let a=this.incompleteMessages.get(s);if(a.expectedChunks!==o)throw this.log(`Chunk count mismatch for id ${s}. Expected ${a.expectedChunks}, got ${o}`),new Error(`Chunk count mismatch for id ${s}. Expected ${a.expectedChunks}, got ${o}`);if(a.chunks[n]=i.params,await this.emit("chunk-received",i.chunk),(()=>{for(let c=0;c<a.chunks.length;c++)if(a.chunks[c]===void 0)return !1;return !0})()){let c=a.chunks.join(""),d=Buffer.from(c,"base64"),u=Ah(d),h=new TextDecoder().decode(u),y=JSON.parse(h);this.log(`Received all chunks for chunk id ${s}, reconstructing message`);let b={method:i.method,params:y};this.incompleteMessages.delete(s),await this.emit("message-received",b);}}}catch(e){this.log("Error decrypting message:",e),await this.emit("error",`Error decrypting message: ${e instanceof Error?e.message:String(e)}`);}}async handleReconnect(){if(this.reconnectAttempts++,this.reconnectAttempts>this.maxReconnectAttempts){this.log(`WebSocket disconnected, max reconnection attempts (${this.maxReconnectAttempts}) reached`),this.resetReconnection();return}this.isReconnecting=true,this.log(`WebSocket disconnected, attempting reconnect ${this.reconnectAttempts}/${this.maxReconnectAttempts}`);let t=0;this.reconnectAttempts>1&&(t=1e3*Math.pow(2,this.reconnectAttempts-2),this.log(`Waiting ${t}ms before reconnecting...`)),this.reconnectTimer=setTimeout(async()=>{try{let e=await this._getWsConnectionUrl();this.websocket=await(this.origin?z0(e,this.origin):z0(e)),this.setupWebSocketHandlers(this.websocket);}catch(e){this.log("Reconnection failed:",e),await this.handleReconnect();}},t);}resetReconnection(){this.log("Resetting reconnection state"),this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=void 0),this.reconnectAttempts=0,this.isReconnecting=false;}isBridgeConnected(){return this.websocket?this.websocket.readyState===WebSocket.OPEN:false}isSecureChannelEstablished(){return this.secureChannelEstablished}async sendSecureMessage(t,e={}){if(!this.isConnected||!this.secureChannelEstablished)return await this.emit("error","Cannot send message: Secure channel not established"),false;let r=await Ch(t,e,this.sharedSecret,this.bridgeId,this.websocket);return r.messageIds.forEach(i=>this.seenMessageIds.add(i)),r.success}onConnect(t){return this.on("connected",t)}onSecureChannelEstablished(t){return this.on("secure-channel-established",t)}onRawMessage(t){return this.on("raw-message-received",t)}onSecureMessage(t){return this.on("message-received",t)}onError(t){return this.on("error",t)}onFailedToConnect(t){return this.on("failed-to-connect",e=>t(e))}onDisconnect(t){return this.on("disconnected",e=>t(e))}setRemotePublicKey(t){this.remotePublicKey=t;}computeSharedSecret(){if(!this.remotePublicKey)throw new Error("Remote public key not set");this.sharedSecret=Gp(this.keyPair.privateKey,this.remotePublicKey);}async createEncryptedGreeting(){if(!this.sharedSecret)throw new Error("Shared secret not available");let t=await J0("hello",this.sharedSecret,this.bridgeId);return Buffer.from(t).toString("hex")}async _getWsConnectionUrl(){if(this.role==="creator")return `${this.bridgeUrl}?id=${this.getBridgeId()}&v=${Dl}`;if(this.isSecureChannelEstablished())return `${this.bridgeUrl}?id=${this.getBridgeId()}&v=${Dl}`;{let t=await this.createEncryptedGreeting(),e=JSON.stringify({jsonrpc:"2.0",id:Vs(16),method:"handshake",params:{pubkey:this.getPublicKey(),greeting:t}}),r=Buffer.from(e).toString("base64");return `${this.bridgeUrl}?id=${this.getBridgeId()}&v=${Dl}&moc=${encodeURIComponent(r)}`}}getPublicKey(){return V0(this.keyPair.publicKey)}getRemotePublicKey(){if(!this.remotePublicKey)throw new Error("Remote public key not set");return V0(this.remotePublicKey)}getBridgeId(){return this.bridgeId}getWebSocket(){return this.websocket}get bridgeOrigin(){return this.role==="creator"?this.origin:this._bridgeOrigin}get connectionString(){return this.role==="creator"?`obsidion:${this.getPublicKey()}?d=${this.bridgeOrigin}`:`obsidion:${this.getBridgeId()}?d=${this.bridgeOrigin}`}async connect(t){try{this.log("Connecting to bridge...",t);let e=await(this.origin?z0(t,this.origin):z0(t));this.websocket=e,this.setupWebSocketHandlers(e);}catch(e){throw this.log("Error connecting to bridge:",e),await this.emit("error",`Error connecting to bridge: ${e instanceof Error?e.message:String(e)}`),e}}_handleCleanup(){this.log("Cleaning up event listeners and associated state"),this.reconnectTimer&&clearTimeout(this.reconnectTimer),this.reconnectTimer=void 0,this.pingTimer&&clearInterval(this.pingTimer),this.pingTimer=void 0,this.websocket&&(this.websocket.onopen=null,this.websocket.onmessage=null,this.websocket.onerror=null,this.websocket.onclose=null,this.websocket=void 0),this.secureChannelEstablished=false,this.sharedSecret=void 0,this.remotePublicKey=void 0,this.eventListeners={connected:[],"secure-channel-established":[],"raw-message-received":[],"message-received":[],"chunk-received":[],error:[],"failed-to-connect":[],disconnected:[]};}cleanup(){this.log("Closing connection to bridge"),this.intentionalClose=true,this.websocket?.close(1e3,"Connection closed by user");}};var Eh=tt(G0(),1),Bh=class S5{static async create(e={}){e.debug&&Eh.default.enable("bridge*");let r=e.autoconnect??true;if(e.origin&&typeof window<"u")throw new Error("Origin can't be specified when running in browser");!e.origin&&typeof window>"u"&&(e.origin="nodejs");let i=e.origin||window?.location?.protocol+"//"+window?.location?.hostname;if(e.remotePublicKey&&!e.resume)throw new Error("Can only provide remotePublicKey when resuming a bridge session");if(e.resume&&(!e.keyPair||!e.remotePublicKey))throw new Error("Resuming a bridge session requires a keyPair and remotePublicKey");let n=e.keyPair||jl(),o=V0(n.publicKey),s=new vh({role:"creator",origin:i,bridgeId:o,keyPair:n,reconnect:e.reconnect,keepalive:e.keepalive,pingInterval:e.pingInterval,bridgeUrl:e.bridgeUrl});return e.resume&&(s.setRemotePublicKey(e.remotePublicKey),await s.computeSharedSecret(),s.resume()),(e.resume||r)&&await s.connect(await s._getWsConnectionUrl()),{websocket:s.getWebSocket(),connection:s,onConnect:a=>s.onConnect(a),onFailedToConnect:a=>s.onFailedToConnect(a),onSecureChannelEstablished:a=>s.onSecureChannelEstablished(a),onRawMessage:a=>s.onRawMessage(a),onSecureMessage:a=>s.onSecureMessage(a),onError:a=>s.onError(a),onDisconnect:a=>s.onDisconnect(a),isBridgeConnected:()=>s.isBridgeConnected(),isSecureChannelEstablished:()=>s.isSecureChannelEstablished(),sendMessage:(a,l)=>s.sendSecureMessage(a,l||{}),connectionString:s.connectionString,bridgeId:s.getBridgeId(),origin:s.bridgeOrigin,getKeyPair:()=>s.keyPair,getPublicKey:()=>s.getPublicKey(),getRemotePublicKey:()=>s.getRemotePublicKey(),close:()=>s.cleanup(),cleanup:()=>s.cleanup(),[Symbol.dispose]:()=>s.cleanup()}}static async join(e,r={}){if(r.debug&&Eh.default.enable("bridge*"),r.resume&&!r.keyPair)throw new Error("Resuming a bridge session requires a keyPair");let i=r.keyPair||jl(),{domain:n,pubkey:o}=S5.parseConnectionString(e),s=new vh({role:"joiner",domain:n,bridgeId:o,keyPair:i,reconnect:r.reconnect,keepalive:r.keepalive,pingInterval:r.pingInterval,bridgeUrl:r.bridgeUrl});return s.setRemotePublicKey(new Uint8Array(Buffer.from(o,"hex"))),await s.computeSharedSecret(),r.resume&&s.resume(),await s.connect(await s._getWsConnectionUrl()),{websocket:s.getWebSocket(),connection:s,onConnect:a=>s.onConnect(a),onFailedToConnect:a=>s.onFailedToConnect(a),onSecureChannelEstablished:a=>s.onSecureChannelEstablished(a),onRawMessage:a=>s.onRawMessage(a),onSecureMessage:a=>s.onSecureMessage(a),onError:a=>s.onError(a),onDisconnect:a=>s.onDisconnect(a),isBridgeConnected:()=>s.isBridgeConnected(),isSecureChannelEstablished:()=>s.isSecureChannelEstablished(),sendMessage:(a,l)=>s.sendSecureMessage(a,l||{}),connectionString:s.connectionString,bridgeId:s.getBridgeId(),origin:s.bridgeOrigin,getKeyPair:()=>s.keyPair,getPublicKey:()=>s.getPublicKey(),getRemotePublicKey:()=>s.getRemotePublicKey(),close:()=>s.cleanup(),cleanup:()=>s.cleanup(),[Symbol.dispose]:()=>s.cleanup()}}static parseConnectionString(e){let r=new URL(e),i=r.pathname,n=r.searchParams.get("d");if(!n||!i)throw new Error("Invalid connection string: missing required parameters");return n!=="nodejs"&&!n.startsWith("http")&&(n="https://"+n),{domain:n,pubkey:i}}static async generateKeyPair(){return jl()}};var fd=tt(Mh(),1);var ud={locale:"en",countries:{AF:"Afghanistan",AL:"Albania",DZ:"Algeria",AS:"American Samoa",AD:"Andorra",AO:"Angola",AI:"Anguilla",AQ:"Antarctica",AG:"Antigua and Barbuda",AR:"Argentina",AM:"Armenia",AW:"Aruba",AU:"Australia",AT:"Austria",AZ:"Azerbaijan",BS:"Bahamas",BH:"Bahrain",BD:"Bangladesh",BB:"Barbados",BY:"Belarus",BE:"Belgium",BZ:"Belize",BJ:"Benin",BM:"Bermuda",BT:"Bhutan",BO:"Bolivia",BA:"Bosnia and Herzegovina",BW:"Botswana",BV:"Bouvet Island",BR:"Brazil",IO:"British Indian Ocean Territory",BN:"Brunei Darussalam",BG:"Bulgaria",BF:"Burkina Faso",BI:"Burundi",KH:"Cambodia",CM:"Cameroon",CA:"Canada",CV:"Cape Verde",KY:"Cayman Islands",CF:"Central African Republic",TD:"Chad",CL:"Chile",CN:["People's Republic of China","China"],CX:"Christmas Island",CC:"Cocos (Keeling) Islands",CO:"Colombia",KM:"Comoros",CG:["Republic of the Congo","Congo"],CD:["Democratic Republic of the Congo","Congo"],CK:"Cook Islands",CR:"Costa Rica",CI:["Cote d'Ivoire","C\xF4te d'Ivoire","Ivory Coast"],HR:"Croatia",CU:"Cuba",CY:"Cyprus",CZ:["Czech Republic","Czechia"],DK:"Denmark",DJ:"Djibouti",DM:"Dominica",DO:"Dominican Republic",EC:"Ecuador",EG:"Egypt",SV:"El Salvador",GQ:"Equatorial Guinea",ER:"Eritrea",EE:"Estonia",ET:"Ethiopia",FK:"Falkland Islands (Malvinas)",FO:"Faroe Islands",FJ:"Fiji",FI:"Finland",FR:"France",GF:"French Guiana",PF:"French Polynesia",TF:"French Southern Territories",GA:"Gabon",GM:["Republic of The Gambia","The Gambia","Gambia"],GE:"Georgia",DE:"Germany",GH:"Ghana",GI:"Gibraltar",GR:"Greece",GL:"Greenland",GD:"Grenada",GP:"Guadeloupe",GU:"Guam",GT:"Guatemala",GN:"Guinea",GW:"Guinea-Bissau",GY:"Guyana",HT:"Haiti",HM:"Heard Island and McDonald Islands",VA:"Holy See (Vatican City State)",HN:"Honduras",HK:"Hong Kong",HU:"Hungary",IS:"Iceland",IN:"India",ID:"Indonesia",IR:["Islamic Republic of Iran","Iran"],IQ:"Iraq",IE:"Ireland",IL:"Israel",IT:"Italy",JM:"Jamaica",JP:"Japan",JO:"Jordan",KZ:"Kazakhstan",KE:"Kenya",KI:"Kiribati",KP:"North Korea",KR:["South Korea","Korea, Republic of","Republic of Korea"],KW:"Kuwait",KG:"Kyrgyzstan",LA:"Lao People's Democratic Republic",LV:"Latvia",LB:"Lebanon",LS:"Lesotho",LR:"Liberia",LY:"Libya",LI:"Liechtenstein",LT:"Lithuania",LU:"Luxembourg",MO:"Macao",MG:"Madagascar",MW:"Malawi",MY:"Malaysia",MV:"Maldives",ML:"Mali",MT:"Malta",MH:"Marshall Islands",MQ:"Martinique",MR:"Mauritania",MU:"Mauritius",YT:"Mayotte",MX:"Mexico",FM:"Micronesia, Federated States of",MD:"Moldova, Republic of",MC:"Monaco",MN:"Mongolia",MS:"Montserrat",MA:"Morocco",MZ:"Mozambique",MM:"Myanmar",NA:"Namibia",NR:"Nauru",NP:"Nepal",NL:["Netherlands","The Netherlands","Netherlands (Kingdom of the)"],NC:"New Caledonia",NZ:"New Zealand",NI:"Nicaragua",NE:"Niger",NG:"Nigeria",NU:"Niue",NF:"Norfolk Island",MK:["The Republic of North Macedonia","North Macedonia"],MP:"Northern Mariana Islands",NO:"Norway",OM:"Oman",PK:"Pakistan",PW:"Palau",PS:["State of Palestine","Palestine"],PA:"Panama",PG:"Papua New Guinea",PY:"Paraguay",PE:"Peru",PH:"Philippines",PN:["Pitcairn","Pitcairn Islands"],PL:"Poland",PT:"Portugal",PR:"Puerto Rico",QA:"Qatar",RE:"Reunion",RO:"Romania",RU:["Russian Federation","Russia"],RW:"Rwanda",SH:"Saint Helena",KN:"Saint Kitts and Nevis",LC:"Saint Lucia",PM:"Saint Pierre and Miquelon",VC:"Saint Vincent and the Grenadines",WS:"Samoa",SM:"San Marino",ST:"Sao Tome and Principe",SA:"Saudi Arabia",SN:"Senegal",SC:"Seychelles",SL:"Sierra Leone",SG:"Singapore",SK:"Slovakia",SI:"Slovenia",SB:"Solomon Islands",SO:"Somalia",ZA:"South Africa",GS:"South Georgia and the South Sandwich Islands",ES:"Spain",LK:"Sri Lanka",SD:"Sudan",SR:"Suriname",SJ:"Svalbard and Jan Mayen",SZ:"Eswatini",SE:"Sweden",CH:"Switzerland",SY:"Syrian Arab Republic",TW:["Taiwan, Province of China","Taiwan"],TJ:"Tajikistan",TZ:["United Republic of Tanzania","Tanzania"],TH:"Thailand",TL:"Timor-Leste",TG:"Togo",TK:"Tokelau",TO:"Tonga",TT:"Trinidad and Tobago",TN:"Tunisia",TR:["T\xFCrkiye","Turkey"],TM:"Turkmenistan",TC:"Turks and Caicos Islands",TV:"Tuvalu",UG:"Uganda",UA:"Ukraine",AE:["United Arab Emirates","UAE"],GB:["United Kingdom","UK","Great Britain"],US:["United States of America","United States","USA","U.S.A.","US","U.S."],UM:"United States Minor Outlying Islands",UY:"Uruguay",UZ:"Uzbekistan",VU:"Vanuatu",VE:"Venezuela",VN:"Vietnam",VG:"Virgin Islands, British",VI:"Virgin Islands, U.S.",WF:"Wallis and Futuna",EH:"Western Sahara",YE:"Yemen",ZM:"Zambia",ZW:"Zimbabwe",AX:["\xC5land Islands","Aland Islands"],BQ:"Bonaire, Sint Eustatius and Saba",CW:"Cura\xE7ao",GG:"Guernsey",IM:"Isle of Man",JE:"Jersey",ME:"Montenegro",BL:"Saint Barth\xE9lemy",MF:"Saint Martin (French part)",RS:"Serbia",SX:"Sint Maarten (Dutch part)",SS:"South Sudan",XK:"Kosovo"}};var D5={debug:(...t)=>{},info:(...t)=>{},warn:(...t)=>{},error:(...t)=>{}};(0, fd.registerLocale)(ud);function oa(t){if(t==="Zero Knowledge Republic")return "ZKR";let e;return e=(0, fd.getAlpha3Code)(t,"en")||t||"ZKR",e}function _n(t,e,r,i,n){n[i][e]={...n[i][e],[t]:r};}function V5(t,e,r,i){i[r][t]={...i[r][t],range:e};}function sa(t,e,r,i,n){n[i][e]={...n[i][e],[t]:r};}function Fv(){let t={query:{}},e="query",r=false,i=o=>{if(t[e].policy)throw new Error(`Cannot call .${o}() on a policy-driven query. The query for policy '${t[e].policy}' is immutable.`);r=true;},n={eq:(o,s)=>(i("eq"),(o==="issuing_country"||o==="nationality")&&(s=oa(s)),sa("eq",o,s,e,t),n),gte:(o,s)=>{if(i("gte"),_n("gte",o,s,e,t),o==="age"&&(s<1||s>=100))throw new Error("Age must be between 1 and 99 (inclusive)");return n},gt:(o,s)=>(i("gt"),_n("gt",o,s,e,t),n),lte:(o,s)=>(i("lte"),_n("lte",o,s,e,t),n),lt:(o,s)=>(i("lt"),_n("lt",o,s,e,t),n),range:(o,s,a)=>(i("range"),V5(o,[s,a],e,t),n),in:(o,s)=>(i("in"),s=s.map(a=>oa(a)),sa("in",o,s,e,t),n),out:(o,s)=>(i("out"),s=s.map(a=>oa(a)),sa("out",o,s,e,t),n),disclose:o=>(i("disclose"),t[e][o]={...t[e][o],disclose:true},n),bind:(o,s)=>(t[e].bind={...t[e].bind,[o]:s},n),sanctions:(o="all",s="all",a={strict:false})=>(i("sanctions"),t[e].sanctions={...t[e].sanctions,countries:o,lists:s,strict:a.strict??false},n),facematch:(o="strict")=>(i("facematch"),t[e].facematch={mode:o},n),raw:o=>(i("raw"),t[e]=o,n),policy:o=>{if(typeof o!="string"||o.length===0)throw new Error(".policy() requires a non-empty string id.");if(t[e].policy)throw new Error(`Cannot call .policy() more than once on a request (already set to '${t[e].policy}').`);if(r)throw new Error("Cannot combine .policy() with builder methods like .gte()/.disclose()/etc.");return t[e].policy=o,n},done:(()=>({query:t[e]}))};return n}var j5="0.17.0-beta.2",An=new Date(0),X5="https://dashboard-api.zkpassport.id",Uv="https://verifier.zkpassport.id",R5="0x1fa73686cf510f8f85757b0602de0dd72a13e68ae2092462be8b72662e7f179b",O5="0x24d9929b248be7eeecaa98e105c034a50539610f3fdd4cb9c8983ef4100d615d",M5="0x2532418a107c5306fa8308c22255792cf77e4a290cbce8a840a642a3e591340b",F5="0x16700a2d9168a194fc85f237af5829b5a2be05b8ae8ac4879ada34cf54a9c211",U5="0x0e1889bec6c1d686abcf08360ff404f803ab345881ea8cba6aad33b7f7f7ffe0",L5=1440*60*1e3,Lv=class{static checkDiscloseBytesPublicInputs(t,e,r){let i={},n=true,o=t.committedInputs?.disclose_bytes?.disclosedBytes??t.committedInputs?.disclose_bytes_evm?.disclosedBytes,s=Zf.fromDisclosedBytes(o,"passport"),a=Zf.fromDisclosedBytes(o,"id_card");if(r.document_type&&(r.document_type.eq&&r.document_type.eq.result&&r.document_type.eq.expected!==s.documentType&&(console.warn("Document type does not match the expected document type"),n=false,i.document_type={...i.document_type,eq:{expected:`${r.document_type.eq.expected}`,received:`${s.documentType??a.documentType}`,message:"Document type does not match the expected document type"}}),r.document_type.disclose&&r.document_type.disclose.result!==a.documentType&&(console.warn("Document type does not match the disclosed document type in query result"),n=false,i.document_type={...i.document_type,disclose:{expected:`${r.document_type.disclose?.result}`,received:`${a.documentType??s.documentType}`,message:"Document type does not match the disclosed document type in query result"}}),r.document_type.eq&&(e.document_type?.eq===void 0||r.document_type.eq.expected!==e.document_type.eq)&&(console.warn("Document type eq does not match the original query"),n=false,i.document_type={...i.document_type,eq:{expected:`${e.document_type?.eq}`,received:`${r.document_type.eq.expected}`,message:"Document type eq does not match the original query"}}),r.document_type.disclose&&!e.document_type?.disclose&&(console.warn("Document type disclose is not in the original query"),n=false,i.document_type={...i.document_type,disclose:{expected:"Not requested in original query",received:`${r.document_type.disclose.result}`,message:"Document type disclose is not in the original query"}})),r.birthdate){let l=s.dateOfBirth,c=a.dateOfBirth;r.birthdate.eq&&r.birthdate.eq.result&&!pe(r.birthdate.eq.expected,l)&&!pe(r.birthdate.eq.expected,c)&&(console.warn("Birthdate does not match the expected birthdate"),n=false,i.birthdate={...i.birthdate,eq:{expected:`${r.birthdate.eq.expected.toISOString()}`,received:`${l?.toISOString()??c?.toISOString()}`,message:"Birthdate does not match the expected birthdate"}}),r.birthdate.disclose&&!pe(r.birthdate.disclose.result,l)&&!pe(r.birthdate.disclose.result,c)&&(console.warn("Birthdate does not match the disclosed birthdate in query result"),n=false,i.birthdate={...i.birthdate,disclose:{expected:`${r.birthdate.disclose.result.toISOString()}`,received:`${l?.toISOString()??c?.toISOString()}`,message:"Birthdate does not match the disclosed birthdate in query result"}}),r.birthdate.eq&&(e.birthdate?.eq===void 0||!pe(r.birthdate.eq.expected,e.birthdate.eq))&&(console.warn("Birthdate eq does not match the original query"),n=false,i.birthdate={...i.birthdate,eq:{expected:`${e.birthdate?.eq?.toISOString?.()??"undefined"}`,received:`${r.birthdate.eq.expected.toISOString()}`,message:"Birthdate eq does not match the original query"}}),r.birthdate.disclose&&!e.birthdate?.disclose&&(console.warn("Birthdate disclose is not in the original query"),n=false,i.birthdate={...i.birthdate,disclose:{expected:"Not requested in original query",received:`${r.birthdate.disclose.result}`,message:"Birthdate disclose is not in the original query"}});}if(r.expiry_date){let l=s.dateOfExpiry,c=a.dateOfExpiry;r.expiry_date.eq&&r.expiry_date.eq.result&&!pe(r.expiry_date.eq.expected,l)&&!pe(r.expiry_date.eq.expected,c)&&(console.warn("Expiry date does not match the expected expiry date"),n=false,i.expiry_date={...i.expiry_date,eq:{expected:`${r.expiry_date.eq.expected.toISOString()}`,received:`${l?.toISOString()??c?.toISOString()}`,message:"Expiry date does not match the expected expiry date"}}),r.expiry_date.disclose&&!pe(r.expiry_date.disclose.result,l)&&!pe(r.expiry_date.disclose.result,c)&&(console.warn("Expiry date does not match the disclosed expiry date in query result"),n=false,i.expiry_date={...i.expiry_date,disclose:{expected:`${r.expiry_date.disclose.result.toISOString()}`,received:`${l?.toISOString()??c?.toISOString()}`,message:"Expiry date does not match the disclosed expiry date in query result"}}),r.expiry_date.eq&&(e.expiry_date?.eq===void 0||!pe(r.expiry_date.eq.expected,e.expiry_date.eq))&&(console.warn("Expiry date eq does not match the original query"),n=false,i.expiry_date={...i.expiry_date,eq:{expected:`${e.expiry_date?.eq?.toISOString?.()??"undefined"}`,received:`${r.expiry_date.eq.expected.toISOString()}`,message:"Expiry date eq does not match the original query"}}),r.expiry_date.disclose&&!e.expiry_date?.disclose&&(console.warn("Expiry date disclose is not in the original query"),n=false,i.expiry_date={...i.expiry_date,disclose:{expected:"Not requested in original query",received:`${r.expiry_date.disclose.result}`,message:"Expiry date disclose is not in the original query"}});}if(r.nationality){let l=s.nationality,c=a.nationality;r.nationality.eq&&r.nationality.eq.result&&r.nationality.eq.expected!==l&&r.nationality.eq.expected!==c&&(console.warn("Nationality does not match the expected nationality"),n=false,i.nationality={...i.nationality,eq:{expected:`${r.nationality.eq.expected}`,received:`${l??c}`,message:"Nationality does not match the expected nationality"}}),r.nationality.disclose&&r.nationality.disclose.result!==l&&r.nationality.disclose.result!==c&&(console.warn("Nationality does not match the disclosed nationality in query result"),n=false,i.nationality={...i.nationality,disclose:{expected:`${r.nationality.disclose.result}`,received:`${l??c}`,message:"Nationality does not match the disclosed nationality in query result"}}),r.nationality.eq&&(e.nationality?.eq===void 0||r.nationality.eq.expected!==e.nationality.eq)&&(console.warn("Nationality eq does not match the original query"),n=false,i.nationality={...i.nationality,eq:{expected:`${e.nationality?.eq}`,received:`${r.nationality.eq.expected}`,message:"Nationality eq does not match the original query"}}),r.nationality.disclose&&!e.nationality?.disclose&&(console.warn("Nationality disclose is not in the original query"),n=false,i.nationality={...i.nationality,disclose:{expected:"Not requested in original query",received:`${r.nationality.disclose.result}`,message:"Nationality disclose is not in the original query"}});}if(r.document_number){let l=s.documentNumber,c=a.documentNumber;r.document_number.eq&&r.document_number.eq.result&&r.document_number.eq.expected!==l&&r.document_number.eq.expected!==c&&(console.warn("Document number does not match the expected document number"),n=false,i.document_number={...i.document_number,eq:{expected:`${r.document_number.eq.expected}`,received:`${l??c}`,message:"Document number does not match the expected document number"}}),r.document_number.disclose&&r.document_number.disclose.result!==l&&r.document_number.disclose.result!==c&&(console.warn("Document number does not match the disclosed document number in query result"),n=false,i.document_number={...i.document_number,disclose:{expected:`${r.document_number.disclose.result}`,received:`${l??c}`,message:"Document number does not match the disclosed document number in query result"}}),r.document_number.eq&&(e.document_number?.eq===void 0||r.document_number.eq.expected!==e.document_number.eq)&&(console.warn("Document number eq does not match the original query"),n=false,i.document_number={...i.document_number,eq:{expected:`${e.document_number?.eq}`,received:`${r.document_number.eq.expected}`,message:"Document number eq does not match the original query"}}),r.document_number.disclose&&!e.document_number?.disclose&&(console.warn("Document number disclose is not in the original query"),n=false,i.document_number={...i.document_number,disclose:{expected:"Not requested in original query",received:`${r.document_number.disclose.result}`,message:"Document number disclose is not in the original query"}});}if(r.gender){let l=s.gender,c=a.gender;r.gender.eq&&r.gender.eq.result&&r.gender.eq.expected!==l&&r.gender.eq.expected!==c&&(console.warn("Gender does not match the expected gender"),n=false,i.gender={...i.gender,eq:{expected:`${r.gender.eq.expected}`,received:`${l??c}`,message:"Gender does not match the expected gender"}}),r.gender.disclose&&r.gender.disclose.result!==l&&r.gender.disclose.result!==c&&(console.warn("Gender does not match the disclosed gender in query result"),n=false,i.gender={...i.gender,disclose:{expected:`${r.gender.disclose.result}`,received:`${l??c}`,message:"Gender does not match the disclosed gender in query result"}}),r.gender.eq&&(e.gender?.eq===void 0||r.gender.eq.expected!==e.gender.eq)&&(console.warn("Gender eq does not match the original query"),n=false,i.gender={...i.gender,eq:{expected:`${e.gender?.eq}`,received:`${r.gender.eq.expected}`,message:"Gender eq does not match the original query"}}),r.gender.disclose&&!e.gender?.disclose&&(console.warn("Gender disclose is not in the original query"),n=false,i.gender={...i.gender,disclose:{expected:"Not requested in original query",received:`${r.gender.disclose.result}`,message:"Gender disclose is not in the original query"}});}if(r.issuing_country){let l=s.issuingCountry,c=a.issuingCountry;r.issuing_country.eq&&r.issuing_country.eq.result&&r.issuing_country.eq.expected!==l&&r.issuing_country.eq.expected!==c&&(console.warn("Issuing country does not match the expected issuing country"),n=false,i.issuing_country={...i.issuing_country,eq:{expected:`${r.issuing_country.eq.expected}`,received:`${l??c}`,message:"Issuing country does not match the expected issuing country"}}),r.issuing_country.disclose&&r.issuing_country.disclose.result!==l&&r.issuing_country.disclose.result!==c&&(console.warn("Issuing country does not match the disclosed issuing country in query result"),n=false,i.issuing_country={...i.issuing_country,disclose:{expected:`${r.issuing_country.disclose.result}`,received:`${l??c}`,message:"Issuing country does not match the disclosed issuing country in query result"}}),r.issuing_country.eq&&(e.issuing_country?.eq===void 0||r.issuing_country.eq.expected!==e.issuing_country.eq)&&(console.warn("Issuing country eq does not match the original query"),n=false,i.issuing_country={...i.issuing_country,eq:{expected:`${e.issuing_country?.eq}`,received:`${r.issuing_country.eq.expected}`,message:"Issuing country eq does not match the original query"}}),r.issuing_country.disclose&&!e.issuing_country?.disclose&&(console.warn("Issuing country disclose is not in the original query"),n=false,i.issuing_country={...i.issuing_country,disclose:{expected:"Not requested in original query",received:`${r.issuing_country.disclose.result}`,message:"Issuing country disclose is not in the original query"}});}if(r.fullname){let l=s.name,c=a.name;r.fullname.eq&&r.fullname.eq.result&&Ce(r.fullname.eq.expected).toLowerCase()!==l.toLowerCase()&&Ce(r.fullname.eq.expected).toLowerCase()!==c.toLowerCase()&&(console.warn("Fullname does not match the expected fullname"),n=false,i.fullname={...i.fullname,eq:{expected:`${r.fullname.eq.expected}`,received:`${l??c}`,message:"Fullname does not match the expected fullname"}}),r.fullname.disclose&&Ce(r.fullname.disclose.result).toLowerCase()!==l.toLowerCase()&&Ce(r.fullname.disclose.result).toLowerCase()!==c.toLowerCase()&&(console.warn("Fullname does not match the disclosed fullname in query result"),n=false,i.fullname={...i.fullname,disclose:{expected:`${r.fullname.disclose.result}`,received:`${l??c}`,message:"Fullname does not match the disclosed fullname in query result"}}),r.fullname.eq&&(e.fullname?.eq===void 0||Ce(r.fullname.eq.expected).toLowerCase()!==Ce(e.fullname.eq).toLowerCase())&&(console.warn("Fullname eq does not match the original query"),n=false,i.fullname={...i.fullname,eq:{expected:`${e.fullname?.eq}`,received:`${r.fullname.eq.expected}`,message:"Fullname eq does not match the original query"}}),r.fullname.disclose&&!e.fullname?.disclose&&(console.warn("Fullname disclose is not in the original query"),n=false,i.fullname={...i.fullname,disclose:{expected:"Not requested in original query",received:`${r.fullname.disclose.result}`,message:"Fullname disclose is not in the original query"}});}if(r.firstname){let l=s.firstName&&s.firstName.length>0?s.firstName:s.name,c=a.firstName&&a.firstName.length>0?a.firstName:a.name;r.firstname.eq&&r.firstname.eq.result&&Ce(r.firstname.eq.expected).toLowerCase()!==l.toLowerCase()&&Ce(r.firstname.eq.expected).toLowerCase()!==c.toLowerCase()&&(console.warn("Firstname does not match the expected firstname"),n=false,i.firstname={...i.firstname,eq:{expected:`${r.firstname.eq.expected}`,received:`${l??c}`,message:"Firstname does not match the expected firstname"}}),r.firstname.disclose&&Ce(r.firstname.disclose.result).toLowerCase()!==l.toLowerCase()&&Ce(r.firstname.disclose.result).toLowerCase()!==c.toLowerCase()&&(console.warn("Firstname does not match the disclosed firstname in query result"),n=false,i.firstname={...i.firstname,disclose:{expected:`${r.firstname.disclose.result}`,received:`${l??c}`,message:"Firstname does not match the disclosed firstname in query result"}}),r.firstname.eq&&(e.firstname?.eq===void 0||Ce(r.firstname.eq.expected).toLowerCase()!==Ce(e.firstname.eq).toLowerCase())&&(console.warn("Firstname eq does not match the original query"),n=false,i.firstname={...i.firstname,eq:{expected:`${e.firstname?.eq}`,received:`${r.firstname.eq.expected}`,message:"Firstname eq does not match the original query"}}),r.firstname.disclose&&!e.firstname?.disclose&&(console.warn("Firstname disclose is not in the original query"),n=false,i.firstname={...i.firstname,disclose:{expected:"Not requested in original query",received:`${r.firstname.disclose.result}`,message:"Firstname disclose is not in the original query"}});}if(r.lastname){let l=s.lastName&&s.lastName.length>0?s.lastName:s.name,c=a.lastName&&a.lastName.length>0?a.lastName:a.name;r.lastname.eq&&r.lastname.eq.result&&Ce(r.lastname.eq.expected).toLowerCase()!==l.toLowerCase()&&Ce(r.lastname.eq.expected).toLowerCase()!==c.toLowerCase()&&(console.warn("Lastname does not match the expected lastname"),n=false,i.lastname={...i.lastname,eq:{expected:`${r.lastname.eq.expected}`,received:`${l??c}`,message:"Lastname does not match the expected lastname"}}),r.lastname.disclose&&Ce(r.lastname.disclose.result).toLowerCase()!==l.toLowerCase()&&Ce(r.lastname.disclose.result).toLowerCase()!==c.toLowerCase()&&(console.warn("Lastname does not match the disclosed lastname in query result"),n=false,i.lastname={...i.lastname,disclose:{expected:`${r.lastname.disclose.result}`,received:`${l??c}`,message:"Lastname does not match the disclosed lastname in query result"}}),r.lastname.eq&&(e.lastname?.eq===void 0||Ce(r.lastname.eq.expected).toLowerCase()!==Ce(e.lastname.eq).toLowerCase())&&(console.warn("Lastname eq does not match the original query"),n=false,i.lastname={...i.lastname,eq:{expected:`${e.lastname?.eq}`,received:`${r.lastname.eq.expected}`,message:"Lastname eq does not match the original query"}}),r.lastname.disclose&&!e.lastname?.disclose&&(console.warn("Lastname disclose is not in the original query"),n=false,i.lastname={...i.lastname,disclose:{expected:"Not requested in original query",received:`${r.lastname.disclose.result}`,message:"Lastname disclose is not in the original query"}});}return {isCorrect:n,queryResultErrors:i}}static checkAgePublicInputs(t,e,r){let i={},n=true,o=new Date;new Date(o.getFullYear(),o.getMonth(),o.getDate(),0,0,0,0);let s=s4(t.committedInputs?.compare_age??t.committedInputs?.compare_age_evm),a=a4(t.committedInputs?.compare_age??t.committedInputs?.compare_age_evm);return r.age?(r.age.gte&&r.age.gte.result&&s!==r.age.gte.expected&&(console.warn("Age is not greater than or equal to the expected age"),n=false,i.age={...i.age,gte:{expected:r.age.gte.expected,received:s,message:"Age is not greater than or equal to the expected age"}}),r.age.gt&&r.age.gt.result&&s!==r.age.gt.expected+1&&(console.warn("Age is not greater than the expected age"),n=false,i.age={...i.age,gt:{expected:r.age.gt.expected,received:s,message:"Age is not greater than the expected age"}}),r.age.lt&&r.age.lt.result&&a!==r.age.lt.expected-1&&(console.warn("Age is not less than the expected age"),n=false,i.age={...i.age,lt:{expected:r.age.lt.expected,received:a,message:"Age is not less than the expected age"}}),r.age.lte&&r.age.lte.result&&a!==r.age.lte.expected&&(console.warn("Age is not less than or equal to the expected age"),n=false,i.age={...i.age,lte:{expected:r.age.lte.expected,received:a,message:"Age is not less than or equal to the expected age"}}),r.age.eq&&r.age.eq.result&&(s!==r.age.eq.expected||a!==r.age.eq.expected)&&(console.warn("Age does not match the expected age"),n=false,i.age={...i.age,eq:{expected:r.age.eq.expected,received:s!==r.age.eq.expected?s:a,message:"Age does not match the expected age"}}),r.age.range&&r.age.range.result&&(s!==r.age.range.expected[0]||a!==r.age.range.expected[1])&&(console.warn("Age is not in the expected range"),n=false,i.age={...i.age,range:{expected:r.age.range.expected,received:[s,a],message:"Age is not in the expected range"}}),!r.age.lt&&!r.age.lte&&!r.age.eq&&!r.age.range&&a!=0&&(console.warn("Maximum age should be equal to 0"),n=false,i.age={...i.age,disclose:{expected:0,received:a,message:"Maximum age should be equal to 0"}}),!r.age.gte&&!r.age.gt&&!r.age.eq&&!r.age.range&&s!=0&&(console.warn("Minimum age should be equal to 0"),n=false,i.age={...i.age,disclose:{expected:0,received:s,message:"Minimum age should be equal to 0"}}),r.age.disclose&&(r.age.disclose.result!==s||r.age.disclose.result!==a)&&(console.warn("Age does not match the disclosed age in query result"),n=false,i.age={...i.age,disclose:{expected:`${s}`,received:`${r.age.disclose.result}`,message:"Age does not match the disclosed age in query result"}})):(console.warn("Age is not set in the query result"),n=false,i.age={...i.age,disclose:{message:"Age is not set in the query result"}}),r.age?.gte&&(e.age?.gte===void 0||r.age.gte.expected!==e.age.gte)&&(console.warn("Age gte does not match the original query"),n=false,i.age={...i.age,gte:{expected:e.age?.gte,received:r.age.gte.expected,message:"Age gte does not match the original query"}}),r.age?.gt&&(e.age?.gt===void 0||r.age.gt.expected!==e.age.gt)&&(console.warn("Age gt does not match the original query"),n=false,i.age={...i.age,gt:{expected:e.age?.gt,received:r.age.gt.expected,message:"Age gt does not match the original query"}}),r.age?.lt&&(e.age?.lt===void 0||r.age.lt.expected!==e.age.lt)&&(console.warn("Age lt does not match the original query"),n=false,i.age={...i.age,lt:{expected:e.age?.lt,received:r.age.lt.expected,message:"Age lt does not match the original query"}}),r.age?.lte&&(e.age?.lte===void 0||r.age.lte.expected!==e.age.lte)&&(console.warn("Age lte does not match the original query"),n=false,i.age={...i.age,lte:{expected:e.age?.lte,received:r.age.lte.expected,message:"Age lte does not match the original query"}}),r.age?.eq&&(e.age?.eq===void 0||r.age.eq.expected!==e.age.eq)&&(console.warn("Age eq does not match the original query"),n=false,i.age={...i.age,eq:{expected:e.age?.eq,received:r.age.eq.expected,message:"Age eq does not match the original query"}}),r.age?.range&&(e.age?.range===void 0||r.age.range.expected[0]!==e.age.range[0]||r.age.range.expected[1]!==e.age.range[1])&&(console.warn("Age range does not match the original query"),n=false,i.age={...i.age,range:{expected:e.age?.range,received:r.age.range.expected,message:"Age range does not match the original query"}}),r.age?.disclose&&!e.age?.disclose&&(console.warn("Age disclose is not in the original query"),n=false,i.age={...i.age,disclose:{expected:"Not requested in original query",received:`${r.age.disclose.result}`,message:"Age disclose is not in the original query"}}),{isCorrect:n,queryResultErrors:i}}static checkBirthdatePublicInputs(t,e,r){let i={},n=true,o=new Date;new Date(o.getFullYear(),o.getMonth(),o.getDate(),0,0,0);let s=l4(t.committedInputs?.compare_birthdate??t.committedInputs?.compare_birthdate_evm,-1*Ao),a=d4(t.committedInputs?.compare_birthdate??t.committedInputs?.compare_birthdate_evm,-1*Ao);if(r.birthdate){if(r.birthdate.gte&&r.birthdate.gte.result&&!pe(s,r.birthdate.gte.expected)&&(console.warn("Birthdate is not greater than or equal to the expected birthdate"),n=false,i.birthdate={...i.birthdate,gte:{expected:r.birthdate.gte.expected,received:s,message:"Birthdate is not greater than or equal to the expected birthdate"}}),r.birthdate.gt&&r.birthdate.gt.result){let l=new Date(r.birthdate.gt.expected);l.setDate(l.getDate()+1),pe(s,l)||(console.warn("Birthdate is not greater than the expected birthdate"),n=false,i.birthdate={...i.birthdate,gt:{expected:r.birthdate.gt.expected,received:s,message:"Birthdate is not greater than the expected birthdate"}});}if(r.birthdate.lte&&r.birthdate.lte.result&&!pe(a,r.birthdate.lte.expected)&&(console.warn("Birthdate is not less than the expected birthdate"),n=false,i.birthdate={...i.birthdate,lte:{expected:r.birthdate.lte.expected,received:a,message:"Birthdate is not less than the expected birthdate"}}),r.birthdate.lt&&r.birthdate.lt.result){let l=new Date(r.birthdate.lt.expected);l.setDate(l.getDate()-1),pe(a,l)||(console.warn("Birthdate is not less than the expected birthdate"),n=false,i.birthdate={...i.birthdate,lt:{expected:r.birthdate.lt.expected,received:a,message:"Birthdate is not less than the expected birthdate"}});}r.birthdate.range&&r.birthdate.range.result&&(!pe(s,r.birthdate.range.expected[0])||!pe(a,r.birthdate.range.expected[1]))&&(console.warn("Birthdate is not in the expected range"),n=false,i.birthdate={...i.birthdate,range:{expected:r.birthdate.range.expected,received:[s,a],message:"Birthdate is not in the expected range"}}),!r.birthdate.lte&&!r.birthdate.lt&&!r.birthdate.eq&&!r.birthdate.range&&!pe(a,An)&&(console.warn("Maximum birthdate should be equal to default date value"),n=false,i.birthdate={...i.birthdate,disclose:{expected:`${An.toISOString()}`,received:`${a.toISOString()}`,message:"Maximum birthdate should be equal to default date value"}}),!r.birthdate.gte&&!r.birthdate.gt&&!r.birthdate.eq&&!r.birthdate.range&&!pe(s,An)&&(console.warn("Minimum birthdate should be equal to default date value"),n=false,i.birthdate={...i.birthdate,disclose:{expected:`${An.toISOString()}`,received:`${s.toISOString()}`,message:"Minimum birthdate should be equal to default date value"}});}else console.warn("Birthdate is not set in the query result"),n=false,i.birthdate={...i.birthdate,disclose:{message:"Birthdate is not set in the query result"}};return r.birthdate?.gte&&(e.birthdate?.gte===void 0||!pe(r.birthdate.gte.expected,e.birthdate.gte))&&(console.warn("Birthdate gte does not match the original query"),n=false,i.birthdate={...i.birthdate,gte:{expected:e.birthdate?.gte,received:r.birthdate.gte.expected,message:"Birthdate gte does not match the original query"}}),r.birthdate?.gt&&(e.birthdate?.gt===void 0||!pe(r.birthdate.gt.expected,e.birthdate.gt))&&(console.warn("Birthdate gt does not match the original query"),n=false,i.birthdate={...i.birthdate,gt:{expected:e.birthdate?.gt,received:r.birthdate.gt.expected,message:"Birthdate gt does not match the original query"}}),r.birthdate?.lte&&(e.birthdate?.lte===void 0||!pe(r.birthdate.lte.expected,e.birthdate.lte))&&(console.warn("Birthdate lte does not match the original query"),n=false,i.birthdate={...i.birthdate,lte:{expected:e.birthdate?.lte,received:r.birthdate.lte.expected,message:"Birthdate lte does not match the original query"}}),r.birthdate?.lt&&(e.birthdate?.lt===void 0||!pe(r.birthdate.lt.expected,e.birthdate.lt))&&(console.warn("Birthdate lt does not match the original query"),n=false,i.birthdate={...i.birthdate,lt:{expected:e.birthdate?.lt,received:r.birthdate.lt.expected,message:"Birthdate lt does not match the original query"}}),r.birthdate?.range&&(e.birthdate?.range===void 0||!pe(r.birthdate.range.expected[0],e.birthdate.range[0])||!pe(r.birthdate.range.expected[1],e.birthdate.range[1]))&&(console.warn("Birthdate range does not match the original query"),n=false,i.birthdate={...i.birthdate,range:{expected:e.birthdate?.range,received:r.birthdate.range.expected,message:"Birthdate range does not match the original query"}}),{isCorrect:n,queryResultErrors:i}}static checkExpiryDatePublicInputs(t,e,r){let i={},n=true,o=new Date;new Date(o.getFullYear(),o.getMonth(),o.getDate(),0,0,0);let s=fl(t.committedInputs?.compare_expiry??t.committedInputs?.compare_expiry_evm),a=pl(t.committedInputs?.compare_expiry??t.committedInputs?.compare_expiry_evm);return r.expiry_date?(r.expiry_date.gte&&r.expiry_date.gte.result&&!pe(s,r.expiry_date.gte.expected)&&(console.warn("Expiry date is not greater than or equal to the expected expiry date"),n=false,i.expiry_date={...i.expiry_date,gte:{expected:r.expiry_date.gte.expected,received:s,message:"Expiry date is not greater than or equal to the expected expiry date"}}),r.expiry_date.lte&&r.expiry_date.lte.result&&!pe(a,r.expiry_date.lte.expected)&&(console.warn("Expiry date is not less than the expected expiry date"),n=false,i.expiry_date={...i.expiry_date,lte:{expected:r.expiry_date.lte.expected,received:a,message:"Expiry date is not less than the expected expiry date"}}),r.expiry_date.range&&r.expiry_date.range.result&&(!pe(s,r.expiry_date.range.expected[0])||!pe(a,r.expiry_date.range.expected[1]))&&(console.warn("Expiry date is not in the expected range"),n=false,i.expiry_date={...i.expiry_date,range:{expected:r.expiry_date.range.expected,received:[s,a],message:"Expiry date is not in the expected range"}}),!r.expiry_date.lte&&!r.expiry_date.lt&&!r.expiry_date.eq&&!r.expiry_date.range&&!pe(a,An)&&(console.warn("Maximum expiry date should be equal to default date value"),n=false,i.expiry_date={...i.expiry_date,disclose:{expected:`${An.toISOString()}`,received:`${a.toISOString()}`,message:"Maximum expiry date should be equal to default date value"}}),!r.expiry_date.gte&&!r.expiry_date.gt&&!r.expiry_date.eq&&!r.expiry_date.range&&!pe(s,An)&&(console.warn("Minimum expiry date should be equal to default date value"),n=false,i.expiry_date={...i.expiry_date,disclose:{expected:`${An.toISOString()}`,received:`${s.toISOString()}`,message:"Minimum expiry date should be equal to default date value"}})):(console.warn("Expiry date is not set in the query result"),n=false,i.expiry_date={...i.expiry_date,disclose:{message:"Expiry date is not set in the query result"}}),r.expiry_date?.gte&&(e.expiry_date?.gte===void 0||!pe(r.expiry_date.gte.expected,e.expiry_date.gte))&&(console.warn("Expiry date gte does not match the original query"),n=false,i.expiry_date={...i.expiry_date,gte:{expected:e.expiry_date?.gte,received:r.expiry_date.gte.expected,message:"Expiry date gte does not match the original query"}}),r.expiry_date?.gt&&(e.expiry_date?.gt===void 0||!pe(r.expiry_date.gt.expected,e.expiry_date.gt))&&(console.warn("Expiry date gt does not match the original query"),n=false,i.expiry_date={...i.expiry_date,gt:{expected:e.expiry_date?.gt,received:r.expiry_date.gt.expected,message:"Expiry date gt does not match the original query"}}),r.expiry_date?.lte&&(e.expiry_date?.lte===void 0||!pe(r.expiry_date.lte.expected,e.expiry_date.lte))&&(console.warn("Expiry date lte does not match the original query"),n=false,i.expiry_date={...i.expiry_date,lte:{expected:e.expiry_date?.lte,received:r.expiry_date.lte.expected,message:"Expiry date lte does not match the original query"}}),r.expiry_date?.lt&&(e.expiry_date?.lt===void 0||!pe(r.expiry_date.lt.expected,e.expiry_date.lt))&&(console.warn("Expiry date lt does not match the original query"),n=false,i.expiry_date={...i.expiry_date,lt:{expected:e.expiry_date?.lt,received:r.expiry_date.lt.expected,message:"Expiry date lt does not match the original query"}}),r.expiry_date?.range&&(e.expiry_date?.range===void 0||!pe(r.expiry_date.range.expected[0],e.expiry_date.range[0])||!pe(r.expiry_date.range.expected[1],e.expiry_date.range[1]))&&(console.warn("Expiry date range does not match the original query"),n=false,i.expiry_date={...i.expiry_date,range:{expected:e.expiry_date?.range,received:r.expiry_date.range.expected,message:"Expiry date range does not match the original query"}}),{isCorrect:n,queryResultErrors:i}}static checkNationalityExclusionPublicInputs(t,e,r){let i={},n=true;e.nationality&&e.nationality.out&&e.nationality.out.result?e.nationality.out.expected?.every(o=>r.includes(o))||(console.warn("Nationality exclusion list does not match the one from the query results"),n=false,i.nationality={...i.nationality,out:{expected:e.nationality.out.expected,received:r,message:"Nationality exclusion list does not match the one from the query results"}}):(!e.nationality||!e.nationality.out)&&(console.warn("Nationality exclusion is not set in the query result"),n=false,i.nationality={...i.nationality,out:{message:"Nationality exclusion is not set in the query result"}});for(let o=1;o<r.length;o++)r[o]<r[o-1]&&(console.warn("The nationality exclusion list has not been sorted, and thus the proof cannot be trusted"),n=false,i.nationality={...i.nationality,out:{message:"The nationality exclusion list has not been sorted, and thus the proof cannot be trusted"}});return e.nationality?.out&&(t.nationality?.out===void 0||e.nationality.out.expected?.length!==t.nationality.out.length||!e.nationality.out.expected?.every(o=>t.nationality.out.includes(o)))&&(console.warn("Nationality exclusion list does not match the original query"),n=false,i.nationality={...i.nationality,out:{expected:t.nationality?.out,received:e.nationality.out.expected,message:"Nationality exclusion list does not match the original query"}}),{isCorrect:n,queryResultErrors:i}}static checkIssuingCountryExclusionPublicInputs(t,e,r){let i={},n=true;e.issuing_country&&e.issuing_country.out&&e.issuing_country.out.result?e.issuing_country.out.expected?.every(o=>r.includes(o))||(console.warn("Issuing country exclusion list does not match the one from the query results"),n=false,i.issuing_country={...i.issuing_country,out:{expected:e.issuing_country.out.expected,received:r,message:"Issuing country exclusion list does not match the one from the query results"}}):(!e.issuing_country||!e.issuing_country.out)&&(console.warn("Issuing country exclusion is not set in the query result"),n=false,i.issuing_country={...i.issuing_country,out:{message:"Issuing country exclusion is not set in the query result"}});for(let o=1;o<r.length;o++)r[o]<r[o-1]&&(console.warn("The issuing country exclusion list has not been sorted, and thus the proof cannot be trusted"),n=false,i.issuing_country={...i.issuing_country,out:{message:"The issuing country exclusion list has not been sorted, and thus the proof cannot be trusted"}});return e.issuing_country?.out&&(t.issuing_country?.out===void 0||e.issuing_country.out.expected?.length!==t.issuing_country.out.length||!e.issuing_country.out.expected?.every(o=>t.issuing_country.out.includes(o)))&&(console.warn("Issuing country exclusion list does not match the original query"),n=false,i.issuing_country={...i.issuing_country,out:{expected:t.issuing_country?.out,received:e.issuing_country.out.expected,message:"Issuing country exclusion list does not match the original query"}}),{isCorrect:n,queryResultErrors:i}}static checkNationalityInclusionPublicInputs(t,e,r){let i={},n=true;return e.nationality&&e.nationality.in&&e.nationality.in.result?e.nationality.in.expected?.every(o=>r.includes(o))||(console.warn("Nationality inclusion list does not match the one from the query results"),n=false,i.nationality={...i.nationality,in:{expected:e.nationality.in.expected,received:r,message:"Nationality inclusion list does not match the one from the query results"}}):(!e.nationality||!e.nationality.in)&&(console.warn("Nationality inclusion is not set in the query result"),n=false,i.nationality={...i.nationality,in:{message:"Nationality inclusion is not set in the query result"}}),e.nationality?.in&&(t.nationality?.in===void 0||e.nationality.in.expected?.length!==t.nationality.in.length||!e.nationality.in.expected?.every(o=>t.nationality.in.includes(o)))&&(console.warn("Nationality inclusion list does not match the original query"),n=false,i.nationality={...i.nationality,in:{expected:t.nationality?.in,received:e.nationality.in.expected,message:"Nationality inclusion list does not match the original query"}}),{isCorrect:n,queryResultErrors:i}}static checkIssuingCountryInclusionPublicInputs(t,e,r){let i={},n=true;return e.issuing_country&&e.issuing_country.in&&e.issuing_country.in.result?e.issuing_country.in.expected?.every(o=>r.includes(o))||(console.warn("Issuing country inclusion list does not match the one from the query results"),n=false,i.issuing_country={...i.issuing_country,in:{expected:e.issuing_country.in.expected,received:r,message:"Issuing country inclusion list does not match the one from the query results"}}):(!e.issuing_country||!e.issuing_country.in)&&(console.warn("Issuing country inclusion is not set in the query result"),n=false,i.issuing_country={...i.issuing_country,in:{message:"Issuing country inclusion is not set in the query result"}}),e.issuing_country?.in&&(t.issuing_country?.in===void 0||e.issuing_country.in.expected?.length!==t.issuing_country.in.length||!e.issuing_country.in.expected?.every(o=>t.issuing_country.in.includes(o)))&&(console.warn("Issuing country inclusion list does not match the original query"),n=false,i.issuing_country={...i.issuing_country,in:{expected:t.issuing_country?.in,received:e.issuing_country.in.expected,message:"Issuing country inclusion list does not match the original query"}}),{isCorrect:n,queryResultErrors:i}}static checkScopeFromDisclosureProof(t,e,r,i,n){if(t==="*")return {isCorrect:true,queryResultErrors:r};let o=true;if(H0(t)!==ip(e)&&(console.warn("The proof comes from a different domain than the one expected"),o=false,r[i]||(r[i]={}),r[i].scope={expected:`Scope: ${H0(t).toString()}`,received:`Scope: ${ip(e).toString()}`,message:"The proof comes from a different domain than the one expected"}),Hs(n)!==rp(e)){let s=n?"The proof uses a different scope than the one expected":"The proof uses a scope but none was passed to verify()";console.warn(s),o=false,r[i]||(r[i]={}),r[i].scope={expected:`Scope: ${Hs(n).toString()}`,received:`Scope: ${rp(e).toString()}`,message:s};}return {isCorrect:o,queryResultErrors:r}}static async checkCertificateRegistryRoot(t,e,r,i,n){let o=true;try{await new Nl({chainId:i?11155111:1}).isCertificateRootValid(t,n)||(console.warn("The ID was signed by an unrecognized root certificate"),o=!1,e[r?"outer":"sig_check_dsc"]||(e[r?"outer":"sig_check_dsc"]={}),e[r?"outer":"sig_check_dsc"].certificate={expected:"A valid root from ZKPassport Registry",received:`Got invalid certificate registry root: ${t}`,message:"The ID was signed by an unrecognized root certificate"});}catch(s){console.warn(s),console.warn("The ID was signed by an unrecognized root certificate"),o=false,e[r?"outer":"sig_check_dsc"]||(e[r?"outer":"sig_check_dsc"]={}),e[r?"outer":"sig_check_dsc"].certificate={expected:"A valid root from ZKPassport Registry",received:`Got invalid certificate registry root: ${t}`,message:"The ID was signed by an unrecognized root certificate"};}return {isCorrect:o,queryResultErrors:e}}static async checkCircuitRegistryRoot(t,e,r,i){let n=true;try{await new Nl({chainId:r?11155111:1}).isCircuitRootValid(t,i)||(console.warn("The proof uses unrecognized circuits"),n=!1,e.outer||(e.outer={}),e.outer.circuit={expected:"A valid circuit from ZKPassport Registry",received:`Got invalid circuit registry root: ${t}`,message:"The proof uses an unrecognized circuit"});}catch(o){console.warn(o),console.warn("The proof uses unrecognized circuits"),n=false,e.outer||(e.outer={}),e.outer.circuit={expected:"A valid circuit from ZKPassport Registry",received:`Got invalid circuit registry root: ${t}`,message:"The proof uses an unrecognized circuit"};}return {isCorrect:n,queryResultErrors:e}}static checkBindPublicInputs(t,e,r){let i={},n=true;if(e.bind){let o=[];e.bind.user_address?.toLowerCase().replace("0x","")!==r.user_address?.toLowerCase().replace("0x","")&&(console.warn("Bound user address does not match the one from the query results"),n=false,o.push(`user_address: expected ${e.bind.user_address}, received ${r.user_address}`)),e.bind.chain!==r.chain&&(console.warn("Bound chain id does not match the one from the query results"),n=false,o.push(`chain: expected ${e.bind.chain}, received ${r.chain}`)),e.bind.custom_data?.trim().toLowerCase()!==r.custom_data?.trim().toLowerCase()&&(console.warn("Bound custom data does not match the one from the query results"),n=false,o.push(`custom_data: expected ${e.bind.custom_data}, received ${r.custom_data}`)),o.length>0&&(i.bind={...i.bind,eq:{expected:`${e.bind.user_address}, ${e.bind.chain}, ${e.bind.custom_data}`,received:`${r.user_address}, ${r.chain}, ${r.custom_data}`,message:`Bound data does not match: ${o.join("; ")}`}});}return (t.bind===void 0||r.user_address?.toLowerCase().replace("0x","")!==t.bind.user_address?.toLowerCase().replace("0x","")||r.chain!==t.bind.chain||r.custom_data?.trim().toLowerCase()!==t.bind.custom_data?.trim().toLowerCase())&&(console.warn("Bound data does not match the original query"),n=false,i.bind={...i.bind,eq:{expected:`${t.bind?.user_address}, ${t.bind?.chain}, ${t.bind?.custom_data}`,received:`${r.user_address}, ${r.chain}, ${r.custom_data}`,message:"Bound data does not match the original query"}}),{isCorrect:n,queryResultErrors:i}}static async checkSanctionsExclusionPublicInputs(t,e,r,i){let n={},o=true;if(r.isStrict!==(t.sanctions?.strict??false)&&(console.warn("Sanctions strict mode does not match the original query"),o=false,n.sanctions={...n.sanctions,eq:{expected:`strict: ${t.sanctions?.strict??false}`,received:`strict: ${r.isStrict}`,message:"Sanctions strict mode does not match the original query"}}),e.sanctions&&e.sanctions.passed){let s=await i.getRoot();r.rootHash!==s&&(console.warn("Invalid sanctions registry root"),o=false,n.sanctions={...n.sanctions,eq:{expected:s,received:r.rootHash,message:"Invalid sanctions registry root"}}),e.sanctions.isStrict!==r.isStrict&&(console.warn("Invalid sanctions strict mode"),o=false,n.sanctions={...n.sanctions,eq:{expected:e.sanctions.isStrict.toString(),received:r.isStrict.toString(),message:"Invalid sanctions strict mode"}});}return e.sanctions&&(t.sanctions===void 0||e.sanctions.isStrict!==(t.sanctions.strict??false))&&(console.warn("Sanctions config does not match the original query"),o=false,n.sanctions={...n.sanctions,eq:{expected:`strict: ${t.sanctions?.strict??false}`,received:`strict: ${e.sanctions.isStrict}`,message:"Sanctions config does not match the original query"}}),{isCorrect:o,queryResultErrors:n}}static async checkFacematchPublicInputs(t,e,r){let i=true,n={};r.rootKeyLeaf!==M5&&r.rootKeyLeaf!==F5&&r.rootKeyLeaf!==U5&&(console.warn("Invalid facematch root key hash"),i=false,n.facematch={...n.facematch,eq:{expected:`${M5} (iOS) or ${F5} (Android) or ${U5} (Android)`,received:r.rootKeyLeaf,message:"Invalid facematch root key hash"}});let o="production";return r.environment!==o&&(console.warn("Invalid facematch environment, it should be production"),i=false,n.facematch={...n.facematch,eq:{expected:o,received:r.environment,message:"Invalid facematch environment, it should be production"}}),r.appIdHash!==R5&&r.appIdHash!==O5&&(console.warn("Invalid facematch app id hash, the attestation should be coming from the ZKPassport app"),i=false,n.facematch={...n.facematch,eq:{expected:`${R5} (iOS) or ${O5} (Android)`,received:r.appIdHash,message:"Invalid facematch app id hash, the attestation should be coming from the ZKPassport app"}}),(e.facematch&&r.mode!==e.facematch.mode||r.mode!==t.facematch?.mode)&&(console.warn("Invalid facematch mode"),i=false,n.facematch={...n.facematch,eq:{expected:t.facematch?.mode,received:r.mode,message:"Invalid facematch mode"}}),{isCorrect:i,queryResultErrors:n}}static async checkCurrentDate(t,e,r,i){let n=new Date,o=new Date(n.getFullYear(),n.getMonth(),n.getDate(),0,0,0,0),s=np(e),a=o.getTime()-s.getTime(),l=r?r*1e3:604800*1e3,c=true;return a>=l&&(console.warn("The date used to check the validity of the ID falls out of the validity period"),c=false,i[t]||(i[t]={}),i[t].date={expected:`Difference: ${r} seconds`,received:`Difference: ${Math.round(a/1e3)} seconds`,message:"The date used to check the validity of the ID falls out of the validity period"}),s.getTime()-o.getTime()>L5&&(console.warn("The date used to check the validity of the ID is in the future"),c=false,i[t]||(i[t]={}),i[t].date={expected:`Difference: ${r} seconds`,received:`Difference: ${Math.round(a/1e3)} seconds`,message:"The date used to check the validity of the ID is in the future"}),{isCorrect:c,queryResultErrors:i}}static checkQueryCompleteness(t,e){let r=true,i={},n=(...y)=>y.some(b=>e.has(b)),o=(y,b)=>{r=false,i[y]={...i[y],commitment:{expected:"A proof covering the requested condition",received:"No matching proof was provided",message:b}};},s=n("disclose_bytes","disclose_bytes_evm"),a=y=>!!y&&(y.gte!==void 0||y.gt!==void 0||y.lte!==void 0||y.lt!==void 0||y.range!==void 0),l=y=>!!y&&(y.eq!==void 0||y.disclose===true),c=t.age;(a(c)||c?.eq!==void 0)&&!n("compare_age","compare_age_evm")&&o("age","The proof does not verify the requested age condition"),a(t.birthdate)&&!n("compare_birthdate","compare_birthdate_evm")&&o("birthdate","The proof does not verify the requested birthdate condition"),l(t.birthdate)&&!s&&o("birthdate","The proof does not disclose the requested birthdate"),a(t.expiry_date)&&!n("compare_expiry","compare_expiry_evm")&&o("expiry_date","The proof does not verify the requested expiry date condition"),l(t.expiry_date)&&!s&&o("expiry_date","The proof does not disclose the requested expiry date");let d=t.nationality;d?.in!==void 0&&!n("inclusion_check_nationality","inclusion_check_nationality_evm")&&o("nationality","The proof does not verify the requested nationality inclusion"),d?.out!==void 0&&!n("exclusion_check_nationality","exclusion_check_nationality_evm")&&o("nationality","The proof does not verify the requested nationality exclusion"),l(d)&&!s&&o("nationality","The proof does not disclose the requested nationality");let u=t.issuing_country;u?.in!==void 0&&!n("inclusion_check_issuing_country","inclusion_check_issuing_country_evm")&&o("issuing_country","The proof does not verify the requested issuing country inclusion"),u?.out!==void 0&&!n("exclusion_check_issuing_country","exclusion_check_issuing_country_evm")&&o("issuing_country","The proof does not verify the requested issuing country exclusion"),l(u)&&!s&&o("issuing_country","The proof does not disclose the requested issuing country");let h=["firstname","lastname","fullname","document_number","document_type","gender"];for(let y of h)l(t[y])&&!s&&o(y,`The proof does not disclose the requested ${y}`);return t.bind&&!n("bind","bind_evm")&&o("bind","The proof does not verify the requested bound data"),t.sanctions&&!n("exclusion_check_sanctions","exclusion_check_sanctions_evm")&&o("sanctions","The proof does not verify the requested sanctions exclusion"),t.facematch&&!n("facematch","facematch_evm")&&o("facematch","The proof does not verify the requested FaceMatch"),r||console.warn("The proof does not verify all the requested conditions and information"),{isCorrect:r,queryResultErrors:i}}static async checkPublicInputs(t,e,r,i,n,o,s,a){let l,c,d=true,u,h,y,b=new Date,x=new Date(b.getFullYear(),b.getMonth(),b.getDate(),0,0,0,0),m={},A=["sig_check_dsc","sig_check_id_data","data_check_integrity","disclose_bytes","compare_age","compare_birthdate","compare_expiry","exclusion_check_nationality","inclusion_check_nationality","exclusion_check_issuing_country","inclusion_check_issuing_country","bind","exclusion_check_sanctions","facematch"],_=e.sort((T,C)=>{let E=v=>{let B=v.name||"";return A.findIndex(D=>B.startsWith(D))};return E(T)-E(C)}),w=A.slice(3),I=_.find(T=>w.some(C=>T.name?.startsWith(C))),N=I?np(Ks(I.proof,Ls(I.name))):void 0,H=N?Math.floor(N.getTime()/1e3):void 0;for(let T of _){let C=Ks(T.proof,Ls(T.name));if(T.name?.startsWith("outer")){let E=T.name?.startsWith("outer_evm"),v=N4(C),B=Math.floor(v.getTime()/1e3),D=k4(C),{isCorrect:P,queryResultErrors:L}=await this.checkCertificateRegistryRoot(D.toString(16),m,true,a,B);d=d&&P,m={...m,...L};let K=P4(C),{isCorrect:z,queryResultErrors:q}=await this.checkCircuitRegistryRoot(K.toString(16),m,a,B);d=d&&z,m={...m,...q};let Y=x.getTime()-v.getTime(),Q=n?n*1e3:604800*1e3;Y>=Q&&(console.warn("The date used to check the validity of the ID is older than the validity period"),d=false,m.outer={...m.outer,date:{expected:`Difference: ${n} seconds`,received:`Difference: ${Math.round(Y/1e3)} seconds`,message:"The date used to check the validity of the ID is older than the validity period"}}),v.getTime()-x.getTime()>L5&&(console.warn("The date used to check the validity of the ID is in the future"),d=false,m.outer={...m.outer,date:{expected:`Difference: ${n} seconds`,received:`Difference: ${Math.round(Y/1e3)} seconds`,message:"The date used to check the validity of the ID is in the future"}});let ee=cp(C),V=T.committedInputs,ue=Object.keys(V||{});if(ue.length!==ee.length&&(console.warn("The proof does not verify all the requested conditions and information"),d=false,m.outer={...m.outer,commitment:{expected:`Number of parameter commitments: ${ee.length}`,received:`Number of disclosure proofs provided: ${ue.length}`,message:"The proof does not verify all the requested conditions and information"}}),H0(t)!==sp(C)&&(console.warn("The proof comes from a different domain than the one expected"),d=false,m.outer={...m.outer,scope:{expected:`Scope: ${H0(t).toString()}`,received:`Scope: ${sp(C).toString()}`,message:"The proof comes from a different domain than the one expected"}}),Hs(o)!==ap(C)){let $=o?"The proof uses a different scope than the one expected":"The proof uses a scope but none was passed to verify()";console.warn($),d=false,m.outer={...m.outer,scope:{expected:`Scope: ${Hs(o).toString()}`,received:`Scope: ${ap(C).toString()}`,message:$}};}if(V?.compare_age||V?.compare_age_evm){let $=V?.compare_age??V?.compare_age_evm,Z=E?await c4($.minAge,$.maxAge):await Qf($.minAge,$.maxAge);ee.includes(Z)||(console.warn("This proof does not verify the age"),d=false,m.age={...m.age,commitment:{expected:`Age parameter commitment: ${Z.toString()}`,received:`Parameter commitments included: ${ee.join(", ")}`,message:"This proof does not verify the age"}});let{isCorrect:ae,queryResultErrors:re}=this.checkAgePublicInputs(T,r,i);d=d&&ae,m={...m,...re};}if(V?.compare_birthdate||V?.compare_birthdate_evm){let $=V?.compare_birthdate??V?.compare_birthdate_evm,Z=E?await Jf(le.BIRTHDATE,$.minDateTimestamp,$.maxDateTimestamp,0):await U0(le.BIRTHDATE,$.minDateTimestamp,$.maxDateTimestamp,0);ee.includes(Z)||(console.warn("This proof does not verify the birthdate"),d=false,m.birthdate={...m.birthdate,commitment:{expected:`Birthdate parameter commitment: ${Z.toString()}`,received:`Parameter commitments included: ${ee.join(", ")}`,message:"This proof does not verify the birthdate"}});let{isCorrect:ae,queryResultErrors:re}=this.checkBirthdatePublicInputs(T,r,i);d=d&&ae,m={...m,...re};}if(V?.compare_expiry||V?.compare_expiry_evm){let $=V?.compare_expiry??V?.compare_expiry_evm,Z=E?await Jf(le.EXPIRY_DATE,$.minDateTimestamp,$.maxDateTimestamp):await U0(le.EXPIRY_DATE,$.minDateTimestamp,$.maxDateTimestamp);ee.includes(Z)||(console.warn("This proof does not verify the expiry date"),d=false,m.expiry_date={...m.expiry_date,commitment:{expected:`Expiry date parameter commitment: ${Z.toString()}`,received:`Parameter commitments included: ${ee.join(", ")}`,message:"This proof does not verify the expiry date"}});let{isCorrect:ae,queryResultErrors:re}=this.checkExpiryDatePublicInputs(T,r,i);d=d&&ae,m={...m,...re};}if(V?.disclose_bytes||V?.disclose_bytes_evm){let $=V?.disclose_bytes??V?.disclose_bytes_evm,Z=E?await o4($.discloseMask,$.disclosedBytes):await Yf($.discloseMask,$.disclosedBytes);ee.includes(Z)||(console.warn("This proof does not verify any of the data disclosed"),d=false,m.disclose={...m.disclose,commitment:{expected:`Disclosure parameter commitment: ${Z.toString()}`,received:`Parameter commitments included: ${ee.join(", ")}`,message:"This proof does not verify any of the data disclosed"}});let{isCorrect:ae,queryResultErrors:re}=this.checkDiscloseBytesPublicInputs(T,r,i);d=d&&ae,m={...m,...re};}if(V?.inclusion_check_nationality||V?.inclusion_check_nationality_evm){let $=V?.inclusion_check_nationality??V?.inclusion_check_nationality_evm,Z=E?await F0(le.NATIONALITY_INCLUSION,$.countries):await Ai(le.NATIONALITY_INCLUSION,$.countries);ee.includes(Z)||(console.warn("This proof does not verify the inclusion of the nationality"),d=false,m.nationality={...m.nationality,commitment:{expected:`Nationality parameter commitment: ${Z.toString()}`,received:`Parameter commitments included: ${ee.join(", ")}`,message:"This proof does not verify the inclusion of the nationality"}});let ae=$.countries,{isCorrect:re,queryResultErrors:me}=this.checkNationalityInclusionPublicInputs(r,i,ae);d=d&&re,m={...m,...me};}if(V?.inclusion_check_issuing_country||V?.inclusion_check_issuing_country_evm){let $=V?.inclusion_check_issuing_country??V?.inclusion_check_issuing_country_evm,Z=E?await F0(le.ISSUING_COUNTRY_INCLUSION,$.countries):await Ai(le.ISSUING_COUNTRY_INCLUSION,$.countries);ee.includes(Z)||(console.warn("This proof does not verify the inclusion of the issuing country"),d=false,m.issuing_country={...m.issuing_country,commitment:{expected:`Issuing country parameter commitment: ${Z.toString()}`,received:`Parameter commitments included: ${ee.join(", ")}`,message:"This proof does not verify the inclusion of the issuing country"}});let ae=$.countries,{isCorrect:re,queryResultErrors:me}=this.checkIssuingCountryInclusionPublicInputs(r,i,ae);d=d&&re,m={...m,...me};}if(V?.exclusion_check_nationality||V?.exclusion_check_nationality_evm){let $=V?.exclusion_check_nationality??V?.exclusion_check_nationality_evm,Z=E?await F0(le.NATIONALITY_EXCLUSION,$.countries):await Ai(le.NATIONALITY_EXCLUSION,$.countries);ee.includes(Z)||(console.warn("This proof does not verify the exclusion of the nationality"),d=false,m.nationality={...m.nationality,commitment:{expected:`Nationality parameter commitment: ${Z.toString()}`,received:`Parameter commitments included: ${ee.join(", ")}`,message:"This proof does not verify the exclusion of the nationality"}});let ae=$.countries,{isCorrect:re,queryResultErrors:me}=this.checkNationalityExclusionPublicInputs(r,i,ae);d=d&&re,m={...m,...me};}if(V?.exclusion_check_issuing_country||V?.exclusion_check_issuing_country_evm){let $=V?.exclusion_check_issuing_country??V?.exclusion_check_issuing_country_evm,Z=E?await F0(le.ISSUING_COUNTRY_EXCLUSION,$.countries):await Ai(le.ISSUING_COUNTRY_EXCLUSION,$.countries);ee.includes(Z)||(console.warn("This proof does not verify the exclusion of the issuing country"),d=false,m.issuing_country={...m.issuing_country,commitment:{expected:`Issuing country parameter commitment: ${Z.toString()}`,received:`Parameter commitments included: ${ee.join(", ")}`,message:"This proof does not verify the exclusion of the issuing country"}});let ae=$.countries,{isCorrect:re,queryResultErrors:me}=this.checkIssuingCountryExclusionPublicInputs(r,i,ae);d=d&&re,m={...m,...me};}if(V?.bind||V?.bind_evm){let $=V?.bind??V?.bind_evm,Z=E?await p4(L0($.data)):await ep(L0($.data));ee.includes(Z)||(console.warn("This proof does not verify the bound data"),d=false,m.bind={...m.bind,commitment:{expected:`Bind parameter commitment: ${Z.toString()}`,received:`Parameter commitments included: ${ee.join(", ")}`,message:"This proof does not verify the bound data"}});let{isCorrect:ae,queryResultErrors:re}=this.checkBindPublicInputs(r,i,$.data);d=d&&ae,m={...m,...re};}if(V?.exclusion_check_sanctions||V?.exclusion_check_sanctions_evm){let $=await op.create(),Z=V?.exclusion_check_sanctions??V?.exclusion_check_sanctions_evm,ae=E?await $.getSanctionsEvmParameterCommitment(Z.isStrict):await $.getSanctionsParameterCommitment(Z.isStrict);ee.includes(ae)||(console.warn("This proof does not verify the exclusion from the sanction lists"),d=false,m.sanctions={...m.sanctions,commitment:{expected:`Sanctions parameter commitment: ${ae.toString()}`,received:`Parameter commitments included: ${ee.join(", ")}`,message:"This proof does not verify the exclusion from the sanction lists"}});let{isCorrect:re,queryResultErrors:me}=await this.checkSanctionsExclusionPublicInputs(r,i,Z,$);d=d&&re,m={...m,...me};}if(V?.facematch||V?.facematch_evm){let $=V?.facematch??V?.facematch_evm,Z=E?await g4(BigInt($.rootKeyLeaf),$.environment==="development"?0n:1n,BigInt($.appIdHash),$.mode==="regular"?1n:2n):await tp(BigInt($.rootKeyLeaf),$.environment==="development"?0n:1n,BigInt($.appIdHash),$.mode==="regular"?1n:2n);ee.includes(Z)||(console.warn("This proof does not verify FaceMatch"),d=false,m.facematch={...m.facematch,commitment:{expected:`Facematch parameter commitment: ${Z.toString()}`,received:`Parameter commitments included: ${ee.join(", ")}`,message:"This proof does not verify FaceMatch"}});let{isCorrect:ae,queryResultErrors:re}=await this.checkFacematchPublicInputs(r,i,$);d=d&&ae,m={...m,...re};}u=R4(C).toString(10),h=D4(C),y=O4(C);}else if(T.name?.startsWith("sig_check_dsc")){c=r4(C);let E=t4(C),{isCorrect:v,queryResultErrors:B}=await this.checkCertificateRegistryRoot(E.toString(16),m,false,a,H);d=d&&v,m={...m,...B};}else if(T.name?.startsWith("sig_check_id_data"))l=u4(C),l!==c&&(console.warn("Failed to check the link between the certificate signature and ID signature"),d=false,m.sig_check_id_data={...m.sig_check_id_data,commitment:{expected:`Commitment: ${c?.toString()||"undefined"}`,received:`Commitment: ${l?.toString()||"undefined"}`,message:"Failed to check the link between the certificate signature and ID signature"}}),c=f4(C);else if(T.name?.startsWith("data_check_integrity"))l=i4(C),l!==c&&(console.warn("Failed to check the link between the ID signature and the data signed"),d=false,m.data_check_integrity={...m.data_check_integrity,commitment:{expected:`Commitment: ${c?.toString()||"undefined"}`,received:`Commitment: ${l?.toString()||"undefined"}`,message:"Failed to check the link between the ID signature and the data signed"}}),c=n4(C);else if(T.name==="disclose_bytes"){l=rr(C),l!==c&&(console.warn("Failed to check the link between the validity of the ID and the data to disclose"),d=false,m.disclose={...m.disclose,commitment:{expected:`Commitment: ${c?.toString()||"undefined"}`,received:`Commitment: ${l?.toString()||"undefined"}`,message:"Failed to check the link between the validity of the ID and the data to disclose"}});let E=tr(C),v=await Yf((T.committedInputs?.disclose_bytes).discloseMask,(T.committedInputs?.disclose_bytes).disclosedBytes);E!==v&&(console.warn("The disclosed data does not match the data committed by the proof"),d=false,m.disclose={...m.disclose,commitment:{expected:`Commitment: ${v}`,received:`Commitment: ${E}`,message:"The disclosed data does not match the data committed by the proof"}});let{isCorrect:B,queryResultErrors:D}=this.checkScopeFromDisclosureProof(t,C,m,"disclose",o);d=d&&B,m={...m,...D};let{isCorrect:P,queryResultErrors:L}=this.checkDiscloseBytesPublicInputs(T,r,i);d=d&&P&&B,m={...m,...L,...D};let{isCorrect:K,queryResultErrors:z}=await this.checkCurrentDate("disclose",C,n??604800,m);d=d&&K,m={...m,...z},u=Cr(C).toString(10),h=wr(C);}else if(T.name==="compare_age"){l=rr(C),l!==c&&(console.warn("Failed to check the link between the validity of the ID and the age derived from it"),d=false,m.age={...m.age,commitment:{expected:`Commitment: ${c}`,received:`Commitment: ${l}`,message:"Failed to check the link between the validity of the ID and the age derived from it"}});let E=tr(C),v=T.committedInputs?.compare_age,B=await Qf(v.minAge,v.maxAge);E!==B&&(console.warn("The conditions for the age check do not match the conditions checked by the proof"),d=false,m.age={...m.age,commitment:{expected:`Commitment: ${B}`,received:`Commitment: ${E}`,message:"The conditions for the age check do not match the conditions checked by the proof"}});let{isCorrect:D,queryResultErrors:P}=this.checkScopeFromDisclosureProof(t,C,m,"age",o),{isCorrect:L,queryResultErrors:K}=this.checkAgePublicInputs(T,r,i);d=d&&L&&D,m={...m,...K,...P};let{isCorrect:z,queryResultErrors:q}=await this.checkCurrentDate("age",C,n??604800,m);d=d&&z,m={...m,...q},u=Cr(C).toString(10),h=wr(C);}else if(T.name==="compare_birthdate"){l=rr(C),l!==c&&(console.warn("Failed to check the link between the validity of the ID and the birthdate derived from it"),d=false,m.birthdate={...m.birthdate,commitment:{expected:`Commitment: ${c}`,received:`Commitment: ${l}`,message:"Failed to check the link between the validity of the ID and the birthdate derived from it"}});let E=tr(C),v=T.committedInputs?.compare_birthdate,B=await U0(le.BIRTHDATE,v.minDateTimestamp,v.maxDateTimestamp,0);E!==B&&(console.warn("The conditions for the birthdate check do not match the conditions checked by the proof"),d=false,m.birthdate={...m.birthdate,commitment:{expected:`Commitment: ${B}`,received:`Commitment: ${E}`,message:"The conditions for the birthdate check do not match the conditions checked by the proof"}});let{isCorrect:D,queryResultErrors:P}=this.checkScopeFromDisclosureProof(t,C,m,"birthdate",o),{isCorrect:L,queryResultErrors:K}=this.checkBirthdatePublicInputs(T,r,i);d=d&&L&&D,m={...m,...K,...P};let{isCorrect:z,queryResultErrors:q}=await this.checkCurrentDate("birthdate",C,n??604800,m);d=d&&z,m={...m,...q},u=Cr(C).toString(10),h=wr(C);}else if(T.name==="compare_expiry"){l=rr(C),l!==c&&(console.warn("Failed to check the link between the validity of the ID and its expiry date"),d=false,m.expiry_date={...m.expiry_date,commitment:{expected:`Commitment: ${c}`,received:`Commitment: ${l}`,message:"Failed to check the link between the validity of the ID and its expiry date"}});let E=tr(C),v=T.committedInputs?.compare_expiry,B=await U0(le.EXPIRY_DATE,v.minDateTimestamp,v.maxDateTimestamp);E!==B&&(console.warn("The conditions for the expiry date check do not match the conditions checked by the proof"),d=false,m.expiry_date={...m.expiry_date,commitment:{expected:`Commitment: ${B}`,received:`Commitment: ${E}`,message:"The conditions for the expiry date check do not match the conditions checked by the proof"}});let{isCorrect:D,queryResultErrors:P}=this.checkScopeFromDisclosureProof(t,C,m,"expiry_date",o),{isCorrect:L,queryResultErrors:K}=this.checkExpiryDatePublicInputs(T,r,i);d=d&&L&&D,m={...m,...K,...P};let{isCorrect:z,queryResultErrors:q}=await this.checkCurrentDate("expiry_date",C,n??604800,m);d=d&&z,m={...m,...q},u=Cr(C).toString(10),h=wr(C);}else if(T.name==="exclusion_check_nationality"){l=rr(C),l!==c&&(console.warn("Failed to check the link between the validity of the ID and the nationality exclusion check"),d=false,m.nationality={...m.nationality,commitment:{expected:`Commitment: ${c}`,received:`Commitment: ${l}`,message:"Failed to check the link between the validity of the ID and the nationality exclusion check"}});let E=(T.committedInputs?.exclusion_check_nationality).countries,v=tr(C),B=await Ai(le.NATIONALITY_EXCLUSION,E,true);v!==B&&(console.warn("The committed country list for the exclusion check does not match the one from the proof"),d=false,m.nationality={...m.nationality,commitment:{expected:`Commitment: ${B}`,received:`Commitment: ${v}`,message:"The committed country list for the exclusion check does not match the one from the proof"}});let{isCorrect:D,queryResultErrors:P}=this.checkScopeFromDisclosureProof(t,C,m,"nationality",o),{isCorrect:L,queryResultErrors:K}=this.checkNationalityExclusionPublicInputs(r,i,E);d=d&&L&&D,m={...m,...K,...P};let{isCorrect:z,queryResultErrors:q}=await this.checkCurrentDate("nationality",C,n??604800,m);d=d&&z,m={...m,...q},u=Cr(C).toString(10),h=wr(C);}else if(T.name==="exclusion_check_issuing_country"){l=rr(C),l!==c&&(console.warn("Failed to check the link between the validity of the ID and the issuing country exclusion check"),d=false,m.issuing_country={...m.issuing_country,commitment:{expected:`Commitment: ${c}`,received:`Commitment: ${l}`,message:"Failed to check the link between the validity of the ID and the issuing country exclusion check"}});let E=(T.committedInputs?.exclusion_check_issuing_country).countries,v=tr(C),B=await Ai(le.ISSUING_COUNTRY_EXCLUSION,E,true);v!==B&&(console.warn("The committed country list for the issuing country exclusion check does not match the one from the proof"),d=false,m.issuing_country={...m.issuing_country,commitment:{expected:`Commitment: ${B}`,received:`Commitment: ${v}`,message:"The committed country list for the issuing country exclusion check does not match the one from the proof"}});let{isCorrect:D,queryResultErrors:P}=this.checkScopeFromDisclosureProof(t,C,m,"issuing_country",o),{isCorrect:L,queryResultErrors:K}=this.checkIssuingCountryExclusionPublicInputs(r,i,E);d=d&&L&&D,m={...m,...K,...P};let{isCorrect:z,queryResultErrors:q}=await this.checkCurrentDate("issuing_country",C,n??604800,m);d=d&&z,m={...m,...q},u=Cr(C).toString(10),h=wr(C);}else if(T.name==="inclusion_check_nationality"){l=rr(C),l!==c&&(console.warn("Failed to check the link between the validity of the ID and the nationality inclusion check"),d=false,m.nationality={...m.nationality,commitment:{expected:`Commitment: ${c}`,received:`Commitment: ${l}`,message:"Failed to check the link between the validity of the ID and the nationality inclusion check"}});let E=(T.committedInputs?.inclusion_check_nationality).countries,v=tr(C),B=await Ai(le.NATIONALITY_INCLUSION,E,false);v!==B&&(console.warn("The committed country list for the nationality inclusion check does not match the one from the proof"),d=false,m.nationality={...m.nationality,commitment:{expected:`Commitment: ${B}`,received:`Commitment: ${v}`,message:"The committed country list for the nationality inclusion check does not match the one from the proof"}});let{isCorrect:D,queryResultErrors:P}=this.checkScopeFromDisclosureProof(t,C,m,"nationality",o),{isCorrect:L,queryResultErrors:K}=this.checkNationalityInclusionPublicInputs(r,i,E);d=d&&L&&D,m={...m,...K,...P};let{isCorrect:z,queryResultErrors:q}=await this.checkCurrentDate("nationality",C,n??604800,m);d=d&&z,m={...m,...q},u=Cr(C).toString(10),h=wr(C);}else if(T.name==="inclusion_check_issuing_country"){l=rr(C),l!==c&&(console.warn("Failed to check the link between the validity of the ID and the issuing country inclusion check"),d=false,m.issuing_country={...m.issuing_country,commitment:{expected:`Commitment: ${c}`,received:`Commitment: ${l}`,message:"Failed to check the link between the validity of the ID and the issuing country inclusion check"}});let E=(T.committedInputs?.inclusion_check_issuing_country).countries,v=tr(C),B=await Ai(le.ISSUING_COUNTRY_INCLUSION,E,false);v!==B&&(console.warn("The committed country list for the issuing country inclusion check does not match the one from the proof"),d=false,m.issuing_country={...m.issuing_country,commitment:{expected:`Commitment: ${B}`,received:`Commitment: ${v}`,message:"The committed country list for the issuing country inclusion check does not match the one from the proof"}});let{isCorrect:D,queryResultErrors:P}=this.checkScopeFromDisclosureProof(t,C,m,"issuing_country",o),{isCorrect:L,queryResultErrors:K}=this.checkIssuingCountryInclusionPublicInputs(r,i,E);d=d&&L&&D,m={...m,...K,...P};let{isCorrect:z,queryResultErrors:q}=await this.checkCurrentDate("issuing_country",C,n??604800,m);d=d&&z,m={...m,...q},u=Cr(C).toString(10),h=wr(C);}else if(T.name==="bind"){l=rr(C),l!==c&&(console.warn("Failed to check the link between the validity of the ID and the bound data"),d=false,m.bind={...m.bind,commitment:{expected:`Commitment: ${c}`,received:`Commitment: ${l}`,message:"Failed to check the link between the validity of the ID and the bound data"}});let E=T.committedInputs?.bind,v=tr(C),B=await ep(L0(E.data));v!==B&&(console.warn("The bound data does not match the one from the proof"),d=false,m.bind={...m.bind,commitment:{expected:`Commitment: ${B}`,received:`Commitment: ${v}`,message:"The bound data does not match the one from the proof"}});let{isCorrect:D,queryResultErrors:P}=this.checkScopeFromDisclosureProof(t,C,m,"bind",o),{isCorrect:L,queryResultErrors:K}=this.checkBindPublicInputs(r,i,E.data);d=d&&L&&D,m={...m,...K,...P};let{isCorrect:z,queryResultErrors:q}=await this.checkCurrentDate("bind",C,n??604800,m);d=d&&z,m={...m,...q},u=Cr(C).toString(10),h=wr(C);}else if(T.name==="exclusion_check_sanctions"){l=rr(C),l!==c&&(console.warn("Failed to check the link between the validity of the ID and the sanctions exclusion check"),d=false,m.sanctions={...m.sanctions,commitment:{expected:`Commitment: ${c}`,received:`Commitment: ${l}`,message:"Failed to check the link between the validity of the ID and the sanctions exclusion check"}});let E=await op.create(),v=T.committedInputs?.exclusion_check_sanctions,B=await E.getSanctionsParameterCommitment(v.isStrict),D=tr(C);D!==B&&(console.warn("The sanction lists check against do not match the sanction lists from the proof"),d=false,m.sanctions={...m.sanctions,commitment:{expected:`Commitment: ${B.toString()}`,received:`Commitment: ${D.toString()}`,message:"The sanction lists check against do not match the sanction lists from the proof"}});let{isCorrect:P,queryResultErrors:L}=this.checkScopeFromDisclosureProof(t,C,m,"sanctions",o),{isCorrect:K,queryResultErrors:z}=await this.checkSanctionsExclusionPublicInputs(r,i,v,E);d=d&&K&&P,m={...m,...z,...L};let{isCorrect:q,queryResultErrors:Y}=await this.checkCurrentDate("sanctions",C,n??604800,m);d=d&&q,m={...m,...Y},u=Cr(C).toString(10),h=wr(C);}else if(T.name?.startsWith("facematch")&&!T.name?.endsWith("_evm")){l=rr(C),l!==c&&(console.warn("Failed to check the link between the validity of the ID and the facematch check"),d=false,m.facematch={...m.facematch,commitment:{expected:`Commitment: ${c}`,received:`Commitment: ${l}`,message:"Failed to check the link between the validity of the ID and the facematch check"}});let E=T.committedInputs?.facematch,v=tr(C),B=await tp(BigInt(E.rootKeyLeaf),E.environment==="development"?0n:1n,BigInt(E.appIdHash),E.mode==="regular"?1n:2n);v!==B&&(console.warn("The FaceMatch verification does not match the ones from the proof"),d=false,m.facematch={...m.facematch,commitment:{expected:`Commitment: ${B.toString()}`,received:`Commitment: ${v.toString()}`,message:"The FaceMatch verification does not match the ones from the proof"}});let{isCorrect:D,queryResultErrors:P}=this.checkScopeFromDisclosureProof(t,C,m,"facematch",o),{isCorrect:L,queryResultErrors:K}=await this.checkFacematchPublicInputs(r,i,E);d=d&&L&&D,m={...m,...K,...P};let{isCorrect:z,queryResultErrors:q}=await this.checkCurrentDate("facematch",C,n??604800,m);d=d&&z,m={...m,...q};}}let O=new Set;for(let T of _)for(let C of Object.keys(T.committedInputs??{}))O.add(C);let{isCorrect:U,queryResultErrors:F}=this.checkQueryCompleteness(r,O);if(d=d&&U,m={...m,...F},d&&h&&(h===Le.SALTED||h===Le.SALTED_MOCK))try{let T=await E4(s??v4),C=await B4(T),E=y;if(E===void 0){let v=_.find(B=>B.name&&!B.name.startsWith("sig_check_")&&!B.name.startsWith("data_check_")&&!B.name.startsWith("outer")&&!B.name.startsWith("facematch"));if(v){let B=Ks(v.proof,Ls(v.name));E=y4(B);}}(E===void 0||E!==C)&&(console.warn("OPRF public key hash mismatch: proof uses an unknown OPRF key"),d=!1);}catch(T){console.warn("Failed to verify OPRF public key:",T),d=false;}return h===Le.NONE?(u!==void 0&&BigInt(u)!==0n&&(console.warn("Proofs with the NONE nullifier type cannot carry a unique identifier"),d=false),u=void 0):u!==void 0&&BigInt(u)===0n&&(u=void 0),{isCorrect:d,uniqueIdentifier:u,uniqueIdentifierType:h,queryResultErrors:m}}},Hv={abi:[{type:"constructor",inputs:[{name:"_admin",type:"address",internalType:"address"},{name:"_guardian",type:"address",internalType:"address"},{name:"_rootRegistry",type:"address",internalType:"contract RootRegistry"},{name:"_defaultOPRFPubKeyHash",type:"bytes32",internalType:"bytes32"}],stateMutability:"nonpayable"},{type:"function",name:"addHelper",inputs:[{name:"version",type:"bytes32",internalType:"bytes32"},{name:"newHelper",type:"address",internalType:"address"}],outputs:[],stateMutability:"nonpayable"},{type:"function",name:"addSubVerifier",inputs:[{name:"version",type:"bytes32",internalType:"bytes32"},{name:"subVerifier",type:"address",internalType:"contract SubVerifier"}],outputs:[],stateMutability:"nonpayable"},{type:"function",name:"admin",inputs:[],outputs:[{name:"",type:"address",internalType:"address"}],stateMutability:"view"},{type:"function",name:"config",inputs:[{name:"key",type:"bytes32",internalType:"bytes32"}],outputs:[{name:"value",type:"bytes32",internalType:"bytes32"}],stateMutability:"view"},{type:"function",name:"defaultOPRFPubKeyHash",inputs:[],outputs:[{name:"",type:"bytes32",internalType:"bytes32"}],stateMutability:"view"},{type:"function",name:"getHelper",inputs:[{name:"version",type:"bytes32",internalType:"bytes32"}],outputs:[{name:"",type:"address",internalType:"address"}],stateMutability:"view"},{type:"function",name:"getSubVerifier",inputs:[{name:"version",type:"bytes32",internalType:"bytes32"}],outputs:[{name:"",type:"address",internalType:"address"}],stateMutability:"view"},{type:"function",name:"guardian",inputs:[],outputs:[{name:"",type:"address",internalType:"address"}],stateMutability:"view"},{type:"function",name:"helperCount",inputs:[],outputs:[{name:"",type:"uint256",internalType:"uint256"}],stateMutability:"view"},{type:"function",name:"helpers",inputs:[{name:"",type:"bytes32",internalType:"bytes32"}],outputs:[{name:"",type:"address",internalType:"contract VerifierHelper"}],stateMutability:"view"},{type:"function",name:"pause",inputs:[],outputs:[],stateMutability:"nonpayable"},{type:"function",name:"paused",inputs:[],outputs:[{name:"",type:"bool",internalType:"bool"}],stateMutability:"view"},{type:"function",name:"removeHelper",inputs:[{name:"version",type:"bytes32",internalType:"bytes32"}],outputs:[],stateMutability:"nonpayable"},{type:"function",name:"removeSubVerifier",inputs:[{name:"version",type:"bytes32",internalType:"bytes32"}],outputs:[],stateMutability:"nonpayable"},{type:"function",name:"rootRegistry",inputs:[],outputs:[{name:"",type:"address",internalType:"contract RootRegistry"}],stateMutability:"view"},{type:"function",name:"setDefaultOPRFPubKeyHash",inputs:[{name:"newHash",type:"bytes32",internalType:"bytes32"}],outputs:[],stateMutability:"nonpayable"},{type:"function",name:"setGuardian",inputs:[{name:"newGuardian",type:"address",internalType:"address"}],outputs:[],stateMutability:"nonpayable"},{type:"function",name:"subverifierCount",inputs:[],outputs:[{name:"",type:"uint256",internalType:"uint256"}],stateMutability:"view"},{type:"function",name:"subverifiers",inputs:[{name:"",type:"bytes32",internalType:"bytes32"}],outputs:[{name:"",type:"address",internalType:"contract SubVerifier"}],stateMutability:"view"},{type:"function",name:"transferAdmin",inputs:[{name:"newAdmin",type:"address",internalType:"address"}],outputs:[],stateMutability:"nonpayable"},{type:"function",name:"unpause",inputs:[],outputs:[],stateMutability:"nonpayable"},{type:"function",name:"updateConfig",inputs:[{name:"key",type:"bytes32",internalType:"bytes32"},{name:"value",type:"bytes32",internalType:"bytes32"}],outputs:[],stateMutability:"nonpayable"},{type:"function",name:"updateHelper",inputs:[{name:"version",type:"bytes32",internalType:"bytes32"},{name:"newHelper",type:"address",internalType:"address"}],outputs:[],stateMutability:"nonpayable"},{type:"function",name:"updateSubVerifier",inputs:[{name:"version",type:"bytes32",internalType:"bytes32"},{name:"newSubVerifier",type:"address",internalType:"address"}],outputs:[],stateMutability:"nonpayable"},{type:"function",name:"verify",inputs:[{name:"params",type:"tuple",internalType:"struct ProofVerificationParams",components:[{name:"version",type:"bytes32",internalType:"bytes32"},{name:"proofVerificationData",type:"tuple",internalType:"struct ProofVerificationData",components:[{name:"vkeyHash",type:"bytes32",internalType:"bytes32"},{name:"proof",type:"bytes",internalType:"bytes"},{name:"publicInputs",type:"bytes32[]",internalType:"bytes32[]"}]},{name:"committedInputs",type:"bytes",internalType:"bytes"},{name:"serviceConfig",type:"tuple",internalType:"struct ServiceConfig",components:[{name:"validityPeriodInSeconds",type:"uint256",internalType:"uint256"},{name:"domain",type:"string",internalType:"string"},{name:"scope",type:"string",internalType:"string"},{name:"devMode",type:"bool",internalType:"bool"}]}]}],outputs:[{name:"valid",type:"bool",internalType:"bool"},{name:"uniqueIdentifier",type:"bytes32",internalType:"bytes32"},{name:"helper",type:"address",internalType:"contract VerifierHelper"}],stateMutability:"view"},{type:"event",name:"AdminUpdated",inputs:[{name:"oldAdmin",type:"address",indexed:true,internalType:"address"},{name:"newAdmin",type:"address",indexed:true,internalType:"address"}],anonymous:false},{type:"event",name:"ConfigUpdated",inputs:[{name:"key",type:"bytes32",indexed:true,internalType:"bytes32"},{name:"oldValue",type:"bytes32",indexed:false,internalType:"bytes32"},{name:"newValue",type:"bytes32",indexed:false,internalType:"bytes32"}],anonymous:false},{type:"event",name:"DefaultOPRFPubKeyHashUpdated",inputs:[{name:"oldHash",type:"bytes32",indexed:false,internalType:"bytes32"},{name:"newHash",type:"bytes32",indexed:false,internalType:"bytes32"}],anonymous:false},{type:"event",name:"GuardianUpdated",inputs:[{name:"oldGuardian",type:"address",indexed:true,internalType:"address"},{name:"newGuardian",type:"address",indexed:true,internalType:"address"}],anonymous:false},{type:"event",name:"HelperAdded",inputs:[{name:"version",type:"bytes32",indexed:true,internalType:"bytes32"},{name:"helper",type:"address",indexed:true,internalType:"address"}],anonymous:false},{type:"event",name:"HelperRemoved",inputs:[{name:"version",type:"bytes32",indexed:true,internalType:"bytes32"},{name:"helper",type:"address",indexed:true,internalType:"address"}],anonymous:false},{type:"event",name:"HelperUpdated",inputs:[{name:"version",type:"bytes32",indexed:true,internalType:"bytes32"},{name:"oldHelper",type:"address",indexed:true,internalType:"address"},{name:"newHelper",type:"address",indexed:true,internalType:"address"}],anonymous:false},{type:"event",name:"PausedStatusChanged",inputs:[{name:"paused",type:"bool",indexed:false,internalType:"bool"}],anonymous:false},{type:"event",name:"RootRegistryUpdated",inputs:[{name:"oldRootRegistry",type:"address",indexed:true,internalType:"address"},{name:"newRootRegistry",type:"address",indexed:true,internalType:"address"}],anonymous:false},{type:"event",name:"RootVerifierDeployed",inputs:[{name:"admin",type:"address",indexed:false,internalType:"address"},{name:"guardian",type:"address",indexed:false,internalType:"address"},{name:"rootRegistry",type:"address",indexed:false,internalType:"address"}],anonymous:false},{type:"event",name:"SubVerifierAdded",inputs:[{name:"version",type:"bytes32",indexed:true,internalType:"bytes32"},{name:"subVerifier",type:"address",indexed:true,internalType:"address"}],anonymous:false},{type:"event",name:"SubVerifierRemoved",inputs:[{name:"version",type:"bytes32",indexed:true,internalType:"bytes32"},{name:"subVerifier",type:"address",indexed:true,internalType:"address"}],anonymous:false},{type:"event",name:"SubVerifierUpdated",inputs:[{name:"version",type:"bytes32",indexed:true,internalType:"bytes32"},{name:"oldSubVerifier",type:"address",indexed:true,internalType:"address"},{name:"newSubVerifier",type:"address",indexed:true,internalType:"address"}],anonymous:false}]},H5=class{static getDetails(){return {functionName:"verify",abi:Hv.abi,address:"0x1D000001000EFD9a6371f4d90bB8920D5431c0D8"}}static getParameters({proof:t,validityPeriodInSeconds:e=604800,domain:r,scope:i,devMode:n=false}){if(!t.name?.startsWith("outer_evm"))throw new Error("This proof cannot be verified on an EVM chain. Please make sure to use the `compressed-evm` mode.");let o=Ks(t.proof,Ls(t.name)),s=[],a=[];for(let h in t.committedInputs){let y=b4(h),b=h;s.push({circuitName:b,count:y});let x="";if(b==="inclusion_check_issuing_country_evm"||b==="inclusion_check_nationality_evm"||b==="exclusion_check_issuing_country_evm"||b==="exclusion_check_nationality_evm"){let m=t.committedInputs[b].countries;(b==="exclusion_check_issuing_country_evm"||b==="exclusion_check_nationality_evm")&&m.sort((_,w)=>_.localeCompare(w));let A=(()=>{switch(b){case "exclusion_check_issuing_country_evm":return le.ISSUING_COUNTRY_EXCLUSION;case "exclusion_check_nationality_evm":return le.NATIONALITY_EXCLUSION;case "inclusion_check_issuing_country_evm":return le.ISSUING_COUNTRY_INCLUSION;case "inclusion_check_nationality_evm":return le.NATIONALITY_INCLUSION}})();x=A.toString(16).padStart(2,"0")+ie[A].evm.toString(16).padStart(4,"0")+So(m.map(_=>Array.from(new TextEncoder().encode(_))).flat(),600).map(_=>_.toString(16).padStart(2,"0")).join("");}else if(b==="compare_age_evm"){let m=t.committedInputs[b];x=le.AGE.toString(16).padStart(2,"0")+ie[le.AGE].evm.toString(16).padStart(4,"0")+m.minAge.toString(16).padStart(2,"0")+m.maxAge.toString(16).padStart(2,"0");}else if(b==="compare_birthdate_evm"){let m=t.committedInputs[b],A=Array.from(Ie(m.minDateTimestamp,8)),_=Array.from(Ie(m.maxDateTimestamp,8));x=le.BIRTHDATE.toString(16).padStart(2,"0")+ie[le.BIRTHDATE].evm.toString(16).padStart(4,"0")+A.map(w=>w.toString(16).padStart(2,"0")).join("")+_.map(w=>w.toString(16).padStart(2,"0")).join("");}else if(b==="compare_expiry_evm"){let m=t.committedInputs[b],A=Array.from(Ie(m.minDateTimestamp,8)),_=Array.from(Ie(m.maxDateTimestamp,8));x=le.EXPIRY_DATE.toString(16).padStart(2,"0")+ie[le.EXPIRY_DATE].evm.toString(16).padStart(4,"0")+A.map(w=>w.toString(16).padStart(2,"0")).join("")+_.map(w=>w.toString(16).padStart(2,"0")).join("");}else if(b==="disclose_bytes_evm"){let m=t.committedInputs[b];x=le.DISCLOSE.toString(16).padStart(2,"0")+ie[le.DISCLOSE].evm.toString(16).padStart(4,"0")+m.discloseMask.map(A=>A.toString(16).padStart(2,"0")).join("")+m.disclosedBytes.map(A=>A.toString(16).padStart(2,"0")).join("");}else if(b==="bind_evm"){let m=t.committedInputs[b];x=le.BIND.toString(16).padStart(2,"0")+ie[le.BIND].evm.toString(16).padStart(4,"0")+So(L0(m.data),509).map(A=>A.toString(16).padStart(2,"0")).join("");}else if(b==="exclusion_check_sanctions_evm"){let m=t.committedInputs[b];x+=le.SANCTIONS_EXCLUSION.toString(16).padStart(2,"0"),x+=ie[le.SANCTIONS_EXCLUSION].evm.toString(16).padStart(4,"0"),x+=Array.from(Ie(BigInt(m.rootHash),32)).map(A=>A.toString(16).padStart(2,"0")).join(""),x+=m.isStrict?"01":"00";}else if(b.startsWith("facematch")&&b.endsWith("_evm")){let m=t.committedInputs[b];x+=le.FACEMATCH.toString(16).padStart(2,"0"),x+=ie[le.FACEMATCH].evm.toString(16).padStart(4,"0"),x+=Array.from(Ie(BigInt(m.rootKeyLeaf),32)).map(A=>A.toString(16).padStart(2,"0")).join(""),x+=m.environment==="development"?"00":"01",x+=Array.from(Ie(BigInt(m.appIdHash),32)).map(A=>A.toString(16).padStart(2,"0")).join(""),x+=Array.from(Ie(BigInt(m.integrityPubkeyHash),32)).map(A=>A.toString(16).padStart(2,"0")).join(""),x+=m.mode==="regular"?"01":"02";}else throw new Error(`Unsupported circuit for EVM verification: ${b}`);a.push({circuitName:b,inputs:x});}let l=cp(o).map(h=>h.toString(16).padStart(64,"0")),c="";for(let h of l){let y=a.find(b=>{let x=rt(Tn(b.inputs)),m=new Uint8Array(x.length);for(let A=0;A<x.length-1;A++)m[A+1]=x[A];return m[0]=0,Bn(m)===h.replace("0x","")});if(y)if(s.find(x=>x.circuitName===y.circuitName)?.count)c+=y.inputs;else throw new Error(`Unknown circuit name: ${y.circuitName}`);else throw new Error(`Invalid commitment: ${h}`)}let d=t.version?.split(".").map(h=>Number(h));if(!d||d.length!==3)throw new Error("Invalid version format");let u=new Uint8Array([...Ie(d[0],2),...Ie(d[1],2),...Ie(d[2],2)]);return {version:`0x${Bn(u).padEnd(64,"0")}`,proofVerificationData:{vkeyHash:`0x${t.vkeyHash.replace("0x","").padStart(64,"0")}`,proof:`0x${o.proof.join("")}`,publicInputs:o.publicInputs},committedInputs:`0x${c}`,serviceConfig:{validityPeriodInSeconds:e,domain:r,scope:i??"",devMode:n}}}};async function Kv({domain:t,proofs:e,query:r,queryResult:i,scope:n,requestId:o}){let s=e.map(a=>({proof:a.proof,vkeyHash:a.vkeyHash,version:a.version,name:a.name,index:a.index,total:a.total,committedInputs:a.committedInputs}));try{let a=await fetch(`${X5}/public/proofs`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({domain:t,proofs:s,query:r,queryResult:i,scope:n,sdkVersion:j5,requestId:o}),signal:AbortSignal.timeout(3e4)});a.ok?D5.debug("API response status:",a.status):D5.warn("API request failed with status:",a.status);}catch{}}var qv=[0,20,0];function Gv(t){if(!t)return "v5";let e=t.split(".").map(l=>Number(l));if(e.length!==3||e.some(l=>Number.isNaN(l)))return "v5";let[r,i,n]=e,[o,s,a]=qv;return r!==o?r>o?"v5":"v4":i!==s?i>s?"v5":"v4":n>=a?"v5":"v4"}async function zv(t,{writingDirectory:e}={}){await $v(t);let r=e?e+"/.bb-crs":void 0;if(t==="v4"){console.warn("Using deprecated v4 UltraHonk Verifier"),r=e?e+"/.bb-crs-v4":void 0;let{UltraHonkVerifierBackend:s,Barretenberg:a}=await Promise.resolve().then(()=>tt(E5(),1)),l=await a.new({crsPath:r});return {verifier:new s(l),destroy:()=>l.destroy()}}let{UltraHonkVerifierBackend:i,Barretenberg:n}=await Promise.resolve().then(()=>tt(T5(),1)),o=await n.new({crsPath:r});return {verifier:new i(o),destroy:()=>o.destroy()}}var K5="__zkpassport_bb_version",q5="keyval-store";async function $v(t){if(!(typeof indexedDB>"u"))try{let e=typeof localStorage<"u"?localStorage:void 0;if((e?.getItem(K5)??"v4")===t)return;let r=!0;if(typeof indexedDB.databases=="function")try{r=(await indexedDB.databases()).some(i=>i.name===q5);}catch{r=!0;}r&&await new Promise(i=>{let n=indexedDB.deleteDatabase(q5);n.onsuccess=n.onerror=n.onblocked=()=>i();}),e?.setItem(K5,t);}catch{}}async function G5({proofs:t,originalQuery:e,queryResult:r,domain:i,validity:n,scope:o,devMode:s,oprfKeyId:a}){try{let l=await fetch(`${Uv}/verify`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({proofs:t,originalQuery:e,queryResult:r,serviceConfig:{domain:i,scope:o,validityPeriodInSeconds:n,devMode:s},oprfKeyId:a}),signal:AbortSignal.timeout(6e4)});if(l.status>=500)return console.warn(`Verifier API error (status ${l.status})`),null;let c=await l.json().catch(()=>null);return !c||typeof c.verified!="boolean"?(console.warn(`Unexpected verifier API response (status ${l.status})`),null):c.verified?{uniqueIdentifier:c.uniqueIdentifier,uniqueIdentifierType:c.uniqueIdentifierType,verified:!0}:(console.warn("Verifier API did not verify the proofs:",c.error),{uniqueIdentifier:void 0,uniqueIdentifierType:void 0,verified:!1,queryResultErrors:c.queryResultErrors})}catch(l){return console.warn("Verifier API call failed:",l),null}}typeof globalThis.Buffer>"u"&&(globalThis.Buffer=Ro.Buffer,typeof window<"u"&&(window.Buffer=Ro.Buffer));var z5="Verify identity privately";function Vv({uniqueIdentifier:t,uniqueIdentifierType:e}){return e===Le.SALTED_MOCK?Le.SALTED:e===Le.NON_SALTED_MOCK?t===void 0?Le.NONE:Le.NON_SALTED:e}function jv(t,e){if(e==null||!t.verified||Vv(t)===e)return t;let r=t.uniqueIdentifierType,i=r===void 0?"missing":Le[r];return console.warn(`Unique identifier type mismatch: requested ${Le[e]}, got ${i}`),{...t,uniqueIdentifier:void 0,uniqueIdentifierType:void 0,verified:false}}var $5=false;function Xv(){$5||($5=true,console.warn("[zkpassport] onResult is deprecated. Use onSuccess and verify the proofs on your backend with verify()."));}var Uh=class{constructor(t){if(this.topicToConfig={},this.topicToLocalConfig={},this.topicToPublicKey={},this.topicToBridge={},this.topicToRequestReceived={},this.topicToService={},this.topicToCallerPurpose={},this.topicToProofs={},this.topicToFailedProofCount={},this.topicToResults={},this.topicToPolicy={},this.dashboardConfig=null,this.dashboardConfigPromise=null,this.dashboardConfigError=null,this.onRequestReceivedCallbacks={},this.onGeneratingProofCallbacks={},this.onBridgeConnectCallbacks={},this.onProofGeneratedCallbacks={},this.onSuccessCallbacks={},this.onResultCallbacks={},this.onRejectCallbacks={},this.onErrorCallbacks={},!t&&typeof window>"u")throw new Error("Domain argument is required in Node.js environment");this.domainProvided=!!t,this.domain=this.normalizeDomain(t||window.location.hostname);}normalizeDomain(t){return t.trim().replace(/^https?:\/\//,"").replace(/\/[^/]*$/,"").replace(/:[0-9]+/,"").replace(/\?.*$/,"").replace(/#.*$/,"").toLowerCase()}async handleResult(t){let e=this.topicToResults[t];delete this.topicToResults[t];let r=this.topicToProofs[t],i=this.topicToFailedProofCount[t]>0,n=!i&&r.length>0;if(n)try{await Promise.all(this.onSuccessCallbacks[t].map(a=>a({proofs:r,result:e})));}catch{}let o=this.topicToLocalConfig[t]?.devMode===true,s=this.topicToPolicy[t]?.proofStorageEnabled===true;n&&s&&this.domainProvided&&!o&&Kv({domain:this.domain,proofs:r,query:this.topicToConfig[t],queryResult:e,scope:this.topicToService[t]?.scope,requestId:this.topicToPublicKey[t]}),this.onResultCallbacks[t].length>0&&await this.verifyAndReportResult(t,r,e,i),delete this.topicToProofs[t],delete this.topicToFailedProofCount[t];}async verifyAndReportResult(t,e,r,i){let n;try{n=await this.verify({proofs:e,originalQuery:this.topicToConfig[t],queryResult:r,validity:this.topicToLocalConfig[t]?.validity,scope:this.topicToService[t]?.scope,devMode:this.topicToLocalConfig[t]?.devMode,oprfKeyId:this.topicToLocalConfig[t]?.oprfKeyId??void 0,uniqueIdentifierType:this.topicToLocalConfig[t]?.uniqueIdentifierType,verifierMode:this.topicToLocalConfig[t]?.verifierMode});}catch(c){let d=c instanceof Error?c.message:String(c);await Promise.all(this.onErrorCallbacks[t].map(u=>u(d)));return}let{uniqueIdentifier:o,uniqueIdentifierType:s,verified:a,queryResultErrors:l}=n;await Promise.all(this.onResultCallbacks[t].map(c=>c({uniqueIdentifier:i?void 0:o,uniqueIdentifierType:i?void 0:s,verified:i?false:a,result:r,queryResultErrors:l,proofs:e,sdkInstance:this})));}async handleEncryptedMessage(t,e){if(e.method==="accept")await Promise.all(this.onGeneratingProofCallbacks[t].map(r=>r(t)));else if(e.method==="reject")await Promise.all(this.onRejectCallbacks[t].map(r=>r()));else if(e.method==="proof")this.topicToProofs[t].push(e.params),await Promise.all(this.onProofGeneratedCallbacks[t].map(r=>r(e.params))),this.topicToResults[t]&&e.params.total===this.topicToProofs[t].length+this.topicToFailedProofCount[t]&&await this.handleResult(t);else if(e.method==="done")this.topicToResults[t]=Wf(e.params),this.topicToProofs[t].length>0&&this.topicToProofs[t].length+this.topicToFailedProofCount[t]===this.topicToProofs[t][0].total&&await this.handleResult(t);else if(e.method==="error"){let r=e.params.error;r&&r==="This ID is not supported yet"?this.topicToResults[t]&&await this.handleResult(t):r&&r.startsWith("Cannot generate proof")&&(this.topicToFailedProofCount[t]+=1,this.topicToResults[t]&&this.topicToProofs[t].length>0&&this.topicToProofs[t].length+this.topicToFailedProofCount[t]===this.topicToProofs[t][0].total&&await this.handleResult(t)),await Promise.all(this.onErrorCallbacks[t].map(i=>i(r)));}}assertNotPolicyLocked(t,e){if(this.topicToPolicy[t])throw new Error(`Cannot call .${e}() on a policy-driven request. The query for policy '${this.topicToPolicy[t].id}' is immutable.`)}getZkPassportRequest(t){return {eq:(e,r)=>(this.assertNotPolicyLocked(t,"eq"),(e==="issuing_country"||e==="nationality")&&(r=oa(r)),sa("eq",e,r,t,this.topicToConfig),this.getZkPassportRequest(t)),gte:(e,r)=>{if(this.assertNotPolicyLocked(t,"gte"),_n("gte",e,r,t,this.topicToConfig),e==="age"&&(r<1||r>=100))throw new Error("Age must be between 1 and 99 (inclusive)");return this.getZkPassportRequest(t)},gt:(e,r)=>(this.assertNotPolicyLocked(t,"gt"),_n("gt",e,r,t,this.topicToConfig),this.getZkPassportRequest(t)),lte:(e,r)=>(this.assertNotPolicyLocked(t,"lte"),_n("lte",e,r,t,this.topicToConfig),this.getZkPassportRequest(t)),lt:(e,r)=>(this.assertNotPolicyLocked(t,"lt"),_n("lt",e,r,t,this.topicToConfig),this.getZkPassportRequest(t)),range:(e,r,i)=>(this.assertNotPolicyLocked(t,"range"),V5(e,[r,i],t,this.topicToConfig),this.getZkPassportRequest(t)),in:(e,r)=>(this.assertNotPolicyLocked(t,"in"),r=r.map(i=>oa(i)),sa("in",e,r,t,this.topicToConfig),this.getZkPassportRequest(t)),out:(e,r)=>(this.assertNotPolicyLocked(t,"out"),r=r.map(i=>oa(i)),sa("out",e,r,t,this.topicToConfig),this.getZkPassportRequest(t)),disclose:e=>(this.assertNotPolicyLocked(t,"disclose"),this.topicToConfig[t][e]={...this.topicToConfig[t][e],disclose:true},this.getZkPassportRequest(t)),bind:(e,r)=>(this.topicToConfig[t].bind={...this.topicToConfig[t].bind,[e]:r},this.getZkPassportRequest(t)),sanctions:(e="all",r="all",i={strict:false})=>(this.assertNotPolicyLocked(t,"sanctions"),this.topicToConfig[t].sanctions={...this.topicToConfig[t].sanctions,countries:e,lists:r,strict:i.strict??false},this.getZkPassportRequest(t)),facematch:(e="strict")=>(this.assertNotPolicyLocked(t,"facematch"),this.topicToConfig[t].facematch={mode:e},this.getZkPassportRequest(t)),raw:e=>{this.assertNotPolicyLocked(t,"raw");let{policy:r,bind:i,...n}=e;if(r){if(Object.keys(n).length>0)throw new Error("A query with `policy` cannot also carry conditions (bind is allowed).");this.getZkPassportRequest(t).policy(r),i&&(this.topicToConfig[t].bind=i);}else this.topicToConfig[t]=e;return this.getZkPassportRequest(t)},policy:e=>{if(this.assertCanApplyPolicy(t,e),!this.dashboardConfig)throw this.dashboardConfigError?this.dashboardConfigError:new Error(`Domain '${this.domain}' is not registered with the ZKPassport dashboard. To use policies, register your domain at https://dashboard.zkpassport.id.`);let r=this.findPolicy(this.dashboardConfig,e),{bind:i,...n}=r.query;this.topicToConfig[t]=n;let o=this.topicToService[t];return o&&(this.topicToCallerPurpose[t]||(o.purpose=r.purpose||z5),o.scope=r.id),this.topicToPolicy[t]={id:r.id,proofStorageEnabled:r.proofStorageEnabled===true},this.getZkPassportRequest(t)},done:(()=>{if(this.topicToFailedProofCount[t]=0,t==="offline-query"){let o=this.topicToConfig[t];return delete this.topicToConfig[t],delete this.topicToPolicy[t],{query:o}}let e=this.topicToLocalConfig[t],r=this.topicToConfig[t],i=!!r.facematch,n=!!r.facematch&&r.facematch?.mode==="strict";if(e.uniqueIdentifierType===Le.SALTED&&(e.devMode===false&&!n||!i))throw new Error("Salted nullifier requires strict facematch. Add .facematch('strict') to your query or remove the salted nullifier option.");return {url:this._getUrl(t),query:this.topicToConfig[t],requestId:t,policy:this.topicToPolicy[t]?.id,onRequestReceived:o=>this.onRequestReceivedCallbacks[t].push(o),onGeneratingProof:o=>this.onGeneratingProofCallbacks[t].push(o),onBridgeConnect:o=>this.onBridgeConnectCallbacks[t].push(o),onProofGenerated:o=>this.onProofGeneratedCallbacks[t].push(o),onSuccess:o=>this.onSuccessCallbacks[t].push(o),onResult:o=>{Xv(),this.onResultCallbacks[t].push(o);},onReject:o=>this.onRejectCallbacks[t].push(o),onError:o=>this.onErrorCallbacks[t].push(o),isBridgeConnected:()=>this.topicToBridge[t].isBridgeConnected(),requestReceived:()=>this.topicToRequestReceived[t]===true}})}}async getDashboardConfig(){return this.dashboardConfig?this.dashboardConfig:(this.dashboardConfigPromise||(this.dashboardConfigPromise=this.fetchDashboardConfig().then(t=>(this.dashboardConfig=t,t)).catch(t=>{throw this.dashboardConfigPromise=null,t})),this.dashboardConfigPromise)}async fetchDashboardConfig(){let t=`${X5}/public/project?domain=${encodeURIComponent(this.domain)}`,e;try{e=await fetch(t,{signal:AbortSignal.timeout(1e4)});}catch(i){throw new Error(`Failed to fetch dashboard config for domain '${this.domain}': ${i.message}`)}if(!e.ok)throw new Error(`Failed to fetch dashboard config for domain '${this.domain}': ${e.status} ${e.statusText}`);let r=await e.json();if(r&&r.project===null)return null;if(!r||!r.project||!Array.isArray(r.policies))throw new Error(`Invalid dashboard config response for domain '${this.domain}'`);return r}findPolicy(t,e){let r=t.policies.find(i=>i.id===e);if(!r)throw new Error(`Policy '${e}' not found for domain '${this.domain}'. The dashboard returned ${t.policies.length} policies for this domain.`);if(!r.query||typeof r.query!="object")throw new Error(`Invalid policy '${e}' for domain '${this.domain}': missing query object.`);return r}assertCanApplyPolicy(t,e){if(typeof e!="string"||e.length===0)throw new Error(".policy() requires a non-empty string id.");if(this.topicToPolicy[t])throw new Error(`Cannot call .policy() more than once on a request (already set to '${this.topicToPolicy[t].id}').`);if(Object.keys(this.topicToConfig[t]).length>0)throw new Error("Cannot combine .policy() with builder methods like .gte()/.disclose()/etc. Call .policy() first; only .bind() may follow it.")}async request({name:t,logo:e,purpose:r,scope:i,projectID:n,mode:o,validity:s,devMode:a,uniqueIdentifierType:l,oprfKeyId:c,topicOverride:d,keyPairOverride:u,cloudProverUrl:h,bridgeUrl:y,returnDeepLink:b,verifierMode:x}){if(d==="offline-query")throw new Error("You cannot override the topic with 'offline-query'");if(c&&l===Le.NONE)throw new Error("An OPRF key cannot be used with the NONE unique identifier type. Remove the oprfKeyId option or use the SALTED type.");let m=null;try{m=await this.getDashboardConfig(),this.dashboardConfigError=null;}catch(w){this.dashboardConfigError=w;}let A=await Bh.create({keyPair:u,bridgeId:d,bridgeUrl:y}),_=A.connection.getBridgeId();return this.topicToConfig[_]={},this.topicToCallerPurpose[_]=r,this.topicToService[_]={name:t||m?.project?.name||this.domain,logo:e||m?.project?.logoUrl||"",purpose:r||z5,scope:i,projectID:n,cloudProverUrl:h,bridgeUrl:y},this.topicToProofs[_]=[],this.topicToLocalConfig[_]={validity:s||604800,mode:o||"fast",devMode:a??false,uniqueIdentifierType:c?Le.SALTED:l,oprfKeyId:c??null,returnDeepLink:b,verifierMode:x},this.onRequestReceivedCallbacks[_]=[],this.onGeneratingProofCallbacks[_]=[],this.onBridgeConnectCallbacks[_]=[],this.onProofGeneratedCallbacks[_]=[],this.onSuccessCallbacks[_]=[],this.onResultCallbacks[_]=[],this.onRejectCallbacks[_]=[],this.onErrorCallbacks[_]=[],this.topicToPublicKey[_]=A.getPublicKey(),this.topicToBridge[_]=A,A.onConnect(async w=>{await Promise.all(this.onBridgeConnectCallbacks[_].map(I=>I()));}),A.onSecureChannelEstablished(async()=>{await Promise.all(this.onRequestReceivedCallbacks[_].map(w=>w()));}),A.onSecureMessage(async w=>{this.handleEncryptedMessage(_,w);}),this.getZkPassportRequest(_)}createQuery(){return Fv()}async verify({proofs:t,originalQuery:e,queryResult:r,validity:i,scope:n,devMode:o=false,writingDirectory:s,oprfKeyId:a,uniqueIdentifierType:l,verifierMode:c="auto"}){if(!e||!r)throw new Error("verify() requires `originalQuery` and `queryResult`");let d={uniqueIdentifier:void 0,uniqueIdentifierType:void 0,verified:false};if(!t||t.length===0)return d;let u={proofs:t,originalQuery:e,queryResult:r,validity:i,scope:n,devMode:o,oprfKeyId:a},h={...u,writingDirectory:s},y={...u,domain:this.domain},b=a?Le.SALTED:l,x;if(c==="local")x=await this.verifyLocally(h);else if(c==="api")x=await G5(y)??d;else {let m;try{m=await this.verifyLocally(h);}catch(A){console.warn("Local proof verification failed:",A);}x=m?.verified?m:await G5(y)??m??d;}return jv(x,b)}async verifyLocally({proofs:t,originalQuery:e,queryResult:r,validity:i,scope:n,devMode:o=false,writingDirectory:s,oprfKeyId:a}){let l=Wf(r);typeof window>"u"&&!s&&(s="/tmp");let c=Gv(t[0]?.version),{verifier:d,destroy:u}=await zv(c,{writingDirectory:s}),h=true,y,b,x;try{let{isCorrect:m,uniqueIdentifier:A,uniqueIdentifierType:_,queryResultErrors:w}=await Lv.checkPublicInputs(this.domain,t,e,l,i,n,a,o);if(y=A,b=_,h=m,x=m?void 0:w,(b===Le.SALTED_MOCK||b===Le.NON_SALTED_MOCK)&&!o&&(h=!1,console.warn("You are trying to verify a mock proof. This is only allowed in dev mode. To enable dev mode, set the `devMode` parameter to `true` in the request function parameters.")),h){let I=new Nl({chainId:o?11155111:1}),N=await I.getCircuitManifest(void 0,{version:t[0].version});for(let H of t){let O=H.name?.startsWith("outer_evm_"),U=H.name,F=Ks(H.proof,Ls(U)),T=await I.getPackagedCircuit(U,N,{validate:!O});if(O)try{let{createPublicClient:C,http:E}=await Promise.resolve().then(()=>tt(P5(),1)),{sepolia:v}=await Promise.resolve().then(()=>tt(Fh(),1)),{mainnet:B}=await Promise.resolve().then(()=>tt(Fh(),1)),{address:D,abi:P,functionName:L}=this.getSolidityVerifierDetails(),K=C({chain:o?v:B,transport:E(o?"https://eth-sepolia.g.alchemy.com/v2/in6UjcATST36yyKuk83yb1yukKs65u8G":"https://eth-mainnet.g.alchemy.com/v2/in6UjcATST36yyKuk83yb1yukKs65u8G")}),z=this.getSolidityVerifierParameters({proof:H,validityPeriodInSeconds:i,domain:this.domain,scope:n,devMode:o}),q=await K.readContract({address:D,abi:P,functionName:L,args:[z]});h=Array.isArray(q)?!!q[0]:!1;}catch(C){console.warn("Error verifying proof",C),h=!1;}else {let C=Ro.Buffer.from(T.vkey,"base64");try{h=await d.verifyProof({proof:Ro.Buffer.from(F.proof.join(""),"hex"),publicInputs:F.publicInputs,verificationKey:new Uint8Array(C)});}catch(E){console.warn(`Error verifying proof ${U}`,E),h=!1;}}if(!h)break}}}finally{await u();}return y=h?y:void 0,b=h?b:void 0,{uniqueIdentifier:y,uniqueIdentifierType:b,verified:h,queryResultErrors:x}}getSolidityVerifierDetails(){return H5.getDetails()}getSolidityVerifierParameters({proof:t,validityPeriodInSeconds:e=604800,domain:r,scope:i,devMode:n=false}){return H5.getParameters({proof:t,validityPeriodInSeconds:e,domain:r??this.domain,scope:i,devMode:n})}_getUrl(t){let e=Ro.Buffer.from(JSON.stringify(this.topicToConfig[t])).toString("base64"),r=Ro.Buffer.from(JSON.stringify(this.topicToService[t])).toString("base64"),i=this.topicToPublicKey[t],n=Math.floor(Date.now()/1e3)-this.topicToLocalConfig[t].validity,o=this.topicToLocalConfig[t].uniqueIdentifierType,s=this.topicToLocalConfig[t].oprfKeyId,a=this.topicToLocalConfig[t].returnDeepLink,l=`https://zkpassport.id/r?d=${this.domain}&t=${t}&c=${encodeURIComponent(e)}&s=${encodeURIComponent(r)}&p=${i}&m=${this.topicToLocalConfig[t].mode}&v=${j5}&dt=${n}&dev=${this.topicToLocalConfig[t].devMode?"1":"0"}`;return o!=null&&(l+=`&nt=${o}`),s&&(l+=`&oprf_k=${s}`),a&&(l+=`&r=${encodeURIComponent(a)}`),l}getUrl(t){return this._getUrl(t)}getServiceDetails(t){return this.topicToService[t]}cancelRequest(t){this.topicToBridge[t]&&(this.topicToBridge[t].close(),delete this.topicToBridge[t]),delete this.topicToPublicKey[t],delete this.topicToConfig[t],delete this.topicToLocalConfig[t],delete this.topicToProofs[t],delete this.topicToFailedProofCount[t],delete this.topicToResults[t],delete this.topicToPolicy[t],this.onRequestReceivedCallbacks[t]=[],this.onGeneratingProofCallbacks[t]=[],this.onBridgeConnectCallbacks[t]=[],this.onProofGeneratedCallbacks[t]=[],this.onRejectCallbacks[t]=[],this.onErrorCallbacks[t]=[];}clearAllRequests(){for(let t in this.topicToBridge)this.cancelRequest(t);}};var pd="[zkpassport]";function Wv(){try{return typeof localStorage<"u"&&localStorage.getItem("zkpassport:debug")==="1"}catch{return false}}var Yr={error(...t){console.error(pd,...t);},warn(...t){console.warn(pd,...t);},info(...t){console.info(pd,...t);},debug(...t){Wv()&&console.debug(pd,...t);}};function Z5(t){let e=t.showIntroScreen===true,[r,i]=cr(e?"intro":"preparing"),[n,o]=cr(null),[s,a]=cr(null),[l,c]=cr(null),[d,u]=cr(null),[h,y]=cr(null),[b,x]=cr(0),[m,A]=cr({received:0,total:null}),_=Fo(t);_.current=t;let w=Fo(null),I=Fo("preparing"),N=Fo(e),H=Fo(null);H.current===null&&(H.current=new Uh(t.domain)),Oc(()=>{let F=false,T=false,C=_.current.showIntroScreen===true;N.current=C,I.current="preparing",i(C?"intro":"preparing"),o(null),a(null),c(null),u(null),y(null),A({received:0,total:null}),w.current=null;let{domain:E,theme:v,showIntroScreen:B,query:D,onReady:P,onRetryClicked:L,onBridgeConnect:K,onRequestReceived:z,onGeneratingProof:q,onProofGenerated:Y,onSuccess:Q,onResult:ee,onReject:V,onError:ue,...$}=_.current;ee&&_.current.onSuccess&&Yr.warn("onResult is deprecated and drives the card; onSuccess return values are ignored");let Z=()=>{T||(T=true,Tr(_.current.onReady));},ae=(ot,ye)=>{Yr.error(ye),i("error");let xe=ye instanceof Error?ye.message:String(ye);Tr(_.current.onError,`${ot}: ${xe}`);},re=ot=>(...ye)=>{if(!F)try{ot(...ye);}catch(xe){ae("Failed to handle a verification update",xe);}},me=(ot,ye=false)=>{I.current=ot,ye&&(N.current=false),N.current||i(ot);};return H.current.request({...$,verifierMode:"api"}).then(ot=>{if(F)return;let ye;try{ye=D(ot);}catch(xe){ae("Failed to build the verification query",xe);return}ye.onBridgeConnect(re(()=>{(I.current==="preparing"||I.current==="connecting")&&me("waiting"),Z(),Tr(_.current.onBridgeConnect);})),ye.onRequestReceived(re(()=>{me("scanned",!0),Tr(_.current.onRequestReceived);})),ye.onGeneratingProof(re(()=>{me("generating",!0),Tr(_.current.onGeneratingProof);})),ye.onProofGenerated(re(xe=>{A(Qr=>({received:Qr.received+1,total:xe.total??Qr.total})),Tr(_.current.onProofGenerated,xe);})),ye.onSuccess(re(xe=>{if(ee){Tr(_.current.onSuccess,xe);return}let Qr=Cn=>{F||(N.current=!1,i(Cn));},$h;try{$h=_.current.onSuccess?.(xe);}catch(Cn){Yr.error(Cn),Qr("error");return}Promise.resolve($h).then(Cn=>Qr(Cn===!1?"error":"success"),Cn=>{Yr.error(Cn),Qr("error");});})),ee&&ye.onResult(re(xe=>{N.current=!1,i(xe.verified?"success":"error"),Tr(_.current.onResult,xe);})),ye.onReject(re(()=>{N.current=!1,i("error"),Tr(_.current.onReject);})),ye.onError(re(xe=>{N.current=!1,i("error"),Tr(_.current.onError,xe);})),w.current=ye,c(ye.query);try{let xe=H.current.getServiceDetails(ye.requestId);xe&&(u(xe.name||null),y(xe.logo||null));}catch(xe){Yr.error(xe);}try{ye.requestReceived()?me("scanned",!0):ye.isBridgeConnected()?(me("waiting"),Z()):me("connecting");}catch(xe){ae("Failed to check the verification state",xe);}o(ye.url);try{a(Zv(ye.url));}catch(xe){ae("Failed to render the QR code",xe);}}).catch(ot=>{F||ae("Failed to start the verification request",ot);}),()=>{F=true;}},[b]);let O=Td(()=>{Tr(_.current.onRetryClicked),x(F=>F+1);},[]),U=Td(()=>{N.current=false,i(I.current);},[]);return {state:r,url:n,qrSvg:s,query:l,serviceName:d,serviceLogo:h,retry:O,continueWithPhone:U,proofProgress:m}}function Zv(t){let e=W5.default.create(t,{errorCorrectionLevel:"Q"}),r=e.modules.size,i=e.modules.data,n=100/r,o=u=>u.toFixed(3),s=[[0,0],[0,r-7],[r-7,0]],a=(u,h)=>s.some(([y,b])=>u>=y&&u<y+7&&h>=b&&h<b+7),l="",c=n*.47;for(let u=0;u<r;u++)for(let h=0;h<r;h++){if(!i[u*r+h]||a(u,h))continue;let y=(h+.5)*n,b=(u+.5)*n;l+=`<circle cx="${o(y)}" cy="${o(b)}" r="${o(c)}"/>`;}let d="";for(let[u,h]of s){let y=(h+3.5)*n,b=(u+3.5)*n;d+=`<circle cx="${o(y)}" cy="${o(b)}" r="${o(n*3)}" fill="none" stroke="currentColor" stroke-width="${o(n)}"/><circle cx="${o(y)}" cy="${o(b)}" r="${o(n*1.5)}"/>`;}return `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" shape-rendering="geometricPrecision" fill="currentColor">${d}${l}</svg>`}function Tr(t,...e){if(t)try{t(...e);}catch{}}var Yv={firstname:"first name",lastname:"last name",fullname:"full name",birthdate:"date of birth",age:"age",expiry_date:"ID expiry date",nationality:"nationality",issuing_country:"ID issuing country",document_number:"document number",document_type:"document type",gender:"gender"},Qv=["birthdate","expiry_date"],hd="Read from your ID chip, nothing else is shared";function sr(t,e){if(e instanceof Date)return e.toLocaleDateString();if(Qv.includes(t)&&(typeof e=="string"||typeof e=="number")){let r=new Date(e);if(!Number.isNaN(r.getTime()))return r.toLocaleDateString()}return t==="document_type"&&typeof e=="string"?e.replace(/_/g," "):String(e)}function Y5(t,e){let r=e.slice(0,3).map(n=>sr(t,n)),i=e.length-r.length;return r.join(", ")+(i>0?` and ${i} more`:"")}function Jv(t){return Yv[t]??String(t).replace(/_/g," ")}function e7(t,e,r){let i=Jv(t);if(t==="age"){let n="Your exact age and birthdate stay hidden";e.gte!=null&&r.push({title:`You are ${e.gte} or older`,detail:n}),e.gt!=null&&r.push({title:`You are over ${e.gt}`,detail:n}),e.lte!=null&&r.push({title:`You are ${e.lte} or younger`,detail:n}),e.lt!=null&&r.push({title:`You are under ${e.lt}`,detail:n}),e.range!=null&&r.push({title:`Your age is between ${e.range[0]} and ${e.range[1]}`,detail:n}),e.eq!=null&&r.push({title:`You are ${e.eq} years old`,detail:"Your birthdate stays hidden"}),e.disclose&&r.push({title:"Share your age",detail:hd});return}if(t==="expiry_date"){let n="Your exact expiry date stays hidden";(e.gte!=null||e.gt!=null)&&r.push({title:`Your ID is valid until at least ${sr(t,e.gte??e.gt)}`,detail:n}),(e.lte!=null||e.lt!=null)&&r.push({title:`Your ID expires before ${sr(t,e.lte??e.lt)}`,detail:n}),e.range!=null&&r.push({title:`Your ID expires between ${sr(t,e.range[0])} and ${sr(t,e.range[1])}`,detail:n}),e.eq!=null&&r.push({title:`Your ID expires on ${sr(t,e.eq)}`}),e.disclose&&r.push({title:"Share your ID expiry date",detail:hd});return}if(t==="birthdate"){let n="Your exact birthdate stays hidden";(e.gte!=null||e.gt!=null)&&r.push({title:`You were born after ${sr(t,e.gte??e.gt)}`,detail:n}),(e.lte!=null||e.lt!=null)&&r.push({title:`You were born before ${sr(t,e.lte??e.lt)}`,detail:n}),e.range!=null&&r.push({title:`You were born between ${sr(t,e.range[0])} and ${sr(t,e.range[1])}`,detail:n}),e.eq!=null&&r.push({title:`Your date of birth is ${sr(t,e.eq)}`}),e.disclose&&r.push({title:"Share your date of birth",detail:hd});return}e.eq!=null&&r.push({title:`Your ${i} is ${sr(t,e.eq)}`,detail:"Only whether it matches is shared"}),e.in!=null&&r.push({title:`Your ${i} is one of: ${Y5(t,e.in)}`,detail:`Your actual ${i} stays hidden`}),e.out!=null&&r.push({title:`Your ${i} is not one of: ${Y5(t,e.out)}`,detail:`Your actual ${i} stays hidden`}),e.disclose&&r.push({title:`Share your ${i}`,detail:hd});}function Q5(t){if(!t)return [];let e=[];for(let[r,i]of Object.entries(t))if(i!=null){if(r==="sanctions"){e.push({title:"You are not on sanctions lists",detail:"Checked without revealing who you are"});continue}if(r==="facematch"){e.push({title:"Your face matches your ID photo",detail:"Selfie compared on your device, never uploaded"});continue}if(r==="bind"){e.push({title:"Attach the provided data to this verification"});continue}e7(r,i,e);}return e.length===0&&e.push({title:"You hold a valid, unexpired passport or ID card",detail:"Nothing else about you is revealed"}),e}function J5(){if(typeof navigator>"u"||typeof window>"u")return false;if(navigator.userAgentData?.mobile)return true;let e=navigator.userAgent;return !!(/Android|iPhone|iPod|Mobile|IEMobile/i.test(e)||/iPad/.test(e)||navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1)}function md(){if(typeof navigator>"u")return false;let t=navigator.userAgent;return !!(/FBAN|FBAV|FB_IAB|Instagram|Twitter|TwitterAndroid|Discord|Snapchat|TikTok|BytedanceWebview|musical_ly|Line\/|MicroMessenger|GSA\/|LinkedInApp|Pinterest/i.test(t)||/Android/.test(t)&&/; wv\)/.test(t)||/iPhone|iPad|iPod/.test(t)&&/AppleWebKit/.test(t)&&!/Safari\//.test(t))}var t7=0;function G(t,e,r,i,n,o){e||(e={});var s,a,l=e;if("ref"in l)for(a in l={},e)a=="ref"?s=e[a]:l[a]=e[a];var c={type:t,props:l,key:r,ref:s,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--t7,__i:-1,__u:0,__source:n,__self:o};if(typeof t=="function"&&(s=t.defaultProps))for(a in s)l[a]===void 0&&(l[a]=s[a]);return Ae.vnode&&Ae.vnode(c),c}function Lh({options:t,controlRef:e}){g2(c7,[]);let{state:r,url:i,qrSvg:n,query:o,serviceName:s,serviceLogo:a,retry:l,continueWithPhone:c,proofProgress:d}=Z5(t);Oc(()=>{if(e)return e.current={retry:l},()=>{e.current=null;}},[l,e]);let u=t.display?.header??true,h=t.display?.steps??true,y=t.display?.appLinks??true,b=t.name??s??t.domain??"",x=t.logo??a??"",m=r==="scanned"||r==="generating"||r==="success"||r==="error",A=!!o?.facematch,_=n7(r),w=r==="waiting"||r==="scanned",[I,N]=cr(false),H=J5(),O=md(),F=H&&(r==="preparing"||r==="connecting"||r==="waiting")&&!I,T=o7(r,m,A,d,H&&!I);return G("div",{className:"zkp-card","data-state":r,"data-theme":t.theme??"auto",children:[w?G("button",{type:"button",className:"zkp-restart","aria-label":"Restart verification",title:"Restart verification",onClick:l,dangerouslySetInnerHTML:{__html:B2}}):null,u?G(ar,{children:[G("div",{className:"zkp-header",children:[G("div",{className:"zkp-header-icons",children:[G("div",{className:"zkp-zkp-icon",dangerouslySetInnerHTML:{__html:la}}),x?G(ar,{children:[G("div",{className:"zkp-header-dots",children:[G("span",{}),G("span",{}),G("span",{})]}),G("div",{className:"zkp-app-icon-slot",children:G("img",{className:"zkp-app-icon",src:x,alt:b?`${b} icon`:""})})]}):null]}),G("p",{className:"zkp-title",children:[G("strong",{children:b||"This app"})," uses ",G("strong",{children:"ZKPassport"})," to verify identity without compromising your privacy."]})]}),G("div",{className:"zkp-divider zkp-divider-header"})]}):null,r==="intro"?G(i7,{appName:b||"This app",items:Q5(o),loading:o===null,onContinue:c}):G("div",{className:"zkp-screen",children:[F?G("div",{className:"zkp-open-app-hero",children:[r==="waiting"&&i?G("a",{className:"zkp-open-app zkp-open-app-block",href:i,children:"Open ZKPassport App"}):G("div",{className:"zkp-open-app-loading",role:"status","aria-label":"Preparing request",children:G("span",{className:"zkp-skel-row",style:{width:"100%",height:"48px"}})}),O?G("p",{className:"zkp-inapp-hint",children:"If nothing opens, open this page in Safari or Chrome and try again."}):null,G("button",{type:"button",className:"zkp-qr-reveal",onClick:()=>N(true),children:"Scan a QR code with another device instead"})]}):G(s7,{state:r,qrSvg:n,caption:_}),r==="waiting"&&i&&H&&I?G("a",{className:"zkp-open-app zkp-open-app-block",href:i,children:"Open in ZKPassport App"}):null,h&&T.length>0?G(ar,{children:[G("div",{className:"zkp-divider zkp-divider-top"}),G("div",{className:"zkp-steps",children:T.map(C=>G(a7,{status:C.status,icon:C.icon,children:C.label},C.key))})]}):null,y?G("div",{className:`zkp-collapse${m?" zkp-collapse-out":""}`,children:G("div",{className:"zkp-collapse-inner",children:[G("div",{className:"zkp-divider zkp-divider-bottom"}),G("div",{className:"zkp-footer",children:[G("span",{className:"zkp-footer-label",children:"ZKPassport App"}),G("div",{className:"zkp-store-buttons",children:[G(e8,{href:x2,badge:T2}),G(e8,{href:A2,badge:k2})]})]})]})}):null,r==="error"?G("div",{className:"zkp-result-actions",children:G("button",{type:"button",className:"zkp-retry",onClick:l,children:"Try again"})}):null]})]})}var r7='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 52 36" fill="none" stroke="currentColor" stroke-width="2.6" stroke-linecap="round"><rect x="1.6" y="1.6" width="48.8" height="32.8" rx="5"/><line x1="8.5" y1="18" x2="17" y2="18"/><line x1="35" y1="18" x2="43.5" y2="18"/><circle cx="26" cy="18" r="6.5" fill="currentColor" stroke="none"/></svg>';function i7({appName:t,items:e,loading:r,onContinue:i}){return G("div",{className:"zkp-intro",children:[G("div",{className:"zkp-intro-request",children:[G("p",{className:"zkp-eyebrow",children:[t," wants to verify"]}),r?G("div",{className:"zkp-skel-rows",role:"status","aria-label":"Loading request",children:[G("span",{className:"zkp-skel-row",style:{width:"68%"}}),G("span",{className:"zkp-skel-row zkp-skel-row-detail",style:{width:"48%"}}),G("span",{className:"zkp-skel-row",style:{width:"56%"}}),G("span",{className:"zkp-skel-row zkp-skel-row-detail",style:{width:"48%"}})]}):G("ul",{className:"zkp-intro-list",children:e.map(n=>G("li",{children:[G("span",{className:"zkp-intro-check",dangerouslySetInnerHTML:{__html:Uo}}),G("span",{className:"zkp-intro-item",children:[G("span",{className:"zkp-intro-item-title",children:n.title}),n.detail?G("span",{className:"zkp-intro-item-detail",children:n.detail}):null]})]},n.title))})]}),G("div",{className:"zkp-intro-question",children:[G("span",{className:"zkp-chip-symbol","aria-hidden":"true",dangerouslySetInnerHTML:{__html:r7}}),G("p",{className:"zkp-intro-question-text",children:"Do you have a passport or ID card with a chip?"}),G("p",{className:"zkp-intro-question-hint",children:["You can verify with a chip-enabled passport or ID without sharing your document. Your phone can read it over NFC.",G("br",{}),"Look for this symbol on the cover."]}),G("button",{type:"button",className:"zkp-intro-continue",onClick:i,children:"Continue"})]}),G("div",{className:"zkp-intro-footer",children:[G("div",{className:"zkp-divider"}),G("div",{className:"zkp-privacy-strip","aria-label":"Private, encrypted, on your device",children:[G("span",{children:"Private"}),G("span",{className:"zkp-privacy-dot","aria-hidden":"true",children:"\xB7"}),G("span",{children:"Encrypted"}),G("span",{className:"zkp-privacy-dot","aria-hidden":"true",children:"\xB7"}),G("span",{children:"On your device"})]}),G("p",{className:"zkp-intro-footer-note",children:["Neither ",t," nor ZKPassport ever sees any personal information beyond what you choose to share. Your raw passport data stays on your devices."]})]})]})}function n7(t){switch(t){case "scanned":return "Approve the request on your phone";case "generating":return "Generating proof\u2026";case "success":return "Request complete";case "error":return "Something went wrong";default:return ""}}function o7(t,e,r,i,n){let o=t==="success",s=t==="generating",{received:a,total:l}=i,c=l!==null&&a>=l,d=e?"done":"pending",u=[{key:"download",label:G(ar,{children:[G("a",{href:S2,target:"_blank",rel:"noopener noreferrer",children:"Download"})," the ZKPassport mobile app."]}),status:d,icon:e?null:I2},{key:"scan",label:n?"Tap \u201COpen ZKPassport App\u201D above.":"Scan this QR code with the ZKPassport app.",status:d,icon:e?null:C2},{key:"approve",label:"Approve the request on your phone.",status:t==="scanned"?"current":s||o?"done":"pending",icon:e?null:w2}];return r&&u.push({key:"selfie",label:"Take a selfie to match your ID photo.",status:s&&a===0?"current":s&&a>0||o?"done":"pending",icon:null}),u.push({key:"generate",label:s&&l!==null?`Generate proof on your device (${Math.min(a,l)}/${l}).`:"Generate proof on your device.",status:s&&!c&&(!r||a>0)?"current":s&&c||o?"done":"pending",icon:null},{key:"verify",label:"Verify the proof.",status:s&&c?"current":o?"done":"pending",icon:null}),e?u:u.slice(0,3)}function s7({state:t,qrSvg:e,caption:r}){return G("div",{className:"zkp-qr-slot","data-state":t,children:[G("div",{className:"zkp-skeleton"}),G("div",{className:"zkp-qr",dangerouslySetInnerHTML:e?{__html:e}:void 0}),e?G("div",{className:"zkp-qr-logo",dangerouslySetInnerHTML:{__html:la}}):null,G("div",{className:"zkp-overlay",children:[G("div",{className:"zkp-overlay-body",children:[t==="connecting"||t==="generating"?G("div",{className:"zkp-spinner",dangerouslySetInnerHTML:{__html:_2}}):null,t==="scanned"?G("div",{className:"zkp-scanned-phone",dangerouslySetInnerHTML:{__html:E2}}):null,t==="success"?G("div",{className:"zkp-check",dangerouslySetInnerHTML:{__html:Uo}}):null,t==="error"?G("div",{className:"zkp-error-icon",dangerouslySetInnerHTML:{__html:v2}}):null]}),r?G("div",{className:"zkp-overlay-caption",children:r},t):null]})]})}function a7({status:t,icon:e,children:r}){return G("div",{className:"zkp-step","data-status":t,"data-mode":e?"icon":"progress",children:[G("div",{className:"zkp-step-marker",dangerouslySetInnerHTML:{__html:e??Uo}}),G("div",{className:"zkp-step-text",children:r})]})}function e8({href:t,badge:e}){return G("a",{className:"zkp-store-button",href:t,target:"_blank",rel:"noopener noreferrer","aria-label":e.ariaLabel,dangerouslySetInnerHTML:{__html:e.svg}})}function c7(){Mc(P2,"card");}var t8=`@layer zkpassport {
880
+ /* "Verify with ZKPassport" button (opens the hosted popup).
881
+ Customize via CSS custom properties on the mount element or any ancestor:
882
+ --zkp-btn-bg/-fg/-border-color/-radius/-padding/-font/-font-size/-letter-spacing/
883
+ -text-transform, and --zkp-btn-success/-error for the verified and failed states.
884
+ Sizing hangs off --zkp-btn-font-size: the icon, gap and padding are all in em.
885
+
886
+ !important throughout: host resets (e.g. Tailwind preflight) are unlayered
887
+ and would otherwise strip these. */
888
+ .zkp-verify-button {
889
+ --zkp-bg: #ffffff;
890
+ --zkp-brand: #2139a3;
891
+ --zkp-border: #d3d9e8;
892
+ appearance: none !important;
893
+ -webkit-appearance: none !important;
894
+ -webkit-tap-highlight-color: transparent !important;
895
+ display: inline-flex !important;
896
+ align-items: center !important;
897
+ justify-content: center !important;
898
+ padding: var(--zkp-btn-padding, 0.8667em 1.6em) !important;
899
+ border: 1px solid var(--zkp-btn-border-color, var(--zkp-border)) !important;
900
+ border-radius: var(--zkp-btn-radius, 8px) !important;
901
+ background: var(--zkp-btn-bg, var(--zkp-bg)) !important;
902
+ color: var(--zkp-btn-fg, var(--zkp-brand)) !important;
903
+ font-family: var(
904
+ --zkp-btn-font,
905
+ ui-sans-serif,
906
+ system-ui,
907
+ -apple-system,
908
+ sans-serif
909
+ ) !important;
910
+ font-size: var(--zkp-btn-font-size, 15px) !important;
911
+ white-space: nowrap !important;
912
+ font-weight: 600 !important;
913
+ letter-spacing: var(--zkp-btn-letter-spacing, 0.04em) !important;
914
+ text-transform: var(--zkp-btn-text-transform, none) !important;
915
+ line-height: 1.2 !important;
916
+ cursor: pointer !important;
917
+ transition:
918
+ filter 150ms ease,
919
+ transform 150ms ease;
920
+ }
921
+ .zkp-verify-wrap[data-theme="dark"] .zkp-verify-button {
922
+ --zkp-bg: #0f172a;
923
+ --zkp-brand: #93b0f5;
924
+ --zkp-border: #334155;
925
+ }
926
+ @media (prefers-color-scheme: dark) {
927
+ .zkp-verify-wrap[data-theme="auto"] .zkp-verify-button {
928
+ --zkp-bg: #0f172a;
929
+ --zkp-brand: #93b0f5;
930
+ --zkp-border: #334155;
931
+ }
932
+ }
933
+ .zkp-verify-button:hover:not(:disabled) {
934
+ filter: brightness(0.97);
935
+ }
936
+ .zkp-verify-button:active:not(:disabled) {
937
+ transform: translateY(1px);
938
+ filter: brightness(0.95);
939
+ }
940
+ /* Both states share one grid cell, so the button is as wide as the longer of the two
941
+ and never resizes when it switches to "Verified" */
942
+ .zkp-verify-content {
943
+ display: grid !important;
944
+ grid-template-areas: "state" !important;
945
+ justify-items: center !important;
946
+ }
947
+ .zkp-verify-state {
948
+ grid-area: state !important;
949
+ display: inline-flex !important;
950
+ align-items: center !important;
951
+ gap: 0.7333em !important;
952
+ }
953
+ .zkp-verify-button:not([data-status="success"]) .zkp-verify-state-success,
954
+ .zkp-verify-button[data-status="success"] .zkp-verify-state-default {
955
+ visibility: hidden !important;
956
+ }
957
+ .zkp-verify-button-mark {
958
+ position: relative;
959
+ display: inline-flex;
960
+ width: 1.3333em;
961
+ height: 1.3333em;
962
+ flex: none;
963
+ }
964
+ .zkp-verify-button-mark svg {
965
+ width: 100%;
966
+ height: 100%;
967
+ display: block;
968
+ }
969
+ /* !important: unlayered host resets (Tailwind preflight sets border-width: 0
970
+ on all ::after elements) would otherwise erase the ring */
971
+ .zkp-verify-button[data-status="in-progress"] .zkp-verify-button-mark::after {
972
+ content: "" !important;
973
+ position: absolute !important;
974
+ inset: -0.3333em !important;
975
+ border-radius: 50% !important;
976
+ border: 0.1333em solid color-mix(in srgb, currentColor 35%, transparent) !important;
977
+ border-top-color: currentColor !important;
978
+ box-sizing: border-box !important;
979
+ animation: zkp-spinner-rotate 0.9s linear infinite !important;
980
+ }
981
+ .zkp-verify-wrap {
982
+ display: inline-flex;
983
+ flex-direction: column;
984
+ align-items: center;
985
+ gap: 8px;
986
+ --zkp-success: #15803d;
987
+ --zkp-error: #dc2626;
988
+ }
989
+ .zkp-verify-wrap[data-theme="dark"] {
990
+ --zkp-success: #4ade80;
991
+ --zkp-error: #f87171;
992
+ }
993
+ @media (prefers-color-scheme: dark) {
994
+ .zkp-verify-wrap[data-theme="auto"] {
995
+ --zkp-success: #4ade80;
996
+ --zkp-error: #f87171;
997
+ }
998
+ }
999
+ .zkp-verify-error {
1000
+ margin: 0 !important;
1001
+ font-family: ui-sans-serif, system-ui, sans-serif !important;
1002
+ font-size: 12.5px !important;
1003
+ line-height: 1.4 !important;
1004
+ color: var(--zkp-btn-error, var(--zkp-error)) !important;
1005
+ }
1006
+ .zkp-verify-button:disabled {
1007
+ cursor: default !important;
1008
+ transform: none !important;
1009
+ }
1010
+ /* Only the waiting state is dimmed; success is an outcome, not an unavailable button */
1011
+ .zkp-verify-button[data-status="in-progress"] {
1012
+ opacity: 0.65 !important;
1013
+ filter: saturate(0.75) !important;
1014
+ }
1015
+ .zkp-verify-button[data-status="success"] {
1016
+ color: var(--zkp-btn-success, var(--zkp-success)) !important;
1017
+ }
1018
+
1019
+ @keyframes zkp-spinner-rotate {
1020
+ to {
1021
+ transform: rotate(360deg);
1022
+ }
1023
+ }
1024
+ }
1025
+ `;var yd=tt(Mh(),1);(0, yd.registerLocale)(ud);function Hh(t){if(t==="Zero Knowledge Republic")return "ZKR";let e;return e=(0, yd.getAlpha3Code)(t,"en")||t||"ZKR",e}function gd(t,e,r,i,n){n[i][e]={...n[i][e],[t]:r};}function d7(t,e,r,i){i[r][t]={...i[r][t],range:e};}function Kh(t,e,r,i,n){n[i][e]={...n[i][e],[t]:r};}function qh(){let t={query:{}},e="query",r=false,i=o=>{if(t[e].policy)throw new Error(`Cannot call .${o}() on a policy-driven query. The query for policy '${t[e].policy}' is immutable.`);r=true;},n={eq:(o,s)=>(i("eq"),(o==="issuing_country"||o==="nationality")&&(s=Hh(s)),Kh("eq",o,s,e,t),n),gte:(o,s)=>{if(i("gte"),gd("gte",o,s,e,t),o==="age"&&(s<1||s>=100))throw new Error("Age must be between 1 and 99 (inclusive)");return n},gt:(o,s)=>(i("gt"),gd("gt",o,s,e,t),n),lte:(o,s)=>(i("lte"),gd("lte",o,s,e,t),n),lt:(o,s)=>(i("lt"),gd("lt",o,s,e,t),n),range:(o,s,a)=>(i("range"),d7(o,[s,a],e,t),n),in:(o,s)=>(i("in"),s=s.map(a=>Hh(a)),Kh("in",o,s,e,t),n),out:(o,s)=>(i("out"),s=s.map(a=>Hh(a)),Kh("out",o,s,e,t),n),disclose:o=>(i("disclose"),t[e][o]={...t[e][o],disclose:true},n),bind:(o,s)=>(t[e].bind={...t[e].bind,[o]:s},n),sanctions:(o="all",s="all",a={strict:false})=>(i("sanctions"),t[e].sanctions={...t[e].sanctions,countries:o,lists:s,strict:a.strict??false},n),facematch:(o="strict")=>(i("facematch"),t[e].facematch={mode:o},n),raw:o=>(i("raw"),t[e]=o,n),policy:o=>{if(typeof o!="string"||o.length===0)throw new Error(".policy() requires a non-empty string id.");if(t[e].policy)throw new Error(`Cannot call .policy() more than once on a request (already set to '${t[e].policy}').`);if(r)throw new Error("Cannot combine .policy() with builder methods like .gte()/.disclose()/etc.");return t[e].policy=o,n},done:(()=>({query:t[e]}))};return n}var u7="https://verify.zkpassport.id";function f7(t){return !!t&&t.zkpassport===true&&typeof t.type=="string"}var r8=460,i8=780,p7=500;function Gh(t){if(typeof window>"u")return null;let e=t.popupUrl??u7,r=new URL(e).origin,i=Math.max(0,(window.screenX??0)+(window.outerWidth-r8)/2),n=Math.max(0,(window.screenY??0)+(window.outerHeight-i8)/2),o=window.open(e,"zkpassport-verify",`popup,width=${r8},height=${i8},left=${Math.round(i)},top=${Math.round(n)}`)??window.open(e,"zkpassport-verify");if(!o)return null;let s=t.callbacks??{},a=false,l=null,c=()=>{window.removeEventListener("message",d),l&&(clearInterval(l),l=null);},d=u=>{if(u.origin!==r||u.source!==o)return;let h=u.data;if(f7(h))switch(h.type){case "ready":try{o.postMessage({zkpassport:!0,type:"configure",request:t.request,query:t.query},r);}catch(y){console.error("[zkpassport] failed to send the request to the popup:",y),s.onError?.("Failed to send the request to the verification popup");try{o.close();}catch{}}break;case "request-received":s.onRequestReceived?.();break;case "generating":s.onGeneratingProof?.();break;case "proof-generated":s.onProofGenerated?.({index:h.index,total:h.total,name:h.name});break;case "success":{a=true;let{zkpassport:y,type:b,...x}=h;s.onSuccess?.(x);break}case "rejected":a=true,s.onReject?.();break;case "error":s.onError?.(h.message);break}};return window.addEventListener("message",d),l=setInterval(()=>{o.closed&&(c(),a||s.onClose?.());},p7),{popup:o,close:()=>{c();try{o.close();}catch{}}}}var h7={name:true,logo:true,purpose:true,scope:true,mode:true,devMode:true,validity:true,uniqueIdentifierType:true,oprfKeyId:true},m7="Popup blocked. Allow popups for this site and try again.",g7="Couldn't open the verification window here. Open this page in Safari or Chrome and try again.";function zh(t,e){let r={status:"idle",error:null},i=null,n=0,o=(l,c=null)=>{r={status:l,error:c},e(r);};return {get state(){return r},verify:()=>{let l=t();if(i){if(!i.popup.closed){i.popup.focus();return}i.close(),i=null;}let c=++n,d;try{d=y7(l);}catch(h){Yr.error(h),o("error"),l.onError?.("Failed to build the verification query");return}let u=Gh({popupUrl:l.popupUrl,request:b7(l),query:d,callbacks:{onRequestReceived:()=>t().onRequestReceived?.(),onGeneratingProof:()=>t().onGeneratingProof?.(),onProofGenerated:h=>t().onProofGenerated?.(h),onSuccess:h=>{let y=x=>{n===c&&o(x);},b;try{b=t().onSuccess?.(h);}catch(x){Yr.error(x),y("error");return}Promise.resolve(b).then(x=>y(x===false?"error":"success"),x=>{Yr.error(x),y("error");});},onReject:()=>{o("error"),t().onReject?.();},onError:h=>t().onError?.(h),onClose:()=>{o("idle"),t().onClose?.();}}});if(!u){o("error",md()?g7:m7),l.onError?.("Popup blocked");return}i=u,o("in-progress");},close:()=>{n++,i?.close(),i=null;}}}function y7(t){let e=qh();return t.policyId&&e.policy(t.policyId),t.query(e).query}function b7(t){let e={};for(let r of Object.keys(h7)){let i=t[r];i!==void 0&&(e[r]=i);}return e}var n8={small:"13px",medium:"15px",large:"18px"},o8="Verify with ZKPassport",s8="Verified";function a8(t){return t==="in-progress"||t==="success"}function c8(t){return t==="in-progress"?"Verification is running in the ZKPassport window":t==="success"?"Verification complete":"Opens a secure ZKPassport window"}function l8(t,e){return t==="error"&&e.showErrorMessage!==false}function d8(t){return t??"Verification failed. Click to try again."}function bd(t,e){return e?`${t} ${e}`:t}function u8(t,e){let r=document.createElement("span");r.className=`zkp-verify-state ${t}`;let i=document.createElement("span");i.className="zkp-verify-button-mark",i.innerHTML=e;let n=document.createElement("span");return r.append(i,n),{element:r,label:n}}function S7(t,e){if(typeof document>"u"||typeof window>"u")throw new Error("@zkpassport/ui: mountVerifyButton() requires a browser environment.");Mc(t8,"button");let r=e,i=document.createElement("div"),n=document.createElement("button"),o=document.createElement("span"),s=u8("zkp-verify-state-default",la),a=u8("zkp-verify-state-success",Uo),l=document.createElement("p");n.type="button",o.className="zkp-verify-content",a.label.textContent=s8,l.setAttribute("role","alert"),o.append(s.element,a.element),n.append(o),i.append(n);function c(u){i.className=bd("zkp-verify-wrap",r.classes?.root),i.dataset.theme=r.theme??"light",r.size?i.style.setProperty("--zkp-btn-font-size",n8[r.size]):i.style.removeProperty("--zkp-btn-font-size"),n.className=bd("zkp-verify-button",r.classes?.button),n.dataset.status=u.status,n.disabled=a8(u.status),n.title=c8(u.status),s.label.textContent=r.label??o8,l8(u.status,r)?(l.className=bd("zkp-verify-error",r.classes?.error),l.textContent=d8(u.error),i.append(l)):l.remove();}let d=zh(()=>r,c);return n.addEventListener("click",d.verify),c(d.state),t.appendChild(i),{update(u){r=u,c(d.state);},unmount(){d.close(),i.remove();}}}function fX(t,e){if(typeof document>"u"||typeof window>"u")throw new Error("@zkpassport/ui: mount() requires a browser environment.");if(!(t instanceof HTMLElement))throw new Error("@zkpassport/ui: mount() requires an HTMLElement as the first argument.");let r=document.createElement("div");t.appendChild(r);let i={current:null},n=e;return Nc(Pc(Lh,{options:n,controlRef:i}),r),{update(o){n=o,Nc(Pc(Lh,{options:n,controlRef:i}),r);},retry(){i.current?.retry();},unmount(){Nc(null,r),r.parentNode&&r.parentNode.removeChild(r);}}}/*! Bundled license information:
1026
+
1027
+ pvtsutils/build/index.js:
1028
+ (*!
1029
+ * MIT License
1030
+ *
1031
+ * Copyright (c) 2017-2024 Peculiar Ventures, LLC
1032
+ *
1033
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
1034
+ * of this software and associated documentation files (the "Software"), to deal
1035
+ * in the Software without restriction, including without limitation the rights
1036
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
1037
+ * copies of the Software, and to permit persons to whom the Software is
1038
+ * furnished to do so, subject to the following conditions:
1039
+ *
1040
+ * The above copyright notice and this permission notice shall be included in all
1041
+ * copies or substantial portions of the Software.
1042
+ *
1043
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1044
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1045
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1046
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1047
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
1048
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
1049
+ * SOFTWARE.
1050
+ *
1051
+ *)
1052
+
1053
+ ieee754/index.js:
1054
+ (*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> *)
1055
+
1056
+ buffer/index.js:
1057
+ (*!
1058
+ * The buffer module from node.js, for the browser.
1059
+ *
1060
+ * @author Feross Aboukhadijeh <https://feross.org>
1061
+ * @license MIT
1062
+ *)
1063
+
1064
+ @noble/curves/utils.js:
1065
+ @noble/curves/abstract/modular.js:
1066
+ @noble/curves/abstract/curve.js:
1067
+ @noble/curves/abstract/weierstrass.js:
1068
+ @noble/curves/nist.js:
1069
+ @noble/curves/abstract/edwards.js:
1070
+ @noble/curves/misc.js:
1071
+ (*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) *)
1072
+
1073
+ pvutils/build/utils.es.js:
1074
+ (*!
1075
+ Copyright (c) Peculiar Ventures, LLC
1076
+ *)
1077
+
1078
+ asn1js/build/index.es.js:
1079
+ (*!
1080
+ * Copyright (c) 2014, GMO GlobalSign
1081
+ * Copyright (c) 2015-2022, Peculiar Ventures
1082
+ * All rights reserved.
1083
+ *
1084
+ * Author 2014-2019, Yury Strozhevsky
1085
+ *
1086
+ * Redistribution and use in source and binary forms, with or without modification,
1087
+ * are permitted provided that the following conditions are met:
1088
+ *
1089
+ * * Redistributions of source code must retain the above copyright notice, this
1090
+ * list of conditions and the following disclaimer.
1091
+ *
1092
+ * * Redistributions in binary form must reproduce the above copyright notice, this
1093
+ * list of conditions and the following disclaimer in the documentation and/or
1094
+ * other materials provided with the distribution.
1095
+ *
1096
+ * * Neither the name of the copyright holder nor the names of its
1097
+ * contributors may be used to endorse or promote products derived from
1098
+ * this software without specific prior written permission.
1099
+ *
1100
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
1101
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
1102
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
1103
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
1104
+ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
1105
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
1106
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
1107
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
1108
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
1109
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
1110
+ *
1111
+ *)
1112
+
1113
+ @zk-kit/utils/dist/index.browser.js:
1114
+ (**
1115
+ * @module @zk-kit/utils
1116
+ * @version 1.3.0
1117
+ * @file Essential zero-knowledge utility library for JavaScript developers.
1118
+ * @copyright Ethereum Foundation 2025
1119
+ * @license MIT
1120
+ * @see [Github]{@link https://github.com/privacy-scaling-explorations/zk-kit/tree/main/packages/utils}
1121
+ *)
1122
+
1123
+ @noble/ciphers/esm/utils.js:
1124
+ (*! noble-ciphers - MIT License (c) 2023 Paul Miller (paulmillr.com) *)
1125
+
1126
+ @noble/secp256k1/index.js:
1127
+ (*! noble-secp256k1 - MIT License (c) 2019 Paul Miller (paulmillr.com) *)
1128
+
1129
+ @noble/hashes/esm/utils.js:
1130
+ (*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) *)
1131
+
1132
+ pako/dist/pako.esm.mjs:
1133
+ (*! pako 2.1.0 https://github.com/nodeca/pako @license (MIT AND Zlib) *)
1134
+ */export{_4 as ASEAN_COUNTRIES,x4 as EEA_COUNTRIES,gl as EU_COUNTRIES,C4 as MERCOSUR_COUNTRIES,Le as NullifierType,le as ProofType,ie as ProofTypeLength,S4 as SANCTIONED_COUNTRIES,A4 as SCHENGEN_COUNTRIES,Uh as ZKPassport,zh as createVerification,fX as mount,S7 as mountVerifyButton};//# sourceMappingURL=index.js.map
569
1135
  //# sourceMappingURL=index.js.map