@zkpassport/ui 0.15.2 → 0.15.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -0
- package/dist/cjs/index.cjs +2 -2
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/cjs/index.d.cts +1 -1
- package/dist/cjs/react.cjs +2 -2
- package/dist/cjs/react.cjs.map +1 -1
- package/dist/cjs/react.d.cts +2 -2
- package/dist/cjs/{types-ZVs5vysN.d.cts → types-DjMZu04q.d.cts} +6 -0
- package/dist/esm/index.d.ts +1 -1
- package/dist/esm/index.js +2 -2
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/react.d.ts +2 -2
- package/dist/esm/react.js +2 -2
- package/dist/esm/react.js.map +1 -1
- package/dist/esm/{types-ZVs5vysN.d.ts → types-DjMZu04q.d.ts} +6 -0
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -78,6 +78,10 @@ Props are a 1:1 mirror of `sdk.request(...)`'s argument shape, plus:
|
|
|
78
78
|
|
|
79
79
|
- `domain?` — passed to `new ZKPassport(...)`. Defaults to `window.location.hostname`.
|
|
80
80
|
- `query` (required) — receives the SDK's `QueryBuilder`, applies gates and returns `queryBuilder.done()`.
|
|
81
|
+
- `display?` — toggle optional card sections (each defaults to shown):
|
|
82
|
+
- `header` — the ZKPassport mark, app logo, and intro line.
|
|
83
|
+
- `steps` — the numbered verification steps.
|
|
84
|
+
- `appLinks` — the footer with the App Store / Google Play download links.
|
|
81
85
|
- Lifecycle callbacks (see table above).
|
|
82
86
|
|
|
83
87
|
So `name`, `logo`, `purpose`, `scope`, `mode`, `devMode`, `validity`, `uniqueIdentifierType`, `oprfKeyId` are all valid props with their SDK-derived types. New SDK request fields appear automatically on the next SDK bump.
|
package/dist/cjs/index.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
'use strict';var Ce=require('qrcode'),sdk=require('@zkpassport/sdk');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var Ce__default=/*#__PURE__*/_interopDefault(Ce);var Y,v,M1,P,x1,Z1,L1,a1,G,I,S1,l1,s1,i1,K={},Q=[],ue=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,J=Array.isArray;function Z(e,t){for(var r in t)e[r]=t[r];return e}function c1(e){e&&e.parentNode&&e.parentNode.removeChild(e);}function X(e,t,r){var a,s,n,p={};for(n in t)n=="key"?a=t[n]:n=="ref"?s=t[n]:p[n]=t[n];if(arguments.length>2&&(p.children=arguments.length>3?Y.call(arguments,2):r),typeof e=="function"&&e.defaultProps!=null)for(n in e.defaultProps)p[n]===void 0&&(p[n]=e.defaultProps[n]);return F(e,p,a,s,null)}function F(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??++M1,__i:-1,__u:0};return s==null&&v.vnode!=null&&v.vnode(n),n}function L(e){return e.children}function $(e,t){this.props=e,this.context=t;}function q(e,t){if(t==null)return e.__?q(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"?q(e):null}function fe(e){if(e.__P&&e.__d){var t=e.__v,r=t.__e,a=[],s=[],n=Z({},t);n.__v=t.__v+1,v.vnode&&v.vnode(n),_1(e.__P,n,t,e.__n,e.__P.namespaceURI,32&t.__u?[r]:null,a,r??q(t),!!(32&t.__u),s),n.__v=t.__v,n.__.__k[n.__i]=n,H1(a,n,s),t.__e=t.__=null,n.__e!=r&&N1(n);}}function N1(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}),N1(e)}function C1(e){(!e.__d&&(e.__d=true)&&P.push(e)&&!W.__r++||x1!=v.debounceRendering)&&((x1=v.debounceRendering)||Z1)(W);}function W(){try{for(var e,t=1;P.length;)P.length>t&&P.sort(L1),e=P.shift(),t=P.length,fe(e);}finally{P.length=W.__r=0;}}function R1(e,t,r,a,s,n,p,l,u,i,f){var o,_,d,g,b,z,m,h=a&&a.__k||Q,M=t.length;for(u=he(r,t,h,u,M),o=0;o<M;o++)(d=r.__k[o])!=null&&(_=d.__i!=-1&&h[d.__i]||K,d.__i=o,z=_1(e,d,_,s,n,p,l,u,i,f),g=d.__e,d.ref&&_.ref!=d.ref&&(_.ref&&d1(_.ref,null,d),f.push(d.ref,d.__c||g,d)),b==null&&g!=null&&(b=g),(m=!!(4&d.__u))||_.__k===d.__k?(u=P1(d,u,e,m),m&&_.__e&&(_.__e=null)):typeof d.type=="function"&&z!==void 0?u=z:g&&(u=g.nextSibling),d.__u&=-7);return r.__e=b,u}function he(e,t,r,a,s){var n,p,l,u,i,f=r.length,o=f,_=0;for(e.__k=new Array(s),n=0;n<s;n++)(p=t[n])!=null&&typeof p!="boolean"&&typeof p!="function"?(typeof p=="string"||typeof p=="number"||typeof p=="bigint"||p.constructor==String?p=e.__k[n]=F(null,p,null,null,null):J(p)?p=e.__k[n]=F(L,{children:p},null,null,null):p.constructor===void 0&&p.__b>0?p=e.__k[n]=F(p.type,p.props,p.key,p.ref?p.ref:null,p.__v):e.__k[n]=p,u=n+_,p.__=e,p.__b=e.__b+1,l=null,(i=p.__i=ve(p,r,u,o))!=-1&&(o--,(l=r[i])&&(l.__u|=2)),l==null||l.__v==null?(i==-1&&(s>f?_--:s<f&&_++),typeof p.type!="function"&&(p.__u|=4)):i!=u&&(i==u-1?_--:i==u+1?_++:(i>u?_--:_++,p.__u|=4))):e.__k[n]=null;if(o)for(n=0;n<f;n++)(l=r[n])!=null&&(2&l.__u)==0&&(l.__e==a&&(a=q(l)),q1(l,l));return a}function P1(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=P1(s[n],t,r,a));return t}e.__e!=t&&(a&&(t&&e.type&&!t.parentNode&&(t=q(e)),r.insertBefore(e.__e,t||null)),t=e.__e);do t=t&&t.nextSibling;while(t!=null&&t.nodeType==8);return t}function ve(e,t,r,a){var s,n,p,l=e.key,u=e.type,i=t[r],f=i!=null&&(2&i.__u)==0;if(i===null&&l==null||f&&l==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[p=s>=0?s--:n++])!=null&&(2&i.__u)==0&&l==i.key&&u==i.type)return p}return -1}function b1(e,t,r){t[0]=="-"?e.setProperty(t,r??""):e[t]=r==null?"":typeof r!="number"||ue.test(t)?r:r+"px";}function j(e,t,r,a,s){var n,p;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||b1(e.style,t,"");if(r)for(t in r)a&&r[t]==a[t]||b1(e.style,t,r[t]);}else if(t[0]=="o"&&t[1]=="n")n=t!=(t=t.replace(S1,"$1")),p=t.toLowerCase(),t=p in e||t=="onFocusOut"||t=="onFocusIn"?p.slice(2):t.slice(2),e.l||(e.l={}),e.l[t+n]=r,r?a?r[I]=a[I]:(r[I]=l1,e.addEventListener(t,n?i1:s1,n)):e.removeEventListener(t,n?i1:s1,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 w1(e){return function(t){if(this.l){var r=this.l[t.type+e];if(t[G]==null)t[G]=l1++;else if(t[G]<r[I])return;return r(v.event?v.event(t):t)}}}function _1(e,t,r,a,s,n,p,l,u,i){var f,o,_,d,g,b,z,m,h,M,N,A,o1,E,B,w=t.type;if(t.constructor!==void 0)return null;128&r.__u&&(u=!!(32&r.__u),n=[l=t.__e=r.__e]),(f=v.__b)&&f(t);e:if(typeof w=="function")try{if(m=t.props,h=w.prototype&&w.prototype.render,M=(f=w.contextType)&&a[f.__c],N=f?M?M.props.value:f.__:a,r.__c?z=(o=t.__c=r.__c).__=o.__E:(h?t.__c=o=new w(m,N):(t.__c=o=new $(m,N),o.constructor=w,o.render=ge),M&&M.sub(o),o.state||(o.state={}),o.__n=a,_=o.__d=!0,o.__h=[],o._sb=[]),h&&o.__s==null&&(o.__s=o.state),h&&w.getDerivedStateFromProps!=null&&(o.__s==o.state&&(o.__s=Z({},o.__s)),Z(o.__s,w.getDerivedStateFromProps(m,o.__s))),d=o.props,g=o.state,o.__v=t,_)h&&w.getDerivedStateFromProps==null&&o.componentWillMount!=null&&o.componentWillMount(),h&&o.componentDidMount!=null&&o.__h.push(o.componentDidMount);else {if(h&&w.getDerivedStateFromProps==null&&m!==d&&o.componentWillReceiveProps!=null&&o.componentWillReceiveProps(m,N),t.__v==r.__v||!o.__e&&o.shouldComponentUpdate!=null&&o.shouldComponentUpdate(m,o.__s,N)===!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(R){R&&(R.__=t);}),Q.push.apply(o.__h,o._sb),o._sb=[],o.__h.length&&p.push(o);break e}o.componentWillUpdate!=null&&o.componentWillUpdate(m,o.__s,N),h&&o.componentDidUpdate!=null&&o.__h.push(function(){o.componentDidUpdate(d,g,b);});}if(o.context=N,o.props=m,o.__P=e,o.__e=!1,A=v.__r,o1=0,h)o.state=o.__s,o.__d=!1,A&&A(t),f=o.render(o.props,o.state,o.context),Q.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&&++o1<25);o.state=o.__s,o.getChildContext!=null&&(a=Z(Z({},a),o.getChildContext())),h&&!_&&o.getSnapshotBeforeUpdate!=null&&(b=o.getSnapshotBeforeUpdate(d,g)),E=f!=null&&f.type===L&&f.key==null?A1(f.props.children):f,l=R1(e,J(E)?E:[E],t,r,a,s,n,p,l,u,i),o.base=t.__e,t.__u&=-161,o.__h.length&&p.push(o),z&&(o.__E=o.__=null);}catch(R){if(t.__v=null,u||n!=null)if(R.then){for(t.__u|=u?160:128;l&&l.nodeType==8&&l.nextSibling;)l=l.nextSibling;n[n.indexOf(l)]=null,t.__e=l;}else {for(B=n.length;B--;)c1(n[B]);p1(t);}else t.__e=r.__e,t.__k=r.__k,R.then||p1(t);v.__e(R,t,r);}else n==null&&t.__v==r.__v?(t.__k=r.__k,t.__e=r.__e):l=t.__e=me(r.__e,t,r,a,s,n,p,u,i);return (f=v.diffed)&&f(t),128&t.__u?void 0:l}function p1(e){e&&(e.__c&&(e.__c.__e=true),e.__k&&e.__k.some(p1));}function H1(e,t,r){for(var a=0;a<r.length;a++)d1(r[a],r[++a],r[++a]);v.__c&&v.__c(t,e),e.some(function(s){try{e=s.__h,s.__h=[],e.some(function(n){n.call(s);});}catch(n){v.__e(n,s.__v);}});}function A1(e){return typeof e!="object"||e==null||e.__b>0?e:J(e)?e.map(A1):e.constructor!==void 0?null:Z({},e)}function me(e,t,r,a,s,n,p,l,u){var i,f,o,_,d,g,b,z=r.props||K,m=t.props,h=t.type;if(h=="svg"?s="http://www.w3.org/2000/svg":h=="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((d=n[i])&&"setAttribute"in d==!!h&&(h?d.localName==h:d.nodeType==3)){e=d,n[i]=null;break}}if(e==null){if(h==null)return document.createTextNode(m);e=document.createElementNS(s,h,m.is&&m),l&&(v.__m&&v.__m(t,n),l=false),n=null;}if(h==null)z===m||l&&e.data==m||(e.data=m);else {if(n=h=="textarea"&&m.defaultValue!=null?null:n&&Y.call(e.childNodes),!l&&n!=null)for(z={},i=0;i<e.attributes.length;i++)z[(d=e.attributes[i]).name]=d.value;for(i in z)d=z[i],i=="dangerouslySetInnerHTML"?o=d:i=="children"||i in m||i=="value"&&"defaultValue"in m||i=="checked"&&"defaultChecked"in m||j(e,i,null,d,s);for(i in m)d=m[i],i=="children"?_=d:i=="dangerouslySetInnerHTML"?f=d:i=="value"?g=d:i=="checked"?b=d:l&&typeof d!="function"||z[i]===d||j(e,i,d,z[i],s);if(f)l||o&&(f.__html==o.__html||f.__html==e.innerHTML)||(e.innerHTML=f.__html),t.__k=[];else if(o&&(e.innerHTML=""),R1(t.type=="template"?e.content:e,J(_)?_:[_],t,r,a,h=="foreignObject"?"http://www.w3.org/1999/xhtml":s,n,p,n?n[0]:r.__k&&q(r,0),l,u),n!=null)for(i=n.length;i--;)c1(n[i]);l&&h!="textarea"||(i="value",h=="progress"&&g==null?e.removeAttribute("value"):g!=null&&(g!==e[i]||h=="progress"&&!g||h=="option"&&g!=z[i])&&j(e,i,g,z[i],s),i="checked",b!=null&&b!=e[i]&&j(e,i,b,z[i],s));}return e}function d1(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){v.__e(s,r);}}function q1(e,t,r){var a,s;if(v.unmount&&v.unmount(e),(a=e.ref)&&(a.current&&a.current!=e.__e||d1(a,null,t)),(a=e.__c)!=null){if(a.componentWillUnmount)try{a.componentWillUnmount();}catch(n){v.__e(n,t);}a.base=a.__P=null;}if(a=e.__k)for(s=0;s<a.length;s++)a[s]&&q1(a[s],t,r||typeof e.type!="function");r||c1(e.__e),e.__c=e.__=e.__e=void 0;}function ge(e,t,r){return this.constructor(e,r)}function e1(e,t,r){var a,s,n,p;t==document&&(t=document.documentElement),v.__&&v.__(e,t),s=(a="undefined"=="function")?null:t.__k,n=[],p=[],_1(t,e=(t).__k=X(L,null,[e]),s||K,K,t.namespaceURI,s?null:t.firstChild?Y.call(t.childNodes):null,n,s?s.__e:t.firstChild,a,p),H1(n,e,p);}Y=Q.slice,v={__e:function(e,t,r,a){for(var s,n,p;t=t.__;)if((s=t.__c)&&!s.__)try{if((n=s.constructor)&&n.getDerivedStateFromError!=null&&(s.setState(n.getDerivedStateFromError(e)),p=s.__d),s.componentDidCatch!=null&&(s.componentDidCatch(e,a||{}),p=s.__d),p)return s.__E=s}catch(l){e=l;}throw e}},M1=0,$.prototype.setState=function(e,t){var r;r=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=Z({},this.state),typeof e=="function"&&(e=e(Z({},r),this.props)),e&&Z(r,e),e!=null&&this.__v&&(t&&this._sb.push(t),C1(this));},$.prototype.forceUpdate=function(e){this.__v&&(this.__e=true,e&&this.__h.push(e),C1(this));},$.prototype.render=L,P=[],Z1=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,L1=function(e,t){return e.__v.__b-t.__v.__b},W.__r=0,a1=Math.random().toString(8),G="__d"+a1,I="__a"+a1,S1=/(PointerCapture)$|Capture$/i,l1=0,s1=w1(false),i1=w1(true);var O,k,u1,O1,D=0,j1=[],y=v,E1=y.__b,T1=y.__r,I1=y.diffed,D1=y.__c,V1=y.unmount,U1=y.__;function r1(e,t){y.__h&&y.__h(k,e,D||t),D=0;var r=k.__H||(k.__H={__:[],__h:[]});return e>=r.__.length&&r.__.push({}),r.__[e]}function V(e){return D=1,ke(K1,e)}function ke(e,t,r){var a=r1(O++,2);if(a.t=e,!a.__c&&(a.__=[K1(void 0,t),function(l){var u=a.__N?a.__N[0]:a.__[0],i=a.t(u,l);u!==i&&(a.__N=[i,a.__[1]],a.__c.setState({}));}],a.__c=k,!k.__f)){var s=function(l,u,i){if(!a.__c.__H)return true;var f=a.__c.__H.__.filter(function(_){return _.__c});if(f.every(function(_){return !_.__N}))return !n||n.call(this,l,u,i);var o=a.__c.props!==l;return f.some(function(_){if(_.__N){var d=_.__[0];_.__=_.__N,_.__N=void 0,d!==_.__[0]&&(o=true);}}),n&&n.call(this,l,u,i)||o};k.__f=true;var n=k.shouldComponentUpdate,p=k.componentWillUpdate;k.componentWillUpdate=function(l,u,i){if(this.__e){var f=n;n=void 0,s(l,u,i),n=f;}p&&p.call(this,l,u,i);},k.shouldComponentUpdate=s;}return a.__N||a.__}function n1(e,t){var r=r1(O++,3);!y.__s&&v1(r.__H,t)&&(r.__=e,r.u=t,k.__H.__h.push(r));}function G1(e,t){var r=r1(O++,4);!y.__s&&v1(r.__H,t)&&(r.__=e,r.u=t,k.__h.push(r));}function h1(e){return D=5,F1(function(){return {current:e}},[])}function F1(e,t){var r=r1(O++,7);return v1(r.__H,t)&&(r.__=e(),r.__H=t,r.__h=e),r.__}function $1(e,t){return D=8,F1(function(){return e},t)}function ye(){for(var e;e=j1.shift();){var t=e.__H;if(e.__P&&t)try{t.__h.some(t1),t.__h.some(f1),t.__h=[];}catch(r){t.__h=[],y.__e(r,e.__v);}}}y.__b=function(e){k=null,E1&&E1(e);},y.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),U1&&U1(e,t);},y.__r=function(e){T1&&T1(e),O=0;var t=(k=e.__c).__H;t&&(u1===k?(t.__h=[],k.__h=[],t.__.some(function(r){r.__N&&(r.__=r.__N),r.u=r.__N=void 0;})):(t.__h.some(t1),t.__h.some(f1),t.__h=[],O=0)),u1=k;},y.diffed=function(e){I1&&I1(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(j1.push(t)!==1&&O1===y.requestAnimationFrame||((O1=y.requestAnimationFrame)||ze)(ye)),t.__H.__.some(function(r){r.u&&(r.__H=r.u),r.u=void 0;})),u1=k=null;},y.__c=function(e,t){t.some(function(r){try{r.__h.some(t1),r.__h=r.__h.filter(function(a){return !a.__||f1(a)});}catch(a){t.some(function(s){s.__h&&(s.__h=[]);}),t=[],y.__e(a,r.__v);}}),D1&&D1(e,t);},y.unmount=function(e){V1&&V1(e);var t,r=e.__c;r&&r.__H&&(r.__H.__.some(function(a){try{t1(a);}catch(s){t=s;}}),r.__H=void 0,t&&y.__e(t,r.__v));};var B1=typeof requestAnimationFrame=="function";function ze(e){var t,r=function(){clearTimeout(a),B1&&cancelAnimationFrame(t),setTimeout(e);},a=setTimeout(r,35);B1&&(t=requestAnimationFrame(r));}function t1(e){var t=k,r=e.__c;typeof r=="function"&&(e.__c=void 0,r()),k=t;}function f1(e){var t=k;e.__c=e.__(),k=t;}function v1(e,t){return !e||e.length!==t.length||t.some(function(r,a){return r!==e[a]})}function K1(e,t){return typeof t=="function"?t(e):t}var Q1="https://zkpassport.id/r",W1="https://apps.apple.com/us/app/zkpassport/id6477371975",Y1="https://play.google.com/store/apps/details?id=app.zkpassport.zkpassport",m1='<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>',J1=`
|
|
1
|
+
'use strict';var Ce=require('qrcode'),sdk=require('@zkpassport/sdk');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var Ce__default=/*#__PURE__*/_interopDefault(Ce);var Y,m,M1,P,x1,Z1,L1,a1,G,I,S1,l1,s1,i1,K={},Q=[],ue=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,J=Array.isArray;function L(e,t){for(var r in t)e[r]=t[r];return e}function c1(e){e&&e.parentNode&&e.parentNode.removeChild(e);}function X(e,t,r){var a,s,n,p={};for(n in t)n=="key"?a=t[n]:n=="ref"?s=t[n]:p[n]=t[n];if(arguments.length>2&&(p.children=arguments.length>3?Y.call(arguments,2):r),typeof e=="function"&&e.defaultProps!=null)for(n in e.defaultProps)p[n]===void 0&&(p[n]=e.defaultProps[n]);return F(e,p,a,s,null)}function F(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??++M1,__i:-1,__u:0};return s==null&&m.vnode!=null&&m.vnode(n),n}function M(e){return e.children}function $(e,t){this.props=e,this.context=t;}function q(e,t){if(t==null)return e.__?q(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"?q(e):null}function fe(e){if(e.__P&&e.__d){var t=e.__v,r=t.__e,a=[],s=[],n=L({},t);n.__v=t.__v+1,m.vnode&&m.vnode(n),_1(e.__P,n,t,e.__n,e.__P.namespaceURI,32&t.__u?[r]:null,a,r??q(t),!!(32&t.__u),s),n.__v=t.__v,n.__.__k[n.__i]=n,H1(a,n,s),t.__e=t.__=null,n.__e!=r&&N1(n);}}function N1(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}),N1(e)}function C1(e){(!e.__d&&(e.__d=true)&&P.push(e)&&!W.__r++||x1!=m.debounceRendering)&&((x1=m.debounceRendering)||Z1)(W);}function W(){try{for(var e,t=1;P.length;)P.length>t&&P.sort(L1),e=P.shift(),t=P.length,fe(e);}finally{P.length=W.__r=0;}}function R1(e,t,r,a,s,n,p,l,u,i,f){var o,c,d,h,b,z,g,v=a&&a.__k||Q,Z=t.length;for(u=he(r,t,v,u,Z),o=0;o<Z;o++)(d=r.__k[o])!=null&&(c=d.__i!=-1&&v[d.__i]||K,d.__i=o,z=_1(e,d,c,s,n,p,l,u,i,f),h=d.__e,d.ref&&c.ref!=d.ref&&(c.ref&&d1(c.ref,null,d),f.push(d.ref,d.__c||h,d)),b==null&&h!=null&&(b=h),(g=!!(4&d.__u))||c.__k===d.__k?(u=P1(d,u,e,g),g&&c.__e&&(c.__e=null)):typeof d.type=="function"&&z!==void 0?u=z:h&&(u=h.nextSibling),d.__u&=-7);return r.__e=b,u}function he(e,t,r,a,s){var n,p,l,u,i,f=r.length,o=f,c=0;for(e.__k=new Array(s),n=0;n<s;n++)(p=t[n])!=null&&typeof p!="boolean"&&typeof p!="function"?(typeof p=="string"||typeof p=="number"||typeof p=="bigint"||p.constructor==String?p=e.__k[n]=F(null,p,null,null,null):J(p)?p=e.__k[n]=F(M,{children:p},null,null,null):p.constructor===void 0&&p.__b>0?p=e.__k[n]=F(p.type,p.props,p.key,p.ref?p.ref:null,p.__v):e.__k[n]=p,u=n+c,p.__=e,p.__b=e.__b+1,l=null,(i=p.__i=ve(p,r,u,o))!=-1&&(o--,(l=r[i])&&(l.__u|=2)),l==null||l.__v==null?(i==-1&&(s>f?c--:s<f&&c++),typeof p.type!="function"&&(p.__u|=4)):i!=u&&(i==u-1?c--:i==u+1?c++:(i>u?c--:c++,p.__u|=4))):e.__k[n]=null;if(o)for(n=0;n<f;n++)(l=r[n])!=null&&(2&l.__u)==0&&(l.__e==a&&(a=q(l)),q1(l,l));return a}function P1(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=P1(s[n],t,r,a));return t}e.__e!=t&&(a&&(t&&e.type&&!t.parentNode&&(t=q(e)),r.insertBefore(e.__e,t||null)),t=e.__e);do t=t&&t.nextSibling;while(t!=null&&t.nodeType==8);return t}function ve(e,t,r,a){var s,n,p,l=e.key,u=e.type,i=t[r],f=i!=null&&(2&i.__u)==0;if(i===null&&l==null||f&&l==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[p=s>=0?s--:n++])!=null&&(2&i.__u)==0&&l==i.key&&u==i.type)return p}return -1}function b1(e,t,r){t[0]=="-"?e.setProperty(t,r??""):e[t]=r==null?"":typeof r!="number"||ue.test(t)?r:r+"px";}function j(e,t,r,a,s){var n,p;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||b1(e.style,t,"");if(r)for(t in r)a&&r[t]==a[t]||b1(e.style,t,r[t]);}else if(t[0]=="o"&&t[1]=="n")n=t!=(t=t.replace(S1,"$1")),p=t.toLowerCase(),t=p in e||t=="onFocusOut"||t=="onFocusIn"?p.slice(2):t.slice(2),e.l||(e.l={}),e.l[t+n]=r,r?a?r[I]=a[I]:(r[I]=l1,e.addEventListener(t,n?i1:s1,n)):e.removeEventListener(t,n?i1:s1,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 w1(e){return function(t){if(this.l){var r=this.l[t.type+e];if(t[G]==null)t[G]=l1++;else if(t[G]<r[I])return;return r(m.event?m.event(t):t)}}}function _1(e,t,r,a,s,n,p,l,u,i){var f,o,c,d,h,b,z,g,v,Z,N,A,o1,E,B,w=t.type;if(t.constructor!==void 0)return null;128&r.__u&&(u=!!(32&r.__u),n=[l=t.__e=r.__e]),(f=m.__b)&&f(t);e:if(typeof w=="function")try{if(g=t.props,v=w.prototype&&w.prototype.render,Z=(f=w.contextType)&&a[f.__c],N=f?Z?Z.props.value:f.__:a,r.__c?z=(o=t.__c=r.__c).__=o.__E:(v?t.__c=o=new w(g,N):(t.__c=o=new $(g,N),o.constructor=w,o.render=ge),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=L({},o.__s)),L(o.__s,w.getDerivedStateFromProps(g,o.__s))),d=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&&g!==d&&o.componentWillReceiveProps!=null&&o.componentWillReceiveProps(g,N),t.__v==r.__v||!o.__e&&o.shouldComponentUpdate!=null&&o.shouldComponentUpdate(g,o.__s,N)===!1){t.__v!=r.__v&&(o.props=g,o.state=o.__s,o.__d=!1),t.__e=r.__e,t.__k=r.__k,t.__k.some(function(R){R&&(R.__=t);}),Q.push.apply(o.__h,o._sb),o._sb=[],o.__h.length&&p.push(o);break e}o.componentWillUpdate!=null&&o.componentWillUpdate(g,o.__s,N),v&&o.componentDidUpdate!=null&&o.__h.push(function(){o.componentDidUpdate(d,h,b);});}if(o.context=N,o.props=g,o.__P=e,o.__e=!1,A=m.__r,o1=0,v)o.state=o.__s,o.__d=!1,A&&A(t),f=o.render(o.props,o.state,o.context),Q.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&&++o1<25);o.state=o.__s,o.getChildContext!=null&&(a=L(L({},a),o.getChildContext())),v&&!c&&o.getSnapshotBeforeUpdate!=null&&(b=o.getSnapshotBeforeUpdate(d,h)),E=f!=null&&f.type===M&&f.key==null?A1(f.props.children):f,l=R1(e,J(E)?E:[E],t,r,a,s,n,p,l,u,i),o.base=t.__e,t.__u&=-161,o.__h.length&&p.push(o),z&&(o.__E=o.__=null);}catch(R){if(t.__v=null,u||n!=null)if(R.then){for(t.__u|=u?160:128;l&&l.nodeType==8&&l.nextSibling;)l=l.nextSibling;n[n.indexOf(l)]=null,t.__e=l;}else {for(B=n.length;B--;)c1(n[B]);p1(t);}else t.__e=r.__e,t.__k=r.__k,R.then||p1(t);m.__e(R,t,r);}else n==null&&t.__v==r.__v?(t.__k=r.__k,t.__e=r.__e):l=t.__e=me(r.__e,t,r,a,s,n,p,u,i);return (f=m.diffed)&&f(t),128&t.__u?void 0:l}function p1(e){e&&(e.__c&&(e.__c.__e=true),e.__k&&e.__k.some(p1));}function H1(e,t,r){for(var a=0;a<r.length;a++)d1(r[a],r[++a],r[++a]);m.__c&&m.__c(t,e),e.some(function(s){try{e=s.__h,s.__h=[],e.some(function(n){n.call(s);});}catch(n){m.__e(n,s.__v);}});}function A1(e){return typeof e!="object"||e==null||e.__b>0?e:J(e)?e.map(A1):e.constructor!==void 0?null:L({},e)}function me(e,t,r,a,s,n,p,l,u){var i,f,o,c,d,h,b,z=r.props||K,g=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((d=n[i])&&"setAttribute"in d==!!v&&(v?d.localName==v:d.nodeType==3)){e=d,n[i]=null;break}}if(e==null){if(v==null)return document.createTextNode(g);e=document.createElementNS(s,v,g.is&&g),l&&(m.__m&&m.__m(t,n),l=false),n=null;}if(v==null)z===g||l&&e.data==g||(e.data=g);else {if(n=v=="textarea"&&g.defaultValue!=null?null:n&&Y.call(e.childNodes),!l&&n!=null)for(z={},i=0;i<e.attributes.length;i++)z[(d=e.attributes[i]).name]=d.value;for(i in z)d=z[i],i=="dangerouslySetInnerHTML"?o=d:i=="children"||i in g||i=="value"&&"defaultValue"in g||i=="checked"&&"defaultChecked"in g||j(e,i,null,d,s);for(i in g)d=g[i],i=="children"?c=d:i=="dangerouslySetInnerHTML"?f=d:i=="value"?h=d:i=="checked"?b=d:l&&typeof d!="function"||z[i]===d||j(e,i,d,z[i],s);if(f)l||o&&(f.__html==o.__html||f.__html==e.innerHTML)||(e.innerHTML=f.__html),t.__k=[];else if(o&&(e.innerHTML=""),R1(t.type=="template"?e.content:e,J(c)?c:[c],t,r,a,v=="foreignObject"?"http://www.w3.org/1999/xhtml":s,n,p,n?n[0]:r.__k&&q(r,0),l,u),n!=null)for(i=n.length;i--;)c1(n[i]);l&&v!="textarea"||(i="value",v=="progress"&&h==null?e.removeAttribute("value"):h!=null&&(h!==e[i]||v=="progress"&&!h||v=="option"&&h!=z[i])&&j(e,i,h,z[i],s),i="checked",b!=null&&b!=e[i]&&j(e,i,b,z[i],s));}return e}function d1(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){m.__e(s,r);}}function q1(e,t,r){var a,s;if(m.unmount&&m.unmount(e),(a=e.ref)&&(a.current&&a.current!=e.__e||d1(a,null,t)),(a=e.__c)!=null){if(a.componentWillUnmount)try{a.componentWillUnmount();}catch(n){m.__e(n,t);}a.base=a.__P=null;}if(a=e.__k)for(s=0;s<a.length;s++)a[s]&&q1(a[s],t,r||typeof e.type!="function");r||c1(e.__e),e.__c=e.__=e.__e=void 0;}function ge(e,t,r){return this.constructor(e,r)}function e1(e,t,r){var a,s,n,p;t==document&&(t=document.documentElement),m.__&&m.__(e,t),s=(a="undefined"=="function")?null:t.__k,n=[],p=[],_1(t,e=(t).__k=X(M,null,[e]),s||K,K,t.namespaceURI,s?null:t.firstChild?Y.call(t.childNodes):null,n,s?s.__e:t.firstChild,a,p),H1(n,e,p);}Y=Q.slice,m={__e:function(e,t,r,a){for(var s,n,p;t=t.__;)if((s=t.__c)&&!s.__)try{if((n=s.constructor)&&n.getDerivedStateFromError!=null&&(s.setState(n.getDerivedStateFromError(e)),p=s.__d),s.componentDidCatch!=null&&(s.componentDidCatch(e,a||{}),p=s.__d),p)return s.__E=s}catch(l){e=l;}throw e}},M1=0,$.prototype.setState=function(e,t){var r;r=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=L({},this.state),typeof e=="function"&&(e=e(L({},r),this.props)),e&&L(r,e),e!=null&&this.__v&&(t&&this._sb.push(t),C1(this));},$.prototype.forceUpdate=function(e){this.__v&&(this.__e=true,e&&this.__h.push(e),C1(this));},$.prototype.render=M,P=[],Z1=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,L1=function(e,t){return e.__v.__b-t.__v.__b},W.__r=0,a1=Math.random().toString(8),G="__d"+a1,I="__a"+a1,S1=/(PointerCapture)$|Capture$/i,l1=0,s1=w1(false),i1=w1(true);var O,k,u1,O1,D=0,j1=[],y=m,E1=y.__b,T1=y.__r,I1=y.diffed,D1=y.__c,V1=y.unmount,U1=y.__;function r1(e,t){y.__h&&y.__h(k,e,D||t),D=0;var r=k.__H||(k.__H={__:[],__h:[]});return e>=r.__.length&&r.__.push({}),r.__[e]}function V(e){return D=1,ke(K1,e)}function ke(e,t,r){var a=r1(O++,2);if(a.t=e,!a.__c&&(a.__=[K1(void 0,t),function(l){var u=a.__N?a.__N[0]:a.__[0],i=a.t(u,l);u!==i&&(a.__N=[i,a.__[1]],a.__c.setState({}));}],a.__c=k,!k.__f)){var s=function(l,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,l,u,i);var o=a.__c.props!==l;return f.some(function(c){if(c.__N){var d=c.__[0];c.__=c.__N,c.__N=void 0,d!==c.__[0]&&(o=true);}}),n&&n.call(this,l,u,i)||o};k.__f=true;var n=k.shouldComponentUpdate,p=k.componentWillUpdate;k.componentWillUpdate=function(l,u,i){if(this.__e){var f=n;n=void 0,s(l,u,i),n=f;}p&&p.call(this,l,u,i);},k.shouldComponentUpdate=s;}return a.__N||a.__}function n1(e,t){var r=r1(O++,3);!y.__s&&v1(r.__H,t)&&(r.__=e,r.u=t,k.__H.__h.push(r));}function G1(e,t){var r=r1(O++,4);!y.__s&&v1(r.__H,t)&&(r.__=e,r.u=t,k.__h.push(r));}function h1(e){return D=5,F1(function(){return {current:e}},[])}function F1(e,t){var r=r1(O++,7);return v1(r.__H,t)&&(r.__=e(),r.__H=t,r.__h=e),r.__}function $1(e,t){return D=8,F1(function(){return e},t)}function ye(){for(var e;e=j1.shift();){var t=e.__H;if(e.__P&&t)try{t.__h.some(t1),t.__h.some(f1),t.__h=[];}catch(r){t.__h=[],y.__e(r,e.__v);}}}y.__b=function(e){k=null,E1&&E1(e);},y.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),U1&&U1(e,t);},y.__r=function(e){T1&&T1(e),O=0;var t=(k=e.__c).__H;t&&(u1===k?(t.__h=[],k.__h=[],t.__.some(function(r){r.__N&&(r.__=r.__N),r.u=r.__N=void 0;})):(t.__h.some(t1),t.__h.some(f1),t.__h=[],O=0)),u1=k;},y.diffed=function(e){I1&&I1(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(j1.push(t)!==1&&O1===y.requestAnimationFrame||((O1=y.requestAnimationFrame)||ze)(ye)),t.__H.__.some(function(r){r.u&&(r.__H=r.u),r.u=void 0;})),u1=k=null;},y.__c=function(e,t){t.some(function(r){try{r.__h.some(t1),r.__h=r.__h.filter(function(a){return !a.__||f1(a)});}catch(a){t.some(function(s){s.__h&&(s.__h=[]);}),t=[],y.__e(a,r.__v);}}),D1&&D1(e,t);},y.unmount=function(e){V1&&V1(e);var t,r=e.__c;r&&r.__H&&(r.__H.__.some(function(a){try{t1(a);}catch(s){t=s;}}),r.__H=void 0,t&&y.__e(t,r.__v));};var B1=typeof requestAnimationFrame=="function";function ze(e){var t,r=function(){clearTimeout(a),B1&&cancelAnimationFrame(t),setTimeout(e);},a=setTimeout(r,35);B1&&(t=requestAnimationFrame(r));}function t1(e){var t=k,r=e.__c;typeof r=="function"&&(e.__c=void 0,r()),k=t;}function f1(e){var t=k;e.__c=e.__(),k=t;}function v1(e,t){return !e||e.length!==t.length||t.some(function(r,a){return r!==e[a]})}function K1(e,t){return typeof t=="function"?t(e):t}var Q1="https://zkpassport.id/r",W1="https://apps.apple.com/us/app/zkpassport/id6477371975",Y1="https://play.google.com/store/apps/details?id=app.zkpassport.zkpassport",m1='<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>',J1=`
|
|
2
2
|
<svg width="100%" height="100%" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg" aria-hidden="true">
|
|
3
3
|
<defs>
|
|
4
4
|
<linearGradient id="zkp-spin-mark-grad" x1="15.0417" y1="0" x2="15.0417" y2="30.0755" gradientUnits="userSpaceOnUse">
|
|
@@ -564,6 +564,6 @@
|
|
|
564
564
|
}
|
|
565
565
|
}
|
|
566
566
|
}
|
|
567
|
-
`;function pe(e){let[t,r]=V("preparing"),[a,s]=V(null),[n,p]=V(null),[l,u]=V(0),i=h1(e);i.current=e;let f=h1(null);f.current===null&&(f.current=new sdk.ZKPassport(e.domain)),n1(()=>{let
|
|
567
|
+
`;function pe(e){let[t,r]=V("preparing"),[a,s]=V(null),[n,p]=V(null),[l,u]=V(0),i=h1(e);i.current=e;let f=h1(null);f.current===null&&(f.current=new sdk.ZKPassport(e.domain)),n1(()=>{let c=false,d=false;r("preparing"),s(null),p(null);let{domain:h,theme:b,query:z,onReady:g,onRetryClicked:v,onBridgeConnect:Z,onRequestReceived:N,onGeneratingProof:A,onProofGenerated:o1,onResult:E,onReject:B,onError:w,...R}=i.current,z1=()=>{d||(d=true,S(i.current.onReady));},H=T=>(...C)=>{if(!c)try{T(...C);}catch(x){console.error(x),r("error");}};return f.current.request(R).then(T=>{if(c)return;let C;try{C=z(T);}catch(x){console.error(x),r("error");return}C.onBridgeConnect(H(()=>{r(x=>x==="preparing"||x==="connecting"?"waiting":x),z1(),S(i.current.onBridgeConnect);})),C.onRequestReceived(H(()=>{r("scanned"),S(i.current.onRequestReceived);})),C.onGeneratingProof(H(()=>{r("generating"),S(i.current.onGeneratingProof);})),C.onProofGenerated(H(x=>{S(i.current.onProofGenerated,x);})),C.onResult(H(x=>{r(x.verified?"success":"error"),S(i.current.onResult,x);})),C.onReject(H(()=>{r("error"),S(i.current.onReject);})),C.onError(H(x=>{r("error"),S(i.current.onError,x);}));try{C.requestReceived()?r("scanned"):C.isBridgeConnected()?(r("waiting"),z1()):r("connecting");}catch(x){console.error(x),r("error");}s(C.url);try{p(we(C.url));}catch(x){console.error(x),r("error");}}).catch(T=>{c||(console.error(T),r("error"));}),()=>{c=true;}},[l]);let o=$1(()=>{S(i.current.onRetryClicked),u(c=>c+1);},[]);return {state:t,url:a,qrSvg:n,retry:o}}function we(e){let t=Ce__default.default.create(e,{errorCorrectionLevel:"Q"}),r=t.modules.size,a=t.modules.data,s=100/r,n=o=>o.toFixed(3),p=[[0,0],[0,r-7],[r-7,0]],l=(o,c)=>p.some(([d,h])=>o>=d&&o<d+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]||l(o,c))continue;let d=(c+.5)*s,h=(o+.5)*s;u+=`<circle cx="${n(d)}" cy="${n(h)}" r="${n(i)}"/>`;}let f="";for(let[o,c]of p){let d=(c+3.5)*s,h=(o+3.5)*s;f+=`<circle cx="${n(d)}" cy="${n(h)}" r="${n(s*3)}" fill="none" stroke="currentColor" stroke-width="${n(s)}"/><circle cx="${n(d)}" 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 Me=0;function _(e,t,r,a,s,n){t||(t={});var p,l,u=t;if("ref"in u)for(l in u={},t)l=="ref"?p=t[l]:u[l]=t[l];var i={type:e,props:u,key:r,ref:p,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--Me,__i:-1,__u:0,__source:s,__self:n};if(typeof e=="function"&&(p=e.defaultProps))for(l in p)u[l]===void 0&&(u[l]=p[l]);return m.vnode&&m.vnode(i),i}function y1({options:e,controlRef:t}){G1(Ne,[]);let{state:r,url:a,qrSvg:s,retry:n}=pe(e);n1(()=>{if(t)return t.current={retry:n},()=>{t.current=null;}},[n,t]);let p=e.display?.header??true,l=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=Le(r),d=Ze(r),h=r==="waiting"||r==="scanned";return _("div",{className:"zkp-card","data-state":r,"data-theme":e.theme??"auto",children:[h?_("button",{type:"button",className:"zkp-restart","aria-label":"Restart verification",title:"Restart verification",onClick:n,dangerouslySetInnerHTML:{__html:oe}}):null,p?_(M,{children:[_("div",{className:"zkp-header",children:[_("div",{className:"zkp-header-icons",children:[_("div",{className:"zkp-zkp-icon",dangerouslySetInnerHTML:{__html:m1}}),f?_(M,{children:[_("div",{className:"zkp-header-dots",children:[_("span",{}),_("span",{}),_("span",{})]}),_("div",{className:"zkp-app-icon-slot",children:_("img",{className:"zkp-app-icon",src:f,alt:i?`${i} icon`:""})})]}):null]}),_("p",{className:"zkp-title",children:[_("strong",{children:i||"This app"})," uses ",_("strong",{children:"ZKPassport"})," to verify identity without compromising your privacy."]})]}),_("div",{className:"zkp-divider zkp-divider-header"})]}):null,_(Se,{state:r,qrSvg:s,caption:d}),r==="waiting"&&a?_("a",{className:"zkp-open-app",href:a,children:"Open in ZKPassport App"}):null,l?_(M,{children:[_("div",{className:"zkp-divider zkp-divider-top"}),_("div",{className:"zkp-steps",children:[_(U,{status:c[0],icon:o?null:te,children:[_("a",{href:Q1,target:"_blank",rel:"noopener noreferrer",children:"Download"})," the ZKPassport mobile app."]}),_(U,{status:c[1],icon:o?null:X1,children:"Scan this QR code with the ZKPassport app."}),_(U,{status:c[2],icon:o?null:ee,children:"Approve the request on your phone."}),_("div",{className:`zkp-collapse${o?"":" zkp-collapse-out"}`,children:_(M,{children:[_(U,{status:c[3],icon:null,children:"Generate proof on your device."}),_(U,{status:c[4],icon:null,children:"Verify the proof."})]})})]})]}):null,u?_("div",{className:`zkp-collapse${o?" zkp-collapse-out":""}`,children:_("div",{className:"zkp-collapse-inner",children:[_("div",{className:"zkp-divider zkp-divider-bottom"}),_("div",{className:"zkp-footer",children:[_("span",{className:"zkp-footer-label",children:"ZKPassport App"}),_("div",{className:"zkp-store-buttons",children:[_(le,{href:W1,badge:ae}),_(le,{href:Y1,badge:se})]})]})]})}):null,r==="error"?_("div",{className:"zkp-result-actions",children:_("button",{type:"button",className:"zkp-retry",onClick:n,children:"Try again"})}):null]})}function Ze(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 Le(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 Se({state:e,qrSvg:t,caption:r}){return _("div",{className:"zkp-qr-slot","data-state":e,children:[_("div",{className:"zkp-skeleton"}),_("div",{className:"zkp-qr",dangerouslySetInnerHTML:t?{__html:t}:void 0}),t?_("div",{className:"zkp-qr-logo",dangerouslySetInnerHTML:{__html:m1}}):null,_("div",{className:"zkp-overlay",children:[_("div",{className:"zkp-overlay-body",children:[e==="connecting"||e==="generating"?_("div",{className:"zkp-spinner",dangerouslySetInnerHTML:{__html:J1}}):null,e==="scanned"?_("div",{className:"zkp-scanned-phone",dangerouslySetInnerHTML:{__html:ne}}):null,e==="success"?_("div",{className:"zkp-check",dangerouslySetInnerHTML:{__html:g1}}):null,e==="error"?_("div",{className:"zkp-error-icon",dangerouslySetInnerHTML:{__html:re}}):null]}),r?_("div",{className:"zkp-overlay-caption",children:r},e):null]})]})}function U({status:e,icon:t,children:r}){return _("div",{className:"zkp-step","data-status":e,"data-mode":t?"icon":"progress",children:[_("div",{className:"zkp-step-marker",dangerouslySetInnerHTML:{__html:t??g1}}),_("div",{className:"zkp-step-text",children:r})]})}function le({href:e,badge:t}){return _("a",{className:"zkp-store-button",href:e,target:"_blank",rel:"noopener noreferrer","aria-label":t.ariaLabel,dangerouslySetInnerHTML:{__html:t.svg}})}var ce="data-zkpassport-ui",k1=false;function Ne(){if(k1||typeof document>"u")return;if(document.querySelector(`style[${ce}]`)){k1=true;return}let e=document.createElement("style");e.setAttribute(ce,""),e.textContent=ie,document.head.appendChild(e),k1=true;}function Ye(e,t){if(typeof document>"u"||typeof window>"u")throw new Error("@zkpassport/ui: mount() requires a browser environment.");if(!(e instanceof HTMLElement))throw new Error("@zkpassport/ui: mount() requires an HTMLElement as the first argument.");let r=document.createElement("div");e.appendChild(r);let a={current:null},s=t;return e1(X(y1,{options:s,controlRef:a}),r),{update(n){s=n,e1(X(y1,{options:s,controlRef:a}),r);},retry(){a.current?.retry();},unmount(){e1(null,r),r.parentNode&&r.parentNode.removeChild(r);}}}
|
|
568
568
|
exports.mount=Ye;//# sourceMappingURL=index.cjs.map
|
|
569
569
|
//# sourceMappingURL=index.cjs.map
|