@zkpassport/ui 0.16.2 → 0.17.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,12 @@
1
1
  "use client";
2
- 'use strict';var react=require('react'),b1=require('qrcode'),sdk=require('@zkpassport/sdk'),jsxRuntime=require('react/jsx-runtime');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var b1__default=/*#__PURE__*/_interopDefault(b1);var Y,k,we,N,ze,Me,Ze,ne,G,T,Re,ie,oe,ae,F={},$=[],f1=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,J=Array.isArray;function R(e,t){for(var r in t)e[r]=t[r];return e}function le(e){e&&e.parentNode&&e.parentNode.removeChild(e);}function pe(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 K(e,l,a,s,null)}function K(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??++we,__i:-1,__u:0};return s==null&&k.vnode!=null&&k.vnode(n),n}function M(e){return e.children}function j(e,t){this.props=e,this.context=t;}function O(e,t){if(t==null)return e.__?O(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"?O(e):null}function h1(e){if(e.__P&&e.__d){var t=e.__v,r=t.__e,a=[],s=[],n=R({},t);n.__v=t.__v+1,k.vnode&&k.vnode(n),ce(e.__P,n,t,e.__n,e.__P.namespaceURI,32&t.__u?[r]:null,a,r??O(t),!!(32&t.__u),s),n.__v=t.__v,n.__.__k[n.__i]=n,Ne(a,n,s),t.__e=t.__=null,n.__e!=r&&Se(n);}}function Se(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}),Se(e)}function xe(e){(!e.__d&&(e.__d=true)&&N.push(e)&&!W.__r++||ze!=k.debounceRendering)&&((ze=k.debounceRendering)||Me)(W);}function W(){try{for(var e,t=1;N.length;)N.length>t&&N.sort(Ze),e=N.shift(),t=N.length,h1(e);}finally{N.length=W.__r=0;}}function Le(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=v1(r,t,v,u,Z),o=0;o<Z;o++)(_=r.__k[o])!=null&&(c=_.__i!=-1&&v[_.__i]||F,_.__i=o,z=ce(e,_,c,s,n,l,p,u,i,f),h=_.__e,_.ref&&c.ref!=_.ref&&(c.ref&&de(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 v1(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]=K(null,l,null,null,null):J(l)?l=e.__k[n]=K(M,{children:l},null,null,null):l.constructor===void 0&&l.__b>0?l=e.__k[n]=K(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=k1(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=O(p)),Ae(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=O(e)),r.insertBefore(e.__e,t||null)),t=e.__e);do t=t&&t.nextSibling;while(t!=null&&t.nodeType==8);return t}function k1(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 Ce(e,t,r){t[0]=="-"?e.setProperty(t,r??""):e[t]=r==null?"":typeof r!="number"||f1.test(t)?r:r+"px";}function Q(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||Ce(e.style,t,"");if(r)for(t in r)a&&r[t]==a[t]||Ce(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[T]=a[T]:(r[T]=ie,e.addEventListener(t,n?ae:oe,n)):e.removeEventListener(t,n?ae:oe,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 be(e){return function(t){if(this.l){var r=this.l[t.type+e];if(t[G]==null)t[G]=ie++;else if(t[G]<r[T])return;return r(k.event?k.event(t):t)}}}function ce(e,t,r,a,s,n,l,p,u,i){var f,o,c,_,h,b,z,m,v,Z,L,A,re,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 j(m,L),o.constructor=w,o.render=g1),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=R({},o.__s)),R(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(P){P&&(P.__=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,re=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&&++re<25);o.state=o.__s,o.getChildContext!=null&&(a=R(R({},a),o.getChildContext())),v&&!c&&o.getSnapshotBeforeUpdate!=null&&(b=o.getSnapshotBeforeUpdate(_,h)),q=f!=null&&f.type===M&&f.key==null?Ee(f.props.children):f,p=Le(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(P){if(t.__v=null,u||n!=null)if(P.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--;)le(n[V]);se(t);}else t.__e=r.__e,t.__k=r.__k,P.then||se(t);k.__e(P,t,r);}else n==null&&t.__v==r.__v?(t.__k=r.__k,t.__e=r.__e):p=t.__e=m1(r.__e,t,r,a,s,n,l,u,i);return (f=k.diffed)&&f(t),128&t.__u?void 0:p}function se(e){e&&(e.__c&&(e.__c.__e=true),e.__k&&e.__k.some(se));}function Ne(e,t,r){for(var a=0;a<r.length;a++)de(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 Ee(e){return typeof e!="object"||e==null||e.__b>0?e:J(e)?e.map(Ee):e.constructor!==void 0?null:R({},e)}function m1(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||Q(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]===_||Q(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=""),Le(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&&O(r,0),p,u),n!=null)for(i=n.length;i--;)le(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])&&Q(e,i,h,z[i],s),i="checked",b!=null&&b!=e[i]&&Q(e,i,b,z[i],s));}return e}function de(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 Ae(e,t,r){var a,s;if(k.unmount&&k.unmount(e),(a=e.ref)&&(a.current&&a.current!=e.__e||de(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]&&Ae(a[s],t,r||typeof e.type!="function");r||le(e.__e),e.__c=e.__=e.__e=void 0;}function g1(e,t,r){return this.constructor(e,r)}function _e(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=[],ce(t,e=(t).__k=pe(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),Ne(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}},we=0,j.prototype.setState=function(e,t){var r;r=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=R({},this.state),typeof e=="function"&&(e=e(R({},r),this.props)),e&&R(r,e),e!=null&&this.__v&&(t&&this._sb.push(t),xe(this));},j.prototype.forceUpdate=function(e){this.__v&&(this.__e=true,e&&this.__h.push(e),xe(this));},j.prototype.render=M,N=[],Me=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Ze=function(e,t){return e.__v.__b-t.__v.__b},W.__r=0,ne=Math.random().toString(8),G="__d"+ne,T="__a"+ne,Re=/(PointerCapture)$|Capture$/i,ie=0,oe=be(false),ae=be(true);var H,g,ue,Oe,D=0,Ve=[],y=k,He=y.__b,qe=y.__r,Ie=y.diffed,Te=y.__c,De=y.unmount,Ue=y.__;function ee(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,y1(je,e)}function y1(e,t,r){var a=ee(H++,2);if(a.t=e,!a.__c&&(a.__=[je(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 te(e,t){var r=ee(H++,3);!y.__s&&ve(r.__H,t)&&(r.__=e,r.u=t,g.__H.__h.push(r));}function Qe(e,t){var r=ee(H++,4);!y.__s&&ve(r.__H,t)&&(r.__=e,r.u=t,g.__h.push(r));}function he(e){return D=5,Ge(function(){return {current:e}},[])}function Ge(e,t){var r=ee(H++,7);return ve(r.__H,t)&&(r.__=e(),r.__H=t,r.__h=e),r.__}function Ke(e,t){return D=8,Ge(function(){return e},t)}function z1(){for(var e;e=Ve.shift();){var t=e.__H;if(e.__P&&t)try{t.__h.some(X),t.__h.some(fe),t.__h=[];}catch(r){t.__h=[],y.__e(r,e.__v);}}}y.__b=function(e){g=null,He&&He(e);},y.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),Ue&&Ue(e,t);},y.__r=function(e){qe&&qe(e),H=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(X),t.__h.some(fe),t.__h=[],H=0)),ue=g;},y.diffed=function(e){Ie&&Ie(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(Ve.push(t)!==1&&Oe===y.requestAnimationFrame||((Oe=y.requestAnimationFrame)||x1)(z1)),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(X),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);}}),Te&&Te(e,t);},y.unmount=function(e){De&&De(e);var t,r=e.__c;r&&r.__H&&(r.__H.__.some(function(a){try{X(a);}catch(s){t=s;}}),r.__H=void 0,t&&y.__e(t,r.__v));};var Be=typeof requestAnimationFrame=="function";function x1(e){var t,r=function(){clearTimeout(a),Be&&cancelAnimationFrame(t),setTimeout(e);},a=setTimeout(r,35);Be&&(t=requestAnimationFrame(r));}function X(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 je(e,t){return typeof t=="function"?t(e):t}var Fe="https://zkpassport.id/r",$e="https://apps.apple.com/us/app/zkpassport/id6477371975",We="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>',Ye=`
2
+ 'use strict';var react=require('react'),jsxRuntime=require('react/jsx-runtime');var g8=Object.create;var _c=Object.defineProperty;var y8=Object.getOwnPropertyDescriptor;var b8=Object.getOwnPropertyNames;var S8=Object.getPrototypeOf,x8=Object.prototype.hasOwnProperty;var A8=(t,e,r)=>e in t?_c(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),zh=(t,e)=>{for(var r in e)_c(t,r,{get:e[r],enumerable:true});},_8=(t,e,r,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of b8(e))!x8.call(t,n)&&n!==r&&_c(t,n,{get:()=>e[n],enumerable:!(i=y8(e,n))||i.enumerable});return t};var et=(t,e,r)=>(r=t!=null?g8(S8(t)):{},_8(e||!t||!t.__esModule?_c(r,"default",{value:t,enumerable:true}):r,t));var f=(t,e,r)=>A8(t,typeof e!="symbol"?e+"":e,r);var P2=se((Mv,k2)=>{k2.exports=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then};});var Ni=se(In=>{var Rd,O8=[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];In.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};In.getSymbolTotalCodewords=function(e){return O8[e]};In.getBCHDigit=function(t){let e=0;for(;t!==0;)e++,t>>>=1;return e};In.setToSJISFunction=function(e){if(typeof e!="function")throw new Error('"toSJISFunc" is not a valid function.');Rd=e;};In.isKanjiModeEnabled=function(){return typeof Rd<"u"};In.toSJIS=function(e){return Rd(e)};});var Mc=se(Ft=>{Ft.L={bit:1};Ft.M={bit:0};Ft.Q={bit:3};Ft.H={bit:2};function M8(t){if(typeof t!="string")throw new Error("Param is not a string");switch(t.toLowerCase()){case "l":case "low":return Ft.L;case "m":case "medium":return Ft.M;case "q":case "quartile":return Ft.Q;case "h":case "high":return Ft.H;default:throw new Error("Unknown EC Level: "+t)}}Ft.isValid=function(e){return e&&typeof e.bit<"u"&&e.bit>=0&&e.bit<4};Ft.from=function(e,r){if(Ft.isValid(e))return e;try{return M8(e)}catch{return r}};});var R2=se((Lv,D2)=>{function N2(){this.buffer=[],this.length=0;}N2.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++;}};D2.exports=N2;});var M2=se((Hv,O2)=>{function ua(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);}ua.prototype.set=function(t,e,r,i){let n=t*this.size+e;this.data[n]=r,i&&(this.reservedBit[n]=true);};ua.prototype.get=function(t,e){return this.data[t*this.size+e]};ua.prototype.xor=function(t,e,r){this.data[t*this.size+e]^=r;};ua.prototype.isReserved=function(t,e){return this.reservedBit[t*this.size+e]};O2.exports=ua;});var F2=se(Fc=>{var F8=Ni().getSymbolSize;Fc.getRowColCoords=function(e){if(e===1)return [];let r=Math.floor(e/7)+2,i=F8(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()};Fc.getPositions=function(e){let r=[],i=Fc.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 H2=se(L2=>{var U8=Ni().getSymbolSize,U2=7;L2.getPositions=function(e){let r=U8(e);return [[0,0],[r-U2,0],[0,r-U2]]};});var K2=se(we=>{we.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};var vn={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+=vn.N1+(n-5)),s=d,n=1),d=e.get(c,l),d===a?o++:(o>=5&&(i+=vn.N1+(o-5)),a=d,o=1);}n>=5&&(i+=vn.N1+(n-5)),o>=5&&(i+=vn.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*vn.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*vn.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)*vn.N4};function L8(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,L8(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 Md=se(Od=>{var Di=Mc(),Uc=[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],Lc=[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];Od.getBlocksCount=function(e,r){switch(r){case Di.L:return Uc[(e-1)*4+0];case Di.M:return Uc[(e-1)*4+1];case Di.Q:return Uc[(e-1)*4+2];case Di.H:return Uc[(e-1)*4+3];default:return}};Od.getTotalCodewordsCount=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}};});var q2=se(Kc=>{var fa=new Uint8Array(512),Hc=new Uint8Array(256);(function(){let e=1;for(let r=0;r<255;r++)fa[r]=e,Hc[e]=r,e<<=1,e&256&&(e^=285);for(let r=255;r<512;r++)fa[r]=fa[r-255];})();Kc.log=function(e){if(e<1)throw new Error("log("+e+")");return Hc[e]};Kc.exp=function(e){return fa[e]};Kc.mul=function(e,r){return e===0||r===0?0:fa[Hc[e]+Hc[r]]};});var G2=se(pa=>{var Fd=q2();pa.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]^=Fd.mul(e[n],r[o]);return i};pa.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]^=Fd.mul(r[s],n);let o=0;for(;o<i.length&&i[o]===0;)o++;i=i.slice(o);}return i};pa.generateECPolynomial=function(e){let r=new Uint8Array([1]);for(let i=0;i<e;i++)r=pa.mul(r,new Uint8Array([1,Fd.exp(i)]));return r};});var V2=se((jv,$2)=>{var z2=G2();function Ud(t){this.genPoly=void 0,this.degree=t,this.degree&&this.initialize(this.degree);}Ud.prototype.initialize=function(e){this.degree=e,this.genPoly=z2.generateECPolynomial(this.degree);};Ud.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=z2.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};$2.exports=Ud;});var Ld=se(j2=>{j2.isValid=function(e){return !isNaN(e)&&e>=1&&e<=40};});var Hd=se(ei=>{var X2="[0-9]+",H8="[A-Z $%*+\\-./:]+",ha="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";ha=ha.replace(/u/g,"\\u");var K8="(?:(?![A-Z0-9 $%*+\\-./:]|"+ha+`)(?:.|[\r
3
+ ]))+`;ei.KANJI=new RegExp(ha,"g");ei.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g");ei.BYTE=new RegExp(K8,"g");ei.NUMERIC=new RegExp(X2,"g");ei.ALPHANUMERIC=new RegExp(H8,"g");var q8=new RegExp("^"+ha+"$"),G8=new RegExp("^"+X2+"$"),z8=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");ei.testKanji=function(e){return q8.test(e)};ei.testNumeric=function(e){return G8.test(e)};ei.testAlphanumeric=function(e){return z8.test(e)};});var Ri=se(Ne=>{var $8=Ld(),Kd=Hd();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(!$8.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 Kd.testNumeric(e)?Ne.NUMERIC:Kd.testAlphanumeric(e)?Ne.ALPHANUMERIC:Kd.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 V8(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 V8(e)}catch{return r}};});var J2=se(En=>{var qc=Ni(),j8=Md(),W2=Mc(),Oi=Ri(),qd=Ld(),Y2=7973,Z2=qc.getBCHDigit(Y2);function X8(t,e,r){for(let i=1;i<=40;i++)if(e<=En.getCapacity(i,r,t))return i}function Q2(t,e){return Oi.getCharCountIndicator(t,e)+4}function W8(t,e){let r=0;return t.forEach(function(i){let n=Q2(i.mode,e);r+=n+i.getBitsLength();}),r}function Z8(t,e){for(let r=1;r<=40;r++)if(W8(t,r)<=En.getCapacity(r,e,Oi.MIXED))return r}En.from=function(e,r){return qd.isValid(e)?parseInt(e,10):r};En.getCapacity=function(e,r,i){if(!qd.isValid(e))throw new Error("Invalid QR Code version");typeof i>"u"&&(i=Oi.BYTE);let n=qc.getSymbolTotalCodewords(e),o=j8.getTotalCodewordsCount(e,r),s=(n-o)*8;if(i===Oi.MIXED)return s;let a=s-Q2(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)}};En.getBestVersionForData=function(e,r){let i,n=W2.from(r,W2.M);if(Array.isArray(e)){if(e.length>1)return Z8(e,n);if(e.length===0)return 1;i=e[0];}else i=e;return X8(i.mode,i.getLength(),n)};En.getEncodedBits=function(e){if(!qd.isValid(e)||e<7)throw new Error("Invalid QR Code version");let r=e<<12;for(;qc.getBCHDigit(r)-Z2>=0;)r^=Y2<<qc.getBCHDigit(r)-Z2;return e<<12|r};});var im=se(rm=>{var Gd=Ni(),tm=1335,Y8=21522,em=Gd.getBCHDigit(tm);rm.getEncodedBits=function(e,r){let i=e.bit<<3|r,n=i<<10;for(;Gd.getBCHDigit(n)-em>=0;)n^=tm<<Gd.getBCHDigit(n)-em;return (i<<10|n)^Y8};});var om=se((Jv,nm)=>{var Q8=Ri();function Ho(t){this.mode=Q8.NUMERIC,this.data=t.toString();}Ho.getBitsLength=function(e){return 10*Math.floor(e/3)+(e%3?e%3*3+1:0)};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,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));};nm.exports=Ho;});var am=se((eE,sm)=>{var J8=Ri(),zd=["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 Ko(t){this.mode=J8.ALPHANUMERIC,this.data=t;}Ko.getBitsLength=function(e){return 11*Math.floor(e/2)+6*(e%2)};Ko.prototype.getLength=function(){return this.data.length};Ko.prototype.getBitsLength=function(){return Ko.getBitsLength(this.data.length)};Ko.prototype.write=function(e){let r;for(r=0;r+2<=this.data.length;r+=2){let i=zd.indexOf(this.data[r])*45;i+=zd.indexOf(this.data[r+1]),e.put(i,11);}this.data.length%2&&e.put(zd.indexOf(this.data[r]),6);};sm.exports=Ko;});var lm=se((tE,cm)=>{var eS=Ri();function qo(t){this.mode=eS.BYTE,typeof t=="string"?this.data=new TextEncoder().encode(t):this.data=new Uint8Array(t);}qo.getBitsLength=function(e){return e*8};qo.prototype.getLength=function(){return this.data.length};qo.prototype.getBitsLength=function(){return qo.getBitsLength(this.data.length)};qo.prototype.write=function(t){for(let e=0,r=this.data.length;e<r;e++)t.put(this.data[e],8);};cm.exports=qo;});var um=se((rE,dm)=>{var tS=Ri(),rS=Ni();function Go(t){this.mode=tS.KANJI,this.data=t;}Go.getBitsLength=function(e){return e*13};Go.prototype.getLength=function(){return this.data.length};Go.prototype.getBitsLength=function(){return Go.getBitsLength(this.data.length)};Go.prototype.write=function(t){let e;for(e=0;e<this.data.length;e++){let r=rS.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]+`
4
+ Make sure your charset is UTF-8`);r=(r>>>8&255)*192+(r&255),t.put(r,13);}};dm.exports=Go;});var fm=se((iE,$d)=>{var ma={single_source_shortest_paths:function(t,e,r){var i={},n={};n[e]=0;var o=ma.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 A=["Could not find a path from ",e," to ",r,"."].join("");throw new Error(A)}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=ma.single_source_shortest_paths(t,e,r);return ma.extract_shortest_path_from_predecessor_list(i,r)},PriorityQueue:{make:function(t){var e=ma.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 $d<"u"&&($d.exports=ma);});var xm=se(zo=>{var be=Ri(),mm=om(),gm=am(),ym=lm(),bm=um(),ga=Hd(),Gc=Ni(),iS=fm();function pm(t){return unescape(encodeURIComponent(t)).length}function ya(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 Sm(t){let e=ya(ga.NUMERIC,be.NUMERIC,t),r=ya(ga.ALPHANUMERIC,be.ALPHANUMERIC,t),i,n;return Gc.isKanjiModeEnabled()?(i=ya(ga.BYTE,be.BYTE,t),n=ya(ga.KANJI,be.KANJI,t)):(i=ya(ga.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 Vd(t,e){switch(e){case be.NUMERIC:return mm.getBitsLength(t);case be.ALPHANUMERIC:return gm.getBitsLength(t);case be.KANJI:return bm.getBitsLength(t);case be.BYTE:return ym.getBitsLength(t)}}function nS(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 oS(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:pm(i.data)}]);break;case be.BYTE:e.push([{data:i.data,mode:be.BYTE,length:pm(i.data)}]);}}return e}function sS(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]=Vd(r[h].lastCount+c.length,c.mode)-Vd(r[h].lastCount,c.mode),r[h].lastCount+=c.length):(r[h]&&(r[h].lastCount=c.length),i[h][d]=Vd(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 hm(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)+`.
5
+ Suggested mode is: `+be.toString(i));switch(r===be.KANJI&&!Gc.isKanjiModeEnabled()&&(r=be.BYTE),r){case be.NUMERIC:return new mm(t);case be.ALPHANUMERIC:return new gm(t);case be.KANJI:return new bm(t);case be.BYTE:return new ym(t)}}zo.fromArray=function(e){return e.reduce(function(r,i){return typeof i=="string"?r.push(hm(i,null)):i.data&&r.push(hm(i.data,i.mode)),r},[])};zo.fromString=function(e,r){let i=Sm(e,Gc.isKanjiModeEnabled()),n=oS(i),o=sS(n,r),s=iS.find_path(o.map,"start","end"),a=[];for(let l=1;l<s.length-1;l++)a.push(o.table[s[l]].node);return zo.fromArray(nS(a))};zo.rawSplit=function(e){return zo.fromArray(Sm(e,Gc.isKanjiModeEnabled()))};});var _m=se(Am=>{var $c=Ni(),jd=Mc(),aS=R2(),cS=M2(),lS=F2(),dS=H2(),Zd=K2(),Yd=Md(),uS=V2(),zc=J2(),fS=im(),pS=Ri(),Xd=xm();function hS(t,e){let r=t.size,i=dS.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 mS(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 gS(t,e){let r=lS.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 yS(t,e){let r=t.size,i=zc.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 Wd(t,e,r){let i=t.size,n=fS.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 bS(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 SS(t,e,r){let i=new aS;r.forEach(function(l){i.put(l.mode.bit,4),i.put(l.getLength(),pS.getCharCountIndicator(l.mode,t)),l.write(i);});let n=$c.getSymbolTotalCodewords(t),o=Yd.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 xS(i,t,e)}function xS(t,e,r){let i=$c.getSymbolTotalCodewords(e),n=Yd.getTotalCodewordsCount(e,r),o=i-n,s=Yd.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 uS(h),b=0,A=new Array(s),g=new Array(s),x=0,_=new Uint8Array(t.buffer);for(let O=0;O<s;O++){let U=O<l?d:u;A[O]=_.slice(b,b+U),g[O]=y.encode(A[O]),b+=U,x=Math.max(x,U);}let w=new Uint8Array(i),I=0,N,H;for(N=0;N<x;N++)for(H=0;H<s;H++)N<A[H].length&&(w[I++]=A[H][N]);for(N=0;N<h;N++)for(H=0;H<s;H++)w[I++]=g[H][N];return w}function AS(t,e,r,i){let n;if(Array.isArray(t))n=Xd.fromArray(t);else if(typeof t=="string"){let c=e;if(!c){let d=Xd.rawSplit(t);c=zc.getBestVersionForData(d,r);}n=Xd.fromString(t,c||40);}else throw new Error("Invalid data");let o=zc.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(`
6
+ The chosen QR Code version cannot contain this amount of data.
7
+ Minimum version required to store current data is: `+o+`.
8
+ `);let s=SS(e,r,n),a=$c.getSymbolSize(e),l=new cS(a);return hS(l,e),mS(l),gS(l,e),Wd(l,r,0),e>=7&&yS(l,e),bS(l,s),isNaN(i)&&(i=Zd.getBestMask(l,Wd.bind(null,l,r))),Zd.applyMask(i,l),Wd(l,r,i),{modules:l,version:e,errorCorrectionLevel:r,maskPattern:i,segments:n}}Am.create=function(e,r){if(typeof e>"u"||e==="")throw new Error("No input text");let i=jd.M,n,o;return typeof r<"u"&&(i=jd.from(r.errorCorrectionLevel,jd.M),n=zc.from(r.version),o=Zd.from(r.maskPattern),r.toSJISFunc&&$c.setToSJISFunction(r.toSJISFunc)),AS(e,n,i,o)};});var Qd=se(Bn=>{function Cm(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("")}}Bn.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:Cm(e.color.dark||"#000000ff"),light:Cm(e.color.light||"#ffffffff")},type:e.type,rendererOpts:e.rendererOpts||{}}};Bn.getScale=function(e,r){return r.width&&r.width>=e+r.margin*2?r.width/(e+r.margin*2):r.scale};Bn.getImageWidth=function(e,r){let i=Bn.getScale(e,r);return Math.floor((e+r.margin*2)*i)};Bn.qrToImageData=function(e,r,i){let n=r.modules.size,o=r.modules.data,s=Bn.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),A=Math.floor((u-l)/s);y=c[o[b*n+A]?1:0];}e[h++]=y.r,e[h++]=y.g,e[h++]=y.b,e[h]=y.a;}};});var wm=se(Vc=>{var Jd=Qd();function _S(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 CS(){try{return document.createElement("canvas")}catch{throw new Error("You need to specify a canvas element")}}Vc.render=function(e,r,i){let n=i,o=r;typeof n>"u"&&(!r||!r.getContext)&&(n=r,r=void 0),r||(o=CS()),n=Jd.getOptions(n);let s=Jd.getImageWidth(e.modules.size,n),a=o.getContext("2d"),l=a.createImageData(s,s);return Jd.qrToImageData(l.data,e,n),_S(a,o,s),a.putImageData(l,0,0),o};Vc.renderToDataURL=function(e,r,i){let n=i;typeof n>"u"&&(!r||!r.getContext)&&(n=r,r=void 0),n||(n={});let o=Vc.render(e,r,n),s=n.type||"image/png",a=n.rendererOpts||{};return o.toDataURL(s,a.quality)};});var Em=se(vm=>{var wS=Qd();function Im(t,e){let r=t.a/255,i=e+'="'+t.hex+'"';return r<1?i+" "+e+'-opacity="'+r.toFixed(2).slice(1)+'"':i}function eu(t,e,r){let i=t+e;return typeof r<"u"&&(i+=" "+r),i}function IS(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?eu("M",l+r,.5+c+r):eu("m",n,0),n=0,o=false),l+1<e&&t[a+1]||(i+=eu("h",s),s=0)):n++;}return i}vm.render=function(e,r,i){let n=wS.getOptions(r),o=e.modules.size,s=e.modules.data,a=o+n.margin*2,l=n.color.light.a?"<path "+Im(n.color.light,"fill")+' d="M0 0h'+a+"v"+a+'H0z"/>':"",c="<path "+Im(n.color.dark,"stroke")+' d="'+IS(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>
9
+ `;return typeof i=="function"&&i(null,h),h};});var Tm=se(ba=>{var vS=P2(),tu=_m(),Bm=wm(),ES=Em();function ru(t,e,r,i,n){let o=[].slice.call(arguments,1),s=o.length,a=typeof o[s-1]=="function";if(!a&&!vS())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=tu.create(r,i);l(t(d,e,i));}catch(d){c(d);}})}try{let l=tu.create(r,i);n(null,t(l,e,i));}catch(l){n(l);}}ba.create=tu.create;ba.toCanvas=ru.bind(null,Bm.render);ba.toDataURL=ru.bind(null,Bm.renderToDataURL);ba.toString=ru.bind(null,function(t,e,r){return ES.render(t,r)});});var _g=se(ts=>{var nx="[object ArrayBuffer]",oi=class t{static isArrayBuffer(e){return Object.prototype.toString.call(e)===nx}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}},Bu="string",ox=/^[0-9a-f\s]+$/i,sx=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/,ax=/^[a-zA-Z0-9-_]+$/,f1=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))}},Lt=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}},p1=class t{static isHex(e){return typeof e===Bu&&ox.test(e)}static isBase64(e){return typeof e===Bu&&sx.test(e)}static isBase64Url(e){return typeof e===Bu&&ax.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 Lt.toString(i,true);case "utf16":case "utf16be":return Lt.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 Lt.fromString(e,true);case "utf16":case "utf16be":return Lt.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 f1.fromString(e);case "utf16":case "utf16be":return Lt.fromString(e);case "utf16le":case "usc2":return Lt.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 f1.toString(e);case "utf16":case "utf16be":return Lt.toString(e);case "utf16le":case "usc2":return Lt.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 Lt.toString(e,r)}static FromUtf16String(e,r=false){return Lt.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,"")||""}};p1.DEFAULT_UTF8_ENCODING="utf8";function cx(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 lx(...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 dx(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}ts.BufferSourceConverter=oi;ts.Convert=p1;ts.assign=cx;ts.combine=lx;ts.isEqual=dx;});var Ky=se(z1=>{z1.byteLength=EA;z1.toByteArray=TA;z1.fromByteArray=NA;var qr=[],Wt=[],vA=typeof Uint8Array<"u"?Uint8Array:Array,pf="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(ao=0,Ly=pf.length;ao<Ly;++ao)qr[ao]=pf[ao],Wt[pf.charCodeAt(ao)]=ao;var ao,Ly;Wt[45]=62;Wt[95]=63;function Hy(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 EA(t){var e=Hy(t),r=e[0],i=e[1];return (r+i)*3/4-i}function BA(t,e,r){return (e+r)*3/4-r}function TA(t){var e,r=Hy(t),i=r[0],n=r[1],o=new vA(BA(t,i,n)),s=0,a=n>0?i-4:i,l;for(l=0;l<a;l+=4)e=Wt[t.charCodeAt(l)]<<18|Wt[t.charCodeAt(l+1)]<<12|Wt[t.charCodeAt(l+2)]<<6|Wt[t.charCodeAt(l+3)],o[s++]=e>>16&255,o[s++]=e>>8&255,o[s++]=e&255;return n===2&&(e=Wt[t.charCodeAt(l)]<<2|Wt[t.charCodeAt(l+1)]>>4,o[s++]=e&255),n===1&&(e=Wt[t.charCodeAt(l)]<<10|Wt[t.charCodeAt(l+1)]<<4|Wt[t.charCodeAt(l+2)]>>2,o[s++]=e>>8&255,o[s++]=e&255),o}function kA(t){return qr[t>>18&63]+qr[t>>12&63]+qr[t>>6&63]+qr[t&63]}function PA(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(kA(i));return n.join("")}function NA(t){for(var e,r=t.length,i=r%3,n=[],o=16383,s=0,a=r-i;s<a;s+=o)n.push(PA(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 qy=se(hf=>{hf.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)};hf.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,A=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]|=A*128;};});var j1=se(gs=>{var mf=Ky(),hs=qy(),Gy=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;gs.Buffer=R;gs.SlowBuffer=UA;gs.INSPECT_MAX_BYTES=50;var $1=2147483647;gs.kMaxLength=$1;R.TYPED_ARRAY_SUPPORT=DA();!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 DA(){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>$1)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 Sf(t)}return jy(t,e,r)}R.poolSize=8192;function jy(t,e,r){if(typeof t=="string")return OA(t,e);if(ArrayBuffer.isView(t))return MA(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 yf(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=FA(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 jy(t,e,r)};Object.setPrototypeOf(R.prototype,Uint8Array.prototype);Object.setPrototypeOf(R,Uint8Array);function Xy(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 RA(t,e,r){return Xy(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 RA(t,e,r)};function Sf(t){return Xy(t),mi(t<0?0:xf(t)|0)}R.allocUnsafe=function(t){return Sf(t)};R.allocUnsafeSlow=function(t){return Sf(t)};function OA(t,e){if((typeof e!="string"||e==="")&&(e="utf8"),!R.isEncoding(e))throw new TypeError("Unknown encoding: "+e);let r=Wy(t,e)|0,i=mi(r),n=i.write(t,e);return n!==r&&(i=i.slice(0,n)),i}function gf(t){let e=t.length<0?0:xf(t.length)|0,r=mi(e);for(let i=0;i<e;i+=1)r[i]=t[i]&255;return r}function MA(t){if(Gr(t,Uint8Array)){let e=new Uint8Array(t);return yf(e.buffer,e.byteOffset,e.byteLength)}return gf(t)}function yf(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 FA(t){if(R.isBuffer(t)){let e=xf(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"||_f(t.length)?mi(0):gf(t);if(t.type==="Buffer"&&Array.isArray(t.data))return gf(t.data)}function xf(t){if(t>=$1)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+$1.toString(16)+" bytes");return t|0}function UA(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 Wy(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 bf(t).length;case "ucs2":case "ucs-2":case "utf16le":case "utf-16le":return r*2;case "hex":return r>>>1;case "base64":return n3(t).length;default:if(n)return i?-1:bf(t).length;e=(""+e).toLowerCase(),n=true;}}R.byteLength=Wy;function LA(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 WA(this,e,r);case "utf8":case "utf-8":return Yy(this,e,r);case "ascii":return jA(this,e,r);case "latin1":case "binary":return XA(this,e,r);case "base64":return $A(this,e,r);case "ucs2":case "ucs-2":case "utf16le":case "utf-16le":return ZA(this,e,r);default:if(i)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),i=true;}}R.prototype._isBuffer=true;function co(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)co(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)co(this,r,r+3),co(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)co(this,r,r+7),co(this,r+1,r+6),co(this,r+2,r+5),co(this,r+3,r+4);return this};R.prototype.toString=function(){let e=this.length;return e===0?"":arguments.length===0?Yy(this,0,e):LA.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=gs.INSPECT_MAX_BYTES;return e=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(e+=" ... "),"<Buffer "+e+">"};Gy&&(R.prototype[Gy]=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 Zy(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,_f(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:zy(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):zy(t,[e],r,i,n);throw new TypeError("val must be string, number or Buffer")}function zy(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 Zy(this,e,r,i,true)};R.prototype.lastIndexOf=function(e,r,i){return Zy(this,e,r,i,false)};function HA(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(_f(a))return s;t[r+s]=a;}return s}function KA(t,e,r,i){return V1(bf(e,t.length-r),t,r,i)}function qA(t,e,r,i){return V1(e_(e),t,r,i)}function GA(t,e,r,i){return V1(n3(e),t,r,i)}function zA(t,e,r,i){return V1(t_(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 HA(this,e,r,i);case "utf8":case "utf-8":return KA(this,e,r,i);case "ascii":case "latin1":case "binary":return qA(this,e,r,i);case "base64":return GA(this,e,r,i);case "ucs2":case "ucs-2":case "utf16le":case "utf-16le":return zA(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 $A(t,e,r){return e===0&&r===t.length?mf.fromByteArray(t):mf.fromByteArray(t.slice(e,r))}function Yy(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 VA(i)}var $y=4096;function VA(t){let e=t.length;if(e<=$y)return String.fromCharCode.apply(String,t);let r="",i=0;for(;i<e;)r+=String.fromCharCode.apply(String,t.slice(i,i+=$y));return r}function jA(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 XA(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 WA(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+=r_[t[o]];return n}function ZA(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 Qe(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||Qe(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||Qe(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||Qe(e,1,this.length),this[e]};R.prototype.readUint16LE=R.prototype.readUInt16LE=function(e,r){return e=e>>>0,r||Qe(e,2,this.length),this[e]|this[e+1]<<8};R.prototype.readUint16BE=R.prototype.readUInt16BE=function(e,r){return e=e>>>0,r||Qe(e,2,this.length),this[e]<<8|this[e+1]};R.prototype.readUint32LE=R.prototype.readUInt32LE=function(e,r){return e=e>>>0,r||Qe(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||Qe(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,ms(e,"offset");let r=this[e],i=this[e+7];(r===void 0||i===void 0)&&h0(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,ms(e,"offset");let r=this[e],i=this[e+7];(r===void 0||i===void 0)&&h0(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||Qe(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||Qe(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||Qe(e,1,this.length),this[e]&128?(255-this[e]+1)*-1:this[e]};R.prototype.readInt16LE=function(e,r){e=e>>>0,r||Qe(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||Qe(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||Qe(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||Qe(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,ms(e,"offset");let r=this[e],i=this[e+7];(r===void 0||i===void 0)&&h0(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,ms(e,"offset");let r=this[e],i=this[e+7];(r===void 0||i===void 0)&&h0(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||Qe(e,4,this.length),hs.read(this,e,true,23,4)};R.prototype.readFloatBE=function(e,r){return e=e>>>0,r||Qe(e,4,this.length),hs.read(this,e,false,23,4)};R.prototype.readDoubleLE=function(e,r){return e=e>>>0,r||Qe(e,8,this.length),hs.read(this,e,true,52,8)};R.prototype.readDoubleBE=function(e,r){return e=e>>>0,r||Qe(e,8,this.length),hs.read(this,e,false,52,8)};function xt(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;xt(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;xt(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||xt(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||xt(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||xt(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||xt(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||xt(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 Qy(t,e,r,i,n){i3(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 Jy(t,e,r,i,n){i3(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 Qy(this,e,r,BigInt(0),BigInt("0xffffffffffffffff"))});R.prototype.writeBigUInt64BE=Ji(function(e,r=0){return Jy(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);xt(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);xt(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||xt(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||xt(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||xt(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||xt(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||xt(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 Qy(this,e,r,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});R.prototype.writeBigInt64BE=Ji(function(e,r=0){return Jy(this,e,r,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function e3(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 t3(t,e,r,i,n){return e=+e,r=r>>>0,n||e3(t,e,r,4),hs.write(t,e,r,i,23,4),r+4}R.prototype.writeFloatLE=function(e,r,i){return t3(this,e,r,true,i)};R.prototype.writeFloatBE=function(e,r,i){return t3(this,e,r,false,i)};function r3(t,e,r,i,n){return e=+e,r=r>>>0,n||e3(t,e,r,8),hs.write(t,e,r,i,52,8),r+8}R.prototype.writeDoubleLE=function(e,r,i){return r3(this,e,r,true,i)};R.prototype.writeDoubleBE=function(e,r,i){return r3(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 ps={};function Af(t,e,r){ps[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}`}};}Af("ERR_BUFFER_OUT_OF_BOUNDS",function(t){return t?`${t} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError);Af("ERR_INVALID_ARG_TYPE",function(t,e){return `The "${t}" argument must be of type number. Received type ${typeof e}`},TypeError);Af("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=Vy(String(r)):typeof r=="bigint"&&(n=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(n=Vy(n)),n+="n"),i+=` It must be ${e}. Received ${n}`,i},RangeError);function Vy(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 YA(t,e,r){ms(e,"offset"),(t[e]===void 0||t[e+r]===void 0)&&h0(e,t.length-(r+1));}function i3(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 ps.ERR_OUT_OF_RANGE("value",a,t)}YA(i,n,o);}function ms(t,e){if(typeof t!="number")throw new ps.ERR_INVALID_ARG_TYPE(e,"number",t)}function h0(t,e,r){throw Math.floor(t)!==t?(ms(t,r),new ps.ERR_OUT_OF_RANGE("offset","an integer",t)):e<0?new ps.ERR_BUFFER_OUT_OF_BOUNDS:new ps.ERR_OUT_OF_RANGE("offset",`>= ${0} and <= ${e}`,t)}var QA=/[^+/0-9A-Za-z-_]/g;function JA(t){if(t=t.split("=")[0],t=t.trim().replace(QA,""),t.length<2)return "";for(;t.length%4!==0;)t=t+"=";return t}function bf(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 e_(t){let e=[];for(let r=0;r<t.length;++r)e.push(t.charCodeAt(r)&255);return e}function t_(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 n3(t){return mf.toByteArray(JA(t))}function V1(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 _f(t){return t!==t}var r_=(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"?i_:t}function i_(){throw new Error("BigInt not supported")}});var X4=se((L$,j4)=>{var zs=1e3,$s=zs*60,Vs=$s*60,Co=Vs*24,qC=Co*7,GC=Co*365.25;j4.exports=function(t,e){e=e||{};var r=typeof t;if(r==="string"&&t.length>0)return zC(t);if(r==="number"&&isFinite(t))return e.long?VC(t):$C(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))};function zC(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*GC;case "weeks":case "week":case "w":return r*qC;case "days":case "day":case "d":return r*Co;case "hours":case "hour":case "hrs":case "hr":case "h":return r*Vs;case "minutes":case "minute":case "mins":case "min":case "m":return r*$s;case "seconds":case "second":case "secs":case "sec":case "s":return r*zs;case "milliseconds":case "millisecond":case "msecs":case "msec":case "ms":return r;default:return}}}}function $C(t){var e=Math.abs(t);return e>=Co?Math.round(t/Co)+"d":e>=Vs?Math.round(t/Vs)+"h":e>=$s?Math.round(t/$s)+"m":e>=zs?Math.round(t/zs)+"s":t+"ms"}function VC(t){var e=Math.abs(t);return e>=Co?Il(t,e,Co,"day"):e>=Vs?Il(t,e,Vs,"hour"):e>=$s?Il(t,e,$s,"minute"):e>=zs?Il(t,e,zs,"second"):t+" ms"}function Il(t,e,r,i){var n=e>=r*1.5;return Math.round(t/r)+" "+i+(n?"s":"")}});var Z4=se((H$,W4)=>{function jC(t){r.debug=r,r.default=r,r.coerce=l,r.disable=s,r.enable=n,r.enabled=a,r.humanize=X4(),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 A(...g){if(!A.enabled)return;let x=A,_=Number(new Date),w=_-(u||_);x.diff=w,x.prev=u,x.curr=_,u=_,g[0]=r.coerce(g[0]),typeof g[0]!="string"&&g.unshift("%O");let I=0;g[0]=g[0].replace(/%([a-zA-Z%])/g,(H,O)=>{if(H==="%%")return "%";I++;let U=r.formatters[O];if(typeof U=="function"){let F=g[I];H=U.call(x,F),g.splice(I,1),I--;}return H}),r.formatArgs.call(x,g),(x.log||r.log).apply(x,g);}return A.namespace=d,A.useColors=r.useColors(),A.color=r.selectColor(d),A.extend=i,A.destroy=r.destroy,Object.defineProperty(A,"enabled",{enumerable:true,configurable:false,get:()=>h!==null?h:(y!==r.namespaces&&(y=r.namespaces,b=r.enabled(d)),b),set:g=>{h=g;}}),typeof r.init=="function"&&r.init(A),A}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,A=0;for(;h<d.length;)if(y<u.length&&(u[y]===d[h]||u[y]==="*"))u[y]==="*"?(b=y,A=h,y++):(h++,y++);else if(b!==-1)y=b+1,A++,h=A;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}W4.exports=jC;});var z0=se((Et,vl)=>{Et.formatArgs=WC;Et.save=ZC;Et.load=YC;Et.useColors=XC;Et.storage=QC();Et.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`."));}})();Et.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 XC(){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 WC(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+vl.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);}Et.log=console.debug||console.log||(()=>{});function ZC(t){try{t?Et.storage.setItem("debug",t):Et.storage.removeItem("debug");}catch{}}function YC(){let t;try{t=Et.storage.getItem("debug")||Et.storage.getItem("DEBUG");}catch{}return !t&&typeof process<"u"&&"env"in process&&(t=process.env.DEBUG),t}function QC(){try{return localStorage}catch{}}vl.exports=Z4()(Et);var{formatters:JC}=vl.exports;JC.j=function(t){try{return JSON.stringify(t)}catch(e){return "[UnexpectedJSONParseError]: "+e.message}};});var sb=se((X$,ob)=>{ob.exports={};});var b5=se((hj,k7)=>{k7.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 S5=se((mj,P7)=>{P7.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 x5=se(ad=>{ad.remove=N7;var sd=[{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"}],Nh={};for(Sc=0;Sc<sd.length;Sc+=1)for(Ph=sd[Sc].chars,od=0;od<Ph.length;od+=1)Nh[Ph[od]]=sd[Sc].base;var Ph,od,Sc;function N7(t){return t.replace(/[^\u0000-\u007e]/g,function(e){return Nh[e]||e})}ad.replacementList=sd;ad.diacriticsMap=Nh;});var Uh=se(ve=>{var D7=b5(),R7=S5(),O7=x5().remove,oa={},cd={},ld={},Ac={},Oh={};D7.forEach(function(t){let e=t;cd[e[0]]=e[1],ld[e[1]]=e[0],Ac[e[2]]=e[0],Oh[e[0]]=e[2];});function A5(t){return ("000"+(t||"")).slice(-3)}function xc(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function M7(t,e){return Object.keys(t).reduce(function(r,i){let n=t[i];return r[i]=e(n,i),r},{})}function _5(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");oa[t.locale]=t.countries;};function Mh(t){return ld[t]}ve.alpha3ToAlpha2=Mh;function Fh(t){return cd[t]}ve.alpha2ToAlpha3=Fh;function F7(t){return Oh[Mh(t)]}ve.alpha3ToNumeric=F7;function U7(t){return Oh[t]}ve.alpha2ToNumeric=U7;function Dh(t){let e=A5(t);return Fh(Ac[e])}ve.numericToAlpha3=Dh;function Rh(t){let e=A5(t);return Ac[e]}ve.numericToAlpha2=Rh;function L7(t){if(typeof t=="string"){if(/^[0-9]*$/.test(t))return Dh(t);if(t.length===2)return Fh(t.toUpperCase());if(t.length===3)return t.toUpperCase()}if(typeof t=="number")return Dh(t)}ve.toAlpha3=L7;function C5(t){if(typeof t=="string"){if(/^[0-9]*$/.test(t))return Rh(t);if(t.length===2)return t.toUpperCase();if(t.length===3)return Mh(t.toUpperCase())}if(typeof t=="number")return Rh(t)}ve.toAlpha2=C5;ve.getName=function(t,e,r={}){"select"in r||(r.select="official");try{let n=oa[e.toLowerCase()][C5(t)];return _5(r.select,n)}catch{return}};ve.getNames=function(t,e={}){"select"in e||(e.select="official");let r=oa[t.toLowerCase()];return r===void 0?{}:M7(r,function(i){return _5(e.select,i)})};ve.getAlpha2Code=function(t,e){let r=n=>n.toLowerCase(),i=(n,o)=>r(n)===r(o);try{let n=oa[e.toLowerCase()];for(let o in n)if(xc(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=>O7(n.toLowerCase()),i=(n,o)=>r(n)===r(o);try{let n=oa[e.toLowerCase()];for(let o in n)if(xc(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 cd};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 ld};ve.getNumericCodes=function(){return Ac};ve.langs=function(){return Object.keys(oa)};ve.getSupportedLanguages=function(){return R7};ve.isValid=function(t){if(!t)return false;let e=t.toString().toUpperCase();return xc(ld,e)||xc(cd,e)||xc(Ac,e)};});var I5=se((Sj,w5)=>{w5.exports={};});var E5=se((xj,v5)=>{v5.exports={};});var T5=se((Aj,B5)=>{B5.exports={};});var Lh=se((_j,k5)=>{k5.exports={};});var kc,Ae,Wh,Pi,$h,Zh,Yh,Sd,wc,ca,Qh,Cd,xd,Ad,Ec={},Bc=[],I8=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Pc=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 Id(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?kc.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 Ic(t,s,i,n,null)}function Ic(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??++Wh,__i:-1,__u:0};return n==null&&Ae.vnode!=null&&Ae.vnode(o),o}function ar(t){return t.children}function vc(t,e){this.props=t,this.context=e;}function Mo(t,e){if(e==null)return t.__?Mo(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"?Mo(t):null}function v8(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),vd(t.__P,o,e,t.__n,t.__P.namespaceURI,32&e.__u?[r]:null,i,r??Mo(e),!!(32&e.__u),n),o.__v=e.__v,o.__.__k[o.__i]=o,r2(i,o,n),e.__e=e.__=null,o.__e!=r&&Jh(o);}}function Jh(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}),Jh(t)}function Vh(t){(!t.__d&&(t.__d=true)&&Pi.push(t)&&!Tc.__r++||$h!=Ae.debounceRendering)&&(($h=Ae.debounceRendering)||Zh)(Tc);}function Tc(){try{for(var t,e=1;Pi.length;)Pi.length>e&&Pi.sort(Yh),t=Pi.shift(),e=Pi.length,v8(t);}finally{Pi.length=Tc.__r=0;}}function e2(t,e,r,i,n,o,s,a,l,c,d){var u,h,y,b,A,g,x,_=i&&i.__k||Bc,w=e.length;for(l=E8(r,e,_,l,w),u=0;u<w;u++)(y=r.__k[u])!=null&&(h=y.__i!=-1&&_[y.__i]||Ec,y.__i=u,g=vd(t,y,h,n,o,s,a,l,c,d),b=y.__e,y.ref&&h.ref!=y.ref&&(h.ref&&Ed(h.ref,null,y),d.push(y.ref,y.__c||b,y)),A==null&&b!=null&&(A=b),(x=!!(4&y.__u))||h.__k===y.__k?(l=t2(y,l,t,x),x&&h.__e&&(h.__e=null)):typeof y.type=="function"&&g!==void 0?l=g:b&&(l=b.nextSibling),y.__u&=-7);return r.__e=A,l}function E8(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]=Ic(null,s,null,null,null):Pc(s)?s=t.__k[o]=Ic(ar,{children:s},null,null,null):s.constructor===void 0&&s.__b>0?s=t.__k[o]=Ic(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=B8(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=Mo(a)),n2(a,a));return i}function t2(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=t2(n[o],e,r,i));return e}t.__e!=e&&(i&&(e&&t.type&&!e.parentNode&&(e=Mo(t)),r.insertBefore(t.__e,e||null)),e=t.__e);do e=e&&e.nextSibling;while(e!=null&&e.nodeType==8);return e}function B8(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 jh(t,e,r){e[0]=="-"?t.setProperty(e,r??""):t[e]=r==null?"":typeof r!="number"||I8.test(e)?r:r+"px";}function Cc(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||jh(t.style,e,"");if(r)for(e in r)i&&r[e]==i[e]||jh(t.style,e,r[e]);}else if(e[0]=="o"&&e[1]=="n")o=e!=(e=e.replace(Qh,"$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[ca]=i[ca]:(r[ca]=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 Xh(t){return function(e){if(this.l){var r=this.l[e.type+t];if(e[wc]==null)e[wc]=Cd++;else if(e[wc]<r[ca])return;return r(Ae.event?Ae.event(e):e)}}}function vd(t,e,r,i,n,o,s,a,l,c){var d,u,h,y,b,A,g,x,_,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(x=e.props,_=F.prototype&&F.prototype.render,w=(d=F.contextType)&&i[d.__c],I=d?w?w.props.value:d.__:i,r.__c?g=(u=e.__c=r.__c).__=u.__E:(_?e.__c=u=new F(x,I):(e.__c=u=new vc(x,I),u.constructor=F,u.render=k8),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(x,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&&x!==y&&u.componentWillReceiveProps!=null&&u.componentWillReceiveProps(x,I),e.__v==r.__v||!u.__e&&u.shouldComponentUpdate!=null&&u.shouldComponentUpdate(x,u.__s,I)===!1){e.__v!=r.__v&&(u.props=x,u.state=u.__s,u.__d=!1),e.__e=r.__e,e.__k=r.__k,e.__k.some(function(T){T&&(T.__=e);}),Bc.push.apply(u.__h,u._sb),u._sb=[],u.__h.length&&s.push(u);break e}u.componentWillUpdate!=null&&u.componentWillUpdate(x,u.__s,I),_&&u.componentDidUpdate!=null&&u.__h.push(function(){u.componentDidUpdate(y,b,A);});}if(u.context=I,u.props=x,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),Bc.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&&(A=u.getSnapshotBeforeUpdate(y,b)),O=d!=null&&d.type===ar&&d.key==null?i2(d.props.children):d,a=e2(t,Pc(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),g&&(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=T8(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 r2(t,e,r){for(var i=0;i<r.length;i++)Ed(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 i2(t){return typeof t!="object"||t==null||t.__b>0?t:Pc(t)?t.map(i2):t.constructor!==void 0?null:Jr({},t)}function T8(t,e,r,i,n,o,s,a,l){var c,d,u,h,y,b,A,g=r.props||Ec,x=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(x);t=document.createElementNS(n,_,x.is&&x),a&&(Ae.__m&&Ae.__m(e,o),a=false),o=null;}if(_==null)g===x||a&&t.data==x||(t.data=x);else {if(o=_=="textarea"&&x.defaultValue!=null?null:o&&kc.call(t.childNodes),!a&&o!=null)for(g={},c=0;c<t.attributes.length;c++)g[(y=t.attributes[c]).name]=y.value;for(c in g)y=g[c],c=="dangerouslySetInnerHTML"?u=y:c=="children"||c in x||c=="value"&&"defaultValue"in x||c=="checked"&&"defaultChecked"in x||Cc(t,c,null,y,n);for(c in x)y=x[c],c=="children"?h=y:c=="dangerouslySetInnerHTML"?d=y:c=="value"?b=y:c=="checked"?A=y:a&&typeof y!="function"||g[c]===y||Cc(t,c,y,g[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=""),e2(e.type=="template"?t.content:t,Pc(h)?h:[h],e,r,i,_=="foreignObject"?"http://www.w3.org/1999/xhtml":n,o,s,o?o[0]:r.__k&&Mo(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!=g[c])&&Cc(t,c,b,g[c],n),c="checked",A!=null&&A!=t[c]&&Cc(t,c,A,g[c],n));}return t}function Ed(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 n2(t,e,r){var i,n;if(Ae.unmount&&Ae.unmount(t),(i=t.ref)&&(i.current&&i.current!=t.__e||Ed(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]&&n2(i[n],e,r||typeof t.type!="function");r||wd(t.__e),t.__c=t.__=t.__e=void 0;}function k8(t,e,r){return this.constructor(t,r)}function Bd(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=[],vd(e,t=(e).__k=Id(ar,null,[t]),n||Ec,Ec,e.namespaceURI,n?null:e.firstChild?kc.call(e.childNodes):null,o,n?n.__e:e.firstChild,i,s),r2(o,t,s);}kc=Bc.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}},Wh=0,vc.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),Vh(this));},vc.prototype.forceUpdate=function(t){this.__v&&(this.__e=true,t&&this.__h.push(t),Vh(this));},vc.prototype.render=ar,Pi=[],Zh=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Yh=function(t,e){return t.__v.__b-e.__v.__b},Tc.__r=0,Sd=Math.random().toString(8),wc="__d"+Sd,ca="__a"+Sd,Qh=/(PointerCapture)$|Capture$/i,Cd=0,xd=Xh(false),Ad=Xh(true);var Fo,Te,Td,o2,la=0,p2=[],ke=Ae,s2=ke.__b,a2=ke.__r,c2=ke.diffed,l2=ke.__c,d2=ke.unmount,u2=ke.__;function Dc(t,e){ke.__h&&ke.__h(Te,t,la||e),la=0;var r=Te.__H||(Te.__H={__:[],__h:[]});return t>=r.__.length&&r.__.push({}),r.__[t]}function cr(t){return la=1,P8(g2,t)}function P8(t,e,r){var i=Dc(Fo++,2);if(i.t=t,!i.__c&&(i.__=[g2(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 Rc(t,e){var r=Dc(Fo++,3);!ke.__s&&Nd(r.__H,e)&&(r.__=t,r.u=e,Te.__H.__h.push(r));}function h2(t,e){var r=Dc(Fo++,4);!ke.__s&&Nd(r.__H,e)&&(r.__=t,r.u=e,Te.__h.push(r));}function Uo(t){return la=5,m2(function(){return {current:t}},[])}function m2(t,e){var r=Dc(Fo++,7);return Nd(r.__H,e)&&(r.__=t(),r.__H=e,r.__h=t),r.__}function Pd(t,e){return la=8,m2(function(){return t},e)}function N8(){for(var t;t=p2.shift();){var e=t.__H;if(t.__P&&e)try{e.__h.some(Nc),e.__h.some(kd),e.__h=[];}catch(r){e.__h=[],ke.__e(r,t.__v);}}}ke.__b=function(t){Te=null,s2&&s2(t);},ke.__=function(t,e){t&&e.__k&&e.__k.__m&&(t.__m=e.__k.__m),u2&&u2(t,e);},ke.__r=function(t){a2&&a2(t),Fo=0;var e=(Te=t.__c).__H;e&&(Td===Te?(e.__h=[],Te.__h=[],e.__.some(function(r){r.__N&&(r.__=r.__N),r.u=r.__N=void 0;})):(e.__h.some(Nc),e.__h.some(kd),e.__h=[],Fo=0)),Td=Te;},ke.diffed=function(t){c2&&c2(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(p2.push(e)!==1&&o2===ke.requestAnimationFrame||((o2=ke.requestAnimationFrame)||D8)(N8)),e.__H.__.some(function(r){r.u&&(r.__H=r.u),r.u=void 0;})),Td=Te=null;},ke.__c=function(t,e){e.some(function(r){try{r.__h.some(Nc),r.__h=r.__h.filter(function(i){return !i.__||kd(i)});}catch(i){e.some(function(n){n.__h&&(n.__h=[]);}),e=[],ke.__e(i,r.__v);}}),l2&&l2(t,e);},ke.unmount=function(t){d2&&d2(t);var e,r=t.__c;r&&r.__H&&(r.__H.__.some(function(i){try{Nc(i);}catch(n){e=n;}}),r.__H=void 0,e&&ke.__e(e,r.__v));};var f2=typeof requestAnimationFrame=="function";function D8(t){var e,r=function(){clearTimeout(i),f2&&cancelAnimationFrame(e),setTimeout(t);},i=setTimeout(r,35);f2&&(e=requestAnimationFrame(r));}function Nc(t){var e=Te,r=t.__c;typeof r=="function"&&(t.__c=void 0,r()),Te=e;}function kd(t){var e=Te;t.__c=t.__(),Te=e;}function Nd(t,e){return !t||t.length!==e.length||e.some(function(r,i){return r!==t[i]})}function g2(t,e){return typeof e=="function"?e(t):e}var y2="https://zkpassport.id/r",b2="https://apps.apple.com/us/app/zkpassport/id6477371975",S2="https://play.google.com/store/apps/details?id=app.zkpassport.zkpassport",da='<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>',x2=`
3
10
  <svg width="100%" height="100%" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg" aria-hidden="true">
4
11
  <defs>
5
12
  <linearGradient id="zkp-spin-mark-grad" x1="15.0417" y1="0" x2="15.0417" y2="30.0755" gradientUnits="userSpaceOnUse">
@@ -12,7 +19,7 @@
12
19
  <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)"/>
13
20
  </g>
14
21
  <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"/>
15
- </svg>`,Je='<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>',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="M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z"/></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="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>',t1='<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>',r1='<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>',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"><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>',o1={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>'},a1={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 s1=`@layer zkpassport {
22
+ </svg>`,A2='<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>',_2='<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>',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="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>',Lo='<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>',w2='<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>',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"><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>',v2='<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>',E2={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>'},B2={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 T2=`@layer zkpassport {
16
23
  .zkp-card {
17
24
  --zkp-bg: #ffffff;
18
25
  --zkp-fg: #111827;
@@ -39,8 +46,10 @@
39
46
  background: var(--zkp-bg);
40
47
  color: var(--zkp-fg);
41
48
  font-family: ui-sans-serif, system-ui, sans-serif;
49
+ text-align: left;
42
50
  font-size: 14px;
43
51
  line-height: 1.4;
52
+ min-height: 460px;
44
53
  }
45
54
 
46
55
  .zkp-card[data-theme="dark"] {
@@ -78,6 +87,19 @@
78
87
  font: inherit;
79
88
  cursor: pointer;
80
89
  }
90
+ .zkp-card button:focus-visible,
91
+ .zkp-card a:focus-visible,
92
+ .zkp-card input:focus-visible {
93
+ outline: 2px solid var(--zkp-brand);
94
+ outline-offset: 2px;
95
+ }
96
+ @media (prefers-reduced-motion: reduce) {
97
+ .zkp-card,
98
+ .zkp-card * {
99
+ animation: none !important;
100
+ transition: none !important;
101
+ }
102
+ }
81
103
 
82
104
  /* Header */
83
105
  .zkp-header {
@@ -251,11 +273,15 @@
251
273
  opacity: 0.65;
252
274
  }
253
275
  .zkp-qr-slot[data-state="generating"] .zkp-qr,
276
+ .zkp-qr-slot[data-state="local-proving"] .zkp-qr,
277
+ .zkp-qr-slot[data-state="save-offer"] .zkp-qr,
254
278
  .zkp-qr-slot[data-state="success"] .zkp-qr,
255
279
  .zkp-qr-slot[data-state="error"] .zkp-qr {
256
280
  opacity: 0.35;
257
281
  }
258
282
  .zkp-qr-slot[data-state="generating"] .zkp-qr-logo,
283
+ .zkp-qr-slot[data-state="local-proving"] .zkp-qr-logo,
284
+ .zkp-qr-slot[data-state="save-offer"] .zkp-qr-logo,
259
285
  .zkp-qr-slot[data-state="success"] .zkp-qr-logo,
260
286
  .zkp-qr-slot[data-state="error"] .zkp-qr-logo {
261
287
  opacity: 0;
@@ -263,6 +289,8 @@
263
289
  .zkp-qr-slot[data-state="connecting"] .zkp-overlay,
264
290
  .zkp-qr-slot[data-state="scanned"] .zkp-overlay,
265
291
  .zkp-qr-slot[data-state="generating"] .zkp-overlay,
292
+ .zkp-qr-slot[data-state="local-proving"] .zkp-overlay,
293
+ .zkp-qr-slot[data-state="save-offer"] .zkp-overlay,
266
294
  .zkp-qr-slot[data-state="success"] .zkp-overlay,
267
295
  .zkp-qr-slot[data-state="error"] .zkp-overlay {
268
296
  display: block;
@@ -436,28 +464,303 @@
436
464
  overflow: hidden;
437
465
  }
438
466
 
439
- /* Open-in-app deep link (mobile only, waiting state) */
467
+ /* Open-in-app deep link (mobile: primary action; shown via .zkp-open-app-block) */
440
468
  .zkp-open-app {
441
- display: none;
442
- margin: 16px 0 0;
443
- padding: 12px 16px;
444
- border-radius: 10px;
445
- background: var(--zkp-accent);
446
- color: var(--zkp-bg);
447
- font-size: 15px;
448
- font-weight: 600;
449
- text-align: center;
450
- text-decoration: none;
451
- box-shadow: 0 4px 12px rgba(17, 24, 39, 0.18);
452
- transition: transform 150ms ease;
469
+ display: none !important;
470
+ margin: 16px 0 0 !important;
471
+ padding: 16px !important;
472
+ border-radius: 8px !important;
473
+ background: var(--zkp-brand) !important;
474
+ color: var(--zkp-bg) !important;
475
+ font-size: 13px !important;
476
+ font-weight: 700 !important;
477
+ letter-spacing: 0.09em !important;
478
+ text-transform: uppercase !important;
479
+ text-align: center !important;
480
+ text-decoration: none !important;
481
+ transition: transform 150ms ease !important;
453
482
  }
454
483
  .zkp-open-app:active {
455
484
  transform: translateY(1px);
456
485
  }
457
- @media (hover: none) and (pointer: coarse) {
458
- .zkp-card[data-state="waiting"] .zkp-open-app {
459
- display: block;
486
+ .zkp-open-app-block {
487
+ display: block !important;
488
+ margin-top: 0 !important;
489
+ width: 100% !important;
490
+ box-sizing: border-box !important;
491
+ }
492
+ /* Mobile-first waiting screen: open-app primary, QR behind a toggle */
493
+ .zkp-open-app-hero {
494
+ display: flex;
495
+ flex-direction: column;
496
+ align-items: stretch;
497
+ gap: 12px;
498
+ padding: 8px 0 4px;
499
+ }
500
+ .zkp-open-app-loading {
501
+ display: flex;
502
+ }
503
+ .zkp-qr-reveal {
504
+ appearance: none !important;
505
+ -webkit-appearance: none !important;
506
+ border: none !important;
507
+ background: none !important;
508
+ padding: 4px !important;
509
+ cursor: pointer !important;
510
+ font-size: 12.5px !important;
511
+ color: var(--zkp-muted) !important;
512
+ text-decoration: underline !important;
513
+ text-underline-offset: 3px !important;
514
+ }
515
+ .zkp-inapp-hint {
516
+ margin: 0;
517
+ font-size: 12px;
518
+ line-height: 1.5;
519
+ text-align: center;
520
+ color: var(--zkp-muted);
521
+ }
522
+
523
+ /* Intro screen */
524
+ .zkp-intro {
525
+ display: flex;
526
+ flex-direction: column;
527
+ flex: 1;
528
+ gap: 16px;
529
+ margin-top: 18px;
530
+ animation: zkp-screen-in 240ms ease;
531
+ }
532
+ .zkp-screen {
533
+ display: flex;
534
+ flex-direction: column;
535
+ flex: 1;
536
+ animation: zkp-screen-in 240ms ease;
537
+ }
538
+ @keyframes zkp-screen-in {
539
+ from {
540
+ opacity: 0;
541
+ transform: translateY(4px);
542
+ }
543
+ to {
544
+ opacity: 1;
545
+ transform: none;
546
+ }
547
+ }
548
+ .zkp-intro > .zkp-divider {
549
+ margin: 2px 0;
550
+ }
551
+ /* Passport data-page style micro-label */
552
+ .zkp-eyebrow {
553
+ margin: 0 0 6px;
554
+ font-size: 11px;
555
+ font-weight: 600;
556
+ letter-spacing: 0.08em;
557
+ text-transform: uppercase;
558
+ color: var(--zkp-muted);
559
+ padding-bottom: 1rem;
560
+ }
561
+ .zkp-intro-request {
562
+ padding: 16px;
563
+ border: 1px solid var(--zkp-border);
564
+ border-radius: 12px;
565
+ background: var(--zkp-surface);
566
+ }
567
+ .zkp-skel-rows {
568
+ display: flex;
569
+ flex-direction: column;
570
+ gap: 12px;
571
+ }
572
+ .zkp-skel-row {
573
+ height: 12px;
574
+ border-radius: 6px;
575
+ background: color-mix(in srgb, var(--zkp-muted) 25%, transparent);
576
+ animation: zkp-skel-pulse 1.4s ease-in-out infinite;
577
+ }
578
+ .zkp-skel-row-detail {
579
+ height: 9px;
580
+ margin-left: 25px;
581
+ opacity: 0.7;
582
+ }
583
+ @keyframes zkp-skel-pulse {
584
+ 0%,
585
+ 100% {
586
+ opacity: 0.55;
460
587
  }
588
+ 50% {
589
+ opacity: 1;
590
+ }
591
+ }
592
+ .zkp-intro-list {
593
+ margin: 0;
594
+ padding: 0;
595
+ list-style: none;
596
+ display: flex;
597
+ flex-direction: column;
598
+ gap: 14px;
599
+ }
600
+ .zkp-intro-list li {
601
+ display: flex;
602
+ align-items: flex-start;
603
+ gap: 10px;
604
+ }
605
+ .zkp-intro-list-hint {
606
+ font-size: 12px;
607
+ line-height: 1.45;
608
+ color: var(--zkp-muted);
609
+ margin-top: 5px;
610
+ text-align: center;
611
+ }
612
+ .zkp-intro-item {
613
+ display: flex;
614
+ flex-direction: column;
615
+ gap: 3px;
616
+ min-width: 0;
617
+ }
618
+ .zkp-intro-item-title {
619
+ font-size: 14px;
620
+ font-weight: 600;
621
+ line-height: 1.35;
622
+ color: var(--zkp-fg);
623
+ }
624
+ .zkp-intro-item-detail {
625
+ font-size: 12px;
626
+ line-height: 1.4;
627
+ color: var(--zkp-muted);
628
+ }
629
+ .zkp-intro-check {
630
+ flex: none;
631
+ display: inline-flex;
632
+ width: 15px;
633
+ height: 15px;
634
+ margin-top: 2px;
635
+ color: var(--zkp-brand);
636
+ }
637
+ .zkp-intro-check svg {
638
+ width: 100%;
639
+ height: 100%;
640
+ }
641
+ .zkp-intro-explainer {
642
+ margin: 0;
643
+ font-size: 13px;
644
+ line-height: 1.5;
645
+ color: var(--zkp-muted);
646
+ }
647
+ .zkp-intro-footer {
648
+ display: flex;
649
+ flex-direction: column;
650
+ gap: 10px;
651
+ margin-top: auto;
652
+ padding-top: 4px;
653
+ text-align: center;
654
+ }
655
+ .zkp-intro-footer .zkp-divider {
656
+ margin-bottom: 4px;
657
+ }
658
+ .zkp-intro-footer-note {
659
+ margin: 0;
660
+ font-size: 11.5px;
661
+ line-height: 1.55;
662
+ color: var(--zkp-muted);
663
+ }
664
+ /* Passport-label style privacy assurances */
665
+ .zkp-privacy-strip {
666
+ display: flex;
667
+ align-items: center;
668
+ justify-content: center;
669
+ gap: 10px;
670
+ font-size: 10.5px;
671
+ font-weight: 600;
672
+ letter-spacing: 0.1em;
673
+ text-transform: uppercase;
674
+ color: var(--zkp-brand);
675
+ }
676
+ .zkp-privacy-dot {
677
+ color: var(--zkp-muted);
678
+ letter-spacing: 0;
679
+ }
680
+ .zkp-intro-question {
681
+ display: flex;
682
+ flex-direction: column;
683
+ align-items: center;
684
+ text-align: center;
685
+ gap: 8px;
686
+ padding-top: 6px;
687
+ }
688
+ .zkp-chip-symbol {
689
+ width: 54px;
690
+ color: var(--zkp-brand);
691
+ }
692
+ .zkp-chip-symbol svg {
693
+ width: 100%;
694
+ height: auto;
695
+ display: block;
696
+ }
697
+ .zkp-intro-question-hint {
698
+ margin: 0;
699
+ max-width: 340px;
700
+ font-size: 12.5px;
701
+ line-height: 1.45;
702
+ color: var(--zkp-muted);
703
+ }
704
+ .zkp-intro-question .zkp-intro-continue {
705
+ margin-top: 6px;
706
+ }
707
+
708
+ .zkp-intro-question-text {
709
+ margin: 4px 0 0;
710
+ font-size: 15px;
711
+ font-weight: 600;
712
+ color: var(--zkp-fg);
713
+ }
714
+ .zkp-intro-continue {
715
+ appearance: none !important;
716
+ -webkit-appearance: none !important;
717
+ -webkit-tap-highlight-color: transparent !important;
718
+ display: block !important;
719
+ width: 100% !important;
720
+ padding: 16px !important;
721
+ border: none !important;
722
+ border-radius: 8px !important;
723
+ background: var(--zkp-brand) !important;
724
+ color: var(--zkp-bg) !important;
725
+ font-size: 13px !important;
726
+ font-weight: 700 !important;
727
+ letter-spacing: 0.09em !important;
728
+ text-transform: uppercase !important;
729
+ text-align: center !important;
730
+ cursor: pointer !important;
731
+ transition:
732
+ filter 150ms ease,
733
+ transform 150ms ease !important;
734
+ }
735
+ .zkp-intro-continue:hover {
736
+ filter: brightness(1.08) !important;
737
+ }
738
+ .zkp-intro-continue:active {
739
+ transform: translateY(1px) !important;
740
+ filter: brightness(0.95) !important;
741
+ }
742
+ /* Dark --zkp-brand is a muted accent tint and makes the CTA read as
743
+ disabled; the primary action gets its own saturated fill */
744
+ .zkp-card[data-theme="dark"] .zkp-intro-continue {
745
+ background: #4a68dd !important;
746
+ color: #ffffff !important;
747
+ }
748
+ @media (prefers-color-scheme: dark) {
749
+ .zkp-card[data-theme="auto"] .zkp-intro-continue {
750
+ background: #4a68dd !important;
751
+ color: #ffffff !important;
752
+ }
753
+ }
754
+
755
+ .zkp-intro-link {
756
+ align-self: center !important;
757
+ padding: 4px 8px !important;
758
+ border: none !important;
759
+ background: transparent !important;
760
+ color: var(--zkp-muted) !important;
761
+ font-size: 13px !important;
762
+ text-decoration: underline !important;
763
+ cursor: pointer !important;
461
764
  }
462
765
 
463
766
  /* Retry */
@@ -565,6 +868,269 @@
565
868
  }
566
869
  }
567
870
  }
568
- `;function i1(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 sdk.ZKPassport(e.domain)),te(()=>{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:re,onResult:q,onReject:V,onError:w,...P}=i.current,ye=()=>{_||(_=true,S(i.current.onReady));},E=I=>(...C)=>{if(!c)try{I(...C);}catch(x){console.error(x),r("error");}};return f.current.request(P).then(I=>{if(c)return;let C;try{C=z(I);}catch(x){console.error(x),r("error");return}C.onBridgeConnect(E(()=>{r(x=>x==="preparing"||x==="connecting"?"waiting":x),ye(),S(i.current.onBridgeConnect);})),C.onRequestReceived(E(()=>{r("scanned"),S(i.current.onRequestReceived);})),C.onGeneratingProof(E(()=>{r("generating"),S(i.current.onGeneratingProof);})),C.onProofGenerated(E(x=>{S(i.current.onProofGenerated,x);})),C.onResult(E(x=>{r(x.verified?"success":"error"),S(i.current.onResult,x);})),C.onReject(E(()=>{r("error"),S(i.current.onReject);})),C.onError(E(x=>{r("error"),S(i.current.onError,x);}));try{C.requestReceived()?r("scanned"):C.isBridgeConnected()?(r("waiting"),ye()):r("connecting");}catch(x){console.error(x),r("error");}s(C.url);try{l(M1(C.url));}catch(x){console.error(x),r("error");}}).catch(I=>{c||(console.error(I),r("error"));}),()=>{c=true;}},[p]);let o=Ke(()=>{S(i.current.onRetryClicked),u(c=>c+1);},[]);return {state:t,url:a,qrSvg:n,retry:o}}function M1(e){let t=b1__default.default.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 S(e,...t){if(e)try{e(...t);}catch{}}var Z1=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:--Z1,__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 c1({options:e,controlRef:t}){Qe(P1,[]);let{state:r,url:a,qrSvg:s,retry:n}=i1(e);te(()=>{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),_=R1(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:n1}}):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(L1,{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:e1,children:[d("a",{href:Fe,target:"_blank",rel:"noopener noreferrer",children:"Download"})," the ZKPassport mobile app."]}),d(B,{status:c[1],icon:o?null:Je,children:"Scan this QR code with the ZKPassport app."}),d(B,{status:c[2],icon:o?null:Xe,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(l1,{href:$e,badge:o1}),d(l1,{href:We,badge:a1})]})]})]})}):null,r==="error"?d("div",{className:"zkp-result-actions",children:d("button",{type:"button",className:"zkp-retry",onClick:n,children:"Try again"})}):null]})}function R1(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 L1({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:Ye}}):null,e==="scanned"?d("div",{className:"zkp-scanned-phone",dangerouslySetInnerHTML:{__html:r1}}):null,e==="success"?d("div",{className:"zkp-check",dangerouslySetInnerHTML:{__html:me}}):null,e==="error"?d("div",{className:"zkp-error-icon",dangerouslySetInnerHTML:{__html:t1}}):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 l1({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 p1="data-zkpassport-ui",ge=false;function P1(){if(ge||typeof document>"u")return;if(document.querySelector(`style[${p1}]`)){ge=true;return}let e=document.createElement("style");e.setAttribute(p1,""),e.textContent=s1,document.head.appendChild(e),ge=true;}function ut(e){let t=react.useRef(null);return react.useEffect(()=>{let r=t.current;if(r)return ()=>{_e(null,r);}},[]),react.useEffect(()=>{let r=t.current;r&&_e(pe(c1,{options:e}),r);}),jsxRuntime.jsx("div",{ref:t})}
569
- Object.defineProperty(exports,"ASEAN_COUNTRIES",{enumerable:true,get:function(){return sdk.ASEAN_COUNTRIES}});Object.defineProperty(exports,"EEA_COUNTRIES",{enumerable:true,get:function(){return sdk.EEA_COUNTRIES}});Object.defineProperty(exports,"EU_COUNTRIES",{enumerable:true,get:function(){return sdk.EU_COUNTRIES}});Object.defineProperty(exports,"MERCOSUR_COUNTRIES",{enumerable:true,get:function(){return sdk.MERCOSUR_COUNTRIES}});Object.defineProperty(exports,"NullifierType",{enumerable:true,get:function(){return sdk.NullifierType}});Object.defineProperty(exports,"ProofType",{enumerable:true,get:function(){return sdk.ProofType}});Object.defineProperty(exports,"ProofTypeLength",{enumerable:true,get:function(){return sdk.ProofTypeLength}});Object.defineProperty(exports,"SANCTIONED_COUNTRIES",{enumerable:true,get:function(){return sdk.SANCTIONED_COUNTRIES}});Object.defineProperty(exports,"SCHENGEN_COUNTRIES",{enumerable:true,get:function(){return sdk.SCHENGEN_COUNTRIES}});Object.defineProperty(exports,"ZKPassport",{enumerable:true,get:function(){return sdk.ZKPassport}});exports.ZKPassportQRCode=ut;//# sourceMappingURL=react.cjs.map
871
+ `;var Dd=new Set;function Oc(t,e){if(Dd.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),Dd.add(e);return}let n=document.createElement("style");n.setAttribute("data-zkpassport-ui",e),n.textContent=t,document.head.appendChild(n),Dd.add(e);}var j5=et(Tm(),1);function iu(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 Tt(t,e,r=""){let i=iu(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 jc(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 $o(t,e){Tt(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 je(...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 Xc(t,e){return t<<e|t>>>32-e>>>0}var Pm=typeof Uint8Array.from([]).toHex=="function"&&typeof Uint8Array.fromHex=="function",BS=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));function Tn(t){if(Tt(t),Pm)return t.toHex();let e="";for(let r=0;r<t.length;r++)e+=BS[t[r]];return e}var ti={_0:48,_9:57,A:65,F:70,a:97,f:102};function km(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 kn(t){if(typeof t!="string")throw new TypeError("hex string expected, got "+typeof t);if(Pm)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=km(t.charCodeAt(o)),a=km(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 Nm(...t){let e=0;for(let i=0;i<t.length;i++){let n=t[i];Tt(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 Dm(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 Sa=t=>({oid:Uint8Array.from([6,9,96,134,72,1,101,3,4,2,t])});function Wc(t,e,r){return t&e^~t&r}function Zc(t,e,r){return t&e^t&r^e&r}var Pn=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),Tt(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),$o(e,this),this.finished=true;let{buffer:r,view:i,blockLen:n,isLE:o}=this,{pos:s}=this;r[s++]=128,je(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]),Xe=Uint32Array.from([3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]),Le=Uint32Array.from([1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209]);var Yc=BigInt(4294967295),Rm=BigInt(32);function nu(t,e=false){return e?{h:Number(t&Yc),l:Number(t>>Rm&Yc)}:{h:Number(t>>Rm&Yc)|0,l:Number(t&Yc)|0}}function Om(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}=nu(t[o],e);[i[o],n[o]]=[s,a];}return [i,n]}var ou=(t,e,r)=>t>>>r,su=(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,xa=(t,e,r)=>t<<64-r|e>>>r-32,Aa=(t,e,r)=>t>>>r-32|e<<64-r,Mm=(t,e)=>e,Fm=(t,e)=>t;function kt(t,e,r,i){let n=(e>>>0)+(i>>>0);return {h:t+r+(n/2**32|0)|0,l:n|0}}var _a=(t,e,r)=>(t>>>0)+(e>>>0)+(r>>>0),Ca=(t,e,r,i)=>e+r+i+(t/2**32|0)|0,Um=(t,e,r,i)=>(t>>>0)+(e>>>0)+(r>>>0)+(i>>>0),Lm=(t,e,r,i,n)=>e+r+i+n+(t/2**32|0)|0,Hm=(t,e,r,i,n)=>(t>>>0)+(e>>>0)+(r>>>0)+(i>>>0)+(n>>>0),Km=(t,e,r,i,n,o)=>e+r+i+n+o+(t/2**32|0)|0;var TS=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),Qc=class extends Pn{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,A=lr(y,17)^lr(y,19)^y>>>10;Fi[u]=A+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+Wc(a,l,c)+TS[u]+Fi[u]|0,A=(lr(i,2)^lr(i,13)^lr(i,22))+Zc(i,n,o)|0;d=c,c=l,l=a,a=s+y|0,s=o,o=n,n=i,i=y+A|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(){je(Fi);}destroy(){this.destroyed=true,this.set(0,0,0,0,0,0,0,0),je(this.buffer);}},au=class extends Qc{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);}},cu=class extends Qc{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);}},Gm=Om(["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))),kS=Gm[0],PS=Gm[1],Ui=new Uint32Array(80),Li=new Uint32Array(80),Jc=class extends Pn{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:A,Hl:g}=this;return [e,r,i,n,o,s,a,l,c,d,u,h,y,b,A,g]}set(e,r,i,n,o,s,a,l,c,d,u,h,y,b,A,g){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=A|0,this.Hl=g|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)^ou(I,N,7),O=ur(I,N,1)^ur(I,N,8)^su(I,N,7),U=Ui[w-2]|0,F=Li[w-2]|0,T=dr(U,F,19)^xa(U,F,61)^ou(U,F,6),C=ur(U,F,19)^Aa(U,F,61)^su(U,F,6),E=Um(O,C,Li[w-7],Li[w-16]),v=Lm(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:A,Gl:g,Hh:x,Hl:_}=this;for(let w=0;w<80;w++){let I=dr(u,h,14)^dr(u,h,18)^xa(u,h,41),N=ur(u,h,14)^ur(u,h,18)^Aa(u,h,41),H=u&y^~u&A,O=h&b^~h&g,U=Hm(_,N,O,PS[w],Li[w]),F=Km(U,x,I,H,kS[w],Ui[w]),T=U|0,C=dr(i,n,28)^xa(i,n,34)^xa(i,n,39),E=ur(i,n,28)^Aa(i,n,34)^Aa(i,n,39),v=i&o^i&a^o&a,B=n&s^n&l^s&l;x=A|0,_=g|0,A=y|0,g=b|0,y=u|0,b=h|0,{h:u,l:h}=kt(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=_a(T,E,B);i=Ca(D,F,C,v),n=D|0;}(({h:i,l:n}=kt(this.Ah|0,this.Al|0,i|0,n|0))),{h:o,l:s}=kt(this.Bh|0,this.Bl|0,o|0,s|0),{h:a,l}=kt(this.Ch|0,this.Cl|0,a|0,l|0),{h:c,l:d}=kt(this.Dh|0,this.Dl|0,c|0,d|0),{h:u,l:h}=kt(this.Eh|0,this.El|0,u|0,h|0),{h:y,l:b}=kt(this.Fh|0,this.Fl|0,y|0,b|0),{h:A,l:g}=kt(this.Gh|0,this.Gl|0,A|0,g|0),{h:x,l:_}=kt(this.Hh|0,this.Hl|0,x|0,_|0),this.set(i,n,o,s,a,l,c,d,u,h,y,b,A,g,x,_);}roundClean(){je(Ui,Li);}destroy(){this.destroyed=true,je(this.buffer),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);}},lu=class extends Jc{constructor(){super(64);f(this,"Ah",Le[0]|0);f(this,"Al",Le[1]|0);f(this,"Bh",Le[2]|0);f(this,"Bl",Le[3]|0);f(this,"Ch",Le[4]|0);f(this,"Cl",Le[5]|0);f(this,"Dh",Le[6]|0);f(this,"Dl",Le[7]|0);f(this,"Eh",Le[8]|0);f(this,"El",Le[9]|0);f(this,"Fh",Le[10]|0);f(this,"Fl",Le[11]|0);f(this,"Gh",Le[12]|0);f(this,"Gl",Le[13]|0);f(this,"Hh",Le[14]|0);f(this,"Hl",Le[15]|0);}},du=class extends Jc{constructor(){super(48);f(this,"Ah",Xe[0]|0);f(this,"Al",Xe[1]|0);f(this,"Bh",Xe[2]|0);f(this,"Bl",Xe[3]|0);f(this,"Ch",Xe[4]|0);f(this,"Cl",Xe[5]|0);f(this,"Dh",Xe[6]|0);f(this,"Dl",Xe[7]|0);f(this,"Eh",Xe[8]|0);f(this,"El",Xe[9]|0);f(this,"Fh",Xe[10]|0);f(this,"Fl",Xe[11]|0);f(this,"Gh",Xe[12]|0);f(this,"Gl",Xe[13]|0);f(this,"Hh",Xe[14]|0);f(this,"Hl",Xe[15]|0);}};var tt=ni(()=>new au,Sa(1)),Nr=ni(()=>new cu,Sa(4)),Vo=ni(()=>new lu,Sa(3)),jo=ni(()=>new du,Sa(2));var Se=(t,e,r)=>Tt(t,e,r),fu=Mi,wa=Tn,Ut=(...t)=>Nm(...t),Xo=t=>kn(t),Ia=iu,va=t=>Dm(t),t1=BigInt(0),uu=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 r1(t){if(typeof t=="bigint"){if(!e1(t))throw new RangeError("positive bigint expected, got "+t)}else fu(t);return t}function Nn(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 Ea(t){let e=r1(t).toString(16);return e.length&1?"0"+e:e}function zm(t){if(typeof t!="string")throw new TypeError("hex string expected, got "+typeof t);return t===""?t1:BigInt("0x"+t)}function Wo(t){return zm(Tn(t))}function Dn(t){return zm(Tn(n1(Tt(t)).reverse()))}function i1(t,e){if(Mi(e),e===0)throw new RangeError("zero length");t=r1(t);let r=t.toString(16);if(r.length>e*2)throw new RangeError("number too large");return kn(r.padStart(e*2,"0"))}function pu(t,e){return i1(t,e).reverse()}function n1(t){return Uint8Array.from(Se(t))}var e1=t=>typeof t=="bigint"&&t1<=t;function NS(t,e,r){return e1(t)&&e1(e)&&e1(r)&&e<=t&&t<r}function Zo(t,e,r,i){if(!NS(e,r,i))throw new RangeError("expected valid "+t+": "+r+" <= n < "+i+", got "+e)}function Yo(t){if(t<t1)throw new Error("expected non-negative bigint, got "+t);let e;for(e=0;t>t1;t>>=uu,e+=1);return e}var Ba=t=>(uu<<BigInt(t))-uu;function $m(t,e,r){if(Mi(t,"hashLen"),Mi(e,"qByteLen"),typeof r!="function")throw new TypeError("hmacFn must be a function");let i=g=>new Uint8Array(g),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=(...g)=>r(c,Ut(l,...g)),y=(g=n)=>{c=h(o,g),l=h(),g.length!==0&&(c=h(s,g),l=h());},b=()=>{if(d++>=a)throw new Error("drbg: tried max amount of iterations");let g=0,x=[];for(;g<e;){l=h();let _=l.slice();x.push(_),g+=l.length;}return Ut(...x)};return (g,x)=>{u(),y(g);let _;for(;(_=x(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 ut=BigInt(0),De=BigInt(1),Rn=BigInt(2),Wm=BigInt(3),Zm=BigInt(4),Ym=BigInt(5),DS=BigInt(7),Qm=BigInt(8),RS=BigInt(9),Jm=BigInt(16);function pr(t,e){if(e<=ut)throw new Error("mod: expected positive modulus, got "+e);let r=t%e;return r>=ut?r:e+r}function Vm(t,e){if(t===ut)throw new Error("invert: expected non-zero number");if(e<=ut)throw new Error("invert: expected positive modulus, got "+e);let r=pr(t,e),i=e,n=ut,s=De;for(;r!==ut;){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 hu(t,e,r){let i=t;if(!i.eql(i.sqr(e),r))throw new Error("Cannot find square root")}function eg(t,e){let r=t,i=(r.ORDER+De)/Zm,n=r.pow(e,i);return hu(r,n,e),n}function OS(t,e){let r=t,i=(r.ORDER-Ym)/Qm,n=r.mul(e,Rn),o=r.pow(n,i),s=r.mul(e,o),a=r.mul(r.mul(s,Rn),o),l=r.mul(s,r.sub(a,r.ONE));return hu(r,l,e),l}function MS(t){let e=Qo(t),r=tg(t),i=r(e,e.neg(e.ONE)),n=r(e,i),o=r(e,e.neg(i)),s=(t+DS)/Jm;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),A=c.eql(c.sqr(h),l);d=c.cmov(d,u,b),u=c.cmov(y,h,A);let g=c.eql(c.sqr(u),l),x=c.cmov(d,u,g);return hu(c,x,l),x})}function tg(t){if(t<Wm)throw new Error("sqrt is not defined for small field");let e=t-De,r=0;for(;e%Rn===ut;)e/=Rn,r++;let i=Rn,n=Qo(t);for(;jm(n,i)===1;)if(i++>1e3)throw new Error("Cannot find square root: probably non-prime P");if(r===1)return eg;let o=n.pow(i,e),s=(e+De)/Rn;return function(l,c){let d=l;if(d.is0(c))return c;if(jm(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 A=1,g=d.sqr(y);for(;!d.eql(g,d.ONE);)if(A++,g=d.sqr(g),A===u)throw new Error("Cannot find square root");let x=De<<BigInt(u-A-1),_=d.pow(h,x);u=A,h=d.sqr(_),y=d.mul(y,h),b=d.mul(b,_);}return b}}function FS(t){return t%Zm===Wm?eg:t%Qm===Ym?OS:t%Jm===RS?MS(t):tg(t)}var US=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function mu(t){let e={ORDER:"bigint",BYTES:"number",BITS:"number"},r=US.reduce((i,n)=>(i[n]="function",i),e);if(Dr(t,r),Nn(t.BYTES,"BYTES"),Nn(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 LS(t,e,r){let i=t;if(r<ut)throw new Error("invalid exponent, negatives unsupported");if(r===ut)return i.ONE;if(r===De)return e;let n=i.ONE,o=e;for(;r>ut;)r&De&&(n=i.mul(n,o)),o=i.sqr(o),r>>=De;return n}function s1(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 jm(t,e){let r=t,i=(r.ORDER-De)/Rn,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 HS(t,e){if(e!==void 0&&fu(e),t<=ut)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=Yo(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 Xm=new WeakMap,o1=class{constructor(e,r={}){f(this,"ORDER");f(this,"BITS");f(this,"BYTES");f(this,"isLE");f(this,"ZERO",ut);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}=HS(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 ut<=e&&e<this.ORDER}is0(e){return e===ut}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 LS(this,e,r)}div(e,r){return pr(e*Vm(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 Vm(e,this.ORDER)}sqrt(e){let r=Xm.get(this);return r||Xm.set(this,r=FS(this.ORDER)),r(this,e)}toBytes(e){return this.isLE?pu(e,this.BYTES):i1(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?Dn(e):Wo(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 s1(this,e)}cmov(e,r,i){return fr(i,"condition"),i?r:e}};Object.freeze(o1.prototype);function Qo(t,e={}){return new o1(t,e)}function rg(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=Yo(t-De);return Math.ceil(e/8)}function gu(t){let e=rg(t);return e+Math.ceil(e/2)}function ig(t,e,r=false){Se(t);let i=t.length,n=rg(e),o=Math.max(gu(e),16);if(i<o||i>1024)throw new Error("expected "+o+"-1024 bytes of input, got "+i);let s=r?Dn(t):Wo(t),a=pr(s,e-De)+De;return r?pu(a,n):i1(a,n)}var Jo=BigInt(0),On=BigInt(1);function Ta(t,e){let r=e.negate();return t?r:e}function Mn(t,e){let r=s1(t.Fp,e.map(i=>i.Z));return e.map((i,n)=>t.fromAffine(i.toAffine(r[n])))}function ag(t,e){if(!Number.isSafeInteger(t)||t<=0||t>e)throw new Error("invalid window size, expected [1.."+e+"], got W="+t)}function yu(t,e){ag(t,e);let r=Math.ceil(e/t)+1,i=2**(t-1),n=2**t,o=Ba(t),s=BigInt(t);return {windows:r,windowSize:i,mask:o,maxNumber:n,shiftBy:s}}function ng(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+=On);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 bu=new WeakMap,cg=new WeakMap;function Su(t){return cg.get(t)||1}function og(t){if(t!==Jo)throw new Error("invalid wNAF")}var es=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>Jo;)r&On&&(i=i.add(n)),n=n.double(),r>>=On;return i}precomputeWindow(e,r){let{windows:i,windowSize:n}=yu(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=yu(e,this.bits);for(let a=0;a<s.windows;a++){let{nextN:l,offset:c,isZero:d,isNeg:u,isNegF:h,offsetF:y}=ng(i,a,s);i=l,d?o=o.add(Ta(h,r[y])):n=n.add(Ta(u,r[c]));}return og(i),{p:n,f:o}}wNAFUnsafe(e,r,i,n=this.ZERO){let o=yu(e,this.bits);for(let s=0;s<o.windows&&i!==Jo;s++){let{nextN:a,offset:l,isZero:c,isNeg:d}=ng(i,s,o);if(i=a,!c){let u=r[l];n=n.add(d?u.negate():u);}}return og(i),n}getPrecomputes(e,r,i){let n=bu.get(r);return n||(n=this.precomputeWindow(r,e),e!==1&&(typeof i=="function"&&(n=i(n)),bu.set(r,n))),n}cached(e,r,i){let n=Su(e);return this.wNAF(n,this.getPrecomputes(n,e,i),r)}unsafe(e,r,i,n){let o=Su(e);return o===1?this._unsafeLadder(e,r,n):this.wNAFUnsafe(o,this.getPrecomputes(o,e,i),r,n)}createCache(e,r){ag(r,this.bits),cg.set(e,r),bu.delete(e);}hasCache(e){return Su(e)!==1}};function lg(t,e,r,i){let n=e,o=t.ZERO,s=t.ZERO;for(;r>Jo||i>Jo;)r&On&&(o=o.add(n)),i&On&&(s=s.add(n)),n=n.double(),r>>=On,i>>=On;return {p1:o,p2:s}}function sg(t,e,r){if(e){if(e.ORDER!==t)throw new Error("Field.ORDER must match order: Fp == p, Fn == n");return mu(e),e}else return Qo(t,{isLE:r})}function a1(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>Jo))throw new Error(`CURVE.${l} must be positive bigint`)}let n=sg(e.p,r.Fp,i),o=sg(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 c1(t,e){return function(i){let n=t(i);return {secretKey:n,publicKey:e(n)}}}var l1=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(jc(e),Tt(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),je(n);}update(e){return ri(this),this.iHash.update(e),this}digestInto(e){ri(this),$o(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();}},dg=(()=>{let t=((e,r,i)=>new l1(e,r).update(i).digest());return t.create=(e,r)=>new l1(e,r),t})();var ug=(t,e)=>(t+(t>=0?e:-e)/fg)/e;function KS(t,e,r){Zo("scalar",t,Rr,r);let[[i,n],[o,s]]=e,a=ug(s*t,r),l=ug(-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=Ba(Math.ceil(Yo(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 Au(t){if(!["compact","recovered","der"].includes(t))throw new Error('Signature format must be "compact", "recovered", or "der"');return t}function xu(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&&Au(r.format),r}var _u=class extends Error{constructor(e=""){super(e);}},hr={Err:_u,_tlv:{encode:(t,e)=>{let{Err:r}=hr;if(Nn(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=Ea(i);if(n.length/2&128)throw new r("tlv.encode: long form length too big");let o=i>127?Ea(n.length/2|128):"";return Ea(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(r1(t),t<Rr)throw new e("integer: negative integers are not allowed");let r=Ea(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 Wo(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),fg=BigInt(2),d1=BigInt(3),qS=BigInt(4);function Re(t,e={}){let r=a1("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=hg(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 Ut(pg(K),L)}else return Ut(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=g(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(!x(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,A=e.fromBytes===void 0?y:e.fromBytes;function g(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 x(E,v){let B=i.sqr(v),D=g(E);return i.eql(B,D)}if(!x(o.Gx,o.Gy))throw new Error("bad curve params: generator point");let _=i.mul(i.pow(o.a,d1),qS),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 KS(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=Ta(D,v),B=Ta(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(A(Se(v,void 0,"point")));return B.assertValidity(),B}static fromHex(v){return C.fromBytes(Xo(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(d1),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(!x(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,d1),{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,d1),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=>Mn(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 Mn(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}=lg(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 wa(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 es(U,e.endo?Math.ceil(F/2):F);return F>=8&&U.BASE.precompute(8),Object.freeze(U.prototype),Object.freeze(U),U}function pg(t){return Uint8Array.of(t?2:3)}function hg(t,e){return {secretKey:e.BYTES,publicKey:1+t.BYTES,publicKeyUncompressed:1+2*t.BYTES,publicKeyHasPrefix:true,signature:2*e.BYTES}}function GS(t,e={}){let{Fn:r}=t,i=e.randomBytes===void 0?va:e.randomBytes,n=Object.assign(hg(t.Fp,r),{seed:Math.max(gu(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:A,publicKeyUncompressed:g}=n;try{let x=y.length;return b===!0&&x!==A||b===!1&&x!==g?!1:!!t.fromBytes(y)}catch{return false}}function a(y){return y=y===void 0?i(n.seed):y,ig(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:A,publicKeyUncompressed:g}=n,x=r._lengths;if(!Ia(y))return;let _=Se(y,void 0,"key").length,w=_===A||_===g,I=_===b||!!x?.includes(_);if(!(w&&I))return w}function d(y,b,A=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 g=r.fromBytes(y);return t.fromBytes(b).multiply(g).toBytes(A)}let u={isValidSecretKey:o,isValidPublicKey:s,randomSecretKey:a},h=c1(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;jc(i),Dr(r,{},{hmac:"function",lowS:"boolean",randomBytes:"function",bits2int:"function",bits2int_modN:"function"}),r=Object.assign({},r);let n=r.randomBytes===void 0?va:r.randomBytes,o=r.hmac===void 0?(D,P)=>dg(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}=GS(t,r),A={prehash:true,lowS:typeof r.lowS=="boolean"?r.lowS:true,format:"compact",extraEntropy:false},g=l*fg+Hi<s.ORDER;function x(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(g)throw new Error('"recovered" sig type is not supported for cofactor >2 curves')}function I(D,P){Au(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=A.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(Xo(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(Ut(pg((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 x(this.s)}toBytes(P=A.format){if(Au(P),P==="der")return Xo(hr.hexFromSig(this));let{r:L,s:K}=this,z=a.toBytes(L),q=a.toBytes(K);return P==="recovered"?(w(),Ut(Uint8Array.of(this.assertRecovery()),z,q)):Ut(z,q)}toHex(P){return wa(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=Wo(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=Ba(c);function F(D){return Zo("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}=xu(L,A);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=Ut(...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(),nt=a.create(me.x);if(nt===Rr)return;let ye=a.create(re*a.create(ue+nt*Q));if(ye===Rr)return;let xe=(me.x===nt?0:2)|Number(me.y&Hi),Qr=ye;return K&&x(ye)&&(Qr=a.neg(ye),xe^=1),new N(nt,Qr,g?void 0:xe)}return {seed:V,k2sig:$}}function E(D,P,L={}){let{seed:K,k2sig:z}=C(D,P,L);return $m(i.outputLen,a.BYTES,o)(K,z).toBytes(L.format)}function v(D,P,L,K={}){let{lowS:z,prehash:q,format:Y}=xu(K,A);if(L=Se(L,void 0,"publicKey"),P=T(P,q),!Ia(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}=xu(L,A);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 zS={p:BigInt("0xffffffff00000001000000000000000000000000ffffffffffffffffffffffff"),n:BigInt("0xffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551"),h:BigInt(1),a:BigInt("0xffffffff00000001000000000000000000000000fffffffffffffffffffffffc"),b:BigInt("0x5ac635d8aa3a93e7b3ebbd55769886bc651d06b0cc53b0f63bce3c3e27d2604b"),Gx:BigInt("0x6b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c296"),Gy:BigInt("0x4fe342e2fe1a7f9b8ee7eb4a7c0f9e162bce33576b315ececbb6406837bf51f5")},$S={p:BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffeffffffff0000000000000000ffffffff"),n:BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffc7634d81f4372ddf581a0db248b0a77aecec196accc52973"),h:BigInt(1),a:BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffeffffffff0000000000000000fffffffc"),b:BigInt("0xb3312fa7e23ee7e4988e056be3f82d19181d9c6efe8141120314088f5013875ac656398d8a2ed19d2a85c8edd3ec2aef"),Gx:BigInt("0xaa87ca22be8b05378eb1c71ef320ad746e1d3b628ba79b9859f741e082542a385502f25dbf55296c3a545e3872760ab7"),Gy:BigInt("0x3617de4a96262c6f5d9e98bf9292dc29f8f41dbd289a147ce9da3113b5f0b8c00a60b1ce1d7e819d7a431d7c90ea0e5f")},VS={p:BigInt("0x1ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),n:BigInt("0x01fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa51868783bf2f966b7fcc0148f709a5d03bb5c9b8899c47aebb6fb71e91386409"),h:BigInt(1),a:BigInt("0x1fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc"),b:BigInt("0x0051953eb9618e1c9a1f929a21a0b68540eea2da725b99b315f3b8b489918ef109e156193951ec7e937b1652c0bd3bb1bf073573df883d2c34f1ef451fd46b503f00"),Gx:BigInt("0x00c6858e06b70404e9cd9e3ecb662395b4429c648139053fb521f828af606b4d3dbaa14b5e77efe75928fe1dc127a2ffa8de3348b3c1856a429bf97e7e31c2e5bd66"),Gy:BigInt("0x011839296a789a3bc0045c8a5fb42c7d1bd998f54449579b446817afbd17273e662c97ee72995ef42640c550b9013fad0761353c7086a272c24088be94769fd16650")};var jS=Re(zS),ot=Oe(jS,tt);var XS=Re($S),st=Oe(XS,jo);var WS=Re(VS),at=Oe(WS,Vo);var ka=Uint32Array.from([1732584193,4023233417,2562383102,271733878,3285377520]),Ki=new Uint32Array(80),Cu=class extends Pn{constructor(){super(64,20,8,false);f(this,"A",ka[0]|0);f(this,"B",ka[1]|0);f(this,"C",ka[2]|0);f(this,"D",ka[3]|0);f(this,"E",ka[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]=Xc(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=Wc(o,s,a),u=1518500249):c<40?(d=o^s^a,u=1859775393):c<60?(d=Zc(o,s,a),u=2400959708):(d=o^s^a,u=3395469782);let h=Xc(n,5)+d+l+u+Ki[c]|0;l=a,a=s,s=Xc(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(){je(Ki);}destroy(){this.destroyed=true,this.set(0,0,0,0,0),je(this.buffer);}},Fn=ni(()=>new Cu);var Un=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 mg=new Uint32Array(8),wu=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;Tt(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=mg,this.constants=s;}update(e){ri(this),Tt(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!==mg&&je(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),$o(e,this),this.finished=true;let{buffer:r,blockLen:i,counterLen:n,lengthFlag:o,view:s}=this;je(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),je(r),this.pos=0),r[l]|=o,s.setBigUint64(i-8,a,false),this.compress(s,0,this.pos!==0),je(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}},Pa=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 ZS=Le.slice();var j=new Uint32Array(32),We=new Uint32Array(32);function YS(){let t=[];for(let e=0,r=0;e<16;e++,r+=16)for(let i=1;i<16;i+=2)t.push(Pa[Un[r+i]*2+0]),t.push(Pa[Un[r+i]*2+1]),t.push(Pa[Un[r+i-1]*2+0]),t.push(Pa[Un[r+i-1]*2+1]);return new Uint32Array(t)}var u1=YS();function qi(t,e,r,i,n,o){let s=2*Un[o],a=n[s+1]^u1[o*2+1],l=n[s]^u1[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],A=j[2*i+1],g=j[2*i],x=_a(c,u,a);d=Ca(x,d,h,l)>>>0,c=(x|0)>>>0,{Dh:g,Dl:A}={Dh:g^d,Dl:A^c},{Dh:g,Dl:A}={Dh:Mm(g,A),Dl:Fm(g)},{h:b,l:y}=kt(b,y,g,A),{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]=A,j[2*i]=g;}function Gi(t,e,r,i,n,o){let s=2*Un[o],a=n[s+1]^u1[o*2+1],l=n[s]^u1[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],A=j[2*i+1],g=j[2*i],x=_a(c,u,a);d=Ca(x,d,h,l),c=x|0,{Dh:g,Dl:A}={Dh:g^d,Dl:A^c},{Dh:g,Dl:A}={Dh:dr(g,A,16),Dl:ur(g,A,16)},{h:b,l:y}=kt(b,y,g,A),{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]=A,j[2*i]=g;}var Iu=class extends wu{constructor(r,i,n,o={}){super(128,r,n,16,8,Pa,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:A,v7l:g,v7h:x}=this;return [r,i,n,o,s,a,l,c,d,u,h,y,b,A,g,x]}set(r,i,n,o,s,a,l,c,d,u,h,y,b,A,g,x){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=A|0,this.v7l=g|0,this.v7h=x|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)We[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}=nu(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,We,s++),Gi(0,4,8,12,We,s++),qi(1,5,9,13,We,s++),Gi(1,5,9,13,We,s++),qi(2,6,10,14,We,s++),Gi(2,6,10,14,We,s++),qi(3,7,11,15,We,s++),Gi(3,7,11,15,We,s++),qi(0,5,10,15,We,s++),Gi(0,5,10,15,We,s++),qi(1,6,11,12,We,s++),Gi(1,6,11,12,We,s++),qi(2,7,8,13,We,s++),Gi(2,7,8,13,We,s++),qi(3,4,9,14,We,s++),Gi(3,4,9,14,We,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],je(j,We);}};var vu=class extends Iu{constructor(e={}){super(64,ZS,1,e);}};var gg=ni(t=>new vu(t));var zi=BigInt(0),Ze=BigInt(1),Eu=BigInt(2),QS=BigInt(8);function JS(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 yg(t,e={}){let r=e,i=a1("edwards",t,r,r.FpFnLE),{Fp:n,Fn:o}=i,s=i.CURVE,{h:a}=s;Dr(r,{},{uvRatio:"function"});let l=Eu<<BigInt(o.BYTES*8)-Ze,c=g=>n.create(g),d=r.uvRatio===void 0?(g,x)=>{try{return {isValid:!0,value:n.sqrt(n.div(g,x))}}catch{return {isValid:false,value:zi}}}:r.uvRatio;if(!JS(n,s,s.Gx,s.Gy))throw new Error("bad curve params: generator point");function u(g,x,_=false){let w=_?Ze:zi;return Zo("coordinate "+g,x,w,l),x}function h(g){if(!(g instanceof y))throw new Error("EdwardsPoint expected")}let A=class A{constructor(x,_,w,I){f(this,"X");f(this,"Y");f(this,"Z");f(this,"T");this.X=u("x",x),this.Y=u("y",_),this.Z=u("z",w,true),this.T=u("t",I),Object.freeze(this);}static CURVE(){return s}static fromAffine(x){if(x instanceof A)throw new Error("extended point not allowed");let{x:_,y:w}=x||{};return u("x",_),u("y",w),new A(_,w,Ze,c(_*w))}static fromBytes(x,_=false){let w=n.BYTES,{a:I,d:N}=s;x=n1(Se(x,w,"point")),fr(_,"zip215");let H=n1(x),O=x[w-1];H[w-1]=O&-129;let U=Dn(H),F=_?l:n.ORDER;Zo("point.y",U,zi,F);let T=c(U*U),C=c(T-Ze),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&Ze)===Ze,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)),A.fromAffine({x:B,y:U})}static fromHex(x,_=false){return A.fromBytes(Xo(x),_)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}precompute(x=8,_=true){return b.createCache(this,x),_||this.multiply(Eu),this}assertValidity(){let x=this,{a:_,d:w}=s;if(x.is0())throw new Error("bad point: ZERO");let{X:I,Y:N,Z:H,T:O}=x,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(x){h(x);let{X:_,Y:w,Z:I}=this,{X:N,Y:H,Z:O}=x,U=c(_*O),F=c(N*I),T=c(w*O),C=c(H*I);return U===F&&T===C}is0(){return this.equals(A.ZERO)}negate(){return new A(c(-this.X),this.Y,this.Z,c(-this.T))}double(){let{a:x}=s,{X:_,Y:w,Z:I}=this,N=c(_*_),H=c(w*w),O=c(Eu*c(I*I)),U=c(x*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 A(B,D,L,P)}add(x){h(x);let{a:_,d:w}=s,{X:I,Y:N,Z:H,T:O}=this,{X:U,Y:F,Z:T,T:C}=x,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 A(q,Y,ee,Q)}subtract(x){return h(x),this.add(x.negate())}multiply(x){if(!o.isValidNot0(x))throw new RangeError("invalid scalar: expected 1 <= sc < curve.n");let{p:_,f:w}=b.cached(this,x,I=>Mn(A,I));return Mn(A,[_,w])[0]}multiplyUnsafe(x){if(!o.isValid(x))throw new RangeError("invalid scalar: expected 0 <= sc < curve.n");return x===zi?A.ZERO:this.is0()||x===Ze?this:b.unsafe(this,x,_=>Mn(A,_))}isSmallOrder(){return this.clearCofactor().is0()}isTorsionFree(){return b.unsafe(this,s.n).is0()}toAffine(x){let _=this,w=x,{X:I,Y:N,Z:H}=_,O=_.is0();w==null&&(w=O?QS:n.inv(H));let U=c(I*w),F=c(N*w),T=n.mul(H,w);if(O)return {x:zi,y:Ze};if(T!==Ze)throw new Error("invZ was invalid");return {x:U,y:F}}clearCofactor(){return a===Ze?this:this.multiplyUnsafe(a)}toBytes(){let{x,y:_}=this.toAffine(),w=n.toBytes(_);return w[w.length-1]|=x&Ze?128:0,w}toHex(){return wa(this.toBytes())}toString(){return `<Point ${this.is0()?"ZERO":this.toHex()}>`}};f(A,"BASE",new A(s.Gx,s.Gy,Ze,c(s.Gx*s.Gy))),f(A,"ZERO",new A(zi,Ze,Ze,zi)),f(A,"Fp",n),f(A,"Fn",o);let y=A,b=new es(y,o.BITS);return o.BITS>=8&&y.BASE.precompute(8),Object.freeze(y.prototype),Object.freeze(y),y}function bg(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&&(Nn(c,"hash.outputLen"),c!==d))throw new Error(`hash.outputLen must be ${d}, got ${c}`);let u=n.randomBytes===void 0?va: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(Dn(E))}function A(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 g(E){let{head:v,prefix:B,scalar:D}=A(E),P=s.multiply(D),L=P.toBytes();return {head:v,prefix:B,scalar:D,point:P,pointBytes:L}}function x(E){return g(E).pointBytes}function _(E=Uint8Array.of(),...v){let B=Ut(...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}=g(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=Ut(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=Dn(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 Ia(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:g,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(Ze+v,Ze-v):a.div(v-Ze,v+Ze);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:c1(U,x),getPublicKey:x,sign:w,verify:N,utils:C,Point:t,lengths:O})}var ex={p:BigInt("0x30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000001"),n:BigInt("0x060c89ce5c263405370a08b6d0302b0bab3eedb83920ee0a677297dc392126f1"),h:BigInt(8),a:BigInt("168700"),d:BigInt("168696"),Gx:BigInt("0xbb77a6ad63e739b4eacb2e09d6277c12ab8d8010534e0b62893f3f6bb957051"),Gy:BigInt("0x25797203f7a0b24925572e1cd16bf9edfce0051fb9e133774b3c257a872d7d8b")},Pt=bg(yg(ex),gg);var tx={p:BigInt("0xa9fb57dba1eea9bc3e660a909d838d726e3bf623d52620282013481d1f6e5377"),a:BigInt("0x7d5a0975fc2c3057eef67530417affe7fb8055c126dc5c6ce94a4b44f330b5d9"),b:BigInt("0x26dc5c6ce94a4b44f330b5d9bbd77cbf958416295cf7e1ce6bccdc18ff8c07b6"),n:BigInt("0xa9fb57dba1eea9bc3e660a909d838d718c397aa3b561a6f7901e0e82974856a7"),Gx:BigInt("0x8bd2aeb9cb7e57cb2c4b482ffc81b7afb9de27e1e3bd23c23a4453bd9ace3262"),Gy:BigInt("0x547ef835c3dac4fd97f8461a14611dc9c27745132ded8e545c1d54c72f046997"),h:BigInt(1)},Sg=Oe(Re(tx),tt),rx={p:BigInt("0x8cb91e82a3386d280f5d6f7e50e641df152f7109ed5456b412b1da197fb71123acd3a729901d1a71874700133107ec53"),a:BigInt("0x7bc382c63d8c150c3c72080ace05afa0c2bea28e4fb22787139165efba91f90f8aa5814a503ad4eb04a8c7dd22ce2826"),b:BigInt("0x04a8c7dd22ce28268b39b55416f0447c2fb77de107dcd2a62e880ea53eeb62d57cb4390295dbc9943ab78696fa504c11"),n:BigInt("0x8cb91e82a3386d280f5d6f7e50e641df152f7109ed5456b31f166e6cac0425a7cf3ab6af6b7fc3103b883202e9046565"),Gx:BigInt("0x1d1c64f068cf45ffa2a63a81b7c13f6b8847a3e77ef14fe3db7fcafe0cbd10e8e826e03436d646aaef87b2e247d4af1e"),Gy:BigInt("0x8abe1d7520f9c2a45cb1eb8e95cfd55262b70b29feec5864e19c054ff99129280e4646217791811142820341263c5315"),h:BigInt(1)},xg=Oe(Re(rx),jo),ix={p:BigInt("0xaadd9db8dbe9c48b3fd4e6ae33c9fc07cb308db3b3c9d20ed6639cca703308717d4d9b009bc66842aecda12ae6a380e62881ff2f2d82c68528aa6056583a48f3"),a:BigInt("0x7830a3318b603b89e2327145ac234cc594cbdd8d3df91610a83441caea9863bc2ded5d5aa8253aa10a2ef1c98b9ac8b57f1117a72bf2c7b9e7c1ac4d77fc94ca"),b:BigInt("0x3df91610a83441caea9863bc2ded5d5aa8253aa10a2ef1c98b9ac8b57f1117a72bf2c7b9e7c1ac4d77fc94cadc083e67984050b75ebae5dd2809bd638016f723"),n:BigInt("0xaadd9db8dbe9c48b3fd4e6ae33c9fc07cb308db3b3c9d20ed6639cca70330870553e5c414ca92619418661197fac10471db1d381085ddaddb58796829ca90069"),Gx:BigInt("0x81aee4bdd82ed9645a21322e9c4c6a9385ed9f70b5d916c1b43b62eef4d0098eff3b1f78e2d0d48d50d1687b93b97d5f7c6d5047406a5e688b352209bcb9f822"),Gy:BigInt("0x7dde385d566332ecc0eabfa9cf7822fdf209f70024a57b1aa000c55b881f8111b2dcde494a5f485e5bca4bd88a2763aed1ca2b2fa8f0540678cd1e0f3ad80892"),h:BigInt(1)},Ag=Oe(Re(ix),Vo);var Lr={};zh(Lr,{Any:()=>Mr,BaseBlock:()=>Pe,BaseStringBlock:()=>Oa,BitString:()=>yr,BmpString:()=>Gn,Boolean:()=>Hn,CharacterString:()=>Qn,Choice:()=>is,Constructed:()=>Me,DATE:()=>Ka,DEFAULT_MAX_CONTENT_LENGTH:()=>Rg,DEFAULT_MAX_DEPTH:()=>Ng,DEFAULT_MAX_NODES:()=>Dg,DateTime:()=>Ga,Duration:()=>za,EndOfContent:()=>Ma,Enumerated:()=>Kn,GeneralString:()=>Yn,GeneralizedTime:()=>Jn,GraphicString:()=>Zn,HexBlock:()=>Ur,IA5String:()=>Wn,Integer:()=>li,Null:()=>mr,NumericString:()=>$n,ObjectIdentifier:()=>qn,OctetString:()=>gr,Primitive:()=>ci,PrintableString:()=>Vn,RawData:()=>Pu,RelativeObjectIdentifier:()=>Ha,Repeated:()=>eo,Sequence:()=>ct,Set:()=>ft,TIME:()=>$a,TeletexString:()=>jn,TimeOfDay:()=>qa,UTCTime:()=>ji,UniversalString:()=>zn,Utf8String:()=>Ht,ValueBlock:()=>Ye,VideotexString:()=>Xn,ViewWriter:()=>rs,VisibleString:()=>Vi,compareSchema:()=>si,fromBER:()=>ui,verifySchema:()=>kx});var de=et(_g());function Ln(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 h1(...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 Tu(){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=Ln(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,Ln(o,8)-i}function Cg(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 wg(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 bt(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 m1(){if(typeof BigInt>"u")throw new Error("BigInt is not defined. Your environment doesn't implement BigInt.")}function Nu(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 rs=class{constructor(){this.items=[];}write(e){this.items.push(e);}final(){return Nu(this.items)}},Na=[new Uint8Array([1])],Ig="0123456789",ku="name",vg="valueHexView",fx="isHexOnly",px="idBlock",hx="tagClass",mx="tagNumber",gx="isConstructed",yx="fromBER",bx="toBER",Sx="local",St="",Fr=new ArrayBuffer(0),k1=new Uint8Array(0),Ra="EndOfContent",Bg="OCTET STRING",Tg="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):k1;}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=St,warnings:i=[],valueBeforeDecode:n=k1}={}){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 Ye=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'")}};Ye.NAME="valueBlock";var g1=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):k1,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=Ln(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}}};g1.NAME="identificationBlock";var y1=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=Ln(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}}};y1.NAME="lengthBlock";var X={},Pe=class extends ai{constructor({name:e=St,optional:r=false,primitiveSchema:i,...n}={},o){super(n),this.name=e,this.optional=r,i&&(this.primitiveSchema=i),this.idBlock=new g1(n),this.lenBlock=new y1(n),this.valueBlock=o?new o(n):new Ye(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 rs;r||kg(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 wg(r,i)}};Pe.NAME="BaseBlock";function kg(t){var e;if(t instanceof X.Constructed)for(let r of t.valueBlock.value)kg(r)&&(t.lenBlock.isIndefiniteForm=true);return !!(!((e=t.lenBlock)===null||e===void 0)&&e.isIndefiniteForm)}var Oa=class extends Pe{getValue(){return this.valueBlock.value}setValue(e){this.valueBlock.value=e;}constructor({value:e=St,...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}'`}};Oa.NAME="BaseStringBlock";var b1=class extends Ur(Ye){constructor({isHexOnly:e=true,...r}={}){super(r),this.isHexOnly=e;}};b1.NAME="PrimitiveValueBlock";var Pg,ci=class extends Pe{constructor(e={}){super(e,b1),this.idBlock.isConstructed=false;}};Pg=ci;X.Primitive=Pg;ci.NAME="PRIMITIVE";var Ng=100,Dg=1e4,Rg=16*1024*1024,xx="Maximum ASN.1 nesting depth exceeded",Ax="Maximum ASN.1 node count exceeded",_x="Maximum ASN.1 content length exceeded";function Va(t={}){var e,r,i;return {depth:0,maxDepth:(e=t.maxDepth)!==null&&e!==void 0?e:Ng,nodesCount:0,maxNodes:(r=t.maxNodes)!==null&&r!==void 0?r:Dg,maxContentLength:(i=t.maxContentLength)!==null&&i!==void 0?i:Rg}}function Cx(t){let e=new Pe({},Ye);return e.error=t,{offset:-1,result:e}}function wx(t){if(t.nodesCount+=1,t.nodesCount>t.maxNodes)return Ax}function Ix(t,e){if(t>e.maxContentLength)return _x}function Du(t,e,r,i){let n=i.depth+1;if(n>i.maxDepth)return Cx(xx);i.depth=n;try{return P1(t,e,r,i)}finally{i.depth-=1;}}function vx(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 P1(t,e=0,r=t.length,i=Va()){let n=e,o=new Pe({},Ye),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=wx(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=Ix(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=vx(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({},Ye);return r.error="Input buffer has zero length",{offset:-1,result:r}}return P1(de.BufferSourceConverter.toUint8Array(t).slice(),0,t.byteLength,Va(e))}function Ex(t,e){return t?1:e}var Or=class extends Ye{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??Va();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(;Ex(this.isIndefiniteForm,i)>0;){let l=Du(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===Ra)break}return this.isIndefiniteForm&&(this.value[this.value.length-1].constructor.NAME===Ra?this.value.pop():this.warnings.push("No EndOfContent block encoded")),a}toBER(e,r){let i=r||new rs;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 Og,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(`
872
+ `).map(n=>` ${n}`).join(`
873
+ `));let r=this.idBlock.tagClass===3?`[${this.idBlock.tagNumber}]`:this.constructor.NAME;return e.length?`${r} :
874
+ ${e.join(`
875
+ `)}`:`${r} :`}};Og=Me;X.Constructed=Og;Me.NAME="CONSTRUCTED";var S1=class extends Ye{fromBER(e,r,i){return r}toBER(e){return Fr}};S1.override="EndOfContentValueBlock";var Mg,Ma=class extends Pe{constructor(e={}){super(e,S1),this.idBlock.tagClass=1,this.idBlock.tagNumber=0;}};Mg=Ma;X.EndOfContent=Mg;Ma.NAME=Ra;var Fg,mr=class extends Pe{constructor(e={}){super(e,Ye),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}`}};Fg=mr;X.Null=Fg;mr.NAME="NULL";var x1=class extends Ur(Ye){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,Tu.call(this),this.blockLength=i,r+i):-1}toBER(){return this.valueHexView.slice()}toJSON(){return {...super.toJSON(),value:this.value}}};x1.NAME="BooleanValueBlock";var Ug,Hn=class extends Pe{getValue(){return this.valueBlock.value}setValue(e){this.valueBlock.value=e;}constructor(e={}){super(e,x1),this.idBlock.tagClass=1,this.idBlock.tagNumber=1;}onAsciiEncoding(){return `${this.constructor.NAME} : ${this.getValue}`}};Ug=Hn;X.Boolean=Ug;Hn.NAME="BOOLEAN";var A1=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===Ra){if(this.isIndefiniteForm)break;return this.error="EndOfContent is unexpected, OCTET STRING may consists of OCTET STRINGs only",-1}if(a!==Bg)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}}};A1.NAME="OctetStringValueBlock";var Ru,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},A1),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??Va(),l=Du(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 Ru&&e.push(r.valueBlock.valueHexView);return de.BufferSourceConverter.concat(e)}};Ru=gr;X.OctetString=Ru;gr.NAME=Bg;var _1=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===Ra){if(this.isIndefiniteForm)break;return this.error="EndOfContent is unexpected, BIT STRING may consists of BIT STRINGs only",-1}if(c!==Tg)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??Va(),d=Du(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}}};_1.NAME="BitStringValueBlock";var Lg,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},_1),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}`}}};Lg=yr;X.BitString=Lg;yr.NAME=Tg;var Hg;function Bx(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=h1(new Uint8Array([c%10]),o):o[s-u]=c%10;return r[0]>0&&(o=h1(r,o)),o}function Eg(t){if(t>=Na.length)for(let e=Na.length;e<=t;e++){let r=new Uint8Array([0]),i=Na[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=h1(r,i)),Na.push(i);}return Na[t]}function Tx(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 Fa=class extends Ur(Ye){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=Tu.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(Cg(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=Tx(Eg(i),r),s="-"):r=Bx(r,Eg(i))),i++,n>>=1;}for(let l=0;l<r.length;l++)r[l]&&(a=true),a&&(s+=Ig.charAt(r[l]));return a===false&&(s+=Ig.charAt(0)),s}};Hg=Fa;Fa.NAME="IntegerValueBlock";Object.defineProperty(Hg.prototype,"valueHex",{set:function(t){this.valueHexView=new Uint8Array(t),this.setValueHex();},get:function(){return this.valueHexView.slice().buffer}});var Da,li=class extends Pe{constructor(e={}){super(e,Fa),this.idBlock.tagClass=1,this.idBlock.tagNumber=2;}toBigInt(){return m1(),BigInt(this.valueBlock.toString())}static fromBigInt(e){m1();let r=BigInt(e),i=new rs,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 Da({valueHex:i.final()})}convertToDER(){let e=new Da({valueHex:this.valueBlock.valueHexView});return e.valueBlock.toDER(),e}convertFromDER(){return new Da({valueHex:this.valueBlock.valueHexView[0]===0?this.valueBlock.valueHexView.subarray(1):this.valueBlock.valueHexView})}onAsciiEncoding(){return `${this.constructor.NAME} : ${this.valueBlock.toString()}`}};Da=li;X.Integer=Da;li.NAME="INTEGER";var Kg,Kn=class extends li{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=10;}};Kg=Kn;X.Enumerated=Kg;Kn.NAME="ENUMERATED";var Ua=class extends Ur(Ye){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=Ln(this.valueHexView,7):(this.isHexOnly=true,this.warnings.push("Too big SID for decoding, hex only")),r+this.blockLength)}set valueBigInt(e){m1();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}}};Ua.NAME="sidBlock";var C1=class extends Ye{constructor({value:e=St,...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.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 Nu(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 Ua;if(n>Number.MAX_SAFE_INTEGER){m1();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}};C1.NAME="ObjectIdentifierValueBlock";var qg,qn=class extends Pe{getValue(){return this.valueBlock.toString()}setValue(e){this.valueBlock.fromString(e);}constructor(e={}){super(e,C1),this.idBlock.tagClass=1,this.idBlock.tagNumber=6;}onAsciiEncoding(){return `${this.constructor.NAME} : ${this.valueBlock.toString()||"empty"}`}toJSON(){return {...super.toJSON(),value:this.getValue()}}};qg=qn;X.ObjectIdentifier=qg;qn.NAME="OBJECT IDENTIFIER";var La=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=Ln(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}}};La.NAME="relativeSidBlock";var w1=class extends Ye{constructor({value:e=St,...r}={}){super(r),this.value=[],e&&this.fromString(e);}fromBER(e,r,i){let n=r;for(;i>0;){let o=new La;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 Nu(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 La;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}};w1.NAME="RelativeObjectIdentifierValueBlock";var Gg,Ha=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=13;}onAsciiEncoding(){return `${this.constructor.NAME} : ${this.valueBlock.toString()||"empty"}`}toJSON(){return {...super.toJSON(),value:this.getValue()}}};Gg=Ha;X.RelativeObjectIdentifier=Gg;Ha.NAME="RelativeObjectIdentifier";var zg,ct=class extends Me{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=16;}};zg=ct;X.Sequence=zg;ct.NAME="SEQUENCE";var $g,ft=class extends Me{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=17;}};$g=ft;X.Set=$g;ft.NAME="SET";var I1=class extends Ur(Ye){constructor({...e}={}){super(e),this.isHexOnly=true,this.value=St;}toJSON(){return {...super.toJSON(),value:this.value}}};I1.NAME="StringValueBlock";var v1=class extends I1{};v1.NAME="SimpleStringValueBlock";var pt=class extends Oa{constructor({...e}={}){super(e,v1);}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;}};pt.NAME="SIMPLE STRING";var E1=class extends pt{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;}};E1.NAME="Utf8StringValueBlock";var Vg,Ht=class extends E1{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=12;}};Vg=Ht;X.Utf8String=Vg;Ht.NAME="UTF8String";var B1=class extends pt{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));}};B1.NAME="BmpStringValueBlock";var jg,Gn=class extends B1{constructor({...e}={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=30;}};jg=Gn;X.BmpString=jg;Gn.NAME="BMPString";var T1=class extends pt{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;}};T1.NAME="UniversalStringValueBlock";var Xg,zn=class extends T1{constructor({...e}={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=28;}};Xg=zn;X.UniversalString=Xg;zn.NAME="UniversalString";var Wg,$n=class extends pt{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=18;}};Wg=$n;X.NumericString=Wg;$n.NAME="NumericString";var Zg,Vn=class extends pt{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=19;}};Zg=Vn;X.PrintableString=Zg;Vn.NAME="PrintableString";var Yg,jn=class extends pt{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=20;}};Yg=jn;X.TeletexString=Yg;jn.NAME="TeletexString";var Qg,Xn=class extends pt{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=21;}};Qg=Xn;X.VideotexString=Qg;Xn.NAME="VideotexString";var Jg,Wn=class extends pt{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=22;}};Jg=Wn;X.IA5String=Jg;Wn.NAME="IA5String";var ey,Zn=class extends pt{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=25;}};ey=Zn;X.GraphicString=ey;Zn.NAME="GraphicString";var ty,Vi=class extends pt{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=26;}};ty=Vi;X.VisibleString=ty;Vi.NAME="VisibleString";var ry,Yn=class extends pt{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=27;}};ry=Yn;X.GeneralString=ry;Yn.NAME="GeneralString";var iy,Qn=class extends pt{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=29;}};iy=Qn;X.CharacterString=iy;Qn.NAME="CharacterString";var ny,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]=bt(this.year<2e3?this.year-1900:this.year-2e3,2),r[1]=bt(this.month,2),r[2]=bt(this.day,2),r[3]=bt(this.hour,2),r[4]=bt(this.minute,2),r[5]=bt(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}}};ny=ji;X.UTCTime=ny;ji.NAME="UTCTime";var oy,Jn=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(bt(this.year,4)),r.push(bt(this.month,2)),r.push(bt(this.day,2)),r.push(bt(this.hour,2)),r.push(bt(this.minute,2)),r.push(bt(this.second,2)),this.millisecond!==0&&(r.push("."),r.push(bt(this.millisecond,3))),r.push("Z"),r.join("")}return super.toString(e)}toJSON(){return {...super.toJSON(),millisecond:this.millisecond}}};oy=Jn;X.GeneralizedTime=oy;Jn.NAME="GeneralizedTime";var sy,Ka=class extends Ht{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=31;}};sy=Ka;X.DATE=sy;Ka.NAME="DATE";var ay,qa=class extends Ht{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=32;}};ay=qa;X.TimeOfDay=ay;qa.NAME="TimeOfDay";var cy,Ga=class extends Ht{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=33;}};cy=Ga;X.DateTime=cy;Ga.NAME="DateTime";var ly,za=class extends Ht{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=34;}};ly=za;X.Duration=ly;za.NAME="Duration";var dy,$a=class extends Ht{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=14;}};dy=$a;X.TIME=dy;$a.NAME="TIME";var Mr=class{constructor({name:e=St,optional:r=false}={}){this.name=e,this.optional=r;}},is=class extends Mr{constructor({value:e=[],...r}={}){super(r),this.value=e;}},eo=class extends Mr{constructor({value:e=new Mr,local:r=false,...i}={}){super(i),this.value=e,this.local=r;}},Pu=class{get data(){return this.dataView.slice().buffer}set data(e){this.dataView=de.BufferSourceConverter.toUint8Array(e);}constructor({data:e=k1}={}){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 is){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(ku)&&(o.name=r.name),o}}if(r instanceof Mr)return r.hasOwnProperty(ku)&&(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(!(px in r))return {verified:false,result:{error:"Wrong ASN.1 schema"}};if(!(yx in r.idBlock))return {verified:false,result:{error:"Wrong ASN.1 schema"}};if(!(bx 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(hx)===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(mx)===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(gx)===false)return {verified:false,result:{error:"Wrong ASN.1 schema"}};if(r.idBlock.isConstructed!==e.idBlock.isConstructed)return {verified:false,result:t};if(!(fx 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(!(vg 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,St),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 eo&&(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,St),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,St),r.name&&(delete t[r.name],c.name=r.name)),c}}else if(r.valueBlock.value[0]instanceof eo){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,St),r.name&&delete t[r.name]),s;if(ku in r.valueBlock.value[0]&&r.valueBlock.value[0].name.length>0){let c={};Sx 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,St),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,St),r.name&&(delete t[r.name],l.name=r.name)),l}return {verified:true,result:t}}if(r.primitiveSchema&&vg in e.valueBlock){let o=P1(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,St),r.name&&(delete t[r.name],s.name=r.name)),s}return si(t,o.result,r.primitiveSchema)}return {verified:true,result:t}}function kx(t,e){if(!(e instanceof Object))return {verified:false,result:{error:"Wrong ASN.1 schema type"}};let r=P1(de.BufferSourceConverter.toUint8Array(t));return r.offset===-1?{verified:false,result:r.result}:si(r.result,r.result,e)}var Px="[object ArrayBuffer]",Nx="[object SharedArrayBuffer]";function uy(t){return Object.prototype.toString.call(t)}function Dx(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"&&N1(e.buffer)}function Ou(t){return uy(t)===Px}function fy(t){return typeof SharedArrayBuffer<"u"&&uy(t)===Nx}function N1(t){return Ou(t)||fy(t)}function py(t){return Dx(t)}function fi(t){return N1(t)||py(t)}function Mu(t){if(!fi(t))throw new TypeError("Expected ArrayBuffer, SharedArrayBuffer, or ArrayBufferView")}function Kt(t){return Mu(t),N1(t)?new Uint8Array(t):new Uint8Array(t.buffer,t.byteOffset,t.byteLength)}function He(t){if(Mu(t),Ou(t))return t;let e=new ArrayBuffer(t.byteLength);return new Uint8Array(e).set(Kt(t)),e}function Fu(t,e,r={}){let i=Kt(t),n=Kt(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=He(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=He(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=He(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=He(e.valueBlock.valueHex),this}toASN(){return new gr({valueHex:this.buffer})}toSchema(e){return new gr({name:e})}};var Mx={fromASN:t=>t instanceof mr?null:He(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}},Fx={fromASN:t=>t.valueBlock.valueHexView.byteLength>=4?t.valueBlock.toString():t.valueBlock.valueDec,toASN:t=>new li({value:+t})},Ux={fromASN:t=>t.valueBlock.valueDec,toASN:t=>new Kn({value:t})},fe={fromASN:t=>He(t.valueBlock.valueHexView),toASN:t=>new li({valueHex:t})};var Lx={fromASN:t=>He(t.valueBlock.valueHexView),toASN:t=>new yr({valueHex:t})},Hx={fromASN:t=>t.valueBlock.toString(),toASN:t=>new qn({value:t})},Kx={fromASN:t=>t.valueBlock.value,toASN:t=>new Hn({value:t})},ns={fromASN:t=>He(t.valueBlock.valueHexView),toASN:t=>new gr({valueHex:t})},hy={fromASN:t=>new oe(t.getValue()),toASN:t=>t.toASN()};function qt(t){return {fromASN:e=>e.valueBlock.value,toASN:e=>new t({value:e})}}var qx=qt(Ht),Gx=qt(Gn),zx=qt(zn),$x=qt($n),Vx=qt(Vn),jx=qt(jn),Xx=qt(Xn),Wx=qt(Wn),Zx=qt(Zn),Yx=qt(Vi),Qx=qt(Yn),Jx=qt(Qn),eA={fromASN:t=>t.toDate(),toASN:t=>new ji({valueDate:t})},tA={fromASN:t=>t.toDate(),toASN:t=>new Jn({valueDate:t})},rA={fromASN:()=>null,toASN:()=>new mr};function Xi(t){switch(t){case S.Any:return Mx;case S.BitString:return Lx;case S.BmpString:return Gx;case S.Boolean:return Kx;case S.CharacterString:return Jx;case S.Enumerated:return Ux;case S.GeneralString:return Qx;case S.GeneralizedTime:return tA;case S.GraphicString:return Zx;case S.IA5String:return Wx;case S.Integer:return Fx;case S.Null:return rA;case S.NumericString:return $x;case S.ObjectIdentifier:return Hx;case S.OctetString:return ns;case S.PrintableString:return Vx;case S.TeletexString:return jx;case S.UTCTime:return eA;case S.UniversalString:return zx;case S.Utf8String:return qx;case S.VideotexString:return Xx;case S.VisibleString:return Yx;default:return null}}function Gt(t){return typeof t=="function"&&t.prototype?t.prototype.toASN&&t.prototype.fromASN?true:Gt(t.prototype):!!(t&&typeof t=="object"&&"toASN"in t&&"fromASN"in t)}function Lu(t){if(t){let e=Object.getPrototypeOf(t);return e?.prototype?.constructor===Array?true:Lu(e)}return false}function my(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 D1=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 Gt(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"?ft:ct;l=new d({name:"",value:[new eo({name:a,value:l})]});}if(s.context!==null&&s.context!==void 0)if(s.implicit)if(typeof s.type=="number"||Gt(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 ct({value:n,name:""});case k.Set:return new ft({value:n,name:""});case k.Choice:return new is({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 D1;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 m=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 os=class{static parse(e,r,i){let n=ui(He(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(Gt(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 Lu(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 ct;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"||Gt(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??(Gt(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"?ct:ft,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(Gt(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 ct;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 ft;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 ss=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"&&Gt(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"&&my(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"||Gt(a.type))){let d={};d.valueHex=c instanceof mr?He(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 ct({value:n});break;case k.Set:o=new ft({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"?ct:ft;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"?ct:ft;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 zt=class t{static serialize(e){return ss.serialize(e)}static parse(e,r,i){return os.parse(e,r,i)}static toString(e,r){let i=fi(e)?He(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 as={};zh(as,{decode:()=>Ku,encode:()=>Hu,format:()=>xy,formats:()=>Ay,hex:()=>hA,is:()=>by,normalize:()=>ja,parse:()=>Sy});var nA=/^[0-9a-f]$/i,oA=[" "," ",`
876
+ `,"\r",":","-","."];function sA(t){return t.separators==="none"?[]:!t.separators||t.separators==="common"?oA:t.separators}function aA(t){if(!t)throw new TypeError("Hex separators must be non-empty strings")}function cA(t,e,r){for(let i of r)if(t.startsWith(i,e))return i}function lA(t){let e=/[A-F]/.test(t),r=/[a-f]/.test(t);return e&&!r?"upper":"lower"}function dA(t){let e=/\r\n|\n/.exec(t);if(e)return e[0]===`\r
877
+ `?`\r
878
+ `:`
879
+ `}function gy(t){return t.replace(/[^0-9a-f]/gi,"")}function uA(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 fA(t){let e=t.trim(),r=/^0x/i.test(e)?"0x":"",i=r?e.slice(2):e,n=dA(i),o=i.split(/\r\n|\n/).filter(c=>c.length>0),s=o[0]?.trim()??"",a=uA(s),l={case:lA(e),prefix:r};if(a&&(l.group=a),n&&o.length>1){let c=gy(o[0]??"").length/2;c>0&&o.slice(0,-1).every(d=>gy(d).length/2===c)&&(l.line={bytesPerLine:c,separator:n});}return l}function pA(t,e){let r=e.allowPrefix??true,i=[...sA(e)].sort((a,l)=>l.length-a.length);for(let a of i)aA(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(nA.test(l)){o+=l,s=false,a+=1;continue}let c=cA(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 yy(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 ja(t,e={}){return pA(t,e)}function by(t,e={}){if(typeof t!="string")return false;try{return ja(t,e),!0}catch{return false}}function Hu(t,e={}){let r=Kt(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??`
880
+ `,l=[];for(let c=0;c<n.length;c+=s)l.push(yy(n.slice(c,c+s),e.group));o=l.join(a);}else o=yy(n,e.group);return `${e.prefix??""}${o}`}function Ku(t,e={}){let r=ja(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 Sy(t,e={}){let r=ja(t,e);return {bytes:Ku(r),format:fA(t),normalized:r}}function xy(t,e){return Hu(t,e)}var Ay={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"})},hA={encode:Hu,decode:Ku,format:xy,formats:Ay,is:by,normalize:ja,parse:Sy};var Xa=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(as.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 qu,Gu,zu,$t=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([m({type:S.TeletexString})],$t.prototype,"teletexString",void 0);p([m({type:S.PrintableString})],$t.prototype,"printableString",void 0);p([m({type:S.UniversalString})],$t.prototype,"universalString",void 0);p([m({type:S.Utf8String})],$t.prototype,"utf8String",void 0);p([m({type:S.BmpString})],$t.prototype,"bmpString",void 0);$t=p([M({type:k.Choice})],$t);var cs=class extends $t{constructor(r={}){super(r);f(this,"ia5String");f(this,"anyValue");Object.assign(this,r);}toString(){return this.ia5String||(this.anyValue?as.encode(this.anyValue):super.toString())}};p([m({type:S.IA5String})],cs.prototype,"ia5String",void 0);p([m({type:S.Any})],cs.prototype,"anyValue",void 0);cs=p([M({type:k.Choice})],cs);var Wa=class{constructor(e={}){f(this,"type","");f(this,"value",new cs);Object.assign(this,e);}};p([m({type:S.ObjectIdentifier})],Wa.prototype,"type",void 0);p([m({type:cs})],Wa.prototype,"value",void 0);var Za=qu=class extends te{constructor(e){super(e),Object.setPrototypeOf(this,qu.prototype);}};Za=qu=p([M({type:k.Set,itemType:Wa})],Za);var $u=Gu=class extends te{constructor(e){super(e),Object.setPrototypeOf(this,Gu.prototype);}};$u=Gu=p([M({type:k.Sequence,itemType:Za})],$u);var ht=zu=class extends $u{constructor(e){super(e),Object.setPrototypeOf(this,zu.prototype);}};ht=zu=p([M({type:k.Sequence})],ht);var SA={fromASN:t=>Xa.toString(ns.fromASN(t)),toASN:t=>ns.toASN(Xa.fromString(t))},Ya=class{constructor(e={}){f(this,"typeId","");f(this,"value",new ArrayBuffer(0));Object.assign(this,e);}};p([m({type:S.ObjectIdentifier})],Ya.prototype,"typeId",void 0);p([m({type:S.Any,context:0})],Ya.prototype,"value",void 0);var Qa=class{constructor(e={}){f(this,"nameAssigner");f(this,"partyName",new $t);Object.assign(this,e);}};p([m({type:$t,optional:true,context:0,implicit:true})],Qa.prototype,"nameAssigner",void 0);p([m({type:$t,context:1,implicit:true})],Qa.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([m({type:Ya,context:0,implicit:true})],ce.prototype,"otherName",void 0);p([m({type:S.IA5String,context:1,implicit:true})],ce.prototype,"rfc822Name",void 0);p([m({type:S.IA5String,context:2,implicit:true})],ce.prototype,"dNSName",void 0);p([m({type:S.Any,context:3,implicit:true})],ce.prototype,"x400Address",void 0);p([m({type:ht,context:4,implicit:false})],ce.prototype,"directoryName",void 0);p([m({type:Qa,context:5})],ce.prototype,"ediPartyName",void 0);p([m({type:S.IA5String,context:6,implicit:true})],ce.prototype,"uniformResourceIdentifier",void 0);p([m({type:S.OctetString,context:7,implicit:true,converter:SA})],ce.prototype,"iPAddress",void 0);p([m({type:S.ObjectIdentifier,context:8,implicit:true})],ce.prototype,"registeredID",void 0);ce=p([M({type:k.Choice})],ce);var Vu,ro=class{constructor(e={}){f(this,"accessMethod","");f(this,"accessLocation",new ce);Object.assign(this,e);}};p([m({type:S.ObjectIdentifier})],ro.prototype,"accessMethod",void 0);p([m({type:ce})],ro.prototype,"accessLocation",void 0);var Cy=Vu=class extends te{constructor(e){super(e),Object.setPrototypeOf(this,Vu.prototype);}};Cy=Vu=p([M({type:k.Sequence,itemType:ro})],Cy);var Ja=class extends oe{},ls=class{constructor(e={}){f(this,"keyIdentifier");f(this,"authorityCertIssuer");f(this,"authorityCertSerialNumber");e&&Object.assign(this,e);}};p([m({type:Ja,context:0,optional:true,implicit:true})],ls.prototype,"keyIdentifier",void 0);p([m({type:ce,context:1,optional:true,implicit:true,repeated:"sequence"})],ls.prototype,"authorityCertIssuer",void 0);p([m({type:S.Integer,context:2,optional:true,implicit:true,converter:fe})],ls.prototype,"authorityCertSerialNumber",void 0);var O1=class{constructor(e={}){f(this,"cA",false);f(this,"pathLenConstraint");Object.assign(this,e);}};p([m({type:S.Boolean,defaultValue:false})],O1.prototype,"cA",void 0);p([m({type:S.Integer,optional:true})],O1.prototype,"pathLenConstraint",void 0);var ju,Ke=ju=class extends te{constructor(e){super(e),Object.setPrototypeOf(this,ju.prototype);}};Ke=ju=p([M({type:k.Sequence,itemType:ce})],Ke);var Xu,wy=Xu=class extends Ke{constructor(e){super(e),Object.setPrototypeOf(this,Xu.prototype);}};wy=Xu=p([M({type:k.Sequence})],wy);var Wu,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([m({type:S.IA5String})],hi.prototype,"ia5String",void 0);p([m({type:S.VisibleString})],hi.prototype,"visibleString",void 0);p([m({type:S.BmpString})],hi.prototype,"bmpString",void 0);p([m({type:S.Utf8String})],hi.prototype,"utf8String",void 0);hi=p([M({type:k.Choice})],hi);var e0=class{constructor(e={}){f(this,"organization",new hi);f(this,"noticeNumbers",[]);Object.assign(this,e);}};p([m({type:hi})],e0.prototype,"organization",void 0);p([m({type:S.Integer,repeated:"sequence"})],e0.prototype,"noticeNumbers",void 0);var t0=class{constructor(e={}){f(this,"noticeRef");f(this,"explicitText");Object.assign(this,e);}};p([m({type:e0,optional:true})],t0.prototype,"noticeRef",void 0);p([m({type:hi,optional:true})],t0.prototype,"explicitText",void 0);var M1=class{constructor(e={}){f(this,"cPSuri");f(this,"userNotice");Object.assign(this,e);}};p([m({type:S.IA5String})],M1.prototype,"cPSuri",void 0);p([m({type:t0})],M1.prototype,"userNotice",void 0);M1=p([M({type:k.Choice})],M1);var r0=class{constructor(e={}){f(this,"policyQualifierId","");f(this,"qualifier",new ArrayBuffer(0));Object.assign(this,e);}};p([m({type:S.ObjectIdentifier})],r0.prototype,"policyQualifierId",void 0);p([m({type:S.Any})],r0.prototype,"qualifier",void 0);var i0=class{constructor(e={}){f(this,"policyIdentifier","");f(this,"policyQualifiers");Object.assign(this,e);}};p([m({type:S.ObjectIdentifier})],i0.prototype,"policyIdentifier",void 0);p([m({type:r0,repeated:"sequence",optional:true})],i0.prototype,"policyQualifiers",void 0);var Iy=Wu=class extends te{constructor(e){super(e),Object.setPrototypeOf(this,Wu.prototype);}};Iy=Wu=p([M({type:k.Sequence,itemType:i0})],Iy);var n0=class{constructor(e=0){f(this,"value");this.value=e;}};p([m({type:S.Integer})],n0.prototype,"value",void 0);n0=p([M({type:k.Choice})],n0);var vy=class extends n0{};vy=p([M({type:k.Choice})],vy);var Zu,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 o0=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(", ")}]`}},io=class{constructor(e={}){f(this,"fullName");f(this,"nameRelativeToCRLIssuer");Object.assign(this,e);}};p([m({type:ce,context:0,repeated:"sequence",implicit:true})],io.prototype,"fullName",void 0);p([m({type:Za,context:1,implicit:true})],io.prototype,"nameRelativeToCRLIssuer",void 0);io=p([M({type:k.Choice})],io);var Qi=class{constructor(e={}){f(this,"distributionPoint");f(this,"reasons");f(this,"cRLIssuer");Object.assign(this,e);}};p([m({type:io,context:0,optional:true})],Qi.prototype,"distributionPoint",void 0);p([m({type:o0,context:1,optional:true,implicit:true})],Qi.prototype,"reasons",void 0);p([m({type:ce,context:2,optional:true,repeated:"sequence",implicit:true})],Qi.prototype,"cRLIssuer",void 0);var F1=Zu=class extends te{constructor(e){super(e),Object.setPrototypeOf(this,Zu.prototype);}};F1=Zu=p([M({type:k.Sequence,itemType:Qi})],F1);var Yu,Ey=Yu=class extends F1{constructor(e){super(e),Object.setPrototypeOf(this,Yu.prototype);}};Ey=Yu=p([M({type:k.Sequence,itemType:Qi})],Ey);var no=class no{constructor(e={}){f(this,"distributionPoint");f(this,"onlyContainsUserCerts",no.ONLY);f(this,"onlyContainsCACerts",no.ONLY);f(this,"onlySomeReasons");f(this,"indirectCRL",no.ONLY);f(this,"onlyContainsAttributeCerts",no.ONLY);Object.assign(this,e);}};f(no,"ONLY",false);var Vt=no;p([m({type:io,context:0,optional:true})],Vt.prototype,"distributionPoint",void 0);p([m({type:S.Boolean,context:1,defaultValue:Vt.ONLY,implicit:true})],Vt.prototype,"onlyContainsUserCerts",void 0);p([m({type:S.Boolean,context:2,defaultValue:Vt.ONLY,implicit:true})],Vt.prototype,"onlyContainsCACerts",void 0);p([m({type:o0,context:3,optional:true,implicit:true})],Vt.prototype,"onlySomeReasons",void 0);p([m({type:S.Boolean,context:4,defaultValue:Vt.ONLY,implicit:true})],Vt.prototype,"indirectCRL",void 0);p([m({type:S.Boolean,context:5,defaultValue:Vt.ONLY,implicit:true})],Vt.prototype,"onlyContainsAttributeCerts",void 0);var s0;(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";})(s0||(s0={}));var Qu=class{constructor(e=s0.unspecified){f(this,"reason",s0.unspecified);this.reason=e;}toJSON(){return s0[this.reason]}toString(){return this.toJSON()}};p([m({type:S.Enumerated})],Qu.prototype,"reason",void 0);Qu=p([M({type:k.Choice})],Qu);var Ju,By=Ju=class extends te{constructor(e){super(e),Object.setPrototypeOf(this,Ju.prototype);}};By=Ju=p([M({type:k.Sequence,itemType:S.ObjectIdentifier})],By);var ef=class{constructor(e=new ArrayBuffer(0)){f(this,"value");this.value=e;}};p([m({type:S.Integer,converter:fe})],ef.prototype,"value",void 0);ef=p([M({type:k.Choice})],ef);var tf=class{constructor(e){f(this,"value",new Date);e&&(this.value=e);}};p([m({type:S.GeneralizedTime})],tf.prototype,"value",void 0);tf=p([M({type:k.Choice})],tf);var rf,Ty=rf=class extends Ke{constructor(e){super(e),Object.setPrototypeOf(this,rf.prototype);}};Ty=rf=p([M({type:k.Sequence})],Ty);var ky;(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";})(ky||(ky={}));var nf,ds=class{constructor(e={}){f(this,"base",new ce);f(this,"minimum",0);f(this,"maximum");Object.assign(this,e);}};p([m({type:ce})],ds.prototype,"base",void 0);p([m({type:S.Integer,context:0,defaultValue:0,implicit:true})],ds.prototype,"minimum",void 0);p([m({type:S.Integer,context:1,optional:true,implicit:true})],ds.prototype,"maximum",void 0);var U1=nf=class extends te{constructor(e){super(e),Object.setPrototypeOf(this,nf.prototype);}};U1=nf=p([M({type:k.Sequence,itemType:ds})],U1);var L1=class{constructor(e={}){f(this,"permittedSubtrees");f(this,"excludedSubtrees");Object.assign(this,e);}};p([m({type:U1,context:0,optional:true,implicit:true})],L1.prototype,"permittedSubtrees",void 0);p([m({type:U1,context:1,optional:true,implicit:true})],L1.prototype,"excludedSubtrees",void 0);var H1=class{constructor(e={}){f(this,"requireExplicitPolicy");f(this,"inhibitPolicyMapping");Object.assign(this,e);}};p([m({type:S.Integer,context:0,implicit:true,optional:true,converter:fe})],H1.prototype,"requireExplicitPolicy",void 0);p([m({type:S.Integer,context:1,implicit:true,optional:true,converter:fe})],H1.prototype,"inhibitPolicyMapping",void 0);var of,a0=class{constructor(e={}){f(this,"issuerDomainPolicy","");f(this,"subjectDomainPolicy","");Object.assign(this,e);}};p([m({type:S.ObjectIdentifier})],a0.prototype,"issuerDomainPolicy",void 0);p([m({type:S.ObjectIdentifier})],a0.prototype,"subjectDomainPolicy",void 0);var Py=of=class extends te{constructor(e){super(e),Object.setPrototypeOf(this,of.prototype);}};Py=of=p([M({type:k.Sequence,itemType:a0})],Py);var sf,Ny=sf=class extends Ke{constructor(e){super(e),Object.setPrototypeOf(this,sf.prototype);}};Ny=sf=p([M({type:k.Sequence})],Ny);var Hr=class{constructor(e={}){f(this,"type","");f(this,"values",[]);Object.assign(this,e);}};p([m({type:S.ObjectIdentifier})],Hr.prototype,"type",void 0);p([m({type:S.Any,repeated:"set"})],Hr.prototype,"values",void 0);var af,Dy=af=class extends te{constructor(e){super(e),Object.setPrototypeOf(this,af.prototype);}};Dy=af=p([M({type:k.Sequence,itemType:Hr})],Dy);var Sr=class extends Ja{};var c0=class{constructor(e={}){f(this,"notBefore");f(this,"notAfter");Object.assign(this,e);}};p([m({type:S.GeneralizedTime,context:0,implicit:true,optional:true})],c0.prototype,"notBefore",void 0);p([m({type:S.GeneralizedTime,context:1,implicit:true,optional:true})],c0.prototype,"notAfter",void 0);var l0;(function(t){t[t.keyUpdateAllowed=1]="keyUpdateAllowed",t[t.newExtensions=2]="newExtensions",t[t.pKIXCertificate=4]="pKIXCertificate";})(l0||(l0={}));var K1=class extends pi{toJSON(){let e=[],r=this.toNumber();return r&l0.pKIXCertificate&&e.push("pKIXCertificate"),r&l0.newExtensions&&e.push("newExtensions"),r&l0.keyUpdateAllowed&&e.push("keyUpdateAllowed"),e}toString(){return `[${this.toJSON().join(", ")}]`}},q1=class{constructor(e={}){f(this,"entrustVers","");f(this,"entrustInfoFlags",new K1);Object.assign(this,e);}};p([m({type:S.GeneralString})],q1.prototype,"entrustVers",void 0);p([m({type:K1})],q1.prototype,"entrustInfoFlags",void 0);var cf,Ry=cf=class extends te{constructor(e){super(e),Object.setPrototypeOf(this,cf.prototype);}};Ry=cf=p([M({type:k.Sequence,itemType:ro})],Ry);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&&Fu(e.parameters,this.parameters)||e.parameters===this.parameters)}};p([m({type:S.ObjectIdentifier})],W.prototype,"algorithm",void 0);p([m({type:S.Any,optional:true})],W.prototype,"parameters",void 0);var oo=class{constructor(e={}){f(this,"algorithm",new W);f(this,"subjectPublicKey",new ArrayBuffer(0));Object.assign(this,e);}};p([m({type:W})],oo.prototype,"algorithm",void 0);p([m({type:S.BitString})],oo.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([m({type:S.UTCTime})],Ue.prototype,"utcTime",void 0);p([m({type:S.GeneralizedTime})],Ue.prototype,"generalTime",void 0);Ue=p([M({type:k.Choice})],Ue);var so=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([m({type:Ue})],so.prototype,"notBefore",void 0);p([m({type:Ue})],so.prototype,"notAfter",void 0);var lf,G1=class G1{constructor(e={}){f(this,"extnID","");f(this,"critical",G1.CRITICAL);f(this,"extnValue",new oe);Object.assign(this,e);}};f(G1,"CRITICAL",false);var Kr=G1;p([m({type:S.ObjectIdentifier})],Kr.prototype,"extnID",void 0);p([m({type:S.Boolean,defaultValue:Kr.CRITICAL})],Kr.prototype,"critical",void 0);p([m({type:oe})],Kr.prototype,"extnValue",void 0);var us=lf=class extends te{constructor(e){super(e),Object.setPrototypeOf(this,lf.prototype);}};us=lf=p([M({type:k.Sequence,itemType:Kr})],us);var d0;(function(t){t[t.v1=0]="v1",t[t.v2=1]="v2",t[t.v3=2]="v3";})(d0||(d0={}));var mt=class{constructor(e={}){f(this,"version",d0.v1);f(this,"serialNumber",new ArrayBuffer(0));f(this,"signature",new W);f(this,"issuer",new ht);f(this,"validity",new so);f(this,"subject",new ht);f(this,"subjectPublicKeyInfo",new oo);f(this,"issuerUniqueID");f(this,"subjectUniqueID");f(this,"extensions");Object.assign(this,e);}};p([m({type:S.Integer,context:0,defaultValue:d0.v1})],mt.prototype,"version",void 0);p([m({type:S.Integer,converter:fe})],mt.prototype,"serialNumber",void 0);p([m({type:W})],mt.prototype,"signature",void 0);p([m({type:ht})],mt.prototype,"issuer",void 0);p([m({type:so})],mt.prototype,"validity",void 0);p([m({type:ht})],mt.prototype,"subject",void 0);p([m({type:oo})],mt.prototype,"subjectPublicKeyInfo",void 0);p([m({type:S.BitString,context:1,implicit:true,optional:true})],mt.prototype,"issuerUniqueID",void 0);p([m({type:S.BitString,context:2,implicit:true,optional:true})],mt.prototype,"subjectUniqueID",void 0);p([m({type:us,context:3,optional:true})],mt.prototype,"extensions",void 0);var Nt=class{constructor(e={}){f(this,"tbsCertificate",new mt);f(this,"tbsCertificateRaw");f(this,"signatureAlgorithm",new W);f(this,"signatureValue",new ArrayBuffer(0));Object.assign(this,e);}};p([m({type:mt,raw:true})],Nt.prototype,"tbsCertificate",void 0);p([m({type:W})],Nt.prototype,"signatureAlgorithm",void 0);p([m({type:S.BitString})],Nt.prototype,"signatureValue",void 0);var fs=class{constructor(e={}){f(this,"userCertificate",new ArrayBuffer(0));f(this,"revocationDate",new Ue);f(this,"crlEntryExtensions");Object.assign(this,e);}};p([m({type:S.Integer,converter:fe})],fs.prototype,"userCertificate",void 0);p([m({type:Ue})],fs.prototype,"revocationDate",void 0);p([m({type:Kr,optional:true,repeated:"sequence"})],fs.prototype,"crlEntryExtensions",void 0);var jt=class{constructor(e={}){f(this,"version");f(this,"signature",new W);f(this,"issuer",new ht);f(this,"thisUpdate",new Ue);f(this,"nextUpdate");f(this,"revokedCertificates");f(this,"crlExtensions");Object.assign(this,e);}};p([m({type:S.Integer,optional:true})],jt.prototype,"version",void 0);p([m({type:W})],jt.prototype,"signature",void 0);p([m({type:ht})],jt.prototype,"issuer",void 0);p([m({type:Ue})],jt.prototype,"thisUpdate",void 0);p([m({type:Ue,optional:true})],jt.prototype,"nextUpdate",void 0);p([m({type:fs,repeated:"sequence",optional:true})],jt.prototype,"revokedCertificates",void 0);p([m({type:Kr,optional:true,context:0,repeated:"sequence"})],jt.prototype,"crlExtensions",void 0);var u0=class{constructor(e={}){f(this,"tbsCertList",new jt);f(this,"tbsCertListRaw");f(this,"signatureAlgorithm",new W);f(this,"signature",new ArrayBuffer(0));Object.assign(this,e);}};p([m({type:jt,raw:true})],u0.prototype,"tbsCertList",void 0);p([m({type:W})],u0.prototype,"signatureAlgorithm",void 0);p([m({type:S.BitString})],u0.prototype,"signature",void 0);var f0=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 p0=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 df(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 Oy=[BigInt("0x10dc6e9c006ea38b04b1e03b4bd9490c0d03f98929ca1d7fb56821fd19d3b6e7"),BigInt("0x0c28145b6a44df3e0149b3d0a30b3bb599df9756d4dd9b84a86b38cfb45a740b"),BigInt("0x00544b8338791518b2c7645a50392798b21f75bb60e3596170067d00141cac15"),BigInt("0x222c01175718386f2e2e82eb122789e352e105a3b8fa852613bc534433ee428b")],My=[[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")]],Fy=[[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 _A=new f0(BigInt("21888242871839275222246405745257275088548364400416034343698204186575808495617")),uf=null;function Xt(){return uf||(uf=new p0(df(4,5,8,56,Oy,My,Fy),_A)),uf}Xt().primeField;Xt().permute.bind(Xt());var Uy;(function(t){t[t.ABSORB=0]="ABSORB",t[t.SQUEEZE=1]="SQUEEZE";})(Uy||(Uy={}));var CA=Xt().primeField,wA=Xt().permute.bind(Xt()),xr;(function(t){t[t.ABSORB=0]="ABSORB",t[t.SQUEEZE=1]="SQUEEZE";})(xr||(xr={}));var ff=class t{constructor(e=0n){this.rate=Xt().getT()-1,this.t=Xt().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]=CA.add(this.state[e],this.cache[e]);return this.state=wA(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 ff.hashFixedLength(t))[0]}Xt().primeField;et(j1(),1);et(j1(),1);var o3="1.2.840.10045.4.1",s3="1.2.840.10045.4.3.1",a3="1.2.840.10045.4.3.2",c3="1.2.840.10045.4.3.3",l3="1.2.840.10045.4.3.4";function m0(t){return new W({algorithm:t})}m0(o3);m0(s3);m0(a3);m0(c3);m0(l3);var g0=class{constructor(e={}){f(this,"fieldType");f(this,"parameters");Object.assign(this,e);}};p([m({type:S.ObjectIdentifier})],g0.prototype,"fieldType",void 0);p([m({type:S.Any})],g0.prototype,"parameters",void 0);g0=p([M({type:k.Sequence})],g0);var Cf=class extends oe{};var ys=class{constructor(e={}){f(this,"a");f(this,"b");f(this,"seed");Object.assign(this,e);}};p([m({type:S.OctetString})],ys.prototype,"a",void 0);p([m({type:S.OctetString})],ys.prototype,"b",void 0);p([m({type:S.BitString,optional:true})],ys.prototype,"seed",void 0);ys=p([M({type:k.Sequence})],ys);var wf;(function(t){t[t.ecpVer1=1]="ecpVer1";})(wf||(wf={}));var zr=class{constructor(e={}){f(this,"version",wf.ecpVer1);f(this,"fieldID");f(this,"curve");f(this,"base");f(this,"order");f(this,"cofactor");Object.assign(this,e);}};p([m({type:S.Integer})],zr.prototype,"version",void 0);p([m({type:g0})],zr.prototype,"fieldID",void 0);p([m({type:ys})],zr.prototype,"curve",void 0);p([m({type:Cf})],zr.prototype,"base",void 0);p([m({type:S.Integer,converter:fe})],zr.prototype,"order",void 0);p([m({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([m({type:S.ObjectIdentifier})],en.prototype,"namedCurve",void 0);p([m({type:S.Null})],en.prototype,"implicitCurve",void 0);p([m({type:zr})],en.prototype,"specifiedCurve",void 0);en=p([M({type:k.Choice})],en);var bs=class{constructor(e={}){f(this,"version",1);f(this,"privateKey",new oe);f(this,"parameters");f(this,"publicKey");Object.assign(this,e);}};p([m({type:S.Integer})],bs.prototype,"version",void 0);p([m({type:oe})],bs.prototype,"privateKey",void 0);p([m({type:en,context:0,optional:true})],bs.prototype,"parameters",void 0);p([m({type:S.BitString,context:1,optional:true})],bs.prototype,"publicKey",void 0);var X1=class{constructor(e={}){f(this,"r",new ArrayBuffer(0));f(this,"s",new ArrayBuffer(0));Object.assign(this,e);}};p([m({type:S.Integer,converter:fe})],X1.prototype,"r",void 0);p([m({type:S.Integer,converter:fe})],X1.prototype,"s",void 0);var At="1.2.840.113549.1.1",d3=`${At}.1`,u3=`${At}.7`,f3=`${At}.9`,p3=`${At}.10`,h3=`${At}.2`,m3=`${At}.4`,g3=`${At}.5`;var y3=`${At}.12`,b3=`${At}.13`,If=`${At}.15`,vf=`${At}.16`,S3="1.3.14.3.2.26",x3="2.16.840.1.101.3.4.2.4",A3="2.16.840.1.101.3.4.2.1",_3="2.16.840.1.101.3.4.2.2",C3="2.16.840.1.101.3.4.2.3",w3="2.16.840.1.101.3.4.2.5",I3="2.16.840.1.101.3.4.2.6",v3="1.2.840.113549.2.2",E3="1.2.840.113549.2.5",Ss=`${At}.8`;function qe(t){return new W({algorithm:t,parameters:null})}qe(v3);qe(E3);var gi=qe(S3);qe(x3);qe(A3);qe(_3);qe(C3);qe(w3);qe(I3);var W1=new W({algorithm:Ss,parameters:zt.serialize(gi)}),Ef=new W({algorithm:f3,parameters:zt.serialize(ns.toASN(new Uint8Array([218,57,163,238,94,107,75,13,50,85,191,239,149,96,24,144,175,216,7,9]).buffer))});qe(d3);qe(h3);qe(m3);qe(g3);qe(If);qe(vf);qe(y3);qe(b3);qe(If);qe(vf);var xs=class{constructor(e={}){f(this,"hashAlgorithm",new W(gi));f(this,"maskGenAlgorithm",new W({algorithm:Ss,parameters:zt.serialize(gi)}));f(this,"pSourceAlgorithm",new W(Ef));Object.assign(this,e);}};p([m({type:W,context:0,defaultValue:gi})],xs.prototype,"hashAlgorithm",void 0);p([m({type:W,context:1,defaultValue:W1})],xs.prototype,"maskGenAlgorithm",void 0);p([m({type:W,context:2,defaultValue:Ef})],xs.prototype,"pSourceAlgorithm",void 0);new W({algorithm:u3,parameters:zt.serialize(new xs)});var tn=class{constructor(e={}){f(this,"hashAlgorithm",new W(gi));f(this,"maskGenAlgorithm",new W({algorithm:Ss,parameters:zt.serialize(gi)}));f(this,"saltLength",20);f(this,"trailerField",1);Object.assign(this,e);}};p([m({type:W,context:0,defaultValue:gi})],tn.prototype,"hashAlgorithm",void 0);p([m({type:W,context:1,defaultValue:W1})],tn.prototype,"maskGenAlgorithm",void 0);p([m({type:S.Integer,context:2,defaultValue:20})],tn.prototype,"saltLength",void 0);p([m({type:S.Integer,context:3,defaultValue:1})],tn.prototype,"trailerField",void 0);new W({algorithm:p3,parameters:zt.serialize(new tn)});var Z1=class{constructor(e={}){f(this,"digestAlgorithm",new W);f(this,"digest",new oe);Object.assign(this,e);}};p([m({type:W})],Z1.prototype,"digestAlgorithm",void 0);p([m({type:oe})],Z1.prototype,"digest",void 0);var Bf,As=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([m({type:S.Integer,converter:fe})],As.prototype,"prime",void 0);p([m({type:S.Integer,converter:fe})],As.prototype,"exponent",void 0);p([m({type:S.Integer,converter:fe})],As.prototype,"coefficient",void 0);var Y1=Bf=class extends te{constructor(e){super(e),Object.setPrototypeOf(this,Bf.prototype);}};Y1=Bf=p([M({type:k.Sequence,itemType:As})],Y1);var Zt=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([m({type:S.Integer})],Zt.prototype,"version",void 0);p([m({type:S.Integer,converter:fe})],Zt.prototype,"modulus",void 0);p([m({type:S.Integer,converter:fe})],Zt.prototype,"publicExponent",void 0);p([m({type:S.Integer,converter:fe})],Zt.prototype,"privateExponent",void 0);p([m({type:S.Integer,converter:fe})],Zt.prototype,"prime1",void 0);p([m({type:S.Integer,converter:fe})],Zt.prototype,"prime2",void 0);p([m({type:S.Integer,converter:fe})],Zt.prototype,"exponent1",void 0);p([m({type:S.Integer,converter:fe})],Zt.prototype,"exponent2",void 0);p([m({type:S.Integer,converter:fe})],Zt.prototype,"coefficient",void 0);p([m({type:Y1,optional:true})],Zt.prototype,"otherPrimeInfos",void 0);var y0=class{constructor(e={}){f(this,"modulus",new ArrayBuffer(0));f(this,"publicExponent",new ArrayBuffer(0));Object.assign(this,e);}};p([m({type:S.Integer,converter:fe})],y0.prototype,"modulus",void 0);p([m({type:S.Integer,converter:fe})],y0.prototype,"publicExponent",void 0);var Ar=class{constructor(e={}){f(this,"issuer",new ht);f(this,"serialNumber",new ArrayBuffer(0));Object.assign(this,e);}};p([m({type:ht})],Ar.prototype,"issuer",void 0);p([m({type:S.Integer,converter:fe})],Ar.prototype,"serialNumber",void 0);var lo=class{constructor(e={}){f(this,"subjectKeyIdentifier");f(this,"issuerAndSerialNumber");Object.assign(this,e);}};p([m({type:Sr,context:0,implicit:true})],lo.prototype,"subjectKeyIdentifier",void 0);p([m({type:Ar})],lo.prototype,"issuerAndSerialNumber",void 0);lo=p([M({type:k.Choice})],lo);var lt;(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";})(lt||(lt={}));var dt=class extends W{};dt=p([M({type:k.Sequence})],dt);var b0=class extends W{};b0=p([M({type:k.Sequence})],b0);var _t=class extends W{};_t=p([M({type:k.Sequence})],_t);var S0=class extends W{};S0=p([M({type:k.Sequence})],S0);var B3=class extends W{};B3=p([M({type:k.Sequence})],B3);var Q1=class extends W{};Q1=p([M({type:k.Sequence})],Q1);var gt=class{constructor(e={}){f(this,"attrType","");f(this,"attrValues",[]);Object.assign(this,e);}};p([m({type:S.ObjectIdentifier})],gt.prototype,"attrType",void 0);p([m({type:S.Any,repeated:"set"})],gt.prototype,"attrValues",void 0);var Tf,Yt=class{constructor(e={}){f(this,"version",lt.v0);f(this,"sid",new lo);f(this,"digestAlgorithm",new dt);f(this,"signedAttrs");f(this,"signedAttrsRaw");f(this,"signatureAlgorithm",new b0);f(this,"signature",new oe);f(this,"unsignedAttrs");Object.assign(this,e);}};p([m({type:S.Integer})],Yt.prototype,"version",void 0);p([m({type:lo})],Yt.prototype,"sid",void 0);p([m({type:dt})],Yt.prototype,"digestAlgorithm",void 0);p([m({type:gt,repeated:"set",context:0,implicit:true,optional:true,raw:true})],Yt.prototype,"signedAttrs",void 0);p([m({type:b0})],Yt.prototype,"signatureAlgorithm",void 0);p([m({type:oe})],Yt.prototype,"signature",void 0);p([m({type:gt,repeated:"set",context:1,implicit:true,optional:true})],Yt.prototype,"unsignedAttrs",void 0);var x0=Tf=class extends te{constructor(e){super(e),Object.setPrototypeOf(this,Tf.prototype);}};x0=Tf=p([M({type:k.Set,itemType:Yt})],x0);var T3=class extends Yt{};T3=p([M({type:k.Sequence})],T3);var k3=class extends Ue{};k3=p([M({type:k.Choice})],k3);var A0=class{constructor(e={}){f(this,"acIssuer",new ce);f(this,"acSerial",0);f(this,"attrs",[]);Object.assign(this,e);}};p([m({type:ce})],A0.prototype,"acIssuer",void 0);p([m({type:S.Integer})],A0.prototype,"acSerial",void 0);p([m({type:Hr,repeated:"sequence"})],A0.prototype,"attrs",void 0);var kf,_0=kf=class extends te{constructor(e){super(e),Object.setPrototypeOf(this,kf.prototype);}};_0=kf=p([M({type:k.Sequence,itemType:S.ObjectIdentifier})],_0);var _s=class{constructor(e={}){f(this,"pathLenConstraint");f(this,"permittedAttrs");f(this,"excludedAttrs");f(this,"permitUnSpecified",true);Object.assign(this,e);}};p([m({type:S.Integer,optional:true})],_s.prototype,"pathLenConstraint",void 0);p([m({type:_0,implicit:true,context:0,optional:true})],_s.prototype,"permittedAttrs",void 0);p([m({type:_0,implicit:true,context:1,optional:true})],_s.prototype,"excludedAttrs",void 0);p([m({type:S.Boolean,defaultValue:true})],_s.prototype,"permitUnSpecified",void 0);var Qt=class{constructor(e={}){f(this,"issuer",new Ke);f(this,"serial",new ArrayBuffer(0));f(this,"issuerUID",new ArrayBuffer(0));Object.assign(this,e);}};p([m({type:Ke})],Qt.prototype,"issuer",void 0);p([m({type:S.Integer,converter:fe})],Qt.prototype,"serial",void 0);p([m({type:S.BitString,optional:true})],Qt.prototype,"issuerUID",void 0);var Pf;(function(t){t[t.publicKey=0]="publicKey",t[t.publicKeyCert=1]="publicKeyCert",t[t.otherObjectTypes=2]="otherObjectTypes";})(Pf||(Pf={}));var Jt=class{constructor(e={}){f(this,"digestedObjectType",Pf.publicKey);f(this,"otherObjectTypeID");f(this,"digestAlgorithm",new W);f(this,"objectDigest",new ArrayBuffer(0));Object.assign(this,e);}};p([m({type:S.Enumerated})],Jt.prototype,"digestedObjectType",void 0);p([m({type:S.ObjectIdentifier,optional:true})],Jt.prototype,"otherObjectTypeID",void 0);p([m({type:W})],Jt.prototype,"digestAlgorithm",void 0);p([m({type:S.BitString})],Jt.prototype,"objectDigest",void 0);var uo=class{constructor(e={}){f(this,"issuerName");f(this,"baseCertificateID");f(this,"objectDigestInfo");Object.assign(this,e);}};p([m({type:Ke,optional:true})],uo.prototype,"issuerName",void 0);p([m({type:Qt,context:0,implicit:true,optional:true})],uo.prototype,"baseCertificateID",void 0);p([m({type:Jt,context:1,implicit:true,optional:true})],uo.prototype,"objectDigestInfo",void 0);var fo=class{constructor(e={}){f(this,"v1Form");f(this,"v2Form");Object.assign(this,e);}};p([m({type:ce,repeated:"sequence"})],fo.prototype,"v1Form",void 0);p([m({type:uo,context:0,implicit:true})],fo.prototype,"v2Form",void 0);fo=p([M({type:k.Choice})],fo);var po=class{constructor(e={}){f(this,"notBeforeTime",new Date);f(this,"notAfterTime",new Date);Object.assign(this,e);}};p([m({type:S.GeneralizedTime})],po.prototype,"notBeforeTime",void 0);p([m({type:S.GeneralizedTime})],po.prototype,"notAfterTime",void 0);var rn=class{constructor(e={}){f(this,"baseCertificateID");f(this,"entityName");f(this,"objectDigestInfo");Object.assign(this,e);}};p([m({type:Qt,implicit:true,context:0,optional:true})],rn.prototype,"baseCertificateID",void 0);p([m({type:Ke,implicit:true,context:1,optional:true})],rn.prototype,"entityName",void 0);p([m({type:Jt,implicit:true,context:2,optional:true})],rn.prototype,"objectDigestInfo",void 0);var Nf;(function(t){t[t.v2=1]="v2";})(Nf||(Nf={}));var Ct=class{constructor(e={}){f(this,"version",Nf.v2);f(this,"holder",new rn);f(this,"issuer",new fo);f(this,"signature",new W);f(this,"serialNumber",new ArrayBuffer(0));f(this,"attrCertValidityPeriod",new po);f(this,"attributes",[]);f(this,"issuerUniqueID");f(this,"extensions");Object.assign(this,e);}};p([m({type:S.Integer})],Ct.prototype,"version",void 0);p([m({type:rn})],Ct.prototype,"holder",void 0);p([m({type:fo})],Ct.prototype,"issuer",void 0);p([m({type:W})],Ct.prototype,"signature",void 0);p([m({type:S.Integer,converter:fe})],Ct.prototype,"serialNumber",void 0);p([m({type:po})],Ct.prototype,"attrCertValidityPeriod",void 0);p([m({type:Hr,repeated:"sequence"})],Ct.prototype,"attributes",void 0);p([m({type:S.BitString,optional:true})],Ct.prototype,"issuerUniqueID",void 0);p([m({type:us,optional:true})],Ct.prototype,"extensions",void 0);var ho=class{constructor(e={}){f(this,"acinfo",new Ct);f(this,"signatureAlgorithm",new W);f(this,"signatureValue",new ArrayBuffer(0));Object.assign(this,e);}};p([m({type:Ct})],ho.prototype,"acinfo",void 0);p([m({type:W})],ho.prototype,"signatureAlgorithm",void 0);p([m({type:S.BitString})],ho.prototype,"signatureValue",void 0);var C0;(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";})(C0||(C0={}));var Cs=class extends pi{};var ws=class{constructor(e={}){f(this,"type","");f(this,"value",new ArrayBuffer(0));Object.assign(this,e);}};p([m({type:S.ObjectIdentifier,implicit:true,context:0})],ws.prototype,"type",void 0);p([m({type:S.Any,implicit:true,context:1})],ws.prototype,"value",void 0);var w0=class{constructor(e={}){f(this,"policyId","");f(this,"classList",new Cs(C0.unclassified));f(this,"securityCategories");Object.assign(this,e);}};p([m({type:S.ObjectIdentifier})],w0.prototype,"policyId",void 0);p([m({type:Cs,defaultValue:new Cs(C0.unclassified)})],w0.prototype,"classList",void 0);p([m({type:ws,repeated:"set"})],w0.prototype,"securityCategories",void 0);var Is=class{constructor(e={}){f(this,"cotets");f(this,"oid");f(this,"string");Object.assign(this,e);}};p([m({type:oe})],Is.prototype,"cotets",void 0);p([m({type:S.ObjectIdentifier})],Is.prototype,"oid",void 0);p([m({type:S.Utf8String})],Is.prototype,"string",void 0);var J1=class{constructor(e={}){f(this,"policyAuthority");f(this,"values",[]);Object.assign(this,e);}};p([m({type:Ke,implicit:true,context:0,optional:true})],J1.prototype,"policyAuthority",void 0);p([m({type:Is,repeated:"sequence"})],J1.prototype,"values",void 0);var Df,vs=class{constructor(e={}){f(this,"targetCertificate",new Qt);f(this,"targetName");f(this,"certDigestInfo");Object.assign(this,e);}};p([m({type:Qt})],vs.prototype,"targetCertificate",void 0);p([m({type:ce,optional:true})],vs.prototype,"targetName",void 0);p([m({type:Jt,optional:true})],vs.prototype,"certDigestInfo",void 0);var Es=class{constructor(e={}){f(this,"targetName");f(this,"targetGroup");f(this,"targetCert");Object.assign(this,e);}};p([m({type:ce,context:0,implicit:true})],Es.prototype,"targetName",void 0);p([m({type:ce,context:1,implicit:true})],Es.prototype,"targetGroup",void 0);p([m({type:vs,context:2,implicit:true})],Es.prototype,"targetCert",void 0);Es=p([M({type:k.Choice})],Es);var el=Df=class extends te{constructor(e){super(e),Object.setPrototypeOf(this,Df.prototype);}};el=Df=p([M({type:k.Sequence,itemType:Es})],el);var Rf,P3=Rf=class extends te{constructor(e){super(e),Object.setPrototypeOf(this,Rf.prototype);}};P3=Rf=p([M({type:k.Sequence,itemType:el})],P3);var tl=class{constructor(e={}){f(this,"roleAuthority");f(this,"roleName");Object.assign(this,e);}};p([m({type:Ke,implicit:true,context:0,optional:true})],tl.prototype,"roleAuthority",void 0);p([m({type:ce,implicit:true,context:1})],tl.prototype,"roleName",void 0);var v0=class{constructor(e={}){f(this,"service",new ce);f(this,"ident",new ce);f(this,"authInfo");Object.assign(this,e);}};p([m({type:ce})],v0.prototype,"service",void 0);p([m({type:ce})],v0.prototype,"ident",void 0);p([m({type:oe,optional:true})],v0.prototype,"authInfo",void 0);var Of,E0=class{constructor(e={}){f(this,"otherCertFormat","");f(this,"otherCert",new ArrayBuffer(0));Object.assign(this,e);}};p([m({type:S.ObjectIdentifier})],E0.prototype,"otherCertFormat",void 0);p([m({type:S.Any})],E0.prototype,"otherCert",void 0);var Bs=class{constructor(e={}){f(this,"certificate");f(this,"v2AttrCert");f(this,"other");Object.assign(this,e);}};p([m({type:Nt})],Bs.prototype,"certificate",void 0);p([m({type:ho,context:2,implicit:true})],Bs.prototype,"v2AttrCert",void 0);p([m({type:E0,context:3,implicit:true})],Bs.prototype,"other",void 0);Bs=p([M({type:k.Choice})],Bs);var Ts=Of=class extends te{constructor(e){super(e),Object.setPrototypeOf(this,Of.prototype);}};Ts=Of=p([M({type:k.Set,itemType:Bs})],Ts);var B0=class{constructor(e={}){f(this,"contentType","");f(this,"content",new ArrayBuffer(0));Object.assign(this,e);}};p([m({type:S.ObjectIdentifier})],B0.prototype,"contentType",void 0);p([m({type:S.Any,context:0})],B0.prototype,"content",void 0);var T0=class{constructor(e={}){f(this,"single");f(this,"any");Object.assign(this,e);}};p([m({type:oe})],T0.prototype,"single",void 0);p([m({type:S.Any})],T0.prototype,"any",void 0);T0=p([M({type:k.Choice})],T0);var mo=class{constructor(e={}){f(this,"eContentType","");f(this,"eContent");Object.assign(this,e);}};p([m({type:S.ObjectIdentifier})],mo.prototype,"eContentType",void 0);p([m({type:T0,context:0,optional:true})],mo.prototype,"eContent",void 0);var k0=class{constructor(e={}){f(this,"value");f(this,"constructedValue");Object.assign(this,e);}};p([m({type:oe,context:0,implicit:true,optional:true})],k0.prototype,"value",void 0);p([m({type:oe,converter:hy,context:0,implicit:true,optional:true,repeated:"sequence"})],k0.prototype,"constructedValue",void 0);k0=p([M({type:k.Choice})],k0);var nn=class{constructor(e={}){f(this,"contentType","");f(this,"contentEncryptionAlgorithm",new S0);f(this,"encryptedContent");Object.assign(this,e);}};p([m({type:S.ObjectIdentifier})],nn.prototype,"contentType",void 0);p([m({type:S0})],nn.prototype,"contentEncryptionAlgorithm",void 0);p([m({type:k0,optional:true})],nn.prototype,"encryptedContent",void 0);var on=class{constructor(e={}){f(this,"keyAttrId","");f(this,"keyAttr");Object.assign(this,e);}};p([m({type:S.ObjectIdentifier})],on.prototype,"keyAttrId",void 0);p([m({type:S.Any,optional:true})],on.prototype,"keyAttr",void 0);var Mf,ks=class{constructor(e={}){f(this,"subjectKeyIdentifier",new Sr);f(this,"date");f(this,"other");Object.assign(this,e);}};p([m({type:Sr})],ks.prototype,"subjectKeyIdentifier",void 0);p([m({type:S.GeneralizedTime,optional:true})],ks.prototype,"date",void 0);p([m({type:on,optional:true})],ks.prototype,"other",void 0);var Ps=class{constructor(e={}){f(this,"rKeyId");f(this,"issuerAndSerialNumber");Object.assign(this,e);}};p([m({type:ks,context:0,implicit:true,optional:true})],Ps.prototype,"rKeyId",void 0);p([m({type:Ar,optional:true})],Ps.prototype,"issuerAndSerialNumber",void 0);Ps=p([M({type:k.Choice})],Ps);var P0=class{constructor(e={}){f(this,"rid",new Ps);f(this,"encryptedKey",new oe);Object.assign(this,e);}};p([m({type:Ps})],P0.prototype,"rid",void 0);p([m({type:oe})],P0.prototype,"encryptedKey",void 0);var rl=Mf=class extends te{constructor(e){super(e),Object.setPrototypeOf(this,Mf.prototype);}};rl=Mf=p([M({type:k.Sequence,itemType:P0})],rl);var N0=class{constructor(e={}){f(this,"algorithm",new W);f(this,"publicKey",new ArrayBuffer(0));Object.assign(this,e);}};p([m({type:W})],N0.prototype,"algorithm",void 0);p([m({type:S.BitString})],N0.prototype,"publicKey",void 0);var go=class{constructor(e={}){f(this,"subjectKeyIdentifier");f(this,"originatorKey");f(this,"issuerAndSerialNumber");Object.assign(this,e);}};p([m({type:Sr,context:0,implicit:true,optional:true})],go.prototype,"subjectKeyIdentifier",void 0);p([m({type:N0,context:1,implicit:true,optional:true})],go.prototype,"originatorKey",void 0);p([m({type:Ar,optional:true})],go.prototype,"issuerAndSerialNumber",void 0);go=p([M({type:k.Choice})],go);var yi=class{constructor(e={}){f(this,"version",lt.v3);f(this,"originator",new go);f(this,"ukm");f(this,"keyEncryptionAlgorithm",new _t);f(this,"recipientEncryptedKeys",new rl);Object.assign(this,e);}};p([m({type:S.Integer})],yi.prototype,"version",void 0);p([m({type:go,context:0})],yi.prototype,"originator",void 0);p([m({type:oe,context:1,optional:true})],yi.prototype,"ukm",void 0);p([m({type:_t})],yi.prototype,"keyEncryptionAlgorithm",void 0);p([m({type:rl})],yi.prototype,"recipientEncryptedKeys",void 0);var Ns=class{constructor(e={}){f(this,"subjectKeyIdentifier");f(this,"issuerAndSerialNumber");Object.assign(this,e);}};p([m({type:Sr,context:0,implicit:true})],Ns.prototype,"subjectKeyIdentifier",void 0);p([m({type:Ar})],Ns.prototype,"issuerAndSerialNumber",void 0);Ns=p([M({type:k.Choice})],Ns);var sn=class{constructor(e={}){f(this,"version",lt.v0);f(this,"rid",new Ns);f(this,"keyEncryptionAlgorithm",new _t);f(this,"encryptedKey",new oe);Object.assign(this,e);}};p([m({type:S.Integer})],sn.prototype,"version",void 0);p([m({type:Ns})],sn.prototype,"rid",void 0);p([m({type:_t})],sn.prototype,"keyEncryptionAlgorithm",void 0);p([m({type:oe})],sn.prototype,"encryptedKey",void 0);var yo=class{constructor(e={}){f(this,"keyIdentifier",new oe);f(this,"date");f(this,"other");Object.assign(this,e);}};p([m({type:oe})],yo.prototype,"keyIdentifier",void 0);p([m({type:S.GeneralizedTime,optional:true})],yo.prototype,"date",void 0);p([m({type:on,optional:true})],yo.prototype,"other",void 0);var an=class{constructor(e={}){f(this,"version",lt.v4);f(this,"kekid",new yo);f(this,"keyEncryptionAlgorithm",new _t);f(this,"encryptedKey",new oe);Object.assign(this,e);}};p([m({type:S.Integer})],an.prototype,"version",void 0);p([m({type:yo})],an.prototype,"kekid",void 0);p([m({type:_t})],an.prototype,"keyEncryptionAlgorithm",void 0);p([m({type:oe})],an.prototype,"encryptedKey",void 0);var cn=class{constructor(e={}){f(this,"version",lt.v0);f(this,"keyDerivationAlgorithm");f(this,"keyEncryptionAlgorithm",new _t);f(this,"encryptedKey",new oe);Object.assign(this,e);}};p([m({type:S.Integer})],cn.prototype,"version",void 0);p([m({type:Q1,context:0,optional:true})],cn.prototype,"keyDerivationAlgorithm",void 0);p([m({type:_t})],cn.prototype,"keyEncryptionAlgorithm",void 0);p([m({type:oe})],cn.prototype,"encryptedKey",void 0);var D0=class{constructor(e={}){f(this,"oriType","");f(this,"oriValue",new ArrayBuffer(0));Object.assign(this,e);}};p([m({type:S.ObjectIdentifier})],D0.prototype,"oriType",void 0);p([m({type:S.Any})],D0.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([m({type:sn,optional:true})],bi.prototype,"ktri",void 0);p([m({type:yi,context:1,implicit:true,optional:true})],bi.prototype,"kari",void 0);p([m({type:an,context:2,implicit:true,optional:true})],bi.prototype,"kekri",void 0);p([m({type:cn,context:3,implicit:true,optional:true})],bi.prototype,"pwri",void 0);p([m({type:D0,context:4,implicit:true,optional:true})],bi.prototype,"ori",void 0);bi=p([M({type:k.Choice})],bi);var Ff,R0=Ff=class extends te{constructor(e){super(e),Object.setPrototypeOf(this,Ff.prototype);}};R0=Ff=p([M({type:k.Set,itemType:bi})],R0);var Uf,Ds=class{constructor(e={}){f(this,"otherRevInfoFormat","");f(this,"otherRevInfo",new ArrayBuffer(0));Object.assign(this,e);}};p([m({type:S.ObjectIdentifier})],Ds.prototype,"otherRevInfoFormat",void 0);p([m({type:S.Any})],Ds.prototype,"otherRevInfo",void 0);var il=class{constructor(e={}){f(this,"other",new Ds);Object.assign(this,e);}};p([m({type:Ds,context:1,implicit:true})],il.prototype,"other",void 0);il=p([M({type:k.Choice})],il);var Rs=Uf=class extends te{constructor(e){super(e),Object.setPrototypeOf(this,Uf.prototype);}};Rs=Uf=p([M({type:k.Set,itemType:il})],Rs);var Os=class{constructor(e={}){f(this,"certs");f(this,"crls");Object.assign(this,e);}};p([m({type:Ts,context:0,implicit:true,optional:true})],Os.prototype,"certs",void 0);p([m({type:Rs,context:1,implicit:true,optional:true})],Os.prototype,"crls",void 0);var Lf,Hf=Lf=class extends te{constructor(e){super(e),Object.setPrototypeOf(this,Lf.prototype);}};Hf=Lf=p([M({type:k.Set,itemType:gt})],Hf);var bo=class{constructor(e={}){f(this,"version",lt.v0);f(this,"originatorInfo");f(this,"recipientInfos",new R0);f(this,"encryptedContentInfo",new nn);f(this,"unprotectedAttrs");Object.assign(this,e);}};p([m({type:S.Integer})],bo.prototype,"version",void 0);p([m({type:Os,context:0,implicit:true,optional:true})],bo.prototype,"originatorInfo",void 0);p([m({type:R0})],bo.prototype,"recipientInfos",void 0);p([m({type:nn})],bo.prototype,"encryptedContentInfo",void 0);p([m({type:Hf,context:1,implicit:true,optional:true})],bo.prototype,"unprotectedAttrs",void 0);var Kf,nl=Kf=class extends te{constructor(e){super(e),Object.setPrototypeOf(this,Kf.prototype);}};nl=Kf=p([M({type:k.Set,itemType:dt})],nl);var Si=class{constructor(e={}){f(this,"version",lt.v0);f(this,"digestAlgorithms",new nl);f(this,"encapContentInfo",new mo);f(this,"certificates");f(this,"crls");f(this,"signerInfos",new x0);Object.assign(this,e);}};p([m({type:S.Integer})],Si.prototype,"version",void 0);p([m({type:nl})],Si.prototype,"digestAlgorithms",void 0);p([m({type:mo})],Si.prototype,"encapContentInfo",void 0);p([m({type:Ts,context:0,implicit:true,optional:true})],Si.prototype,"certificates",void 0);p([m({type:Rs,context:1,implicit:true,optional:true})],Si.prototype,"crls",void 0);p([m({type:x0})],Si.prototype,"signerInfos",void 0);var l_=Pt.Point.Fp;l_.ORDER;var d_=Pt.Point.CURVE().n,u_=8n,f_=d_/u_,Ms=Qo(f_,{BITS:249});Pt.Point.Fp;var ln={x:5299619240641551281634865583518297030282874472190772894086521144482721001553n,y:16950150798460657717958625567821834550301663161624707787222815936182638968203n};Pt.Point.fromAffine(ln);Pt.Point.fromAffine(ln);new TextEncoder().encode("FROST_2_NONCE_COMBINER");var q3=Object.defineProperty,b_=Object.getOwnPropertyDescriptor,S_=(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')}),G3=(t,e)=>()=>(t&&(e=t(t=0)),e),x_=(t,e)=>{for(var r in e)q3(t,r,{get:e[r],enumerable:true});},wt=(t,e,r,i)=>{for(var n=i>1?void 0:i?b_(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&&q3(e,r,n),n},xi,O0,pl=G3(()=>{xi={"P-192":{a:0xfffffffffffffffffffffffffffffffefffffffffffffffcn,b:0x64210519e59c80e70fa7e9ab72243049feb8deecc146b9b1n,n:0xffffffffffffffffffffffff99def836146bc9b1b4d22831n,p:0xfffffffffffffffffffffffffffffffeffffffffffffffffn},"P-224":{a:0xfffffffffffffffffffffffffffffffefffffffffffffffffffffffen,b:0xb4050a850c04b3abf54132565044b0b7d7bfd8ba270b39432355ffb4n,n:0xffffffffffffffffffffffffffff16a2e0b8f03e13dd29455c5c2a3dn,p:0xffffffffffffffffffffffffffffffff000000000000000000000001n},"P-256":{a:ot.Point.CURVE().a,b:ot.Point.CURVE().b,n:ot.Point.CURVE().n,p:ot.Point.CURVE().p},"P-384":{a:st.Point.CURVE().a,b:st.Point.CURVE().b,n:st.Point.CURVE().n,p:st.Point.CURVE().p},"P-521":{a:at.Point.CURVE().a,b:at.Point.CURVE().b,n:at.Point.CURVE().n,p:at.Point.CURVE().p}},O0={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}};}),N_={};x_(N_,{verifyDscSignature:()=>q_,verifyDscSignatureWithTbs:()=>G_,verifyECDSASignature:()=>Wf,verifyRSASignature:()=>Zf});function z3(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 D_(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 Wf(t,e,r){let i=V3[r.curve];if(!i)return false;try{let n=Math.ceil(r.key_size/8),o=D_(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 Zf(t,e,r,i,n,o){try{if(j3.includes(n)){let s=O_();if(s)return await M_(t,r,i,n,o,s)}return F_(e,r,i,n,o)}catch{return false}}function R_(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 O_(){return typeof globalThis<"u"&&globalThis.crypto?.subtle?globalThis.crypto.subtle:typeof globalThis<"u"&&globalThis.crypto?.webcrypto?.subtle?globalThis.crypto.webcrypto.subtle:null}async function M_(t,e,r,i,n,o){let s=new Uint8Array(Buffer.from(r.modulus.replace("0x",""),"hex")),a=R_(r.exponent),l={kty:"RSA",n:D3(s),e:D3(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:$3(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 D3(t){return Buffer.from(t).toString("base64").replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function $3(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 F_(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=U_(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?H_(d,t,i,r.key_size):L_(d,t,i)}catch{return false}}function U_(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 L_(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<W3||i>=t.length||t[i]!==0)return false;i++;let n=t.slice(i),o=X3[r];if(R3(n,e,o))return true;let s=Z3[r];return !!R3(n,e,s)}function R3(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 H_(t,e,r,i){let n=hl[r],o=$3(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=K_(u,c,n),b=new Uint8Array(c);for(let N=0;N<c;N++)b[N]=d[N]^y[N];b[0]&=h;let A=-1;for(let N=0;N<c;N++)if(b[N]===1){A=N;break}else if(b[N]!==0)return false;if(A===-1)return false;let g=c-A-1;if(g<0)return false;let x=b.slice(A+1),_=new Uint8Array(8+o+g);_.set(e,8),g>0&&_.set(x,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 K_(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 q_(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=z3(s);for(let l of a){let c=hl[l];if(!c)continue;let d=c(r);if(n){let u=e.public_key;if(Wf(d,i,u))return true}else {let u=e.public_key;if(await Zf(r,d,i,u,l,o))return true}}return false}async function G_(t,e,r){let i=r.public_key.type==="EC",n=r.signature_algorithm==="RSA-PSS",o=r.public_key.key_size,s=z3(o);for(let a of s){let l=hl[a];if(!l)continue;let c=l(t);if(i){let d=r.public_key;if(Wf(c,e,d))return true}else {let d=r.public_key;if(await Zf(t,c,e,d,a,n))return true}}return false}var hl,O3,M3,F3,U3,L3,H3,V3,j3,X3,W3,Z3,z_=G3(()=>{pl(),hl={"SHA-1":Fn,"SHA-224":Nr,"SHA-256":tt,"SHA-384":jo,"SHA-512":Vo},O3={p:O0.brainpoolP224r1.p,a:O0.brainpoolP224r1.a,b:O0.brainpoolP224r1.b,n:O0.brainpoolP224r1.n,h:BigInt(1),Gx:BigInt("0xd9029ad2c7e5cf4340823b2a87dc68c9e4ce3174c1e6efdee12c07d"),Gy:BigInt("0x58aa56f772c0726f24c6b89e4ecdac24354b9e99caa3f6d3761402cd")},M3=Oe(Re(O3),Nr),F3={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")},U3=Oe(Re(F3),Fn),L3={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")},H3=Oe(Re(L3),Nr),V3={"P-192":U3,"P-224":H3,"P-256":ot,"P-384":st,"P-521":at,brainpoolP224r1:M3,brainpoolP256r1:Sg,brainpoolP384r1:xg,brainpoolP512r1:Ag},j3=["SHA-256","SHA-384","SHA-512"],X3={"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])},W3=8,Z3={"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 dl=class Ge{constructor(e){this.bytes=Ge.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(Ge.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 Ge.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 Ge(e)}static fromHex(e){if(!Ge.isHexString(e))throw new Error("Invalid hex string");return new Ge(e.startsWith("0x")?e:"0x"+e)}static fromBuffer(e){return new Ge(e)}static fromBase64(e){let r=atob(e);return new Ge(Uint8Array.from(r,i=>i.charCodeAt(0)))}static empty(){return new Ge(new Uint8Array(0))}static zero(e){return new Ge(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 Ge(this.bytes.slice(e,r))}concat(e){return new Ge([...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 Ge(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 Ge(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 Ge(r)}not(){let e=new Uint8Array(this.length);for(let r=0;r<this.length;r++)e[r]=~this.bytes[r]&255;return new Ge(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 Ge(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 Ge(i)}};var ol=0n,$_=BigInt("0x2523648240000001ba344d80000000086121000000000013a700000000000012"),V_=class M0{constructor(e,r){this.zeroes=[],this.layers=[],this.leaves=[],this.depth=e,this.hash=r;}static async create(e,r){return new M0(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]??ol}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($_),this.leaves=e,await this.computeZeroes();let i=new Array(r);for(let n=0;n<r;n+=1)i[n]=e[n]??ol;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 M0.verifyMembershipProof(e.left.proof,r)||e.left.proof.root!==e.root||!(e.left.leaf<e.target))||e.right&&(!await M0.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=ol;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]===ol;)n-=1;this.leaves=i.slice(0,n);}static async fromSerialized(e,r){let i=new M0(e.length-1,r);return await i.loadFromSerialized(e),i}};async function _r(t){return Ee(t.map(e=>BigInt(e)))}function X_(t){return BigInt("0x"+Buffer.from(t).toString("hex"))}function xo(t,e){return t.concat(Array(e-t.length).fill(0))}function Y3(t,e){return Array(e-t.length).fill(0).concat(t)}function F0(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 Ao(t,e){let r=BigInt(0);for(let i=0;i<e;i++)r*=BigInt(256),r+=BigInt(t[i]);return r}function W_(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 Q3(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 Fs(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 K3={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 Z_(t){if(!K3[t])throw new Error(`Unsupported chain: ${t}`);return K3[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 Yf(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 kn(t.toString(16).padStart(e*2,"0"))}async function Ls(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 er=(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))(er||{});function J3(t){return BigInt(t.publicInputs[0])}function e4(t){return BigInt(t.publicInputs[1])}function Y_(){return 2}function t4(t){return BigInt(t.publicInputs[t.publicInputs.length-2])}function r4(t){return BigInt(t.publicInputs[t.publicInputs.length-1])}function Q_(){return 2}function So(t){return t==="D<<"?"DEU":t}function qf(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 Gf(t){return t.startsWith("P")?"passport":t==="IR"||t==="AR"?"residence_permit":t.startsWith("I")?"id_card":"other"}var Qf=class ll{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 ll({issuingCountry:So(o(i.issuingCountry)),nationality:So(o(i.nationality)),documentType:Gf(o(i.documentType)),documentNumber:qf(o(i.documentNumber)),dateOfExpiry:Us(i.dateOfExpiry),dateOfBirth:Us(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 ll({issuingCountry:So(o(i.issuingCountry)),nationality:So(o(i.nationality)),documentType:Gf(o(i.documentType)),documentNumber:qf(o(i.documentNumber)),dateOfExpiry:Us(i.dateOfExpiry),dateOfBirth:Us(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 ll({issuingCountry:So(s(n.issuingCountry)),nationality:So(s(n.nationality)),documentType:Gf(s(n.documentType)),documentNumber:qf(s(n.documentNumber)),dateOfExpiry:Us(n.dateOfExpiry),dateOfBirth:Us(n.dateOfBirth),name:Ce(y),firstName:Ce(h),lastName:Ce(c),gender:s(n.gender)})}};function Us(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 Jf(t,e){return await Ee([BigInt(0),BigInt(ie[0].standard),W_(t,253),...Q3(new Uint8Array(e),31).map(r=>BigInt(r))])}async function i4(t,e){let r=tt(new Uint8Array([0,...Ie(ie[0].evm,2),...t.map(i=>Number(i)),...e.map(i=>Number(i))]));return Ao(r,31)}function n4(t){return t.minAge}function o4(t){return t.maxAge}async function ep(t,e){return await Ee([BigInt(1),BigInt(ie[1].standard),BigInt(t),BigInt(e)])}async function s4(t,e){let r=tt(new Uint8Array([1,...Ie(ie[1].evm,2),t,e]));return Ao(r,31)}function J_(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=>J_(o)),n=xo(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 U0(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=tt(new Uint8Array([t,...Ie(ie[t].evm,2),...xo(i,600)]));return Ao(n,31)}var _o=Math.floor(Math.abs(Date.UTC(1900,0,1,0,0,0))/1e3);function ul(t){return new Date(t.minDateTimestamp*1e3)}function fl(t){return new Date(t.maxDateTimestamp*1e3)}function a4(t,e=_o){return ul(t).getTime()===0?new Date(0):new Date(ul(t).getTime()+e*1e3)}function c4(t,e=_o){return fl(t).getTime()===0?new Date(0):new Date(fl(t).getTime()+e*1e3)}async function L0(t,e,r,i=_o){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 tp(t,e,r,i=_o){let n=tt(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 Ao(n,31)}function l4(t){return BigInt(t.publicInputs[0])}function d4(t){return BigInt(t.publicInputs[1])}function eC(){return 2}var tC=(t=>(t[t.USER_ADDRESS=1]="USER_ADDRESS",t[t.CHAIN_ID=2]="CHAIN_ID",t[t.CUSTOM_DATA=3]="CUSTOM_DATA",t))(tC||{});function H0(t){let e=[];if(t.user_address&&t.user_address.length>0){let r=dl.fromHex(t.user_address).toNumberArray();e=[...e,1,...Y3([r.length],2),...r];}if(t.chain){let r=Z_(t.chain),i=dl.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 rp(t,e=509){let r=xo(t,e);return await Ee([BigInt(8),BigInt(ie[8].standard),...Q3(new Uint8Array(r),31).map(i=>BigInt(i))])}async function u4(t,e=509){let r=xo(t,e),i=tt(new Uint8Array([8,...Ie(ie[8].evm,2),...r]));return Ao(i,31)}var f4=8544227306600425492560068004835614964118871262589609739238120993689090208159n,p4=0x24d9929b248be7eeecaa98e105c034a50539610f3fdd4cb9c8983ef4100d615dn;async function ip(t,e,r,i){return await Ee([BigInt(10),BigInt(ie[10].standard),t,e,r,r===p4?f4:0n,i])}async function h4(t,e,r,i){let n=tt(new Uint8Array([10,...Ie(ie[10].evm,2),...Ie(t,32),...Ie(e,1),...Ie(r,32),...Ie(r===p4?f4:0n,32),...Ie(i,1)]));return Ao(n,31)}function Cr(t){return BigInt(t.publicInputs[t.publicInputs.length-2])}function m4(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 np(t){return BigInt(t.publicInputs[3])}function op(t){return BigInt(t.publicInputs[2])}function rr(t){return BigInt(t.publicInputs[0])}function sp(t){return new Date(Number(BigInt(t.publicInputs[1]))*1e3)}function Hs(t){return t.startsWith("data_check_integrity")?Q_():t.startsWith("sig_check_id_data")?eC():t.startsWith("sig_check_dsc")?Y_():t.startsWith("oprf_auth")?3:t.startsWith("outer")?8+(Number(t.substring(t.lastIndexOf("_")+1))-3):8}function g4(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}};pl();var y4=["North Korea","Iran","Iraq","Libya","Somalia","Sudan","Syrian Arab Republic","Yemen"],ml=["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"],b4=[...ml,"Iceland","Liechtenstein","Norway"],S4=[...ml.filter(t=>t!=="Cyprus"&&t!=="Ireland"),"Switzerland","Iceland","Liechtenstein","Norway"],x4=["Brunei Darussalam","Cambodia","Indonesia","Lao People's Democratic Republic","Malaysia","Myanmar","Philippines","Singapore","Thailand","Vietnam"],A4=["Argentina","Brazil","Chile","Colombia","Paraguay","Uruguay"];pl();var Vf=class extends te{constructor(t){super(t),Object.setPrototypeOf(this,Vf.prototype);}};Vf=wt([M({type:k.Set,itemType:gt})],Vf);var jf=class{constructor(t={}){this.number=1,this.hash=new ArrayBuffer(0),Object.assign(this,t);}};wt([m({type:S.Integer})],jf.prototype,"number",2),wt([m({type:S.OctetString})],jf.prototype,"hash",2);var Xf=class{constructor(t={}){this.ldsVersion="",this.unicodeVersion="",Object.assign(this,t);}};wt([m({type:S.PrintableString})],Xf.prototype,"ldsVersion",2),wt([m({type:S.PrintableString})],Xf.prototype,"unicodeVersion",2);var zf=class{constructor(t){this.value="",t&&(typeof t=="string"?this.value=t:Object.assign(this,t));}};wt([m({type:S.ObjectIdentifier})],zf.prototype,"value",2),zf=wt([M({type:k.Choice})],zf);var sl=class{constructor(t={}){this.version=1,this.hashAlgorithm=new dt,this.dataGroups=[],Object.assign(this,t);}};wt([m({type:S.Integer})],sl.prototype,"version",2),wt([m({type:dt})],sl.prototype,"hashAlgorithm",2),wt([m({type:jf,repeated:"sequence"})],sl.prototype,"dataGroups",2),wt([m({type:Xf,optional:true})],sl.prototype,"versionInfo",2);var al=class{constructor(t={}){this.version=0,this.certificates=[],Object.assign(this,t);}};wt([m({type:S.Integer})],al.prototype,"version",2),wt([m({type:Nt,repeated:"set"})],al.prototype,"certificates",2),al=wt([M({type:k.Sequence})],al);pl();function _4(t){let e=t?.mrz,r=e.length==90?60:5,i=F0(e.split(""),["<","<"],r)+2,n=false;i>0&&i<e.length&&e[i]==="<"&&(i=F0(e.split(""),["<"],r)+1,n=true);let o=F0(e.split(""),["<"],i);return [i-(n?1:2),o]}function C4(t){let e=t?.mrz,r=_4(t)[1]+1,i=F0(e.split(""),["<"],r);return [r-1,i]}function rC(t){let e=t?.mrz,r=C4(t)[1]+1,i=F0(e.split(""),["<"],r);return [r-1,i]}function iC(t){let e=(t?.mrz).length==90;return [e?60:5,e?90:44]}function nC(t){let e=(t?.mrz).length==90;return [e?30:57,e?36:63]}function oC(t){let e=(t?.mrz).length==90;return [e?5:44,e?14:53]}function sC(t){let e=(t?.mrz).length==90;return [e?45:54,e?48:57]}function aC(t){let e=t?.mrz;return So(e.slice(...sC(t)))}var cC=["https://eu.node0.zkp.oprf.taceo.network","https://eu.node1.zkp.oprf.taceo.network","https://eu.node2.zkp.oprf.taceo.network"],w4="1";Pt.Point.fromAffine(ln);Ms.ORDER;async function I4(t,e){let r=cC,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 v4(t){return Ee([t.x,t.y])}var ap=class E4{constructor(e){this.tree=e;}static async create(){let e=await Ls(()=>fetch("https://cdn.zkpassport.id/sanctions/all_sanctions_tree.json.gz",{headers:{"Accept-Encoding":"gzip"}})).then(i=>i.json()),r=await V_.fromSerialized(e,_r);return new E4(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 dC(e),y=r?this.tree.createNonMembershipProof(i):this.tree.createNonMembershipProof(1n),b=r?this.tree.createNonMembershipProof(n):this.tree.createNonMembershipProof(1n),A=r?this.tree.createNonMembershipProof(o):this.tree.createNonMembershipProof(1n),g=this.tree.createNonMembershipProof(s),x=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,A],name_and_dob_proofs:[g,x,_],name_and_yob_proofs:[w,I,N],passport_no_and_nationality_proof:H};return {proofs:{name_proofs:U.name_proofs.map(F=>cl(F)),name_and_dob_proofs:U.name_and_dob_proofs.map(F=>cl(F)),name_and_yob_proofs:U.name_and_yob_proofs.map(F=>cl(F)),passport_no_and_nationality_proof:cl(U.passport_no_and_nationality_proof)},root:O}}async getSanctionsEvmParameterCommitment(e){let r=this.getRootHash(),i=Array.from(r).map(s=>Number(s)),n=Y3(i,32),o=tt(new Uint8Array([9,...Ie(ie[9].evm,2),...n,e?1:0]));return Ao(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 cl(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 $f(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 lC(t){let[e,r]=iC(t),i=Math.min(_4(t)[1],r);i<0&&(i=r);let n=t.mrz.slice(e,i).padEnd(39,"<"),o=i===r?r:Math.min(C4(t)[1],r);o<0&&(o=r);let s=t.mrz.slice(e,o).padEnd(39,"<"),a=o===r?r:Math.min(rC(t)[1],r);a<0&&(a=r);let l=t.mrz.slice(e,a).padEnd(39,"<");return [$f(n),$f(s),$f(l)]}async function dC(t){let[e,r,i]=lC(t),n=Fs(e),o=Fs(r),s=Fs(i),a=await _r(n),l=await _r(o),c=await _r(s),d=Fs(t.mrz.slice(...nC(t))),u=Fs(t.mrz.slice(...oC(t))),h=Fs(aC(t)),y=[...n,...d],b=[...n,...d.slice(0,2)],A=[...o,...d],g=[...o,...d.slice(0,2)],x=[...s,...d],_=[...s,...d.slice(0,2)],w=[...u,...h],I=await _r(y),N=await _r(b),H=await _r(A),O=await _r(g),U=await _r(x),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 Ks(t){if(!t)return 0n;let e=tt(new TextEncoder().encode(t)).slice(0,31);return X_(Array.from(e))}function K0(t){return Ks(t)}function uC(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 fC(t,e){return t.slice(0,e)}function pC(t,e){return t.slice(e)}function qs(t,e,r=0){let i=uC(Buffer.from(t,"hex"),r),n=pC(i,e),o=fC(i,e);return {proof:n,publicInputs:o.map(s=>s.startsWith("0x")?s:`0x${s}`)}}function B4(t){return BigInt(t.publicInputs[0])}function T4(t){return BigInt(t.publicInputs[1])}function k4(t){return new Date(Number(BigInt(t.publicInputs[2]))*1e3)}function cp(t){return BigInt(t.publicInputs[3])}function lp(t){return BigInt(t.publicInputs[4])}function P4(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 N4(t){return BigInt(t.publicInputs[t.publicInputs.length-2])}function D4(t){return BigInt(t.publicInputs[t.publicInputs.length-1])}function dp(t){return t.publicInputs.slice(5,t.publicInputs.length-3).map(BigInt)}if(typeof window>"u")try{let t=S_("crypto");crypto=t;}catch{}z_();var Oo=et(j1(),1);var hC=Object.defineProperty,mC=Object.getOwnPropertyDescriptor,gC=(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')}),F4=(t,e)=>()=>(t&&(e=t(t=0)),e),It=(t,e,r,i)=>{for(var n=i>1?void 0:i?mC(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&&hC(e,r,n),n},_i,q0,bl=F4(()=>{_i={"P-192":{a:0xfffffffffffffffffffffffffffffffefffffffffffffffcn,b:0x64210519e59c80e70fa7e9ab72243049feb8deecc146b9b1n,n:0xffffffffffffffffffffffff99def836146bc9b1b4d22831n,p:0xfffffffffffffffffffffffffffffffeffffffffffffffffn},"P-224":{a:0xfffffffffffffffffffffffffffffffefffffffffffffffffffffffen,b:0xb4050a850c04b3abf54132565044b0b7d7bfd8ba270b39432355ffb4n,n:0xffffffffffffffffffffffffffff16a2e0b8f03e13dd29455c5c2a3dn,p:0xffffffffffffffffffffffffffffffff000000000000000000000001n},"P-256":{a:ot.Point.CURVE().a,b:ot.Point.CURVE().b,n:ot.Point.CURVE().n,p:ot.Point.CURVE().p},"P-384":{a:st.Point.CURVE().a,b:st.Point.CURVE().b,n:st.Point.CURVE().n,p:st.Point.CURVE().p},"P-521":{a:at.Point.CURVE().a,b:at.Point.CURVE().b,n:at.Point.CURVE().n,p:at.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}};}),R4,O4,M4,yC=F4(()=>{bl(),R4={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(R4),Nr),O4={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(O4),Fn),M4={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(M4),Nr);});BigInt("0x2523648240000001ba344d80000000086121000000000013a700000000000012");bl();bl();var fp=class extends te{constructor(t){super(t),Object.setPrototypeOf(this,fp.prototype);}};fp=It([M({type:k.Set,itemType:gt})],fp);var pp=class{constructor(t={}){this.number=1,this.hash=new ArrayBuffer(0),Object.assign(this,t);}};It([m({type:S.Integer})],pp.prototype,"number",2),It([m({type:S.OctetString})],pp.prototype,"hash",2);var hp=class{constructor(t={}){this.ldsVersion="",this.unicodeVersion="",Object.assign(this,t);}};It([m({type:S.PrintableString})],hp.prototype,"ldsVersion",2),It([m({type:S.PrintableString})],hp.prototype,"unicodeVersion",2);var up=class{constructor(t){this.value="",t&&(typeof t=="string"?this.value=t:Object.assign(this,t));}};It([m({type:S.ObjectIdentifier})],up.prototype,"value",2),up=It([M({type:k.Choice})],up);var gl=class{constructor(t={}){this.version=1,this.hashAlgorithm=new dt,this.dataGroups=[],Object.assign(this,t);}};It([m({type:S.Integer})],gl.prototype,"version",2),It([m({type:dt})],gl.prototype,"hashAlgorithm",2),It([m({type:pp,repeated:"sequence"})],gl.prototype,"dataGroups",2),It([m({type:hp,optional:true})],gl.prototype,"versionInfo",2);var yl=class{constructor(t={}){this.version=0,this.certificates=[],Object.assign(this,t);}};It([m({type:S.Integer})],yl.prototype,"version",2),It([m({type:Nt,repeated:"set"})],yl.prototype,"certificates",2),yl=It([M({type:k.Sequence})],yl);bl();Pt.Point.fromAffine(ln);Ms.ORDER;if(typeof window>"u")try{let t=gC("crypto");crypto=t;}catch{}yC();function bC(t){return "0x"+Buffer.from(t).toString("hex").padStart(64,"0")}function U4(t){let e=[];for(let r=0;r<t.length;r+=32)e.push(bC(t.slice(r,r+32)));return e}var SC=(t=>(t[t.USER_ADDRESS=1]="USER_ADDRESS",t[t.CHAIN_ID=2]="CHAIN_ID",t[t.CUSTOM_DATA=3]="CUSTOM_DATA",t))(SC||{});var xC=(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))(xC||{});var AC=Object.defineProperty,_C=Object.getOwnPropertyDescriptor,CC=(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')}),z4=(t,e)=>()=>(t&&(e=t(t=0)),e),vt=(t,e,r,i)=>{for(var n=i>1?void 0:i?_C(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&&AC(e,r,n),n},Ci,G0,_l=z4(()=>{Ci={"P-192":{a:0xfffffffffffffffffffffffffffffffefffffffffffffffcn,b:0x64210519e59c80e70fa7e9ab72243049feb8deecc146b9b1n,n:0xffffffffffffffffffffffff99def836146bc9b1b4d22831n,p:0xfffffffffffffffffffffffffffffffeffffffffffffffffn},"P-224":{a:0xfffffffffffffffffffffffffffffffefffffffffffffffffffffffen,b:0xb4050a850c04b3abf54132565044b0b7d7bfd8ba270b39432355ffb4n,n:0xffffffffffffffffffffffffffff16a2e0b8f03e13dd29455c5c2a3dn,p:0xffffffffffffffffffffffffffffffff000000000000000000000001n},"P-256":{a:ot.Point.CURVE().a,b:ot.Point.CURVE().b,n:ot.Point.CURVE().n,p:ot.Point.CURVE().p},"P-384":{a:st.Point.CURVE().a,b:st.Point.CURVE().b,n:st.Point.CURVE().n,p:st.Point.CURVE().p},"P-521":{a:at.Point.CURVE().a,b:at.Point.CURVE().b,n:at.Point.CURVE().n,p:at.Point.CURVE().p}},G0={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}};}),L4,H4,K4,wC=z4(()=>{_l(),L4={p:G0.brainpoolP224r1.p,a:G0.brainpoolP224r1.a,b:G0.brainpoolP224r1.b,n:G0.brainpoolP224r1.n,h:BigInt(1),Gx:BigInt("0xd9029ad2c7e5cf4340823b2a87dc68c9e4ce3174c1e6efdee12c07d"),Gy:BigInt("0x58aa56f772c0726f24c6b89e4ecdac24354b9e99caa3f6d3761402cd")},Oe(Re(L4),Nr),H4={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(H4),Fn),K4={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(K4),Nr);}),Al=class $e{constructor(e){this.bytes=$e.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($e.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 $e.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 $e(e)}static fromHex(e){if(!$e.isHexString(e))throw new Error("Invalid hex string");return new $e(e.startsWith("0x")?e:"0x"+e)}static fromBuffer(e){return new $e(e)}static fromBase64(e){let r=atob(e);return new $e(Uint8Array.from(r,i=>i.charCodeAt(0)))}static empty(){return new $e(new Uint8Array(0))}static zero(e){return new $e(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 $e(this.bytes.slice(e,r))}concat(e){return new $e([...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 $e(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 $e(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 $e(r)}not(){let e=new Uint8Array(this.length);for(let r=0;r<this.length;r++)e[r]=~this.bytes[r]&255;return new $e(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 $e(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 $e(i)}};function Ir(t,e){if(!t)throw new Error(e)}function Gs(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 Cl=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");_l();_l();var yp=class extends te{constructor(t){super(t),Object.setPrototypeOf(this,yp.prototype);}};yp=vt([M({type:k.Set,itemType:gt})],yp);var bp=class{constructor(t={}){this.number=1,this.hash=new ArrayBuffer(0),Object.assign(this,t);}};vt([m({type:S.Integer})],bp.prototype,"number",2),vt([m({type:S.OctetString})],bp.prototype,"hash",2);var Sp=class{constructor(t={}){this.ldsVersion="",this.unicodeVersion="",Object.assign(this,t);}};vt([m({type:S.PrintableString})],Sp.prototype,"ldsVersion",2),vt([m({type:S.PrintableString})],Sp.prototype,"unicodeVersion",2);var mp=class{constructor(t){this.value="",t&&(typeof t=="string"?this.value=t:Object.assign(this,t));}};vt([m({type:S.ObjectIdentifier})],mp.prototype,"value",2),mp=vt([M({type:k.Choice})],mp);var Sl=class{constructor(t={}){this.version=1,this.hashAlgorithm=new dt,this.dataGroups=[],Object.assign(this,t);}};vt([m({type:S.Integer})],Sl.prototype,"version",2),vt([m({type:dt})],Sl.prototype,"hashAlgorithm",2),vt([m({type:bp,repeated:"sequence"})],Sl.prototype,"dataGroups",2),vt([m({type:Sp,optional:true})],Sl.prototype,"versionInfo",2);var xl=class{constructor(t={}){this.version=0,this.certificates=[],Object.assign(this,t);}};vt([m({type:S.Integer})],xl.prototype,"version",2),vt([m({type:Nt,repeated:"set"})],xl.prototype,"certificates",2),xl=vt([M({type:k.Sequence})],xl);_l();Pt.Point.fromAffine(ln);Ms.ORDER;if(typeof window>"u")try{let t=CC("crypto");crypto=t;}catch{}wC();var IC="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz",q4=[18,32];function vC(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=IC[n]+i,r=r/BigInt(58);}return "1".repeat(e)+i}function xp(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]=q4[0],e[1]=q4[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 vC(e)}var EC=16,BC=14,TC=8,kC=12,wl=0n;var PC=1;var un=1,fn=2;function G4(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 NC(t){if(t.type==="RSA")return Al.from(t.modulus).toUInt8Array();if(t.type==="EC")return Al.from(t.public_key_x).concat(Al.from(t.public_key_y)).toUInt8Array();throw new Error("Unsupported signature algorithm")}async function DC(t,e){let r=e?.version??0;Ir(r===0||r===1,`Unsupported Packaged Certificates version: ${r}`);let i=e?.tags?G4(e.tags):t?.tags?G4(t.tags):[0n,0n,0n];Ir(i.length===3,"Tags must be exactly 3 fields");let n=e?.type??PC;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=NC(t.public_key);if(r===0)return Ee([...i,BigInt(Gs(new Uint8Array([n,t.country.charCodeAt(0),t.country.charCodeAt(1),t.country.charCodeAt(2)]),31)[0]),...Gs(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(Gs(new Uint8Array([n,t.country.charCodeAt(0),t.country.charCodeAt(1),t.country.charCodeAt(2),...a]),31)[0]),s,...Gs(o,31).map(l=>BigInt(l))])}else throw new Error(`Unsupported Packaged Certificates version: ${r}`)}async function RC(t,e=0){let r=await Promise.all(t.map(i=>DC(i,{version:e})));return r.sort((i,n)=>i>n?1:i<n?-1:0),r}async function OC(t,e=0){let r=await RC(t,e),i=new Cl(EC,2);return await i.initialize(wl,r),i}async function MC(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=Al.from(t.serial).toUInt8Array(),r=await Ee(Gs(e,31).map(i=>BigInt(i)));return Ee([BigInt(t.fingerprint),r])}async function FC(t){let e=await Promise.all(t.map(r=>MC(r)));return e.sort((r,i)=>r>i?1:r<i?-1:0),e}async function UC(t){let e=await FC(t),r=new Cl(BC,2);return await r.initialize(wl,e),r}async function LC(t){let e=t.map(i=>BigInt(i));e.sort((i,n)=>i>n?1:i<n?-1:0);let r=new Cl(TC,2);return await r.initialize(wl,e),r}var HC=21888242871839275222246405745257275088548364400416034343698204186575808495617n;function gp(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>=HC)throw new Error(`${t} must be in [0, BN254_FIELD_MODULUS): ${r}`);return r}async function KC(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=gp("certificateRoot",i),a=gp("revocationRoot",n),l=gp("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(Gs(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 $4(t){let e=t.version??0,r=await OC(t.certificates,e);if(e===0)return r.root;if(e===1){let i=t,n=await UC(i.revocations??[]),o=await LC(i.masterlists??[]),{certificateRoot:s}=await KC({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 V4(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 Cl(kC,2);return await r.initialize(wl,e),r.root}var ib=et(z0(),1);function wi(t){return t.startsWith("0x")?t.slice(2):t}function Dt(t){return typeof t=="bigint"?`0x${t.toString(16).toLowerCase().padStart(64,"0")}`:`0x${wi(t).toLowerCase().padStart(64,"0")}`}var ew=3,tw="https://certificates.zkpassport.id/mainnet",rw="https://certificates.zkpassport.id/testnet",iw="http://localhost:8000/root",El=(t,e,r)=>r?`https://ipfs.zkpassport.id/ipfs/${r}`:(e=Dt(e),t===1||t===8453?`${tw}/${e}.json`:t===11155111?`${rw}/${e}.json`:`${iw}/${e}.json`),Ap="https://circuits2.zkpassport.id/mainnet",_p="https://circuits2.zkpassport.id/testnet",Cp="http://localhost:8000",Bl=(t,{root:e,version:r,cid:i})=>{if(e)return e=Dt(e),t===1?`${Ap}/by-root/${e}/manifest.json`:t===11155111?`${_p}/by-root/${e}/manifest.json`:`${Cp}/by-root/${e}/manifest.json`;if(r)return t===1?`${Ap}/by-version/${r}/manifest.json`:t===11155111?`${_p}/by-version/${r}/manifest.json`:`${Cp}/by-version/${r}/manifest.json`;if(i)return `https://ipfs.zkpassport.id/ipfs/${i}`;throw new Error("No root, version or cid provided")},Tl=(t,e,r)=>r?`https://ipfs.zkpassport.id/ipfs/${r}`:(e=Dt(e),t===1?`${Ap}/by-hash/${e}.json`:t===11155111?`${_p}/by-hash/${e}.json`:`${Cp}/by-hash/${e}.json`),kl=100,Y4="0xc3bc16e8",Q4="0x06ac4103",J4="0xcb0c82c7",eb="0x76785af8",nw="0x5d8d57a6",tb="0xbb3dd539",rb="0x2aae4296",ow=[{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}],Ve=(0, ib.default)("zkpassport:registry"),sw={1:{rpcUrl:"https://eth-mainnet.g.alchemy.com/v2/in6UjcATST36yyKuk83yb1yukKs65u8G",rootRegistry:"0x1D0000020038d6E40E1d98e09fA1bb3A7DAA8B70",registryHelper:"0x8C93bB3a7ED88dA0647Ea53f8cd3f57832a513Cd",packagedCertsUrlGenerator:El,circuitManifestUrlGenerator:Bl,packagedCircuitUrlGenerator:Tl},8453:{rpcUrl:"https://base-mainnet.g.alchemy.com/v2/in6UjcATST36yyKuk83yb1yukKs65u8G",rootRegistry:"0x1D0000020038d6E40E1d98e09fA1bb3A7DAA8B70",registryHelper:"0xC404C605130F3345E1A2BFdf3BAFABED7234cCa7",packagedCertsUrlGenerator:El,circuitManifestUrlGenerator:Bl,packagedCircuitUrlGenerator:Tl},11155111:{rpcUrl:"https://eth-sepolia.g.alchemy.com/v2/in6UjcATST36yyKuk83yb1yukKs65u8G",rootRegistry:"0x1D0000020038d6E40E1d98e09fA1bb3A7DAA8B70",registryHelper:"0x6Ee299B1E8049fadc3494f1110A3479f5BE8EC0e",packagedCertsUrlGenerator:El,circuitManifestUrlGenerator:Bl,packagedCircuitUrlGenerator:Tl},31337:{rpcUrl:"http://localhost:8545",rootRegistry:"0x5FbDB2315678afecb367f032d93F642f64180aa3",registryHelper:"0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512",packagedCertsUrlGenerator:El,circuitManifestUrlGenerator:Bl,packagedCircuitUrlGenerator:Tl}},Pl=class wp{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=sw[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||ew;}async getLatestCertificateRoot(){Ve("Getting latest certificate root",{registry:this.rootRegistry});let e=await this.rpcRequest(this.rootRegistry,Y4+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 Ve(`Got latest certificates root: ${r.result}`),r.result}async isCertificateRootValid(e,r){e=Dt(e);let i=r??Math.floor(Date.now()/1e3),n=await this.rpcRequest(this.rootRegistry,rb+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=Dt(e):e=await this.getLatestCertificateRoot(),i)throw new Error("IPFS flag not implemented");let n=this.packagedCertsUrlGenerator(this.chainId,e);Ve("Getting certificates from:",n);let o=await Ls(()=>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),Ve(`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=Dt(l.fingerprint));if(r&&!await wp.validateCertificates(s,e))throw new Error(`Validation failed for packaged certificates: ${e}`);return s}static async validateCertificates(e,r){try{let i=await $4(e),n=Dt(r),o=i.toLowerCase()===n.toLowerCase();return Ve(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=kl){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"?`${Q4}${un.toString(16).padStart(64,"0")}${i.toString(16).padStart(64,"0")}${r.toString(16).padStart(64,"0")}`:`${J4}${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=kl,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){Ve("Getting certificate root details");let i=await this.rpcRequest(this.registryHelper,tb+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)}Ve("Getting latest certificate root details");let r=await this.rpcRequest(this.registryHelper,eb+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(){Ve("Getting latest circuit root",{registry:this.rootRegistry});let e=await this.rpcRequest(this.rootRegistry,Y4+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 Ve(`Got latest circuit root: ${r.result}`),r.result}async isCircuitRootValid(e,r){e=Dt(e);let i=r??Math.floor(Date.now()/1e3),n=await this.rpcRequest(this.rootRegistry,rb+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=Dt(e)),i)throw new Error("IPFS flag not implemented");let o=this.circuitManifestUrlGenerator(this.chainId,{root:e,version:n});Ve("Getting circuit manifest from:",o);let s=await Ls(()=>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(Ve(`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=Dt(await V4({hashes:i})),o=Dt(r||e.root),s=n.toLowerCase()===o.toLowerCase();return Ve(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=Dt(r||e.vkey_hash),n=U4(dl.fromBase64(e.vkey).toUInt8Array()),o=Dt((await Ee(n.map(BigInt))).toString(16)),s=o===i;return Ve(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);Ve("Getting packaged circuit from:",s);let a=await Ls(()=>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(Ve(`Got packaged circuit for ${e}`),i&&!await wp.validatePackagedCircuit(l,o))throw new Error(`Validation failed for packaged circuit: ${e}`);return l}async getHistoricalCircuitRoots(e,r=kl){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"?`${Q4}${fn.toString(16).padStart(64,"0")}${i.toString(16).padStart(64,"0")}${r.toString(16).padStart(64,"0")}`:`${J4}${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=kl,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){Ve("Getting circuit root details");let i=await this.rpcRequest(this.registryHelper,tb+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)}Ve("Getting latest circuit root details");let r=await this.rpcRequest(this.registryHelper,eb+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){Ve(`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,`${nw}${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 Ve(`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=ow.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 Ls(()=>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=xp(`0x${i.slice(384,448)}`),h=i.slice(448,512),y=i.slice(512,576),b=i.slice(576,640),A=h===""?void 0:`0x${h}`,g=y===""?void 0:`0x${y}`,x=b===""?void 0:`0x${b}`;return {index:n,root:o,validFrom:s,validTo:l,revoked:c,leaves:d,cid:u,...A!==void 0&&{metadata1:A},...g!==void 0&&{metadata2:g},...x!==void 0&&{metadata3:x},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),A=parseInt(s.slice(u+192,u+256),16),g=A===0?void 0:new Date(A*1e3),x=parseInt(s.slice(u+256,u+320),16)===1,_=parseInt(s.slice(u+320,u+384),16),w=xp(`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:g,revoked:x,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 nb=(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 aw(){return typeof process<"u"&&process.versions!=null&&typeof window>"u"}async function $0(t,e){if(aw())try{let r=await Promise.resolve().then(()=>et(sb(),1)).catch(()=>{try{return {default:nb("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 ab=10,cb="wss://bridge.zkpassport.id",lb=3e4,Nl="1";var cw=typeof window<"u"?{getRandomValues:t=>window.crypto.getRandomValues(t)}:globalThis.crypto,Ip=typeof window<"u"?window.crypto:typeof globalThis<"u"&&globalThis.crypto?globalThis.crypto:cw;function db(t){let e=new Uint8Array(t);if(Ip&&typeof Ip.getRandomValues=="function")return Ip.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 ub(t){try{let e=new URL(t);return `${e.protocol}//${e.host.split(":")[0]}`}catch{return t}}function js(t=16){let e=db(t);return Buffer.from(e).toString("hex")}function fb(t){return t instanceof Uint8Array||ArrayBuffer.isView(t)&&t.constructor.name==="Uint8Array"}function rt(t,...e){if(!fb(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 V0(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 vp(t,e){rt(t);let r=e.outputLen;if(t.length<r)throw new Error("digestInto() expects output buffer of length at least "+r)}function pb(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 Xs(t){return new DataView(t.buffer,t.byteOffset,t.byteLength)}var dw=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68,uw=typeof Uint8Array.from([]).toHex=="function"&&typeof Uint8Array.fromHex=="function",fw=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));function j0(t){if(rt(t),uw)return t.toHex();let e="";for(let r=0;r<t.length;r++)e+=fw[t[r]];return e}function Ep(t){if(typeof t!="string")throw new Error("string expected");return new Uint8Array(new TextEncoder().encode(t))}function Ws(t){if(typeof t=="string")t=Ep(t);else if(fb(t))t=wo(t);else throw new Error("Uint8Array expected, got "+typeof t);return t}function hb(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 mb=(t,e)=>{function r(i,...n){if(rt(i),!dw)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?rt(d):rt(d,t.nonceLength);}let o=t.tagLength;o&&n[1]!==void 0&&rt(n[1]);let s=e(i,...n),a=(d,u)=>{if(u!==void 0){if(d!==2)throw new Error("cipher output not supported");rt(u);}},l=false;return {encrypt(d,u){if(l)throw new Error("cannot encrypt() twice with same key + nonce");return l=true,rt(d),a(s.encrypt.length,u),s.encrypt(d,u)},decrypt(d,u){if(rt(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 gb(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&&!X0(e))throw new Error("invalid output, must be aligned");return e}function Dl(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 yb(t,e,r){let i=new Uint8Array(16),n=Xs(i);return Dl(n,0,BigInt(e),r),Dl(n,8,BigInt(t),r),i}function X0(t){return t.byteOffset%4===0}function wo(t){return Uint8Array.from(t)}var Ii=16,Tp=new Uint8Array(16),$r=vr(Tp),pw=225,hw=(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^pw<<24&-(n&1)}},ir=t=>(t>>>0&255)<<24|(t>>>8&255)<<16|(t>>>16&255)<<8|t>>>24&255|0;function mw(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 gw=t=>t>64*1024?8:t>1024?4:2,Rl=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=Ws(e),rt(e,16);let i=Xs(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}=hw(n,o,s,a);let c=gw(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 A=0;A<h;A++){let g=0,x=0,_=0,w=0;for(let I=0;I<c;I++){if(!(A>>>c-I-1&1))continue;let{s0:H,s1:O,s2:U,s3:F}=l[c*b+I];g^=H,x^=O,_^=U,w^=F;}y.push({s0:g,s1:x,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 A=0;A<4;A++){let g=b>>>8*A&255;for(let x=8/o-1;x>=0;x--){let _=g>>>o*x&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){V0(this),e=Ws(e),rt(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&&(Tp.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){V0(this),vp(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}},Bp=class extends Rl{constructor(e,r){e=Ws(e),rt(e);let i=mw(wo(e));super(i,r),Er(i);}update(e){e=Ws(e),V0(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&&(Tp.set(e.subarray(n*Ii)),this._updateBlock(ir($r[3]),ir($r[2]),ir($r[1]),ir($r[0])),Er($r)),this}digestInto(e){V0(this),vp(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 bb(t){let e=(i,n)=>t(n,i.length).update(Ws(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 kp=bb((t,e)=>new Rl(t,e));bb((t,e)=>new Bp(t,e));var Np=16,bw=4,Ol=new Uint8Array(Np),Sw=283;function Dp(t){return t<<1^Sw&-(t>>7)}function Sb(t,e){let r=0;for(;e>0;e>>=1)r^=t&-(e&1),t=Dp(t);return r}var xw=(()=>{let t=new Uint8Array(256);for(let r=0,i=1;r<256;r++,i^=Dp(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 Aw=t=>t<<24|t>>>8,Pp=t=>t<<8|t>>>24;function _w(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(Pp),n=i.map(Pp),o=n.map(Pp),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 Ab=_w(xw,t=>Sb(t,3)<<24|t<<16|t<<8|Sb(t,2));var Cw=(()=>{let t=new Uint8Array(16);for(let e=0,r=1;e<16;e++,r=Dp(r))t[e]=r;return t})();function ww(t){rt(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}=Ab,i=[];X0(t)||i.push(t=wo(t));let n=vr(t),o=n.length,s=l=>W0(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(Aw(c))^Cw[l/o-1]:o>6&&l%o===4&&(c=s(c)),a[l]=a[l-o]^c;}return Er(...i),a}function Ml(t,e,r,i,n,o){return t[r<<8&65280|i>>>8&255]^e[n>>>8&65280|o>>>24&255]}function W0(t,e,r,i,n){return t[e&255|r&65280]|t[i>>>16&255|n>>>16&65280]<<16}function xb(t,e,r,i,n){let{sbox2:o,T01:s,T23:a}=Ab,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 A=t[l++]^Ml(s,a,e,r,i,n),g=t[l++]^Ml(s,a,r,i,n,e),x=t[l++]^Ml(s,a,i,n,e,r),_=t[l++]^Ml(s,a,n,e,r,i);e=A,r=g,i=x,n=_;}let d=t[l++]^W0(o,e,r,i,n),u=t[l++]^W0(o,r,i,n,e),h=t[l++]^W0(o,i,n,e,r),y=t[l++]^W0(o,n,e,r,i);return {s0:d,s1:u,s2:h,s3:y}}function Fl(t,e,r,i,n){rt(r,Np),rt(i),n=gb(i.length,n);let o=r,s=vr(o),a=Xs(o),l=vr(i),c=vr(n),d=12,u=i.length,h=a.getUint32(d,e),{s0:y,s1:b,s2:A,s3:g}=xb(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]^A,c[_+3]=l[_+3]^g,h=h+1>>>0,a.setUint32(d,h,e),{s0:y,s1:b,s2:A,s3:g}=xb(t,s[0],s[1],s[2],s[3]);let x=Np*Math.floor(l.length/bw);if(x<u){let _=new Uint32Array([y,b,A,g]),w=pb(_);for(let I=x,N=0;I<u;I++,N++)n[I]=i[I]^w[N];Er(_);}return n}function Iw(t,e,r,i,n){let o=n?n.length:0,s=t.create(r,i.length+o);n&&s.update(n);let a=yb(8*i.length,8*o,e);s.update(i),s.update(a);let l=s.digest();return Er(a),l}var Rp=mb({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=Iw(kp,false,a,c,i);for(let u=0;u<l.length;u++)d[u]^=l[u];return d}function s(){let a=ww(e),l=Ol.slice(),c=Ol.slice();if(Fl(a,false,c,c,l),r.length===12)c.set(r);else {let u=Ol.slice(),h=Xs(u);Dl(h,8,BigInt(r.length*8),false);let y=kp.create(l).update(r).update(u);y.digestInto(c),y.destroy();}let d=Fl(a,false,c,Ol);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];X0(a)||y.push(a=wo(a)),Fl(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];X0(a)||h.push(a=wo(a));let y=a.subarray(0,-n),b=a.subarray(-n),A=o(c,u,y);if(h.push(A),!hb(A,b))throw new Error("aes/gcm: invalid ghash tag");let g=Fl(l,false,d,y);return Er(...h),g}}});var vw={p:0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2fn,n:0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141n,b:7n,Gx:0x79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798n,Gy:0x483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8n},{p:vo,n:Lp,Gx:Ew,Gy:Bw,b:Tb}=vw,Eo=32,Op=64,Rt=(t="")=>{throw new Error(t)},kb=t=>typeof t=="bigint",Pb=t=>typeof t=="string",Tw=t=>t instanceof Uint8Array||ArrayBuffer.isView(t)&&t.constructor.name==="Uint8Array",Z0=(t,e)=>!Tw(t)||typeof e=="number"&&e>0&&t.length!==e?Rt("Uint8Array expected"):t,Hp=t=>new Uint8Array(t),kw=t=>Uint8Array.from(t),Nb=(t,e)=>t.toString(16).padStart(e,"0"),Db=t=>Array.from(Z0(t)).map(e=>Nb(e,2)).join(""),vi={_0:48,_9:57,A:65,F:70,a:97,f:102},_b=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)},Rb=t=>{let e="hex invalid";if(!Pb(t))return Rt(e);let r=t.length,i=r/2;if(r%2)return Rt(e);let n=Hp(i);for(let o=0,s=0;o<i;o++,s+=2){let a=_b(t.charCodeAt(s)),l=_b(t.charCodeAt(s+1));if(a===void 0||l===void 0)return Rt(e);n[o]=a*16+l;}return n},Kl=(t,e)=>Z0(Pb(t)?Rb(t):kw(Z0(t)),e),Pw=()=>globalThis?.crypto;var Cb=(...t)=>{let e=Hp(t.reduce((i,n)=>i+Z0(n).length,0)),r=0;return t.forEach(i=>{e.set(i,r),r+=i.length;}),e},Nw=(t=Eo)=>Pw().getRandomValues(Hp(t)),Ll=BigInt,Q0=(t,e,r,i="bad number: out of range")=>kb(t)&&e<=t&&t<r?t:Rt(i),J=(t,e=vo)=>{let r=t%e;return r>=0n?r:e+r};var Dw=(t,e)=>{(t===0n||e<=0n)&&Rt("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):Rt("no inverse")};var wb=t=>t instanceof hn?t:Rt("Point expected"),Ob=t=>J(J(t*t)*t+Tb),Ib=t=>Q0(t,0n,vo),Ul=t=>Q0(t,1n,vo),Rw=t=>Q0(t,1n,Lp),Mp=t=>(t&1n)===0n,Mb=t=>Uint8Array.of(t),Ow=t=>Mb(Mp(t)?2:3),Mw=t=>{let e=Ob(Ul(t)),r=1n;for(let i=e,n=(vo+1n)/4n;n>0n;n>>=1n)n&1n&&(r=r*i%vo),i=i*i%vo;return J(r*r)===e?r:Rt("sqrt invalid")},Vr=class Vr{constructor(e,r,i){f(this,"px");f(this,"py");f(this,"pz");this.px=Ib(e),this.py=Ul(r),this.pz=Ib(i),Object.freeze(this);}static fromBytes(e){Z0(e);let r,i=e[0],n=e.subarray(1),o=vb(n,0,Eo),s=e.length;if(s===Eo+1&&[2,3].includes(i)){let a=Mw(o),l=Mp(a);Mp(Ll(i))!==l&&(a=J(-a)),r=new Vr(o,a,1n);}return s===Op+1&&i===4&&(r=new Vr(o,vb(n,Eo,Op),1n)),r?r.assertValidity():Rt("bad point: not on curve")}equals(e){let{px:r,py:i,pz:n}=this,{px:o,py:s,pz:a}=wb(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(Io)}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}=wb(e),l=0n,c=Tb,d=0n,u=0n,h=0n,y=J(c*3n),b=J(r*o),A=J(i*s),g=J(n*a),x=J(r+i),_=J(o+s);x=J(x*_),_=J(b+A),x=J(x-_),_=J(r+n);let w=J(o+a);return _=J(_*w),w=J(b+g),_=J(_-w),w=J(i+n),d=J(s+a),w=J(w*d),d=J(A+g),w=J(w-d),h=J(l*_),d=J(y*g),h=J(d+h),d=J(A-h),h=J(A+h),u=J(d*h),A=J(b+b),A=J(A+b),g=J(l*g),_=J(y*_),A=J(A+g),g=J(b-g),g=J(l*g),_=J(_+g),b=J(A*_),u=J(u+b),b=J(w*_),d=J(x*d),d=J(d-b),b=J(x*A),h=J(w*h),h=J(h+b),new Vr(d,u,h)}multiply(e,r=true){if(!r&&e===0n)return Io;if(Rw(e),e===1n)return this;if(this.equals(pn))return qw(e).p;let i=Io,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(Io))return {x:0n,y:0n};if(i===1n)return {x:e,y:r};let n=Dw(i,vo);return J(i*n)!==1n&&Rt("inverse invalid"),{x:J(e*n),y:J(r*n)}}assertValidity(){let{x:e,y:r}=this.toAffine();return Ul(e),Ul(r),J(r*r)===Ob(e)?this:Rt("bad point: not on curve")}toBytes(e=true){let{x:r,y:i}=this.assertValidity().toAffine(),n=Fp(r);return e?Cb(Ow(i),n):Cb(Mb(4),n,Fp(i))}static fromAffine(e){let{x:r,y:i}=e;return r===0n&&i===0n?Io:new Vr(r,i,1n)}toHex(e){return Db(this.toBytes(e))}static fromPrivateKey(e){return pn.multiply(Y0(e))}static fromHex(e){return Vr.fromBytes(Kl(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(Ew,Bw,1n),Io=new hn(0n,1n,0n);hn.BASE=pn;hn.ZERO=Io;var Kp=t=>Ll("0x"+(Db(t)||"0")),vb=(t,e,r)=>Kp(t.subarray(e,r)),Fw=2n**256n,Fp=t=>Rb(Nb(Q0(t,0n,Fw),Op)),Y0=t=>{let e=kb(t)?t:Kp(Kl(t,Eo));return Q0(e,1n,Lp,"private key invalid 3")};var Fb=(t,e=true)=>pn.multiply(Y0(t)).toBytes(e);var Ub=(t,e,r=true)=>hn.fromBytes(Kl(e)).multiply(Y0(t)).toBytes(r),Uw=t=>{t=Kl(t),(t.length<Eo+8||t.length>1024)&&Rt("expected 40-1024b");let e=J(Kp(t),Lp-1n);return Fp(e+1n)},Lw=()=>Uw(Nw(Eo+16));var Lb={normPrivateKeyToScalar:Y0,isValidPrivateKey:t=>{try{return !!Y0(t)}catch{return false}},randomPrivateKey:Lw,precompute:(t=8,e=pn)=>(e.multiply(3n),e)},Hl=8,Hw=256,Hb=Math.ceil(Hw/Hl)+1,Up=2**(Hl-1),Kw=()=>{let t=[],e=pn,r=e;for(let i=0;i<Hb;i++){r=e,t.push(r);for(let n=1;n<Up;n++)r=r.add(e),t.push(r);e=r.double();}return t},Eb,Bb=(t,e)=>{let r=e.negate();return t?r:e},qw=t=>{let e=Eb||(Eb=Kw()),r=Io,i=pn,n=2**Hl,o=n,s=Ll(n-1),a=Ll(Hl);for(let l=0;l<Hb;l++){let c=Number(t&s);t>>=a,c>Up&&(c-=o,t+=1n);let d=l*Up,u=d,h=d+Math.abs(c)-1,y=l%2!==0,b=c<0;c===0?i=i.add(Bb(y,e[u])):r=r.add(Bb(b,e[h]));}return {p:r,f:i}};function Gw(t){return t instanceof Uint8Array||ArrayBuffer.isView(t)&&t.constructor.name==="Uint8Array"}function Gl(t,...e){if(!Gw(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 qp(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 Kb(t,e){Gl(t);let r=e.outputLen;if(t.length<r)throw new Error("digestInto() expects output buffer of length at least "+r)}function J0(...t){for(let e=0;e<t.length;e++)t[e].fill(0);}function zl(t){return new DataView(t.buffer,t.byteOffset,t.byteLength)}function Br(t,e){return t<<32-e|t>>>e}function zw(t){if(typeof t!="string")throw new Error("string expected");return new Uint8Array(new TextEncoder().encode(t))}function Gp(t){return typeof t=="string"&&(t=zw(t)),Gl(t),t}var ql=class{};function qb(t){let e=i=>t().update(Gp(i)).digest(),r=t();return e.outputLen=r.outputLen,e.blockLen=r.blockLen,e.create=()=>t(),e}function $w(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 Gb(t,e,r){return t&e^~t&r}function zb(t,e,r){return t&e^t&r^e&r}var $l=class extends ql{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=zl(this.buffer);}update(e){qp(this),e=Gp(e),Gl(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=zl(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){qp(this),Kb(e,this),this.finished=true;let{buffer:r,view:i,blockLen:n,isLE:o}=this,{pos:s}=this;r[s++]=128,J0(this.buffer.subarray(s)),this.padOffset>n-s&&(this.process(i,0),s=0);for(let u=s;u<n;u++)r[u]=0;$w(i,n-8,BigInt(this.length*8),o),this.process(i,0);let a=zl(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 Vw=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),zp=class extends $l{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,A=Br(y,17)^Br(y,19)^y>>>10;mn[u]=A+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+Gb(a,l,c)+Vw[u]+mn[u]|0,A=(Br(i,2)^Br(i,13)^Br(i,22))+zb(i,n,o)|0;d=c,c=l,l=a,a=s+y|0,s=o,o=n,n=i,i=y+A|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(){J0(mn);}destroy(){this.set(0,0,0,0,0,0,0,0),J0(this.buffer);}};var $b=qb(()=>new zp);async function Vb(t){let r=new TextEncoder().encode(t),i=await $b(r);return new Uint8Array(i).slice(0,12)}function Vl(){let t=Lb.randomPrivateKey(),e=Fb(t);return {privateKey:t,publicKey:e}}function $p(t,e){return Ub(t,e).slice(0,32)}async function ec(t,e,r){let i=await Vb(r),n=Rp(e,i),o=Ep(t);return n.encrypt(o)}async function Vp(t,e,r){let i=await Vb(r),o=Rp(e,i).decrypt(t);return new TextDecoder().decode(o)}var m5=et(z0(),1);function ta(t){let e=t.length;for(;--e>=0;)t[e]=0;}var jw=0,P6=1,Xw=2,Ww=3,Zw=258,gh=29,mc=256,ac=mc+1+gh,Qs=30,yh=19,N6=2*ac+1,Bo=15,jp=16,Yw=7,bh=256,D6=16,R6=17,O6=18,ah=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]),Ql=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]),Qw=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),M6=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Jw=512,Ti=new Array((ac+2)*2);ta(Ti);var nc=new Array(Qs*2);ta(nc);var cc=new Array(Jw);ta(cc);var lc=new Array(Zw-Ww+1);ta(lc);var Sh=new Array(gh);ta(Sh);var Jl=new Array(Qs);ta(Jl);function Xp(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 F6,U6,L6;function Wp(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e;}var H6=t=>t<256?cc[t]:cc[256+(t>>>7)],dc=(t,e)=>{t.pending_buf[t.pending++]=e&255,t.pending_buf[t.pending++]=e>>>8&255;},Bt=(t,e,r)=>{t.bi_valid>jp-r?(t.bi_buf|=e<<t.bi_valid&65535,dc(t,t.bi_buf),t.bi_buf=e>>jp-t.bi_valid,t.bi_valid+=r-jp):(t.bi_buf|=e<<t.bi_valid&65535,t.bi_valid+=r);},Xr=(t,e,r)=>{Bt(t,r[e*2],r[e*2+1]);},K6=(t,e)=>{let r=0;do r|=t&1,t>>>=1,r<<=1;while(--e>0);return r>>>1},eI=t=>{t.bi_valid===16?(dc(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);},tI=(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,A=0;for(h=0;h<=Bo;h++)t.bl_count[h]=0;for(r[t.heap[t.heap_max]*2+1]=0,c=t.heap_max+1;c<N6;c++)d=t.heap[c],h=r[r[d*2+1]*2+1]+1,h>l&&(h=l,A++),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(A!==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]--,A-=2;}while(A>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--);}},q6=(t,e,r)=>{let i=new Array(Bo+1),n=0,o,s;for(o=1;o<=Bo;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]=K6(i[a]++,a));}},rI=()=>{let t,e,r,i,n,o=new Array(Bo+1);for(r=0,i=0;i<gh-1;i++)for(Sh[i]=r,t=0;t<1<<ah[i];t++)lc[r++]=i;for(lc[r-1]=i,n=0,i=0;i<16;i++)for(Jl[i]=n,t=0;t<1<<Ql[i];t++)cc[n++]=i;for(n>>=7;i<Qs;i++)for(Jl[i]=n<<7,t=0;t<1<<Ql[i]-7;t++)cc[256+n++]=i;for(e=0;e<=Bo;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(q6(Ti,ac+1,o),t=0;t<Qs;t++)nc[t*2+1]=5,nc[t*2]=K6(t,5);F6=new Xp(Ti,ah,mc+1,ac,Bo),U6=new Xp(nc,Ql,0,Qs,Bo),L6=new Xp(new Array(0),Qw,0,yh,Yw);},G6=t=>{let e;for(e=0;e<ac;e++)t.dyn_ltree[e*2]=0;for(e=0;e<Qs;e++)t.dyn_dtree[e*2]=0;for(e=0;e<yh;e++)t.bl_tree[e*2]=0;t.dyn_ltree[bh*2]=1,t.opt_len=t.static_len=0,t.sym_next=t.matches=0;},z6=t=>{t.bi_valid>8?dc(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0;},jb=(t,e,r,i)=>{let n=e*2,o=r*2;return t[n]<t[o]||t[n]===t[o]&&i[e]<=i[r]},Zp=(t,e,r)=>{let i=t.heap[r],n=r<<1;for(;n<=t.heap_len&&(n<t.heap_len&&jb(e,t.heap[n+1],t.heap[n],t.depth)&&n++,!jb(e,i,t.heap[n],t.depth));)t.heap[r]=t.heap[n],r=n,n<<=1;t.heap[r]=i;},Xb=(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=lc[n],Xr(t,s+mc+1,e),a=ah[s],a!==0&&(n-=Sh[s],Bt(t,n,a)),i--,s=H6(i),Xr(t,s,r),a=Ql[s],a!==0&&(i-=Jl[s],Bt(t,i,a)));while(o<t.sym_next);Xr(t,bh,e);},ch=(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=N6,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--)Zp(t,r,s);c=o;do s=t.heap[1],t.heap[1]=t.heap[t.heap_len--],Zp(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++,Zp(t,r,1);while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],tI(t,e),q6(r,l,t.bl_count);},Wb=(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[D6*2]++):a<=10?t.bl_tree[R6*2]++:t.bl_tree[O6*2]++,a=0,n=o,s===0?(l=138,c=3):o===s?(l=6,c=3):(l=7,c=4));},Zb=(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,D6,t.bl_tree),Bt(t,a-3,2)):a<=10?(Xr(t,R6,t.bl_tree),Bt(t,a-3,3)):(Xr(t,O6,t.bl_tree),Bt(t,a-11,7));a=0,n=o,s===0?(l=138,c=3):o===s?(l=6,c=3):(l=7,c=4);}},iI=t=>{let e;for(Wb(t,t.dyn_ltree,t.l_desc.max_code),Wb(t,t.dyn_dtree,t.d_desc.max_code),ch(t,t.bl_desc),e=yh-1;e>=3&&t.bl_tree[M6[e]*2+1]===0;e--);return t.opt_len+=3*(e+1)+5+5+4,e},nI=(t,e,r,i)=>{let n;for(Bt(t,e-257,5),Bt(t,r-1,5),Bt(t,i-4,4),n=0;n<i;n++)Bt(t,t.bl_tree[M6[n]*2+1],3);Zb(t,t.dyn_ltree,e-1),Zb(t,t.dyn_dtree,r-1);},oI=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<mc;r++)if(t.dyn_ltree[r*2]!==0)return 1;return 0},Yb=false,sI=t=>{Yb||(rI(),Yb=true),t.l_desc=new Wp(t.dyn_ltree,F6),t.d_desc=new Wp(t.dyn_dtree,U6),t.bl_desc=new Wp(t.bl_tree,L6),t.bi_buf=0,t.bi_valid=0,G6(t);},$6=(t,e,r,i)=>{Bt(t,(jw<<1)+(i?1:0),3),z6(t),dc(t,r),dc(t,~r),r&&t.pending_buf.set(t.window.subarray(e,e+r),t.pending),t.pending+=r;},aI=t=>{Bt(t,P6<<1,3),Xr(t,bh,Ti),eI(t);},cI=(t,e,r,i)=>{let n,o,s=0;t.level>0?(t.strm.data_type===2&&(t.strm.data_type=oI(t)),ch(t,t.l_desc),ch(t,t.d_desc),s=iI(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?$6(t,e,r,i):t.strategy===4||o===n?(Bt(t,(P6<<1)+(i?1:0),3),Xb(t,Ti,nc)):(Bt(t,(Xw<<1)+(i?1:0),3),nI(t,t.l_desc.max_code+1,t.d_desc.max_code+1,s+1),Xb(t,t.dyn_ltree,t.dyn_dtree)),G6(t),i&&z6(t);},lI=(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[(lc[r]+mc+1)*2]++,t.dyn_dtree[H6(e)*2]++),t.sym_next===t.sym_end),dI=sI,uI=$6,fI=cI,pI=lI,hI=aI,mI={_tr_init:dI,_tr_stored_block:uI,_tr_flush_block:fI,_tr_tally:pI,_tr_align:hI},gI=(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},uc=gI,yI=()=>{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},bI=new Uint32Array(yI()),SI=(t,e,r,i)=>{let n=bI,o=i+r;t^=-1;for(let s=i;s<o;s++)t=t>>>8^n[(t^e[s])&255];return t^-1},Je=SI,Po={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"},ra={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:xI,_tr_stored_block:lh,_tr_flush_block:AI,_tr_tally:bn,_tr_align:_I}=mI,{Z_NO_FLUSH:Sn,Z_PARTIAL_FLUSH:CI,Z_FULL_FLUSH:wI,Z_FINISH:nr,Z_BLOCK:Qb,Z_OK:it,Z_STREAM_END:Jb,Z_STREAM_ERROR:Wr,Z_DATA_ERROR:II,Z_BUF_ERROR:Yp,Z_DEFAULT_COMPRESSION:vI,Z_FILTERED:EI,Z_HUFFMAN_ONLY:jl,Z_RLE:BI,Z_FIXED:TI,Z_DEFAULT_STRATEGY:kI,Z_UNKNOWN:PI,Z_DEFLATED:rd}=ra,NI=9,DI=15,RI=8,OI=29,MI=256,dh=MI+1+OI,FI=30,UI=19,LI=2*dh+1,HI=15,he=3,yn=258,Zr=yn+he+1,KI=32,Js=42,xh=57,uh=69,fh=73,ph=91,hh=103,To=113,rc=666,yt=1,ia=2,No=3,na=4,qI=3,ko=(t,e)=>(t.msg=Po[e],e),e6=t=>t*2-(t>4?9:0),gn=t=>{let e=t.length;for(;--e>=0;)t[e]=0;},GI=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)},zI=(t,e,r)=>(e<<t.hash_shift^r)&t.hash_mask,xn=zI,Ot=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));},Mt=(t,e)=>{AI(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,Ot(t.strm);},ge=(t,e)=>{t.pending_buf[t.pending++]=e;},tc=(t,e)=>{t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=e&255;},mh=(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=uc(t.adler,e,n,r):t.state.wrap===2&&(t.adler=Je(t.adler,e,n,r)),t.next_in+=n,t.total_in+=n,n)},V6=(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},ea=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),GI(t),i+=e),t.strm.avail_in===0)break;if(r=mh(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)},j6=(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,lh(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,Ot(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&&(mh(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?na:e!==Sn&&e!==nr&&t.strm.avail_in===0&&t.strstart===t.block_start?ia:(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&&(mh(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,lh(t,t.block_start,i,s),t.block_start+=i,Ot(t.strm)),s?No:yt)},Qp=(t,e)=>{let r,i;for(;;){if(t.lookahead<Zr){if(ea(t),t.lookahead<Zr&&e===Sn)return yt;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=V6(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&&(Mt(t,false),t.strm.avail_out===0))return yt}return t.insert=t.strstart<he-1?t.strstart:he-1,e===nr?(Mt(t,true),t.strm.avail_out===0?No:na):t.sym_next&&(Mt(t,false),t.strm.avail_out===0)?yt:ia},Zs=(t,e)=>{let r,i,n;for(;;){if(t.lookahead<Zr){if(ea(t),t.lookahead<Zr&&e===Sn)return yt;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=V6(t,r),t.match_length<=5&&(t.strategy===EI||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&&(Mt(t,false),t.strm.avail_out===0))return yt}else if(t.match_available){if(i=bn(t,0,t.window[t.strstart-1]),i&&Mt(t,false),t.strstart++,t.lookahead--,t.strm.avail_out===0)return yt}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?(Mt(t,true),t.strm.avail_out===0?No:na):t.sym_next&&(Mt(t,false),t.strm.avail_out===0)?yt:ia},$I=(t,e)=>{let r,i,n,o,s=t.window;for(;;){if(t.lookahead<=yn){if(ea(t),t.lookahead<=yn&&e===Sn)return yt;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&&(Mt(t,false),t.strm.avail_out===0))return yt}return t.insert=0,e===nr?(Mt(t,true),t.strm.avail_out===0?No:na):t.sym_next&&(Mt(t,false),t.strm.avail_out===0)?yt:ia},VI=(t,e)=>{let r;for(;;){if(t.lookahead===0&&(ea(t),t.lookahead===0)){if(e===Sn)return yt;break}if(t.match_length=0,r=bn(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,r&&(Mt(t,false),t.strm.avail_out===0))return yt}return t.insert=0,e===nr?(Mt(t,true),t.strm.avail_out===0?No:na):t.sym_next&&(Mt(t,false),t.strm.avail_out===0)?yt:ia};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 ic=[new jr(0,0,0,0,j6),new jr(4,4,8,4,Qp),new jr(4,5,16,8,Qp),new jr(4,6,32,32,Qp),new jr(4,4,16,16,Zs),new jr(8,16,32,32,Zs),new jr(8,16,128,128,Zs),new jr(8,32,128,256,Zs),new jr(32,128,258,1024,Zs),new jr(32,258,258,4096,Zs)],jI=t=>{t.window_size=2*t.w_size,gn(t.head),t.max_lazy_match=ic[t.level].max_lazy,t.good_match=ic[t.level].good_length,t.nice_match=ic[t.level].nice_length,t.max_chain_length=ic[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 XI(){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=rd,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(LI*2),this.dyn_dtree=new Uint16Array((2*FI+1)*2),this.bl_tree=new Uint16Array((2*UI+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(HI+1),this.heap=new Uint16Array(2*dh+1),gn(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(2*dh+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 gc=t=>{if(!t)return 1;let e=t.state;return !e||e.strm!==t||e.status!==Js&&e.status!==xh&&e.status!==uh&&e.status!==fh&&e.status!==ph&&e.status!==hh&&e.status!==To&&e.status!==rc?1:0},X6=t=>{if(gc(t))return ko(t,Wr);t.total_in=t.total_out=0,t.data_type=PI;let e=t.state;return e.pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=e.wrap===2?xh:e.wrap?Js:To,t.adler=e.wrap===2?0:1,e.last_flush=-2,xI(e),it},W6=t=>{let e=X6(t);return e===it&&jI(t.state),e},WI=(t,e)=>gc(t)||t.state.wrap!==2?Wr:(t.state.gzhead=e,it),Z6=(t,e,r,i,n,o)=>{if(!t)return Wr;let s=1;if(e===vI&&(e=6),i<0?(s=0,i=-i):i>15&&(s=2,i-=16),n<1||n>NI||r!==rd||i<8||i>15||e<0||e>9||o<0||o>TI||i===8&&s!==1)return ko(t,Wr);i===8&&(i=9);let a=new XI;return t.state=a,a.strm=t,a.status=Js,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,W6(t)},ZI=(t,e)=>Z6(t,e,rd,DI,RI,kI),YI=(t,e)=>{if(gc(t)||e>Qb||e<0)return t?ko(t,Wr):Wr;let r=t.state;if(!t.output||t.avail_in!==0&&!t.input||r.status===rc&&e!==nr)return ko(t,t.avail_out===0?Yp:Wr);let i=r.last_flush;if(r.last_flush=e,r.pending!==0){if(Ot(t),t.avail_out===0)return r.last_flush=-1,it}else if(t.avail_in===0&&e6(e)<=e6(i)&&e!==nr)return ko(t,Yp);if(r.status===rc&&t.avail_in!==0)return ko(t,Yp);if(r.status===Js&&r.wrap===0&&(r.status=To),r.status===Js){let n=rd+(r.w_bits-8<<4)<<8,o=-1;if(r.strategy>=jl||r.level<2?o=0:r.level<6?o=1:r.level===6?o=2:o=3,n|=o<<6,r.strstart!==0&&(n|=KI),n+=31-n%31,tc(r,n),r.strstart!==0&&(tc(r,t.adler>>>16),tc(r,t.adler&65535)),t.adler=1,r.status=To,Ot(t),r.pending!==0)return r.last_flush=-1,it}if(r.status===xh){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>=jl||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=Je(t.adler,r.pending_buf,r.pending,0)),r.gzindex=0,r.status=uh;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>=jl||r.level<2?4:0),ge(r,qI),r.status=To,Ot(t),r.pending!==0)return r.last_flush=-1,it}if(r.status===uh){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=Je(t.adler,r.pending_buf,r.pending-n,n)),r.gzindex+=a,Ot(t),r.pending!==0)return r.last_flush=-1,it;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=Je(t.adler,r.pending_buf,r.pending-n,n)),r.gzindex=0;}r.status=fh;}if(r.status===fh){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=Je(t.adler,r.pending_buf,r.pending-n,n)),Ot(t),r.pending!==0)return r.last_flush=-1,it;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=Je(t.adler,r.pending_buf,r.pending-n,n)),r.gzindex=0;}r.status=ph;}if(r.status===ph){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=Je(t.adler,r.pending_buf,r.pending-n,n)),Ot(t),r.pending!==0)return r.last_flush=-1,it;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=Je(t.adler,r.pending_buf,r.pending-n,n));}r.status=hh;}if(r.status===hh){if(r.gzhead.hcrc){if(r.pending+2>r.pending_buf_size&&(Ot(t),r.pending!==0))return r.last_flush=-1,it;ge(r,t.adler&255),ge(r,t.adler>>8&255),t.adler=0;}if(r.status=To,Ot(t),r.pending!==0)return r.last_flush=-1,it}if(t.avail_in!==0||r.lookahead!==0||e!==Sn&&r.status!==rc){let n=r.level===0?j6(r,e):r.strategy===jl?VI(r,e):r.strategy===BI?$I(r,e):ic[r.level].func(r,e);if((n===No||n===na)&&(r.status=rc),n===yt||n===No)return t.avail_out===0&&(r.last_flush=-1),it;if(n===ia&&(e===CI?_I(r):e!==Qb&&(lh(r,0,0,false),e===wI&&(gn(r.head),r.lookahead===0&&(r.strstart=0,r.block_start=0,r.insert=0))),Ot(t),t.avail_out===0))return r.last_flush=-1,it}return e!==nr?it:r.wrap<=0?Jb:(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)):(tc(r,t.adler>>>16),tc(r,t.adler&65535)),Ot(t),r.wrap>0&&(r.wrap=-r.wrap),r.pending!==0?it:Jb)},QI=t=>{if(gc(t))return Wr;let e=t.state.status;return t.state=null,e===To?ko(t,II):it},JI=(t,e)=>{let r=e.length;if(gc(t))return Wr;let i=t.state,n=i.wrap;if(n===2||n===1&&i.status!==Js||i.lookahead)return Wr;if(n===1&&(t.adler=uc(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,ea(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,ea(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,it},e9=ZI,t9=Z6,r9=W6,i9=X6,n9=WI,o9=YI,s9=QI,a9=JI,c9="pako deflate (from Nodeca project)",oc={deflateInit:e9,deflateInit2:t9,deflateReset:r9,deflateResetKeep:i9,deflateSetHeader:n9,deflate:o9,deflateEnd:s9,deflateSetDictionary:a9,deflateInfo:c9},l9=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),d9=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)l9(r,i)&&(t[i]=r[i]);}}return t},u9=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},id={assign:d9,flattenChunks:u9},Y6=true;try{String.fromCharCode.apply(null,new Uint8Array(1));}catch{Y6=false;}var fc=new Uint8Array(256);for(let t=0;t<256;t++)fc[t]=t>=252?6:t>=248?5:t>=240?4:t>=224?3:t>=192?2:1;fc[254]=fc[254]=1;var f9=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},p9=(t,e)=>{if(e<65534&&t.subarray&&Y6)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},h9=(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=fc[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 p9(o,n)},m9=(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+fc[t[r]]>e?r:e},pc={string2buf:f9,buf2string:h9,utf8border:m9};function g9(){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 Q6=g9,J6=Object.prototype.toString,{Z_NO_FLUSH:y9,Z_SYNC_FLUSH:b9,Z_FULL_FLUSH:S9,Z_FINISH:x9,Z_OK:ed,Z_STREAM_END:A9,Z_DEFAULT_COMPRESSION:_9,Z_DEFAULT_STRATEGY:C9,Z_DEFLATED:w9}=ra;function yc(t){this.options=id.assign({level:_9,method:w9,chunkSize:16384,windowBits:15,memLevel:8,strategy:C9},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 Q6,this.strm.avail_out=0;let r=oc.deflateInit2(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy);if(r!==ed)throw new Error(Po[r]);if(e.header&&oc.deflateSetHeader(this.strm,e.header),e.dictionary){let i;if(typeof e.dictionary=="string"?i=pc.string2buf(e.dictionary):J6.call(e.dictionary)==="[object ArrayBuffer]"?i=new Uint8Array(e.dictionary):i=e.dictionary,r=oc.deflateSetDictionary(this.strm,i),r!==ed)throw new Error(Po[r]);this._dict_set=true;}}yc.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?x9:y9,typeof t=="string"?r.input=pc.string2buf(t):J6.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===b9||o===S9)&&r.avail_out<=6){this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;continue}if(n=oc.deflate(r,o),n===A9)return r.next_out>0&&this.onData(r.output.subarray(0,r.next_out)),n=oc.deflateEnd(this.strm),this.onEnd(n),this.ended=true,n===ed;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};yc.prototype.onData=function(t){this.chunks.push(t);};yc.prototype.onEnd=function(t){t===ed&&(this.result=id.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg;};function Ah(t,e){let r=new yc(e);if(r.push(t,true),r.err)throw r.msg||Po[r.err];return r.result}var B9=Ah,N9={deflate:B9},Xl=16209,D9=16191,R9=function(e,r){let i,n,o,s,a,l,c,d,u,h,y,b,A,g,x,_,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,A=C.lencode,g=C.distcode,x=(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=A[y&x];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=g[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=Xl;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=Xl;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=g[(w&65535)+(y&(1<<I)-1)];continue r}else {e.msg="invalid distance code",C.mode=Xl;break e}break}}else if((I&64)===0){w=A[(w&65535)+(y&(1<<I)-1)];continue t}else if(I&32){C.mode=D9;break e}else {e.msg="invalid literal/length code",C.mode=Xl;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;},Ys=15,t6=852,r6=592,i6=0,Jp=1,n6=2,O9=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]),M9=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]),F9=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]),U9=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]),L9=(t,e,r,i,n,o,s,a)=>{let l=a.bits,c=0,d=0,u=0,h=0,y=0,b=0,A=0,g=0,x=0,_=0,w,I,N,H,O,U=null,F,T=new Uint16Array(Ys+1),C=new Uint16Array(Ys+1),E=null,v,B,D;for(c=0;c<=Ys;c++)T[c]=0;for(d=0;d<i;d++)T[e[r+d]]++;for(y=l,h=Ys;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),g=1,c=1;c<=Ys;c++)if(g<<=1,g-=T[c],g<0)return -1;if(g>0&&(t===i6||h!==1))return -1;for(C[1]=0,c=1;c<Ys;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===i6?(U=E=s,F=20):t===Jp?(U=O9,E=M9,F=257):(U=F9,E=U9,F=0),_=0,d=0,c=u,O=o,b=y,A=0,N=-1,x=1<<y,H=x-1,t===Jp&&x>t6||t===n6&&x>r6)return 1;for(;;){v=c-A,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-A,I=1<<b,u=I;do I-=w,n[O+(_>>A)+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(A===0&&(A=y),O+=u,b=c-A,g=1<<b;b+A<h&&(g-=T[b+A],!(g<=0));)b++,g<<=1;if(x+=1<<b,t===Jp&&x>t6||t===n6&&x>r6)return 1;N=_&H,n[N]=y<<24|b<<16|O-o|0;}}return _!==0&&(n[O+_]=c-A<<24|64<<16|0),a.bits=y,0},sc=L9,H9=0,e5=1,t5=2,{Z_FINISH:o6,Z_BLOCK:K9,Z_TREES:Wl,Z_OK:Do,Z_STREAM_END:q9,Z_NEED_DICT:G9,Z_STREAM_ERROR:or,Z_DATA_ERROR:r5,Z_MEM_ERROR:i5,Z_BUF_ERROR:z9,Z_DEFLATED:s6}=ra,nd=16180,a6=16181,c6=16182,l6=16183,d6=16184,u6=16185,f6=16186,p6=16187,h6=16188,m6=16189,td=16190,Bi=16191,eh=16192,g6=16193,th=16194,y6=16195,b6=16196,S6=16197,x6=16198,Zl=16199,Yl=16200,A6=16201,_6=16202,C6=16203,w6=16204,I6=16205,rh=16206,v6=16207,E6=16208,Be=16209,n5=16210,o5=16211,$9=852,V9=592,j9=15,X9=j9,B6=t=>(t>>>24&255)+(t>>>8&65280)+((t&65280)<<8)+((t&255)<<24);function W9(){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 Ro=t=>{if(!t)return 1;let e=t.state;return !e||e.strm!==t||e.mode<nd||e.mode>o5?1:0},s5=t=>{if(Ro(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=nd,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($9),e.distcode=e.distdyn=new Int32Array(V9),e.sane=1,e.back=-1,Do},a5=t=>{if(Ro(t))return or;let e=t.state;return e.wsize=0,e.whave=0,e.wnext=0,s5(t)},c5=(t,e)=>{let r;if(Ro(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,a5(t))},l5=(t,e)=>{if(!t)return or;let r=new W9;t.state=r,r.strm=t,r.window=null,r.mode=nd;let i=c5(t,e);return i!==Do&&(t.state=null),i},Z9=t=>l5(t,X9),T6=true,ih,nh,Y9=t=>{if(T6){ih=new Int32Array(512),nh=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(sc(e5,t.lens,0,288,ih,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;sc(t5,t.lens,0,32,nh,0,t.work,{bits:5}),T6=false;}t.lencode=ih,t.lenbits=9,t.distcode=nh,t.distbits=5;},d5=(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},Q9=(t,e)=>{let r,i,n,o,s,a,l,c,d,u,h,y,b,A,g=0,x,_,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(Ro(t)||!t.output||!t.input&&t.avail_in!==0)return or;r=t.state,r.mode===Bi&&(r.mode=eh),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=Do;e:for(;;)switch(r.mode){case nd:if(r.wrap===0){r.mode=eh;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=Je(r.check,F,2,0),c=0,d=0,r.mode=a6;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)!==s6){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?m6:Bi,c=0,d=0;break;case a6:for(;d<16;){if(a===0)break e;a--,c+=i[o++]<<d,d+=8;}if(r.flags=c,(r.flags&255)!==s6){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=Je(r.check,F,2,0)),c=0,d=0,r.mode=c6;case c6: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=Je(r.check,F,4,0)),c=0,d=0,r.mode=l6;case l6: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=Je(r.check,F,2,0)),c=0,d=0,r.mode=d6;case d6: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=Je(r.check,F,2,0)),c=0,d=0;}else r.head&&(r.head.extra=null);r.mode=u6;case u6: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=Je(r.check,i,y,o)),a-=y,o+=y,r.length-=y),r.length))break e;r.length=0,r.mode=f6;case f6: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=Je(r.check,i,y,o)),a-=y,o+=y,O)break e}else r.head&&(r.head.name=null);r.length=0,r.mode=p6;case p6: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=Je(r.check,i,y,o)),a-=y,o+=y,O)break e}else r.head&&(r.head.comment=null);r.mode=h6;case h6: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 m6:for(;d<32;){if(a===0)break e;a--,c+=i[o++]<<d,d+=8;}t.adler=r.check=B6(c),c=0,d=0,r.mode=td;case td: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,G9;t.adler=r.check=1,r.mode=Bi;case Bi:if(e===K9||e===Wl)break e;case eh:if(r.last){c>>>=d&7,d-=d&7,r.mode=rh;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=g6;break;case 1:if(Y9(r),r.mode=Zl,e===Wl){c>>>=2,d-=2;break e}break;case 2:r.mode=b6;break;case 3:t.msg="invalid block type",r.mode=Be;}c>>>=2,d-=2;break;case g6: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=th,e===Wl)break e;case th:r.mode=y6;case y6: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 b6: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=S6;case S6: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=sc(H9,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=x6;case x6:for(;r.have<r.nlen+r.ndist;){for(;g=r.lencode[c&(1<<r.lenbits)-1],x=g>>>24,_=g>>>16&255,w=g&65535,!(x<=d);){if(a===0)break e;a--,c+=i[o++]<<d,d+=8;}if(w<16)c>>>=x,d-=x,r.lens[r.have++]=w;else {if(w===16){for(C=x+2;d<C;){if(a===0)break e;a--,c+=i[o++]<<d,d+=8;}if(c>>>=x,d-=x,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=x+3;d<C;){if(a===0)break e;a--,c+=i[o++]<<d,d+=8;}c>>>=x,d-=x,O=0,y=3+(c&7),c>>>=3,d-=3;}else {for(C=x+7;d<C;){if(a===0)break e;a--,c+=i[o++]<<d,d+=8;}c>>>=x,d-=x,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=sc(e5,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=sc(t5,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=Zl,e===Wl)break e;case Zl:r.mode=Yl;case Yl: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,R9(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;g=r.lencode[c&(1<<r.lenbits)-1],x=g>>>24,_=g>>>16&255,w=g&65535,!(x<=d);){if(a===0)break e;a--,c+=i[o++]<<d,d+=8;}if(_&&(_&240)===0){for(I=x,N=_,H=w;g=r.lencode[H+((c&(1<<I+N)-1)>>I)],x=g>>>24,_=g>>>16&255,w=g&65535,!(I+x<=d);){if(a===0)break e;a--,c+=i[o++]<<d,d+=8;}c>>>=I,d-=I,r.back+=I;}if(c>>>=x,d-=x,r.back+=x,r.length=w,_===0){r.mode=I6;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=A6;case A6: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=_6;case _6:for(;g=r.distcode[c&(1<<r.distbits)-1],x=g>>>24,_=g>>>16&255,w=g&65535,!(x<=d);){if(a===0)break e;a--,c+=i[o++]<<d,d+=8;}if((_&240)===0){for(I=x,N=_,H=w;g=r.distcode[H+((c&(1<<I+N)-1)>>I)],x=g>>>24,_=g>>>16&255,w=g&65535,!(I+x<=d);){if(a===0)break e;a--,c+=i[o++]<<d,d+=8;}c>>>=I,d-=I,r.back+=I;}if(c>>>=x,d-=x,r.back+=x,_&64){t.msg="invalid distance code",r.mode=Be;break}r.offset=w,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.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=w6;case w6: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),A=r.window;}else A=n,b=s-r.offset,y=r.length;y>l&&(y=l),l-=y,r.length-=y;do n[s++]=A[b++];while(--y);r.length===0&&(r.mode=Yl);break;case I6:if(l===0)break e;n[s++]=r.length,l--,r.mode=Yl;break;case rh: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?Je(r.check,n,h,s-h):uc(r.check,n,h,s-h)),h=l,r.wrap&4&&(r.flags?c:B6(c))!==r.check){t.msg="incorrect data check",r.mode=Be;break}c=0,d=0;}r.mode=v6;case v6: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=E6;case E6:U=q9;break e;case Be:U=r5;break e;case n5:return i5;case o5: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<rh||e!==o6))&&d5(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?Je(r.check,n,h,t.next_out-h):uc(r.check,n,h,t.next_out-h)),t.data_type=r.bits+(r.last?64:0)+(r.mode===Bi?128:0)+(r.mode===Zl||r.mode===th?256:0),(u===0&&h===0||e===o6)&&U===Do&&(U=z9),U},J9=t=>{if(Ro(t))return or;let e=t.state;return e.window&&(e.window=null),t.state=null,Do},e7=(t,e)=>{if(Ro(t))return or;let r=t.state;return (r.wrap&2)===0?or:(r.head=e,e.done=false,Do)},t7=(t,e)=>{let r=e.length,i,n,o;return Ro(t)||(i=t.state,i.wrap!==0&&i.mode!==td)?or:i.mode===td&&(n=1,n=uc(n,e,r,0),n!==i.check)?r5:(o=d5(t,e,r,r),o?(i.mode=n5,i5):(i.havedict=1,Do))},r7=a5,i7=c5,n7=s5,o7=Z9,s7=l5,a7=Q9,c7=J9,l7=e7,d7=t7,u7="pako inflate (from Nodeca project)",ki={inflateReset:r7,inflateReset2:i7,inflateResetKeep:n7,inflateInit:o7,inflateInit2:s7,inflate:a7,inflateEnd:c7,inflateGetHeader:l7,inflateSetDictionary:d7,inflateInfo:u7};function f7(){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 p7=f7,u5=Object.prototype.toString,{Z_NO_FLUSH:h7,Z_FINISH:m7,Z_OK:hc,Z_STREAM_END:oh,Z_NEED_DICT:sh,Z_STREAM_ERROR:g7,Z_DATA_ERROR:k6,Z_MEM_ERROR:y7}=ra;function bc(t){this.options=id.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 Q6,this.strm.avail_out=0;let r=ki.inflateInit2(this.strm,e.windowBits);if(r!==hc)throw new Error(Po[r]);if(this.header=new p7,ki.inflateGetHeader(this.strm,this.header),e.dictionary&&(typeof e.dictionary=="string"?e.dictionary=pc.string2buf(e.dictionary):u5.call(e.dictionary)==="[object ArrayBuffer]"&&(e.dictionary=new Uint8Array(e.dictionary)),e.raw&&(r=ki.inflateSetDictionary(this.strm,e.dictionary),r!==hc)))throw new Error(Po[r])}bc.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?m7:h7,u5.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===sh&&n&&(o=ki.inflateSetDictionary(r,n),o===hc?o=ki.inflate(r,s):o===k6&&(o=sh));r.avail_in>0&&o===oh&&r.state.wrap>0&&t[r.next_in]!==0;)ki.inflateReset(r),o=ki.inflate(r,s);switch(o){case g7:case k6:case sh:case y7:return this.onEnd(o),this.ended=true,false}if(a=r.avail_out,r.next_out&&(r.avail_out===0||o===oh))if(this.options.to==="string"){let l=pc.utf8border(r.output,r.next_out),c=r.next_out-l,d=pc.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===hc&&a===0)){if(o===oh)return o=ki.inflateEnd(this.strm),this.onEnd(o),this.ended=true,true;if(r.avail_in===0)break}}return true};bc.prototype.onData=function(t){this.chunks.push(t);};bc.prototype.onEnd=function(t){t===hc&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=id.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg;};function _h(t,e){let r=new bc(e);if(r.push(t),r.err)throw r.msg||Po[r.err];return r.result}var x7=_h,w7={inflate:x7},{deflate:I7}=N9,{inflate:v7}=w7;var f5=I7;var Ch=v7;var E7=(0, m5.default)("bridge"),p5=32*1024,wh=1024*16,B7=1;function h5(t,e){return {jsonrpc:"2.0",id:js(16),method:t,params:e}}async function T7(t,e,r,i){let n=[],o=[];if(e){let s=Buffer.from(f5(JSON.stringify(e))).toString("base64"),a=Math.ceil(s.length/wh),l=js(16);for(let c=0;c<a;c++){let d=c*wh,u=Math.min(d+wh,s.length),h=s.slice(d,u),y=JSON.stringify({method:t,params:h,chunk:{id:l,index:c,length:a}}),b=await ec(y,r,i),A=h5("encryptedMessage",{payload:Buffer.from(b).toString("base64")});o.push(A.id),n.push(JSON.stringify(A));}}else {let s=JSON.stringify({method:t,params:e||{}}),a=await ec(s,r,i),l=h5("encryptedMessage",{payload:Buffer.from(a).toString("base64")});o.push(l.id),n.push(JSON.stringify(l));}return {chunks:n,messageIds:o}}async function Ih(t,e,r,i,n){try{let{chunks:o,messageIds:s}=await T7(t,e,r,i);for(let a of o){if(a.length>p5)throw new Error(`Payload exceeds max size of ${p5} bytes`);n.send(a),o.length>1&&await new Promise(l=>setTimeout(l,B7));}return {success:!0,messageIds:s}}catch(o){return E7("Error sending encrypted message:",o),{success:false,messageIds:[]}}}var vh=class{constructor(t){f(this,"code");f(this,"reason");f(this,"event");this.code=t.code,this.reason=t.reason,this.event=t.event;}},Eh=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 g5=et(z0(),1);var Bh=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, g5.default)(`bridge:${this.role}`),this.bridgeId=t.bridgeId||js(16),this.keyPair=t.keyPair,this.reconnect=t.reconnect??true,this.keepalive=t.keepalive??true,this.maxReconnectAttempts=t.reconnectAttempts||ab,this.pingInterval=t.pingInterval||lb,this.bridgeUrl=t.bridgeUrl??cb,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 Eh({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 vh({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?ub(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=$p(this.keyPair.privateKey,e),await Vp(Buffer.from(t.params.greeting,"hex"),this.sharedSecret,this.bridgeId)!=="hello")throw new Error("Invalid greeting");this.websocket&&(await Ih("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 Vp(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=Ch(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=Ch(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?$0(e,this.origin):$0(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 Ih(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=$p(this.keyPair.privateKey,this.remotePublicKey);}async createEncryptedGreeting(){if(!this.sharedSecret)throw new Error("Shared secret not available");let t=await ec("hello",this.sharedSecret,this.bridgeId);return Buffer.from(t).toString("hex")}async _getWsConnectionUrl(){if(this.role==="creator")return `${this.bridgeUrl}?id=${this.getBridgeId()}&v=${Nl}`;if(this.isSecureChannelEstablished())return `${this.bridgeUrl}?id=${this.getBridgeId()}&v=${Nl}`;{let t=await this.createEncryptedGreeting(),e=JSON.stringify({jsonrpc:"2.0",id:js(16),method:"handshake",params:{pubkey:this.getPublicKey(),greeting:t}}),r=Buffer.from(e).toString("base64");return `${this.bridgeUrl}?id=${this.getBridgeId()}&v=${Nl}&moc=${encodeURIComponent(r)}`}}getPublicKey(){return j0(this.keyPair.publicKey)}getRemotePublicKey(){if(!this.remotePublicKey)throw new Error("Remote public key not set");return j0(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?$0(t,this.origin):$0(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 Th=et(z0(),1),kh=class y5{static async create(e={}){e.debug&&Th.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||Vl(),o=j0(n.publicKey),s=new Bh({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&&Th.default.enable("bridge*"),r.resume&&!r.keyPair)throw new Error("Resuming a bridge session requires a keyPair");let i=r.keyPair||Vl(),{domain:n,pubkey:o}=y5.parseConnectionString(e),s=new Bh({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 Vl()}};var ud=et(Uh(),1);var dd={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 P5={debug:(...t)=>{},info:(...t)=>{},warn:(...t)=>{},error:(...t)=>{}};(0, ud.registerLocale)(dd);function sa(t){if(t==="Zero Knowledge Republic")return "ZKR";let e;return e=(0, ud.getAlpha3Code)(t,"en")||t||"ZKR",e}function _n(t,e,r,i,n){n[i][e]={...n[i][e],[t]:r};}function z5(t,e,r,i){i[r][t]={...i[r][t],range:e};}function aa(t,e,r,i,n){n[i][e]={...n[i][e],[t]:r};}function K7(){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=sa(s)),aa("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"),z5(o,[s,a],e,t),n),in:(o,s)=>(i("in"),s=s.map(a=>sa(a)),aa("in",o,s,e,t),n),out:(o,s)=>(i("out"),s=s.map(a=>sa(a)),aa("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 $5="0.17.0-beta.1",An=new Date(0),V5="https://dashboard-api.zkpassport.id",q7="https://verifier.zkpassport.id",N5="0x1fa73686cf510f8f85757b0602de0dd72a13e68ae2092462be8b72662e7f179b",D5="0x24d9929b248be7eeecaa98e105c034a50539610f3fdd4cb9c8983ef4100d615d",R5="0x2532418a107c5306fa8308c22255792cf77e4a290cbce8a840a642a3e591340b",O5="0x16700a2d9168a194fc85f237af5829b5a2be05b8ae8ac4879ada34cf54a9c211",M5="0x0e1889bec6c1d686abcf08360ff404f803ab345881ea8cba6aad33b7f7f7ffe0",F5=1440*60*1e3,G7=class{static checkDiscloseBytesPublicInputs(t,e,r){let i={},n=true,o=t.committedInputs?.disclose_bytes?.disclosedBytes??t.committedInputs?.disclose_bytes_evm?.disclosedBytes,s=Qf.fromDisclosedBytes(o,"passport"),a=Qf.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=n4(t.committedInputs?.compare_age??t.committedInputs?.compare_age_evm),a=o4(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=a4(t.committedInputs?.compare_birthdate??t.committedInputs?.compare_birthdate_evm,-1*_o),a=c4(t.committedInputs?.compare_birthdate??t.committedInputs?.compare_birthdate_evm,-1*_o);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=ul(t.committedInputs?.compare_expiry??t.committedInputs?.compare_expiry_evm),a=fl(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){let o=true;if(K0(t)!==op(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: ${K0(t).toString()}`,received:`Scope: ${op(e).toString()}`,message:"The proof comes from a different domain than the one expected"}),Ks(n)!==np(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: ${Ks(n).toString()}`,received:`Scope: ${np(e).toString()}`,message:s};}return {isCorrect:o,queryResultErrors:r}}static async checkCertificateRegistryRoot(t,e,r,i,n){let o=true;try{await new Pl({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 Pl({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!==R5&&r.rootKeyLeaf!==O5&&r.rootKeyLeaf!==M5&&(console.warn("Invalid facematch root key hash"),i=false,n.facematch={...n.facematch,eq:{expected:`${R5} (iOS) or ${O5} (Android) or ${M5} (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!==N5&&r.appIdHash!==D5&&(console.warn("Invalid facematch app id hash, the attestation should be coming from the ZKPassport app"),i=false,n.facematch={...n.facematch,eq:{expected:`${N5} (iOS) or ${D5} (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=sp(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()>F5&&(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,A=new Date(b.getFullYear(),b.getMonth(),b.getDate(),0,0,0,0),g={},x=["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 x.findIndex(D=>B.startsWith(D))};return E(T)-E(C)}),w=x.slice(3),I=_.find(T=>w.some(C=>T.name?.startsWith(C))),N=I?sp(qs(I.proof,Hs(I.name))):void 0,H=N?Math.floor(N.getTime()/1e3):void 0;for(let T of _){let C=qs(T.proof,Hs(T.name));if(T.name?.startsWith("outer")){let E=T.name?.startsWith("outer_evm"),v=k4(C),B=Math.floor(v.getTime()/1e3),D=B4(C),{isCorrect:P,queryResultErrors:L}=await this.checkCertificateRegistryRoot(D.toString(16),g,true,a,B);d=d&&P,g={...g,...L};let K=T4(C),{isCorrect:z,queryResultErrors:q}=await this.checkCircuitRegistryRoot(K.toString(16),g,a,B);d=d&&z,g={...g,...q};let Y=A.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,g.outer={...g.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()-A.getTime()>F5&&(console.warn("The date used to check the validity of the ID is in the future"),d=false,g.outer={...g.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=dp(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,g.outer={...g.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"}}),K0(t)!==cp(C)&&(console.warn("The proof comes from a different domain than the one expected"),d=false,g.outer={...g.outer,scope:{expected:`Scope: ${K0(t).toString()}`,received:`Scope: ${cp(C).toString()}`,message:"The proof comes from a different domain than the one expected"}}),Ks(o)!==lp(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,g.outer={...g.outer,scope:{expected:`Scope: ${Ks(o).toString()}`,received:`Scope: ${lp(C).toString()}`,message:$}};}if(V?.compare_age||V?.compare_age_evm){let $=V?.compare_age??V?.compare_age_evm,Z=E?await s4($.minAge,$.maxAge):await ep($.minAge,$.maxAge);ee.includes(Z)||(console.warn("This proof does not verify the age"),d=false,g.age={...g.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,g={...g,...re};}if(V?.compare_birthdate||V?.compare_birthdate_evm){let $=V?.compare_birthdate??V?.compare_birthdate_evm,Z=E?await tp(le.BIRTHDATE,$.minDateTimestamp,$.maxDateTimestamp,0):await L0(le.BIRTHDATE,$.minDateTimestamp,$.maxDateTimestamp,0);ee.includes(Z)||(console.warn("This proof does not verify the birthdate"),d=false,g.birthdate={...g.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,g={...g,...re};}if(V?.compare_expiry||V?.compare_expiry_evm){let $=V?.compare_expiry??V?.compare_expiry_evm,Z=E?await tp(le.EXPIRY_DATE,$.minDateTimestamp,$.maxDateTimestamp):await L0(le.EXPIRY_DATE,$.minDateTimestamp,$.maxDateTimestamp);ee.includes(Z)||(console.warn("This proof does not verify the expiry date"),d=false,g.expiry_date={...g.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,g={...g,...re};}if(V?.disclose_bytes||V?.disclose_bytes_evm){let $=V?.disclose_bytes??V?.disclose_bytes_evm,Z=E?await i4($.discloseMask,$.disclosedBytes):await Jf($.discloseMask,$.disclosedBytes);ee.includes(Z)||(console.warn("This proof does not verify any of the data disclosed"),d=false,g.disclose={...g.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,g={...g,...re};}if(V?.inclusion_check_nationality||V?.inclusion_check_nationality_evm){let $=V?.inclusion_check_nationality??V?.inclusion_check_nationality_evm,Z=E?await U0(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,g.nationality={...g.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,g={...g,...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 U0(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,g.issuing_country={...g.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,g={...g,...me};}if(V?.exclusion_check_nationality||V?.exclusion_check_nationality_evm){let $=V?.exclusion_check_nationality??V?.exclusion_check_nationality_evm,Z=E?await U0(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,g.nationality={...g.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,g={...g,...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 U0(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,g.issuing_country={...g.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,g={...g,...me};}if(V?.bind||V?.bind_evm){let $=V?.bind??V?.bind_evm,Z=E?await u4(H0($.data)):await rp(H0($.data));ee.includes(Z)||(console.warn("This proof does not verify the bound data"),d=false,g.bind={...g.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,g={...g,...re};}if(V?.exclusion_check_sanctions||V?.exclusion_check_sanctions_evm){let $=await ap.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,g.sanctions={...g.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,g={...g,...me};}if(V?.facematch||V?.facematch_evm){let $=V?.facematch??V?.facematch_evm,Z=E?await h4(BigInt($.rootKeyLeaf),$.environment==="development"?0n:1n,BigInt($.appIdHash),$.mode==="regular"?1n:2n):await ip(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,g.facematch={...g.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,g={...g,...re};}u=N4(C).toString(10),h=P4(C),y=D4(C);}else if(T.name?.startsWith("sig_check_dsc")){c=e4(C);let E=J3(C),{isCorrect:v,queryResultErrors:B}=await this.checkCertificateRegistryRoot(E.toString(16),g,false,a,H);d=d&&v,g={...g,...B};}else if(T.name?.startsWith("sig_check_id_data"))l=l4(C),l!==c&&(console.warn("Failed to check the link between the certificate signature and ID signature"),d=false,g.sig_check_id_data={...g.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=d4(C);else if(T.name?.startsWith("data_check_integrity"))l=t4(C),l!==c&&(console.warn("Failed to check the link between the ID signature and the data signed"),d=false,g.data_check_integrity={...g.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=r4(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,g.disclose={...g.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 Jf((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,g.disclose={...g.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,g,"disclose",o);d=d&&B,g={...g,...D};let{isCorrect:P,queryResultErrors:L}=this.checkDiscloseBytesPublicInputs(T,r,i);d=d&&P&&B,g={...g,...L,...D};let{isCorrect:K,queryResultErrors:z}=await this.checkCurrentDate("disclose",C,n??604800,g);d=d&&K,g={...g,...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,g.age={...g.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 ep(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,g.age={...g.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,g,"age",o),{isCorrect:L,queryResultErrors:K}=this.checkAgePublicInputs(T,r,i);d=d&&L&&D,g={...g,...K,...P};let{isCorrect:z,queryResultErrors:q}=await this.checkCurrentDate("age",C,n??604800,g);d=d&&z,g={...g,...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,g.birthdate={...g.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 L0(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,g.birthdate={...g.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,g,"birthdate",o),{isCorrect:L,queryResultErrors:K}=this.checkBirthdatePublicInputs(T,r,i);d=d&&L&&D,g={...g,...K,...P};let{isCorrect:z,queryResultErrors:q}=await this.checkCurrentDate("birthdate",C,n??604800,g);d=d&&z,g={...g,...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,g.expiry_date={...g.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 L0(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,g.expiry_date={...g.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,g,"expiry_date",o),{isCorrect:L,queryResultErrors:K}=this.checkExpiryDatePublicInputs(T,r,i);d=d&&L&&D,g={...g,...K,...P};let{isCorrect:z,queryResultErrors:q}=await this.checkCurrentDate("expiry_date",C,n??604800,g);d=d&&z,g={...g,...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,g.nationality={...g.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,g.nationality={...g.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,g,"nationality",o),{isCorrect:L,queryResultErrors:K}=this.checkNationalityExclusionPublicInputs(r,i,E);d=d&&L&&D,g={...g,...K,...P};let{isCorrect:z,queryResultErrors:q}=await this.checkCurrentDate("nationality",C,n??604800,g);d=d&&z,g={...g,...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,g.issuing_country={...g.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,g.issuing_country={...g.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,g,"issuing_country",o),{isCorrect:L,queryResultErrors:K}=this.checkIssuingCountryExclusionPublicInputs(r,i,E);d=d&&L&&D,g={...g,...K,...P};let{isCorrect:z,queryResultErrors:q}=await this.checkCurrentDate("issuing_country",C,n??604800,g);d=d&&z,g={...g,...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,g.nationality={...g.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,g.nationality={...g.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,g,"nationality",o),{isCorrect:L,queryResultErrors:K}=this.checkNationalityInclusionPublicInputs(r,i,E);d=d&&L&&D,g={...g,...K,...P};let{isCorrect:z,queryResultErrors:q}=await this.checkCurrentDate("nationality",C,n??604800,g);d=d&&z,g={...g,...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,g.issuing_country={...g.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,g.issuing_country={...g.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,g,"issuing_country",o),{isCorrect:L,queryResultErrors:K}=this.checkIssuingCountryInclusionPublicInputs(r,i,E);d=d&&L&&D,g={...g,...K,...P};let{isCorrect:z,queryResultErrors:q}=await this.checkCurrentDate("issuing_country",C,n??604800,g);d=d&&z,g={...g,...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,g.bind={...g.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 rp(H0(E.data));v!==B&&(console.warn("The bound data does not match the one from the proof"),d=false,g.bind={...g.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,g,"bind",o),{isCorrect:L,queryResultErrors:K}=this.checkBindPublicInputs(r,i,E.data);d=d&&L&&D,g={...g,...K,...P};let{isCorrect:z,queryResultErrors:q}=await this.checkCurrentDate("bind",C,n??604800,g);d=d&&z,g={...g,...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,g.sanctions={...g.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 ap.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,g.sanctions={...g.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,g,"sanctions",o),{isCorrect:K,queryResultErrors:z}=await this.checkSanctionsExclusionPublicInputs(r,i,v,E);d=d&&K&&P,g={...g,...z,...L};let{isCorrect:q,queryResultErrors:Y}=await this.checkCurrentDate("sanctions",C,n??604800,g);d=d&&q,g={...g,...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,g.facematch={...g.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 ip(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,g.facematch={...g.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,g,"facematch",o),{isCorrect:L,queryResultErrors:K}=await this.checkFacematchPublicInputs(r,i,E);d=d&&L&&D,g={...g,...K,...P};let{isCorrect:z,queryResultErrors:q}=await this.checkCurrentDate("facematch",C,n??604800,g);d=d&&z,g={...g,...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,g={...g,...F},d&&h&&(h===er.SALTED||h===er.SALTED_MOCK))try{let T=await I4(s??w4),C=await v4(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=qs(v.proof,Hs(v.name));E=m4(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===er.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:g}}},z7={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}]},U5=class{static getDetails(){return {functionName:"verify",abi:z7.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=qs(t.proof,Hs(t.name)),s=[],a=[];for(let h in t.committedInputs){let y=g4(h),b=h;s.push({circuitName:b,count:y});let A="";if(b==="inclusion_check_issuing_country_evm"||b==="inclusion_check_nationality_evm"||b==="exclusion_check_issuing_country_evm"||b==="exclusion_check_nationality_evm"){let g=t.committedInputs[b].countries;(b==="exclusion_check_issuing_country_evm"||b==="exclusion_check_nationality_evm")&&g.sort((_,w)=>_.localeCompare(w));let x=(()=>{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}})();A=x.toString(16).padStart(2,"0")+ie[x].evm.toString(16).padStart(4,"0")+xo(g.map(_=>Array.from(new TextEncoder().encode(_))).flat(),600).map(_=>_.toString(16).padStart(2,"0")).join("");}else if(b==="compare_age_evm"){let g=t.committedInputs[b];A=le.AGE.toString(16).padStart(2,"0")+ie[le.AGE].evm.toString(16).padStart(4,"0")+g.minAge.toString(16).padStart(2,"0")+g.maxAge.toString(16).padStart(2,"0");}else if(b==="compare_birthdate_evm"){let g=t.committedInputs[b],x=Array.from(Ie(g.minDateTimestamp,8)),_=Array.from(Ie(g.maxDateTimestamp,8));A=le.BIRTHDATE.toString(16).padStart(2,"0")+ie[le.BIRTHDATE].evm.toString(16).padStart(4,"0")+x.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 g=t.committedInputs[b],x=Array.from(Ie(g.minDateTimestamp,8)),_=Array.from(Ie(g.maxDateTimestamp,8));A=le.EXPIRY_DATE.toString(16).padStart(2,"0")+ie[le.EXPIRY_DATE].evm.toString(16).padStart(4,"0")+x.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 g=t.committedInputs[b];A=le.DISCLOSE.toString(16).padStart(2,"0")+ie[le.DISCLOSE].evm.toString(16).padStart(4,"0")+g.discloseMask.map(x=>x.toString(16).padStart(2,"0")).join("")+g.disclosedBytes.map(x=>x.toString(16).padStart(2,"0")).join("");}else if(b==="bind_evm"){let g=t.committedInputs[b];A=le.BIND.toString(16).padStart(2,"0")+ie[le.BIND].evm.toString(16).padStart(4,"0")+xo(H0(g.data),509).map(x=>x.toString(16).padStart(2,"0")).join("");}else if(b==="exclusion_check_sanctions_evm"){let g=t.committedInputs[b];A+=le.SANCTIONS_EXCLUSION.toString(16).padStart(2,"0"),A+=ie[le.SANCTIONS_EXCLUSION].evm.toString(16).padStart(4,"0"),A+=Array.from(Ie(BigInt(g.rootHash),32)).map(x=>x.toString(16).padStart(2,"0")).join(""),A+=g.isStrict?"01":"00";}else if(b.startsWith("facematch")&&b.endsWith("_evm")){let g=t.committedInputs[b];A+=le.FACEMATCH.toString(16).padStart(2,"0"),A+=ie[le.FACEMATCH].evm.toString(16).padStart(4,"0"),A+=Array.from(Ie(BigInt(g.rootKeyLeaf),32)).map(x=>x.toString(16).padStart(2,"0")).join(""),A+=g.environment==="development"?"00":"01",A+=Array.from(Ie(BigInt(g.appIdHash),32)).map(x=>x.toString(16).padStart(2,"0")).join(""),A+=Array.from(Ie(BigInt(g.integrityPubkeyHash),32)).map(x=>x.toString(16).padStart(2,"0")).join(""),A+=g.mode==="regular"?"01":"02";}else throw new Error(`Unsupported circuit for EVM verification: ${b}`);a.push({circuitName:b,inputs:A});}let l=dp(o).map(h=>h.toString(16).padStart(64,"0")),c="";for(let h of l){let y=a.find(b=>{let A=tt(kn(b.inputs)),g=new Uint8Array(A.length);for(let x=0;x<A.length-1;x++)g[x+1]=A[x];return g[0]=0,Tn(g)===h.replace("0x","")});if(y)if(s.find(A=>A.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${Tn(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 $7({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(`${V5}/public/proofs`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({domain:t,proofs:s,query:r,queryResult:i,scope:n,sdkVersion:$5,requestId:o}),signal:AbortSignal.timeout(3e4)});a.ok?P5.debug("API response status:",a.status):P5.warn("API request failed with status:",a.status);}catch{}}var V7=[0,20,0];function j7(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]=V7;return r!==o?r>o?"v5":"v4":i!==s?i>s?"v5":"v4":n>=a?"v5":"v4"}async function X7(t,{writingDirectory:e}={}){await W7(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(()=>et(I5(),1)),l=await a.new({crsPath:r});return {verifier:new s(l),destroy:()=>l.destroy()}}let{UltraHonkVerifierBackend:i,Barretenberg:n}=await Promise.resolve().then(()=>et(E5(),1)),o=await n.new({crsPath:r});return {verifier:new i(o),destroy:()=>o.destroy()}}var L5="__zkpassport_bb_version",H5="keyval-store";async function W7(t){if(!(typeof indexedDB>"u"))try{let e=typeof localStorage<"u"?localStorage:void 0;if((e?.getItem(L5)??"v4")===t)return;let r=!0;if(typeof indexedDB.databases=="function")try{r=(await indexedDB.databases()).some(i=>i.name===H5);}catch{r=!0;}r&&await new Promise(i=>{let n=indexedDB.deleteDatabase(H5);n.onsuccess=n.onerror=n.onblocked=()=>i();}),e?.setItem(L5,t);}catch{}}async function K5({proofs:t,originalQuery:e,queryResult:r,domain:i,validity:n,scope:o,devMode:s,oprfKeyId:a}){try{let l=await fetch(`${q7}/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=Oo.Buffer,typeof window<"u"&&(window.Buffer=Oo.Buffer));var q5="Verify identity privately",G5=false;function Z7(){G5||(G5=true,console.warn("[zkpassport] onResult is deprecated. Use onSuccess and verify the proofs on your backend with verify()."));}var Hh=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&&$7({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,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]=Yf(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=sa(r)),aa("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"),z5(e,[r,i],t,this.topicToConfig),this.getZkPassportRequest(t)),in:(e,r)=>(this.assertNotPolicyLocked(t,"in"),r=r.map(i=>sa(i)),aa("in",e,r,t,this.topicToConfig),this.getZkPassportRequest(t)),out:(e,r)=>(this.assertNotPolicyLocked(t,"out"),r=r.map(i=>sa(i)),aa("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||q5),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===er.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=>{Z7(),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=`${V5}/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:A}){if(d==="offline-query")throw new Error("You cannot override the topic with 'offline-query'");if(c&&l===er.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 g=null;try{g=await this.getDashboardConfig(),this.dashboardConfigError=null;}catch(w){this.dashboardConfigError=w;}let x=await kh.create({keyPair:u,bridgeId:d,bridgeUrl:y}),_=x.connection.getBridgeId();return this.topicToConfig[_]={},this.topicToCallerPurpose[_]=r,this.topicToService[_]={name:t||g?.project?.name||this.domain,logo:e||g?.project?.logoUrl||"",purpose:r||q5,scope:i,projectID:n,cloudProverUrl:h,bridgeUrl:y},this.topicToProofs[_]=[],this.topicToLocalConfig[_]={validity:s||604800,mode:o||"fast",devMode:a??false,uniqueIdentifierType:c?er.SALTED:l,oprfKeyId:c??null,returnDeepLink:b,verifierMode:A},this.onRequestReceivedCallbacks[_]=[],this.onGeneratingProofCallbacks[_]=[],this.onBridgeConnectCallbacks[_]=[],this.onProofGeneratedCallbacks[_]=[],this.onSuccessCallbacks[_]=[],this.onResultCallbacks[_]=[],this.onRejectCallbacks[_]=[],this.onErrorCallbacks[_]=[],this.topicToPublicKey[_]=x.getPublicKey(),this.topicToBridge[_]=x,x.onConnect(async w=>{await Promise.all(this.onBridgeConnectCallbacks[_].map(I=>I()));}),x.onSecureChannelEstablished(async()=>{await Promise.all(this.onRequestReceivedCallbacks[_].map(w=>w()));}),x.onSecureMessage(async w=>{this.handleEncryptedMessage(_,w);}),this.getZkPassportRequest(_)}createQuery(){return K7()}async verify({proofs:t,originalQuery:e,queryResult:r,validity:i,scope:n,devMode:o=false,writingDirectory:s,oprfKeyId:a,verifierMode:l="auto"}){if(!e||!r)throw new Error("verify() requires `originalQuery` and `queryResult`");let c={uniqueIdentifier:void 0,uniqueIdentifierType:void 0,verified:false};if(!t||t.length===0)return c;let d={proofs:t,originalQuery:e,queryResult:r,validity:i,scope:n,devMode:o,oprfKeyId:a},u={...d,writingDirectory:s},h={...d,domain:this.domain};if(l==="local")return this.verifyLocally(u);if(l==="api")return await K5(h)??c;let y;try{if(y=await this.verifyLocally(u),y.verified)return y}catch(b){console.warn("Local proof verification failed:",b);}return await K5(h)??y??c}async verifyLocally({proofs:t,originalQuery:e,queryResult:r,validity:i,scope:n,devMode:o=false,writingDirectory:s,oprfKeyId:a}){let l=Yf(r);typeof window>"u"&&!s&&(s="/tmp");let c=j7(t[0]?.version),{verifier:d,destroy:u}=await X7(c,{writingDirectory:s}),h=true,y,b,A;try{let{isCorrect:g,uniqueIdentifier:x,uniqueIdentifierType:_,queryResultErrors:w}=await G7.checkPublicInputs(this.domain,t,e,l,i,n,a,o);if(y=x,b=_,h=g,A=g?void 0:w,(b===er.SALTED_MOCK||b===er.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 Pl({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=qs(H.proof,Hs(U)),T=await I.getPackagedCircuit(U,N,{validate:!O});if(O)try{let{createPublicClient:C,http:E}=await Promise.resolve().then(()=>et(T5(),1)),{sepolia:v}=await Promise.resolve().then(()=>et(Lh(),1)),{mainnet:B}=await Promise.resolve().then(()=>et(Lh(),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=Oo.Buffer.from(T.vkey,"base64");try{h=await d.verifyProof({proof:Oo.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:A}}getSolidityVerifierDetails(){return U5.getDetails()}getSolidityVerifierParameters({proof:t,validityPeriodInSeconds:e=604800,domain:r,scope:i,devMode:n=false}){return U5.getParameters({proof:t,validityPeriodInSeconds:e,domain:r??this.domain,scope:i,devMode:n})}_getUrl(t){let e=Oo.Buffer.from(JSON.stringify(this.topicToConfig[t])).toString("base64"),r=Oo.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=${$5}&dt=${n}&dev=${this.topicToLocalConfig[t].devMode?"1":"0"}`;return o&&(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 fd="[zkpassport]";function Y7(){try{return typeof localStorage<"u"&&localStorage.getItem("zkpassport:debug")==="1"}catch{return false}}var Yr={error(...t){console.error(fd,...t);},warn(...t){console.warn(fd,...t);},info(...t){console.info(fd,...t);},debug(...t){Y7()&&console.debug(fd,...t);}};function X5(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,A]=cr(0),[g,x]=cr({received:0,total:null}),_=Uo(t);_.current=t;let w=Uo(null),I=Uo("preparing"),N=Uo(e),H=Uo(null);H.current===null&&(H.current=new Hh(t.domain)),Rc(()=>{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),x({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=(nt,ye)=>{Yr.error(ye),i("error");let xe=ye instanceof Error?ye.message:String(ye);Tr(_.current.onError,`${nt}: ${xe}`);},re=nt=>(...ye)=>{if(!F)try{nt(...ye);}catch(xe){ae("Failed to handle a verification update",xe);}},me=(nt,ye=false)=>{I.current=nt,ye&&(N.current=false),N.current||i(nt);};return H.current.request({...$,verifierMode:"api"}).then(nt=>{if(F)return;let ye;try{ye=D(nt);}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=>{x(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=wn=>{F||(N.current=!1,i(wn));},Gh;try{Gh=_.current.onSuccess?.(xe);}catch(wn){Yr.error(wn),Qr("error");return}Promise.resolve(Gh).then(wn=>Qr(wn===!1?"error":"success"),wn=>{Yr.error(wn),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(Q7(ye.url));}catch(xe){ae("Failed to render the QR code",xe);}}).catch(nt=>{F||ae("Failed to start the verification request",nt);}),()=>{F=true;}},[b]);let O=Pd(()=>{Tr(_.current.onRetryClicked),A(F=>F+1);},[]),U=Pd(()=>{N.current=false,i(I.current);},[]);return {state:r,url:n,qrSvg:s,query:l,serviceName:d,serviceLogo:h,retry:O,continueWithPhone:U,proofProgress:g}}function Q7(t){let e=j5.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 J7={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"},ev=["birthdate","expiry_date"],pd="Read from your ID chip, nothing else is shared";function sr(t,e){if(e instanceof Date)return e.toLocaleDateString();if(ev.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 W5(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 tv(t){return J7[t]??String(t).replace(/_/g," ")}function rv(t,e,r){let i=tv(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:pd});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:pd});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:pd});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: ${W5(t,e.in)}`,detail:`Your actual ${i} stays hidden`}),e.out!=null&&r.push({title:`Your ${i} is not one of: ${W5(t,e.out)}`,detail:`Your actual ${i} stays hidden`}),e.disclose&&r.push({title:`Share your ${i}`,detail:pd});}function Z5(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}rv(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 Y5(){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 hd(){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 iv=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:--iv,__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 J5({options:t,controlRef:e}){h2(dv,[]);let{state:r,url:i,qrSvg:n,query:o,serviceName:s,serviceLogo:a,retry:l,continueWithPhone:c,proofProgress:d}=X5(t);Rc(()=>{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??"",A=t.logo??a??"",g=r==="scanned"||r==="generating"||r==="success"||r==="error",x=!!o?.facematch,_=sv(r),w=r==="waiting"||r==="scanned",[I,N]=cr(false),H=Y5(),O=hd(),F=H&&(r==="preparing"||r==="connecting"||r==="waiting")&&!I,T=av(r,g,x,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:v2}}):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:da}}),A?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:A,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(ov,{appName:b||"This app",items:Z5(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(cv,{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(lv,{status:C.status,icon:C.icon,children:C.label},C.key))})]}):null,y?G("div",{className:`zkp-collapse${g?" 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(Q5,{href:b2,badge:E2}),G(Q5,{href:S2,badge:B2})]})]})]})}):null,r==="error"?G("div",{className:"zkp-result-actions",children:G("button",{type:"button",className:"zkp-retry",onClick:l,children:"Try again"})}):null]})]})}var nv='<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 ov({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:Lo}}),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:nv}}),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 sv(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 av(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:y2,target:"_blank",rel:"noopener noreferrer",children:"Download"})," the ZKPassport mobile app."]}),status:d,icon:e?null:C2},{key:"scan",label:n?"Tap \u201COpen ZKPassport App\u201D above.":"Scan this QR code with the ZKPassport app.",status:d,icon:e?null:A2},{key:"approve",label:"Approve the request on your phone.",status:t==="scanned"?"current":s||o?"done":"pending",icon:e?null:_2}];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 cv({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:da}}):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:x2}}):null,t==="scanned"?G("div",{className:"zkp-scanned-phone",dangerouslySetInnerHTML:{__html:I2}}):null,t==="success"?G("div",{className:"zkp-check",dangerouslySetInnerHTML:{__html:Lo}}):null,t==="error"?G("div",{className:"zkp-error-icon",dangerouslySetInnerHTML:{__html:w2}}):null]}),r?G("div",{className:"zkp-overlay-caption",children:r},t):null]})]})}function lv({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??Lo}}),G("div",{className:"zkp-step-text",children:r})]})}function Q5({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 dv(){Oc(T2,"card");}var e8=`@layer zkpassport {
881
+ /* "Verify with ZKPassport" button (opens the hosted popup).
882
+ Customize via CSS custom properties on the mount element or any ancestor:
883
+ --zkp-btn-bg/-fg/-border-color/-radius/-padding/-font/-font-size/-letter-spacing/
884
+ -text-transform, and --zkp-btn-success/-error for the verified and failed states.
885
+ Sizing hangs off --zkp-btn-font-size: the icon, gap and padding are all in em.
886
+
887
+ !important throughout: host resets (e.g. Tailwind preflight) are unlayered
888
+ and would otherwise strip these. */
889
+ .zkp-verify-button {
890
+ --zkp-bg: #ffffff;
891
+ --zkp-brand: #2139a3;
892
+ --zkp-border: #d3d9e8;
893
+ appearance: none !important;
894
+ -webkit-appearance: none !important;
895
+ -webkit-tap-highlight-color: transparent !important;
896
+ display: inline-flex !important;
897
+ align-items: center !important;
898
+ justify-content: center !important;
899
+ padding: var(--zkp-btn-padding, 0.8667em 1.6em) !important;
900
+ border: 1px solid var(--zkp-btn-border-color, var(--zkp-border)) !important;
901
+ border-radius: var(--zkp-btn-radius, 8px) !important;
902
+ background: var(--zkp-btn-bg, var(--zkp-bg)) !important;
903
+ color: var(--zkp-btn-fg, var(--zkp-brand)) !important;
904
+ font-family: var(
905
+ --zkp-btn-font,
906
+ ui-sans-serif,
907
+ system-ui,
908
+ -apple-system,
909
+ sans-serif
910
+ ) !important;
911
+ font-size: var(--zkp-btn-font-size, 15px) !important;
912
+ white-space: nowrap !important;
913
+ font-weight: 600 !important;
914
+ letter-spacing: var(--zkp-btn-letter-spacing, 0.04em) !important;
915
+ text-transform: var(--zkp-btn-text-transform, none) !important;
916
+ line-height: 1.2 !important;
917
+ cursor: pointer !important;
918
+ transition:
919
+ filter 150ms ease,
920
+ transform 150ms ease;
921
+ }
922
+ .zkp-verify-wrap[data-theme="dark"] .zkp-verify-button {
923
+ --zkp-bg: #0f172a;
924
+ --zkp-brand: #93b0f5;
925
+ --zkp-border: #334155;
926
+ }
927
+ @media (prefers-color-scheme: dark) {
928
+ .zkp-verify-wrap[data-theme="auto"] .zkp-verify-button {
929
+ --zkp-bg: #0f172a;
930
+ --zkp-brand: #93b0f5;
931
+ --zkp-border: #334155;
932
+ }
933
+ }
934
+ .zkp-verify-button:hover:not(:disabled) {
935
+ filter: brightness(0.97);
936
+ }
937
+ .zkp-verify-button:active:not(:disabled) {
938
+ transform: translateY(1px);
939
+ filter: brightness(0.95);
940
+ }
941
+ /* Both states share one grid cell, so the button is as wide as the longer of the two
942
+ and never resizes when it switches to "Verified" */
943
+ .zkp-verify-content {
944
+ display: grid !important;
945
+ grid-template-areas: "state" !important;
946
+ justify-items: center !important;
947
+ }
948
+ .zkp-verify-state {
949
+ grid-area: state !important;
950
+ display: inline-flex !important;
951
+ align-items: center !important;
952
+ gap: 0.7333em !important;
953
+ }
954
+ .zkp-verify-button:not([data-status="success"]) .zkp-verify-state-success,
955
+ .zkp-verify-button[data-status="success"] .zkp-verify-state-default {
956
+ visibility: hidden !important;
957
+ }
958
+ .zkp-verify-button-mark {
959
+ position: relative;
960
+ display: inline-flex;
961
+ width: 1.3333em;
962
+ height: 1.3333em;
963
+ flex: none;
964
+ }
965
+ .zkp-verify-button-mark svg {
966
+ width: 100%;
967
+ height: 100%;
968
+ display: block;
969
+ }
970
+ /* !important: unlayered host resets (Tailwind preflight sets border-width: 0
971
+ on all ::after elements) would otherwise erase the ring */
972
+ .zkp-verify-button[data-status="in-progress"] .zkp-verify-button-mark::after {
973
+ content: "" !important;
974
+ position: absolute !important;
975
+ inset: -0.3333em !important;
976
+ border-radius: 50% !important;
977
+ border: 0.1333em solid color-mix(in srgb, currentColor 35%, transparent) !important;
978
+ border-top-color: currentColor !important;
979
+ box-sizing: border-box !important;
980
+ animation: zkp-spinner-rotate 0.9s linear infinite !important;
981
+ }
982
+ .zkp-verify-wrap {
983
+ display: inline-flex;
984
+ flex-direction: column;
985
+ align-items: center;
986
+ gap: 8px;
987
+ --zkp-success: #15803d;
988
+ --zkp-error: #dc2626;
989
+ }
990
+ .zkp-verify-wrap[data-theme="dark"] {
991
+ --zkp-success: #4ade80;
992
+ --zkp-error: #f87171;
993
+ }
994
+ @media (prefers-color-scheme: dark) {
995
+ .zkp-verify-wrap[data-theme="auto"] {
996
+ --zkp-success: #4ade80;
997
+ --zkp-error: #f87171;
998
+ }
999
+ }
1000
+ .zkp-verify-error {
1001
+ margin: 0 !important;
1002
+ font-family: ui-sans-serif, system-ui, sans-serif !important;
1003
+ font-size: 12.5px !important;
1004
+ line-height: 1.4 !important;
1005
+ color: var(--zkp-btn-error, var(--zkp-error)) !important;
1006
+ }
1007
+ .zkp-verify-button:disabled {
1008
+ cursor: default !important;
1009
+ transform: none !important;
1010
+ }
1011
+ /* Only the waiting state is dimmed; success is an outcome, not an unavailable button */
1012
+ .zkp-verify-button[data-status="in-progress"] {
1013
+ opacity: 0.65 !important;
1014
+ filter: saturate(0.75) !important;
1015
+ }
1016
+ .zkp-verify-button[data-status="success"] {
1017
+ color: var(--zkp-btn-success, var(--zkp-success)) !important;
1018
+ }
1019
+
1020
+ @keyframes zkp-spinner-rotate {
1021
+ to {
1022
+ transform: rotate(360deg);
1023
+ }
1024
+ }
1025
+ }
1026
+ `;var gd=et(Uh(),1);(0, gd.registerLocale)(dd);function Kh(t){if(t==="Zero Knowledge Republic")return "ZKR";let e;return e=(0, gd.getAlpha3Code)(t,"en")||t||"ZKR",e}function md(t,e,r,i,n){n[i][e]={...n[i][e],[t]:r};}function fv(t,e,r,i){i[r][t]={...i[r][t],range:e};}function qh(t,e,r,i,n){n[i][e]={...n[i][e],[t]:r};}function t8(){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=Kh(s)),qh("eq",o,s,e,t),n),gte:(o,s)=>{if(i("gte"),md("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"),md("gt",o,s,e,t),n),lte:(o,s)=>(i("lte"),md("lte",o,s,e,t),n),lt:(o,s)=>(i("lt"),md("lt",o,s,e,t),n),range:(o,s,a)=>(i("range"),fv(o,[s,a],e,t),n),in:(o,s)=>(i("in"),s=s.map(a=>Kh(a)),qh("in",o,s,e,t),n),out:(o,s)=>(i("out"),s=s.map(a=>Kh(a)),qh("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 pv="https://verify.zkpassport.id";function hv(t){return !!t&&t.zkpassport===true&&typeof t.type=="string"}var r8=460,i8=780,mv=500;function n8(t){if(typeof window>"u")return null;let e=t.popupUrl??pv,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(hv(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,...A}=h;s.onSuccess?.(A);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?.());},mv),{popup:o,close:()=>{c();try{o.close();}catch{}}}}var gv={name:true,logo:true,purpose:true,scope:true,mode:true,devMode:true,validity:true,uniqueIdentifierType:true,oprfKeyId:true},yv="Popup blocked. Allow popups for this site and try again.",bv="Couldn't open the verification window here. Open this page in Safari or Chrome and try again.";function o8(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=Sv(l);}catch(h){Yr.error(h),o("error"),l.onError?.("Failed to build the verification query");return}let u=n8({popupUrl:l.popupUrl,request:xv(l),query:d,callbacks:{onRequestReceived:()=>t().onRequestReceived?.(),onGeneratingProof:()=>t().onGeneratingProof?.(),onProofGenerated:h=>t().onProofGenerated?.(h),onSuccess:h=>{let y=A=>{n===c&&o(A);},b;try{b=t().onSuccess?.(h);}catch(A){Yr.error(A),y("error");return}Promise.resolve(b).then(A=>y(A===false?"error":"success"),A=>{Yr.error(A),y("error");});},onReject:()=>{o("error"),t().onReject?.();},onError:h=>t().onError?.(h),onClose:()=>{o("idle"),t().onClose?.();}}});if(!u){o("error",hd()?bv:yv),l.onError?.("Popup blocked");return}i=u,o("in-progress");},close:()=>{n++,i?.close(),i=null;}}}function Sv(t){let e=t8();return t.policyId&&e.policy(t.policyId),t.query(e).query}function xv(t){let e={};for(let r of Object.keys(gv)){let i=t[r];i!==void 0&&(e[r]=i);}return e}var s8={small:"13px",medium:"15px",large:"18px"},a8="Verify with ZKPassport",c8="Verified";function l8(t){return t==="in-progress"||t==="success"}function d8(t){return t==="in-progress"?"Verification is running in the ZKPassport window":t==="success"?"Verification complete":"Opens a secure ZKPassport window"}function u8(t,e){return t==="error"&&e.showErrorMessage!==false}function f8(t){return t??"Verification failed. Click to try again."}function yd(t,e){return e?`${t} ${e}`:t}var Cv=typeof window>"u"?react.useEffect:react.useLayoutEffect;function wv({children:t,...e}){let[r,i]=react.useState({status:"idle",error:null}),n=react.useRef(e);n.current=e;let[o]=react.useState(()=>o8(()=>n.current,i));react.useEffect(()=>o.close,[o]);let s={...r,isLoading:r.status==="in-progress",verify:o.verify};return t?jsxRuntime.jsx(jsxRuntime.Fragment,{children:t(s)}):jsxRuntime.jsx(Iv,{options:e,verification:s})}function Iv({options:t,verification:e}){Cv(()=>Oc(e8,"button"),[]);let{status:r}=e;return jsxRuntime.jsxs("div",{className:yd("zkp-verify-wrap",t.classes?.root),"data-theme":t.theme??"light",style:t.size?{"--zkp-btn-font-size":s8[t.size]}:void 0,children:[jsxRuntime.jsx("button",{type:"button",className:yd("zkp-verify-button",t.classes?.button),"data-status":r,disabled:l8(r),title:d8(r),onClick:e.verify,children:jsxRuntime.jsxs("span",{className:"zkp-verify-content",children:[jsxRuntime.jsxs("span",{className:"zkp-verify-state zkp-verify-state-default",children:[jsxRuntime.jsx("span",{className:"zkp-verify-button-mark",dangerouslySetInnerHTML:{__html:da}}),jsxRuntime.jsx("span",{children:t.label??a8})]}),jsxRuntime.jsxs("span",{className:"zkp-verify-state zkp-verify-state-success",children:[jsxRuntime.jsx("span",{className:"zkp-verify-button-mark",dangerouslySetInnerHTML:{__html:Lo}}),jsxRuntime.jsx("span",{children:c8})]})]})}),u8(r,t)&&jsxRuntime.jsx("p",{className:yd("zkp-verify-error",t.classes?.error),role:"alert",children:f8(e.error)})]})}function _X(t){let e=react.useRef(null);return react.useEffect(()=>{let r=e.current;if(r)return ()=>{Bd(null,r);}},[]),react.useEffect(()=>{let r=e.current;r&&Bd(Id(J5,{options:t}),r);}),jsxRuntime.jsx("div",{ref:e})}/*! Bundled license information:
1027
+
1028
+ pvtsutils/build/index.js:
1029
+ (*!
1030
+ * MIT License
1031
+ *
1032
+ * Copyright (c) 2017-2024 Peculiar Ventures, LLC
1033
+ *
1034
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
1035
+ * of this software and associated documentation files (the "Software"), to deal
1036
+ * in the Software without restriction, including without limitation the rights
1037
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
1038
+ * copies of the Software, and to permit persons to whom the Software is
1039
+ * furnished to do so, subject to the following conditions:
1040
+ *
1041
+ * The above copyright notice and this permission notice shall be included in all
1042
+ * copies or substantial portions of the Software.
1043
+ *
1044
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1045
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1046
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1047
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1048
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
1049
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
1050
+ * SOFTWARE.
1051
+ *
1052
+ *)
1053
+
1054
+ ieee754/index.js:
1055
+ (*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> *)
1056
+
1057
+ buffer/index.js:
1058
+ (*!
1059
+ * The buffer module from node.js, for the browser.
1060
+ *
1061
+ * @author Feross Aboukhadijeh <https://feross.org>
1062
+ * @license MIT
1063
+ *)
1064
+
1065
+ @noble/curves/utils.js:
1066
+ @noble/curves/abstract/modular.js:
1067
+ @noble/curves/abstract/curve.js:
1068
+ @noble/curves/abstract/weierstrass.js:
1069
+ @noble/curves/nist.js:
1070
+ @noble/curves/abstract/edwards.js:
1071
+ @noble/curves/misc.js:
1072
+ (*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) *)
1073
+
1074
+ pvutils/build/utils.es.js:
1075
+ (*!
1076
+ Copyright (c) Peculiar Ventures, LLC
1077
+ *)
1078
+
1079
+ asn1js/build/index.es.js:
1080
+ (*!
1081
+ * Copyright (c) 2014, GMO GlobalSign
1082
+ * Copyright (c) 2015-2022, Peculiar Ventures
1083
+ * All rights reserved.
1084
+ *
1085
+ * Author 2014-2019, Yury Strozhevsky
1086
+ *
1087
+ * Redistribution and use in source and binary forms, with or without modification,
1088
+ * are permitted provided that the following conditions are met:
1089
+ *
1090
+ * * Redistributions of source code must retain the above copyright notice, this
1091
+ * list of conditions and the following disclaimer.
1092
+ *
1093
+ * * Redistributions in binary form must reproduce the above copyright notice, this
1094
+ * list of conditions and the following disclaimer in the documentation and/or
1095
+ * other materials provided with the distribution.
1096
+ *
1097
+ * * Neither the name of the copyright holder nor the names of its
1098
+ * contributors may be used to endorse or promote products derived from
1099
+ * this software without specific prior written permission.
1100
+ *
1101
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
1102
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
1103
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
1104
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
1105
+ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
1106
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
1107
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
1108
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
1109
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
1110
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
1111
+ *
1112
+ *)
1113
+
1114
+ @zk-kit/utils/dist/index.browser.js:
1115
+ (**
1116
+ * @module @zk-kit/utils
1117
+ * @version 1.3.0
1118
+ * @file Essential zero-knowledge utility library for JavaScript developers.
1119
+ * @copyright Ethereum Foundation 2025
1120
+ * @license MIT
1121
+ * @see [Github]{@link https://github.com/privacy-scaling-explorations/zk-kit/tree/main/packages/utils}
1122
+ *)
1123
+
1124
+ @noble/ciphers/esm/utils.js:
1125
+ (*! noble-ciphers - MIT License (c) 2023 Paul Miller (paulmillr.com) *)
1126
+
1127
+ @noble/secp256k1/index.js:
1128
+ (*! noble-secp256k1 - MIT License (c) 2019 Paul Miller (paulmillr.com) *)
1129
+
1130
+ @noble/hashes/esm/utils.js:
1131
+ (*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) *)
1132
+
1133
+ pako/dist/pako.esm.mjs:
1134
+ (*! pako 2.1.0 https://github.com/nodeca/pako @license (MIT AND Zlib) *)
1135
+ */exports.ASEAN_COUNTRIES=x4;exports.EEA_COUNTRIES=b4;exports.EU_COUNTRIES=ml;exports.MERCOSUR_COUNTRIES=A4;exports.NullifierType=er;exports.ProofType=le;exports.ProofTypeLength=ie;exports.SANCTIONED_COUNTRIES=y4;exports.SCHENGEN_COUNTRIES=S4;exports.VerifyWithZKPassportButton=wv;exports.ZKPassport=Hh;exports.ZKPassportQRCode=_X;//# sourceMappingURL=react.cjs.map
570
1136
  //# sourceMappingURL=react.cjs.map