youverify-liveness-web 0.1.30 → 0.1.31
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 +1 -1
- package/dist/index.js +1 -1
- package/dist/index.umd.cjs +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -148,7 +148,7 @@ The `onSuccess` and `onFailure` callbacks (if supplied) are passed the following
|
|
|
148
148
|
| `data.livenessClip` | String | Video of user performing liveness check |
|
|
149
149
|
| `data.passed` | Boolean | Indicator on whether liveness check passed or failed |
|
|
150
150
|
| `data.metadata` | Any | Metadata passed in during initialization |
|
|
151
|
-
| `data.error` | Object | Error object containing error key(`eyes_closed`, `image_capture_failed`, `
|
|
151
|
+
| `data.error` | Object | Error object containing error key(`eyes_closed`, `image_capture_failed`, `API_ERROR`) and message (only present in failure cases) |
|
|
152
152
|
|
|
153
153
|
## Credits
|
|
154
154
|
|
package/dist/index.js
CHANGED
|
@@ -4353,7 +4353,7 @@ const _l = () => {
|
|
|
4353
4353
|
});
|
|
4354
4354
|
const o = document.createElement("script");
|
|
4355
4355
|
o.src = `${dr}/${r}`, o.async = !0, o.onerror = () => {
|
|
4356
|
-
n(new Error("Network error: Failed to load
|
|
4356
|
+
n(new Error("Network error: Failed to load SDK script."));
|
|
4357
4357
|
}, document.head.appendChild(o);
|
|
4358
4358
|
});
|
|
4359
4359
|
return window.azureSdkLoadPromise = e, e;
|
package/dist/index.umd.cjs
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
(function(ve,A){typeof exports=="object"&&typeof module<"u"?module.exports=A():typeof define=="function"&&define.amd?define(A):(ve=typeof globalThis<"u"?globalThis:ve||self,ve.YouverifyLiveness=A())})(this,function(){"use strict";var ve,A,In,Fe,Rn,On,Ht,Vt,Wt,zt,Hn,Ke={},Vn=[],Jo=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,dt=Array.isArray;function _e(e,t){for(var n in t)e[n]=t[n];return e}function Wn(e){var t=e.parentNode;t&&t.removeChild(e)}function le(e,t,n){var r,o,i,s={};for(i in t)i=="key"?r=t[i]:i=="ref"?o=t[i]:s[i]=t[i];if(arguments.length>2&&(s.children=arguments.length>3?ve.call(arguments,2):n),typeof e=="function"&&e.defaultProps!=null)for(i in e.defaultProps)s[i]===void 0&&(s[i]=e.defaultProps[i]);return Ge(e,s,r,o,null)}function Ge(e,t,n,r,o){var i={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:o??++In,__i:-1,__u:0};return o==null&&A.vnode!=null&&A.vnode(i),i}function Ut(){return{current:null}}function q(e){return e.children}function ue(e,t){this.props=e,this.context=t}function Me(e,t){if(t==null)return e.__?Me(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null)return n.__e;return typeof e.type=="function"?Me(e):null}function zn(e){var t,n;if((e=e.__)!=null&&e.__c!=null){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null){e.__e=e.__c.base=n.__e;break}return zn(e)}}function jt(e){(!e.__d&&(e.__d=!0)&&Fe.push(e)&&!ft.__r++||Rn!==A.debounceRendering)&&((Rn=A.debounceRendering)||On)(ft)}function ft(){var e,t,n,r,o,i,s,a;for(Fe.sort(Ht);e=Fe.shift();)e.__d&&(t=Fe.length,r=void 0,i=(o=(n=e).__v).__e,s=[],a=[],n.__P&&((r=_e({},o)).__v=o.__v+1,A.vnode&&A.vnode(r),Bt(n.__P,r,o,n.__n,n.__P.namespaceURI,32&o.__u?[i]:null,s,i??Me(o),!!(32&o.__u),a),r.__v=o.__v,r.__.__k[r.__i]=r,Yn(s,r,a),r.__e!=i&&zn(r)),Fe.length>t&&Fe.sort(Ht));ft.__r=0}function Un(e,t,n,r,o,i,s,a,c,u,d){var l,h,f,v,g,_=r&&r.__k||Vn,m=t.length;for(n.__d=c,Qo(n,t,_),c=n.__d,l=0;l<m;l++)(f=n.__k[l])!=null&&typeof f!="boolean"&&typeof f!="function"&&(h=f.__i===-1?Ke:_[f.__i]||Ke,f.__i=l,Bt(e,f,h,o,i,s,a,c,u,d),v=f.__e,f.ref&&h.ref!=f.ref&&(h.ref&&qt(h.ref,null,f),d.push(f.ref,f.__c||v,f)),g==null&&v!=null&&(g=v),65536&f.__u||h.__k===f.__k?c=jn(f,c,e):typeof f.type=="function"&&f.__d!==void 0?c=f.__d:v&&(c=v.nextSibling),f.__d=void 0,f.__u&=-196609);n.__d=c,n.__e=g}function Qo(e,t,n){var r,o,i,s,a,c=t.length,u=n.length,d=u,l=0;for(e.__k=[],r=0;r<c;r++)s=r+l,(o=e.__k[r]=(o=t[r])==null||typeof o=="boolean"||typeof o=="function"?null:typeof o=="string"||typeof o=="number"||typeof o=="bigint"||o.constructor==String?Ge(null,o,null,null,null):dt(o)?Ge(q,{children:o},null,null,null):o.constructor===void 0&&o.__b>0?Ge(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):o)!=null?(o.__=e,o.__b=e.__b+1,a=ei(o,n,s,d),o.__i=a,i=null,a!==-1&&(d--,(i=n[a])&&(i.__u|=131072)),i==null||i.__v===null?(a==-1&&l--,typeof o.type!="function"&&(o.__u|=65536)):a!==s&&(a==s-1?l=a-s:a==s+1?l++:a>s?d>c-s?l+=a-s:l--:a<s&&l++,a!==r+l&&(o.__u|=65536))):(i=n[s])&&i.key==null&&i.__e&&!(131072&i.__u)&&(i.__e==e.__d&&(e.__d=Me(i)),Yt(i,i,!1),n[s]=null,d--);if(d)for(r=0;r<u;r++)(i=n[r])!=null&&!(131072&i.__u)&&(i.__e==e.__d&&(e.__d=Me(i)),Yt(i,i))}function jn(e,t,n){var r,o;if(typeof e.type=="function"){for(r=e.__k,o=0;r&&o<r.length;o++)r[o]&&(r[o].__=e,t=jn(r[o],t,n));return t}e.__e!=t&&(t&&e.type&&!n.contains(t)&&(t=Me(e)),n.insertBefore(e.__e,t||null),t=e.__e);do t=t&&t.nextSibling;while(t!=null&&t.nodeType===8);return t}function ge(e,t){return t=t||[],e==null||typeof e=="boolean"||(dt(e)?e.some(function(n){ge(n,t)}):t.push(e)),t}function ei(e,t,n,r){var o=e.key,i=e.type,s=n-1,a=n+1,c=t[n];if(c===null||c&&o==c.key&&i===c.type&&!(131072&c.__u))return n;if(r>(c!=null&&!(131072&c.__u)?1:0))for(;s>=0||a<t.length;){if(s>=0){if((c=t[s])&&!(131072&c.__u)&&o==c.key&&i===c.type)return s;s--}if(a<t.length){if((c=t[a])&&!(131072&c.__u)&&o==c.key&&i===c.type)return a;a++}}return-1}function Bn(e,t,n){t[0]==="-"?e.setProperty(t,n??""):e[t]=n==null?"":typeof n!="number"||Jo.test(t)?n:n+"px"}function ht(e,t,n,r,o){var i;e:if(t==="style")if(typeof n=="string")e.style.cssText=n;else{if(typeof r=="string"&&(e.style.cssText=r=""),r)for(t in r)n&&t in n||Bn(e.style,t,"");if(n)for(t in n)r&&n[t]===r[t]||Bn(e.style,t,n[t])}else if(t[0]==="o"&&t[1]==="n")i=t!==(t=t.replace(/(PointerCapture)$|Capture$/i,"$1")),t=t.toLowerCase()in e||t==="onFocusOut"||t==="onFocusIn"?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+i]=n,n?r?n.u=r.u:(n.u=Vt,e.addEventListener(t,i?zt:Wt,i)):e.removeEventListener(t,i?zt:Wt,i);else{if(o=="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]=n??"";break e}catch{}typeof n=="function"||(n==null||n===!1&&t[4]!=="-"?e.removeAttribute(t):e.setAttribute(t,t=="popover"&&n==1?"":n))}}function qn(e){return function(t){if(this.l){var n=this.l[t.type+e];if(t.t==null)t.t=Vt++;else if(t.t<n.u)return;return n(A.event?A.event(t):t)}}}function Bt(e,t,n,r,o,i,s,a,c,u){var d,l,h,f,v,g,_,m,y,b,E,T,D,F,O,M,C=t.type;if(t.constructor!==void 0)return null;128&n.__u&&(c=!!(32&n.__u),i=[a=t.__e=n.__e]),(d=A.__b)&&d(t);e:if(typeof C=="function")try{if(m=t.props,y="prototype"in C&&C.prototype.render,b=(d=C.contextType)&&r[d.__c],E=d?b?b.props.value:d.__:r,n.__c?_=(l=t.__c=n.__c).__=l.__E:(y?t.__c=l=new C(m,E):(t.__c=l=new ue(m,E),l.constructor=C,l.render=ni),b&&b.sub(l),l.props=m,l.state||(l.state={}),l.context=E,l.__n=r,h=l.__d=!0,l.__h=[],l._sb=[]),y&&l.__s==null&&(l.__s=l.state),y&&C.getDerivedStateFromProps!=null&&(l.__s==l.state&&(l.__s=_e({},l.__s)),_e(l.__s,C.getDerivedStateFromProps(m,l.__s))),f=l.props,v=l.state,l.__v=t,h)y&&C.getDerivedStateFromProps==null&&l.componentWillMount!=null&&l.componentWillMount(),y&&l.componentDidMount!=null&&l.__h.push(l.componentDidMount);else{if(y&&C.getDerivedStateFromProps==null&&m!==f&&l.componentWillReceiveProps!=null&&l.componentWillReceiveProps(m,E),!l.__e&&(l.shouldComponentUpdate!=null&&l.shouldComponentUpdate(m,l.__s,E)===!1||t.__v===n.__v)){for(t.__v!==n.__v&&(l.props=m,l.state=l.__s,l.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.forEach(function(k){k&&(k.__=t)}),T=0;T<l._sb.length;T++)l.__h.push(l._sb[T]);l._sb=[],l.__h.length&&s.push(l);break e}l.componentWillUpdate!=null&&l.componentWillUpdate(m,l.__s,E),y&&l.componentDidUpdate!=null&&l.__h.push(function(){l.componentDidUpdate(f,v,g)})}if(l.context=E,l.props=m,l.__P=e,l.__e=!1,D=A.__r,F=0,y){for(l.state=l.__s,l.__d=!1,D&&D(t),d=l.render(l.props,l.state,l.context),O=0;O<l._sb.length;O++)l.__h.push(l._sb[O]);l._sb=[]}else do l.__d=!1,D&&D(t),d=l.render(l.props,l.state,l.context),l.state=l.__s;while(l.__d&&++F<25);l.state=l.__s,l.getChildContext!=null&&(r=_e(_e({},r),l.getChildContext())),y&&!h&&l.getSnapshotBeforeUpdate!=null&&(g=l.getSnapshotBeforeUpdate(f,v)),Un(e,dt(M=d!=null&&d.type===q&&d.key==null?d.props.children:d)?M:[M],t,n,r,o,i,s,a,c,u),l.base=t.__e,t.__u&=-161,l.__h.length&&s.push(l),_&&(l.__E=l.__=null)}catch(k){if(t.__v=null,c||i!=null){for(t.__u|=c?160:32;a&&a.nodeType===8&&a.nextSibling;)a=a.nextSibling;i[i.indexOf(a)]=null,t.__e=a}else t.__e=n.__e,t.__k=n.__k;A.__e(k,t,n)}else i==null&&t.__v===n.__v?(t.__k=n.__k,t.__e=n.__e):t.__e=ti(n.__e,t,n,r,o,i,s,c,u);(d=A.diffed)&&d(t)}function Yn(e,t,n){t.__d=void 0;for(var r=0;r<n.length;r++)qt(n[r],n[++r],n[++r]);A.__c&&A.__c(t,e),e.some(function(o){try{e=o.__h,o.__h=[],e.some(function(i){i.call(o)})}catch(i){A.__e(i,o.__v)}})}function ti(e,t,n,r,o,i,s,a,c){var u,d,l,h,f,v,g,_=n.props,m=t.props,y=t.type;if(y==="svg"?o="http://www.w3.org/2000/svg":y==="math"?o="http://www.w3.org/1998/Math/MathML":o||(o="http://www.w3.org/1999/xhtml"),i!=null){for(u=0;u<i.length;u++)if((f=i[u])&&"setAttribute"in f==!!y&&(y?f.localName===y:f.nodeType===3)){e=f,i[u]=null;break}}if(e==null){if(y===null)return document.createTextNode(m);e=document.createElementNS(o,y,m.is&&m),i=null,a=!1}if(y===null)_===m||a&&e.data===m||(e.data=m);else{if(i=i&&ve.call(e.childNodes),_=n.props||Ke,!a&&i!=null)for(_={},u=0;u<e.attributes.length;u++)_[(f=e.attributes[u]).name]=f.value;for(u in _)if(f=_[u],u!="children"){if(u=="dangerouslySetInnerHTML")l=f;else if(u!=="key"&&!(u in m)){if(u=="value"&&"defaultValue"in m||u=="checked"&&"defaultChecked"in m)continue;ht(e,u,null,f,o)}}for(u in m)f=m[u],u=="children"?h=f:u=="dangerouslySetInnerHTML"?d=f:u=="value"?v=f:u=="checked"?g=f:u==="key"||a&&typeof f!="function"||_[u]===f||ht(e,u,f,_[u],o);if(d)a||l&&(d.__html===l.__html||d.__html===e.innerHTML)||(e.innerHTML=d.__html),t.__k=[];else if(l&&(e.innerHTML=""),Un(e,dt(h)?h:[h],t,n,r,y==="foreignObject"?"http://www.w3.org/1999/xhtml":o,i,s,i?i[0]:n.__k&&Me(n,0),a,c),i!=null)for(u=i.length;u--;)i[u]!=null&&Wn(i[u]);a||(u="value",v!==void 0&&(v!==e[u]||y==="progress"&&!v||y==="option"&&v!==_[u])&&ht(e,u,v,_[u],o),u="checked",g!==void 0&&g!==e[u]&&ht(e,u,g,_[u],o))}return e}function qt(e,t,n){try{if(typeof e=="function"){var r=typeof e.__u=="function";r&&e.__u(),r&&t==null||(e.__u=e(t))}else e.current=t}catch(o){A.__e(o,n)}}function Yt(e,t,n){var r,o;if(A.unmount&&A.unmount(e),(r=e.ref)&&(r.current&&r.current!==e.__e||qt(r,null,t)),(r=e.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(i){A.__e(i,t)}r.base=r.__P=null}if(r=e.__k)for(o=0;o<r.length;o++)r[o]&&Yt(r[o],t,n||typeof e.type!="function");n||e.__e==null||Wn(e.__e),e.__c=e.__=e.__e=e.__d=void 0}function ni(e,t,n){return this.constructor(e,n)}function Ve(e,t,n){var r,o,i,s;A.__&&A.__(e,t),o=(r=typeof n=="function")?null:n&&n.__k||t.__k,i=[],s=[],Bt(t,e=(!r&&n||t).__k=le(q,null,[e]),o||Ke,Ke,t.namespaceURI,!r&&n?[n]:o?null:t.firstChild?ve.call(t.childNodes):null,i,!r&&n?n:o?o.__e:t.firstChild,r,s),Yn(i,e,s)}function Kn(e,t){Ve(e,t,Kn)}function ri(e,t,n){var r,o,i,s,a=_e({},e.props);for(i in e.type&&e.type.defaultProps&&(s=e.type.defaultProps),t)i=="key"?r=t[i]:i=="ref"?o=t[i]:a[i]=t[i]===void 0&&s!==void 0?s[i]:t[i];return arguments.length>2&&(a.children=arguments.length>3?ve.call(arguments,2):n),Ge(e.type,a,r||e.key,o||e.ref,null)}function ie(e,t){var n={__c:t="__cC"+Hn++,__:e,Consumer:function(r,o){return r.children(o)},Provider:function(r){var o,i;return this.getChildContext||(o=[],(i={})[t]=this,this.getChildContext=function(){return i},this.componentWillUnmount=function(){o=null},this.shouldComponentUpdate=function(s){this.props.value!==s.value&&o.some(function(a){a.__e=!0,jt(a)})},this.sub=function(s){o.push(s);var a=s.componentWillUnmount;s.componentWillUnmount=function(){o&&o.splice(o.indexOf(s),1),a&&a.call(s)}}),r.children}};return n.Provider.__=n.Consumer.contextType=n}ve=Vn.slice,A={__e:function(e,t,n,r){for(var o,i,s;t=t.__;)if((o=t.__c)&&!o.__)try{if((i=o.constructor)&&i.getDerivedStateFromError!=null&&(o.setState(i.getDerivedStateFromError(e)),s=o.__d),o.componentDidCatch!=null&&(o.componentDidCatch(e,r||{}),s=o.__d),s)return o.__E=o}catch(a){e=a}throw e}},In=0,ue.prototype.setState=function(e,t){var n;n=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=_e({},this.state),typeof e=="function"&&(e=e(_e({},n),this.props)),e&&_e(n,e),e!=null&&this.__v&&(t&&this._sb.push(t),jt(this))},ue.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),jt(this))},ue.prototype.render=q,Fe=[],On=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Ht=function(e,t){return e.__v.__b-t.__v.__b},ft.__r=0,Vt=0,Wt=qn(!1),zt=qn(!0),Hn=0;var oi=0;function p(e,t,n,r,o,i){t||(t={});var s,a,c=t;if("ref"in c)for(a in c={},t)a=="ref"?s=t[a]:c[a]=t[a];var u={type:e,props:c,key:n,ref:s,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:--oi,__i:-1,__u:0,__source:o,__self:i};if(typeof e=="function"&&(s=e.defaultProps))for(a in s)c[a]===void 0&&(c[a]=s[a]);return A.vnode&&A.vnode(u),u}var ye,Y,Kt,Gn,We=0,Zn=[],Z=A,Xn=Z.__b,Jn=Z.__r,Qn=Z.diffed,er=Z.__c,tr=Z.unmount,nr=Z.__;function xe(e,t){Z.__h&&Z.__h(Y,e,We||t),We=0;var n=Y.__H||(Y.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function x(e){return We=1,Ze(or,e)}function Ze(e,t,n){var r=xe(ye++,2);if(r.t=e,!r.__c&&(r.__=[n?n(t):or(void 0,t),function(a){var c=r.__N?r.__N[0]:r.__[0],u=r.t(c,a);c!==u&&(r.__N=[u,r.__[1]],r.__c.setState({}))}],r.__c=Y,!Y.u)){var o=function(a,c,u){if(!r.__c.__H)return!0;var d=r.__c.__H.__.filter(function(h){return!!h.__c});if(d.every(function(h){return!h.__N}))return!i||i.call(this,a,c,u);var l=!1;return d.forEach(function(h){if(h.__N){var f=h.__[0];h.__=h.__N,h.__N=void 0,f!==h.__[0]&&(l=!0)}}),!(!l&&r.__c.props===a)&&(!i||i.call(this,a,c,u))};Y.u=!0;var i=Y.shouldComponentUpdate,s=Y.componentWillUpdate;Y.componentWillUpdate=function(a,c,u){if(this.__e){var d=i;i=void 0,o(a,c,u),i=d}s&&s.call(this,a,c,u)},Y.shouldComponentUpdate=o}return r.__N||r.__}function W(e,t){var n=xe(ye++,3);!Z.__s&&Jt(n.__H,t)&&(n.__=e,n.i=t,Y.__H.__h.push(n))}function Pe(e,t){var n=xe(ye++,4);!Z.__s&&Jt(n.__H,t)&&(n.__=e,n.i=t,Y.__h.push(n))}function w(e){return We=5,U(function(){return{current:e}},[])}function Gt(e,t,n){We=6,Pe(function(){return typeof e=="function"?(e(t()),function(){return e(null)}):e?(e.current=t(),function(){return e.current=null}):void 0},n==null?n:n.concat(e))}function U(e,t){var n=xe(ye++,7);return Jt(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function j(e,t){return We=8,U(function(){return e},t)}function te(e){var t=Y.context[e.__c],n=xe(ye++,9);return n.c=e,t?(n.__==null&&(n.__=!0,t.sub(Y)),t.props.value):e.__}function Zt(e,t){Z.useDebugValue&&Z.useDebugValue(t?t(e):e)}function ii(e){var t=xe(ye++,10),n=x();return t.__=e,Y.componentDidCatch||(Y.componentDidCatch=function(r,o){t.__&&t.__(r,o),n[1](r)}),[n[0],function(){n[1](void 0)}]}function Ee(){var e=xe(ye++,11);if(!e.__){for(var t=Y.__v;t!==null&&!t.__m&&t.__!==null;)t=t.__;var n=t.__m||(t.__m=[0,0]);e.__="P"+n[0]+"-"+n[1]++}return e.__}function si(){for(var e;e=Zn.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(pt),e.__H.__h.forEach(Xt),e.__H.__h=[]}catch(t){e.__H.__h=[],Z.__e(t,e.__v)}}Z.__b=function(e){Y=null,Xn&&Xn(e)},Z.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),nr&&nr(e,t)},Z.__r=function(e){Jn&&Jn(e),ye=0;var t=(Y=e.__c).__H;t&&(Kt===Y?(t.__h=[],Y.__h=[],t.__.forEach(function(n){n.__N&&(n.__=n.__N),n.i=n.__N=void 0})):(t.__h.forEach(pt),t.__h.forEach(Xt),t.__h=[],ye=0)),Kt=Y},Z.diffed=function(e){Qn&&Qn(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(Zn.push(t)!==1&&Gn===Z.requestAnimationFrame||((Gn=Z.requestAnimationFrame)||ai)(si)),t.__H.__.forEach(function(n){n.i&&(n.__H=n.i),n.i=void 0})),Kt=Y=null},Z.__c=function(e,t){t.some(function(n){try{n.__h.forEach(pt),n.__h=n.__h.filter(function(r){return!r.__||Xt(r)})}catch(r){t.some(function(o){o.__h&&(o.__h=[])}),t=[],Z.__e(r,n.__v)}}),er&&er(e,t)},Z.unmount=function(e){tr&&tr(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach(function(r){try{pt(r)}catch(o){t=o}}),n.__H=void 0,t&&Z.__e(t,n.__v))};var rr=typeof requestAnimationFrame=="function";function ai(e){var t,n=function(){clearTimeout(r),rr&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,100);rr&&(t=requestAnimationFrame(n))}function pt(e){var t=Y,n=e.__c;typeof n=="function"&&(e.__c=void 0,n()),Y=t}function Xt(e){var t=Y;e.__c=e.__(),Y=t}function Jt(e,t){return!e||e.length!==t.length||t.some(function(n,r){return n!==e[r]})}function or(e,t){return typeof t=="function"?t(e):t}function ir(e,t){for(var n in t)e[n]=t[n];return e}function Qt(e,t){for(var n in e)if(n!=="__source"&&!(n in t))return!0;for(var r in t)if(r!=="__source"&&e[r]!==t[r])return!0;return!1}function mt(e,t){this.props=e,this.context=t}function sr(e,t){function n(o){var i=this.props.ref,s=i==o.ref;return!s&&i&&(i.call?i(null):i.current=null),t?!t(this.props,o)||!s:Qt(this.props,o)}function r(o){return this.shouldComponentUpdate=n,le(e,o)}return r.displayName="Memo("+(e.displayName||e.name)+")",r.prototype.isReactComponent=!0,r.__f=!0,r}(mt.prototype=new ue).isPureReactComponent=!0,mt.prototype.shouldComponentUpdate=function(e,t){return Qt(this.props,e)||Qt(this.state,t)};var ar=A.__b;A.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),ar&&ar(e)};var ci=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.forward_ref")||3911;function en(e){function t(n){var r=ir({},n);return delete r.ref,e(r,n.ref||null)}return t.$$typeof=ci,t.render=t,t.prototype.isReactComponent=t.__f=!0,t.displayName="ForwardRef("+(e.displayName||e.name)+")",t}var cr=function(e,t){return e==null?null:ge(ge(e).map(t))},lr={map:cr,forEach:cr,count:function(e){return e?ge(e).length:0},only:function(e){var t=ge(e);if(t.length!==1)throw"Children.only";return t[0]},toArray:ge},li=A.__e;A.__e=function(e,t,n,r){if(e.then){for(var o,i=t;i=i.__;)if((o=i.__c)&&o.__c)return t.__e==null&&(t.__e=n.__e,t.__k=n.__k),o.__c(e,t)}li(e,t,n,r)};var ur=A.unmount;function dr(e,t,n){return e&&(e.__c&&e.__c.__H&&(e.__c.__H.__.forEach(function(r){typeof r.__c=="function"&&r.__c()}),e.__c.__H=null),(e=ir({},e)).__c!=null&&(e.__c.__P===n&&(e.__c.__P=t),e.__c=null),e.__k=e.__k&&e.__k.map(function(r){return dr(r,t,n)})),e}function fr(e,t,n){return e&&n&&(e.__v=null,e.__k=e.__k&&e.__k.map(function(r){return fr(r,t,n)}),e.__c&&e.__c.__P===t&&(e.__e&&n.appendChild(e.__e),e.__c.__e=!0,e.__c.__P=n)),e}function Xe(){this.__u=0,this.t=null,this.__b=null}function hr(e){var t=e.__.__c;return t&&t.__a&&t.__a(e)}function pr(e){var t,n,r;function o(i){if(t||(t=e()).then(function(s){n=s.default||s},function(s){r=s}),r)throw r;if(!n)throw t;return le(n,i)}return o.displayName="Lazy",o.__f=!0,o}function ze(){this.u=null,this.o=null}A.unmount=function(e){var t=e.__c;t&&t.__R&&t.__R(),t&&32&e.__u&&(e.type=null),ur&&ur(e)},(Xe.prototype=new ue).__c=function(e,t){var n=t.__c,r=this;r.t==null&&(r.t=[]),r.t.push(n);var o=hr(r.__v),i=!1,s=function(){i||(i=!0,n.__R=null,o?o(a):a())};n.__R=s;var a=function(){if(!--r.__u){if(r.state.__a){var c=r.state.__a;r.__v.__k[0]=fr(c,c.__c.__P,c.__c.__O)}var u;for(r.setState({__a:r.__b=null});u=r.t.pop();)u.forceUpdate()}};r.__u++||32&t.__u||r.setState({__a:r.__b=r.__v.__k[0]}),e.then(s,s)},Xe.prototype.componentWillUnmount=function(){this.t=[]},Xe.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),r=this.__v.__k[0].__c;this.__v.__k[0]=dr(this.__b,n,r.__O=r.__P)}this.__b=null}var o=t.__a&&le(q,null,e.fallback);return o&&(o.__u&=-33),[le(q,null,t.__a?null:e.children),o]};var mr=function(e,t,n){if(++n[1]===n[0]&&e.o.delete(t),e.props.revealOrder&&(e.props.revealOrder[0]!=="t"||!e.o.size))for(n=e.u;n;){for(;n.length>3;)n.pop()();if(n[1]<n[0])break;e.u=n=n[2]}};function ui(e){return this.getChildContext=function(){return e.context},e.children}function di(e){var t=this,n=e.i;t.componentWillUnmount=function(){Ve(null,t.l),t.l=null,t.i=null},t.i&&t.i!==n&&t.componentWillUnmount(),t.l||(t.i=n,t.l={nodeType:1,parentNode:n,childNodes:[],contains:function(){return!0},appendChild:function(r){this.childNodes.push(r),t.i.appendChild(r)},insertBefore:function(r,o){this.childNodes.push(r),t.i.appendChild(r)},removeChild:function(r){this.childNodes.splice(this.childNodes.indexOf(r)>>>1,1),t.i.removeChild(r)}}),Ve(le(ui,{context:t.context},e.__v),t.l)}function vt(e,t){var n=le(di,{__v:e,i:t});return n.containerInfo=t,n}(ze.prototype=new ue).__a=function(e){var t=this,n=hr(t.__v),r=t.o.get(e);return r[0]++,function(o){var i=function(){t.props.revealOrder?(r.push(o),mr(t,e,r)):o()};n?n(i):i()}},ze.prototype.render=function(e){this.u=null,this.o=new Map;var t=ge(e.children);e.revealOrder&&e.revealOrder[0]==="b"&&t.reverse();for(var n=t.length;n--;)this.o.set(t[n],this.u=[1,0,this.u]);return e.children},ze.prototype.componentDidUpdate=ze.prototype.componentDidMount=function(){var e=this;this.o.forEach(function(t,n){mr(e,n,t)})};var vr=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.element")||60103,fi=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,hi=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,pi=/[A-Z0-9]/g,mi=typeof document<"u",vi=function(e){return(typeof Symbol<"u"&&typeof Symbol()=="symbol"?/fil|che|rad/:/fil|che|ra/).test(e)};function _r(e,t,n){return t.__k==null&&(t.textContent=""),Ve(e,t),typeof n=="function"&&n(),e?e.__c:null}function gr(e,t,n){return Kn(e,t),typeof n=="function"&&n(),e?e.__c:null}ue.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(e){Object.defineProperty(ue.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})});var yr=A.event;function _i(){}function gi(){return this.cancelBubble}function yi(){return this.defaultPrevented}A.event=function(e){return yr&&(e=yr(e)),e.persist=_i,e.isPropagationStopped=gi,e.isDefaultPrevented=yi,e.nativeEvent=e};var tn,wi={enumerable:!1,configurable:!0,get:function(){return this.class}},wr=A.vnode;A.vnode=function(e){typeof e.type=="string"&&function(t){var n=t.props,r=t.type,o={};for(var i in n){var s=n[i];if(!(i==="value"&&"defaultValue"in n&&s==null||mi&&i==="children"&&r==="noscript"||i==="class"||i==="className")){var a=i.toLowerCase();i==="defaultValue"&&"value"in n&&n.value==null?i="value":i==="download"&&s===!0?s="":a==="translate"&&s==="no"?s=!1:a==="ondoubleclick"?i="ondblclick":a!=="onchange"||r!=="input"&&r!=="textarea"||vi(n.type)?a==="onfocus"?i="onfocusin":a==="onblur"?i="onfocusout":hi.test(i)?i=a:r.indexOf("-")===-1&&fi.test(i)?i=i.replace(pi,"-$&").toLowerCase():s===null&&(s=void 0):a=i="oninput",a==="oninput"&&o[i=a]&&(i="oninputCapture"),o[i]=s}}r=="select"&&o.multiple&&Array.isArray(o.value)&&(o.value=ge(n.children).forEach(function(c){c.props.selected=o.value.indexOf(c.props.value)!=-1})),r=="select"&&o.defaultValue!=null&&(o.value=ge(n.children).forEach(function(c){c.props.selected=o.multiple?o.defaultValue.indexOf(c.props.value)!=-1:o.defaultValue==c.props.value})),n.class&&!n.className?(o.class=n.class,Object.defineProperty(o,"className",wi)):(n.className&&!n.class||n.class&&n.className)&&(o.class=o.className=n.className),t.props=o}(e),e.$$typeof=vr,wr&&wr(e)};var br=A.__r;A.__r=function(e){br&&br(e),tn=e.__c};var Er=A.diffed;A.diffed=function(e){Er&&Er(e);var t=e.props,n=e.__e;n!=null&&e.type==="textarea"&&"value"in t&&t.value!==n.value&&(n.value=t.value==null?"":t.value),tn=null};var $r={ReactCurrentDispatcher:{current:{readContext:function(e){return tn.__n[e.__c].props.value},useCallback:j,useContext:te,useDebugValue:Zt,useDeferredValue:on,useEffect:W,useId:Ee,useImperativeHandle:Gt,useInsertionEffect:an,useLayoutEffect:Pe,useMemo:U,useReducer:Ze,useRef:w,useState:x,useSyncExternalStore:_t,useTransition:sn}}},bi="17.0.2";function Tr(e){return le.bind(null,e)}function Ue(e){return!!e&&e.$$typeof===vr}function Cr(e){return Ue(e)&&e.type===q}function kr(e){return!!e&&!!e.displayName&&(typeof e.displayName=="string"||e.displayName instanceof String)&&e.displayName.startsWith("Memo(")}function nn(e){return Ue(e)?ri.apply(null,arguments):e}function Sr(e){return!!e.__k&&(Ve(null,e),!0)}function Fr(e){return e&&(e.base||e.nodeType===1&&e)||null}var Mr=function(e,t){return e(t)},xr=function(e,t){return e(t)},Pr=q;function rn(e){e()}function on(e){return e}function sn(){return[!1,rn]}var an=Pe,Lr=Ue;function _t(e,t){var n=t(),r=x({h:{__:n,v:t}}),o=r[0].h,i=r[1];return Pe(function(){o.__=n,o.v=t,cn(o)&&i({h:o})},[e,n,t]),W(function(){return cn(o)&&i({h:o}),e(function(){cn(o)&&i({h:o})})},[e]),n}function cn(e){var t,n,r=e.v,o=e.__;try{var i=r();return!((t=o)===(n=i)&&(t!==0||1/t==1/n)||t!=t&&n!=n)}catch{return!0}}var P={useState:x,useId:Ee,useReducer:Ze,useEffect:W,useLayoutEffect:Pe,useInsertionEffect:an,useTransition:sn,useDeferredValue:on,useSyncExternalStore:_t,startTransition:rn,useRef:w,useImperativeHandle:Gt,useMemo:U,useCallback:j,useContext:te,useDebugValue:Zt,version:"17.0.2",Children:lr,render:_r,hydrate:gr,unmountComponentAtNode:Sr,createPortal:vt,createElement:le,createContext:ie,createFactory:Tr,cloneElement:nn,createRef:Ut,Fragment:q,isValidElement:Ue,isElement:Lr,isFragment:Cr,isMemo:kr,findDOMNode:Fr,Component:ue,PureComponent:mt,memo:sr,forwardRef:en,flushSync:xr,unstable_batchedUpdates:Mr,StrictMode:Pr,Suspense:Xe,SuspenseList:ze,lazy:pr,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:$r};const Nr=Object.freeze(Object.defineProperty({__proto__:null,Children:lr,Component:ue,Fragment:q,PureComponent:mt,StrictMode:Pr,Suspense:Xe,SuspenseList:ze,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:$r,cloneElement:nn,createContext:ie,createElement:le,createFactory:Tr,createPortal:vt,createRef:Ut,default:P,findDOMNode:Fr,flushSync:xr,forwardRef:en,hydrate:gr,isElement:Lr,isFragment:Cr,isMemo:kr,isValidElement:Ue,lazy:pr,memo:sr,render:_r,startTransition:rn,unmountComponentAtNode:Sr,unstable_batchedUpdates:Mr,useCallback:j,useContext:te,useDebugValue:Zt,useDeferredValue:on,useEffect:W,useErrorBoundary:ii,useId:Ee,useImperativeHandle:Gt,useInsertionEffect:an,useLayoutEffect:Pe,useMemo:U,useReducer:Ze,useRef:w,useState:x,useSyncExternalStore:_t,useTransition:sn,version:bi},Symbol.toStringTag,{value:"Module"})),Ar=typeof document<"u"?P.useLayoutEffect:()=>{};function Ei(e){const t=w(null);return Ar(()=>{t.current=e},[e]),j((...n)=>{const r=t.current;return r==null?void 0:r(...n)},[])}const Je=e=>{var t;return(t=e==null?void 0:e.ownerDocument)!==null&&t!==void 0?t:document},Le=e=>e&&"window"in e&&e.window===e?e:Je(e).defaultView||window;function $i(e){var t;return typeof window>"u"||window.navigator==null?!1:((t=window.navigator.userAgentData)===null||t===void 0?void 0:t.brands.some(n=>e.test(n.brand)))||e.test(window.navigator.userAgent)}function Ti(e){var t;return typeof window<"u"&&window.navigator!=null?e.test(((t=window.navigator.userAgentData)===null||t===void 0?void 0:t.platform)||window.navigator.platform):!1}function Ci(){return Ti(/^Mac/i)}function ki(){return $i(/Android/i)}function Si(e){return e.mozInputSource===0&&e.isTrusted?!0:ki()&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}class Fi{isDefaultPrevented(){return this.nativeEvent.defaultPrevented}preventDefault(){this.defaultPrevented=!0,this.nativeEvent.preventDefault()}stopPropagation(){this.nativeEvent.stopPropagation(),this.isPropagationStopped=()=>!0}isPropagationStopped(){return!1}persist(){}constructor(t,n){this.nativeEvent=n,this.target=n.target,this.currentTarget=n.currentTarget,this.relatedTarget=n.relatedTarget,this.bubbles=n.bubbles,this.cancelable=n.cancelable,this.defaultPrevented=n.defaultPrevented,this.eventPhase=n.eventPhase,this.isTrusted=n.isTrusted,this.timeStamp=n.timeStamp,this.type=t}}function Dr(e){let t=w({isFocused:!1,observer:null});Ar(()=>{const r=t.current;return()=>{r.observer&&(r.observer.disconnect(),r.observer=null)}},[]);let n=Ei(r=>{e==null||e(r)});return j(r=>{if(r.target instanceof HTMLButtonElement||r.target instanceof HTMLInputElement||r.target instanceof HTMLTextAreaElement||r.target instanceof HTMLSelectElement){t.current.isFocused=!0;let o=r.target,i=s=>{t.current.isFocused=!1,o.disabled&&n(new Fi("blur",s)),t.current.observer&&(t.current.observer.disconnect(),t.current.observer=null)};o.addEventListener("focusout",i,{once:!0}),t.current.observer=new MutationObserver(()=>{if(t.current.isFocused&&o.disabled){var s;(s=t.current.observer)===null||s===void 0||s.disconnect();let a=o===document.activeElement?null:document.activeElement;o.dispatchEvent(new FocusEvent("blur",{relatedTarget:a})),o.dispatchEvent(new FocusEvent("focusout",{bubbles:!0,relatedTarget:a}))}}),t.current.observer.observe(o,{attributes:!0,attributeFilter:["disabled"]})}},[n])}function Mi(e){let{isDisabled:t,onFocus:n,onBlur:r,onFocusChange:o}=e;const i=j(c=>{if(c.target===c.currentTarget)return r&&r(c),o&&o(!1),!0},[r,o]),s=Dr(i),a=j(c=>{const u=Je(c.target);c.target===c.currentTarget&&u.activeElement===c.target&&(n&&n(c),o&&o(!0),s(c))},[o,n,s]);return{focusProps:{onFocus:!t&&(n||o||r)?a:void 0,onBlur:!t&&(r||o)?i:void 0}}}let Qe=null,ln=new Set,et=new Map,Ne=!1,un=!1;const xi={Tab:!0,Escape:!0};function dn(e,t){for(let n of ln)n(e,t)}function Pi(e){return!(e.metaKey||!Ci()&&e.altKey||e.ctrlKey||e.key==="Control"||e.key==="Shift"||e.key==="Meta")}function gt(e){Ne=!0,Pi(e)&&(Qe="keyboard",dn("keyboard",e))}function ce(e){Qe="pointer",(e.type==="mousedown"||e.type==="pointerdown")&&(Ne=!0,dn("pointer",e))}function Ir(e){Si(e)&&(Ne=!0,Qe="virtual")}function Rr(e){e.target===window||e.target===document||(!Ne&&!un&&(Qe="virtual",dn("virtual",e)),Ne=!1,un=!1)}function Or(){Ne=!1,un=!0}function fn(e){if(typeof window>"u"||et.get(Le(e)))return;const t=Le(e),n=Je(e);let r=t.HTMLElement.prototype.focus;t.HTMLElement.prototype.focus=function(){Ne=!0,r.apply(this,arguments)},n.addEventListener("keydown",gt,!0),n.addEventListener("keyup",gt,!0),n.addEventListener("click",Ir,!0),t.addEventListener("focus",Rr,!0),t.addEventListener("blur",Or,!1),typeof PointerEvent<"u"?(n.addEventListener("pointerdown",ce,!0),n.addEventListener("pointermove",ce,!0),n.addEventListener("pointerup",ce,!0)):(n.addEventListener("mousedown",ce,!0),n.addEventListener("mousemove",ce,!0),n.addEventListener("mouseup",ce,!0)),t.addEventListener("beforeunload",()=>{Hr(e)},{once:!0}),et.set(t,{focus:r})}const Hr=(e,t)=>{const n=Le(e),r=Je(e);t&&r.removeEventListener("DOMContentLoaded",t),et.has(n)&&(n.HTMLElement.prototype.focus=et.get(n).focus,r.removeEventListener("keydown",gt,!0),r.removeEventListener("keyup",gt,!0),r.removeEventListener("click",Ir,!0),n.removeEventListener("focus",Rr,!0),n.removeEventListener("blur",Or,!1),typeof PointerEvent<"u"?(r.removeEventListener("pointerdown",ce,!0),r.removeEventListener("pointermove",ce,!0),r.removeEventListener("pointerup",ce,!0)):(r.removeEventListener("mousedown",ce,!0),r.removeEventListener("mousemove",ce,!0),r.removeEventListener("mouseup",ce,!0)),et.delete(n))};function Li(e){const t=Je(e);let n;return t.readyState!=="loading"?fn(e):(n=()=>{fn(e)},t.addEventListener("DOMContentLoaded",n)),()=>Hr(e,n)}typeof document<"u"&&Li();function Vr(){return Qe!=="pointer"}const Ni=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);function Ai(e,t,n){var r;const o=typeof window<"u"?Le(n==null?void 0:n.target).HTMLInputElement:HTMLInputElement,i=typeof window<"u"?Le(n==null?void 0:n.target).HTMLTextAreaElement:HTMLTextAreaElement,s=typeof window<"u"?Le(n==null?void 0:n.target).HTMLElement:HTMLElement,a=typeof window<"u"?Le(n==null?void 0:n.target).KeyboardEvent:KeyboardEvent;return e=e||(n==null?void 0:n.target)instanceof o&&!Ni.has(n==null||(r=n.target)===null||r===void 0?void 0:r.type)||(n==null?void 0:n.target)instanceof i||(n==null?void 0:n.target)instanceof s&&(n==null?void 0:n.target.isContentEditable),!(e&&t==="keyboard"&&n instanceof a&&!xi[n.key])}function Di(e,t,n){fn(),W(()=>{let r=(o,i)=>{Ai(!!(n!=null&&n.isTextInput),o,i)&&e(Vr())};return ln.add(r),()=>{ln.delete(r)}},t)}function Ii(e){let{isDisabled:t,onBlurWithin:n,onFocusWithin:r,onFocusWithinChange:o}=e,i=w({isFocusWithin:!1}),s=j(u=>{i.current.isFocusWithin&&!u.currentTarget.contains(u.relatedTarget)&&(i.current.isFocusWithin=!1,n&&n(u),o&&o(!1))},[n,o,i]),a=Dr(s),c=j(u=>{!i.current.isFocusWithin&&document.activeElement===u.target&&(r&&r(u),o&&o(!0),i.current.isFocusWithin=!0,a(u))},[r,o,a]);return t?{focusWithinProps:{onFocus:void 0,onBlur:void 0}}:{focusWithinProps:{onFocus:c,onBlur:s}}}let yt=!1,hn=0;function pn(){yt=!0,setTimeout(()=>{yt=!1},50)}function Wr(e){e.pointerType==="touch"&&pn()}function Ri(){if(!(typeof document>"u"))return typeof PointerEvent<"u"?document.addEventListener("pointerup",Wr):document.addEventListener("touchend",pn),hn++,()=>{hn--,!(hn>0)&&(typeof PointerEvent<"u"?document.removeEventListener("pointerup",Wr):document.removeEventListener("touchend",pn))}}function Oi(e){let{onHoverStart:t,onHoverChange:n,onHoverEnd:r,isDisabled:o}=e,[i,s]=x(!1),a=w({isHovered:!1,ignoreEmulatedMouseEvents:!1,pointerType:"",target:null}).current;W(Ri,[]);let{hoverProps:c,triggerHoverEnd:u}=U(()=>{let d=(f,v)=>{if(a.pointerType=v,o||v==="touch"||a.isHovered||!f.currentTarget.contains(f.target))return;a.isHovered=!0;let g=f.currentTarget;a.target=g,t&&t({type:"hoverstart",target:g,pointerType:v}),n&&n(!0),s(!0)},l=(f,v)=>{if(a.pointerType="",a.target=null,v==="touch"||!a.isHovered)return;a.isHovered=!1;let g=f.currentTarget;r&&r({type:"hoverend",target:g,pointerType:v}),n&&n(!1),s(!1)},h={};return typeof PointerEvent<"u"?(h.onPointerEnter=f=>{yt&&f.pointerType==="mouse"||d(f,f.pointerType)},h.onPointerLeave=f=>{!o&&f.currentTarget.contains(f.target)&&l(f,f.pointerType)}):(h.onTouchStart=()=>{a.ignoreEmulatedMouseEvents=!0},h.onMouseEnter=f=>{!a.ignoreEmulatedMouseEvents&&!yt&&d(f,"mouse"),a.ignoreEmulatedMouseEvents=!1},h.onMouseLeave=f=>{!o&&f.currentTarget.contains(f.target)&&l(f,"mouse")}),{hoverProps:h,triggerHoverEnd:l}},[t,n,r,o,a]);return W(()=>{o&&u({currentTarget:a.target},a.pointerType)},[o]),{hoverProps:c,isHovered:i}}function Hi(e={}){let{autoFocus:t=!1,isTextInput:n,within:r}=e,o=w({isFocused:!1,isFocusVisible:t||Vr()}),[i,s]=x(!1),[a,c]=x(()=>o.current.isFocused&&o.current.isFocusVisible),u=j(()=>c(o.current.isFocused&&o.current.isFocusVisible),[]),d=j(f=>{o.current.isFocused=f,s(f),u()},[u]);Di(f=>{o.current.isFocusVisible=f,u()},[],{isTextInput:n});let{focusProps:l}=Mi({isDisabled:r,onFocusChange:d}),{focusWithinProps:h}=Ii({isDisabled:!r,onFocusWithinChange:d});return{isFocused:i,isFocusVisible:a,focusProps:r?h:l}}var Vi=Object.defineProperty,Wi=(e,t,n)=>t in e?Vi(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,mn=(e,t,n)=>(Wi(e,typeof t!="symbol"?t+"":t,n),n);let zi=class{constructor(){mn(this,"current",this.detect()),mn(this,"handoffState","pending"),mn(this,"currentId",0)}set(t){this.current!==t&&(this.handoffState="pending",this.currentId=0,this.current=t)}reset(){this.set(this.detect())}nextId(){return++this.currentId}get isServer(){return this.current==="server"}get isClient(){return this.current==="client"}detect(){return typeof window>"u"||typeof document>"u"?"server":"client"}handoff(){this.handoffState==="pending"&&(this.handoffState="complete")}get isHandoffComplete(){return this.handoffState==="complete"}},Ae=new zi;function wt(e){return Ae.isServer?null:e instanceof Node?e.ownerDocument:e!=null&&e.hasOwnProperty("current")&&e.current instanceof Node?e.current.ownerDocument:document}function bt(e){typeof queueMicrotask=="function"?queueMicrotask(e):Promise.resolve().then(e).catch(t=>setTimeout(()=>{throw t}))}function $e(){let e=[],t={addEventListener(n,r,o,i){return n.addEventListener(r,o,i),t.add(()=>n.removeEventListener(r,o,i))},requestAnimationFrame(...n){let r=requestAnimationFrame(...n);return t.add(()=>cancelAnimationFrame(r))},nextFrame(...n){return t.requestAnimationFrame(()=>t.requestAnimationFrame(...n))},setTimeout(...n){let r=setTimeout(...n);return t.add(()=>clearTimeout(r))},microTask(...n){let r={current:!0};return bt(()=>{r.current&&n[0]()}),t.add(()=>{r.current=!1})},style(n,r,o){let i=n.style.getPropertyValue(r);return Object.assign(n.style,{[r]:o}),this.add(()=>{Object.assign(n.style,{[r]:i})})},group(n){let r=$e();return n(r),this.add(()=>r.dispose())},add(n){return e.includes(n)||e.push(n),()=>{let r=e.indexOf(n);if(r>=0)for(let o of e.splice(r,1))o()}},dispose(){for(let n of e.splice(0))n()}};return t}function Et(){let[e]=x($e);return W(()=>()=>e.dispose(),[e]),e}let ne=(e,t)=>{Ae.isServer?W(e,t):Pe(e,t)};function De(e){let t=w(e);return ne(()=>{t.current=e},[e]),t}let G=function(e){let t=De(e);return P.useCallback((...n)=>t.current(...n),[t])};function Ui(e){let t=e.width/2,n=e.height/2;return{top:e.clientY-n,right:e.clientX+t,bottom:e.clientY+n,left:e.clientX-t}}function ji(e,t){return!(!e||!t||e.right<t.left||e.left>t.right||e.bottom<t.top||e.top>t.bottom)}function Bi({disabled:e=!1}={}){let t=w(null),[n,r]=x(!1),o=Et(),i=G(()=>{t.current=null,r(!1),o.dispose()}),s=G(a=>{if(o.dispose(),t.current===null){t.current=a.currentTarget,r(!0);{let c=wt(a.currentTarget);o.addEventListener(c,"pointerup",i,!1),o.addEventListener(c,"pointermove",u=>{if(t.current){let d=Ui(u);r(ji(d,t.current.getBoundingClientRect()))}},!1),o.addEventListener(c,"pointercancel",i,!1)}}});return{pressed:n,pressProps:e?{}:{onPointerDown:s,onPointerUp:i,onClick:i}}}let qi=ie(void 0);function zr(){return te(qi)}function vn(...e){return Array.from(new Set(e.flatMap(t=>typeof t=="string"?t.split(" "):[]))).filter(Boolean).join(" ")}function Te(e,t,...n){if(e in t){let o=t[e];return typeof o=="function"?o(...n):o}let r=new Error(`Tried to handle "${e}" but there is no handler defined. Only defined handlers are: ${Object.keys(t).map(o=>`"${o}"`).join(", ")}.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,Te),r}var $t=(e=>(e[e.None=0]="None",e[e.RenderStrategy=1]="RenderStrategy",e[e.Static=2]="Static",e))($t||{}),Ce=(e=>(e[e.Unmount=0]="Unmount",e[e.Hidden=1]="Hidden",e))(Ce||{});function se({ourProps:e,theirProps:t,slot:n,defaultTag:r,features:o,visible:i=!0,name:s,mergeRefs:a}){a=a??Yi;let c=Ur(t,e);if(i)return Tt(c,n,r,s,a);let u=o??0;if(u&2){let{static:d=!1,...l}=c;if(d)return Tt(l,n,r,s,a)}if(u&1){let{unmount:d=!0,...l}=c;return Te(d?0:1,{0(){return null},1(){return Tt({...l,hidden:!0,style:{display:"none"}},n,r,s,a)}})}return Tt(c,n,r,s,a)}function Tt(e,t={},n,r,o){let{as:i=n,children:s,refName:a="ref",...c}=_n(e,["unmount","static"]),u=e.ref!==void 0?{[a]:e.ref}:{},d=typeof s=="function"?s(t):s;"className"in c&&c.className&&typeof c.className=="function"&&(c.className=c.className(t)),c["aria-labelledby"]&&c["aria-labelledby"]===c.id&&(c["aria-labelledby"]=void 0);let l={};if(t){let h=!1,f=[];for(let[v,g]of Object.entries(t))typeof g=="boolean"&&(h=!0),g===!0&&f.push(v.replace(/([A-Z])/g,_=>`-${_.toLowerCase()}`));if(h){l["data-headlessui-state"]=f.join(" ");for(let v of f)l[`data-${v}`]=""}}if(i===q&&(Object.keys(Ie(c)).length>0||Object.keys(Ie(l)).length>0))if(!Ue(d)||Array.isArray(d)&&d.length>1){if(Object.keys(Ie(c)).length>0)throw new Error(['Passing props on "Fragment"!',"",`The current component <${r} /> is rendering a "Fragment".`,"However we need to passthrough the following props:",Object.keys(Ie(c)).concat(Object.keys(Ie(l))).map(h=>` - ${h}`).join(`
|
|
3
3
|
`),"","You can apply a few solutions:",['Add an `as="..."` prop, to ensure that we render an actual element instead of a "Fragment".',"Render a single element as the child so that we can forward the props onto that element."].map(h=>` - ${h}`).join(`
|
|
4
4
|
`)].join(`
|
|
5
|
-
`))}else{let h=d.props,f=h==null?void 0:h.className,v=typeof f=="function"?(...m)=>vn(f(...m),c.className):vn(f,c.className),g=v?{className:v}:{},_=Ur(d.props,Ie(_n(c,["ref"])));for(let m in l)m in _&&delete l[m];return nn(d,Object.assign({},_,l,u,{ref:o(d.ref,u.ref)},g))}return le(i,Object.assign({},_n(c,["ref"]),i!==q&&u,i!==q&&l),d)}function Yi(...e){return e.every(t=>t==null)?void 0:t=>{for(let n of e)n!=null&&(typeof n=="function"?n(t):n.current=t)}}function Ur(...e){if(e.length===0)return{};if(e.length===1)return e[0];let t={},n={};for(let r of e)for(let o in r)o.startsWith("on")&&typeof r[o]=="function"?(n[o]!=null||(n[o]=[]),n[o].push(r[o])):t[o]=r[o];if(t.disabled||t["aria-disabled"])for(let r in n)/^(on(?:Click|Pointer|Mouse|Key)(?:Down|Up|Press)?)$/.test(r)&&(n[r]=[o=>{var i;return(i=o==null?void 0:o.preventDefault)==null?void 0:i.call(o)}]);for(let r in n)Object.assign(t,{[r](o,...i){let s=n[r];for(let a of s){if((o instanceof Event||(o==null?void 0:o.nativeEvent)instanceof Event)&&o.defaultPrevented)return;a(o,...i)}}});return t}function Ki(...e){if(e.length===0)return{};if(e.length===1)return e[0];let t={},n={};for(let r of e)for(let o in r)o.startsWith("on")&&typeof r[o]=="function"?(n[o]!=null||(n[o]=[]),n[o].push(r[o])):t[o]=r[o];for(let r in n)Object.assign(t,{[r](...o){let i=n[r];for(let s of i)s==null||s(...o)}});return t}function re(e){var t;return Object.assign(en(e),{displayName:(t=e.displayName)!=null?t:e.name})}function Ie(e){let t=Object.assign({},e);for(let n in t)t[n]===void 0&&delete t[n];return t}function _n(e,t=[]){let n=Object.assign({},e);for(let r of t)r in n&&delete n[r];return n}let Gi="button";function Zi(e,t){var n;let r=zr(),{disabled:o=r||!1,autoFocus:i=!1,...s}=e,{isFocusVisible:a,focusProps:c}=Hi({autoFocus:i}),{isHovered:u,hoverProps:d}=Oi({isDisabled:o}),{pressed:l,pressProps:h}=Bi({disabled:o}),f=Ki({ref:t,type:(n=s.type)!=null?n:"button",disabled:o||void 0,autoFocus:i},c,d,h),v=U(()=>({disabled:o,hover:u,focus:a,active:l,autofocus:i}),[o,u,a,l,i]);return se({ourProps:f,theirProps:s,slot:v,defaultTag:Gi,name:"Button"})}let Xi=re(Zi),Ji="div";var Ct=(e=>(e[e.None=1]="None",e[e.Focusable=2]="Focusable",e[e.Hidden=4]="Hidden",e))(Ct||{});function Qi(e,t){var n;let{features:r=1,...o}=e,i={ref:t,"aria-hidden":(r&2)===2?!0:(n=o["aria-hidden"])!=null?n:void 0,hidden:(r&4)===4?!0:void 0,style:{position:"fixed",top:1,left:1,width:1,height:0,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0",...(r&4)===4&&(r&2)!==2&&{display:"none"}}};return se({ourProps:i,theirProps:o,slot:{},defaultTag:Ji,name:"Hidden"})}let gn=re(Qi),es=ie(null);function ts({children:e}){let t=te(es);if(!t)return P.createElement(P.Fragment,null,e);let{target:n}=t;return n?vt(P.createElement(P.Fragment,null,e),n):null}let jr=Symbol();function ns(e,t=!0){return Object.assign(e,{[jr]:t})}function he(...e){let t=w(e);W(()=>{t.current=e},[e]);let n=G(r=>{for(let o of t.current)o!=null&&(typeof o=="function"?o(r):o.current=r)});return e.every(r=>r==null||(r==null?void 0:r[jr]))?void 0:n}let yn=ie(null);yn.displayName="DescriptionContext";function Br(){let e=te(yn);if(e===null){let t=new Error("You used a <Description /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(t,Br),t}return e}function rs(){let[e,t]=x([]);return[e.length>0?e.join(" "):void 0,U(()=>function(n){let r=G(i=>(t(s=>[...s,i]),()=>t(s=>{let a=s.slice(),c=a.indexOf(i);return c!==-1&&a.splice(c,1),a}))),o=U(()=>({register:r,slot:n.slot,name:n.name,props:n.props,value:n.value}),[r,n.slot,n.name,n.props,n.value]);return P.createElement(yn.Provider,{value:o},n.children)},[t])]}let os="p";function is(e,t){let n=Ee(),r=zr(),{id:o=`headlessui-description-${n}`,...i}=e,s=Br(),a=he(t);ne(()=>s.register(o),[o,s.register]);let c=r||!1,u=U(()=>({...s.slot,disabled:c}),[s.slot,c]),d={ref:a,...s.props,id:o};return se({ourProps:d,theirProps:i,slot:u,defaultTag:os,name:s.name||"Description"})}let ss=re(is),as=Object.assign(ss,{});var qr=(e=>(e.Space=" ",e.Enter="Enter",e.Escape="Escape",e.Backspace="Backspace",e.Delete="Delete",e.ArrowLeft="ArrowLeft",e.ArrowUp="ArrowUp",e.ArrowRight="ArrowRight",e.ArrowDown="ArrowDown",e.Home="Home",e.End="End",e.PageUp="PageUp",e.PageDown="PageDown",e.Tab="Tab",e))(qr||{});let cs=ie(()=>{});function ls({value:e,children:t}){return P.createElement(cs.Provider,{value:e},t)}let us=class extends Map{constructor(t){super(),this.factory=t}get(t){let n=super.get(t);return n===void 0&&(n=this.factory(t),this.set(t,n)),n}};function Yr(e,t){let n=e(),r=new Set;return{getSnapshot(){return n},subscribe(o){return r.add(o),()=>r.delete(o)},dispatch(o,...i){let s=t[o].call(n,...i);s&&(n=s,r.forEach(a=>a()))}}}function Kr(e){return _t(e.subscribe,e.getSnapshot,e.getSnapshot)}let ds=new us(()=>Yr(()=>[],{ADD(e){return this.includes(e)?this:[...this,e]},REMOVE(e){let t=this.indexOf(e);if(t===-1)return this;let n=this.slice();return n.splice(t,1),n}}));function je(e,t){let n=ds.get(t),r=Ee(),o=Kr(n);if(ne(()=>{if(e)return n.dispatch("ADD",r),()=>n.dispatch("REMOVE",r)},[n,e]),!e)return!1;let i=o.indexOf(r),s=o.length;return i===-1&&(i=s,s+=1),i===s-1}let wn=new Map,tt=new Map;function Gr(e){var t;let n=(t=tt.get(e))!=null?t:0;return tt.set(e,n+1),n!==0?()=>Zr(e):(wn.set(e,{"aria-hidden":e.getAttribute("aria-hidden"),inert:e.inert}),e.setAttribute("aria-hidden","true"),e.inert=!0,()=>Zr(e))}function Zr(e){var t;let n=(t=tt.get(e))!=null?t:1;if(n===1?tt.delete(e):tt.set(e,n-1),n!==1)return;let r=wn.get(e);r&&(r["aria-hidden"]===null?e.removeAttribute("aria-hidden"):e.setAttribute("aria-hidden",r["aria-hidden"]),e.inert=r.inert,wn.delete(e))}function fs(e,{allowed:t,disallowed:n}={}){let r=je(e,"inert-others");ne(()=>{var o,i;if(!r)return;let s=$e();for(let c of(o=n==null?void 0:n())!=null?o:[])c&&s.add(Gr(c));let a=(i=t==null?void 0:t())!=null?i:[];for(let c of a){if(!c)continue;let u=wt(c);if(!u)continue;let d=c.parentElement;for(;d&&d!==u.body;){for(let l of d.children)a.some(h=>l.contains(h))||s.add(Gr(l));d=d.parentElement}}return s.dispose},[r,t,n])}function Xr(e,t,n){let r=De(o=>{let i=o.getBoundingClientRect();i.x===0&&i.y===0&&i.width===0&&i.height===0&&n()});W(()=>{if(!e)return;let o=t===null?null:t instanceof HTMLElement?t:t.current;if(!o)return;let i=$e();if(typeof ResizeObserver<"u"){let s=new ResizeObserver(()=>r.current(o));s.observe(o),i.add(()=>s.disconnect())}if(typeof IntersectionObserver<"u"){let s=new IntersectionObserver(()=>r.current(o));s.observe(o),i.add(()=>s.disconnect())}return()=>i.dispose()},[t,r,e])}let bn=["[contentEditable=true]","[tabindex]","a[href]","area[href]","button:not([disabled])","iframe","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].map(e=>`${e}:not([tabindex='-1'])`).join(","),hs=["[data-autofocus]"].map(e=>`${e}:not([tabindex='-1'])`).join(",");var we=(e=>(e[e.First=1]="First",e[e.Previous=2]="Previous",e[e.Next=4]="Next",e[e.Last=8]="Last",e[e.WrapAround=16]="WrapAround",e[e.NoScroll=32]="NoScroll",e[e.AutoFocus=64]="AutoFocus",e))(we||{}),En=(e=>(e[e.Error=0]="Error",e[e.Overflow=1]="Overflow",e[e.Success=2]="Success",e[e.Underflow=3]="Underflow",e))(En||{}),ps=(e=>(e[e.Previous=-1]="Previous",e[e.Next=1]="Next",e))(ps||{});function ms(e=document.body){return e==null?[]:Array.from(e.querySelectorAll(bn)).sort((t,n)=>Math.sign((t.tabIndex||Number.MAX_SAFE_INTEGER)-(n.tabIndex||Number.MAX_SAFE_INTEGER)))}function vs(e=document.body){return e==null?[]:Array.from(e.querySelectorAll(hs)).sort((t,n)=>Math.sign((t.tabIndex||Number.MAX_SAFE_INTEGER)-(n.tabIndex||Number.MAX_SAFE_INTEGER)))}var Jr=(e=>(e[e.Strict=0]="Strict",e[e.Loose=1]="Loose",e))(Jr||{});function _s(e,t=0){var n;return e===((n=wt(e))==null?void 0:n.body)?!1:Te(t,{0(){return e.matches(bn)},1(){let r=e;for(;r!==null;){if(r.matches(bn))return!0;r=r.parentElement}return!1}})}var gs=(e=>(e[e.Keyboard=0]="Keyboard",e[e.Mouse=1]="Mouse",e))(gs||{});typeof window<"u"&&typeof document<"u"&&(document.addEventListener("keydown",e=>{e.metaKey||e.altKey||e.ctrlKey||(document.documentElement.dataset.headlessuiFocusVisible="")},!0),document.addEventListener("click",e=>{e.detail===1?delete document.documentElement.dataset.headlessuiFocusVisible:e.detail===0&&(document.documentElement.dataset.headlessuiFocusVisible="")},!0));function be(e){e==null||e.focus({preventScroll:!0})}let ys=["textarea","input"].join(",");function ws(e){var t,n;return(n=(t=e==null?void 0:e.matches)==null?void 0:t.call(e,ys))!=null?n:!1}function bs(e,t=n=>n){return e.slice().sort((n,r)=>{let o=t(n),i=t(r);if(o===null||i===null)return 0;let s=o.compareDocumentPosition(i);return s&Node.DOCUMENT_POSITION_FOLLOWING?-1:s&Node.DOCUMENT_POSITION_PRECEDING?1:0})}function nt(e,t,{sorted:n=!0,relativeTo:r=null,skipElements:o=[]}={}){let i=Array.isArray(e)?e.length>0?e[0].ownerDocument:document:e.ownerDocument,s=Array.isArray(e)?n?bs(e):e:t&64?vs(e):ms(e);o.length>0&&s.length>1&&(s=s.filter(f=>!o.some(v=>v!=null&&"current"in v?(v==null?void 0:v.current)===f:v===f))),r=r??i.activeElement;let a=(()=>{if(t&5)return 1;if(t&10)return-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),c=(()=>{if(t&1)return 0;if(t&2)return Math.max(0,s.indexOf(r))-1;if(t&4)return Math.max(0,s.indexOf(r))+1;if(t&8)return s.length-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),u=t&32?{preventScroll:!0}:{},d=0,l=s.length,h;do{if(d>=l||d+l<=0)return 0;let f=c+d;if(t&16)f=(f+l)%l;else{if(f<0)return 3;if(f>=l)return 1}h=s[f],h==null||h.focus(u),d+=a}while(h!==i.activeElement);return t&6&&ws(h)&&h.select(),2}function Qr(){return/iPhone/gi.test(window.navigator.platform)||/Mac/gi.test(window.navigator.platform)&&window.navigator.maxTouchPoints>0}function Es(){return/Android/gi.test(window.navigator.userAgent)}function $s(){return Qr()||Es()}function rt(e,t,n,r){let o=De(n);W(()=>{if(!e)return;function i(s){o.current(s)}return document.addEventListener(t,i,r),()=>document.removeEventListener(t,i,r)},[e,t,r])}function eo(e,t,n,r){let o=De(n);W(()=>{if(!e)return;function i(s){o.current(s)}return window.addEventListener(t,i,r),()=>window.removeEventListener(t,i,r)},[e,t,r])}const to=30;function Ts(e,t,n){let r=je(e,"outside-click"),o=De(n),i=j(function(c,u){if(c.defaultPrevented)return;let d=u(c);if(d===null||!d.getRootNode().contains(d)||!d.isConnected)return;let l=function h(f){return typeof f=="function"?h(f()):Array.isArray(f)||f instanceof Set?f:[f]}(t);for(let h of l){if(h===null)continue;let f=h instanceof HTMLElement?h:h.current;if(f!=null&&f.contains(d)||c.composed&&c.composedPath().includes(f))return}return!_s(d,Jr.Loose)&&d.tabIndex!==-1&&c.preventDefault(),o.current(c,d)},[o]),s=w(null);rt(r,"pointerdown",c=>{var u,d;s.current=((d=(u=c.composedPath)==null?void 0:u.call(c))==null?void 0:d[0])||c.target},!0),rt(r,"mousedown",c=>{var u,d;s.current=((d=(u=c.composedPath)==null?void 0:u.call(c))==null?void 0:d[0])||c.target},!0),rt(r,"click",c=>{$s()||s.current&&(i(c,()=>s.current),s.current=null)},!0);let a=w({x:0,y:0});rt(r,"touchstart",c=>{a.current.x=c.touches[0].clientX,a.current.y=c.touches[0].clientY},!0),rt(r,"touchend",c=>{let u={x:c.changedTouches[0].clientX,y:c.changedTouches[0].clientY};if(!(Math.abs(u.x-a.current.x)>=to||Math.abs(u.y-a.current.y)>=to))return i(c,()=>c.target instanceof HTMLElement?c.target:null)},!0),eo(r,"blur",c=>i(c,()=>window.document.activeElement instanceof HTMLIFrameElement?window.document.activeElement:null),!0)}function ot(...e){return U(()=>wt(...e),[...e])}function no(e,t,n,r){let o=De(n);W(()=>{e=e??window;function i(s){o.current(s)}return e.addEventListener(t,i,r),()=>e.removeEventListener(t,i,r)},[e,t,r])}function Cs(){let e;return{before({doc:t}){var n;let r=t.documentElement,o=(n=t.defaultView)!=null?n:window;e=Math.max(0,o.innerWidth-r.clientWidth)},after({doc:t,d:n}){let r=t.documentElement,o=Math.max(0,r.clientWidth-r.offsetWidth),i=Math.max(0,e-o);n.style(r,"paddingRight",`${i}px`)}}}function ks(){return Qr()?{before({doc:e,d:t,meta:n}){function r(o){return n.containers.flatMap(i=>i()).some(i=>i.contains(o))}t.microTask(()=>{var o;if(window.getComputedStyle(e.documentElement).scrollBehavior!=="auto"){let a=$e();a.style(e.documentElement,"scrollBehavior","auto"),t.add(()=>t.microTask(()=>a.dispose()))}let i=(o=window.scrollY)!=null?o:window.pageYOffset,s=null;t.addEventListener(e,"click",a=>{if(a.target instanceof HTMLElement)try{let c=a.target.closest("a");if(!c)return;let{hash:u}=new URL(c.href),d=e.querySelector(u);d&&!r(d)&&(s=d)}catch{}},!0),t.addEventListener(e,"touchstart",a=>{if(a.target instanceof HTMLElement)if(r(a.target)){let c=a.target;for(;c.parentElement&&r(c.parentElement);)c=c.parentElement;t.style(c,"overscrollBehavior","contain")}else t.style(a.target,"touchAction","none")}),t.addEventListener(e,"touchmove",a=>{if(a.target instanceof HTMLElement){if(a.target.tagName==="INPUT")return;if(r(a.target)){let c=a.target;for(;c.parentElement&&c.dataset.headlessuiPortal!==""&&!(c.scrollHeight>c.clientHeight||c.scrollWidth>c.clientWidth);)c=c.parentElement;c.dataset.headlessuiPortal===""&&a.preventDefault()}else a.preventDefault()}},{passive:!1}),t.add(()=>{var a;let c=(a=window.scrollY)!=null?a:window.pageYOffset;i!==c&&window.scrollTo(0,i),s&&s.isConnected&&(s.scrollIntoView({block:"nearest"}),s=null)})})}}:{}}function Ss(){return{before({doc:e,d:t}){t.style(e.documentElement,"overflow","hidden")}}}function Fs(e){let t={};for(let n of e)Object.assign(t,n(t));return t}let Re=Yr(()=>new Map,{PUSH(e,t){var n;let r=(n=this.get(e))!=null?n:{doc:e,count:0,d:$e(),meta:new Set};return r.count++,r.meta.add(t),this.set(e,r),this},POP(e,t){let n=this.get(e);return n&&(n.count--,n.meta.delete(t)),this},SCROLL_PREVENT({doc:e,d:t,meta:n}){let r={doc:e,d:t,meta:Fs(n)},o=[ks(),Cs(),Ss()];o.forEach(({before:i})=>i==null?void 0:i(r)),o.forEach(({after:i})=>i==null?void 0:i(r))},SCROLL_ALLOW({d:e}){e.dispose()},TEARDOWN({doc:e}){this.delete(e)}});Re.subscribe(()=>{let e=Re.getSnapshot(),t=new Map;for(let[n]of e)t.set(n,n.documentElement.style.overflow);for(let n of e.values()){let r=t.get(n.doc)==="hidden",o=n.count!==0;(o&&!r||!o&&r)&&Re.dispatch(n.count>0?"SCROLL_PREVENT":"SCROLL_ALLOW",n),n.count===0&&Re.dispatch("TEARDOWN",n)}});function Ms(e,t,n=()=>({containers:[]})){let r=Kr(Re),o=t?r.get(t):void 0,i=o?o.count>0:!1;return ne(()=>{if(!(!t||!e))return Re.dispatch("PUSH",t,n),()=>Re.dispatch("POP",t,n)},[e,t]),i}function xs(e,t,n=()=>[document.body]){let r=je(e,"scroll-lock");Ms(r,t,o=>{var i;return{containers:[...(i=o.containers)!=null?i:[],n]}})}function Ps(e){let t={called:!1};return(...n)=>{if(!t.called)return t.called=!0,e(...n)}}function Ls(e=0){let[t,n]=x(e),r=j(c=>n(c),[t]),o=j(c=>n(u=>u|c),[t]),i=j(c=>(t&c)===c,[t]),s=j(c=>n(u=>u&~c),[n]),a=j(c=>n(u=>u^c),[n]);return{flags:t,setFlag:r,addFlag:o,hasFlag:i,removeFlag:s,toggleFlag:a}}var Ns=(e=>(e[e.None=0]="None",e[e.Closed=1]="Closed",e[e.Enter=2]="Enter",e[e.Leave=4]="Leave",e))(Ns||{});function As(e){let t={};for(let n in e)e[n]===!0&&(t[`data-${n}`]="");return t}function Ds(e,t,n,r){let[o,i]=x(n),{hasFlag:s,addFlag:a,removeFlag:c}=Ls(e&&o?3:0),u=w(!1),d=w(!1),l=Et();return ne(function h(){var f;if(!e)return;n&&i(!0);let v=t.current;return v?((f=r==null?void 0:r.start)==null||f.call(r,n),Is(v,{inFlight:u,prepare(){d.current?d.current=!1:d.current=u.current,u.current=!0,!d.current&&(n?(a(3),c(4)):(a(4),c(2)))},run(){d.current?n?(c(3),a(4)):(c(4),a(3)):n?c(1):a(1)},done(){var g;d.current&&typeof v.getAnimations=="function"&&v.getAnimations().length>0||(u.current=!1,c(7),n||i(!1),(g=r==null?void 0:r.end)==null||g.call(r,n))}})):n?(a(3),l.nextFrame(()=>h())):void 0},[e,n,t,l]),e?[o,{closed:s(1),enter:s(2),leave:s(4),transition:s(2)||s(4)}]:[n,{closed:void 0,enter:void 0,leave:void 0,transition:void 0}]}function Is(e,{prepare:t,run:n,done:r,inFlight:o}){let i=$e();return Os(e,{prepare:t,inFlight:o}),i.nextFrame(()=>{i.add(Rs(e,r)),n()}),i.dispose}function Rs(e,t){let n=Ps(t),r=$e();if(!e)return r.dispose;let{transitionDuration:o,transitionDelay:i}=getComputedStyle(e),[s,a]=[o,i].map(u=>{let[d=0]=u.split(",").filter(Boolean).map(l=>l.includes("ms")?parseFloat(l):parseFloat(l)*1e3).sort((l,h)=>h-l);return d}),c=s+a;if(c!==0){let u=r.group(d=>{let l=d.setTimeout(()=>{n(),d.dispose()},c);d.addEventListener(e,"transitionrun",h=>{h.target===h.currentTarget&&(l(),d.addEventListener(e,"transitioncancel",f=>{f.target===f.currentTarget&&(n(),u())}))})});r.addEventListener(e,"transitionend",d=>{d.target===d.currentTarget&&(n(),r.dispose())})}else n();return r.dispose}function Os(e,{inFlight:t,prepare:n}){if(t!=null&&t.current){n();return}let r=e.style.transition;e.style.transition="none",n(),e.offsetHeight,e.style.transition=r}function $n(e,t){let n=w([]),r=G(e);W(()=>{let o=[...n.current];for(let[i,s]of t.entries())if(n.current[i]!==s){let a=r(t,o);return n.current=t,a}},[r,...t])}let kt=ie(null);kt.displayName="OpenClosedContext";var de=(e=>(e[e.Open=1]="Open",e[e.Closed=2]="Closed",e[e.Closing=4]="Closing",e[e.Opening=8]="Opening",e))(de||{});function St(){return te(kt)}function Hs({value:e,children:t}){return P.createElement(kt.Provider,{value:e},t)}function Vs({children:e}){return P.createElement(kt.Provider,{value:null},e)}function Ws(e){function t(){document.readyState!=="loading"&&(e(),document.removeEventListener("DOMContentLoaded",t))}typeof window<"u"&&typeof document<"u"&&(document.addEventListener("DOMContentLoaded",t),t())}let ke=[];Ws(()=>{function e(t){t.target instanceof HTMLElement&&t.target!==document.body&&ke[0]!==t.target&&(ke.unshift(t.target),ke=ke.filter(n=>n!=null&&n.isConnected),ke.splice(10))}window.addEventListener("click",e,{capture:!0}),window.addEventListener("mousedown",e,{capture:!0}),window.addEventListener("focus",e,{capture:!0}),document.body.addEventListener("click",e,{capture:!0}),document.body.addEventListener("mousedown",e,{capture:!0}),document.body.addEventListener("focus",e,{capture:!0})});function ro(e){let t=G(e),n=w(!1);W(()=>(n.current=!1,()=>{n.current=!0,bt(()=>{n.current&&t()})}),[t])}function zs(){let e=typeof document>"u";return"useSyncExternalStore"in Nr?(t=>t.useSyncExternalStore)(Nr)(()=>()=>{},()=>!1,()=>!e):!1}function it(){let e=zs(),[t,n]=x(Ae.isHandoffComplete);return t&&Ae.isHandoffComplete===!1&&n(!1),W(()=>{t!==!0&&n(!0)},[t]),W(()=>Ae.handoff(),[]),e?!1:t}let oo=ie(!1);function Us(){return te(oo)}function io(e){return P.createElement(oo.Provider,{value:e.force},e.children)}function js(e){let t=Us(),n=te(ao),r=ot(e),[o,i]=x(()=>{var s;if(!t&&n!==null)return(s=n.current)!=null?s:null;if(Ae.isServer)return null;let a=r==null?void 0:r.getElementById("headlessui-portal-root");if(a)return a;if(r===null)return null;let c=r.createElement("div");return c.setAttribute("id","headlessui-portal-root"),r.body.appendChild(c)});return W(()=>{o!==null&&(r!=null&&r.body.contains(o)||r==null||r.body.appendChild(o))},[o,r]),W(()=>{t||n!==null&&i(n.current)},[n,i,t]),o}let so=q,Bs=re(function(e,t){let n=e,r=w(null),o=he(ns(d=>{r.current=d}),t),i=ot(r),s=js(r),[a]=x(()=>{var d;return Ae.isServer?null:(d=i==null?void 0:i.createElement("div"))!=null?d:null}),c=te(Tn),u=it();return ne(()=>{!s||!a||s.contains(a)||(a.setAttribute("data-headlessui-portal",""),s.appendChild(a))},[s,a]),ne(()=>{if(a&&c)return c.register(a)},[c,a]),ro(()=>{var d;!s||!a||(a instanceof Node&&s.contains(a)&&s.removeChild(a),s.childNodes.length<=0&&((d=s.parentElement)==null||d.removeChild(s)))}),u?!s||!a?null:vt(se({ourProps:{ref:o},theirProps:n,slot:{},defaultTag:so,name:"Portal"}),a):null});function qs(e,t){let n=he(t),{enabled:r=!0,...o}=e;return r?P.createElement(Bs,{...o,ref:n}):se({ourProps:{ref:n},theirProps:o,slot:{},defaultTag:so,name:"Portal"})}let Ys=q,ao=ie(null);function Ks(e,t){let{target:n,...r}=e,o={ref:he(t)};return P.createElement(ao.Provider,{value:n},se({ourProps:o,theirProps:r,defaultTag:Ys,name:"Popover.Group"}))}let Tn=ie(null);function Gs(){let e=te(Tn),t=w([]),n=G(i=>(t.current.push(i),e&&e.register(i),()=>r(i))),r=G(i=>{let s=t.current.indexOf(i);s!==-1&&t.current.splice(s,1),e&&e.unregister(i)}),o=U(()=>({register:n,unregister:r,portals:t}),[n,r,t]);return[t,U(()=>function({children:i}){return P.createElement(Tn.Provider,{value:o},i)},[o])]}let Zs=re(qs),co=re(Ks),Xs=Object.assign(Zs,{Group:co});function Js(e,t=typeof document<"u"?document.defaultView:null,n){let r=je(e,"escape");no(t,"keydown",o=>{r&&(o.defaultPrevented||o.key===qr.Escape&&n(o))})}function Qs(){var e;let[t]=x(()=>typeof window<"u"&&typeof window.matchMedia=="function"?window.matchMedia("(pointer: coarse)"):null),[n,r]=x((e=t==null?void 0:t.matches)!=null?e:!1);return ne(()=>{if(!t)return;function o(i){r(i.matches)}return t.addEventListener("change",o),()=>t.removeEventListener("change",o)},[t]),n}function ea({defaultContainers:e=[],portals:t,mainTreeNodeRef:n}={}){var r;let o=w((r=n==null?void 0:n.current)!=null?r:null),i=ot(o),s=G(()=>{var a,c,u;let d=[];for(let l of e)l!==null&&(l instanceof HTMLElement?d.push(l):"current"in l&&l.current instanceof HTMLElement&&d.push(l.current));if(t!=null&&t.current)for(let l of t.current)d.push(l);for(let l of(a=i==null?void 0:i.querySelectorAll("html > *, body > *"))!=null?a:[])l!==document.body&&l!==document.head&&l instanceof HTMLElement&&l.id!=="headlessui-portal-root"&&(l.contains(o.current)||l.contains((u=(c=o.current)==null?void 0:c.getRootNode())==null?void 0:u.host)||d.some(h=>l.contains(h))||d.push(l));return d});return{resolveContainers:s,contains:G(a=>s().some(c=>c.contains(a))),mainTreeNodeRef:o,MainTreeNode:U(()=>function(){return n!=null?null:P.createElement(gn,{features:Ct.Hidden,ref:o})},[o,n])}}function Cn(){let e=w(!1);return ne(()=>(e.current=!0,()=>{e.current=!1}),[]),e}var st=(e=>(e[e.Forwards=0]="Forwards",e[e.Backwards=1]="Backwards",e))(st||{});function ta(){let e=w(0);return eo(!0,"keydown",t=>{t.key==="Tab"&&(e.current=t.shiftKey?1:0)},!0),e}function lo(e){if(!e)return new Set;if(typeof e=="function")return new Set(e());let t=new Set;for(let n of e.current)n.current instanceof HTMLElement&&t.add(n.current);return t}let na="div";var Oe=(e=>(e[e.None=0]="None",e[e.InitialFocus=1]="InitialFocus",e[e.TabLock=2]="TabLock",e[e.FocusLock=4]="FocusLock",e[e.RestoreFocus=8]="RestoreFocus",e[e.AutoFocus=16]="AutoFocus",e))(Oe||{});function ra(e,t){let n=w(null),r=he(n,t),{initialFocus:o,initialFocusFallback:i,containers:s,features:a=15,...c}=e;it()||(a=0);let u=ot(n);aa(a,{ownerDocument:u});let d=ca(a,{ownerDocument:u,container:n,initialFocus:o,initialFocusFallback:i});la(a,{ownerDocument:u,container:n,containers:s,previousActiveElement:d});let l=ta(),h=G(m=>{let y=n.current;y&&(b=>b())(()=>{Te(l.current,{[st.Forwards]:()=>{nt(y,we.First,{skipElements:[m.relatedTarget,i]})},[st.Backwards]:()=>{nt(y,we.Last,{skipElements:[m.relatedTarget,i]})}})})}),f=je(!!(a&2),"focus-trap#tab-lock"),v=Et(),g=w(!1),_={ref:r,onKeyDown(m){m.key=="Tab"&&(g.current=!0,v.requestAnimationFrame(()=>{g.current=!1}))},onBlur(m){if(!(a&4))return;let y=lo(s);n.current instanceof HTMLElement&&y.add(n.current);let b=m.relatedTarget;b instanceof HTMLElement&&b.dataset.headlessuiFocusGuard!=="true"&&(uo(y,b)||(g.current?nt(n.current,Te(l.current,{[st.Forwards]:()=>we.Next,[st.Backwards]:()=>we.Previous})|we.WrapAround,{relativeTo:m.target}):m.target instanceof HTMLElement&&be(m.target)))}};return P.createElement(P.Fragment,null,f&&P.createElement(gn,{as:"button",type:"button","data-headlessui-focus-guard":!0,onFocus:h,features:Ct.Focusable}),se({ourProps:_,theirProps:c,defaultTag:na,name:"FocusTrap"}),f&&P.createElement(gn,{as:"button",type:"button","data-headlessui-focus-guard":!0,onFocus:h,features:Ct.Focusable}))}let oa=re(ra),ia=Object.assign(oa,{features:Oe});function sa(e=!0){let t=w(ke.slice());return $n(([n],[r])=>{r===!0&&n===!1&&bt(()=>{t.current.splice(0)}),r===!1&&n===!0&&(t.current=ke.slice())},[e,ke,t]),G(()=>{var n;return(n=t.current.find(r=>r!=null&&r.isConnected))!=null?n:null})}function aa(e,{ownerDocument:t}){let n=!!(e&8),r=sa(n);$n(()=>{n||(t==null?void 0:t.activeElement)===(t==null?void 0:t.body)&&be(r())},[n]),ro(()=>{n&&be(r())})}function ca(e,{ownerDocument:t,container:n,initialFocus:r,initialFocusFallback:o}){let i=w(null),s=je(!!(e&1),"focus-trap#initial-focus"),a=Cn();return $n(()=>{if(e===0)return;if(!s){o!=null&&o.current&&be(o.current);return}let c=n.current;c&&bt(()=>{if(!a.current)return;let u=t==null?void 0:t.activeElement;if(r!=null&&r.current){if((r==null?void 0:r.current)===u){i.current=u;return}}else if(c.contains(u)){i.current=u;return}if(r!=null&&r.current)be(r.current);else{if(e&16){if(nt(c,we.First|we.AutoFocus)!==En.Error)return}else if(nt(c,we.First)!==En.Error)return;if(o!=null&&o.current&&(be(o.current),(t==null?void 0:t.activeElement)===o.current))return;console.warn("There are no focusable elements inside the <FocusTrap />")}i.current=t==null?void 0:t.activeElement})},[o,s,e]),i}function la(e,{ownerDocument:t,container:n,containers:r,previousActiveElement:o}){let i=Cn(),s=!!(e&4);no(t==null?void 0:t.defaultView,"focus",a=>{if(!s||!i.current)return;let c=lo(r);n.current instanceof HTMLElement&&c.add(n.current);let u=o.current;if(!u)return;let d=a.target;d&&d instanceof HTMLElement?uo(c,d)?(o.current=d,be(d)):(a.preventDefault(),a.stopPropagation(),be(u)):be(o.current)},!0)}function uo(e,t){for(let n of e)if(n.contains(t))return!0;return!1}function fo(e){var t;return!!(e.enter||e.enterFrom||e.enterTo||e.leave||e.leaveFrom||e.leaveTo)||((t=e.as)!=null?t:po)!==q||P.Children.count(e.children)===1}let Ft=ie(null);Ft.displayName="TransitionContext";var ua=(e=>(e.Visible="visible",e.Hidden="hidden",e))(ua||{});function da(){let e=te(Ft);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}function fa(){let e=te(Mt);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}let Mt=ie(null);Mt.displayName="NestingContext";function xt(e){return"children"in e?xt(e.children):e.current.filter(({el:t})=>t.current!==null).filter(({state:t})=>t==="visible").length>0}function ho(e,t){let n=De(e),r=w([]),o=Cn(),i=Et(),s=G((f,v=Ce.Hidden)=>{let g=r.current.findIndex(({el:_})=>_===f);g!==-1&&(Te(v,{[Ce.Unmount](){r.current.splice(g,1)},[Ce.Hidden](){r.current[g].state="hidden"}}),i.microTask(()=>{var _;!xt(r)&&o.current&&((_=n.current)==null||_.call(n))}))}),a=G(f=>{let v=r.current.find(({el:g})=>g===f);return v?v.state!=="visible"&&(v.state="visible"):r.current.push({el:f,state:"visible"}),()=>s(f,Ce.Unmount)}),c=w([]),u=w(Promise.resolve()),d=w({enter:[],leave:[]}),l=G((f,v,g)=>{c.current.splice(0),t&&(t.chains.current[v]=t.chains.current[v].filter(([_])=>_!==f)),t==null||t.chains.current[v].push([f,new Promise(_=>{c.current.push(_)})]),t==null||t.chains.current[v].push([f,new Promise(_=>{Promise.all(d.current[v].map(([m,y])=>y)).then(()=>_())})]),v==="enter"?u.current=u.current.then(()=>t==null?void 0:t.wait.current).then(()=>g(v)):g(v)}),h=G((f,v,g)=>{Promise.all(d.current[v].splice(0).map(([_,m])=>m)).then(()=>{var _;(_=c.current.shift())==null||_()}).then(()=>g(v))});return U(()=>({children:r,register:a,unregister:s,onStart:l,onStop:h,wait:u,chains:d}),[a,s,r,l,h,d,u])}let po=q,mo=$t.RenderStrategy;function ha(e,t){var n,r;let{transition:o=!0,beforeEnter:i,afterEnter:s,beforeLeave:a,afterLeave:c,enter:u,enterFrom:d,enterTo:l,entered:h,leave:f,leaveFrom:v,leaveTo:g,..._}=e,m=w(null),y=fo(e),b=he(...y?[m,t]:t===null?[]:[t]),E=(n=_.unmount)==null||n?Ce.Unmount:Ce.Hidden,{show:T,appear:D,initial:F}=da(),[O,M]=x(T?"visible":"hidden"),C=fa(),{register:k,unregister:z}=C;ne(()=>k(m),[k,m]),ne(()=>{if(E===Ce.Hidden&&m.current){if(T&&O!=="visible"){M("visible");return}return Te(O,{hidden:()=>z(m),visible:()=>k(m)})}},[O,m,k,z,T,E]);let R=it();ne(()=>{if(y&&R&&O==="visible"&&m.current===null)throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?")},[m,O,R,y]);let K=F&&!D,I=D&&T&&F,V=w(!1),S=ho(()=>{V.current||(M("hidden"),z(m))},C),L=G(Q=>{V.current=!0;let J=Q?"enter":"leave";S.onStart(m,J,ee=>{ee==="enter"?i==null||i():ee==="leave"&&(a==null||a())})}),H=G(Q=>{let J=Q?"enter":"leave";V.current=!1,S.onStop(m,J,ee=>{ee==="enter"?s==null||s():ee==="leave"&&(c==null||c())}),J==="leave"&&!xt(S)&&(M("hidden"),z(m))});W(()=>{y&&o||(L(T),H(T))},[T,y,o]);let N=!(!o||!y||!R||K),[,$]=Ds(N,m,T,{start:L,end:H}),B=Ie({ref:b,className:((r=vn(_.className,I&&u,I&&d,$.enter&&u,$.enter&&$.closed&&d,$.enter&&!$.closed&&l,$.leave&&f,$.leave&&!$.closed&&v,$.leave&&$.closed&&g,!$.transition&&T&&h))==null?void 0:r.trim())||void 0,...As($)}),X=0;return O==="visible"&&(X|=de.Open),O==="hidden"&&(X|=de.Closed),$.enter&&(X|=de.Opening),$.leave&&(X|=de.Closing),P.createElement(Mt.Provider,{value:S},P.createElement(Hs,{value:X},se({ourProps:B,theirProps:_,defaultTag:po,features:mo,visible:O==="visible",name:"Transition.Child"})))}function pa(e,t){let{show:n,appear:r=!1,unmount:o=!0,...i}=e,s=w(null),a=fo(e),c=he(...a?[s,t]:t===null?[]:[t]);it();let u=St();if(n===void 0&&u!==null&&(n=(u&de.Open)===de.Open),n===void 0)throw new Error("A <Transition /> is used but it is missing a `show={true | false}` prop.");let[d,l]=x(n?"visible":"hidden"),h=ho(()=>{n||l("hidden")}),[f,v]=x(!0),g=w([n]);ne(()=>{f!==!1&&g.current[g.current.length-1]!==n&&(g.current.push(n),v(!1))},[g,n]);let _=U(()=>({show:n,appear:r,initial:f}),[n,r,f]);Xr(n,s,()=>l("hidden")),ne(()=>{n?l("visible"):!xt(h)&&s.current!==null&&l("hidden")},[n,h]);let m={unmount:o},y=G(()=>{var E;f&&v(!1),(E=e.beforeEnter)==null||E.call(e)}),b=G(()=>{var E;f&&v(!1),(E=e.beforeLeave)==null||E.call(e)});return P.createElement(Mt.Provider,{value:h},P.createElement(Ft.Provider,{value:_},se({ourProps:{...m,as:q,children:P.createElement(vo,{ref:c,...m,...i,beforeEnter:y,beforeLeave:b})},theirProps:{},defaultTag:q,features:mo,visible:d==="visible",name:"Transition"})))}function ma(e,t){let n=te(Ft)!==null,r=St()!==null;return P.createElement(P.Fragment,null,!n&&r?P.createElement(kn,{ref:t,...e}):P.createElement(vo,{ref:t,...e}))}let kn=re(pa),vo=re(ha),Sn=re(ma),pe=Object.assign(kn,{Child:Sn,Root:kn});var va=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(va||{}),_a=(e=>(e[e.SetTitleId=0]="SetTitleId",e))(_a||{});let ga={0(e,t){return e.titleId===t.id?e:{...e,titleId:t.id}}},Fn=ie(null);Fn.displayName="DialogContext";function Pt(e){let t=te(Fn);if(t===null){let n=new Error(`<${e} /> is missing a parent <Dialog /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,Pt),n}return t}function ya(e,t){return Te(t.type,ga,e,t)}let _o=re(function(e,t){let n=Ee(),{id:r=`headlessui-dialog-${n}`,open:o,onClose:i,initialFocus:s,role:a="dialog",autoFocus:c=!0,__demoMode:u=!1,...d}=e,l=w(!1);a=function(){return a==="dialog"||a==="alertdialog"?a:(l.current||(l.current=!0,console.warn(`Invalid role [${a}] passed to <Dialog />. Only \`dialog\` and and \`alertdialog\` are supported. Using \`dialog\` instead.`)),"dialog")}();let h=St();o===void 0&&h!==null&&(o=(h&de.Open)===de.Open);let f=w(null),v=he(f,t),g=ot(f),_=o?0:1,[m,y]=Ze(ya,{titleId:null,descriptionId:null,panelRef:Ut()}),b=G(()=>i(!1)),E=G(N=>y({type:0,id:N})),T=it()?_===0:!1,[D,F]=Gs(),O={get current(){var N;return(N=m.panelRef.current)!=null?N:f.current}},{resolveContainers:M,mainTreeNodeRef:C,MainTreeNode:k}=ea({portals:D,defaultContainers:[O]}),z=h!==null?(h&de.Closing)===de.Closing:!1;fs(u||z?!1:T,{allowed:G(()=>{var N,$;return[($=(N=f.current)==null?void 0:N.closest("[data-headlessui-portal]"))!=null?$:null]}),disallowed:G(()=>{var N,$;return[($=(N=C.current)==null?void 0:N.closest("body > *:not(#headlessui-portal-root)"))!=null?$:null]})}),Ts(T,M,N=>{N.preventDefault(),b()}),Js(T,g==null?void 0:g.defaultView,N=>{N.preventDefault(),N.stopPropagation(),document.activeElement&&"blur"in document.activeElement&&typeof document.activeElement.blur=="function"&&document.activeElement.blur(),b()}),xs(u||z?!1:T,g,M),Xr(T,f,b);let[R,K]=rs(),I=U(()=>[{dialogState:_,close:b,setTitleId:E},m],[_,m,b,E]),V=U(()=>({open:_===0}),[_]),S={ref:v,id:r,role:a,tabIndex:-1,"aria-modal":u?void 0:_===0?!0:void 0,"aria-labelledby":m.titleId,"aria-describedby":R},L=!Qs(),H=Oe.None;return T&&!u&&(H|=Oe.RestoreFocus,H|=Oe.TabLock,c&&(H|=Oe.AutoFocus),L&&(H|=Oe.InitialFocus)),P.createElement(Vs,null,P.createElement(io,{force:!0},P.createElement(Xs,null,P.createElement(Fn.Provider,{value:I},P.createElement(co,{target:f},P.createElement(io,{force:!1},P.createElement(K,{slot:V},P.createElement(F,null,P.createElement(ia,{initialFocus:s,initialFocusFallback:f,containers:M,features:H},P.createElement(ls,{value:b},se({ourProps:S,theirProps:d,slot:V,defaultTag:wa,features:ba,visible:_===0,name:"Dialog"})))))))))),P.createElement(ts,null,P.createElement(k,null)))}),wa="div",ba=$t.RenderStrategy|$t.Static;function Ea(e,t){let{transition:n=!1,open:r,...o}=e,i=St(),s=e.hasOwnProperty("open")||i!==null,a=e.hasOwnProperty("onClose");if(!s&&!a)throw new Error("You have to provide an `open` and an `onClose` prop to the `Dialog` component.");if(!s)throw new Error("You provided an `onClose` prop to the `Dialog`, but forgot an `open` prop.");if(!a)throw new Error("You provided an `open` prop to the `Dialog`, but forgot an `onClose` prop.");if(!i&&typeof e.open!="boolean")throw new Error(`You provided an \`open\` prop to the \`Dialog\`, but the value is not a boolean. Received: ${e.open}`);if(typeof e.onClose!="function")throw new Error(`You provided an \`onClose\` prop to the \`Dialog\`, but the value is not a function. Received: ${e.onClose}`);return(r!==void 0||n)&&!o.static?P.createElement(pe,{show:r,transition:n,unmount:o.unmount},P.createElement(_o,{ref:t,...o})):P.createElement(_o,{ref:t,open:r,...o})}let $a="div";function Ta(e,t){let n=Ee(),{id:r=`headlessui-dialog-panel-${n}`,transition:o=!1,...i}=e,[{dialogState:s},a]=Pt("Dialog.Panel"),c=he(t,a.panelRef),u=U(()=>({open:s===0}),[s]),d=G(l=>{l.stopPropagation()});return P.createElement(o?Sn:q,null,se({ourProps:{ref:c,id:r,onClick:d},theirProps:i,slot:u,defaultTag:$a,name:"Dialog.Panel"}))}let Ca="div";function ka(e,t){let{transition:n=!1,...r}=e,[{dialogState:o}]=Pt("Dialog.Backdrop"),i=U(()=>({open:o===0}),[o]);return P.createElement(n?Sn:q,null,se({ourProps:{ref:t,"aria-hidden":!0},theirProps:r,slot:i,defaultTag:Ca,name:"Dialog.Backdrop"}))}let Sa="h2";function Fa(e,t){let n=Ee(),{id:r=`headlessui-dialog-title-${n}`,...o}=e,[{dialogState:i,setTitleId:s}]=Pt("Dialog.Title"),a=he(t);W(()=>(s(r),()=>s(null)),[r,s]);let c=U(()=>({open:i===0}),[i]);return se({ourProps:{ref:a,id:r},theirProps:o,slot:c,defaultTag:Sa,name:"Dialog.Title"})}let Ma=re(Ea),go=re(Ta);re(ka);let xa=re(Fa),Pa=Object.assign(Ma,{Panel:go,Title:xa,Description:as});const Lt={root:"_root_1duny_1",modal:"_modal_1duny_10",container:"_container_1duny_13",page:"_page_1duny_18",close:"_close_1duny_21"},La={root:"_root_1h6qm_1"},me=e=>{const{children:t,size:n="md",fill:r="currentColor",stroke:o,strokeWidth:i,className:s="",viewBox:a="0 0 20 20"}=e,c=U(()=>{switch(n){case"sm":return"yvlw-w-4 yvlw-h-4";case"lg":return"yvlw-w-7 yvlw-h-7";case"xl":return"yvlw-w-10 yvlw-h-10";case"custom":return"";default:return"yvlw-w-5 yvlw-h-5"}},[n]);return p("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:a,fill:r,stroke:o,strokeWidth:i,className:`${c} ${s}`,children:t})},Na=()=>p(me,{children:p("path",{d:"M10 2a.75.75 0 01.75.75v1.5a.75.75 0 01-1.5 0v-1.5A.75.75 0 0110 2zM10 15a.75.75 0 01.75.75v1.5a.75.75 0 01-1.5 0v-1.5A.75.75 0 0110 15zM10 7a3 3 0 100 6 3 3 0 000-6zM15.657 5.404a.75.75 0 10-1.06-1.06l-1.061 1.06a.75.75 0 001.06 1.06l1.06-1.06zM6.464 14.596a.75.75 0 10-1.06-1.06l-1.06 1.06a.75.75 0 001.06 1.06l1.06-1.06zM18 10a.75.75 0 01-.75.75h-1.5a.75.75 0 010-1.5h1.5A.75.75 0 0118 10zM5 10a.75.75 0 01-.75.75h-1.5a.75.75 0 010-1.5h1.5A.75.75 0 015 10zM14.596 15.657a.75.75 0 001.06-1.06l-1.06-1.061a.75.75 0 10-1.06 1.06l1.06 1.06zM5.404 6.464a.75.75 0 001.06-1.06l-1.06-1.06a.75.75 0 10-1.061 1.06l1.06 1.06z"})}),yo=e=>p(me,{...e,children:p("path",{fillRule:"evenodd",d:"M7.455 2.004a.75.75 0 01.26.77 7 7 0 009.958 7.967.75.75 0 011.067.853A8.5 8.5 0 116.647 1.921a.75.75 0 01.808.083z",clipRule:"evenodd"})}),Aa=e=>p(me,{...e,viewBox:"0 0 24 24",children:[p("path",{d:"M0 0h24v24H0V0z",fill:"none"}),p("path",{d:"M19.07 4.93l-1.41 1.41C19.1 7.79 20 9.79 20 12c0 4.42-3.58 8-8 8s-8-3.58-8-8c0-4.08 3.05-7.44 7-7.93v2.02C8.16 6.57 6 9.03 6 12c0 3.31 2.69 6 6 6s6-2.69 6-6c0-1.66-.67-3.16-1.76-4.24l-1.41 1.41C15.55 9.9 16 10.9 16 12c0 2.21-1.79 4-4 4s-4-1.79-4-4c0-1.86 1.28-3.41 3-3.86v2.14c-.6.35-1 .98-1 1.72 0 1.1.9 2 2 2s2-.9 2-2c0-.74-.4-1.38-1-1.72V2h-1C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10c0-2.76-1.12-5.26-2.93-7.07z"})]}),Da=e=>p(me,{...e,viewBox:"0 0 24 24",children:[p("path",{d:"M0 0h24v24H0V0z",fill:"none"}),p("path",{d:"M3.72 6.04c.47.46 1.21.48 1.71.06.37-.32.69-.51.87-.43.5.2 0 1.03-.3 1.52-.25.42-2.86 3.89-2.86 6.31 0 1.28.48 2.34 1.34 2.98.75.56 1.74.73 2.64.46 1.07-.31 1.95-1.4 3.06-2.77 1.21-1.49 2.83-3.44 4.08-3.44 1.63 0 1.65 1.01 1.76 1.79-3.78.64-5.38 3.67-5.38 5.37 0 1.7 1.44 3.09 3.21 3.09 1.63 0 4.29-1.33 4.69-6.1h1.21c.69 0 1.25-.56 1.25-1.25s-.56-1.25-1.25-1.25h-1.22c-.15-1.65-1.09-4.2-4.03-4.2-2.25 0-4.18 1.91-4.94 2.84-.58.73-2.06 2.48-2.29 2.72-.25.3-.68.84-1.11.84-.45 0-.72-.83-.36-1.92.35-1.09 1.4-2.86 1.85-3.52.78-1.14 1.3-1.92 1.3-3.28C8.95 3.69 7.31 3 6.44 3c-1.09 0-2.04.63-2.7 1.22-.53.48-.53 1.32-.02 1.82zm10.16 12.51c-.31 0-.74-.26-.74-.72 0-.6.73-2.2 2.87-2.76-.3 2.69-1.43 3.48-2.13 3.48z"})]}),wo=e=>p(me,{...e,viewBox:"0 0 24 24",children:[p("path",{d:"M0 0h24v24H0V0z",fill:"none"}),p("path",{d:"M3.72 6.04c.47.46 1.21.48 1.71.06.37-.32.69-.51.87-.43.5.2 0 1.03-.3 1.52-.25.42-2.86 3.89-2.86 6.31 0 1.28.48 2.34 1.34 2.98.75.56 1.74.73 2.64.46 1.07-.31 1.95-1.4 3.06-2.77 1.21-1.49 2.83-3.44 4.08-3.44 1.63 0 1.65 1.01 1.76 1.79-3.78.64-5.38 3.67-5.38 5.37 0 1.7 1.44 3.09 3.21 3.09 1.63 0 4.29-1.33 4.69-6.1h1.21c.69 0 1.25-.56 1.25-1.25s-.56-1.25-1.25-1.25h-1.22c-.15-1.65-1.09-4.2-4.03-4.2-2.25 0-4.18 1.91-4.94 2.84-.58.73-2.06 2.48-2.29 2.72-.25.3-.68.84-1.11.84-.45 0-.72-.83-.36-1.92.35-1.09 1.4-2.86 1.85-3.52.78-1.14 1.3-1.92 1.3-3.28C8.95 3.69 7.31 3 6.44 3c-1.09 0-2.04.63-2.7 1.22-.53.48-.53 1.32-.02 1.82zm10.16 12.51c-.31 0-.74-.26-.74-.72 0-.6.73-2.2 2.87-2.76-.3 2.69-1.43 3.48-2.13 3.48z"})]}),Ia=e=>p(me,{...e,children:[p("path",{d:"M0 0h24v24H0V0z",fill:"none"}),p("path",{d:"M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0-6c1.1 0 2 .9 2 2s-.9 2-2 2-2-.9-2-2 .9-2 2-2zm0 7c-2.67 0-8 1.34-8 4v2c0 .55.45 1 1 1h14c.55 0 1-.45 1-1v-2c0-2.66-5.33-4-8-4zm6 5H6v-.99c.2-.72 3.3-2.01 6-2.01s5.8 1.29 6 2v1z"})]}),Ra=e=>p(me,{...e,children:p("path",{d:"M18,10l-1.77-2.03l0.25-2.69l-2.63-0.6l-1.37-2.32L10,3.43L7.53,2.36L6.15,4.68L3.53,5.28l0.25,2.69L2,10l1.77,2.03 l-0.25,2.69l2.63,0.6l1.37,2.32L10,16.56l2.47,1.07l1.37-2.32l2.63-0.6l-0.25-2.69L18,10z M13.18,8.47l-4.24,4.24 c-0.2,0.2-0.51,0.2-0.71,0L6.82,11.3c-0.2-0.2-0.2-0.51,0-0.71s0.51-0.2,0.71,0l1.06,1.06l3.89-3.89c0.2-0.2,0.51-0.2,0.71,0 S13.38,8.28,13.18,8.47z"})}),bo=e=>p(me,{...e,viewBox:"0 0 24 24",children:p("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"})}),Oa=e=>p(me,{...e,children:p("path",{d:"M6.28 5.22a.75.75 0 0 0-1.06 1.06L8.94 10l-3.72 3.72a.75.75 0 1 0 1.06 1.06L10 11.06l3.72 3.72a.75.75 0 1 0 1.06-1.06L11.06 10l3.72-3.72a.75.75 0 0 0-1.06-1.06L10 8.94 6.28 5.22Z"})}),Eo=e=>p(me,{...e,viewBox:"0 0 99 32",children:[p("g",{clipPath:"url(#clip0_9581_165880)",children:[p("path",{d:"M98.9474 20.7006V2.701C98.9474 1.20997 97.7302 0 96.2304 0H87.4325H2.71699C1.21714 0 0 1.20997 0 2.701V29.299C0 30.79 1.21714 32 2.71699 32H86.6203C87.2911 32 87.938 31.7523 88.4388 31.3069L98.0489 22.7084C98.6191 22.1964 98.9474 21.4651 98.9474 20.7006Z",fill:"#46B2C8"}),p("path",{d:"M24.3666 25.2683H20.593C19.3951 25.2683 18.4199 24.2989 18.4199 23.108V8.8908C18.4199 7.69988 19.3951 6.73047 20.593 6.73047H24.3642C25.5622 6.73047 26.5374 7.69988 26.5374 8.8908V23.1056C26.5398 24.2989 25.5646 25.2683 24.3666 25.2683ZM20.593 8.52161C20.3894 8.52161 20.2217 8.68596 20.2217 8.8908V23.1056C20.2217 23.3081 20.387 23.4748 20.593 23.4748H24.3642C24.5679 23.4748 24.7356 23.3104 24.7356 23.1056V8.8908C24.7356 8.68834 24.5703 8.52161 24.3642 8.52161H20.593Z",fill:"#C7E8EF"}),p("path",{d:"M68.9385 6.74805H67.1367V25.2549H68.9385V6.74805Z",fill:"white"}),p("path",{d:"M55.0725 8.52161V6.73047H47.8535V25.2683H55.0725V23.4748H49.6577V18.9874H52.9664V17.1963H49.6577V8.52161H55.0725Z",fill:"white"}),p("path",{d:"M46.528 6.73828L44.4795 23.4993C44.283 24.5354 43.4061 25.2595 42.3447 25.2595C41.2833 25.2595 40.404 24.5354 40.2099 23.4993L40.2003 23.4421L38.1758 6.73828H39.9919L41.9853 23.1896C42.0404 23.4183 42.2081 23.4683 42.3447 23.4683C42.4789 23.4683 42.649 23.4183 42.7041 23.1896L44.7119 6.73828H46.528Z",fill:"white"}),p("path",{d:"M36.9104 6.73047V23.1056C36.9104 24.2965 35.9353 25.2659 34.7373 25.2659H30.9685C29.7681 25.2659 28.793 24.2965 28.793 23.1056V6.73047H30.5947V23.1056C30.5947 23.3104 30.7624 23.4748 30.9685 23.4748H34.7373C34.9433 23.4748 35.1087 23.3081 35.1087 23.1056V6.73047H36.9104Z",fill:"#C7E8EF"}),p("path",{d:"M78.6291 8.53181V6.73828H71.4102V25.2618H73.2143V18.9976H76.5231V17.2065H73.2143V8.53181H78.6291Z",fill:"white"}),p("path",{d:"M15.8797 6.73047L13.3089 14.9764L10.9034 6.73047H9.02734L12.3793 18.2157V25.2516H14.181V18.2324L17.7653 6.73047H15.8797Z",fill:"#C7E8EF"}),p("path",{d:"M85.7767 6.73047L83.2058 14.9764L80.7979 6.73047H78.9219L82.2738 18.2157V25.2516H84.0755V18.2324L87.6623 6.73047H85.7767Z",fill:"white"}),p("path",{d:"M61.2349 18.4801C63.4535 17.5226 65.0085 15.3241 65.0085 12.7732V8.8908C65.0085 7.69988 64.0357 6.73047 62.8354 6.73047H59.0618C57.8638 6.73047 56.8887 7.69988 56.8887 8.8908V18.0918V18.9874V25.2493H58.6904V18.9898H58.7527C58.9659 18.9898 59.1768 18.9779 59.3828 18.9588L63.6093 25.254H65.78L61.2349 18.4801ZM58.6928 17.1986V8.89318C58.6928 8.68834 58.8581 8.52399 59.0618 8.52399H62.8354C63.039 8.52399 63.2044 8.69072 63.2044 8.89318V12.7756C63.2044 15.2146 61.2085 17.1986 58.7551 17.1986H58.6928Z",fill:"white"})]}),p("defs",{children:p("clipPath",{id:"clip0_9581_165880",children:p("rect",{width:"98.9474",height:"32",fill:"white"})})})]});class Se{static loadVision(){return import("https://cdn.jsdelivr.net/npm/@mediapipe/tasks-vision@0.10.12")}static async loadDetector(){try{const{FaceLandmarker:t,FilesetResolver:n}=await Se.loadVision(),r=await n.forVisionTasks("https://cdn.jsdelivr.net/npm/@mediapipe/tasks-vision@0.10.12/wasm");return await t.createFromOptions(r,{baseOptions:{modelAssetPath:"https://storage.googleapis.com/mediapipe-models/face_landmarker/face_landmarker/float16/1/face_landmarker.task",delegate:"GPU"},outputFaceBlendshapes:!0,runningMode:"IMAGE",numFaces:1})}catch(t){return Promise.reject(t)}}static denormalizeKeypoints(t,n,r){return t.map(o=>({x:o.x*n,y:o.y*r,z:o.z}))}static getBoundingBox(t,n,r){const o={width:n*.6,height:r*.8,x:0,y:0};o.x=(n-o.width)/2,o.y=(r-o.height)/2;let i=1/0,s=-1/0,a=1/0,c=-1/0;t.forEach(d=>{i=Math.min(i,d.x),s=Math.max(s,d.x),a=Math.min(a,d.y),c=Math.max(c,d.y)});const u={xMin:i,xMax:s,yMin:a,yMax:c};return u.xMin<o.x||u.xMax>o.x+o.width||u.yMin<o.y||u.yMax>o.y+o.height?{box:{xMin:i,xMax:s,yMin:a,yMax:c,width:s-i,height:c-a},inBox:!1}:{box:{xMin:i,xMax:s,yMin:a,yMax:c,width:s-i,height:c-a},inBox:!0}}static async detectFaces(t,n){var r;try{const{width:o,height:i}=n,{faceLandmarks:s,faceBlendshapes:a}=await t.detect(n);if(s.length===0)return{faces:[],blendShapes:[],inBox:!1};const c=Se.denormalizeKeypoints(s[0],o,i),{box:u,inBox:d}=Se.getBoundingBox(c,o,i);return{faces:[{keypoints:c,box:u}],blendShapes:((r=a==null?void 0:a[0])==null?void 0:r.categories)??[],inBox:d}}catch(o){return Promise.reject(o)}}}const Ha=(e,t)=>{let n;return typeof OffscreenCanvas<"u"?n=new OffscreenCanvas(e,t):(n=document.createElement("canvas"),n.width=e,n.height=t),n},Mn=(e,t,n,r,o)=>{let i=0,s=0,a=t,c=n;const d=Ha(t,n).getContext("2d",o);return d.drawImage(e,0,0),d.getImageData(i,s,a,c)},Va=e=>new Promise(t=>{const n=document.createElement("canvas");let{width:r}=e,{height:o}=e;e instanceof HTMLVideoElement&&(r=e.videoWidth,o=e.videoHeight),n.width=r,n.height=o,n.getContext("2d").drawImage(e,0,0),n.toBlob(s=>t(s))});function Wa(e){const{width:t,height:n,data:r}=e;let o=0,i=0;const s=[0,-1,0,-1,4,-1,0,-1,0];for(let d=1;d<n-1;d++)for(let l=1;l<t-1;l++){let h=0,f=0,v=0,g=0;for(let m=-1;m<=1;m++)for(let y=-1;y<=1;y++){const b=((d+m)*t+(l+y))*4,E=s[g++];h+=r[b]*E,f+=r[b+1]*E,v+=r[b+2]*E}const _=.299*h+.587*f+.114*v;o+=_,i+=_*_}const a=(t-2)*(n-2);if(a===0)return 0;const c=o/a;return i/a-c*c}function za(){if(MediaRecorder.isTypeSupported("video/webm; codecs=vp9"))return{mimeType:"video/webm; codecs=vp9",videoBitsPerSecond:25e4};if(MediaRecorder.isTypeSupported("video/webm"))return{mimeType:"video/webm",videoBitsPerSecond:25e4};if(MediaRecorder.isTypeSupported("video/mp4"))return{mimeType:"video/mp4",videoBitsPerSecond:25e4}}function $o(e={}){const{onRecord:t=()=>{},onStop:n=()=>{}}=e,r=w([]),o=w(null),i=w(null),s=j(h=>{r.current.push(h)},[]),a=j(async h=>{if(o.current)return;let f=null;h instanceof ImageData?f=await new Promise(v=>{const g=document.createElement("canvas");g.width=h.width,g.height=h.height;const _=g.getContext("2d");_?(_.putImageData(h,0,0),g.toBlob(m=>{v(m)},"image/jpeg",.95)):v(null)}):f=await Va(h),f&&(o.current=f)},[]),c=j(()=>{o.current=null},[]),u=j(h=>{h.data.size>0&&t(h.data)},[]),d=j(()=>{!i.current||i.current.state==="inactive"||(i.current.stop(),i.current.stream.getTracks().forEach(h=>h.stop()),n())},[]),l=j(h=>{i.current||(i.current=new MediaRecorder(h,za()),i.current.ondataavailable=u,i.current.onstop=d,i.current.start(1e3))},[]);return{saveStream:s,savePhoto:a,start:l,stop:d,savedStreams:r,savedPhoto:o,clearSavedPhoto:c}}const Ua=360,ja="#125766",Ba="https://cdn.youverify.co/1721901834404-q2nxqyng5klm918b3BDVU.jpg",To="https://cdn.youverify.co",at={js:{default:"1731681780468-ttgfiK6Sl1GKegUe-wm4v.js",simd:"1731681609027-RTOweJqdl8Tt39aAdyie9.js"},wasm:{default:"1731681817302-aVNwDW6DP2MsDNTbiav_V.wasm",simd:"1731681739675-nvF1En4g5rAW4daq5g5DH.wasm"}},qa=[0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,10,9,1,7,0,65,0,253,15,26,11],Co={spoofing:{key:"GLARE_DETECTION_ERROR",message:"We detected a screen recording or photo during your liveness."},"no face":{key:"LIVENESS_FACE_NOT_FOUND",message:"We could not detect a face in your test."},lighting:{key:"LIGHTING_ERROR",message:"Please check your lighting. Move to a well-lit area, but avoid harsh light or strong reflections on your face."}};function Be(e,t){return Math.sqrt(e**2+t**2)}function Ya(e){const t=e.slice();for(let n=t.length-1;n>0;n--){const r=Math.floor(Math.random()*(n+1));[t[n],t[r]]=[t[r],t[n]]}return t}async function Ka(){var t,n,r;let e=(t=(await navigator.mediaDevices.enumerateDevices()).find(o=>o.deviceId!==""))==null?void 0:t.deviceId;return e?e=e.endsWith("=")?Array.from(atob(e),o=>`0${o.charCodeAt(0).toString(16)}`.slice(-2)).join(""):e:e=((n=globalThis.crypto)==null?void 0:n.randomUUID().replace(/-/g,""))||"0".repeat(64),e="0".repeat(64-e.length)+e,e=(BigInt(`0x${e.substring(0,32)}`)^BigInt(`0x${e.substring(32,64)}`)).toString(16).substring(0,32),e=((r=("0".repeat(32-e.length)+e).match(/^(.{8})(.{4})(.{4})(.{4})(.{12})$/))==null?void 0:r.slice(1).join("-"))||"",e}const He=(e,t)=>{for(const[n,r]of Object.entries(e))if(r===t)return n;return null},Ga=e=>{const t=Object.keys(Co);for(const n of t)if(new RegExp(`\\b${n}\\b`,"i").test(e))return Co[n];return{key:"VALIDATION_ERROR",message:"We detected an error during your test. Please TRY AGAIN"}},Za="https://cdn.svc.youverify.co",Xa=e=>e?"https://identity.staging.svc.youverify.co":"https://identity.svc.youverify.co";function ko(e){const t=Xa(e);return{postData:async o=>{const{faceImage:i,publicKey:s,passed:a,metadata:c,video:u}=o,d=new FormData;d.append("files",i),d.append("files",u);const l=await fetch(`${Za}/v1/uploads/media`,{method:"POST",headers:{},body:d});if(!l.ok)throw l;const h=(await l.json()).data,f=await fetch(`${t}/v1/sdk/identity/liveness/`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({publicMerchantID:s,components:["liveness"],faceImage:h[0].cachedLocation,livenessClip:h[1].cachedLocation,passed:a,metadata:c})});if(!f.ok)throw f;return(await f.json()).data},fetchSessionToken:async o=>{const{action:i="detectLiveness",publicKey:s}=o,a=await Ka(),c=new FormData;c.append("publicMerchantID",s),c.append("action",i),c.append("livenessOperationMode","Passive"),c.append("sendResultsToClient","true"),c.append("deviceCorrelationId",a);const u=await fetch(`${t}/v1/sdk/identity/liveness/token`,{method:"POST",body:c}),{data:d}=await u.json();if(!u.ok)throw new Error("Could not get token");return d.authToken}}}const Ja={"complete-the-circle":{Icon:Aa,name:"Complete The Circle ⭕️",description:"First position your face in the camera frame. Then move your head in a circle to show all the angles of your face"},"yes-or-no":{Icon:Da,name:"Yes or No ❓",description:"First position your face in the camera. Then tilt your head to the left to answer No and to the right to answer Yes"},motions:{Icon:wo,name:"Motions 💫",description:"First position your face in the camera frame, then follow the instructions"},blink:{Icon:wo,name:"Blink 💫",description:"First position your face in the camera frame, then follow the instructions"},"facial-expressions":{Icon:yo,name:"Facial Expressions 🤪",description:"First position your face in the camera frame. Then move your head in a circle to show all the angles of your face"}},So=ie({tasks:[],namespace:"",user:void 0,currentTaskIndex:0,completedCount:0,nextTask:()=>{},completed:!1,onRequestClose:()=>{},faceDetector:null,saveStream:()=>{},savePhoto:()=>{},clearSavedPhoto:()=>{},onComplete:()=>Promise.resolve(),onFailure:()=>{},imageCaptured:!1,setImageCaptured:()=>{},sandboxEnvironment:!0,publicKey:""});let Fo,Mo=!1;function Qa(e){const{publicKey:t,tasks:n,children:r,namespace:o,user:i,branding:s,onRequestClose:a,onSuccess:c=()=>{},onFailure:u=()=>{},metadata:d,presentation:l,sandboxEnvironment:h=!0}=e,[f,v]=x(0),[g,_]=x(0),[m,y]=x(null),[b,E]=x(!1),{saveStream:T,savePhoto:D,savedPhoto:F,clearSavedPhoto:O,savedStreams:M}=$o(),{postData:C}=ko(h),k=U(()=>g===n.length,[n,g]),z=()=>{_(V=>V+1),v(V=>V+1)},R=V=>{const S=new Image;S.crossOrigin="Anonymous",S.src=Ba,S.onload=()=>{const L=Mn(S,S.width,S.height);Se.detectFaces(V,L)}},K=async()=>{if(!F.current){u({faceImage:"",passed:!1,metadata:d,error:{key:"image_capture_failed",message:"No face image captured. Image capture failed. Please try again."}}),a();return}try{const V=await C({faceImage:F.current,video:new Blob(M.current,{type:"video/mp4"}),publicKey:t,passed:!0,metadata:d});c(V),a()}catch{u({faceImage:"",passed:!1,metadata:d,error:{key:"API_ERROR",message:"Failed to process liveness check. Please try again."}}),a()}},I=async()=>{const V=await Se.loadDetector();Fo=V,R(V),y(V)};return W(()=>{if(Mo){y(Fo);return}I(),Mo=!0},[]),p(So.Provider,{value:{tasks:n,namespace:o,user:i,currentTaskIndex:f,completed:k,completedCount:g,nextTask:z,branding:s,onRequestClose:a,faceDetector:m,saveStream:T,savePhoto:D,clearSavedPhoto:O,onComplete:K,onFailure:u,presentation:l,imageCaptured:b,setImageCaptured:E,sandboxEnvironment:h,publicKey:t},children:r})}function fe(){return te(So)}const oe={root:"_root_vqy7d_1",container:"_container_vqy7d_4",lhs:"_lhs_vqy7d_7",info:"_info_vqy7d_11",active:"_active_vqy7d_32",completed:"_completed_vqy7d_39",rhs:"_rhs_vqy7d_62",profile:"_profile_vqy7d_65",avatar:"_avatar_vqy7d_68",main:"_main_vqy7d_81",content:"_content_vqy7d_84"},xn={root:"_root_135td_1",container:"_container_135td_1",brand:"_brand_135td_1"};function ec(){const{branding:e}=fe();return p("div",{className:xn.root,children:p("div",{className:xn.container,children:p("div",{className:xn.brand,children:(e==null?void 0:e.logo)&&p("img",{className:"yvlw-h-10",src:e.logo,alt:"Logo"})})})})}const xo="colorScheme";function Po(){const{namespace:e}=fe(),t=()=>{const o=localStorage.getItem(xo);return!o&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":o},n=(o=null)=>{o&&localStorage.setItem(xo,o);const i=`${e}-color-scheme`,s=document.documentElement;o&&o==="dark"?s==null||s.setAttribute(i,"dark"):s==null||s.removeAttribute(i)};return{setColorScheme:n,toggleColorScheme:()=>{const o=t();return n(o==="dark"?"light":"dark")},getColorScheme:t}}const tc={root:"_root_bcsvc_1"};function nc(){if(!(window.screen.width>=900))return 10/9}function ct(e){const{children:t,onStream:n=()=>{},onRecord:r=()=>{}}=e,o=w(null),i=w(0),s=w(null),{start:a,stop:c}=$o({onRecord:r}),u=async()=>{try{const h=await navigator.mediaDevices.getUserMedia({video:{aspectRatio:{exact:nc()}}});s.current=h,a(h),o.current&&(o.current.srcObject=h)}catch{}},d=()=>{s.current&&(s.current.getTracks().forEach(h=>h.stop()),s.current=null,c(),o.current&&(o.current.srcObject=null))},l=()=>{n(o),i.current=requestAnimationFrame(l)};return W(()=>{const h=o.current;if(!h)return;const f=()=>{i.current=requestAnimationFrame(l)};return u(),h.addEventListener("canplay",f),()=>{h.removeEventListener("canplay",f),cancelAnimationFrame(i.current),d()}},[]),p("div",{className:tc.root,children:[p("video",{ref:o,autoPlay:!0,loop:!0,playsInline:!0}),t]})}const lt={container:"_container_mcmsr_1",focused:"_focused_mcmsr_12",progress:"_progress_mcmsr_15",completed:"_completed_mcmsr_36",marker:"_marker_mcmsr_40"},Lo=360,rc=50;function oc(e){const{visitedSections:t,sectionsCount:n,faceDetected:r,divisions:o=rc}=e,i=U(()=>{const s=[lt.container];return r&&s.push(lt.focused),s.join(" ")},[r]);return p("div",{className:i,children:[p(pe,{as:"div",show:r,leave:"yvlw-transition yvlw-linear yvlw-duration-300",leaveFrom:"yvlw-scale-100 yvlw-opacity-100",leaveTo:"yvlw-scale-125 yvlw-opacity-0",enter:"yvlw-transition yvlw-linear yvlw-duration-300",enterFrom:"yvlw-scale-125 yvlw-opacity-0",enterTo:"yvlw-scale-100 yvlw-opacity-100",className:"yvlw-absolute",children:p("div",{className:lt.progress,children:Array.from(Array(o).keys()).map(s=>{const a=s*Lo/o,c=Math.ceil((a+1)*n/Lo),u=t.includes(c),d=u?s-(c-1)*(o/n):0,l=[];u&&l.push(lt.completed);const h=u?"translateX(158px)":"translateX(150px)";return p("div",{className:l.join(" "),style:{transform:`rotate(${a}deg) ${h}`,transitionDelay:`${d*20}ms`}},`key-${s}`)})})}),p(pe,{as:"div",show:!r,leave:"yvlw-transition yvlw-linear yvlw-duration-200",leaveFrom:"yvlw-scale-100 yvlw-opacity-100",leaveTo:"yvlw-scale-75 yvlw-opacity-0",enter:"yvlw-transition yvlw-linear yvlw-duration-200",enterFrom:"yvlw-scale-75 yvlw-opacity-0",enterTo:"yvlw-scale-100 yvlw-opacity-100",className:"yvlw-absolute",children:p("div",{className:lt.marker,children:[p("div",{}),p("div",{}),p("div",{}),p("div",{})]})})]})}function No(){return{checkZoomLevel:(r,o)=>{const{box:i}=r,{width:s,height:a}=i,c=s*a,u=o**2,d=c/u;if(d>.9)throw new Error("Move face farther from camera");if(d<.05)throw new Error("Move face closer to camera")},checkFacialFeatures:(r,o)=>{},checkInFrame:(r,o)=>{const{offsetX:i,offsetY:s}=o,{box:a}=r;if(!(a.xMin-i>=o.x&&a.yMin-s>=o.y&&a.xMax-i<=o.x+o.width&&a.yMax-s<=o.y+o.height))throw new Error("Position head in frame")}}}function Nt(e={}){const{validations:t=["zoom"],frameSize:n,onFace:r=()=>{},onError:o=()=>{}}=e,{faceDetector:i}=fe(),{checkFacialFeatures:s,checkZoomLevel:a,checkInFrame:c}=No(),u=w(null),d=h=>{var f;try{if(h.length===0)throw new Error("Detecting face...");if(h.length>1)throw new Error("A maximum of 1 face is allowed");const v=u.current,g=(f=u.current)==null?void 0:f.parentElement;if(!v||!g)return;const _=h[0];for(const m of t)switch(m){case"zoom":a(_,Math.min(g.clientHeight,g.clientWidth));break;case"features":s(_,Math.min(g.clientHeight,g.clientWidth));break;case"in-frame":if(!n)throw new Error("Frame size is required to check if face is in frame");const y=n+200;c(_,{x:(g.clientWidth-y)/2,y:(g.clientHeight-y)/2,width:y,height:y,offsetX:(v.videoWidth-g.clientWidth)/2,offsetY:(v.videoHeight-g.clientHeight)/2});break;default:break}r(_)}catch(v){const{message:g}=v;o(g)}};return{detectFaces:async h=>{if(!i)return;const{ref:f}=h;u.current=f.current;const v=u.current;if(!v)throw new Error("No Video Source detected");const{videoWidth:g,videoHeight:_}=v;if(g===0||_===0)return;const m=Mn(v,g,_),y=await Se.detectFaces(i,m);d(y.faces)}}}const ae={root:"_root_5hgaj_1",container:"_container_5hgaj_4",progress:"_progress_5hgaj_7",intro:"_intro_5hgaj_12",content:"_content_5hgaj_15",branding:"_branding_5hgaj_18",instructionsContainer:"_instructionsContainer_5hgaj_22",instructions:"_instructions_5hgaj_22"},Ao={root:"_root_h5elg_1",spinner:"_spinner_h5elg_22"},Do={container:"_container_1vep2_1",spin:"_spin_1vep2_1",md:"_md_1vep2_7",lg:"_lg_1vep2_10"};function Io(e){const{size:t="md",message:n,className:r=""}=e;return p("span",{className:`${Do.container} ${Do[t]} ${r}`,children:n})}function At(e){const{Icon:t,description:n,title:r,actionText:o="Okay, got it",onActionClick:i=()=>{},loading:s=!1,children:a,hideButton:c=!1}=e;return p("div",{className:Ao.root,children:[p(t,{size:"custom",className:"yvlw-h-20 yvlw-mx-auto yvlw-mb-12"}),p("h2",{children:r}),p("p",{className:"subtext",children:n}),!c&&p("div",{className:"yvlw-mt-12",children:p(Xi,{onClick:()=>i(),className:"yvlw-flex yvlw-items-center yvlw-space-x-3",disabled:s,children:[p("span",{className:"yvlw-flex-1 yvlw-flex yvlw-items-center yvlw-space-x-1 yvlw-justify-center",children:o}),s&&p(Io,{className:Ao.spinner})]})}),a]})}const Ro="yvlw-absolute yvlw-w-full yvlw-h-full",Oo="yvlw-transform yvlw-transition yvlw-ease-in yvlw-duration-300",Ho="yvlw-transform yvlw-transition yvlw-ease-in yvlw-duration-300";function Dt(e){const{children:t,instruction:n,completed:r,failed:o,onStart:i=()=>{},onReset:s=()=>{}}=e,[a,c]=x(!1),{completedCount:u,tasks:d,nextTask:l}=fe(),h=U(()=>u*100/d.length,[u,d.length]);return W(()=>{!r&&!o&&(async()=>{await i(),c(!0)})()},[]),W(()=>{r&&(()=>{l()})()},[r]),p("div",{className:ae.root,children:p("div",{className:`${ae.container} view`,children:[p("div",{style:{width:`${h}%`},className:ae.progress}),p(pe,{as:"div",show:a&&!r&&!o,enter:Oo,enterFrom:"yvlw-translate-x-full",enterTo:"yvlw-translate-x-0",leave:Ho,leaveFrom:"yvlw-translate-x-0",leaveTo:"yvlw-translate-x-full",className:Ro,children:[p("div",{className:`${ae.content}`,children:t}),p("div",{className:ae.instructionsContainer,children:[p("div",{className:ae.instructions,children:[p("h2",{children:n.title}),p("p",{className:"subtext",children:n.description})]}),p("div",{className:ae.branding,children:[p("span",{children:"Powered by"})," ",p(Eo,{size:"custom",className:"yvlw-h-3"})]})]})]}),p(pe,{show:o,as:"div",enter:Oo,enterFrom:"yvlw-translate-x-full",enterTo:"yvlw-translate-x-0",leave:Ho,leaveFrom:"yvlw-translate-x-0",leaveTo:"yvlw-translate-x-full",className:Ro,children:p("div",{className:`${ae.intro}`,children:p(At,{Icon:bo,title:"Oops, task failed!",description:"Could not confirm liveness on this task. Click on the button below to go again",onActionClick:s,actionText:"Try Again"})})})]})})}function It(e={}){const{timeout:t,onTimeout:n=()=>{}}=e,[r,o]=x(!1),i=w(null),s=j(()=>{t&&i.current&&clearTimeout(i.current)},[]),a=j(()=>{t&&(i.current=setTimeout(()=>{o(!0),n()},t))},[]),c=j(()=>{o(!1),a()},[]);return W(()=>s,[]),{timedOut:r,reset:c,start:a,stop:s}}const ic=1,Pn=8,Vo="Place face in frame";function sc(e){const{difficulty:t,timeout:n}=e,{saveStream:r}=fe(),[o,i]=x([]),[s,a]=x(Vo),[c,u]=x(!1),[d,l]=x(!1),h=w(new Set),f=w(!1),v=w(null),{reset:g,start:_,stop:m,timedOut:y}=It({timeout:n}),b=()=>{i([]),a(Vo),u(!1),l(!1),h.current=new Set,f.current=!1,v.current=null,g()},E=C=>{const k=C*Pn,z=Math.ceil((k+1)/Ua);h.current.has(z)||(h.current.add(z),i(Array.from(h.current))),h.current.size>=Pn&&(m(),setTimeout(()=>{l(!0)},1e3))},T=(C,k)=>{let R=Math.atan2(k,C)*(180/Math.PI);return R<0&&(R+=360),R},D=j(()=>{if(h.current.size===0)return 25;switch(t){case"easy":return 5;case"hard":return 15;default:return 10}},[]),F=C=>{const{keypoints:k,box:z}=C,R={x:z.width*.5,y:z.height*.5},K=k[ic],I={y:K.y-z.yMin,x:K.x-z.xMin},V=R.x-I.x,S=I.y-R.y,L=D();return Math.abs(V)<L&&Math.abs(S)<L?null:T(V,S)},{detectFaces:O}=Nt({frameSize:280,validations:["zoom","in-frame"],onFace:C=>{u(!0),a("Slowly move head around to complete circle");const k=F(C);k&&E(k)},onError:C=>{a(C),i([]),h.current.clear(),v.current=null,f.current=!1}});return p(q,{children:p(Dt,{instruction:{title:s,description:c?void 0:"Always ensure face is in frame"},name:"complete-the-circle",completed:d,failed:y,onReset:b,onStart:_,children:p(ct,{onStream:C=>{try{if(!C.current||d)return;const{videoWidth:k}=C.current;O({ref:C,frameSize:k})}catch{}},onRecord:r,children:p(oc,{faceDetected:c,sectionsCount:Pn,visitedSections:o})})})})}const Ln={root:"_root_thujo_1",sticker:"_sticker_thujo_4",no:"_no_thujo_7",yes:"_yes_thujo_12"};function ac(e){const{show:t,stickers:n}=e;return p(q,{children:t&&p("div",{className:Ln.root,children:n.map(r=>p("div",{className:`${Ln.sticker} ${Ln[r]}`,children:r.toUpperCase()},`sticker-${r}`))})})}const cc={question:"Are you alive?",errorMessage:"You have to be alive to proceed though",answer:!0},lc="Wrong answer. Try again",Wo="Keep face in camera";function uc(e){const{difficulty:t,questions:n=[cc],timeout:r}=e,[o,i]=x(Wo),[s,a]=x(!1),[c,u]=x(!1),{saveStream:d}=fe(),l=w("inactive"),h=w(0),f=w(!1),v=w(null),g=w(null),_=w(null),m=()=>{v.current&&clearTimeout(v.current),g.current&&clearTimeout(g.current)},{reset:y,start:b,stop:E,timedOut:T}=It({timeout:r,onTimeout:m}),D=()=>{i(Wo),a(!1),u(!1),l.current="inactive",h.current=0,f.current=!1,y()},F=R=>{const{keypoints:K}=R,I=K[1],V=K[9],S=I.x-V.x,L=I.y-V.y;return 90-Math.atan2(L,S)*(180/Math.PI)},O=R=>{l.current="inactive",i(n[R].question),v.current=setTimeout(()=>{l.current="active"},2e3)},M=U(()=>{switch(t){case"easy":return 2;case"hard":return 6;default:return 4}},[]),C=R=>{try{if(l.current="inactive",Math.abs(R)<M)throw new Error("Tilt head further to answer");const K=R>0,I=n[h.current].answer;if(K===I)h.current+=1,h.current===n.length?(u(!0),E()):O(h.current);else throw new Error(n[h.current].errorMessage||lc)}catch(K){i(K.message),g.current=setTimeout(()=>{O(h.current)},2e3)}},{detectFaces:k}=Nt({onFace:R=>{if(f.current||(a(!0),f.current=!0,O(h.current)),l.current==="inactive")return;const K=F(R);C(K)},onError:R=>{i(R)}}),z=R=>{try{if(!R.current||c)return;_.current=R.current;const{videoWidth:K}=R.current;k({ref:R,frameSize:K})}catch{}};return W(()=>m,[]),p(Dt,{instruction:{title:o,description:s?"":"Move head left for No and right for Yes"},name:"yes-or-no",failed:T,onReset:D,onStart:b,completed:c,children:p(ct,{onStream:z,onRecord:d,children:p(ac,{show:s,stickers:["yes","no"]})})})}function dc(e={}){const{onChange:t=()=>{}}=e,n=!!window.DeviceOrientationEvent,r=o=>{t({alpha:o.alpha,beta:o.beta,gamma:o.gamma})};return W(()=>(window.addEventListener("deviceorientation",r),()=>{window.removeEventListener("deviceorientation",r)}),[]),{canUse:n}}function fc(e){const{total:t,onMessage:n,onComplete:r,difficulty:o}=e,i=w(null),s=w(!0),a=w(null),c=w(null),u=w(0),d=w(!1),l=U(()=>{switch(o){case"easy":return 6;case"hard":return 10;default:return 8}},[]),h=()=>{if(u.current<t){const _=t-u.current;let m=`Nod head ${_} `;_<t&&(m+="more "),m+=_>1?"times":"time",n(m);return}d.current=!0,n("Great, hang on..."),setTimeout(()=>{r()},500)},{canUse:f}=dc({onChange:_=>{c.current=_}});return{evaluate:_=>{if(!f){n("Cannot perform task. Transfer to mobile device to complete");return}if(!c.current||!c.current.beta){n("Cannot perform task. Transfer to mobile device to complete");return}if(c.current.beta<60||c.current.beta>100){n("Keep phone in upright position to continue");return}if(d.current)return;const{keypoints:m}=_,y=Be(m[6].x-m[8].x,m[6].y-m[8].y),E=Be(m[2].x-m[1].x,m[2].y-m[1].y)/y*10;if(E>l){if(i.current||!s.current)return;i.current=E,s.current=!1,a.current=setTimeout(()=>{i.current=null},3e3)}else i.current&&i.current-E>l/2&&(u.current+=1,i.current=null,a.current&&clearTimeout(a.current)),s.current=!0;h()},reset:()=>{i.current=null,s.current=!0,a.current=null,c.current=null,u.current=0,d.current=!1}}}function hc(e){const{onMessage:t,onComplete:n,difficulty:r}=e,o=w(!1),i=U(()=>{switch(r){case"easy":return 80;case"hard":return 120;default:return 100}},[]);return{evaluate:c=>{if(o.current)return;const{keypoints:u}=c,d=Be(u[6].x-u[8].x,u[6].y-u[8].y);if(Be(u[14].x-u[13].x,u[14].y-u[13].y)/d*100>i){o.current=!0,t("Awesome!"),setTimeout(()=>{n()},500);return}t("Open your mouth wide")},reset:()=>{o.current=!1}}}function zo(e){const{total:t,onMessage:n,onComplete:r,difficulty:o}=e,i=w(!0),s=w(!1),a=w(null),c=w(0),u=U(()=>{switch(o){case"easy":return{closed:20,open:30};case"hard":return{closed:10,open:30};default:return{closed:15,open:30}}},[]),d=g=>{i.current&&(g>=u.closed||(i.current=!1,a.current=Date.now()))},l=g=>{if(!i.current&&!(g<u.open)&&(i.current=!0,a.current)){const _=Date.now(),m=a.current;(_-m)/1e3<=2&&(c.current+=1)}},h=()=>{if(c.current<t){const g=t-c.current;let _=`Blink right eye ${g} `;g<t&&(_+="more "),_+=g>1?"times":"time",n(_);return}s.current=!0,n("Great, hang on..."),setTimeout(()=>{r()},500)};return{evaluate:g=>{if(s.current)return;const{keypoints:_}=g,m=Be(_[6].x-_[8].x,_[6].y-_[8].y),b=Be(_[145].x-_[159].x,_[145].y-_[159].y)/m*100;d(b),l(b),h()},reset:()=>{i.current=!0,s.current=!1,a.current=null,c.current=0}}}function Uo(){return{requestDeviceOrientationPermission:async()=>{if(!window.DeviceOrientationEvent)throw new Error("Cannot continue. Transfer to mobile device to complete");const t=window.DeviceOrientationEvent;if(typeof t.requestPermission=="function"&&await t.requestPermission()!=="granted")throw new Error("Permission for device orientation not granted")}}}var jo=(e=>(e.open_mouth="open_mouth",e.blink="blink",e))(jo||{});const Bo=Ya(Object.keys(jo)),qo="Keep face in camera";function pc(e){const{difficulty:t,maxBlinks:n=3,maxNods:r=3,timeout:o}=e,i=w(0),[s,a]=x(qo),[c,u]=x(!1),[d,l]=x(null),h=w(!1),{requestDeviceOrientationPermission:f}=Uo(),{saveStream:v}=fe(),{reset:g,start:_,stop:m,timedOut:y}=It({timeout:o}),b=()=>{if(i.current===Bo.length-1){u(!0),m();return}i.current+=1},E=fc({total:Math.floor(Math.random()*r+1),difficulty:t,onMessage:k=>a(k),onComplete:b}),T=hc({difficulty:t,onMessage:k=>a(k),onComplete:b}),D=zo({total:Math.floor(Math.random()*n+1),difficulty:t,onMessage:k=>a(k),onComplete:b}),{detectFaces:F}=Nt({onFace:k=>{switch(h.current||(h.current=!0),Bo[i.current]){case"open_mouth":T.evaluate(k);break;case"blink":D.evaluate(k);break}},onError:k=>{a(k)}}),O=()=>{i.current=0,a(qo),u(!1),h.current=!1,D.reset(),E.reset(),T.reset(),g()},M=async k=>{try{if(!k.current||c)return;const{videoWidth:z}=k.current;await F({ref:k,frameSize:z,throttleInterval:500})}catch{}},C=async()=>{try{await f()}catch(k){const z=k;a(z.message),l(z)}};return p(Dt,{instruction:{title:s,description:"Follow the directives as instructed"},name:"motions",failed:y,onReset:O,completed:c,onStart:async()=>{await C(),_()},children:d?p(q,{}):p(ct,{onStream:M,onRecord:v})})}const Yo="Keep face in camera";function mc(e){const{difficulty:t,maxBlinks:n=3,timeout:r}=e,[o,i]=x(Yo),[s,a]=x(!1),[c,u]=x(null),d=w(!1),{requestDeviceOrientationPermission:l}=Uo(),{saveStream:h}=fe(),{reset:f,start:v,stop:g,timedOut:_}=It({timeout:r}),m=()=>{a(!0),g()},y=zo({total:Math.floor(Math.random()*n+1),difficulty:t,onMessage:F=>i(F),onComplete:m}),{detectFaces:b}=Nt({onFace:F=>{d.current||(d.current=!0),y.evaluate(F)},onError:F=>{i(F)}}),E=()=>{i(Yo),a(!1),d.current=!1,y.reset(),f()},T=async F=>{try{if(!F.current||s)return;const{videoWidth:O}=F.current;await b({ref:F,frameSize:O})}catch{}},D=async()=>{try{await l()}catch(F){const O=F;i(O.message),u(O)}};return p(Dt,{instruction:{title:o,description:"Follow the directives as instructed"},name:"blink",failed:_,onReset:E,completed:s,onStart:async()=>{await D(),v()},children:c?p(q,{}):p(ct,{onStream:T,onRecord:h})})}const Nn={LEFT_EYE:[36,37,38,39,40,41],RIGHT_EYE:[42,43,44,45,46,47],MOUTH:[48,49,50,51,52,53,54,55,56,57,58,59]},Rt=(e,t)=>Math.sqrt((e.x-t.x)**2+(e.y-t.y)**2),Ko=e=>{if(e.length!==6)return 0;const t=Rt(e[1],e[5]),n=Rt(e[2],e[4]),r=Rt(e[0],e[3]);return(t+n)/(2*r)},vc=e=>{if(e.length<12)return 0;const t=e[9],n=e[3];return Rt(t,n)},_c=(e,t,n,r)=>{var l,h,f;let o=!0,i=!0;if(!r){const _=Nn.LEFT_EYE.map(F=>e[F]),m=Nn.RIGHT_EYE.map(F=>e[F]),y=Nn.MOUTH.map(F=>e[F]),b=Ko(_),E=Ko(m),T=vc(y);o=(b+E)/2>1,i=T<73.24,o||t("Please look at the camera!"),i||t("Please close your mouth!")}const s=.5,a=.12,c=((l=r==null?void 0:r.find(v=>v.categoryName==="eyeBlinkLeft"))==null?void 0:l.score)??0,u=((h=r==null?void 0:r.find(v=>v.categoryName==="eyeBlinkRight"))==null?void 0:h.score)??0,d=((f=r==null?void 0:r.find(v=>v.categoryName==="jawOpen"))==null?void 0:f.score)??0;return o=c<s&&u<s,o||t("Please look at the camera!"),i=d<a,i||t("Please close your mouth!"),{eyesOpen:o,mouthClosed:i}};function gc(e={}){const{validations:t=["zoom","in-frame"],frameSize:n,onFace:r=()=>{},onError:o=()=>{},onMessage:i=()=>{},livenessTimeout:s}=e,{faceDetector:a,savePhoto:c}=fe(),{checkFacialFeatures:u,checkZoomLevel:d,checkInFrame:l}=No(),h=w(null),f=w(null),v=w(!1),g=w(null),_=w(!1),m=w([]),y=j(()=>{f.current&&clearTimeout(f.current),g.current&&clearTimeout(g.current),m.current.forEach(clearTimeout),_.current=!1,v.current=!0},[]),b=w(null),E=w(null),T=w([]),D=10,F=7.5,O=2,M=w({sharpness:0,data:null}),C=(S,L)=>{const H=S.getContext("2d");if(!H||L.width===0||L.height===0||!H||L.width===0||L.height===0)return!1;const N=H.getImageData(L.xMin,L.yMin,L.width,L.height),{data:$}=N;let B=0,X=0;for(let J=0;J<$.length;J+=4).299*$[J]+.587*$[J+1]+.114*$[J+2]>250&&X++;const Q=$.length/4;return B=X/Q,B>.01},k=(S,L,H,N)=>{const $=L.current,B=$==null?void 0:$.parentElement;if(!(!$||!B))for(const X of N)switch(X){case"zoom":d(S,Math.min(B.clientHeight,B.clientWidth));break;case"features":u(S,Math.min(B.clientHeight,B.clientWidth));break;case"in-frame":let Q=H;Q||(Q=Math.min(B.clientHeight,B.clientWidth)*.7);const J=Q+200;l(S,{x:(B.clientWidth-J)/2,y:(B.clientHeight-J)/2,width:J,height:J,offsetX:($.videoWidth-B.clientWidth)/2,offsetY:($.videoHeight-B.clientHeight)/2});break}},z=S=>{const L=[33,133,159,362,263,386],H=.5;for(const N of L){const $=S[N];if(!$||$.score&&$.score<H)return!1}return!0},R=(S,L)=>{const H=S.getContext("2d");if(!H||L.width===0||L.height===0)return!1;const N=H.getImageData(L.xMin,L.yMin,L.width,L.height),{data:$}=N;let B=0;for(let Q=0;Q<$.length;Q+=4){const J=$[Q],ee=$[Q+1],Ye=$[Q+2],Ot=.299*J+.587*ee+.114*Ye;B+=Ot}return B/($.length/4)<60},K=S=>{const L={x:S.box.xMin+(S.box.width??0)/2,y:S.box.yMin+(S.box.height??0)/2};if(T.current.push(L),T.current.length>D&&T.current.shift(),T.current.length<D)return!1;let H=0,N=0,$=0;for(let ee=1;ee<T.current.length;ee++){const Ye=T.current[ee-1],Ot=T.current[ee],ut=Ot.x-Ye.x,Zo=Ot.y-Ye.y,Xo=Math.sqrt(ut*ut+Zo*Zo);Xo>=2&&(H+=Xo,ee>1&&Math.sign(ut)!==Math.sign($)&&Math.abs(ut)>3&&N++,$=ut)}const X=H/(D-1)>F,Q=N>=O,J=X||Q;return J&&i("🚨 Head shake detected!"),J},I=(S,L,H,N)=>{try{if(S.length===0||S.length>1){f.current&&(clearTimeout(f.current),f.current=null),i(S.length>1?"Please ensure only one face is visible":"Detecting face...");return}const $=S[0];let B="",X=!0;try{k($,h,n,t)}catch(ee){B=ee.message,X=!1}K($)&&(B="Please hold your head steady",X=!1),N||(B="Center your face in the frame",X=!1),z($.keypoints)||(B="Please ensure your eyes are clearly visible. Remove glasses if necessary.",X=!1);const{eyesOpen:Q,mouthClosed:J}=_c($.keypoints,i,!1,H);if(Q?J||(B="Please close your mouth",X=!1):(f.current&&(clearTimeout(f.current),f.current=null),X=!1),!X){f.current&&(clearTimeout(f.current),f.current=null,m.current.forEach(clearTimeout)),i(B),r($,!1,H,!1);return}if(!f.current){if(R(b.current,$.box)){i("Too dark – move to a well-lit area");return}if(C(b.current,$.box)){i("Too much glare. Please avoid direct light on your face.");return}i("Hold still..."),M.current={sharpness:0,data:null},m.current.forEach(clearTimeout);const ee=setTimeout(()=>i("Almost there..."),400),Ye=setTimeout(()=>i("Detecting liveness..."),700);m.current=[ee,Ye],f.current=setTimeout(()=>{M.current.data?(c(M.current.data),r($,!0,H,!0)):o("Could not capture a clear photo. Please try again.")},1e3)}if(f.current){const ee=Wa(L);ee>M.current.sharpness&&(M.current={sharpness:ee,data:L})}}catch($){o($.message),S.length>0&&r(S[0],!1,H,!1)}};return{detectFaces:async S=>{if(!a)return;h.current=S.ref.current;const L=h.current;if(!L||L.videoWidth===0)return;b.current||(b.current=document.createElement("canvas"),E.current=b.current.getContext("2d",{willReadFrequently:!0}));const H=b.current,N=E.current;if(!H||!N)return;H.width=L.videoWidth,H.height=L.videoHeight,N.drawImage(L,0,0,H.width,H.height);const $=N.getImageData(0,0,H.width,H.height);!_.current&&L.readyState>=2&&!v.current&&(_.current=!0,g.current=setTimeout(()=>{o("Liveness check TIMED OUT. Please try again."),y()},s));const{faces:B,blendShapes:X,inBox:Q}=await Se.detectFaces(a,$);I(B,$,X,Q)},cleanup:y}}const An={container:"_container_1ej18_1",progress:"_progress_1ej18_12",completed:"_completed_1ej18_33",marker:"_marker_1ej18_37"};function yc(e){const{faceDetected:t}=e,n=U(()=>{const r=[An.container];return t&&r.push(An.focused),r.join(" ")},[t]);return p("div",{className:n,children:p(pe,{as:"div",className:"yvlw-absolute",children:p("div",{className:An.marker,children:[p("div",{}),p("div",{}),p("div",{}),p("div",{})]})})})}const Dn={EnvironmentNotSupported:"Please check your lighting. Move to a well-lit area, but avoid harsh light or strong reflections on your face.",SpoofFace:"We detected a spoofing attempt",FaceTrackingFailed:"We could not detect your face",ExcessiveFaceBrightnessDetected:"We detected excessive light during the test, please wipe any oil or sweat that might cause a reflection on your face."},wc={None:"Processing...",LookAtCamera:"Look at camera.",FaceNotCentered:"Center your face in the camera.",MoveCloser:"Too far away! Move in closer.",ContinueToMoveCloser:"Continue to move closer.",MoveBack:"Too close! Move farther away.",TooMuchMovement:"Too much movement.",AttentionNotNeeded:"Finalizing check...",LookInFront:"Look in front.",TimedOut:"Timed out.",IncreaseBrightnessToMax:"Increase your screen brightness to maximum.",Tip1Title:"Tip 1:",Tip2Title:"Tip 2:",Tip3Title:"Tip 3:",Tip1:"Center your face in the preview. Make sure your eyes and mouth are visible, remove any obstructions like headphones.",Tip2:"You may be asked to smile.",Tip3:"You may be asked to turn your nose towards the green color.",Continue:"Continue"};function bc(e){const{onComplete:t=()=>{},onMessage:n=()=>{},onError:r=()=>{}}=e,{setColorScheme:o,getColorScheme:i}=Po(),s=w(null),a=w(!1),c=()=>{s.current&&(s.current.callAttemptEnd(),s.current.delete(),s.current=null)},u=j(()=>{c()},[]),d=()=>{s.current&&c(),s.current=null,a.current=!1},l=_=>{var F,O;const m=_.split(".");let y=!1;s.current.setToken(_);let b="",E="",T,D=0;if(m.length===3){const M=JSON.parse(atob(m[1]));if(M.face){const C=JSON.parse(M.face),k=/^https:\/\/[^/:]+\.(api\.cognitive\.microsoft|cognitiveservices\.azure)\.com$/;if(C.endpoint&&(k.test(C.endpoint)||C.endpoint==="https://virginia.api.cognitive.microsoft.us")){s.current.setEndpoint(C.endpoint);const R=JSON.parse(M["allowed-paths"]);if(R){const K=(F=R.find(N=>N.path.toLocaleLowerCase().endsWith("/session/start")))==null?void 0:F.path;s.current.setSessionStartPath(K);const I=(O=R.find(N=>N.path.toLocaleLowerCase().endsWith("/session/attempt/end")))==null?void 0:O.path;s.current.setAttemptEndPath(I);const V=R.find(N=>N.path.endsWith("/detectLiveness/singleModal"));V&&({path:b,quota:D}=V,s.current.setLivenessPath(b));const S=R.find(N=>N.path.endsWith("/detectLivenessWithVerify/singleModal"));S&&({path:E,quota:D}=S,s.current.setLivenessWithVerifyPath(E));const L=new Set(R.map(N=>{var $;return($=N.path)==null?void 0:$.split("/")[1]}));if(L.size===1&&(V||S)){const N=L.values().next().value;s.current.setApiVersion(N),y=!0,T=C.clientClaims.livenessOperationMode}}}}s.current.setOperationQuota(D),s.current.setOperationMode(window.Module.LivenessOperationMode[T]),M.sid&&s.current.setSid(M.sid),M["azure-resource-id"]&&s.current.setResourceId(M["azure-resource-id"])}if(y)s.current.initialize();else{const M={livenessError:He(window.Module.LivenessFailureReason,window.Module.LivenessFailureReason.InvalidToken),recognitionError:He(window.Module.RecognitionFailureReason,window.Module.RecognitionFailureReason.None)};r(M.livenessError?Dn[M.livenessError]||M.livenessError:"Something went wrong"),u()}},h=_=>{try{s.current=new window.Module.FaceRecoEngineAdapter,l(_)}catch(m){r(`Could not start liveness test: ${m.message}`),c()}},f=_=>{const{isActionValid:m,isFeedbackValid:y,feedback:b}=_;if(m)switch(_.action){case window.Module.ActionRequiredFromApplication.BrightenDisplay:o("light");break;case window.Module.ActionRequiredFromApplication.DarkenDisplay:o("dark");break;case window.Module.ActionRequiredFromApplication.StopCamera:break}if(!a.current&&y){const E=He(window.Module.FeedbackForFace,b);n(E&&(wc[E]||""))}if(b===window.Module.FeedbackForFace.AttentionNotNeeded){a.current=!0;const E=i();o(E)}},v=_=>{var T,D;const{livenessResult:m,recognitionResult:y}=_,b=((T=m.failureReason)==null?void 0:T.value)!==0||((D=y.failureReason)==null?void 0:D.value)!==0,E=new Set(["EnvironmentNotSupported","ExcessiveFaceBrightnessDetected","FaceEyeRegionNotVisible"]);if(b){const F={livenessError:He(window.Module.LivenessFailureReason,m.failureReason),recognitionError:He(window.Module.RecognitionFailureReason,y.failureReason)};F.livenessError&&E.has(F.livenessError)?t():r(F.livenessError?Dn[F.livenessError]||F.livenessError:"Something went wrong")}else{const F={livenessStatus:He(window.Module.LivenessStatus,m.status),recognitionResult:{status:He(window.Module.RecognitionStatus,y.status),matchConfidence:y.confidence},resultId:m.resultId,digest:m.digest};F.livenessStatus==="RealFace"?t():F.livenessStatus==="SpoofFace"?r(Dn[F.livenessStatus]):r("Could not validate request")}u()};return{start:h,analyze:f,processFrame:_=>{let m=!1;if(a.current)m=s.current.generatePayloadAndResult();else{const{videoWidth:y,videoHeight:b}=_,E=Mn(_,y,b,void 0,{willReadFrequently:!0}),T=window.Module._malloc(E.data.byteLength);try{window.Module.HEAPU8.set(E.data,T);const D=s.current.processFrame(y,b,E.data.byteLength,T);D.terminate?m=!0:D.isValid&&f(D)}finally{window.Module._free(T)}}m&&v(s.current.getFaceAnalyzerResult())},reset:d,destroy:u}}const Go="Detecting face...";function Ec({onImageCaptured:e,fetchAzureSessionToken:t,loadAzureSdk:n,onError:r,onReset:o,onFailure:i}){const[s,a]=x(Go),[c,u]=x(!1),d=w("findingFace"),l=w(null),h=w(),f=w(!1),[v,g]=x(0),_=w(!1),[m,y]=x(!1);W(()=>{g(Math.min(window.innerWidth,window.innerHeight)*.6)},[]),W(()=>{n(),t()},[]);const b=bc({onMessage:M=>{d.current==="analyzingLiveness"&&a(M)},onComplete:()=>{d.current="done",e(!0)},onError:M=>{const C=Ga(M);a(C.message),d.current="done",u(!0),r&&r(M),i({faceImage:"",passed:!1,metadata:{},error:C})}}),E=()=>{_.current=!1,a(Go),d.current="findingFace",l.current=null,b.reset(),h.current&&cancelAnimationFrame(h.current),u(!1),o()},{detectFaces:T,cleanup:D}=gc({validations:["zoom","features"],frameSize:v,livenessTimeout:1e4,onFace:async(M,C,k)=>{f.current=C,C&&d.current==="findingFace"&&!_.current&&k&&(_.current=!0,y(!0))},onPhotoSaved:()=>{},onMessage:M=>{d.current==="findingFace"&&a(M)},onError:M=>{a(M),u(!0),r&&r(M)}});W(()=>()=>{D()},[]);const F=()=>{!l.current||l.current.paused||l.current.ended||(d.current==="findingFace"?T({ref:l}):d.current==="analyzingLiveness"&&b.processFrame(l.current),d.current!=="done"&&(h.current=requestAnimationFrame(F)))};W(()=>{(async()=>{if(m){y(!1),D();try{await n();const C=await t();if(C)b.start(C),d.current="analyzingLiveness";else throw new Error("Session token could not be retrieved.")}catch(C){const k=C instanceof Error?C.message:"Failed to start liveness check.";r&&r(k),i({faceImage:"",passed:!1,metadata:{},error:{key:"session_token_error",message:k}}),u(!0)}}})()},[m]);const O=M=>{M.current&&(l.current=M.current,F())};return W(()=>()=>{h.current&&cancelAnimationFrame(h.current)},[]),p("div",{className:"yvlw-h-full yvlw-flex yvlw-flex-col yvlw-items-center yvlw-justify-center",children:c?p("div",{className:`${ae.intro}`,children:p(At,{Icon:bo,title:"Oops, task failed!",description:s,onActionClick:E,actionText:"Try Again"})}):p("div",{className:ae.root,children:p("div",{className:`${ae.container} view`,children:p("div",{className:"yvlw-h-full yvlw-flex yvlw-flex-col",children:[p("div",{children:p(ct,{onStream:O,children:p(q,{children:[p(yc,{faceDetected:f.current}),d.current==="analyzingLiveness"&&p("div",{className:"yvlw-bg-black/20 yvlw-z-5"})]})})}),p("div",{className:"yvlw-border-t dark:yvlw-border-gray-800 yvlw-border-gray-200",children:p("div",{className:"yvlw-text-center yvlw-mx-auto yvlw-pt-4 yvlw-pb-6 yvlw-px-4",children:[p("div",{className:ae.instructions,children:[p("h2",{children:s}),p("p",{className:"subtext",children:"Position your face in the camera frame and hold still."})]}),p("div",{className:ae.branding,children:[p("span",{children:"Powered by"})," ",p(Eo,{size:"custom",className:"yvlw-h-3"})]})]})})]})})})})}const $c=()=>{if(window.isAzureSdkLoading)return window.azureSdkLoadPromise;window.isAzureSdkLoading=!0;const e=new Promise((t,n)=>{let r=at.js.simd;try{WebAssembly.validate(new Uint8Array(qa))||(r=at.js.default)}catch{r=at.js.simd}window.Module=window.Module||{},window.Module.onRuntimeInitialized=()=>{t()},Object.assign(window.Module,{locateFile(i,s){if(i.includes("AzureAIVisionFace")&&i.endsWith(".wasm")){const a=i.includes("SIMD")?at.wasm.simd:at.wasm.default;return`${To}/${a}`}return`${s}${i}`}});const o=document.createElement("script");o.src=`${To}/${r}`,o.async=!0,o.onerror=()=>{n(new Error("Network error: Failed to load Azure SDK script."))},document.head.appendChild(o)});return window.azureSdkLoadPromise=e,e};let qe=null;function Tc(){var K;const{toggleColorScheme:e,getColorScheme:t,setColorScheme:n}=Po(),{user:r,tasks:o,currentTaskIndex:i,completed:s,onComplete:a,onFailure:c,faceDetector:u,presentation:d,clearSavedPhoto:l}=fe(),[h,f]=x(!1),[v,g]=x(!1),[_,m]=x(null),[y,b]=x(!1),[E,T]=x(!1),[D,F]=x(0);W(()=>{const I=t();n(I)},[]);const{sandboxEnvironment:O,publicKey:M}=fe(),{fetchSessionToken:C}=ko(O),k=async()=>(qe||(qe=C({publicKey:M}).catch(I=>{throw qe=null,I})),qe),z=async()=>{try{f(!0),m(null),await a(),qe=null,d==="page"&&b(!0)}catch(I){m(I.message)}finally{f(!1)}},R=j(I=>I===i?oe.active:i>I?oe.completed:"subtext",[i]);return p("div",{className:oe.root,children:p("div",{className:oe.container,children:[p("div",{className:`${oe.lhs} divider`,children:[p("div",{className:oe.info,children:[p(ec,{}),p("div",{children:p("p",{className:"yvlw-text-xs yvlw-m-0 yvlw-p-0 subtext",children:"You have been given this set of tasks to complete. They are pretty easy to do but we will be guiding you every step of the way."})}),p("ol",{children:[o.map((I,V)=>p("li",{className:R(V),children:Ja[I.id].name},`task-${V}`)),p("li",{className:s?oe.active:"",children:"Complete! 🎉"})]})]}),p("footer",{className:"divider",children:[p("div",{children:"Powered by Youverify"}),p("div",{onClick:()=>e(),role:"button",children:[p("div",{className:"dark:yvlw-hidden",children:p(yo,{})}),p("div",{className:"yvlw-hidden dark:yvlw-block",children:p(Na,{})})]})]})]}),p("div",{className:oe.main,children:p("div",{className:oe.content,children:[p(pe,{show:!v,as:"div",leave:"yvlw-transform yvlw-transition yvlw-duration-300",leaveFrom:"yvlw-translate-y-0 yvlw-opacity-100",leaveTo:"yvlw--translate-y-full yvlw-opacity-0",enterFrom:"yvlw-translate-y-full yvlw-opacity-0",enterTo:"yvlw-translate-y-0 yvlw-opacity-100",className:"yvlw-h-full yvlw-w-full",children:p("div",{className:oe.completed,children:u?p(At,{Icon:Ia,title:"Liveness Check",description:"To ensure the security of your identity, we conduct a liveness check to verify that you are a real person actively engaging with the process. Please ensure to stay in a well lit area.",actionText:"Start Liveness Test",onActionClick:()=>g(!0)}):p(Io,{size:"lg"})})}),p(pe,{show:v&&!E,as:"div",leave:"yvlw-transform yvlw-transition yvlw-duration-300",leaveFrom:"yvlw-translate-y-0 yvlw-opacity-100",leaveTo:"yvlw--translate-y-full yvlw-opacity-0",enterFrom:"yvlw-translate-y-full yvlw-opacity-0",enterTo:"yvlw-translate-y-0 yvlw-opacity-100",className:"yvlw-h-full yvlw-w-full",children:p("div",{className:oe.completed,children:p(Ec,{fetchAzureSessionToken:k,loadAzureSdk:$c,onImageCaptured:I=>{m(null),I&&T(!0)},onError:I=>m(I),onReset:()=>{qe=null,T(!1),F(I=>I+1),l()},onFailure:c},D)})}),o.map((I,V)=>{let S;switch(I.id){case"complete-the-circle":S=p(sc,{...I});break;case"yes-or-no":S=p(uc,{...I});break;case"motions":S=p(pc,{...I});break;case"blink":S=p(mc,{...I});break;default:S=p(q,{});break}return p(pe,{show:v&&E&&!s&&i===V,appear:!0,as:"div",leave:"yvlw-transform yvlw-transition yvlw-duration-300",leaveFrom:"yvlw-translate-y-0 yvlw-opacity-100",leaveTo:"yvlw--translate-y-full yvlw-opacity-0",enterFrom:"yvlw-translate-y-full yvlw-opacity-0",enterTo:"yvlw-translate-y-0 yvlw-opacity-100",className:"yvlw-h-full",children:S},`task-${V}`)}),p(pe,{show:v&&s,as:"div",leave:"yvlw-transform yvlw-transition yvlw-duration-300",leaveFrom:"yvlw-translate-y-0 yvlw-opacity-100",leaveTo:"yvlw--translate-y-full yvlw-opacity-0",enterFrom:"yvlw-translate-y-full yvlw-opacity-0",enterTo:"yvlw-translate-y-0 yvlw-opacity-100",className:"yvlw-h-full yvlw-w-full",children:p("div",{className:oe.completed,children:p(At,{Icon:Ra,title:y?"All Set!":"Completed",description:y?"You can now close or exit the window":"Your Identity verification has been completed successfully. Thanks for your patience",actionText:"Finish",loading:h,onActionClick:z,hideButton:y,children:_&&p("div",{className:"yvlw-mt-3",children:_})})})})]})}),p("div",{className:`${oe.rhs} divider`,children:r&&p("div",{className:`${oe.profile} divider`,children:[p("div",{children:p("div",{className:oe.avatar,children:[r.firstName.charAt(0).toUpperCase(),(K=r.lastName)==null?void 0:K.charAt(0).toUpperCase()]})}),p("div",{children:[p("h4",{children:[r.firstName," ",r.lastName]}),r.email&&p("p",{className:"subtext",children:r.email})]})]})})]})})}function Cc(e){const{tasks:t,namespace:n,user:r,branding:o,onClose:i=()=>{},onSuccess:s,onFailure:a,presentation:c="modal",publicKey:u,metadata:d,sandboxEnvironment:l}=e,[h,f]=x(e.show),v=()=>{f(!1),i()};return p(Qa,{namespace:n,publicKey:u,tasks:t,user:r,branding:o,onRequestClose:v,onSuccess:s,onFailure:a,metadata:d,presentation:c,sandboxEnvironment:l,children:p(Pa,{id:n,open:c==="page"?!0:h,onClose:v,transition:!0,className:`${La.root} ${Lt.root} ${Lt[c]}`,style:{"--branding-color":(o==null?void 0:o.color)??ja},children:[c==="modal"&&p("div",{onClick:v,role:"button",className:Lt.close,children:p(Oa,{className:"yvlw-text-white"})}),p(go,{className:`${Lt.container}`,children:p(Tc,{})})]})})}class kc{constructor(t){this.tasks=[],this.container=null,this.namespace="liveness-web-sdk",this.loadedScripts=[];const{presentation:n="modal"}=t;this.presentation=n,this.props=t,t.tasks&&(this.tasks=t.tasks),n==="page"&&this.start()}validateOptions(){if(!this.tasks)throw new Error("Tasks cannot be empty");if(!this.props.publicKey)throw new Error("A Public Key is required");if(this.props.user&&!this.props.user.firstName)throw new Error("First Name is required when User object is supplied")}async start(t){t&&(this.tasks=t),this.validateOptions(),this.container=document.createElement("div"),document.body.appendChild(this.container),Ve(p(Cc,{namespace:this.namespace,publicKey:this.props.publicKey,sandboxEnvironment:this.props.sandboxEnvironment,presentation:this.props.presentation,show:!0,tasks:this.tasks,user:this.props.user,branding:this.props.branding,onClose:()=>this.close(),onSuccess:this.props.onSuccess,onFailure:this.props.onFailure,metadata:this.props.metadata}),this.container)}close(){if(this.container&&this.presentation!=="page"){if(!document.body.contains(this.container))return;document.body.removeChild(this.container),this.props.onClose&&this.props.onClose()}}}return kc});
|
|
5
|
+
`))}else{let h=d.props,f=h==null?void 0:h.className,v=typeof f=="function"?(...m)=>vn(f(...m),c.className):vn(f,c.className),g=v?{className:v}:{},_=Ur(d.props,Ie(_n(c,["ref"])));for(let m in l)m in _&&delete l[m];return nn(d,Object.assign({},_,l,u,{ref:o(d.ref,u.ref)},g))}return le(i,Object.assign({},_n(c,["ref"]),i!==q&&u,i!==q&&l),d)}function Yi(...e){return e.every(t=>t==null)?void 0:t=>{for(let n of e)n!=null&&(typeof n=="function"?n(t):n.current=t)}}function Ur(...e){if(e.length===0)return{};if(e.length===1)return e[0];let t={},n={};for(let r of e)for(let o in r)o.startsWith("on")&&typeof r[o]=="function"?(n[o]!=null||(n[o]=[]),n[o].push(r[o])):t[o]=r[o];if(t.disabled||t["aria-disabled"])for(let r in n)/^(on(?:Click|Pointer|Mouse|Key)(?:Down|Up|Press)?)$/.test(r)&&(n[r]=[o=>{var i;return(i=o==null?void 0:o.preventDefault)==null?void 0:i.call(o)}]);for(let r in n)Object.assign(t,{[r](o,...i){let s=n[r];for(let a of s){if((o instanceof Event||(o==null?void 0:o.nativeEvent)instanceof Event)&&o.defaultPrevented)return;a(o,...i)}}});return t}function Ki(...e){if(e.length===0)return{};if(e.length===1)return e[0];let t={},n={};for(let r of e)for(let o in r)o.startsWith("on")&&typeof r[o]=="function"?(n[o]!=null||(n[o]=[]),n[o].push(r[o])):t[o]=r[o];for(let r in n)Object.assign(t,{[r](...o){let i=n[r];for(let s of i)s==null||s(...o)}});return t}function re(e){var t;return Object.assign(en(e),{displayName:(t=e.displayName)!=null?t:e.name})}function Ie(e){let t=Object.assign({},e);for(let n in t)t[n]===void 0&&delete t[n];return t}function _n(e,t=[]){let n=Object.assign({},e);for(let r of t)r in n&&delete n[r];return n}let Gi="button";function Zi(e,t){var n;let r=zr(),{disabled:o=r||!1,autoFocus:i=!1,...s}=e,{isFocusVisible:a,focusProps:c}=Hi({autoFocus:i}),{isHovered:u,hoverProps:d}=Oi({isDisabled:o}),{pressed:l,pressProps:h}=Bi({disabled:o}),f=Ki({ref:t,type:(n=s.type)!=null?n:"button",disabled:o||void 0,autoFocus:i},c,d,h),v=U(()=>({disabled:o,hover:u,focus:a,active:l,autofocus:i}),[o,u,a,l,i]);return se({ourProps:f,theirProps:s,slot:v,defaultTag:Gi,name:"Button"})}let Xi=re(Zi),Ji="div";var Ct=(e=>(e[e.None=1]="None",e[e.Focusable=2]="Focusable",e[e.Hidden=4]="Hidden",e))(Ct||{});function Qi(e,t){var n;let{features:r=1,...o}=e,i={ref:t,"aria-hidden":(r&2)===2?!0:(n=o["aria-hidden"])!=null?n:void 0,hidden:(r&4)===4?!0:void 0,style:{position:"fixed",top:1,left:1,width:1,height:0,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0",...(r&4)===4&&(r&2)!==2&&{display:"none"}}};return se({ourProps:i,theirProps:o,slot:{},defaultTag:Ji,name:"Hidden"})}let gn=re(Qi),es=ie(null);function ts({children:e}){let t=te(es);if(!t)return P.createElement(P.Fragment,null,e);let{target:n}=t;return n?vt(P.createElement(P.Fragment,null,e),n):null}let jr=Symbol();function ns(e,t=!0){return Object.assign(e,{[jr]:t})}function he(...e){let t=w(e);W(()=>{t.current=e},[e]);let n=G(r=>{for(let o of t.current)o!=null&&(typeof o=="function"?o(r):o.current=r)});return e.every(r=>r==null||(r==null?void 0:r[jr]))?void 0:n}let yn=ie(null);yn.displayName="DescriptionContext";function Br(){let e=te(yn);if(e===null){let t=new Error("You used a <Description /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(t,Br),t}return e}function rs(){let[e,t]=x([]);return[e.length>0?e.join(" "):void 0,U(()=>function(n){let r=G(i=>(t(s=>[...s,i]),()=>t(s=>{let a=s.slice(),c=a.indexOf(i);return c!==-1&&a.splice(c,1),a}))),o=U(()=>({register:r,slot:n.slot,name:n.name,props:n.props,value:n.value}),[r,n.slot,n.name,n.props,n.value]);return P.createElement(yn.Provider,{value:o},n.children)},[t])]}let os="p";function is(e,t){let n=Ee(),r=zr(),{id:o=`headlessui-description-${n}`,...i}=e,s=Br(),a=he(t);ne(()=>s.register(o),[o,s.register]);let c=r||!1,u=U(()=>({...s.slot,disabled:c}),[s.slot,c]),d={ref:a,...s.props,id:o};return se({ourProps:d,theirProps:i,slot:u,defaultTag:os,name:s.name||"Description"})}let ss=re(is),as=Object.assign(ss,{});var qr=(e=>(e.Space=" ",e.Enter="Enter",e.Escape="Escape",e.Backspace="Backspace",e.Delete="Delete",e.ArrowLeft="ArrowLeft",e.ArrowUp="ArrowUp",e.ArrowRight="ArrowRight",e.ArrowDown="ArrowDown",e.Home="Home",e.End="End",e.PageUp="PageUp",e.PageDown="PageDown",e.Tab="Tab",e))(qr||{});let cs=ie(()=>{});function ls({value:e,children:t}){return P.createElement(cs.Provider,{value:e},t)}let us=class extends Map{constructor(t){super(),this.factory=t}get(t){let n=super.get(t);return n===void 0&&(n=this.factory(t),this.set(t,n)),n}};function Yr(e,t){let n=e(),r=new Set;return{getSnapshot(){return n},subscribe(o){return r.add(o),()=>r.delete(o)},dispatch(o,...i){let s=t[o].call(n,...i);s&&(n=s,r.forEach(a=>a()))}}}function Kr(e){return _t(e.subscribe,e.getSnapshot,e.getSnapshot)}let ds=new us(()=>Yr(()=>[],{ADD(e){return this.includes(e)?this:[...this,e]},REMOVE(e){let t=this.indexOf(e);if(t===-1)return this;let n=this.slice();return n.splice(t,1),n}}));function je(e,t){let n=ds.get(t),r=Ee(),o=Kr(n);if(ne(()=>{if(e)return n.dispatch("ADD",r),()=>n.dispatch("REMOVE",r)},[n,e]),!e)return!1;let i=o.indexOf(r),s=o.length;return i===-1&&(i=s,s+=1),i===s-1}let wn=new Map,tt=new Map;function Gr(e){var t;let n=(t=tt.get(e))!=null?t:0;return tt.set(e,n+1),n!==0?()=>Zr(e):(wn.set(e,{"aria-hidden":e.getAttribute("aria-hidden"),inert:e.inert}),e.setAttribute("aria-hidden","true"),e.inert=!0,()=>Zr(e))}function Zr(e){var t;let n=(t=tt.get(e))!=null?t:1;if(n===1?tt.delete(e):tt.set(e,n-1),n!==1)return;let r=wn.get(e);r&&(r["aria-hidden"]===null?e.removeAttribute("aria-hidden"):e.setAttribute("aria-hidden",r["aria-hidden"]),e.inert=r.inert,wn.delete(e))}function fs(e,{allowed:t,disallowed:n}={}){let r=je(e,"inert-others");ne(()=>{var o,i;if(!r)return;let s=$e();for(let c of(o=n==null?void 0:n())!=null?o:[])c&&s.add(Gr(c));let a=(i=t==null?void 0:t())!=null?i:[];for(let c of a){if(!c)continue;let u=wt(c);if(!u)continue;let d=c.parentElement;for(;d&&d!==u.body;){for(let l of d.children)a.some(h=>l.contains(h))||s.add(Gr(l));d=d.parentElement}}return s.dispose},[r,t,n])}function Xr(e,t,n){let r=De(o=>{let i=o.getBoundingClientRect();i.x===0&&i.y===0&&i.width===0&&i.height===0&&n()});W(()=>{if(!e)return;let o=t===null?null:t instanceof HTMLElement?t:t.current;if(!o)return;let i=$e();if(typeof ResizeObserver<"u"){let s=new ResizeObserver(()=>r.current(o));s.observe(o),i.add(()=>s.disconnect())}if(typeof IntersectionObserver<"u"){let s=new IntersectionObserver(()=>r.current(o));s.observe(o),i.add(()=>s.disconnect())}return()=>i.dispose()},[t,r,e])}let bn=["[contentEditable=true]","[tabindex]","a[href]","area[href]","button:not([disabled])","iframe","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].map(e=>`${e}:not([tabindex='-1'])`).join(","),hs=["[data-autofocus]"].map(e=>`${e}:not([tabindex='-1'])`).join(",");var we=(e=>(e[e.First=1]="First",e[e.Previous=2]="Previous",e[e.Next=4]="Next",e[e.Last=8]="Last",e[e.WrapAround=16]="WrapAround",e[e.NoScroll=32]="NoScroll",e[e.AutoFocus=64]="AutoFocus",e))(we||{}),En=(e=>(e[e.Error=0]="Error",e[e.Overflow=1]="Overflow",e[e.Success=2]="Success",e[e.Underflow=3]="Underflow",e))(En||{}),ps=(e=>(e[e.Previous=-1]="Previous",e[e.Next=1]="Next",e))(ps||{});function ms(e=document.body){return e==null?[]:Array.from(e.querySelectorAll(bn)).sort((t,n)=>Math.sign((t.tabIndex||Number.MAX_SAFE_INTEGER)-(n.tabIndex||Number.MAX_SAFE_INTEGER)))}function vs(e=document.body){return e==null?[]:Array.from(e.querySelectorAll(hs)).sort((t,n)=>Math.sign((t.tabIndex||Number.MAX_SAFE_INTEGER)-(n.tabIndex||Number.MAX_SAFE_INTEGER)))}var Jr=(e=>(e[e.Strict=0]="Strict",e[e.Loose=1]="Loose",e))(Jr||{});function _s(e,t=0){var n;return e===((n=wt(e))==null?void 0:n.body)?!1:Te(t,{0(){return e.matches(bn)},1(){let r=e;for(;r!==null;){if(r.matches(bn))return!0;r=r.parentElement}return!1}})}var gs=(e=>(e[e.Keyboard=0]="Keyboard",e[e.Mouse=1]="Mouse",e))(gs||{});typeof window<"u"&&typeof document<"u"&&(document.addEventListener("keydown",e=>{e.metaKey||e.altKey||e.ctrlKey||(document.documentElement.dataset.headlessuiFocusVisible="")},!0),document.addEventListener("click",e=>{e.detail===1?delete document.documentElement.dataset.headlessuiFocusVisible:e.detail===0&&(document.documentElement.dataset.headlessuiFocusVisible="")},!0));function be(e){e==null||e.focus({preventScroll:!0})}let ys=["textarea","input"].join(",");function ws(e){var t,n;return(n=(t=e==null?void 0:e.matches)==null?void 0:t.call(e,ys))!=null?n:!1}function bs(e,t=n=>n){return e.slice().sort((n,r)=>{let o=t(n),i=t(r);if(o===null||i===null)return 0;let s=o.compareDocumentPosition(i);return s&Node.DOCUMENT_POSITION_FOLLOWING?-1:s&Node.DOCUMENT_POSITION_PRECEDING?1:0})}function nt(e,t,{sorted:n=!0,relativeTo:r=null,skipElements:o=[]}={}){let i=Array.isArray(e)?e.length>0?e[0].ownerDocument:document:e.ownerDocument,s=Array.isArray(e)?n?bs(e):e:t&64?vs(e):ms(e);o.length>0&&s.length>1&&(s=s.filter(f=>!o.some(v=>v!=null&&"current"in v?(v==null?void 0:v.current)===f:v===f))),r=r??i.activeElement;let a=(()=>{if(t&5)return 1;if(t&10)return-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),c=(()=>{if(t&1)return 0;if(t&2)return Math.max(0,s.indexOf(r))-1;if(t&4)return Math.max(0,s.indexOf(r))+1;if(t&8)return s.length-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),u=t&32?{preventScroll:!0}:{},d=0,l=s.length,h;do{if(d>=l||d+l<=0)return 0;let f=c+d;if(t&16)f=(f+l)%l;else{if(f<0)return 3;if(f>=l)return 1}h=s[f],h==null||h.focus(u),d+=a}while(h!==i.activeElement);return t&6&&ws(h)&&h.select(),2}function Qr(){return/iPhone/gi.test(window.navigator.platform)||/Mac/gi.test(window.navigator.platform)&&window.navigator.maxTouchPoints>0}function Es(){return/Android/gi.test(window.navigator.userAgent)}function $s(){return Qr()||Es()}function rt(e,t,n,r){let o=De(n);W(()=>{if(!e)return;function i(s){o.current(s)}return document.addEventListener(t,i,r),()=>document.removeEventListener(t,i,r)},[e,t,r])}function eo(e,t,n,r){let o=De(n);W(()=>{if(!e)return;function i(s){o.current(s)}return window.addEventListener(t,i,r),()=>window.removeEventListener(t,i,r)},[e,t,r])}const to=30;function Ts(e,t,n){let r=je(e,"outside-click"),o=De(n),i=j(function(c,u){if(c.defaultPrevented)return;let d=u(c);if(d===null||!d.getRootNode().contains(d)||!d.isConnected)return;let l=function h(f){return typeof f=="function"?h(f()):Array.isArray(f)||f instanceof Set?f:[f]}(t);for(let h of l){if(h===null)continue;let f=h instanceof HTMLElement?h:h.current;if(f!=null&&f.contains(d)||c.composed&&c.composedPath().includes(f))return}return!_s(d,Jr.Loose)&&d.tabIndex!==-1&&c.preventDefault(),o.current(c,d)},[o]),s=w(null);rt(r,"pointerdown",c=>{var u,d;s.current=((d=(u=c.composedPath)==null?void 0:u.call(c))==null?void 0:d[0])||c.target},!0),rt(r,"mousedown",c=>{var u,d;s.current=((d=(u=c.composedPath)==null?void 0:u.call(c))==null?void 0:d[0])||c.target},!0),rt(r,"click",c=>{$s()||s.current&&(i(c,()=>s.current),s.current=null)},!0);let a=w({x:0,y:0});rt(r,"touchstart",c=>{a.current.x=c.touches[0].clientX,a.current.y=c.touches[0].clientY},!0),rt(r,"touchend",c=>{let u={x:c.changedTouches[0].clientX,y:c.changedTouches[0].clientY};if(!(Math.abs(u.x-a.current.x)>=to||Math.abs(u.y-a.current.y)>=to))return i(c,()=>c.target instanceof HTMLElement?c.target:null)},!0),eo(r,"blur",c=>i(c,()=>window.document.activeElement instanceof HTMLIFrameElement?window.document.activeElement:null),!0)}function ot(...e){return U(()=>wt(...e),[...e])}function no(e,t,n,r){let o=De(n);W(()=>{e=e??window;function i(s){o.current(s)}return e.addEventListener(t,i,r),()=>e.removeEventListener(t,i,r)},[e,t,r])}function Cs(){let e;return{before({doc:t}){var n;let r=t.documentElement,o=(n=t.defaultView)!=null?n:window;e=Math.max(0,o.innerWidth-r.clientWidth)},after({doc:t,d:n}){let r=t.documentElement,o=Math.max(0,r.clientWidth-r.offsetWidth),i=Math.max(0,e-o);n.style(r,"paddingRight",`${i}px`)}}}function ks(){return Qr()?{before({doc:e,d:t,meta:n}){function r(o){return n.containers.flatMap(i=>i()).some(i=>i.contains(o))}t.microTask(()=>{var o;if(window.getComputedStyle(e.documentElement).scrollBehavior!=="auto"){let a=$e();a.style(e.documentElement,"scrollBehavior","auto"),t.add(()=>t.microTask(()=>a.dispose()))}let i=(o=window.scrollY)!=null?o:window.pageYOffset,s=null;t.addEventListener(e,"click",a=>{if(a.target instanceof HTMLElement)try{let c=a.target.closest("a");if(!c)return;let{hash:u}=new URL(c.href),d=e.querySelector(u);d&&!r(d)&&(s=d)}catch{}},!0),t.addEventListener(e,"touchstart",a=>{if(a.target instanceof HTMLElement)if(r(a.target)){let c=a.target;for(;c.parentElement&&r(c.parentElement);)c=c.parentElement;t.style(c,"overscrollBehavior","contain")}else t.style(a.target,"touchAction","none")}),t.addEventListener(e,"touchmove",a=>{if(a.target instanceof HTMLElement){if(a.target.tagName==="INPUT")return;if(r(a.target)){let c=a.target;for(;c.parentElement&&c.dataset.headlessuiPortal!==""&&!(c.scrollHeight>c.clientHeight||c.scrollWidth>c.clientWidth);)c=c.parentElement;c.dataset.headlessuiPortal===""&&a.preventDefault()}else a.preventDefault()}},{passive:!1}),t.add(()=>{var a;let c=(a=window.scrollY)!=null?a:window.pageYOffset;i!==c&&window.scrollTo(0,i),s&&s.isConnected&&(s.scrollIntoView({block:"nearest"}),s=null)})})}}:{}}function Ss(){return{before({doc:e,d:t}){t.style(e.documentElement,"overflow","hidden")}}}function Fs(e){let t={};for(let n of e)Object.assign(t,n(t));return t}let Re=Yr(()=>new Map,{PUSH(e,t){var n;let r=(n=this.get(e))!=null?n:{doc:e,count:0,d:$e(),meta:new Set};return r.count++,r.meta.add(t),this.set(e,r),this},POP(e,t){let n=this.get(e);return n&&(n.count--,n.meta.delete(t)),this},SCROLL_PREVENT({doc:e,d:t,meta:n}){let r={doc:e,d:t,meta:Fs(n)},o=[ks(),Cs(),Ss()];o.forEach(({before:i})=>i==null?void 0:i(r)),o.forEach(({after:i})=>i==null?void 0:i(r))},SCROLL_ALLOW({d:e}){e.dispose()},TEARDOWN({doc:e}){this.delete(e)}});Re.subscribe(()=>{let e=Re.getSnapshot(),t=new Map;for(let[n]of e)t.set(n,n.documentElement.style.overflow);for(let n of e.values()){let r=t.get(n.doc)==="hidden",o=n.count!==0;(o&&!r||!o&&r)&&Re.dispatch(n.count>0?"SCROLL_PREVENT":"SCROLL_ALLOW",n),n.count===0&&Re.dispatch("TEARDOWN",n)}});function Ms(e,t,n=()=>({containers:[]})){let r=Kr(Re),o=t?r.get(t):void 0,i=o?o.count>0:!1;return ne(()=>{if(!(!t||!e))return Re.dispatch("PUSH",t,n),()=>Re.dispatch("POP",t,n)},[e,t]),i}function xs(e,t,n=()=>[document.body]){let r=je(e,"scroll-lock");Ms(r,t,o=>{var i;return{containers:[...(i=o.containers)!=null?i:[],n]}})}function Ps(e){let t={called:!1};return(...n)=>{if(!t.called)return t.called=!0,e(...n)}}function Ls(e=0){let[t,n]=x(e),r=j(c=>n(c),[t]),o=j(c=>n(u=>u|c),[t]),i=j(c=>(t&c)===c,[t]),s=j(c=>n(u=>u&~c),[n]),a=j(c=>n(u=>u^c),[n]);return{flags:t,setFlag:r,addFlag:o,hasFlag:i,removeFlag:s,toggleFlag:a}}var Ns=(e=>(e[e.None=0]="None",e[e.Closed=1]="Closed",e[e.Enter=2]="Enter",e[e.Leave=4]="Leave",e))(Ns||{});function As(e){let t={};for(let n in e)e[n]===!0&&(t[`data-${n}`]="");return t}function Ds(e,t,n,r){let[o,i]=x(n),{hasFlag:s,addFlag:a,removeFlag:c}=Ls(e&&o?3:0),u=w(!1),d=w(!1),l=Et();return ne(function h(){var f;if(!e)return;n&&i(!0);let v=t.current;return v?((f=r==null?void 0:r.start)==null||f.call(r,n),Is(v,{inFlight:u,prepare(){d.current?d.current=!1:d.current=u.current,u.current=!0,!d.current&&(n?(a(3),c(4)):(a(4),c(2)))},run(){d.current?n?(c(3),a(4)):(c(4),a(3)):n?c(1):a(1)},done(){var g;d.current&&typeof v.getAnimations=="function"&&v.getAnimations().length>0||(u.current=!1,c(7),n||i(!1),(g=r==null?void 0:r.end)==null||g.call(r,n))}})):n?(a(3),l.nextFrame(()=>h())):void 0},[e,n,t,l]),e?[o,{closed:s(1),enter:s(2),leave:s(4),transition:s(2)||s(4)}]:[n,{closed:void 0,enter:void 0,leave:void 0,transition:void 0}]}function Is(e,{prepare:t,run:n,done:r,inFlight:o}){let i=$e();return Os(e,{prepare:t,inFlight:o}),i.nextFrame(()=>{i.add(Rs(e,r)),n()}),i.dispose}function Rs(e,t){let n=Ps(t),r=$e();if(!e)return r.dispose;let{transitionDuration:o,transitionDelay:i}=getComputedStyle(e),[s,a]=[o,i].map(u=>{let[d=0]=u.split(",").filter(Boolean).map(l=>l.includes("ms")?parseFloat(l):parseFloat(l)*1e3).sort((l,h)=>h-l);return d}),c=s+a;if(c!==0){let u=r.group(d=>{let l=d.setTimeout(()=>{n(),d.dispose()},c);d.addEventListener(e,"transitionrun",h=>{h.target===h.currentTarget&&(l(),d.addEventListener(e,"transitioncancel",f=>{f.target===f.currentTarget&&(n(),u())}))})});r.addEventListener(e,"transitionend",d=>{d.target===d.currentTarget&&(n(),r.dispose())})}else n();return r.dispose}function Os(e,{inFlight:t,prepare:n}){if(t!=null&&t.current){n();return}let r=e.style.transition;e.style.transition="none",n(),e.offsetHeight,e.style.transition=r}function $n(e,t){let n=w([]),r=G(e);W(()=>{let o=[...n.current];for(let[i,s]of t.entries())if(n.current[i]!==s){let a=r(t,o);return n.current=t,a}},[r,...t])}let kt=ie(null);kt.displayName="OpenClosedContext";var de=(e=>(e[e.Open=1]="Open",e[e.Closed=2]="Closed",e[e.Closing=4]="Closing",e[e.Opening=8]="Opening",e))(de||{});function St(){return te(kt)}function Hs({value:e,children:t}){return P.createElement(kt.Provider,{value:e},t)}function Vs({children:e}){return P.createElement(kt.Provider,{value:null},e)}function Ws(e){function t(){document.readyState!=="loading"&&(e(),document.removeEventListener("DOMContentLoaded",t))}typeof window<"u"&&typeof document<"u"&&(document.addEventListener("DOMContentLoaded",t),t())}let ke=[];Ws(()=>{function e(t){t.target instanceof HTMLElement&&t.target!==document.body&&ke[0]!==t.target&&(ke.unshift(t.target),ke=ke.filter(n=>n!=null&&n.isConnected),ke.splice(10))}window.addEventListener("click",e,{capture:!0}),window.addEventListener("mousedown",e,{capture:!0}),window.addEventListener("focus",e,{capture:!0}),document.body.addEventListener("click",e,{capture:!0}),document.body.addEventListener("mousedown",e,{capture:!0}),document.body.addEventListener("focus",e,{capture:!0})});function ro(e){let t=G(e),n=w(!1);W(()=>(n.current=!1,()=>{n.current=!0,bt(()=>{n.current&&t()})}),[t])}function zs(){let e=typeof document>"u";return"useSyncExternalStore"in Nr?(t=>t.useSyncExternalStore)(Nr)(()=>()=>{},()=>!1,()=>!e):!1}function it(){let e=zs(),[t,n]=x(Ae.isHandoffComplete);return t&&Ae.isHandoffComplete===!1&&n(!1),W(()=>{t!==!0&&n(!0)},[t]),W(()=>Ae.handoff(),[]),e?!1:t}let oo=ie(!1);function Us(){return te(oo)}function io(e){return P.createElement(oo.Provider,{value:e.force},e.children)}function js(e){let t=Us(),n=te(ao),r=ot(e),[o,i]=x(()=>{var s;if(!t&&n!==null)return(s=n.current)!=null?s:null;if(Ae.isServer)return null;let a=r==null?void 0:r.getElementById("headlessui-portal-root");if(a)return a;if(r===null)return null;let c=r.createElement("div");return c.setAttribute("id","headlessui-portal-root"),r.body.appendChild(c)});return W(()=>{o!==null&&(r!=null&&r.body.contains(o)||r==null||r.body.appendChild(o))},[o,r]),W(()=>{t||n!==null&&i(n.current)},[n,i,t]),o}let so=q,Bs=re(function(e,t){let n=e,r=w(null),o=he(ns(d=>{r.current=d}),t),i=ot(r),s=js(r),[a]=x(()=>{var d;return Ae.isServer?null:(d=i==null?void 0:i.createElement("div"))!=null?d:null}),c=te(Tn),u=it();return ne(()=>{!s||!a||s.contains(a)||(a.setAttribute("data-headlessui-portal",""),s.appendChild(a))},[s,a]),ne(()=>{if(a&&c)return c.register(a)},[c,a]),ro(()=>{var d;!s||!a||(a instanceof Node&&s.contains(a)&&s.removeChild(a),s.childNodes.length<=0&&((d=s.parentElement)==null||d.removeChild(s)))}),u?!s||!a?null:vt(se({ourProps:{ref:o},theirProps:n,slot:{},defaultTag:so,name:"Portal"}),a):null});function qs(e,t){let n=he(t),{enabled:r=!0,...o}=e;return r?P.createElement(Bs,{...o,ref:n}):se({ourProps:{ref:n},theirProps:o,slot:{},defaultTag:so,name:"Portal"})}let Ys=q,ao=ie(null);function Ks(e,t){let{target:n,...r}=e,o={ref:he(t)};return P.createElement(ao.Provider,{value:n},se({ourProps:o,theirProps:r,defaultTag:Ys,name:"Popover.Group"}))}let Tn=ie(null);function Gs(){let e=te(Tn),t=w([]),n=G(i=>(t.current.push(i),e&&e.register(i),()=>r(i))),r=G(i=>{let s=t.current.indexOf(i);s!==-1&&t.current.splice(s,1),e&&e.unregister(i)}),o=U(()=>({register:n,unregister:r,portals:t}),[n,r,t]);return[t,U(()=>function({children:i}){return P.createElement(Tn.Provider,{value:o},i)},[o])]}let Zs=re(qs),co=re(Ks),Xs=Object.assign(Zs,{Group:co});function Js(e,t=typeof document<"u"?document.defaultView:null,n){let r=je(e,"escape");no(t,"keydown",o=>{r&&(o.defaultPrevented||o.key===qr.Escape&&n(o))})}function Qs(){var e;let[t]=x(()=>typeof window<"u"&&typeof window.matchMedia=="function"?window.matchMedia("(pointer: coarse)"):null),[n,r]=x((e=t==null?void 0:t.matches)!=null?e:!1);return ne(()=>{if(!t)return;function o(i){r(i.matches)}return t.addEventListener("change",o),()=>t.removeEventListener("change",o)},[t]),n}function ea({defaultContainers:e=[],portals:t,mainTreeNodeRef:n}={}){var r;let o=w((r=n==null?void 0:n.current)!=null?r:null),i=ot(o),s=G(()=>{var a,c,u;let d=[];for(let l of e)l!==null&&(l instanceof HTMLElement?d.push(l):"current"in l&&l.current instanceof HTMLElement&&d.push(l.current));if(t!=null&&t.current)for(let l of t.current)d.push(l);for(let l of(a=i==null?void 0:i.querySelectorAll("html > *, body > *"))!=null?a:[])l!==document.body&&l!==document.head&&l instanceof HTMLElement&&l.id!=="headlessui-portal-root"&&(l.contains(o.current)||l.contains((u=(c=o.current)==null?void 0:c.getRootNode())==null?void 0:u.host)||d.some(h=>l.contains(h))||d.push(l));return d});return{resolveContainers:s,contains:G(a=>s().some(c=>c.contains(a))),mainTreeNodeRef:o,MainTreeNode:U(()=>function(){return n!=null?null:P.createElement(gn,{features:Ct.Hidden,ref:o})},[o,n])}}function Cn(){let e=w(!1);return ne(()=>(e.current=!0,()=>{e.current=!1}),[]),e}var st=(e=>(e[e.Forwards=0]="Forwards",e[e.Backwards=1]="Backwards",e))(st||{});function ta(){let e=w(0);return eo(!0,"keydown",t=>{t.key==="Tab"&&(e.current=t.shiftKey?1:0)},!0),e}function lo(e){if(!e)return new Set;if(typeof e=="function")return new Set(e());let t=new Set;for(let n of e.current)n.current instanceof HTMLElement&&t.add(n.current);return t}let na="div";var Oe=(e=>(e[e.None=0]="None",e[e.InitialFocus=1]="InitialFocus",e[e.TabLock=2]="TabLock",e[e.FocusLock=4]="FocusLock",e[e.RestoreFocus=8]="RestoreFocus",e[e.AutoFocus=16]="AutoFocus",e))(Oe||{});function ra(e,t){let n=w(null),r=he(n,t),{initialFocus:o,initialFocusFallback:i,containers:s,features:a=15,...c}=e;it()||(a=0);let u=ot(n);aa(a,{ownerDocument:u});let d=ca(a,{ownerDocument:u,container:n,initialFocus:o,initialFocusFallback:i});la(a,{ownerDocument:u,container:n,containers:s,previousActiveElement:d});let l=ta(),h=G(m=>{let y=n.current;y&&(b=>b())(()=>{Te(l.current,{[st.Forwards]:()=>{nt(y,we.First,{skipElements:[m.relatedTarget,i]})},[st.Backwards]:()=>{nt(y,we.Last,{skipElements:[m.relatedTarget,i]})}})})}),f=je(!!(a&2),"focus-trap#tab-lock"),v=Et(),g=w(!1),_={ref:r,onKeyDown(m){m.key=="Tab"&&(g.current=!0,v.requestAnimationFrame(()=>{g.current=!1}))},onBlur(m){if(!(a&4))return;let y=lo(s);n.current instanceof HTMLElement&&y.add(n.current);let b=m.relatedTarget;b instanceof HTMLElement&&b.dataset.headlessuiFocusGuard!=="true"&&(uo(y,b)||(g.current?nt(n.current,Te(l.current,{[st.Forwards]:()=>we.Next,[st.Backwards]:()=>we.Previous})|we.WrapAround,{relativeTo:m.target}):m.target instanceof HTMLElement&&be(m.target)))}};return P.createElement(P.Fragment,null,f&&P.createElement(gn,{as:"button",type:"button","data-headlessui-focus-guard":!0,onFocus:h,features:Ct.Focusable}),se({ourProps:_,theirProps:c,defaultTag:na,name:"FocusTrap"}),f&&P.createElement(gn,{as:"button",type:"button","data-headlessui-focus-guard":!0,onFocus:h,features:Ct.Focusable}))}let oa=re(ra),ia=Object.assign(oa,{features:Oe});function sa(e=!0){let t=w(ke.slice());return $n(([n],[r])=>{r===!0&&n===!1&&bt(()=>{t.current.splice(0)}),r===!1&&n===!0&&(t.current=ke.slice())},[e,ke,t]),G(()=>{var n;return(n=t.current.find(r=>r!=null&&r.isConnected))!=null?n:null})}function aa(e,{ownerDocument:t}){let n=!!(e&8),r=sa(n);$n(()=>{n||(t==null?void 0:t.activeElement)===(t==null?void 0:t.body)&&be(r())},[n]),ro(()=>{n&&be(r())})}function ca(e,{ownerDocument:t,container:n,initialFocus:r,initialFocusFallback:o}){let i=w(null),s=je(!!(e&1),"focus-trap#initial-focus"),a=Cn();return $n(()=>{if(e===0)return;if(!s){o!=null&&o.current&&be(o.current);return}let c=n.current;c&&bt(()=>{if(!a.current)return;let u=t==null?void 0:t.activeElement;if(r!=null&&r.current){if((r==null?void 0:r.current)===u){i.current=u;return}}else if(c.contains(u)){i.current=u;return}if(r!=null&&r.current)be(r.current);else{if(e&16){if(nt(c,we.First|we.AutoFocus)!==En.Error)return}else if(nt(c,we.First)!==En.Error)return;if(o!=null&&o.current&&(be(o.current),(t==null?void 0:t.activeElement)===o.current))return;console.warn("There are no focusable elements inside the <FocusTrap />")}i.current=t==null?void 0:t.activeElement})},[o,s,e]),i}function la(e,{ownerDocument:t,container:n,containers:r,previousActiveElement:o}){let i=Cn(),s=!!(e&4);no(t==null?void 0:t.defaultView,"focus",a=>{if(!s||!i.current)return;let c=lo(r);n.current instanceof HTMLElement&&c.add(n.current);let u=o.current;if(!u)return;let d=a.target;d&&d instanceof HTMLElement?uo(c,d)?(o.current=d,be(d)):(a.preventDefault(),a.stopPropagation(),be(u)):be(o.current)},!0)}function uo(e,t){for(let n of e)if(n.contains(t))return!0;return!1}function fo(e){var t;return!!(e.enter||e.enterFrom||e.enterTo||e.leave||e.leaveFrom||e.leaveTo)||((t=e.as)!=null?t:po)!==q||P.Children.count(e.children)===1}let Ft=ie(null);Ft.displayName="TransitionContext";var ua=(e=>(e.Visible="visible",e.Hidden="hidden",e))(ua||{});function da(){let e=te(Ft);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}function fa(){let e=te(Mt);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}let Mt=ie(null);Mt.displayName="NestingContext";function xt(e){return"children"in e?xt(e.children):e.current.filter(({el:t})=>t.current!==null).filter(({state:t})=>t==="visible").length>0}function ho(e,t){let n=De(e),r=w([]),o=Cn(),i=Et(),s=G((f,v=Ce.Hidden)=>{let g=r.current.findIndex(({el:_})=>_===f);g!==-1&&(Te(v,{[Ce.Unmount](){r.current.splice(g,1)},[Ce.Hidden](){r.current[g].state="hidden"}}),i.microTask(()=>{var _;!xt(r)&&o.current&&((_=n.current)==null||_.call(n))}))}),a=G(f=>{let v=r.current.find(({el:g})=>g===f);return v?v.state!=="visible"&&(v.state="visible"):r.current.push({el:f,state:"visible"}),()=>s(f,Ce.Unmount)}),c=w([]),u=w(Promise.resolve()),d=w({enter:[],leave:[]}),l=G((f,v,g)=>{c.current.splice(0),t&&(t.chains.current[v]=t.chains.current[v].filter(([_])=>_!==f)),t==null||t.chains.current[v].push([f,new Promise(_=>{c.current.push(_)})]),t==null||t.chains.current[v].push([f,new Promise(_=>{Promise.all(d.current[v].map(([m,y])=>y)).then(()=>_())})]),v==="enter"?u.current=u.current.then(()=>t==null?void 0:t.wait.current).then(()=>g(v)):g(v)}),h=G((f,v,g)=>{Promise.all(d.current[v].splice(0).map(([_,m])=>m)).then(()=>{var _;(_=c.current.shift())==null||_()}).then(()=>g(v))});return U(()=>({children:r,register:a,unregister:s,onStart:l,onStop:h,wait:u,chains:d}),[a,s,r,l,h,d,u])}let po=q,mo=$t.RenderStrategy;function ha(e,t){var n,r;let{transition:o=!0,beforeEnter:i,afterEnter:s,beforeLeave:a,afterLeave:c,enter:u,enterFrom:d,enterTo:l,entered:h,leave:f,leaveFrom:v,leaveTo:g,..._}=e,m=w(null),y=fo(e),b=he(...y?[m,t]:t===null?[]:[t]),E=(n=_.unmount)==null||n?Ce.Unmount:Ce.Hidden,{show:T,appear:D,initial:F}=da(),[O,M]=x(T?"visible":"hidden"),C=fa(),{register:k,unregister:z}=C;ne(()=>k(m),[k,m]),ne(()=>{if(E===Ce.Hidden&&m.current){if(T&&O!=="visible"){M("visible");return}return Te(O,{hidden:()=>z(m),visible:()=>k(m)})}},[O,m,k,z,T,E]);let R=it();ne(()=>{if(y&&R&&O==="visible"&&m.current===null)throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?")},[m,O,R,y]);let K=F&&!D,I=D&&T&&F,V=w(!1),S=ho(()=>{V.current||(M("hidden"),z(m))},C),L=G(Q=>{V.current=!0;let J=Q?"enter":"leave";S.onStart(m,J,ee=>{ee==="enter"?i==null||i():ee==="leave"&&(a==null||a())})}),H=G(Q=>{let J=Q?"enter":"leave";V.current=!1,S.onStop(m,J,ee=>{ee==="enter"?s==null||s():ee==="leave"&&(c==null||c())}),J==="leave"&&!xt(S)&&(M("hidden"),z(m))});W(()=>{y&&o||(L(T),H(T))},[T,y,o]);let N=!(!o||!y||!R||K),[,$]=Ds(N,m,T,{start:L,end:H}),B=Ie({ref:b,className:((r=vn(_.className,I&&u,I&&d,$.enter&&u,$.enter&&$.closed&&d,$.enter&&!$.closed&&l,$.leave&&f,$.leave&&!$.closed&&v,$.leave&&$.closed&&g,!$.transition&&T&&h))==null?void 0:r.trim())||void 0,...As($)}),X=0;return O==="visible"&&(X|=de.Open),O==="hidden"&&(X|=de.Closed),$.enter&&(X|=de.Opening),$.leave&&(X|=de.Closing),P.createElement(Mt.Provider,{value:S},P.createElement(Hs,{value:X},se({ourProps:B,theirProps:_,defaultTag:po,features:mo,visible:O==="visible",name:"Transition.Child"})))}function pa(e,t){let{show:n,appear:r=!1,unmount:o=!0,...i}=e,s=w(null),a=fo(e),c=he(...a?[s,t]:t===null?[]:[t]);it();let u=St();if(n===void 0&&u!==null&&(n=(u&de.Open)===de.Open),n===void 0)throw new Error("A <Transition /> is used but it is missing a `show={true | false}` prop.");let[d,l]=x(n?"visible":"hidden"),h=ho(()=>{n||l("hidden")}),[f,v]=x(!0),g=w([n]);ne(()=>{f!==!1&&g.current[g.current.length-1]!==n&&(g.current.push(n),v(!1))},[g,n]);let _=U(()=>({show:n,appear:r,initial:f}),[n,r,f]);Xr(n,s,()=>l("hidden")),ne(()=>{n?l("visible"):!xt(h)&&s.current!==null&&l("hidden")},[n,h]);let m={unmount:o},y=G(()=>{var E;f&&v(!1),(E=e.beforeEnter)==null||E.call(e)}),b=G(()=>{var E;f&&v(!1),(E=e.beforeLeave)==null||E.call(e)});return P.createElement(Mt.Provider,{value:h},P.createElement(Ft.Provider,{value:_},se({ourProps:{...m,as:q,children:P.createElement(vo,{ref:c,...m,...i,beforeEnter:y,beforeLeave:b})},theirProps:{},defaultTag:q,features:mo,visible:d==="visible",name:"Transition"})))}function ma(e,t){let n=te(Ft)!==null,r=St()!==null;return P.createElement(P.Fragment,null,!n&&r?P.createElement(kn,{ref:t,...e}):P.createElement(vo,{ref:t,...e}))}let kn=re(pa),vo=re(ha),Sn=re(ma),pe=Object.assign(kn,{Child:Sn,Root:kn});var va=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(va||{}),_a=(e=>(e[e.SetTitleId=0]="SetTitleId",e))(_a||{});let ga={0(e,t){return e.titleId===t.id?e:{...e,titleId:t.id}}},Fn=ie(null);Fn.displayName="DialogContext";function Pt(e){let t=te(Fn);if(t===null){let n=new Error(`<${e} /> is missing a parent <Dialog /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,Pt),n}return t}function ya(e,t){return Te(t.type,ga,e,t)}let _o=re(function(e,t){let n=Ee(),{id:r=`headlessui-dialog-${n}`,open:o,onClose:i,initialFocus:s,role:a="dialog",autoFocus:c=!0,__demoMode:u=!1,...d}=e,l=w(!1);a=function(){return a==="dialog"||a==="alertdialog"?a:(l.current||(l.current=!0,console.warn(`Invalid role [${a}] passed to <Dialog />. Only \`dialog\` and and \`alertdialog\` are supported. Using \`dialog\` instead.`)),"dialog")}();let h=St();o===void 0&&h!==null&&(o=(h&de.Open)===de.Open);let f=w(null),v=he(f,t),g=ot(f),_=o?0:1,[m,y]=Ze(ya,{titleId:null,descriptionId:null,panelRef:Ut()}),b=G(()=>i(!1)),E=G(N=>y({type:0,id:N})),T=it()?_===0:!1,[D,F]=Gs(),O={get current(){var N;return(N=m.panelRef.current)!=null?N:f.current}},{resolveContainers:M,mainTreeNodeRef:C,MainTreeNode:k}=ea({portals:D,defaultContainers:[O]}),z=h!==null?(h&de.Closing)===de.Closing:!1;fs(u||z?!1:T,{allowed:G(()=>{var N,$;return[($=(N=f.current)==null?void 0:N.closest("[data-headlessui-portal]"))!=null?$:null]}),disallowed:G(()=>{var N,$;return[($=(N=C.current)==null?void 0:N.closest("body > *:not(#headlessui-portal-root)"))!=null?$:null]})}),Ts(T,M,N=>{N.preventDefault(),b()}),Js(T,g==null?void 0:g.defaultView,N=>{N.preventDefault(),N.stopPropagation(),document.activeElement&&"blur"in document.activeElement&&typeof document.activeElement.blur=="function"&&document.activeElement.blur(),b()}),xs(u||z?!1:T,g,M),Xr(T,f,b);let[R,K]=rs(),I=U(()=>[{dialogState:_,close:b,setTitleId:E},m],[_,m,b,E]),V=U(()=>({open:_===0}),[_]),S={ref:v,id:r,role:a,tabIndex:-1,"aria-modal":u?void 0:_===0?!0:void 0,"aria-labelledby":m.titleId,"aria-describedby":R},L=!Qs(),H=Oe.None;return T&&!u&&(H|=Oe.RestoreFocus,H|=Oe.TabLock,c&&(H|=Oe.AutoFocus),L&&(H|=Oe.InitialFocus)),P.createElement(Vs,null,P.createElement(io,{force:!0},P.createElement(Xs,null,P.createElement(Fn.Provider,{value:I},P.createElement(co,{target:f},P.createElement(io,{force:!1},P.createElement(K,{slot:V},P.createElement(F,null,P.createElement(ia,{initialFocus:s,initialFocusFallback:f,containers:M,features:H},P.createElement(ls,{value:b},se({ourProps:S,theirProps:d,slot:V,defaultTag:wa,features:ba,visible:_===0,name:"Dialog"})))))))))),P.createElement(ts,null,P.createElement(k,null)))}),wa="div",ba=$t.RenderStrategy|$t.Static;function Ea(e,t){let{transition:n=!1,open:r,...o}=e,i=St(),s=e.hasOwnProperty("open")||i!==null,a=e.hasOwnProperty("onClose");if(!s&&!a)throw new Error("You have to provide an `open` and an `onClose` prop to the `Dialog` component.");if(!s)throw new Error("You provided an `onClose` prop to the `Dialog`, but forgot an `open` prop.");if(!a)throw new Error("You provided an `open` prop to the `Dialog`, but forgot an `onClose` prop.");if(!i&&typeof e.open!="boolean")throw new Error(`You provided an \`open\` prop to the \`Dialog\`, but the value is not a boolean. Received: ${e.open}`);if(typeof e.onClose!="function")throw new Error(`You provided an \`onClose\` prop to the \`Dialog\`, but the value is not a function. Received: ${e.onClose}`);return(r!==void 0||n)&&!o.static?P.createElement(pe,{show:r,transition:n,unmount:o.unmount},P.createElement(_o,{ref:t,...o})):P.createElement(_o,{ref:t,open:r,...o})}let $a="div";function Ta(e,t){let n=Ee(),{id:r=`headlessui-dialog-panel-${n}`,transition:o=!1,...i}=e,[{dialogState:s},a]=Pt("Dialog.Panel"),c=he(t,a.panelRef),u=U(()=>({open:s===0}),[s]),d=G(l=>{l.stopPropagation()});return P.createElement(o?Sn:q,null,se({ourProps:{ref:c,id:r,onClick:d},theirProps:i,slot:u,defaultTag:$a,name:"Dialog.Panel"}))}let Ca="div";function ka(e,t){let{transition:n=!1,...r}=e,[{dialogState:o}]=Pt("Dialog.Backdrop"),i=U(()=>({open:o===0}),[o]);return P.createElement(n?Sn:q,null,se({ourProps:{ref:t,"aria-hidden":!0},theirProps:r,slot:i,defaultTag:Ca,name:"Dialog.Backdrop"}))}let Sa="h2";function Fa(e,t){let n=Ee(),{id:r=`headlessui-dialog-title-${n}`,...o}=e,[{dialogState:i,setTitleId:s}]=Pt("Dialog.Title"),a=he(t);W(()=>(s(r),()=>s(null)),[r,s]);let c=U(()=>({open:i===0}),[i]);return se({ourProps:{ref:a,id:r},theirProps:o,slot:c,defaultTag:Sa,name:"Dialog.Title"})}let Ma=re(Ea),go=re(Ta);re(ka);let xa=re(Fa),Pa=Object.assign(Ma,{Panel:go,Title:xa,Description:as});const Lt={root:"_root_1duny_1",modal:"_modal_1duny_10",container:"_container_1duny_13",page:"_page_1duny_18",close:"_close_1duny_21"},La={root:"_root_1h6qm_1"},me=e=>{const{children:t,size:n="md",fill:r="currentColor",stroke:o,strokeWidth:i,className:s="",viewBox:a="0 0 20 20"}=e,c=U(()=>{switch(n){case"sm":return"yvlw-w-4 yvlw-h-4";case"lg":return"yvlw-w-7 yvlw-h-7";case"xl":return"yvlw-w-10 yvlw-h-10";case"custom":return"";default:return"yvlw-w-5 yvlw-h-5"}},[n]);return p("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:a,fill:r,stroke:o,strokeWidth:i,className:`${c} ${s}`,children:t})},Na=()=>p(me,{children:p("path",{d:"M10 2a.75.75 0 01.75.75v1.5a.75.75 0 01-1.5 0v-1.5A.75.75 0 0110 2zM10 15a.75.75 0 01.75.75v1.5a.75.75 0 01-1.5 0v-1.5A.75.75 0 0110 15zM10 7a3 3 0 100 6 3 3 0 000-6zM15.657 5.404a.75.75 0 10-1.06-1.06l-1.061 1.06a.75.75 0 001.06 1.06l1.06-1.06zM6.464 14.596a.75.75 0 10-1.06-1.06l-1.06 1.06a.75.75 0 001.06 1.06l1.06-1.06zM18 10a.75.75 0 01-.75.75h-1.5a.75.75 0 010-1.5h1.5A.75.75 0 0118 10zM5 10a.75.75 0 01-.75.75h-1.5a.75.75 0 010-1.5h1.5A.75.75 0 015 10zM14.596 15.657a.75.75 0 001.06-1.06l-1.06-1.061a.75.75 0 10-1.06 1.06l1.06 1.06zM5.404 6.464a.75.75 0 001.06-1.06l-1.06-1.06a.75.75 0 10-1.061 1.06l1.06 1.06z"})}),yo=e=>p(me,{...e,children:p("path",{fillRule:"evenodd",d:"M7.455 2.004a.75.75 0 01.26.77 7 7 0 009.958 7.967.75.75 0 011.067.853A8.5 8.5 0 116.647 1.921a.75.75 0 01.808.083z",clipRule:"evenodd"})}),Aa=e=>p(me,{...e,viewBox:"0 0 24 24",children:[p("path",{d:"M0 0h24v24H0V0z",fill:"none"}),p("path",{d:"M19.07 4.93l-1.41 1.41C19.1 7.79 20 9.79 20 12c0 4.42-3.58 8-8 8s-8-3.58-8-8c0-4.08 3.05-7.44 7-7.93v2.02C8.16 6.57 6 9.03 6 12c0 3.31 2.69 6 6 6s6-2.69 6-6c0-1.66-.67-3.16-1.76-4.24l-1.41 1.41C15.55 9.9 16 10.9 16 12c0 2.21-1.79 4-4 4s-4-1.79-4-4c0-1.86 1.28-3.41 3-3.86v2.14c-.6.35-1 .98-1 1.72 0 1.1.9 2 2 2s2-.9 2-2c0-.74-.4-1.38-1-1.72V2h-1C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10c0-2.76-1.12-5.26-2.93-7.07z"})]}),Da=e=>p(me,{...e,viewBox:"0 0 24 24",children:[p("path",{d:"M0 0h24v24H0V0z",fill:"none"}),p("path",{d:"M3.72 6.04c.47.46 1.21.48 1.71.06.37-.32.69-.51.87-.43.5.2 0 1.03-.3 1.52-.25.42-2.86 3.89-2.86 6.31 0 1.28.48 2.34 1.34 2.98.75.56 1.74.73 2.64.46 1.07-.31 1.95-1.4 3.06-2.77 1.21-1.49 2.83-3.44 4.08-3.44 1.63 0 1.65 1.01 1.76 1.79-3.78.64-5.38 3.67-5.38 5.37 0 1.7 1.44 3.09 3.21 3.09 1.63 0 4.29-1.33 4.69-6.1h1.21c.69 0 1.25-.56 1.25-1.25s-.56-1.25-1.25-1.25h-1.22c-.15-1.65-1.09-4.2-4.03-4.2-2.25 0-4.18 1.91-4.94 2.84-.58.73-2.06 2.48-2.29 2.72-.25.3-.68.84-1.11.84-.45 0-.72-.83-.36-1.92.35-1.09 1.4-2.86 1.85-3.52.78-1.14 1.3-1.92 1.3-3.28C8.95 3.69 7.31 3 6.44 3c-1.09 0-2.04.63-2.7 1.22-.53.48-.53 1.32-.02 1.82zm10.16 12.51c-.31 0-.74-.26-.74-.72 0-.6.73-2.2 2.87-2.76-.3 2.69-1.43 3.48-2.13 3.48z"})]}),wo=e=>p(me,{...e,viewBox:"0 0 24 24",children:[p("path",{d:"M0 0h24v24H0V0z",fill:"none"}),p("path",{d:"M3.72 6.04c.47.46 1.21.48 1.71.06.37-.32.69-.51.87-.43.5.2 0 1.03-.3 1.52-.25.42-2.86 3.89-2.86 6.31 0 1.28.48 2.34 1.34 2.98.75.56 1.74.73 2.64.46 1.07-.31 1.95-1.4 3.06-2.77 1.21-1.49 2.83-3.44 4.08-3.44 1.63 0 1.65 1.01 1.76 1.79-3.78.64-5.38 3.67-5.38 5.37 0 1.7 1.44 3.09 3.21 3.09 1.63 0 4.29-1.33 4.69-6.1h1.21c.69 0 1.25-.56 1.25-1.25s-.56-1.25-1.25-1.25h-1.22c-.15-1.65-1.09-4.2-4.03-4.2-2.25 0-4.18 1.91-4.94 2.84-.58.73-2.06 2.48-2.29 2.72-.25.3-.68.84-1.11.84-.45 0-.72-.83-.36-1.92.35-1.09 1.4-2.86 1.85-3.52.78-1.14 1.3-1.92 1.3-3.28C8.95 3.69 7.31 3 6.44 3c-1.09 0-2.04.63-2.7 1.22-.53.48-.53 1.32-.02 1.82zm10.16 12.51c-.31 0-.74-.26-.74-.72 0-.6.73-2.2 2.87-2.76-.3 2.69-1.43 3.48-2.13 3.48z"})]}),Ia=e=>p(me,{...e,children:[p("path",{d:"M0 0h24v24H0V0z",fill:"none"}),p("path",{d:"M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0-6c1.1 0 2 .9 2 2s-.9 2-2 2-2-.9-2-2 .9-2 2-2zm0 7c-2.67 0-8 1.34-8 4v2c0 .55.45 1 1 1h14c.55 0 1-.45 1-1v-2c0-2.66-5.33-4-8-4zm6 5H6v-.99c.2-.72 3.3-2.01 6-2.01s5.8 1.29 6 2v1z"})]}),Ra=e=>p(me,{...e,children:p("path",{d:"M18,10l-1.77-2.03l0.25-2.69l-2.63-0.6l-1.37-2.32L10,3.43L7.53,2.36L6.15,4.68L3.53,5.28l0.25,2.69L2,10l1.77,2.03 l-0.25,2.69l2.63,0.6l1.37,2.32L10,16.56l2.47,1.07l1.37-2.32l2.63-0.6l-0.25-2.69L18,10z M13.18,8.47l-4.24,4.24 c-0.2,0.2-0.51,0.2-0.71,0L6.82,11.3c-0.2-0.2-0.2-0.51,0-0.71s0.51-0.2,0.71,0l1.06,1.06l3.89-3.89c0.2-0.2,0.51-0.2,0.71,0 S13.38,8.28,13.18,8.47z"})}),bo=e=>p(me,{...e,viewBox:"0 0 24 24",children:p("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"})}),Oa=e=>p(me,{...e,children:p("path",{d:"M6.28 5.22a.75.75 0 0 0-1.06 1.06L8.94 10l-3.72 3.72a.75.75 0 1 0 1.06 1.06L10 11.06l3.72 3.72a.75.75 0 1 0 1.06-1.06L11.06 10l3.72-3.72a.75.75 0 0 0-1.06-1.06L10 8.94 6.28 5.22Z"})}),Eo=e=>p(me,{...e,viewBox:"0 0 99 32",children:[p("g",{clipPath:"url(#clip0_9581_165880)",children:[p("path",{d:"M98.9474 20.7006V2.701C98.9474 1.20997 97.7302 0 96.2304 0H87.4325H2.71699C1.21714 0 0 1.20997 0 2.701V29.299C0 30.79 1.21714 32 2.71699 32H86.6203C87.2911 32 87.938 31.7523 88.4388 31.3069L98.0489 22.7084C98.6191 22.1964 98.9474 21.4651 98.9474 20.7006Z",fill:"#46B2C8"}),p("path",{d:"M24.3666 25.2683H20.593C19.3951 25.2683 18.4199 24.2989 18.4199 23.108V8.8908C18.4199 7.69988 19.3951 6.73047 20.593 6.73047H24.3642C25.5622 6.73047 26.5374 7.69988 26.5374 8.8908V23.1056C26.5398 24.2989 25.5646 25.2683 24.3666 25.2683ZM20.593 8.52161C20.3894 8.52161 20.2217 8.68596 20.2217 8.8908V23.1056C20.2217 23.3081 20.387 23.4748 20.593 23.4748H24.3642C24.5679 23.4748 24.7356 23.3104 24.7356 23.1056V8.8908C24.7356 8.68834 24.5703 8.52161 24.3642 8.52161H20.593Z",fill:"#C7E8EF"}),p("path",{d:"M68.9385 6.74805H67.1367V25.2549H68.9385V6.74805Z",fill:"white"}),p("path",{d:"M55.0725 8.52161V6.73047H47.8535V25.2683H55.0725V23.4748H49.6577V18.9874H52.9664V17.1963H49.6577V8.52161H55.0725Z",fill:"white"}),p("path",{d:"M46.528 6.73828L44.4795 23.4993C44.283 24.5354 43.4061 25.2595 42.3447 25.2595C41.2833 25.2595 40.404 24.5354 40.2099 23.4993L40.2003 23.4421L38.1758 6.73828H39.9919L41.9853 23.1896C42.0404 23.4183 42.2081 23.4683 42.3447 23.4683C42.4789 23.4683 42.649 23.4183 42.7041 23.1896L44.7119 6.73828H46.528Z",fill:"white"}),p("path",{d:"M36.9104 6.73047V23.1056C36.9104 24.2965 35.9353 25.2659 34.7373 25.2659H30.9685C29.7681 25.2659 28.793 24.2965 28.793 23.1056V6.73047H30.5947V23.1056C30.5947 23.3104 30.7624 23.4748 30.9685 23.4748H34.7373C34.9433 23.4748 35.1087 23.3081 35.1087 23.1056V6.73047H36.9104Z",fill:"#C7E8EF"}),p("path",{d:"M78.6291 8.53181V6.73828H71.4102V25.2618H73.2143V18.9976H76.5231V17.2065H73.2143V8.53181H78.6291Z",fill:"white"}),p("path",{d:"M15.8797 6.73047L13.3089 14.9764L10.9034 6.73047H9.02734L12.3793 18.2157V25.2516H14.181V18.2324L17.7653 6.73047H15.8797Z",fill:"#C7E8EF"}),p("path",{d:"M85.7767 6.73047L83.2058 14.9764L80.7979 6.73047H78.9219L82.2738 18.2157V25.2516H84.0755V18.2324L87.6623 6.73047H85.7767Z",fill:"white"}),p("path",{d:"M61.2349 18.4801C63.4535 17.5226 65.0085 15.3241 65.0085 12.7732V8.8908C65.0085 7.69988 64.0357 6.73047 62.8354 6.73047H59.0618C57.8638 6.73047 56.8887 7.69988 56.8887 8.8908V18.0918V18.9874V25.2493H58.6904V18.9898H58.7527C58.9659 18.9898 59.1768 18.9779 59.3828 18.9588L63.6093 25.254H65.78L61.2349 18.4801ZM58.6928 17.1986V8.89318C58.6928 8.68834 58.8581 8.52399 59.0618 8.52399H62.8354C63.039 8.52399 63.2044 8.69072 63.2044 8.89318V12.7756C63.2044 15.2146 61.2085 17.1986 58.7551 17.1986H58.6928Z",fill:"white"})]}),p("defs",{children:p("clipPath",{id:"clip0_9581_165880",children:p("rect",{width:"98.9474",height:"32",fill:"white"})})})]});class Se{static loadVision(){return import("https://cdn.jsdelivr.net/npm/@mediapipe/tasks-vision@0.10.12")}static async loadDetector(){try{const{FaceLandmarker:t,FilesetResolver:n}=await Se.loadVision(),r=await n.forVisionTasks("https://cdn.jsdelivr.net/npm/@mediapipe/tasks-vision@0.10.12/wasm");return await t.createFromOptions(r,{baseOptions:{modelAssetPath:"https://storage.googleapis.com/mediapipe-models/face_landmarker/face_landmarker/float16/1/face_landmarker.task",delegate:"GPU"},outputFaceBlendshapes:!0,runningMode:"IMAGE",numFaces:1})}catch(t){return Promise.reject(t)}}static denormalizeKeypoints(t,n,r){return t.map(o=>({x:o.x*n,y:o.y*r,z:o.z}))}static getBoundingBox(t,n,r){const o={width:n*.6,height:r*.8,x:0,y:0};o.x=(n-o.width)/2,o.y=(r-o.height)/2;let i=1/0,s=-1/0,a=1/0,c=-1/0;t.forEach(d=>{i=Math.min(i,d.x),s=Math.max(s,d.x),a=Math.min(a,d.y),c=Math.max(c,d.y)});const u={xMin:i,xMax:s,yMin:a,yMax:c};return u.xMin<o.x||u.xMax>o.x+o.width||u.yMin<o.y||u.yMax>o.y+o.height?{box:{xMin:i,xMax:s,yMin:a,yMax:c,width:s-i,height:c-a},inBox:!1}:{box:{xMin:i,xMax:s,yMin:a,yMax:c,width:s-i,height:c-a},inBox:!0}}static async detectFaces(t,n){var r;try{const{width:o,height:i}=n,{faceLandmarks:s,faceBlendshapes:a}=await t.detect(n);if(s.length===0)return{faces:[],blendShapes:[],inBox:!1};const c=Se.denormalizeKeypoints(s[0],o,i),{box:u,inBox:d}=Se.getBoundingBox(c,o,i);return{faces:[{keypoints:c,box:u}],blendShapes:((r=a==null?void 0:a[0])==null?void 0:r.categories)??[],inBox:d}}catch(o){return Promise.reject(o)}}}const Ha=(e,t)=>{let n;return typeof OffscreenCanvas<"u"?n=new OffscreenCanvas(e,t):(n=document.createElement("canvas"),n.width=e,n.height=t),n},Mn=(e,t,n,r,o)=>{let i=0,s=0,a=t,c=n;const d=Ha(t,n).getContext("2d",o);return d.drawImage(e,0,0),d.getImageData(i,s,a,c)},Va=e=>new Promise(t=>{const n=document.createElement("canvas");let{width:r}=e,{height:o}=e;e instanceof HTMLVideoElement&&(r=e.videoWidth,o=e.videoHeight),n.width=r,n.height=o,n.getContext("2d").drawImage(e,0,0),n.toBlob(s=>t(s))});function Wa(e){const{width:t,height:n,data:r}=e;let o=0,i=0;const s=[0,-1,0,-1,4,-1,0,-1,0];for(let d=1;d<n-1;d++)for(let l=1;l<t-1;l++){let h=0,f=0,v=0,g=0;for(let m=-1;m<=1;m++)for(let y=-1;y<=1;y++){const b=((d+m)*t+(l+y))*4,E=s[g++];h+=r[b]*E,f+=r[b+1]*E,v+=r[b+2]*E}const _=.299*h+.587*f+.114*v;o+=_,i+=_*_}const a=(t-2)*(n-2);if(a===0)return 0;const c=o/a;return i/a-c*c}function za(){if(MediaRecorder.isTypeSupported("video/webm; codecs=vp9"))return{mimeType:"video/webm; codecs=vp9",videoBitsPerSecond:25e4};if(MediaRecorder.isTypeSupported("video/webm"))return{mimeType:"video/webm",videoBitsPerSecond:25e4};if(MediaRecorder.isTypeSupported("video/mp4"))return{mimeType:"video/mp4",videoBitsPerSecond:25e4}}function $o(e={}){const{onRecord:t=()=>{},onStop:n=()=>{}}=e,r=w([]),o=w(null),i=w(null),s=j(h=>{r.current.push(h)},[]),a=j(async h=>{if(o.current)return;let f=null;h instanceof ImageData?f=await new Promise(v=>{const g=document.createElement("canvas");g.width=h.width,g.height=h.height;const _=g.getContext("2d");_?(_.putImageData(h,0,0),g.toBlob(m=>{v(m)},"image/jpeg",.95)):v(null)}):f=await Va(h),f&&(o.current=f)},[]),c=j(()=>{o.current=null},[]),u=j(h=>{h.data.size>0&&t(h.data)},[]),d=j(()=>{!i.current||i.current.state==="inactive"||(i.current.stop(),i.current.stream.getTracks().forEach(h=>h.stop()),n())},[]),l=j(h=>{i.current||(i.current=new MediaRecorder(h,za()),i.current.ondataavailable=u,i.current.onstop=d,i.current.start(1e3))},[]);return{saveStream:s,savePhoto:a,start:l,stop:d,savedStreams:r,savedPhoto:o,clearSavedPhoto:c}}const Ua=360,ja="#125766",Ba="https://cdn.youverify.co/1721901834404-q2nxqyng5klm918b3BDVU.jpg",To="https://cdn.youverify.co",at={js:{default:"1731681780468-ttgfiK6Sl1GKegUe-wm4v.js",simd:"1731681609027-RTOweJqdl8Tt39aAdyie9.js"},wasm:{default:"1731681817302-aVNwDW6DP2MsDNTbiav_V.wasm",simd:"1731681739675-nvF1En4g5rAW4daq5g5DH.wasm"}},qa=[0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,10,9,1,7,0,65,0,253,15,26,11],Co={spoofing:{key:"GLARE_DETECTION_ERROR",message:"We detected a screen recording or photo during your liveness."},"no face":{key:"LIVENESS_FACE_NOT_FOUND",message:"We could not detect a face in your test."},lighting:{key:"LIGHTING_ERROR",message:"Please check your lighting. Move to a well-lit area, but avoid harsh light or strong reflections on your face."}};function Be(e,t){return Math.sqrt(e**2+t**2)}function Ya(e){const t=e.slice();for(let n=t.length-1;n>0;n--){const r=Math.floor(Math.random()*(n+1));[t[n],t[r]]=[t[r],t[n]]}return t}async function Ka(){var t,n,r;let e=(t=(await navigator.mediaDevices.enumerateDevices()).find(o=>o.deviceId!==""))==null?void 0:t.deviceId;return e?e=e.endsWith("=")?Array.from(atob(e),o=>`0${o.charCodeAt(0).toString(16)}`.slice(-2)).join(""):e:e=((n=globalThis.crypto)==null?void 0:n.randomUUID().replace(/-/g,""))||"0".repeat(64),e="0".repeat(64-e.length)+e,e=(BigInt(`0x${e.substring(0,32)}`)^BigInt(`0x${e.substring(32,64)}`)).toString(16).substring(0,32),e=((r=("0".repeat(32-e.length)+e).match(/^(.{8})(.{4})(.{4})(.{4})(.{12})$/))==null?void 0:r.slice(1).join("-"))||"",e}const He=(e,t)=>{for(const[n,r]of Object.entries(e))if(r===t)return n;return null},Ga=e=>{const t=Object.keys(Co);for(const n of t)if(new RegExp(`\\b${n}\\b`,"i").test(e))return Co[n];return{key:"VALIDATION_ERROR",message:"We detected an error during your test. Please TRY AGAIN"}},Za="https://cdn.svc.youverify.co",Xa=e=>e?"https://identity.staging.svc.youverify.co":"https://identity.svc.youverify.co";function ko(e){const t=Xa(e);return{postData:async o=>{const{faceImage:i,publicKey:s,passed:a,metadata:c,video:u}=o,d=new FormData;d.append("files",i),d.append("files",u);const l=await fetch(`${Za}/v1/uploads/media`,{method:"POST",headers:{},body:d});if(!l.ok)throw l;const h=(await l.json()).data,f=await fetch(`${t}/v1/sdk/identity/liveness/`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({publicMerchantID:s,components:["liveness"],faceImage:h[0].cachedLocation,livenessClip:h[1].cachedLocation,passed:a,metadata:c})});if(!f.ok)throw f;return(await f.json()).data},fetchSessionToken:async o=>{const{action:i="detectLiveness",publicKey:s}=o,a=await Ka(),c=new FormData;c.append("publicMerchantID",s),c.append("action",i),c.append("livenessOperationMode","Passive"),c.append("sendResultsToClient","true"),c.append("deviceCorrelationId",a);const u=await fetch(`${t}/v1/sdk/identity/liveness/token`,{method:"POST",body:c}),{data:d}=await u.json();if(!u.ok)throw new Error("Could not get token");return d.authToken}}}const Ja={"complete-the-circle":{Icon:Aa,name:"Complete The Circle ⭕️",description:"First position your face in the camera frame. Then move your head in a circle to show all the angles of your face"},"yes-or-no":{Icon:Da,name:"Yes or No ❓",description:"First position your face in the camera. Then tilt your head to the left to answer No and to the right to answer Yes"},motions:{Icon:wo,name:"Motions 💫",description:"First position your face in the camera frame, then follow the instructions"},blink:{Icon:wo,name:"Blink 💫",description:"First position your face in the camera frame, then follow the instructions"},"facial-expressions":{Icon:yo,name:"Facial Expressions 🤪",description:"First position your face in the camera frame. Then move your head in a circle to show all the angles of your face"}},So=ie({tasks:[],namespace:"",user:void 0,currentTaskIndex:0,completedCount:0,nextTask:()=>{},completed:!1,onRequestClose:()=>{},faceDetector:null,saveStream:()=>{},savePhoto:()=>{},clearSavedPhoto:()=>{},onComplete:()=>Promise.resolve(),onFailure:()=>{},imageCaptured:!1,setImageCaptured:()=>{},sandboxEnvironment:!0,publicKey:""});let Fo,Mo=!1;function Qa(e){const{publicKey:t,tasks:n,children:r,namespace:o,user:i,branding:s,onRequestClose:a,onSuccess:c=()=>{},onFailure:u=()=>{},metadata:d,presentation:l,sandboxEnvironment:h=!0}=e,[f,v]=x(0),[g,_]=x(0),[m,y]=x(null),[b,E]=x(!1),{saveStream:T,savePhoto:D,savedPhoto:F,clearSavedPhoto:O,savedStreams:M}=$o(),{postData:C}=ko(h),k=U(()=>g===n.length,[n,g]),z=()=>{_(V=>V+1),v(V=>V+1)},R=V=>{const S=new Image;S.crossOrigin="Anonymous",S.src=Ba,S.onload=()=>{const L=Mn(S,S.width,S.height);Se.detectFaces(V,L)}},K=async()=>{if(!F.current){u({faceImage:"",passed:!1,metadata:d,error:{key:"image_capture_failed",message:"No face image captured. Image capture failed. Please try again."}}),a();return}try{const V=await C({faceImage:F.current,video:new Blob(M.current,{type:"video/mp4"}),publicKey:t,passed:!0,metadata:d});c(V),a()}catch{u({faceImage:"",passed:!1,metadata:d,error:{key:"API_ERROR",message:"Failed to process liveness check. Please try again."}}),a()}},I=async()=>{const V=await Se.loadDetector();Fo=V,R(V),y(V)};return W(()=>{if(Mo){y(Fo);return}I(),Mo=!0},[]),p(So.Provider,{value:{tasks:n,namespace:o,user:i,currentTaskIndex:f,completed:k,completedCount:g,nextTask:z,branding:s,onRequestClose:a,faceDetector:m,saveStream:T,savePhoto:D,clearSavedPhoto:O,onComplete:K,onFailure:u,presentation:l,imageCaptured:b,setImageCaptured:E,sandboxEnvironment:h,publicKey:t},children:r})}function fe(){return te(So)}const oe={root:"_root_vqy7d_1",container:"_container_vqy7d_4",lhs:"_lhs_vqy7d_7",info:"_info_vqy7d_11",active:"_active_vqy7d_32",completed:"_completed_vqy7d_39",rhs:"_rhs_vqy7d_62",profile:"_profile_vqy7d_65",avatar:"_avatar_vqy7d_68",main:"_main_vqy7d_81",content:"_content_vqy7d_84"},xn={root:"_root_135td_1",container:"_container_135td_1",brand:"_brand_135td_1"};function ec(){const{branding:e}=fe();return p("div",{className:xn.root,children:p("div",{className:xn.container,children:p("div",{className:xn.brand,children:(e==null?void 0:e.logo)&&p("img",{className:"yvlw-h-10",src:e.logo,alt:"Logo"})})})})}const xo="colorScheme";function Po(){const{namespace:e}=fe(),t=()=>{const o=localStorage.getItem(xo);return!o&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":o},n=(o=null)=>{o&&localStorage.setItem(xo,o);const i=`${e}-color-scheme`,s=document.documentElement;o&&o==="dark"?s==null||s.setAttribute(i,"dark"):s==null||s.removeAttribute(i)};return{setColorScheme:n,toggleColorScheme:()=>{const o=t();return n(o==="dark"?"light":"dark")},getColorScheme:t}}const tc={root:"_root_bcsvc_1"};function nc(){if(!(window.screen.width>=900))return 10/9}function ct(e){const{children:t,onStream:n=()=>{},onRecord:r=()=>{}}=e,o=w(null),i=w(0),s=w(null),{start:a,stop:c}=$o({onRecord:r}),u=async()=>{try{const h=await navigator.mediaDevices.getUserMedia({video:{aspectRatio:{exact:nc()}}});s.current=h,a(h),o.current&&(o.current.srcObject=h)}catch{}},d=()=>{s.current&&(s.current.getTracks().forEach(h=>h.stop()),s.current=null,c(),o.current&&(o.current.srcObject=null))},l=()=>{n(o),i.current=requestAnimationFrame(l)};return W(()=>{const h=o.current;if(!h)return;const f=()=>{i.current=requestAnimationFrame(l)};return u(),h.addEventListener("canplay",f),()=>{h.removeEventListener("canplay",f),cancelAnimationFrame(i.current),d()}},[]),p("div",{className:tc.root,children:[p("video",{ref:o,autoPlay:!0,loop:!0,playsInline:!0}),t]})}const lt={container:"_container_mcmsr_1",focused:"_focused_mcmsr_12",progress:"_progress_mcmsr_15",completed:"_completed_mcmsr_36",marker:"_marker_mcmsr_40"},Lo=360,rc=50;function oc(e){const{visitedSections:t,sectionsCount:n,faceDetected:r,divisions:o=rc}=e,i=U(()=>{const s=[lt.container];return r&&s.push(lt.focused),s.join(" ")},[r]);return p("div",{className:i,children:[p(pe,{as:"div",show:r,leave:"yvlw-transition yvlw-linear yvlw-duration-300",leaveFrom:"yvlw-scale-100 yvlw-opacity-100",leaveTo:"yvlw-scale-125 yvlw-opacity-0",enter:"yvlw-transition yvlw-linear yvlw-duration-300",enterFrom:"yvlw-scale-125 yvlw-opacity-0",enterTo:"yvlw-scale-100 yvlw-opacity-100",className:"yvlw-absolute",children:p("div",{className:lt.progress,children:Array.from(Array(o).keys()).map(s=>{const a=s*Lo/o,c=Math.ceil((a+1)*n/Lo),u=t.includes(c),d=u?s-(c-1)*(o/n):0,l=[];u&&l.push(lt.completed);const h=u?"translateX(158px)":"translateX(150px)";return p("div",{className:l.join(" "),style:{transform:`rotate(${a}deg) ${h}`,transitionDelay:`${d*20}ms`}},`key-${s}`)})})}),p(pe,{as:"div",show:!r,leave:"yvlw-transition yvlw-linear yvlw-duration-200",leaveFrom:"yvlw-scale-100 yvlw-opacity-100",leaveTo:"yvlw-scale-75 yvlw-opacity-0",enter:"yvlw-transition yvlw-linear yvlw-duration-200",enterFrom:"yvlw-scale-75 yvlw-opacity-0",enterTo:"yvlw-scale-100 yvlw-opacity-100",className:"yvlw-absolute",children:p("div",{className:lt.marker,children:[p("div",{}),p("div",{}),p("div",{}),p("div",{})]})})]})}function No(){return{checkZoomLevel:(r,o)=>{const{box:i}=r,{width:s,height:a}=i,c=s*a,u=o**2,d=c/u;if(d>.9)throw new Error("Move face farther from camera");if(d<.05)throw new Error("Move face closer to camera")},checkFacialFeatures:(r,o)=>{},checkInFrame:(r,o)=>{const{offsetX:i,offsetY:s}=o,{box:a}=r;if(!(a.xMin-i>=o.x&&a.yMin-s>=o.y&&a.xMax-i<=o.x+o.width&&a.yMax-s<=o.y+o.height))throw new Error("Position head in frame")}}}function Nt(e={}){const{validations:t=["zoom"],frameSize:n,onFace:r=()=>{},onError:o=()=>{}}=e,{faceDetector:i}=fe(),{checkFacialFeatures:s,checkZoomLevel:a,checkInFrame:c}=No(),u=w(null),d=h=>{var f;try{if(h.length===0)throw new Error("Detecting face...");if(h.length>1)throw new Error("A maximum of 1 face is allowed");const v=u.current,g=(f=u.current)==null?void 0:f.parentElement;if(!v||!g)return;const _=h[0];for(const m of t)switch(m){case"zoom":a(_,Math.min(g.clientHeight,g.clientWidth));break;case"features":s(_,Math.min(g.clientHeight,g.clientWidth));break;case"in-frame":if(!n)throw new Error("Frame size is required to check if face is in frame");const y=n+200;c(_,{x:(g.clientWidth-y)/2,y:(g.clientHeight-y)/2,width:y,height:y,offsetX:(v.videoWidth-g.clientWidth)/2,offsetY:(v.videoHeight-g.clientHeight)/2});break;default:break}r(_)}catch(v){const{message:g}=v;o(g)}};return{detectFaces:async h=>{if(!i)return;const{ref:f}=h;u.current=f.current;const v=u.current;if(!v)throw new Error("No Video Source detected");const{videoWidth:g,videoHeight:_}=v;if(g===0||_===0)return;const m=Mn(v,g,_),y=await Se.detectFaces(i,m);d(y.faces)}}}const ae={root:"_root_5hgaj_1",container:"_container_5hgaj_4",progress:"_progress_5hgaj_7",intro:"_intro_5hgaj_12",content:"_content_5hgaj_15",branding:"_branding_5hgaj_18",instructionsContainer:"_instructionsContainer_5hgaj_22",instructions:"_instructions_5hgaj_22"},Ao={root:"_root_h5elg_1",spinner:"_spinner_h5elg_22"},Do={container:"_container_1vep2_1",spin:"_spin_1vep2_1",md:"_md_1vep2_7",lg:"_lg_1vep2_10"};function Io(e){const{size:t="md",message:n,className:r=""}=e;return p("span",{className:`${Do.container} ${Do[t]} ${r}`,children:n})}function At(e){const{Icon:t,description:n,title:r,actionText:o="Okay, got it",onActionClick:i=()=>{},loading:s=!1,children:a,hideButton:c=!1}=e;return p("div",{className:Ao.root,children:[p(t,{size:"custom",className:"yvlw-h-20 yvlw-mx-auto yvlw-mb-12"}),p("h2",{children:r}),p("p",{className:"subtext",children:n}),!c&&p("div",{className:"yvlw-mt-12",children:p(Xi,{onClick:()=>i(),className:"yvlw-flex yvlw-items-center yvlw-space-x-3",disabled:s,children:[p("span",{className:"yvlw-flex-1 yvlw-flex yvlw-items-center yvlw-space-x-1 yvlw-justify-center",children:o}),s&&p(Io,{className:Ao.spinner})]})}),a]})}const Ro="yvlw-absolute yvlw-w-full yvlw-h-full",Oo="yvlw-transform yvlw-transition yvlw-ease-in yvlw-duration-300",Ho="yvlw-transform yvlw-transition yvlw-ease-in yvlw-duration-300";function Dt(e){const{children:t,instruction:n,completed:r,failed:o,onStart:i=()=>{},onReset:s=()=>{}}=e,[a,c]=x(!1),{completedCount:u,tasks:d,nextTask:l}=fe(),h=U(()=>u*100/d.length,[u,d.length]);return W(()=>{!r&&!o&&(async()=>{await i(),c(!0)})()},[]),W(()=>{r&&(()=>{l()})()},[r]),p("div",{className:ae.root,children:p("div",{className:`${ae.container} view`,children:[p("div",{style:{width:`${h}%`},className:ae.progress}),p(pe,{as:"div",show:a&&!r&&!o,enter:Oo,enterFrom:"yvlw-translate-x-full",enterTo:"yvlw-translate-x-0",leave:Ho,leaveFrom:"yvlw-translate-x-0",leaveTo:"yvlw-translate-x-full",className:Ro,children:[p("div",{className:`${ae.content}`,children:t}),p("div",{className:ae.instructionsContainer,children:[p("div",{className:ae.instructions,children:[p("h2",{children:n.title}),p("p",{className:"subtext",children:n.description})]}),p("div",{className:ae.branding,children:[p("span",{children:"Powered by"})," ",p(Eo,{size:"custom",className:"yvlw-h-3"})]})]})]}),p(pe,{show:o,as:"div",enter:Oo,enterFrom:"yvlw-translate-x-full",enterTo:"yvlw-translate-x-0",leave:Ho,leaveFrom:"yvlw-translate-x-0",leaveTo:"yvlw-translate-x-full",className:Ro,children:p("div",{className:`${ae.intro}`,children:p(At,{Icon:bo,title:"Oops, task failed!",description:"Could not confirm liveness on this task. Click on the button below to go again",onActionClick:s,actionText:"Try Again"})})})]})})}function It(e={}){const{timeout:t,onTimeout:n=()=>{}}=e,[r,o]=x(!1),i=w(null),s=j(()=>{t&&i.current&&clearTimeout(i.current)},[]),a=j(()=>{t&&(i.current=setTimeout(()=>{o(!0),n()},t))},[]),c=j(()=>{o(!1),a()},[]);return W(()=>s,[]),{timedOut:r,reset:c,start:a,stop:s}}const ic=1,Pn=8,Vo="Place face in frame";function sc(e){const{difficulty:t,timeout:n}=e,{saveStream:r}=fe(),[o,i]=x([]),[s,a]=x(Vo),[c,u]=x(!1),[d,l]=x(!1),h=w(new Set),f=w(!1),v=w(null),{reset:g,start:_,stop:m,timedOut:y}=It({timeout:n}),b=()=>{i([]),a(Vo),u(!1),l(!1),h.current=new Set,f.current=!1,v.current=null,g()},E=C=>{const k=C*Pn,z=Math.ceil((k+1)/Ua);h.current.has(z)||(h.current.add(z),i(Array.from(h.current))),h.current.size>=Pn&&(m(),setTimeout(()=>{l(!0)},1e3))},T=(C,k)=>{let R=Math.atan2(k,C)*(180/Math.PI);return R<0&&(R+=360),R},D=j(()=>{if(h.current.size===0)return 25;switch(t){case"easy":return 5;case"hard":return 15;default:return 10}},[]),F=C=>{const{keypoints:k,box:z}=C,R={x:z.width*.5,y:z.height*.5},K=k[ic],I={y:K.y-z.yMin,x:K.x-z.xMin},V=R.x-I.x,S=I.y-R.y,L=D();return Math.abs(V)<L&&Math.abs(S)<L?null:T(V,S)},{detectFaces:O}=Nt({frameSize:280,validations:["zoom","in-frame"],onFace:C=>{u(!0),a("Slowly move head around to complete circle");const k=F(C);k&&E(k)},onError:C=>{a(C),i([]),h.current.clear(),v.current=null,f.current=!1}});return p(q,{children:p(Dt,{instruction:{title:s,description:c?void 0:"Always ensure face is in frame"},name:"complete-the-circle",completed:d,failed:y,onReset:b,onStart:_,children:p(ct,{onStream:C=>{try{if(!C.current||d)return;const{videoWidth:k}=C.current;O({ref:C,frameSize:k})}catch{}},onRecord:r,children:p(oc,{faceDetected:c,sectionsCount:Pn,visitedSections:o})})})})}const Ln={root:"_root_thujo_1",sticker:"_sticker_thujo_4",no:"_no_thujo_7",yes:"_yes_thujo_12"};function ac(e){const{show:t,stickers:n}=e;return p(q,{children:t&&p("div",{className:Ln.root,children:n.map(r=>p("div",{className:`${Ln.sticker} ${Ln[r]}`,children:r.toUpperCase()},`sticker-${r}`))})})}const cc={question:"Are you alive?",errorMessage:"You have to be alive to proceed though",answer:!0},lc="Wrong answer. Try again",Wo="Keep face in camera";function uc(e){const{difficulty:t,questions:n=[cc],timeout:r}=e,[o,i]=x(Wo),[s,a]=x(!1),[c,u]=x(!1),{saveStream:d}=fe(),l=w("inactive"),h=w(0),f=w(!1),v=w(null),g=w(null),_=w(null),m=()=>{v.current&&clearTimeout(v.current),g.current&&clearTimeout(g.current)},{reset:y,start:b,stop:E,timedOut:T}=It({timeout:r,onTimeout:m}),D=()=>{i(Wo),a(!1),u(!1),l.current="inactive",h.current=0,f.current=!1,y()},F=R=>{const{keypoints:K}=R,I=K[1],V=K[9],S=I.x-V.x,L=I.y-V.y;return 90-Math.atan2(L,S)*(180/Math.PI)},O=R=>{l.current="inactive",i(n[R].question),v.current=setTimeout(()=>{l.current="active"},2e3)},M=U(()=>{switch(t){case"easy":return 2;case"hard":return 6;default:return 4}},[]),C=R=>{try{if(l.current="inactive",Math.abs(R)<M)throw new Error("Tilt head further to answer");const K=R>0,I=n[h.current].answer;if(K===I)h.current+=1,h.current===n.length?(u(!0),E()):O(h.current);else throw new Error(n[h.current].errorMessage||lc)}catch(K){i(K.message),g.current=setTimeout(()=>{O(h.current)},2e3)}},{detectFaces:k}=Nt({onFace:R=>{if(f.current||(a(!0),f.current=!0,O(h.current)),l.current==="inactive")return;const K=F(R);C(K)},onError:R=>{i(R)}}),z=R=>{try{if(!R.current||c)return;_.current=R.current;const{videoWidth:K}=R.current;k({ref:R,frameSize:K})}catch{}};return W(()=>m,[]),p(Dt,{instruction:{title:o,description:s?"":"Move head left for No and right for Yes"},name:"yes-or-no",failed:T,onReset:D,onStart:b,completed:c,children:p(ct,{onStream:z,onRecord:d,children:p(ac,{show:s,stickers:["yes","no"]})})})}function dc(e={}){const{onChange:t=()=>{}}=e,n=!!window.DeviceOrientationEvent,r=o=>{t({alpha:o.alpha,beta:o.beta,gamma:o.gamma})};return W(()=>(window.addEventListener("deviceorientation",r),()=>{window.removeEventListener("deviceorientation",r)}),[]),{canUse:n}}function fc(e){const{total:t,onMessage:n,onComplete:r,difficulty:o}=e,i=w(null),s=w(!0),a=w(null),c=w(null),u=w(0),d=w(!1),l=U(()=>{switch(o){case"easy":return 6;case"hard":return 10;default:return 8}},[]),h=()=>{if(u.current<t){const _=t-u.current;let m=`Nod head ${_} `;_<t&&(m+="more "),m+=_>1?"times":"time",n(m);return}d.current=!0,n("Great, hang on..."),setTimeout(()=>{r()},500)},{canUse:f}=dc({onChange:_=>{c.current=_}});return{evaluate:_=>{if(!f){n("Cannot perform task. Transfer to mobile device to complete");return}if(!c.current||!c.current.beta){n("Cannot perform task. Transfer to mobile device to complete");return}if(c.current.beta<60||c.current.beta>100){n("Keep phone in upright position to continue");return}if(d.current)return;const{keypoints:m}=_,y=Be(m[6].x-m[8].x,m[6].y-m[8].y),E=Be(m[2].x-m[1].x,m[2].y-m[1].y)/y*10;if(E>l){if(i.current||!s.current)return;i.current=E,s.current=!1,a.current=setTimeout(()=>{i.current=null},3e3)}else i.current&&i.current-E>l/2&&(u.current+=1,i.current=null,a.current&&clearTimeout(a.current)),s.current=!0;h()},reset:()=>{i.current=null,s.current=!0,a.current=null,c.current=null,u.current=0,d.current=!1}}}function hc(e){const{onMessage:t,onComplete:n,difficulty:r}=e,o=w(!1),i=U(()=>{switch(r){case"easy":return 80;case"hard":return 120;default:return 100}},[]);return{evaluate:c=>{if(o.current)return;const{keypoints:u}=c,d=Be(u[6].x-u[8].x,u[6].y-u[8].y);if(Be(u[14].x-u[13].x,u[14].y-u[13].y)/d*100>i){o.current=!0,t("Awesome!"),setTimeout(()=>{n()},500);return}t("Open your mouth wide")},reset:()=>{o.current=!1}}}function zo(e){const{total:t,onMessage:n,onComplete:r,difficulty:o}=e,i=w(!0),s=w(!1),a=w(null),c=w(0),u=U(()=>{switch(o){case"easy":return{closed:20,open:30};case"hard":return{closed:10,open:30};default:return{closed:15,open:30}}},[]),d=g=>{i.current&&(g>=u.closed||(i.current=!1,a.current=Date.now()))},l=g=>{if(!i.current&&!(g<u.open)&&(i.current=!0,a.current)){const _=Date.now(),m=a.current;(_-m)/1e3<=2&&(c.current+=1)}},h=()=>{if(c.current<t){const g=t-c.current;let _=`Blink right eye ${g} `;g<t&&(_+="more "),_+=g>1?"times":"time",n(_);return}s.current=!0,n("Great, hang on..."),setTimeout(()=>{r()},500)};return{evaluate:g=>{if(s.current)return;const{keypoints:_}=g,m=Be(_[6].x-_[8].x,_[6].y-_[8].y),b=Be(_[145].x-_[159].x,_[145].y-_[159].y)/m*100;d(b),l(b),h()},reset:()=>{i.current=!0,s.current=!1,a.current=null,c.current=0}}}function Uo(){return{requestDeviceOrientationPermission:async()=>{if(!window.DeviceOrientationEvent)throw new Error("Cannot continue. Transfer to mobile device to complete");const t=window.DeviceOrientationEvent;if(typeof t.requestPermission=="function"&&await t.requestPermission()!=="granted")throw new Error("Permission for device orientation not granted")}}}var jo=(e=>(e.open_mouth="open_mouth",e.blink="blink",e))(jo||{});const Bo=Ya(Object.keys(jo)),qo="Keep face in camera";function pc(e){const{difficulty:t,maxBlinks:n=3,maxNods:r=3,timeout:o}=e,i=w(0),[s,a]=x(qo),[c,u]=x(!1),[d,l]=x(null),h=w(!1),{requestDeviceOrientationPermission:f}=Uo(),{saveStream:v}=fe(),{reset:g,start:_,stop:m,timedOut:y}=It({timeout:o}),b=()=>{if(i.current===Bo.length-1){u(!0),m();return}i.current+=1},E=fc({total:Math.floor(Math.random()*r+1),difficulty:t,onMessage:k=>a(k),onComplete:b}),T=hc({difficulty:t,onMessage:k=>a(k),onComplete:b}),D=zo({total:Math.floor(Math.random()*n+1),difficulty:t,onMessage:k=>a(k),onComplete:b}),{detectFaces:F}=Nt({onFace:k=>{switch(h.current||(h.current=!0),Bo[i.current]){case"open_mouth":T.evaluate(k);break;case"blink":D.evaluate(k);break}},onError:k=>{a(k)}}),O=()=>{i.current=0,a(qo),u(!1),h.current=!1,D.reset(),E.reset(),T.reset(),g()},M=async k=>{try{if(!k.current||c)return;const{videoWidth:z}=k.current;await F({ref:k,frameSize:z,throttleInterval:500})}catch{}},C=async()=>{try{await f()}catch(k){const z=k;a(z.message),l(z)}};return p(Dt,{instruction:{title:s,description:"Follow the directives as instructed"},name:"motions",failed:y,onReset:O,completed:c,onStart:async()=>{await C(),_()},children:d?p(q,{}):p(ct,{onStream:M,onRecord:v})})}const Yo="Keep face in camera";function mc(e){const{difficulty:t,maxBlinks:n=3,timeout:r}=e,[o,i]=x(Yo),[s,a]=x(!1),[c,u]=x(null),d=w(!1),{requestDeviceOrientationPermission:l}=Uo(),{saveStream:h}=fe(),{reset:f,start:v,stop:g,timedOut:_}=It({timeout:r}),m=()=>{a(!0),g()},y=zo({total:Math.floor(Math.random()*n+1),difficulty:t,onMessage:F=>i(F),onComplete:m}),{detectFaces:b}=Nt({onFace:F=>{d.current||(d.current=!0),y.evaluate(F)},onError:F=>{i(F)}}),E=()=>{i(Yo),a(!1),d.current=!1,y.reset(),f()},T=async F=>{try{if(!F.current||s)return;const{videoWidth:O}=F.current;await b({ref:F,frameSize:O})}catch{}},D=async()=>{try{await l()}catch(F){const O=F;i(O.message),u(O)}};return p(Dt,{instruction:{title:o,description:"Follow the directives as instructed"},name:"blink",failed:_,onReset:E,completed:s,onStart:async()=>{await D(),v()},children:c?p(q,{}):p(ct,{onStream:T,onRecord:h})})}const Nn={LEFT_EYE:[36,37,38,39,40,41],RIGHT_EYE:[42,43,44,45,46,47],MOUTH:[48,49,50,51,52,53,54,55,56,57,58,59]},Rt=(e,t)=>Math.sqrt((e.x-t.x)**2+(e.y-t.y)**2),Ko=e=>{if(e.length!==6)return 0;const t=Rt(e[1],e[5]),n=Rt(e[2],e[4]),r=Rt(e[0],e[3]);return(t+n)/(2*r)},vc=e=>{if(e.length<12)return 0;const t=e[9],n=e[3];return Rt(t,n)},_c=(e,t,n,r)=>{var l,h,f;let o=!0,i=!0;if(!r){const _=Nn.LEFT_EYE.map(F=>e[F]),m=Nn.RIGHT_EYE.map(F=>e[F]),y=Nn.MOUTH.map(F=>e[F]),b=Ko(_),E=Ko(m),T=vc(y);o=(b+E)/2>1,i=T<73.24,o||t("Please look at the camera!"),i||t("Please close your mouth!")}const s=.5,a=.12,c=((l=r==null?void 0:r.find(v=>v.categoryName==="eyeBlinkLeft"))==null?void 0:l.score)??0,u=((h=r==null?void 0:r.find(v=>v.categoryName==="eyeBlinkRight"))==null?void 0:h.score)??0,d=((f=r==null?void 0:r.find(v=>v.categoryName==="jawOpen"))==null?void 0:f.score)??0;return o=c<s&&u<s,o||t("Please look at the camera!"),i=d<a,i||t("Please close your mouth!"),{eyesOpen:o,mouthClosed:i}};function gc(e={}){const{validations:t=["zoom","in-frame"],frameSize:n,onFace:r=()=>{},onError:o=()=>{},onMessage:i=()=>{},livenessTimeout:s}=e,{faceDetector:a,savePhoto:c}=fe(),{checkFacialFeatures:u,checkZoomLevel:d,checkInFrame:l}=No(),h=w(null),f=w(null),v=w(!1),g=w(null),_=w(!1),m=w([]),y=j(()=>{f.current&&clearTimeout(f.current),g.current&&clearTimeout(g.current),m.current.forEach(clearTimeout),_.current=!1,v.current=!0},[]),b=w(null),E=w(null),T=w([]),D=10,F=7.5,O=2,M=w({sharpness:0,data:null}),C=(S,L)=>{const H=S.getContext("2d");if(!H||L.width===0||L.height===0||!H||L.width===0||L.height===0)return!1;const N=H.getImageData(L.xMin,L.yMin,L.width,L.height),{data:$}=N;let B=0,X=0;for(let J=0;J<$.length;J+=4).299*$[J]+.587*$[J+1]+.114*$[J+2]>250&&X++;const Q=$.length/4;return B=X/Q,B>.01},k=(S,L,H,N)=>{const $=L.current,B=$==null?void 0:$.parentElement;if(!(!$||!B))for(const X of N)switch(X){case"zoom":d(S,Math.min(B.clientHeight,B.clientWidth));break;case"features":u(S,Math.min(B.clientHeight,B.clientWidth));break;case"in-frame":let Q=H;Q||(Q=Math.min(B.clientHeight,B.clientWidth)*.7);const J=Q+200;l(S,{x:(B.clientWidth-J)/2,y:(B.clientHeight-J)/2,width:J,height:J,offsetX:($.videoWidth-B.clientWidth)/2,offsetY:($.videoHeight-B.clientHeight)/2});break}},z=S=>{const L=[33,133,159,362,263,386],H=.5;for(const N of L){const $=S[N];if(!$||$.score&&$.score<H)return!1}return!0},R=(S,L)=>{const H=S.getContext("2d");if(!H||L.width===0||L.height===0)return!1;const N=H.getImageData(L.xMin,L.yMin,L.width,L.height),{data:$}=N;let B=0;for(let Q=0;Q<$.length;Q+=4){const J=$[Q],ee=$[Q+1],Ye=$[Q+2],Ot=.299*J+.587*ee+.114*Ye;B+=Ot}return B/($.length/4)<60},K=S=>{const L={x:S.box.xMin+(S.box.width??0)/2,y:S.box.yMin+(S.box.height??0)/2};if(T.current.push(L),T.current.length>D&&T.current.shift(),T.current.length<D)return!1;let H=0,N=0,$=0;for(let ee=1;ee<T.current.length;ee++){const Ye=T.current[ee-1],Ot=T.current[ee],ut=Ot.x-Ye.x,Zo=Ot.y-Ye.y,Xo=Math.sqrt(ut*ut+Zo*Zo);Xo>=2&&(H+=Xo,ee>1&&Math.sign(ut)!==Math.sign($)&&Math.abs(ut)>3&&N++,$=ut)}const X=H/(D-1)>F,Q=N>=O,J=X||Q;return J&&i("🚨 Head shake detected!"),J},I=(S,L,H,N)=>{try{if(S.length===0||S.length>1){f.current&&(clearTimeout(f.current),f.current=null),i(S.length>1?"Please ensure only one face is visible":"Detecting face...");return}const $=S[0];let B="",X=!0;try{k($,h,n,t)}catch(ee){B=ee.message,X=!1}K($)&&(B="Please hold your head steady",X=!1),N||(B="Center your face in the frame",X=!1),z($.keypoints)||(B="Please ensure your eyes are clearly visible. Remove glasses if necessary.",X=!1);const{eyesOpen:Q,mouthClosed:J}=_c($.keypoints,i,!1,H);if(Q?J||(B="Please close your mouth",X=!1):(f.current&&(clearTimeout(f.current),f.current=null),X=!1),!X){f.current&&(clearTimeout(f.current),f.current=null,m.current.forEach(clearTimeout)),i(B),r($,!1,H,!1);return}if(!f.current){if(R(b.current,$.box)){i("Too dark – move to a well-lit area");return}if(C(b.current,$.box)){i("Too much glare. Please avoid direct light on your face.");return}i("Hold still..."),M.current={sharpness:0,data:null},m.current.forEach(clearTimeout);const ee=setTimeout(()=>i("Almost there..."),400),Ye=setTimeout(()=>i("Detecting liveness..."),700);m.current=[ee,Ye],f.current=setTimeout(()=>{M.current.data?(c(M.current.data),r($,!0,H,!0)):o("Could not capture a clear photo. Please try again.")},1e3)}if(f.current){const ee=Wa(L);ee>M.current.sharpness&&(M.current={sharpness:ee,data:L})}}catch($){o($.message),S.length>0&&r(S[0],!1,H,!1)}};return{detectFaces:async S=>{if(!a)return;h.current=S.ref.current;const L=h.current;if(!L||L.videoWidth===0)return;b.current||(b.current=document.createElement("canvas"),E.current=b.current.getContext("2d",{willReadFrequently:!0}));const H=b.current,N=E.current;if(!H||!N)return;H.width=L.videoWidth,H.height=L.videoHeight,N.drawImage(L,0,0,H.width,H.height);const $=N.getImageData(0,0,H.width,H.height);!_.current&&L.readyState>=2&&!v.current&&(_.current=!0,g.current=setTimeout(()=>{o("Liveness check TIMED OUT. Please try again."),y()},s));const{faces:B,blendShapes:X,inBox:Q}=await Se.detectFaces(a,$);I(B,$,X,Q)},cleanup:y}}const An={container:"_container_1ej18_1",progress:"_progress_1ej18_12",completed:"_completed_1ej18_33",marker:"_marker_1ej18_37"};function yc(e){const{faceDetected:t}=e,n=U(()=>{const r=[An.container];return t&&r.push(An.focused),r.join(" ")},[t]);return p("div",{className:n,children:p(pe,{as:"div",className:"yvlw-absolute",children:p("div",{className:An.marker,children:[p("div",{}),p("div",{}),p("div",{}),p("div",{})]})})})}const Dn={EnvironmentNotSupported:"Please check your lighting. Move to a well-lit area, but avoid harsh light or strong reflections on your face.",SpoofFace:"We detected a spoofing attempt",FaceTrackingFailed:"We could not detect your face",ExcessiveFaceBrightnessDetected:"We detected excessive light during the test, please wipe any oil or sweat that might cause a reflection on your face."},wc={None:"Processing...",LookAtCamera:"Look at camera.",FaceNotCentered:"Center your face in the camera.",MoveCloser:"Too far away! Move in closer.",ContinueToMoveCloser:"Continue to move closer.",MoveBack:"Too close! Move farther away.",TooMuchMovement:"Too much movement.",AttentionNotNeeded:"Finalizing check...",LookInFront:"Look in front.",TimedOut:"Timed out.",IncreaseBrightnessToMax:"Increase your screen brightness to maximum.",Tip1Title:"Tip 1:",Tip2Title:"Tip 2:",Tip3Title:"Tip 3:",Tip1:"Center your face in the preview. Make sure your eyes and mouth are visible, remove any obstructions like headphones.",Tip2:"You may be asked to smile.",Tip3:"You may be asked to turn your nose towards the green color.",Continue:"Continue"};function bc(e){const{onComplete:t=()=>{},onMessage:n=()=>{},onError:r=()=>{}}=e,{setColorScheme:o,getColorScheme:i}=Po(),s=w(null),a=w(!1),c=()=>{s.current&&(s.current.callAttemptEnd(),s.current.delete(),s.current=null)},u=j(()=>{c()},[]),d=()=>{s.current&&c(),s.current=null,a.current=!1},l=_=>{var F,O;const m=_.split(".");let y=!1;s.current.setToken(_);let b="",E="",T,D=0;if(m.length===3){const M=JSON.parse(atob(m[1]));if(M.face){const C=JSON.parse(M.face),k=/^https:\/\/[^/:]+\.(api\.cognitive\.microsoft|cognitiveservices\.azure)\.com$/;if(C.endpoint&&(k.test(C.endpoint)||C.endpoint==="https://virginia.api.cognitive.microsoft.us")){s.current.setEndpoint(C.endpoint);const R=JSON.parse(M["allowed-paths"]);if(R){const K=(F=R.find(N=>N.path.toLocaleLowerCase().endsWith("/session/start")))==null?void 0:F.path;s.current.setSessionStartPath(K);const I=(O=R.find(N=>N.path.toLocaleLowerCase().endsWith("/session/attempt/end")))==null?void 0:O.path;s.current.setAttemptEndPath(I);const V=R.find(N=>N.path.endsWith("/detectLiveness/singleModal"));V&&({path:b,quota:D}=V,s.current.setLivenessPath(b));const S=R.find(N=>N.path.endsWith("/detectLivenessWithVerify/singleModal"));S&&({path:E,quota:D}=S,s.current.setLivenessWithVerifyPath(E));const L=new Set(R.map(N=>{var $;return($=N.path)==null?void 0:$.split("/")[1]}));if(L.size===1&&(V||S)){const N=L.values().next().value;s.current.setApiVersion(N),y=!0,T=C.clientClaims.livenessOperationMode}}}}s.current.setOperationQuota(D),s.current.setOperationMode(window.Module.LivenessOperationMode[T]),M.sid&&s.current.setSid(M.sid),M["azure-resource-id"]&&s.current.setResourceId(M["azure-resource-id"])}if(y)s.current.initialize();else{const M={livenessError:He(window.Module.LivenessFailureReason,window.Module.LivenessFailureReason.InvalidToken),recognitionError:He(window.Module.RecognitionFailureReason,window.Module.RecognitionFailureReason.None)};r(M.livenessError?Dn[M.livenessError]||M.livenessError:"Something went wrong"),u()}},h=_=>{try{s.current=new window.Module.FaceRecoEngineAdapter,l(_)}catch(m){r(`Could not start liveness test: ${m.message}`),c()}},f=_=>{const{isActionValid:m,isFeedbackValid:y,feedback:b}=_;if(m)switch(_.action){case window.Module.ActionRequiredFromApplication.BrightenDisplay:o("light");break;case window.Module.ActionRequiredFromApplication.DarkenDisplay:o("dark");break;case window.Module.ActionRequiredFromApplication.StopCamera:break}if(!a.current&&y){const E=He(window.Module.FeedbackForFace,b);n(E&&(wc[E]||""))}if(b===window.Module.FeedbackForFace.AttentionNotNeeded){a.current=!0;const E=i();o(E)}},v=_=>{var T,D;const{livenessResult:m,recognitionResult:y}=_,b=((T=m.failureReason)==null?void 0:T.value)!==0||((D=y.failureReason)==null?void 0:D.value)!==0,E=new Set(["EnvironmentNotSupported","ExcessiveFaceBrightnessDetected","FaceEyeRegionNotVisible"]);if(b){const F={livenessError:He(window.Module.LivenessFailureReason,m.failureReason),recognitionError:He(window.Module.RecognitionFailureReason,y.failureReason)};F.livenessError&&E.has(F.livenessError)?t():r(F.livenessError?Dn[F.livenessError]||F.livenessError:"Something went wrong")}else{const F={livenessStatus:He(window.Module.LivenessStatus,m.status),recognitionResult:{status:He(window.Module.RecognitionStatus,y.status),matchConfidence:y.confidence},resultId:m.resultId,digest:m.digest};F.livenessStatus==="RealFace"?t():F.livenessStatus==="SpoofFace"?r(Dn[F.livenessStatus]):r("Could not validate request")}u()};return{start:h,analyze:f,processFrame:_=>{let m=!1;if(a.current)m=s.current.generatePayloadAndResult();else{const{videoWidth:y,videoHeight:b}=_,E=Mn(_,y,b,void 0,{willReadFrequently:!0}),T=window.Module._malloc(E.data.byteLength);try{window.Module.HEAPU8.set(E.data,T);const D=s.current.processFrame(y,b,E.data.byteLength,T);D.terminate?m=!0:D.isValid&&f(D)}finally{window.Module._free(T)}}m&&v(s.current.getFaceAnalyzerResult())},reset:d,destroy:u}}const Go="Detecting face...";function Ec({onImageCaptured:e,fetchAzureSessionToken:t,loadAzureSdk:n,onError:r,onReset:o,onFailure:i}){const[s,a]=x(Go),[c,u]=x(!1),d=w("findingFace"),l=w(null),h=w(),f=w(!1),[v,g]=x(0),_=w(!1),[m,y]=x(!1);W(()=>{g(Math.min(window.innerWidth,window.innerHeight)*.6)},[]),W(()=>{n(),t()},[]);const b=bc({onMessage:M=>{d.current==="analyzingLiveness"&&a(M)},onComplete:()=>{d.current="done",e(!0)},onError:M=>{const C=Ga(M);a(C.message),d.current="done",u(!0),r&&r(M),i({faceImage:"",passed:!1,metadata:{},error:C})}}),E=()=>{_.current=!1,a(Go),d.current="findingFace",l.current=null,b.reset(),h.current&&cancelAnimationFrame(h.current),u(!1),o()},{detectFaces:T,cleanup:D}=gc({validations:["zoom","features"],frameSize:v,livenessTimeout:1e4,onFace:async(M,C,k)=>{f.current=C,C&&d.current==="findingFace"&&!_.current&&k&&(_.current=!0,y(!0))},onPhotoSaved:()=>{},onMessage:M=>{d.current==="findingFace"&&a(M)},onError:M=>{a(M),u(!0),r&&r(M)}});W(()=>()=>{D()},[]);const F=()=>{!l.current||l.current.paused||l.current.ended||(d.current==="findingFace"?T({ref:l}):d.current==="analyzingLiveness"&&b.processFrame(l.current),d.current!=="done"&&(h.current=requestAnimationFrame(F)))};W(()=>{(async()=>{if(m){y(!1),D();try{await n();const C=await t();if(C)b.start(C),d.current="analyzingLiveness";else throw new Error("Session token could not be retrieved.")}catch(C){const k=C instanceof Error?C.message:"Failed to start liveness check.";r&&r(k),i({faceImage:"",passed:!1,metadata:{},error:{key:"session_token_error",message:k}}),u(!0)}}})()},[m]);const O=M=>{M.current&&(l.current=M.current,F())};return W(()=>()=>{h.current&&cancelAnimationFrame(h.current)},[]),p("div",{className:"yvlw-h-full yvlw-flex yvlw-flex-col yvlw-items-center yvlw-justify-center",children:c?p("div",{className:`${ae.intro}`,children:p(At,{Icon:bo,title:"Oops, task failed!",description:s,onActionClick:E,actionText:"Try Again"})}):p("div",{className:ae.root,children:p("div",{className:`${ae.container} view`,children:p("div",{className:"yvlw-h-full yvlw-flex yvlw-flex-col",children:[p("div",{children:p(ct,{onStream:O,children:p(q,{children:[p(yc,{faceDetected:f.current}),d.current==="analyzingLiveness"&&p("div",{className:"yvlw-bg-black/20 yvlw-z-5"})]})})}),p("div",{className:"yvlw-border-t dark:yvlw-border-gray-800 yvlw-border-gray-200",children:p("div",{className:"yvlw-text-center yvlw-mx-auto yvlw-pt-4 yvlw-pb-6 yvlw-px-4",children:[p("div",{className:ae.instructions,children:[p("h2",{children:s}),p("p",{className:"subtext",children:"Position your face in the camera frame and hold still."})]}),p("div",{className:ae.branding,children:[p("span",{children:"Powered by"})," ",p(Eo,{size:"custom",className:"yvlw-h-3"})]})]})})]})})})})}const $c=()=>{if(window.isAzureSdkLoading)return window.azureSdkLoadPromise;window.isAzureSdkLoading=!0;const e=new Promise((t,n)=>{let r=at.js.simd;try{WebAssembly.validate(new Uint8Array(qa))||(r=at.js.default)}catch{r=at.js.simd}window.Module=window.Module||{},window.Module.onRuntimeInitialized=()=>{t()},Object.assign(window.Module,{locateFile(i,s){if(i.includes("AzureAIVisionFace")&&i.endsWith(".wasm")){const a=i.includes("SIMD")?at.wasm.simd:at.wasm.default;return`${To}/${a}`}return`${s}${i}`}});const o=document.createElement("script");o.src=`${To}/${r}`,o.async=!0,o.onerror=()=>{n(new Error("Network error: Failed to load SDK script."))},document.head.appendChild(o)});return window.azureSdkLoadPromise=e,e};let qe=null;function Tc(){var K;const{toggleColorScheme:e,getColorScheme:t,setColorScheme:n}=Po(),{user:r,tasks:o,currentTaskIndex:i,completed:s,onComplete:a,onFailure:c,faceDetector:u,presentation:d,clearSavedPhoto:l}=fe(),[h,f]=x(!1),[v,g]=x(!1),[_,m]=x(null),[y,b]=x(!1),[E,T]=x(!1),[D,F]=x(0);W(()=>{const I=t();n(I)},[]);const{sandboxEnvironment:O,publicKey:M}=fe(),{fetchSessionToken:C}=ko(O),k=async()=>(qe||(qe=C({publicKey:M}).catch(I=>{throw qe=null,I})),qe),z=async()=>{try{f(!0),m(null),await a(),qe=null,d==="page"&&b(!0)}catch(I){m(I.message)}finally{f(!1)}},R=j(I=>I===i?oe.active:i>I?oe.completed:"subtext",[i]);return p("div",{className:oe.root,children:p("div",{className:oe.container,children:[p("div",{className:`${oe.lhs} divider`,children:[p("div",{className:oe.info,children:[p(ec,{}),p("div",{children:p("p",{className:"yvlw-text-xs yvlw-m-0 yvlw-p-0 subtext",children:"You have been given this set of tasks to complete. They are pretty easy to do but we will be guiding you every step of the way."})}),p("ol",{children:[o.map((I,V)=>p("li",{className:R(V),children:Ja[I.id].name},`task-${V}`)),p("li",{className:s?oe.active:"",children:"Complete! 🎉"})]})]}),p("footer",{className:"divider",children:[p("div",{children:"Powered by Youverify"}),p("div",{onClick:()=>e(),role:"button",children:[p("div",{className:"dark:yvlw-hidden",children:p(yo,{})}),p("div",{className:"yvlw-hidden dark:yvlw-block",children:p(Na,{})})]})]})]}),p("div",{className:oe.main,children:p("div",{className:oe.content,children:[p(pe,{show:!v,as:"div",leave:"yvlw-transform yvlw-transition yvlw-duration-300",leaveFrom:"yvlw-translate-y-0 yvlw-opacity-100",leaveTo:"yvlw--translate-y-full yvlw-opacity-0",enterFrom:"yvlw-translate-y-full yvlw-opacity-0",enterTo:"yvlw-translate-y-0 yvlw-opacity-100",className:"yvlw-h-full yvlw-w-full",children:p("div",{className:oe.completed,children:u?p(At,{Icon:Ia,title:"Liveness Check",description:"To ensure the security of your identity, we conduct a liveness check to verify that you are a real person actively engaging with the process. Please ensure to stay in a well lit area.",actionText:"Start Liveness Test",onActionClick:()=>g(!0)}):p(Io,{size:"lg"})})}),p(pe,{show:v&&!E,as:"div",leave:"yvlw-transform yvlw-transition yvlw-duration-300",leaveFrom:"yvlw-translate-y-0 yvlw-opacity-100",leaveTo:"yvlw--translate-y-full yvlw-opacity-0",enterFrom:"yvlw-translate-y-full yvlw-opacity-0",enterTo:"yvlw-translate-y-0 yvlw-opacity-100",className:"yvlw-h-full yvlw-w-full",children:p("div",{className:oe.completed,children:p(Ec,{fetchAzureSessionToken:k,loadAzureSdk:$c,onImageCaptured:I=>{m(null),I&&T(!0)},onError:I=>m(I),onReset:()=>{qe=null,T(!1),F(I=>I+1),l()},onFailure:c},D)})}),o.map((I,V)=>{let S;switch(I.id){case"complete-the-circle":S=p(sc,{...I});break;case"yes-or-no":S=p(uc,{...I});break;case"motions":S=p(pc,{...I});break;case"blink":S=p(mc,{...I});break;default:S=p(q,{});break}return p(pe,{show:v&&E&&!s&&i===V,appear:!0,as:"div",leave:"yvlw-transform yvlw-transition yvlw-duration-300",leaveFrom:"yvlw-translate-y-0 yvlw-opacity-100",leaveTo:"yvlw--translate-y-full yvlw-opacity-0",enterFrom:"yvlw-translate-y-full yvlw-opacity-0",enterTo:"yvlw-translate-y-0 yvlw-opacity-100",className:"yvlw-h-full",children:S},`task-${V}`)}),p(pe,{show:v&&s,as:"div",leave:"yvlw-transform yvlw-transition yvlw-duration-300",leaveFrom:"yvlw-translate-y-0 yvlw-opacity-100",leaveTo:"yvlw--translate-y-full yvlw-opacity-0",enterFrom:"yvlw-translate-y-full yvlw-opacity-0",enterTo:"yvlw-translate-y-0 yvlw-opacity-100",className:"yvlw-h-full yvlw-w-full",children:p("div",{className:oe.completed,children:p(At,{Icon:Ra,title:y?"All Set!":"Completed",description:y?"You can now close or exit the window":"Your Identity verification has been completed successfully. Thanks for your patience",actionText:"Finish",loading:h,onActionClick:z,hideButton:y,children:_&&p("div",{className:"yvlw-mt-3",children:_})})})})]})}),p("div",{className:`${oe.rhs} divider`,children:r&&p("div",{className:`${oe.profile} divider`,children:[p("div",{children:p("div",{className:oe.avatar,children:[r.firstName.charAt(0).toUpperCase(),(K=r.lastName)==null?void 0:K.charAt(0).toUpperCase()]})}),p("div",{children:[p("h4",{children:[r.firstName," ",r.lastName]}),r.email&&p("p",{className:"subtext",children:r.email})]})]})})]})})}function Cc(e){const{tasks:t,namespace:n,user:r,branding:o,onClose:i=()=>{},onSuccess:s,onFailure:a,presentation:c="modal",publicKey:u,metadata:d,sandboxEnvironment:l}=e,[h,f]=x(e.show),v=()=>{f(!1),i()};return p(Qa,{namespace:n,publicKey:u,tasks:t,user:r,branding:o,onRequestClose:v,onSuccess:s,onFailure:a,metadata:d,presentation:c,sandboxEnvironment:l,children:p(Pa,{id:n,open:c==="page"?!0:h,onClose:v,transition:!0,className:`${La.root} ${Lt.root} ${Lt[c]}`,style:{"--branding-color":(o==null?void 0:o.color)??ja},children:[c==="modal"&&p("div",{onClick:v,role:"button",className:Lt.close,children:p(Oa,{className:"yvlw-text-white"})}),p(go,{className:`${Lt.container}`,children:p(Tc,{})})]})})}class kc{constructor(t){this.tasks=[],this.container=null,this.namespace="liveness-web-sdk",this.loadedScripts=[];const{presentation:n="modal"}=t;this.presentation=n,this.props=t,t.tasks&&(this.tasks=t.tasks),n==="page"&&this.start()}validateOptions(){if(!this.tasks)throw new Error("Tasks cannot be empty");if(!this.props.publicKey)throw new Error("A Public Key is required");if(this.props.user&&!this.props.user.firstName)throw new Error("First Name is required when User object is supplied")}async start(t){t&&(this.tasks=t),this.validateOptions(),this.container=document.createElement("div"),document.body.appendChild(this.container),Ve(p(Cc,{namespace:this.namespace,publicKey:this.props.publicKey,sandboxEnvironment:this.props.sandboxEnvironment,presentation:this.props.presentation,show:!0,tasks:this.tasks,user:this.props.user,branding:this.props.branding,onClose:()=>this.close(),onSuccess:this.props.onSuccess,onFailure:this.props.onFailure,metadata:this.props.metadata}),this.container)}close(){if(this.container&&this.presentation!=="page"){if(!document.body.contains(this.container))return;document.body.removeChild(this.container),this.props.onClose&&this.props.onClose()}}}return kc});
|