youverify-liveness-web 0.1.13 → 0.1.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +1 -0
- package/dist/index.umd.cjs +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
package/dist/index.umd.cjs
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
(function(le,k){typeof exports=="object"&&typeof module<"u"?module.exports=k():typeof define=="function"&&define.amd?define(k):(le=typeof globalThis<"u"?globalThis:le||self,le.YouverifyLiveness=k())})(this,function(){"use strict";var le,k,xn,we,Fn,Sn,St,Mt,Pt,Nt,Mn,Ve={},Pn=[],xo=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,rt=Array.isArray;function ce(e,t){for(var n in t)e[n]=t[n];return e}function Nn(e){var t=e.parentNode;t&&t.removeChild(e)}function Q(e,t,n){var r,o,i,a={};for(i in t)i=="key"?r=t[i]:i=="ref"?o=t[i]:a[i]=t[i];if(arguments.length>2&&(a.children=arguments.length>3?le.call(arguments,2):n),typeof e=="function"&&e.defaultProps!=null)for(i in e.defaultProps)a[i]===void 0&&(a[i]=e.defaultProps[i]);return Ue(e,a,r,o,null)}function Ue(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??++xn,__i:-1,__u:0};return o==null&&k.vnode!=null&&k.vnode(i),i}function Lt(){return{current:null}}function H(e){return e.children}function J(e,t){this.props=e,this.context=t}function be(e,t){if(t==null)return e.__?be(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"?be(e):null}function Ln(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 Ln(e)}}function At(e){(!e.__d&&(e.__d=!0)&&we.push(e)&&!ot.__r++||Fn!==k.debounceRendering)&&((Fn=k.debounceRendering)||Sn)(ot)}function ot(){var e,t,n,r,o,i,a,s;for(we.sort(St);e=we.shift();)e.__d&&(t=we.length,r=void 0,i=(o=(n=e).__v).__e,a=[],s=[],n.__P&&((r=ce({},o)).__v=o.__v+1,k.vnode&&k.vnode(r),It(n.__P,r,o,n.__n,n.__P.namespaceURI,32&o.__u?[i]:null,a,i??be(o),!!(32&o.__u),s),r.__v=o.__v,r.__.__k[r.__i]=r,On(a,r,s),r.__e!=i&&Ln(r)),we.length>t&&we.sort(St));ot.__r=0}function An(e,t,n,r,o,i,a,s,l,u,d){var c,p,f,v,y,m=r&&r.__k||Pn,_=t.length;for(n.__d=l,Fo(n,t,m),l=n.__d,c=0;c<_;c++)(f=n.__k[c])!=null&&typeof f!="boolean"&&typeof f!="function"&&(p=f.__i===-1?Ve:m[f.__i]||Ve,f.__i=c,It(e,f,p,o,i,a,s,l,u,d),v=f.__e,f.ref&&p.ref!=f.ref&&(p.ref&&Ht(p.ref,null,f),d.push(f.ref,f.__c||v,f)),y==null&&v!=null&&(y=v),65536&f.__u||p.__k===f.__k?l=In(f,l,e):typeof f.type=="function"&&f.__d!==void 0?l=f.__d:v&&(l=v.nextSibling),f.__d=void 0,f.__u&=-196609);n.__d=l,n.__e=y}function Fo(e,t,n){var r,o,i,a,s,l=t.length,u=n.length,d=u,c=0;for(e.__k=[],r=0;r<l;r++)a=r+c,(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?Ue(null,o,null,null,null):rt(o)?Ue(H,{children:o},null,null,null):o.constructor===void 0&&o.__b>0?Ue(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):o)!=null?(o.__=e,o.__b=e.__b+1,s=So(o,n,a,d),o.__i=s,i=null,s!==-1&&(d--,(i=n[s])&&(i.__u|=131072)),i==null||i.__v===null?(s==-1&&c--,typeof o.type!="function"&&(o.__u|=65536)):s!==a&&(s==a-1?c=s-a:s==a+1?c++:s>a?d>l-a?c+=s-a:c--:s<a&&c++,s!==r+c&&(o.__u|=65536))):(i=n[a])&&i.key==null&&i.__e&&!(131072&i.__u)&&(i.__e==e.__d&&(e.__d=be(i)),Dt(i,i,!1),n[a]=null,d--);if(d)for(r=0;r<u;r++)(i=n[r])!=null&&!(131072&i.__u)&&(i.__e==e.__d&&(e.__d=be(i)),Dt(i,i))}function In(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=In(r[o],t,n));return t}e.__e!=t&&(t&&e.type&&!n.contains(t)&&(t=be(e)),n.insertBefore(e.__e,t||null),t=e.__e);do t=t&&t.nextSibling;while(t!=null&&t.nodeType===8);return t}function ue(e,t){return t=t||[],e==null||typeof e=="boolean"||(rt(e)?e.some(function(n){ue(n,t)}):t.push(e)),t}function So(e,t,n,r){var o=e.key,i=e.type,a=n-1,s=n+1,l=t[n];if(l===null||l&&o==l.key&&i===l.type&&!(131072&l.__u))return n;if(r>(l!=null&&!(131072&l.__u)?1:0))for(;a>=0||s<t.length;){if(a>=0){if((l=t[a])&&!(131072&l.__u)&&o==l.key&&i===l.type)return a;a--}if(s<t.length){if((l=t[s])&&!(131072&l.__u)&&o==l.key&&i===l.type)return s;s++}}return-1}function Hn(e,t,n){t[0]==="-"?e.setProperty(t,n??""):e[t]=n==null?"":typeof n!="number"||xo.test(t)?n:n+"px"}function it(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||Hn(e.style,t,"");if(n)for(t in n)r&&n[t]===r[t]||Hn(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=Mt,e.addEventListener(t,i?Nt:Pt,i)):e.removeEventListener(t,i?Nt:Pt,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 Dn(e){return function(t){if(this.l){var n=this.l[t.type+e];if(t.t==null)t.t=Mt++;else if(t.t<n.u)return;return n(k.event?k.event(t):t)}}}function It(e,t,n,r,o,i,a,s,l,u){var d,c,p,f,v,y,m,_,w,b,C,E,P,R,V,W,$=t.type;if(t.constructor!==void 0)return null;128&n.__u&&(l=!!(32&n.__u),i=[s=t.__e=n.__e]),(d=k.__b)&&d(t);e:if(typeof $=="function")try{if(_=t.props,w="prototype"in $&&$.prototype.render,b=(d=$.contextType)&&r[d.__c],C=d?b?b.props.value:d.__:r,n.__c?m=(c=t.__c=n.__c).__=c.__E:(w?t.__c=c=new $(_,C):(t.__c=c=new J(_,C),c.constructor=$,c.render=Po),b&&b.sub(c),c.props=_,c.state||(c.state={}),c.context=C,c.__n=r,p=c.__d=!0,c.__h=[],c._sb=[]),w&&c.__s==null&&(c.__s=c.state),w&&$.getDerivedStateFromProps!=null&&(c.__s==c.state&&(c.__s=ce({},c.__s)),ce(c.__s,$.getDerivedStateFromProps(_,c.__s))),f=c.props,v=c.state,c.__v=t,p)w&&$.getDerivedStateFromProps==null&&c.componentWillMount!=null&&c.componentWillMount(),w&&c.componentDidMount!=null&&c.__h.push(c.componentDidMount);else{if(w&&$.getDerivedStateFromProps==null&&_!==f&&c.componentWillReceiveProps!=null&&c.componentWillReceiveProps(_,C),!c.__e&&(c.shouldComponentUpdate!=null&&c.shouldComponentUpdate(_,c.__s,C)===!1||t.__v===n.__v)){for(t.__v!==n.__v&&(c.props=_,c.state=c.__s,c.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.forEach(function(x){x&&(x.__=t)}),E=0;E<c._sb.length;E++)c.__h.push(c._sb[E]);c._sb=[],c.__h.length&&a.push(c);break e}c.componentWillUpdate!=null&&c.componentWillUpdate(_,c.__s,C),w&&c.componentDidUpdate!=null&&c.__h.push(function(){c.componentDidUpdate(f,v,y)})}if(c.context=C,c.props=_,c.__P=e,c.__e=!1,P=k.__r,R=0,w){for(c.state=c.__s,c.__d=!1,P&&P(t),d=c.render(c.props,c.state,c.context),V=0;V<c._sb.length;V++)c.__h.push(c._sb[V]);c._sb=[]}else do c.__d=!1,P&&P(t),d=c.render(c.props,c.state,c.context),c.state=c.__s;while(c.__d&&++R<25);c.state=c.__s,c.getChildContext!=null&&(r=ce(ce({},r),c.getChildContext())),w&&!p&&c.getSnapshotBeforeUpdate!=null&&(y=c.getSnapshotBeforeUpdate(f,v)),An(e,rt(W=d!=null&&d.type===H&&d.key==null?d.props.children:d)?W:[W],t,n,r,o,i,a,s,l,u),c.base=t.__e,t.__u&=-161,c.__h.length&&a.push(c),m&&(c.__E=c.__=null)}catch(x){if(t.__v=null,l||i!=null){for(t.__u|=l?160:32;s&&s.nodeType===8&&s.nextSibling;)s=s.nextSibling;i[i.indexOf(s)]=null,t.__e=s}else t.__e=n.__e,t.__k=n.__k;k.__e(x,t,n)}else i==null&&t.__v===n.__v?(t.__k=n.__k,t.__e=n.__e):t.__e=Mo(n.__e,t,n,r,o,i,a,l,u);(d=k.diffed)&&d(t)}function On(e,t,n){t.__d=void 0;for(var r=0;r<n.length;r++)Ht(n[r],n[++r],n[++r]);k.__c&&k.__c(t,e),e.some(function(o){try{e=o.__h,o.__h=[],e.some(function(i){i.call(o)})}catch(i){k.__e(i,o.__v)}})}function Mo(e,t,n,r,o,i,a,s,l){var u,d,c,p,f,v,y,m=n.props,_=t.props,w=t.type;if(w==="svg"?o="http://www.w3.org/2000/svg":w==="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==!!w&&(w?f.localName===w:f.nodeType===3)){e=f,i[u]=null;break}}if(e==null){if(w===null)return document.createTextNode(_);e=document.createElementNS(o,w,_.is&&_),i=null,s=!1}if(w===null)m===_||s&&e.data===_||(e.data=_);else{if(i=i&&le.call(e.childNodes),m=n.props||Ve,!s&&i!=null)for(m={},u=0;u<e.attributes.length;u++)m[(f=e.attributes[u]).name]=f.value;for(u in m)if(f=m[u],u!="children"){if(u=="dangerouslySetInnerHTML")c=f;else if(u!=="key"&&!(u in _)){if(u=="value"&&"defaultValue"in _||u=="checked"&&"defaultChecked"in _)continue;it(e,u,null,f,o)}}for(u in _)f=_[u],u=="children"?p=f:u=="dangerouslySetInnerHTML"?d=f:u=="value"?v=f:u=="checked"?y=f:u==="key"||s&&typeof f!="function"||m[u]===f||it(e,u,f,m[u],o);if(d)s||c&&(d.__html===c.__html||d.__html===e.innerHTML)||(e.innerHTML=d.__html),t.__k=[];else if(c&&(e.innerHTML=""),An(e,rt(p)?p:[p],t,n,r,w==="foreignObject"?"http://www.w3.org/1999/xhtml":o,i,a,i?i[0]:n.__k&&be(n,0),s,l),i!=null)for(u=i.length;u--;)i[u]!=null&&Nn(i[u]);s||(u="value",v!==void 0&&(v!==e[u]||w==="progress"&&!v||w==="option"&&v!==m[u])&&it(e,u,v,m[u],o),u="checked",y!==void 0&&y!==e[u]&&it(e,u,y,m[u],o))}return e}function Ht(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){k.__e(o,n)}}function Dt(e,t,n){var r,o;if(k.unmount&&k.unmount(e),(r=e.ref)&&(r.current&&r.current!==e.__e||Ht(r,null,t)),(r=e.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(i){k.__e(i,t)}r.base=r.__P=null}if(r=e.__k)for(o=0;o<r.length;o++)r[o]&&Dt(r[o],t,n||typeof e.type!="function");n||e.__e==null||Nn(e.__e),e.__c=e.__=e.__e=e.__d=void 0}function Po(e,t,n){return this.constructor(e,n)}function Le(e,t,n){var r,o,i,a;k.__&&k.__(e,t),o=(r=typeof n=="function")?null:n&&n.__k||t.__k,i=[],a=[],It(t,e=(!r&&n||t).__k=Q(H,null,[e]),o||Ve,Ve,t.namespaceURI,!r&&n?[n]:o?null:t.firstChild?le.call(t.childNodes):null,i,!r&&n?n:o?o.__e:t.firstChild,r,a),On(i,e,a)}function Rn(e,t){Le(e,t,Rn)}function No(e,t,n){var r,o,i,a,s=ce({},e.props);for(i in e.type&&e.type.defaultProps&&(a=e.type.defaultProps),t)i=="key"?r=t[i]:i=="ref"?o=t[i]:s[i]=t[i]===void 0&&a!==void 0?a[i]:t[i];return arguments.length>2&&(s.children=arguments.length>3?le.call(arguments,2):n),Ue(e.type,s,r||e.key,o||e.ref,null)}function Y(e,t){var n={__c:t="__cC"+Mn++,__: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(a){this.props.value!==a.value&&o.some(function(s){s.__e=!0,At(s)})},this.sub=function(a){o.push(a);var s=a.componentWillUnmount;a.componentWillUnmount=function(){o&&o.splice(o.indexOf(a),1),s&&s.call(a)}}),r.children}};return n.Provider.__=n.Consumer.contextType=n}le=Pn.slice,k={__e:function(e,t,n,r){for(var o,i,a;t=t.__;)if((o=t.__c)&&!o.__)try{if((i=o.constructor)&&i.getDerivedStateFromError!=null&&(o.setState(i.getDerivedStateFromError(e)),a=o.__d),o.componentDidCatch!=null&&(o.componentDidCatch(e,r||{}),a=o.__d),a)return o.__E=o}catch(s){e=s}throw e}},xn=0,J.prototype.setState=function(e,t){var n;n=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=ce({},this.state),typeof e=="function"&&(e=e(ce({},n),this.props)),e&&ce(n,e),e!=null&&this.__v&&(t&&this._sb.push(t),At(this))},J.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),At(this))},J.prototype.render=H,we=[],Sn=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,St=function(e,t){return e.__v.__b-t.__v.__b},ot.__r=0,Mt=0,Pt=Dn(!1),Nt=Dn(!0),Mn=0;var Lo=0;function h(e,t,n,r,o,i){t||(t={});var a,s,l=t;if("ref"in l)for(s in l={},t)s=="ref"?a=t[s]:l[s]=t[s];var u={type:e,props:l,key:n,ref:a,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:--Lo,__i:-1,__u:0,__source:o,__self:i};if(typeof e=="function"&&(a=e.defaultProps))for(s in a)l[s]===void 0&&(l[s]=a[s]);return k.vnode&&k.vnode(u),u}var de,L,Ot,Vn,Ae=0,Un=[],O=k,Wn=O.__b,zn=O.__r,jn=O.diffed,Bn=O.__c,qn=O.unmount,Yn=O.__;function $e(e,t){O.__h&&O.__h(L,e,Ae||t),Ae=0;var n=L.__H||(L.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function F(e){return Ae=1,We(Gn,e)}function We(e,t,n){var r=$e(de++,2);if(r.t=e,!r.__c&&(r.__=[n?n(t):Gn(void 0,t),function(s){var l=r.__N?r.__N[0]:r.__[0],u=r.t(l,s);l!==u&&(r.__N=[u,r.__[1]],r.__c.setState({}))}],r.__c=L,!L.u)){var o=function(s,l,u){if(!r.__c.__H)return!0;var d=r.__c.__H.__.filter(function(p){return!!p.__c});if(d.every(function(p){return!p.__N}))return!i||i.call(this,s,l,u);var c=!1;return d.forEach(function(p){if(p.__N){var f=p.__[0];p.__=p.__N,p.__N=void 0,f!==p.__[0]&&(c=!0)}}),!(!c&&r.__c.props===s)&&(!i||i.call(this,s,l,u))};L.u=!0;var i=L.shouldComponentUpdate,a=L.componentWillUpdate;L.componentWillUpdate=function(s,l,u){if(this.__e){var d=i;i=void 0,o(s,l,u),i=d}a&&a.call(this,s,l,u)},L.shouldComponentUpdate=o}return r.__N||r.__}function N(e,t){var n=$e(de++,3);!O.__s&&Wt(n.__H,t)&&(n.__=e,n.i=t,L.__H.__h.push(n))}function Ee(e,t){var n=$e(de++,4);!O.__s&&Wt(n.__H,t)&&(n.__=e,n.i=t,L.__h.push(n))}function g(e){return Ae=5,M(function(){return{current:e}},[])}function Rt(e,t,n){Ae=6,Ee(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 M(e,t){var n=$e(de++,7);return Wt(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function A(e,t){return Ae=8,M(function(){return e},t)}function j(e){var t=L.context[e.__c],n=$e(de++,9);return n.c=e,t?(n.__==null&&(n.__=!0,t.sub(L)),t.props.value):e.__}function Vt(e,t){O.useDebugValue&&O.useDebugValue(t?t(e):e)}function Ao(e){var t=$e(de++,10),n=F();return t.__=e,L.componentDidCatch||(L.componentDidCatch=function(r,o){t.__&&t.__(r,o),n[1](r)}),[n[0],function(){n[1](void 0)}]}function he(){var e=$e(de++,11);if(!e.__){for(var t=L.__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 Io(){for(var e;e=Un.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(at),e.__H.__h.forEach(Ut),e.__H.__h=[]}catch(t){e.__H.__h=[],O.__e(t,e.__v)}}O.__b=function(e){L=null,Wn&&Wn(e)},O.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),Yn&&Yn(e,t)},O.__r=function(e){zn&&zn(e),de=0;var t=(L=e.__c).__H;t&&(Ot===L?(t.__h=[],L.__h=[],t.__.forEach(function(n){n.__N&&(n.__=n.__N),n.i=n.__N=void 0})):(t.__h.forEach(at),t.__h.forEach(Ut),t.__h=[],de=0)),Ot=L},O.diffed=function(e){jn&&jn(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(Un.push(t)!==1&&Vn===O.requestAnimationFrame||((Vn=O.requestAnimationFrame)||Ho)(Io)),t.__H.__.forEach(function(n){n.i&&(n.__H=n.i),n.i=void 0})),Ot=L=null},O.__c=function(e,t){t.some(function(n){try{n.__h.forEach(at),n.__h=n.__h.filter(function(r){return!r.__||Ut(r)})}catch(r){t.some(function(o){o.__h&&(o.__h=[])}),t=[],O.__e(r,n.__v)}}),Bn&&Bn(e,t)},O.unmount=function(e){qn&&qn(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach(function(r){try{at(r)}catch(o){t=o}}),n.__H=void 0,t&&O.__e(t,n.__v))};var Kn=typeof requestAnimationFrame=="function";function Ho(e){var t,n=function(){clearTimeout(r),Kn&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,100);Kn&&(t=requestAnimationFrame(n))}function at(e){var t=L,n=e.__c;typeof n=="function"&&(e.__c=void 0,n()),L=t}function Ut(e){var t=L;e.__c=e.__(),L=t}function Wt(e,t){return!e||e.length!==t.length||t.some(function(n,r){return n!==e[r]})}function Gn(e,t){return typeof t=="function"?t(e):t}function Zn(e,t){for(var n in t)e[n]=t[n];return e}function zt(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 st(e,t){this.props=e,this.context=t}function Xn(e,t){function n(o){var i=this.props.ref,a=i==o.ref;return!a&&i&&(i.call?i(null):i.current=null),t?!t(this.props,o)||!a:zt(this.props,o)}function r(o){return this.shouldComponentUpdate=n,Q(e,o)}return r.displayName="Memo("+(e.displayName||e.name)+")",r.prototype.isReactComponent=!0,r.__f=!0,r}(st.prototype=new J).isPureReactComponent=!0,st.prototype.shouldComponentUpdate=function(e,t){return zt(this.props,e)||zt(this.state,t)};var Qn=k.__b;k.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),Qn&&Qn(e)};var Do=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.forward_ref")||3911;function jt(e){function t(n){var r=Zn({},n);return delete r.ref,e(r,n.ref||null)}return t.$$typeof=Do,t.render=t,t.prototype.isReactComponent=t.__f=!0,t.displayName="ForwardRef("+(e.displayName||e.name)+")",t}var Jn=function(e,t){return e==null?null:ue(ue(e).map(t))},er={map:Jn,forEach:Jn,count:function(e){return e?ue(e).length:0},only:function(e){var t=ue(e);if(t.length!==1)throw"Children.only";return t[0]},toArray:ue},Oo=k.__e;k.__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)}Oo(e,t,n,r)};var tr=k.unmount;function nr(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=Zn({},e)).__c!=null&&(e.__c.__P===n&&(e.__c.__P=t),e.__c=null),e.__k=e.__k&&e.__k.map(function(r){return nr(r,t,n)})),e}function rr(e,t,n){return e&&n&&(e.__v=null,e.__k=e.__k&&e.__k.map(function(r){return rr(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 ze(){this.__u=0,this.t=null,this.__b=null}function or(e){var t=e.__.__c;return t&&t.__a&&t.__a(e)}function ir(e){var t,n,r;function o(i){if(t||(t=e()).then(function(a){n=a.default||a},function(a){r=a}),r)throw r;if(!n)throw t;return Q(n,i)}return o.displayName="Lazy",o.__f=!0,o}function Ie(){this.u=null,this.o=null}k.unmount=function(e){var t=e.__c;t&&t.__R&&t.__R(),t&&32&e.__u&&(e.type=null),tr&&tr(e)},(ze.prototype=new J).__c=function(e,t){var n=t.__c,r=this;r.t==null&&(r.t=[]),r.t.push(n);var o=or(r.__v),i=!1,a=function(){i||(i=!0,n.__R=null,o?o(s):s())};n.__R=a;var s=function(){if(!--r.__u){if(r.state.__a){var l=r.state.__a;r.__v.__k[0]=rr(l,l.__c.__P,l.__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(a,a)},ze.prototype.componentWillUnmount=function(){this.t=[]},ze.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]=nr(this.__b,n,r.__O=r.__P)}this.__b=null}var o=t.__a&&Q(H,null,e.fallback);return o&&(o.__u&=-33),[Q(H,null,t.__a?null:e.children),o]};var ar=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 Ro(e){return this.getChildContext=function(){return e.context},e.children}function Vo(e){var t=this,n=e.i;t.componentWillUnmount=function(){Le(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)}}),Le(Q(Ro,{context:t.context},e.__v),t.l)}function lt(e,t){var n=Q(Vo,{__v:e,i:t});return n.containerInfo=t,n}(Ie.prototype=new J).__a=function(e){var t=this,n=or(t.__v),r=t.o.get(e);return r[0]++,function(o){var i=function(){t.props.revealOrder?(r.push(o),ar(t,e,r)):o()};n?n(i):i()}},Ie.prototype.render=function(e){this.u=null,this.o=new Map;var t=ue(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},Ie.prototype.componentDidUpdate=Ie.prototype.componentDidMount=function(){var e=this;this.o.forEach(function(t,n){ar(e,n,t)})};var sr=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.element")||60103,Uo=/^(?: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]/,Wo=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,zo=/[A-Z0-9]/g,jo=typeof document<"u",Bo=function(e){return(typeof Symbol<"u"&&typeof Symbol()=="symbol"?/fil|che|rad/:/fil|che|ra/).test(e)};function lr(e,t,n){return t.__k==null&&(t.textContent=""),Le(e,t),typeof n=="function"&&n(),e?e.__c:null}function cr(e,t,n){return Rn(e,t),typeof n=="function"&&n(),e?e.__c:null}J.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(e){Object.defineProperty(J.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})});var ur=k.event;function qo(){}function Yo(){return this.cancelBubble}function Ko(){return this.defaultPrevented}k.event=function(e){return ur&&(e=ur(e)),e.persist=qo,e.isPropagationStopped=Yo,e.isDefaultPrevented=Ko,e.nativeEvent=e};var Bt,Go={enumerable:!1,configurable:!0,get:function(){return this.class}},dr=k.vnode;k.vnode=function(e){typeof e.type=="string"&&function(t){var n=t.props,r=t.type,o={};for(var i in n){var a=n[i];if(!(i==="value"&&"defaultValue"in n&&a==null||jo&&i==="children"&&r==="noscript"||i==="class"||i==="className")){var s=i.toLowerCase();i==="defaultValue"&&"value"in n&&n.value==null?i="value":i==="download"&&a===!0?a="":s==="translate"&&a==="no"?a=!1:s==="ondoubleclick"?i="ondblclick":s!=="onchange"||r!=="input"&&r!=="textarea"||Bo(n.type)?s==="onfocus"?i="onfocusin":s==="onblur"?i="onfocusout":Wo.test(i)?i=s:r.indexOf("-")===-1&&Uo.test(i)?i=i.replace(zo,"-$&").toLowerCase():a===null&&(a=void 0):s=i="oninput",s==="oninput"&&o[i=s]&&(i="oninputCapture"),o[i]=a}}r=="select"&&o.multiple&&Array.isArray(o.value)&&(o.value=ue(n.children).forEach(function(l){l.props.selected=o.value.indexOf(l.props.value)!=-1})),r=="select"&&o.defaultValue!=null&&(o.value=ue(n.children).forEach(function(l){l.props.selected=o.multiple?o.defaultValue.indexOf(l.props.value)!=-1:o.defaultValue==l.props.value})),n.class&&!n.className?(o.class=n.class,Object.defineProperty(o,"className",Go)):(n.className&&!n.class||n.class&&n.className)&&(o.class=o.className=n.className),t.props=o}(e),e.$$typeof=sr,dr&&dr(e)};var fr=k.__r;k.__r=function(e){fr&&fr(e),Bt=e.__c};var pr=k.diffed;k.diffed=function(e){pr&&pr(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),Bt=null};var hr={ReactCurrentDispatcher:{current:{readContext:function(e){return Bt.__n[e.__c].props.value},useCallback:A,useContext:j,useDebugValue:Vt,useDeferredValue:Kt,useEffect:N,useId:he,useImperativeHandle:Rt,useInsertionEffect:Zt,useLayoutEffect:Ee,useMemo:M,useReducer:We,useRef:g,useState:F,useSyncExternalStore:ct,useTransition:Gt}}},Zo="17.0.2";function _r(e){return Q.bind(null,e)}function He(e){return!!e&&e.$$typeof===sr}function vr(e){return He(e)&&e.type===H}function mr(e){return!!e&&!!e.displayName&&(typeof e.displayName=="string"||e.displayName instanceof String)&&e.displayName.startsWith("Memo(")}function qt(e){return He(e)?No.apply(null,arguments):e}function yr(e){return!!e.__k&&(Le(null,e),!0)}function gr(e){return e&&(e.base||e.nodeType===1&&e)||null}var wr=function(e,t){return e(t)},br=function(e,t){return e(t)},$r=H;function Yt(e){e()}function Kt(e){return e}function Gt(){return[!1,Yt]}var Zt=Ee,Er=He;function ct(e,t){var n=t(),r=F({h:{__:n,v:t}}),o=r[0].h,i=r[1];return Ee(function(){o.__=n,o.v=t,Xt(o)&&i({h:o})},[e,n,t]),N(function(){return Xt(o)&&i({h:o}),e(function(){Xt(o)&&i({h:o})})},[e]),n}function Xt(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 T={useState:F,useId:he,useReducer:We,useEffect:N,useLayoutEffect:Ee,useInsertionEffect:Zt,useTransition:Gt,useDeferredValue:Kt,useSyncExternalStore:ct,startTransition:Yt,useRef:g,useImperativeHandle:Rt,useMemo:M,useCallback:A,useContext:j,useDebugValue:Vt,version:"17.0.2",Children:er,render:lr,hydrate:cr,unmountComponentAtNode:yr,createPortal:lt,createElement:Q,createContext:Y,createFactory:_r,cloneElement:qt,createRef:Lt,Fragment:H,isValidElement:He,isElement:Er,isFragment:vr,isMemo:mr,findDOMNode:gr,Component:J,PureComponent:st,memo:Xn,forwardRef:jt,flushSync:br,unstable_batchedUpdates:wr,StrictMode:$r,Suspense:ze,SuspenseList:Ie,lazy:ir,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:hr};const Tr=Object.freeze(Object.defineProperty({__proto__:null,Children:er,Component:J,Fragment:H,PureComponent:st,StrictMode:$r,Suspense:ze,SuspenseList:Ie,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:hr,cloneElement:qt,createContext:Y,createElement:Q,createFactory:_r,createPortal:lt,createRef:Lt,default:T,findDOMNode:gr,flushSync:br,forwardRef:jt,hydrate:cr,isElement:Er,isFragment:vr,isMemo:mr,isValidElement:He,lazy:ir,memo:Xn,render:lr,startTransition:Yt,unmountComponentAtNode:yr,unstable_batchedUpdates:wr,useCallback:A,useContext:j,useDebugValue:Vt,useDeferredValue:Kt,useEffect:N,useErrorBoundary:Ao,useId:he,useImperativeHandle:Rt,useInsertionEffect:Zt,useLayoutEffect:Ee,useMemo:M,useReducer:We,useRef:g,useState:F,useSyncExternalStore:ct,useTransition:Gt,version:Zo},Symbol.toStringTag,{value:"Module"})),Cr=typeof document<"u"?T.useLayoutEffect:()=>{};function Xo(e){const t=g(null);return Cr(()=>{t.current=e},[e]),A((...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},Te=e=>e&&"window"in e&&e.window===e?e:je(e).defaultView||window;function Qo(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 Jo(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 ei(){return Jo(/^Mac/i)}function ti(){return Qo(/Android/i)}function ni(e){return e.mozInputSource===0&&e.isTrusted?!0:ti()&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}class ri{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 kr(e){let t=g({isFocused:!1,observer:null});Cr(()=>{const r=t.current;return()=>{r.observer&&(r.observer.disconnect(),r.observer=null)}},[]);let n=Xo(r=>{e==null||e(r)});return A(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=a=>{t.current.isFocused=!1,o.disabled&&n(new ri("blur",a)),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 a;(a=t.current.observer)===null||a===void 0||a.disconnect();let s=o===document.activeElement?null:document.activeElement;o.dispatchEvent(new FocusEvent("blur",{relatedTarget:s})),o.dispatchEvent(new FocusEvent("focusout",{bubbles:!0,relatedTarget:s}))}}),t.current.observer.observe(o,{attributes:!0,attributeFilter:["disabled"]})}},[n])}function oi(e){let{isDisabled:t,onFocus:n,onBlur:r,onFocusChange:o}=e;const i=A(l=>{if(l.target===l.currentTarget)return r&&r(l),o&&o(!1),!0},[r,o]),a=kr(i),s=A(l=>{const u=je(l.target);l.target===l.currentTarget&&u.activeElement===l.target&&(n&&n(l),o&&o(!0),a(l))},[o,n,a]);return{focusProps:{onFocus:!t&&(n||o||r)?s:void 0,onBlur:!t&&(r||o)?i:void 0}}}let Be=null,Qt=new Set,qe=new Map,Ce=!1,Jt=!1;const ii={Tab:!0,Escape:!0};function en(e,t){for(let n of Qt)n(e,t)}function ai(e){return!(e.metaKey||!ei()&&e.altKey||e.ctrlKey||e.key==="Control"||e.key==="Shift"||e.key==="Meta")}function ut(e){Ce=!0,ai(e)&&(Be="keyboard",en("keyboard",e))}function Z(e){Be="pointer",(e.type==="mousedown"||e.type==="pointerdown")&&(Ce=!0,en("pointer",e))}function xr(e){ni(e)&&(Ce=!0,Be="virtual")}function Fr(e){e.target===window||e.target===document||(!Ce&&!Jt&&(Be="virtual",en("virtual",e)),Ce=!1,Jt=!1)}function Sr(){Ce=!1,Jt=!0}function tn(e){if(typeof window>"u"||qe.get(Te(e)))return;const t=Te(e),n=je(e);let r=t.HTMLElement.prototype.focus;t.HTMLElement.prototype.focus=function(){Ce=!0,r.apply(this,arguments)},n.addEventListener("keydown",ut,!0),n.addEventListener("keyup",ut,!0),n.addEventListener("click",xr,!0),t.addEventListener("focus",Fr,!0),t.addEventListener("blur",Sr,!1),typeof PointerEvent<"u"?(n.addEventListener("pointerdown",Z,!0),n.addEventListener("pointermove",Z,!0),n.addEventListener("pointerup",Z,!0)):(n.addEventListener("mousedown",Z,!0),n.addEventListener("mousemove",Z,!0),n.addEventListener("mouseup",Z,!0)),t.addEventListener("beforeunload",()=>{Mr(e)},{once:!0}),qe.set(t,{focus:r})}const Mr=(e,t)=>{const n=Te(e),r=je(e);t&&r.removeEventListener("DOMContentLoaded",t),qe.has(n)&&(n.HTMLElement.prototype.focus=qe.get(n).focus,r.removeEventListener("keydown",ut,!0),r.removeEventListener("keyup",ut,!0),r.removeEventListener("click",xr,!0),n.removeEventListener("focus",Fr,!0),n.removeEventListener("blur",Sr,!1),typeof PointerEvent<"u"?(r.removeEventListener("pointerdown",Z,!0),r.removeEventListener("pointermove",Z,!0),r.removeEventListener("pointerup",Z,!0)):(r.removeEventListener("mousedown",Z,!0),r.removeEventListener("mousemove",Z,!0),r.removeEventListener("mouseup",Z,!0)),qe.delete(n))};function si(e){const t=je(e);let n;return t.readyState!=="loading"?tn(e):(n=()=>{tn(e)},t.addEventListener("DOMContentLoaded",n)),()=>Mr(e,n)}typeof document<"u"&&si();function Pr(){return Be!=="pointer"}const li=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);function ci(e,t,n){var r;const o=typeof window<"u"?Te(n==null?void 0:n.target).HTMLInputElement:HTMLInputElement,i=typeof window<"u"?Te(n==null?void 0:n.target).HTMLTextAreaElement:HTMLTextAreaElement,a=typeof window<"u"?Te(n==null?void 0:n.target).HTMLElement:HTMLElement,s=typeof window<"u"?Te(n==null?void 0:n.target).KeyboardEvent:KeyboardEvent;return e=e||(n==null?void 0:n.target)instanceof o&&!li.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 a&&(n==null?void 0:n.target.isContentEditable),!(e&&t==="keyboard"&&n instanceof s&&!ii[n.key])}function ui(e,t,n){tn(),N(()=>{let r=(o,i)=>{ci(!!(n!=null&&n.isTextInput),o,i)&&e(Pr())};return Qt.add(r),()=>{Qt.delete(r)}},t)}function di(e){let{isDisabled:t,onBlurWithin:n,onFocusWithin:r,onFocusWithinChange:o}=e,i=g({isFocusWithin:!1}),a=A(u=>{i.current.isFocusWithin&&!u.currentTarget.contains(u.relatedTarget)&&(i.current.isFocusWithin=!1,n&&n(u),o&&o(!1))},[n,o,i]),s=kr(a),l=A(u=>{!i.current.isFocusWithin&&document.activeElement===u.target&&(r&&r(u),o&&o(!0),i.current.isFocusWithin=!0,s(u))},[r,o,s]);return t?{focusWithinProps:{onFocus:void 0,onBlur:void 0}}:{focusWithinProps:{onFocus:l,onBlur:a}}}let dt=!1,nn=0;function rn(){dt=!0,setTimeout(()=>{dt=!1},50)}function Nr(e){e.pointerType==="touch"&&rn()}function fi(){if(!(typeof document>"u"))return typeof PointerEvent<"u"?document.addEventListener("pointerup",Nr):document.addEventListener("touchend",rn),nn++,()=>{nn--,!(nn>0)&&(typeof PointerEvent<"u"?document.removeEventListener("pointerup",Nr):document.removeEventListener("touchend",rn))}}function pi(e){let{onHoverStart:t,onHoverChange:n,onHoverEnd:r,isDisabled:o}=e,[i,a]=F(!1),s=g({isHovered:!1,ignoreEmulatedMouseEvents:!1,pointerType:"",target:null}).current;N(fi,[]);let{hoverProps:l,triggerHoverEnd:u}=M(()=>{let d=(f,v)=>{if(s.pointerType=v,o||v==="touch"||s.isHovered||!f.currentTarget.contains(f.target))return;s.isHovered=!0;let y=f.currentTarget;s.target=y,t&&t({type:"hoverstart",target:y,pointerType:v}),n&&n(!0),a(!0)},c=(f,v)=>{if(s.pointerType="",s.target=null,v==="touch"||!s.isHovered)return;s.isHovered=!1;let y=f.currentTarget;r&&r({type:"hoverend",target:y,pointerType:v}),n&&n(!1),a(!1)},p={};return typeof PointerEvent<"u"?(p.onPointerEnter=f=>{dt&&f.pointerType==="mouse"||d(f,f.pointerType)},p.onPointerLeave=f=>{!o&&f.currentTarget.contains(f.target)&&c(f,f.pointerType)}):(p.onTouchStart=()=>{s.ignoreEmulatedMouseEvents=!0},p.onMouseEnter=f=>{!s.ignoreEmulatedMouseEvents&&!dt&&d(f,"mouse"),s.ignoreEmulatedMouseEvents=!1},p.onMouseLeave=f=>{!o&&f.currentTarget.contains(f.target)&&c(f,"mouse")}),{hoverProps:p,triggerHoverEnd:c}},[t,n,r,o,s]);return N(()=>{o&&u({currentTarget:s.target},s.pointerType)},[o]),{hoverProps:l,isHovered:i}}function hi(e={}){let{autoFocus:t=!1,isTextInput:n,within:r}=e,o=g({isFocused:!1,isFocusVisible:t||Pr()}),[i,a]=F(!1),[s,l]=F(()=>o.current.isFocused&&o.current.isFocusVisible),u=A(()=>l(o.current.isFocused&&o.current.isFocusVisible),[]),d=A(f=>{o.current.isFocused=f,a(f),u()},[u]);ui(f=>{o.current.isFocusVisible=f,u()},[],{isTextInput:n});let{focusProps:c}=oi({isDisabled:r,onFocusChange:d}),{focusWithinProps:p}=di({isDisabled:!r,onFocusWithinChange:d});return{isFocused:i,isFocusVisible:s,focusProps:r?p:c}}var _i=Object.defineProperty,vi=(e,t,n)=>t in e?_i(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,on=(e,t,n)=>(vi(e,typeof t!="symbol"?t+"":t,n),n);let mi=class{constructor(){on(this,"current",this.detect()),on(this,"handoffState","pending"),on(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"}},ke=new mi;function ft(e){return ke.isServer?null:e instanceof Node?e.ownerDocument:e!=null&&e.hasOwnProperty("current")&&e.current instanceof Node?e.current.ownerDocument:document}function pt(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 pt(()=>{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 ht(){let[e]=F(_e);return N(()=>()=>e.dispose(),[e]),e}let B=(e,t)=>{ke.isServer?N(e,t):Ee(e,t)};function xe(e){let t=g(e);return B(()=>{t.current=e},[e]),t}let D=function(e){let t=xe(e);return T.useCallback((...n)=>t.current(...n),[t])};function yi(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 gi(e,t){return!(!e||!t||e.right<t.left||e.left>t.right||e.bottom<t.top||e.top>t.bottom)}function wi({disabled:e=!1}={}){let t=g(null),[n,r]=F(!1),o=ht(),i=D(()=>{t.current=null,r(!1),o.dispose()}),a=D(s=>{if(o.dispose(),t.current===null){t.current=s.currentTarget,r(!0);{let l=ft(s.currentTarget);o.addEventListener(l,"pointerup",i,!1),o.addEventListener(l,"pointermove",u=>{if(t.current){let d=yi(u);r(gi(d,t.current.getBoundingClientRect()))}},!1),o.addEventListener(l,"pointercancel",i,!1)}}});return{pressed:n,pressProps:e?{}:{onPointerDown:a,onPointerUp:i,onClick:i}}}let bi=Y(void 0);function Lr(){return j(bi)}function an(...e){return Array.from(new Set(e.flatMap(t=>typeof t=="string"?t.split(" "):[]))).filter(Boolean).join(" ")}function ve(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,ve),r}var _t=(e=>(e[e.None=0]="None",e[e.RenderStrategy=1]="RenderStrategy",e[e.Static=2]="Static",e))(_t||{}),me=(e=>(e[e.Unmount=0]="Unmount",e[e.Hidden=1]="Hidden",e))(me||{});function G({ourProps:e,theirProps:t,slot:n,defaultTag:r,features:o,visible:i=!0,name:a,mergeRefs:s}){s=s??$i;let l=Ar(t,e);if(i)return vt(l,n,r,a,s);let u=o??0;if(u&2){let{static:d=!1,...c}=l;if(d)return vt(c,n,r,a,s)}if(u&1){let{unmount:d=!0,...c}=l;return ve(d?0:1,{0(){return null},1(){return vt({...c,hidden:!0,style:{display:"none"}},n,r,a,s)}})}return vt(l,n,r,a,s)}function vt(e,t={},n,r,o){let{as:i=n,children:a,refName:s="ref",...l}=sn(e,["unmount","static"]),u=e.ref!==void 0?{[s]:e.ref}:{},d=typeof a=="function"?a(t):a;"className"in l&&l.className&&typeof l.className=="function"&&(l.className=l.className(t)),l["aria-labelledby"]&&l["aria-labelledby"]===l.id&&(l["aria-labelledby"]=void 0);let c={};if(t){let p=!1,f=[];for(let[v,y]of Object.entries(t))typeof y=="boolean"&&(p=!0),y===!0&&f.push(v.replace(/([A-Z])/g,m=>`-${m.toLowerCase()}`));if(p){c["data-headlessui-state"]=f.join(" ");for(let v of f)c[`data-${v}`]=""}}if(i===H&&(Object.keys(Fe(l)).length>0||Object.keys(Fe(c)).length>0))if(!He(d)||Array.isArray(d)&&d.length>1){if(Object.keys(Fe(l)).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(Fe(l)).concat(Object.keys(Fe(c))).map(p=>` - ${p}`).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(p=>` - ${p}`).join(`
|
|
4
4
|
`)].join(`
|
|
5
|
-
`))}else{let p=d.props,f=p==null?void 0:p.className,v=typeof f=="function"?(..._)=>an(f(..._),l.className):an(f,l.className),y=v?{className:v}:{},m=Ar(d.props,Fe(sn(l,["ref"])));for(let _ in c)_ in m&&delete c[_];return qt(d,Object.assign({},m,c,u,{ref:o(d.ref,u.ref)},y))}return Q(i,Object.assign({},sn(l,["ref"]),i!==H&&u,i!==H&&c),d)}function $i(...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 Ar(...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 a=n[r];for(let s of a){if((o instanceof Event||(o==null?void 0:o.nativeEvent)instanceof Event)&&o.defaultPrevented)return;s(o,...i)}}});return t}function Ei(...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 a of i)a==null||a(...o)}});return t}function q(e){var t;return Object.assign(jt(e),{displayName:(t=e.displayName)!=null?t:e.name})}function Fe(e){let t=Object.assign({},e);for(let n in t)t[n]===void 0&&delete t[n];return t}function sn(e,t=[]){let n=Object.assign({},e);for(let r of t)r in n&&delete n[r];return n}let Ti="button";function Ci(e,t){var n;let r=Lr(),{disabled:o=r||!1,autoFocus:i=!1,...a}=e,{isFocusVisible:s,focusProps:l}=hi({autoFocus:i}),{isHovered:u,hoverProps:d}=pi({isDisabled:o}),{pressed:c,pressProps:p}=wi({disabled:o}),f=Ei({ref:t,type:(n=a.type)!=null?n:"button",disabled:o||void 0,autoFocus:i},l,d,p),v=M(()=>({disabled:o,hover:u,focus:s,active:c,autofocus:i}),[o,u,s,c,i]);return G({ourProps:f,theirProps:a,slot:v,defaultTag:Ti,name:"Button"})}let ki=q(Ci),xi="div";var mt=(e=>(e[e.None=1]="None",e[e.Focusable=2]="Focusable",e[e.Hidden=4]="Hidden",e))(mt||{});function Fi(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 G({ourProps:i,theirProps:o,slot:{},defaultTag:xi,name:"Hidden"})}let ln=q(Fi),Si=Y(null);function Mi({children:e}){let t=j(Si);if(!t)return T.createElement(T.Fragment,null,e);let{target:n}=t;return n?lt(T.createElement(T.Fragment,null,e),n):null}let Ir=Symbol();function Pi(e,t=!0){return Object.assign(e,{[Ir]:t})}function re(...e){let t=g(e);N(()=>{t.current=e},[e]);let n=D(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[Ir]))?void 0:n}let cn=Y(null);cn.displayName="DescriptionContext";function Hr(){let e=j(cn);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,Hr),t}return e}function Ni(){let[e,t]=F([]);return[e.length>0?e.join(" "):void 0,M(()=>function(n){let r=D(i=>(t(a=>[...a,i]),()=>t(a=>{let s=a.slice(),l=s.indexOf(i);return l!==-1&&s.splice(l,1),s}))),o=M(()=>({register:r,slot:n.slot,name:n.name,props:n.props,value:n.value}),[r,n.slot,n.name,n.props,n.value]);return T.createElement(cn.Provider,{value:o},n.children)},[t])]}let Li="p";function Ai(e,t){let n=he(),r=Lr(),{id:o=`headlessui-description-${n}`,...i}=e,a=Hr(),s=re(t);B(()=>a.register(o),[o,a.register]);let l=r||!1,u=M(()=>({...a.slot,disabled:l}),[a.slot,l]),d={ref:s,...a.props,id:o};return G({ourProps:d,theirProps:i,slot:u,defaultTag:Li,name:a.name||"Description"})}let Ii=q(Ai),Hi=Object.assign(Ii,{});var Dr=(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))(Dr||{});let Di=Y(()=>{});function Oi({value:e,children:t}){return T.createElement(Di.Provider,{value:e},t)}let Ri=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 Or(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 a=t[o].call(n,...i);a&&(n=a,r.forEach(s=>s()))}}}function Rr(e){return ct(e.subscribe,e.getSnapshot,e.getSnapshot)}let Vi=new Ri(()=>Or(()=>[],{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 De(e,t){let n=Vi.get(t),r=he(),o=Rr(n);if(B(()=>{if(e)return n.dispatch("ADD",r),()=>n.dispatch("REMOVE",r)},[n,e]),!e)return!1;let i=o.indexOf(r),a=o.length;return i===-1&&(i=a,a+=1),i===a-1}let un=new Map,Ye=new Map;function Vr(e){var t;let n=(t=Ye.get(e))!=null?t:0;return Ye.set(e,n+1),n!==0?()=>Ur(e):(un.set(e,{"aria-hidden":e.getAttribute("aria-hidden"),inert:e.inert}),e.setAttribute("aria-hidden","true"),e.inert=!0,()=>Ur(e))}function Ur(e){var t;let n=(t=Ye.get(e))!=null?t:1;if(n===1?Ye.delete(e):Ye.set(e,n-1),n!==1)return;let r=un.get(e);r&&(r["aria-hidden"]===null?e.removeAttribute("aria-hidden"):e.setAttribute("aria-hidden",r["aria-hidden"]),e.inert=r.inert,un.delete(e))}function Ui(e,{allowed:t,disallowed:n}={}){let r=De(e,"inert-others");B(()=>{var o,i;if(!r)return;let a=_e();for(let l of(o=n==null?void 0:n())!=null?o:[])l&&a.add(Vr(l));let s=(i=t==null?void 0:t())!=null?i:[];for(let l of s){if(!l)continue;let u=ft(l);if(!u)continue;let d=l.parentElement;for(;d&&d!==u.body;){for(let c of d.children)s.some(p=>c.contains(p))||a.add(Vr(c));d=d.parentElement}}return a.dispose},[r,t,n])}function Wr(e,t,n){let r=xe(o=>{let i=o.getBoundingClientRect();i.x===0&&i.y===0&&i.width===0&&i.height===0&&n()});N(()=>{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 a=new ResizeObserver(()=>r.current(o));a.observe(o),i.add(()=>a.disconnect())}if(typeof IntersectionObserver<"u"){let a=new IntersectionObserver(()=>r.current(o));a.observe(o),i.add(()=>a.disconnect())}return()=>i.dispose()},[t,r,e])}let dn=["[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(","),Wi=["[data-autofocus]"].map(e=>`${e}:not([tabindex='-1'])`).join(",");var fe=(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))(fe||{}),fn=(e=>(e[e.Error=0]="Error",e[e.Overflow=1]="Overflow",e[e.Success=2]="Success",e[e.Underflow=3]="Underflow",e))(fn||{}),zi=(e=>(e[e.Previous=-1]="Previous",e[e.Next=1]="Next",e))(zi||{});function ji(e=document.body){return e==null?[]:Array.from(e.querySelectorAll(dn)).sort((t,n)=>Math.sign((t.tabIndex||Number.MAX_SAFE_INTEGER)-(n.tabIndex||Number.MAX_SAFE_INTEGER)))}function Bi(e=document.body){return e==null?[]:Array.from(e.querySelectorAll(Wi)).sort((t,n)=>Math.sign((t.tabIndex||Number.MAX_SAFE_INTEGER)-(n.tabIndex||Number.MAX_SAFE_INTEGER)))}var zr=(e=>(e[e.Strict=0]="Strict",e[e.Loose=1]="Loose",e))(zr||{});function qi(e,t=0){var n;return e===((n=ft(e))==null?void 0:n.body)?!1:ve(t,{0(){return e.matches(dn)},1(){let r=e;for(;r!==null;){if(r.matches(dn))return!0;r=r.parentElement}return!1}})}var Yi=(e=>(e[e.Keyboard=0]="Keyboard",e[e.Mouse=1]="Mouse",e))(Yi||{});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 pe(e){e==null||e.focus({preventScroll:!0})}let Ki=["textarea","input"].join(",");function Gi(e){var t,n;return(n=(t=e==null?void 0:e.matches)==null?void 0:t.call(e,Ki))!=null?n:!1}function Zi(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 a=o.compareDocumentPosition(i);return a&Node.DOCUMENT_POSITION_FOLLOWING?-1:a&Node.DOCUMENT_POSITION_PRECEDING?1:0})}function Ke(e,t,{sorted:n=!0,relativeTo:r=null,skipElements:o=[]}={}){let i=Array.isArray(e)?e.length>0?e[0].ownerDocument:document:e.ownerDocument,a=Array.isArray(e)?n?Zi(e):e:t&64?Bi(e):ji(e);o.length>0&&a.length>1&&(a=a.filter(f=>!o.some(v=>v!=null&&"current"in v?(v==null?void 0:v.current)===f:v===f))),r=r??i.activeElement;let s=(()=>{if(t&5)return 1;if(t&10)return-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),l=(()=>{if(t&1)return 0;if(t&2)return Math.max(0,a.indexOf(r))-1;if(t&4)return Math.max(0,a.indexOf(r))+1;if(t&8)return a.length-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),u=t&32?{preventScroll:!0}:{},d=0,c=a.length,p;do{if(d>=c||d+c<=0)return 0;let f=l+d;if(t&16)f=(f+c)%c;else{if(f<0)return 3;if(f>=c)return 1}p=a[f],p==null||p.focus(u),d+=s}while(p!==i.activeElement);return t&6&&Gi(p)&&p.select(),2}function jr(){return/iPhone/gi.test(window.navigator.platform)||/Mac/gi.test(window.navigator.platform)&&window.navigator.maxTouchPoints>0}function Xi(){return/Android/gi.test(window.navigator.userAgent)}function Qi(){return jr()||Xi()}function Ge(e,t,n,r){let o=xe(n);N(()=>{if(!e)return;function i(a){o.current(a)}return document.addEventListener(t,i,r),()=>document.removeEventListener(t,i,r)},[e,t,r])}function Br(e,t,n,r){let o=xe(n);N(()=>{if(!e)return;function i(a){o.current(a)}return window.addEventListener(t,i,r),()=>window.removeEventListener(t,i,r)},[e,t,r])}const qr=30;function Ji(e,t,n){let r=De(e,"outside-click"),o=xe(n),i=A(function(l,u){if(l.defaultPrevented)return;let d=u(l);if(d===null||!d.getRootNode().contains(d)||!d.isConnected)return;let c=function p(f){return typeof f=="function"?p(f()):Array.isArray(f)||f instanceof Set?f:[f]}(t);for(let p of c){if(p===null)continue;let f=p instanceof HTMLElement?p:p.current;if(f!=null&&f.contains(d)||l.composed&&l.composedPath().includes(f))return}return!qi(d,zr.Loose)&&d.tabIndex!==-1&&l.preventDefault(),o.current(l,d)},[o]),a=g(null);Ge(r,"pointerdown",l=>{var u,d;a.current=((d=(u=l.composedPath)==null?void 0:u.call(l))==null?void 0:d[0])||l.target},!0),Ge(r,"mousedown",l=>{var u,d;a.current=((d=(u=l.composedPath)==null?void 0:u.call(l))==null?void 0:d[0])||l.target},!0),Ge(r,"click",l=>{Qi()||a.current&&(i(l,()=>a.current),a.current=null)},!0);let s=g({x:0,y:0});Ge(r,"touchstart",l=>{s.current.x=l.touches[0].clientX,s.current.y=l.touches[0].clientY},!0),Ge(r,"touchend",l=>{let u={x:l.changedTouches[0].clientX,y:l.changedTouches[0].clientY};if(!(Math.abs(u.x-s.current.x)>=qr||Math.abs(u.y-s.current.y)>=qr))return i(l,()=>l.target instanceof HTMLElement?l.target:null)},!0),Br(r,"blur",l=>i(l,()=>window.document.activeElement instanceof HTMLIFrameElement?window.document.activeElement:null),!0)}function Ze(...e){return M(()=>ft(...e),[...e])}function Yr(e,t,n,r){let o=xe(n);N(()=>{e=e??window;function i(a){o.current(a)}return e.addEventListener(t,i,r),()=>e.removeEventListener(t,i,r)},[e,t,r])}function ea(){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 ta(){return jr()?{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 s=_e();s.style(e.documentElement,"scrollBehavior","auto"),t.add(()=>t.microTask(()=>s.dispose()))}let i=(o=window.scrollY)!=null?o:window.pageYOffset,a=null;t.addEventListener(e,"click",s=>{if(s.target instanceof HTMLElement)try{let l=s.target.closest("a");if(!l)return;let{hash:u}=new URL(l.href),d=e.querySelector(u);d&&!r(d)&&(a=d)}catch{}},!0),t.addEventListener(e,"touchstart",s=>{if(s.target instanceof HTMLElement)if(r(s.target)){let l=s.target;for(;l.parentElement&&r(l.parentElement);)l=l.parentElement;t.style(l,"overscrollBehavior","contain")}else t.style(s.target,"touchAction","none")}),t.addEventListener(e,"touchmove",s=>{if(s.target instanceof HTMLElement){if(s.target.tagName==="INPUT")return;if(r(s.target)){let l=s.target;for(;l.parentElement&&l.dataset.headlessuiPortal!==""&&!(l.scrollHeight>l.clientHeight||l.scrollWidth>l.clientWidth);)l=l.parentElement;l.dataset.headlessuiPortal===""&&s.preventDefault()}else s.preventDefault()}},{passive:!1}),t.add(()=>{var s;let l=(s=window.scrollY)!=null?s:window.pageYOffset;i!==l&&window.scrollTo(0,i),a&&a.isConnected&&(a.scrollIntoView({block:"nearest"}),a=null)})})}}:{}}function na(){return{before({doc:e,d:t}){t.style(e.documentElement,"overflow","hidden")}}}function ra(e){let t={};for(let n of e)Object.assign(t,n(t));return t}let Se=Or(()=>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:ra(n)},o=[ta(),ea(),na()];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)}});Se.subscribe(()=>{let e=Se.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)&&Se.dispatch(n.count>0?"SCROLL_PREVENT":"SCROLL_ALLOW",n),n.count===0&&Se.dispatch("TEARDOWN",n)}});function oa(e,t,n=()=>({containers:[]})){let r=Rr(Se),o=t?r.get(t):void 0,i=o?o.count>0:!1;return B(()=>{if(!(!t||!e))return Se.dispatch("PUSH",t,n),()=>Se.dispatch("POP",t,n)},[e,t]),i}function ia(e,t,n=()=>[document.body]){let r=De(e,"scroll-lock");oa(r,t,o=>{var i;return{containers:[...(i=o.containers)!=null?i:[],n]}})}function aa(e){let t={called:!1};return(...n)=>{if(!t.called)return t.called=!0,e(...n)}}function sa(e=0){let[t,n]=F(e),r=A(l=>n(l),[t]),o=A(l=>n(u=>u|l),[t]),i=A(l=>(t&l)===l,[t]),a=A(l=>n(u=>u&~l),[n]),s=A(l=>n(u=>u^l),[n]);return{flags:t,setFlag:r,addFlag:o,hasFlag:i,removeFlag:a,toggleFlag:s}}var la=(e=>(e[e.None=0]="None",e[e.Closed=1]="Closed",e[e.Enter=2]="Enter",e[e.Leave=4]="Leave",e))(la||{});function ca(e){let t={};for(let n in e)e[n]===!0&&(t[`data-${n}`]="");return t}function ua(e,t,n,r){let[o,i]=F(n),{hasFlag:a,addFlag:s,removeFlag:l}=sa(e&&o?3:0),u=g(!1),d=g(!1),c=ht();return B(function p(){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),da(v,{inFlight:u,prepare(){d.current?d.current=!1:d.current=u.current,u.current=!0,!d.current&&(n?(s(3),l(4)):(s(4),l(2)))},run(){d.current?n?(l(3),s(4)):(l(4),s(3)):n?l(1):s(1)},done(){var y;d.current&&typeof v.getAnimations=="function"&&v.getAnimations().length>0||(u.current=!1,l(7),n||i(!1),(y=r==null?void 0:r.end)==null||y.call(r,n))}})):n?(s(3),c.nextFrame(()=>p())):void 0},[e,n,t,c]),e?[o,{closed:a(1),enter:a(2),leave:a(4),transition:a(2)||a(4)}]:[n,{closed:void 0,enter:void 0,leave:void 0,transition:void 0}]}function da(e,{prepare:t,run:n,done:r,inFlight:o}){let i=_e();return pa(e,{prepare:t,inFlight:o}),i.nextFrame(()=>{i.add(fa(e,r)),n()}),i.dispose}function fa(e,t){let n=aa(t),r=_e();if(!e)return r.dispose;let{transitionDuration:o,transitionDelay:i}=getComputedStyle(e),[a,s]=[o,i].map(u=>{let[d=0]=u.split(",").filter(Boolean).map(c=>c.includes("ms")?parseFloat(c):parseFloat(c)*1e3).sort((c,p)=>p-c);return d}),l=a+s;if(l!==0){let u=r.group(d=>{let c=d.setTimeout(()=>{n(),d.dispose()},l);d.addEventListener(e,"transitionrun",p=>{p.target===p.currentTarget&&(c(),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 pa(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 pn(e,t){let n=g([]),r=D(e);N(()=>{let o=[...n.current];for(let[i,a]of t.entries())if(n.current[i]!==a){let s=r(t,o);return n.current=t,s}},[r,...t])}let yt=Y(null);yt.displayName="OpenClosedContext";var ee=(e=>(e[e.Open=1]="Open",e[e.Closed=2]="Closed",e[e.Closing=4]="Closing",e[e.Opening=8]="Opening",e))(ee||{});function gt(){return j(yt)}function ha({value:e,children:t}){return T.createElement(yt.Provider,{value:e},t)}function _a({children:e}){return T.createElement(yt.Provider,{value:null},e)}function va(e){function t(){document.readyState!=="loading"&&(e(),document.removeEventListener("DOMContentLoaded",t))}typeof window<"u"&&typeof document<"u"&&(document.addEventListener("DOMContentLoaded",t),t())}let ye=[];va(()=>{function e(t){t.target instanceof HTMLElement&&t.target!==document.body&&ye[0]!==t.target&&(ye.unshift(t.target),ye=ye.filter(n=>n!=null&&n.isConnected),ye.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 Kr(e){let t=D(e),n=g(!1);N(()=>(n.current=!1,()=>{n.current=!0,pt(()=>{n.current&&t()})}),[t])}function ma(){let e=typeof document>"u";return"useSyncExternalStore"in Tr?(t=>t.useSyncExternalStore)(Tr)(()=>()=>{},()=>!1,()=>!e):!1}function Xe(){let e=ma(),[t,n]=F(ke.isHandoffComplete);return t&&ke.isHandoffComplete===!1&&n(!1),N(()=>{t!==!0&&n(!0)},[t]),N(()=>ke.handoff(),[]),e?!1:t}let Gr=Y(!1);function ya(){return j(Gr)}function Zr(e){return T.createElement(Gr.Provider,{value:e.force},e.children)}function ga(e){let t=ya(),n=j(Qr),r=Ze(e),[o,i]=F(()=>{var a;if(!t&&n!==null)return(a=n.current)!=null?a:null;if(ke.isServer)return null;let s=r==null?void 0:r.getElementById("headlessui-portal-root");if(s)return s;if(r===null)return null;let l=r.createElement("div");return l.setAttribute("id","headlessui-portal-root"),r.body.appendChild(l)});return N(()=>{o!==null&&(r!=null&&r.body.contains(o)||r==null||r.body.appendChild(o))},[o,r]),N(()=>{t||n!==null&&i(n.current)},[n,i,t]),o}let Xr=H,wa=q(function(e,t){let n=e,r=g(null),o=re(Pi(d=>{r.current=d}),t),i=Ze(r),a=ga(r),[s]=F(()=>{var d;return ke.isServer?null:(d=i==null?void 0:i.createElement("div"))!=null?d:null}),l=j(hn),u=Xe();return B(()=>{!a||!s||a.contains(s)||(s.setAttribute("data-headlessui-portal",""),a.appendChild(s))},[a,s]),B(()=>{if(s&&l)return l.register(s)},[l,s]),Kr(()=>{var d;!a||!s||(s instanceof Node&&a.contains(s)&&a.removeChild(s),a.childNodes.length<=0&&((d=a.parentElement)==null||d.removeChild(a)))}),u?!a||!s?null:lt(G({ourProps:{ref:o},theirProps:n,slot:{},defaultTag:Xr,name:"Portal"}),s):null});function ba(e,t){let n=re(t),{enabled:r=!0,...o}=e;return r?T.createElement(wa,{...o,ref:n}):G({ourProps:{ref:n},theirProps:o,slot:{},defaultTag:Xr,name:"Portal"})}let $a=H,Qr=Y(null);function Ea(e,t){let{target:n,...r}=e,o={ref:re(t)};return T.createElement(Qr.Provider,{value:n},G({ourProps:o,theirProps:r,defaultTag:$a,name:"Popover.Group"}))}let hn=Y(null);function Ta(){let e=j(hn),t=g([]),n=D(i=>(t.current.push(i),e&&e.register(i),()=>r(i))),r=D(i=>{let a=t.current.indexOf(i);a!==-1&&t.current.splice(a,1),e&&e.unregister(i)}),o=M(()=>({register:n,unregister:r,portals:t}),[n,r,t]);return[t,M(()=>function({children:i}){return T.createElement(hn.Provider,{value:o},i)},[o])]}let Ca=q(ba),Jr=q(Ea),ka=Object.assign(Ca,{Group:Jr});function xa(e,t=typeof document<"u"?document.defaultView:null,n){let r=De(e,"escape");Yr(t,"keydown",o=>{r&&(o.defaultPrevented||o.key===Dr.Escape&&n(o))})}function Fa(){var e;let[t]=F(()=>typeof window<"u"&&typeof window.matchMedia=="function"?window.matchMedia("(pointer: coarse)"):null),[n,r]=F((e=t==null?void 0:t.matches)!=null?e:!1);return B(()=>{if(!t)return;function o(i){r(i.matches)}return t.addEventListener("change",o),()=>t.removeEventListener("change",o)},[t]),n}function Sa({defaultContainers:e=[],portals:t,mainTreeNodeRef:n}={}){var r;let o=g((r=n==null?void 0:n.current)!=null?r:null),i=Ze(o),a=D(()=>{var s,l,u;let d=[];for(let c of e)c!==null&&(c instanceof HTMLElement?d.push(c):"current"in c&&c.current instanceof HTMLElement&&d.push(c.current));if(t!=null&&t.current)for(let c of t.current)d.push(c);for(let c of(s=i==null?void 0:i.querySelectorAll("html > *, body > *"))!=null?s:[])c!==document.body&&c!==document.head&&c instanceof HTMLElement&&c.id!=="headlessui-portal-root"&&(c.contains(o.current)||c.contains((u=(l=o.current)==null?void 0:l.getRootNode())==null?void 0:u.host)||d.some(p=>c.contains(p))||d.push(c));return d});return{resolveContainers:a,contains:D(s=>a().some(l=>l.contains(s))),mainTreeNodeRef:o,MainTreeNode:M(()=>function(){return n!=null?null:T.createElement(ln,{features:mt.Hidden,ref:o})},[o,n])}}function _n(){let e=g(!1);return B(()=>(e.current=!0,()=>{e.current=!1}),[]),e}var Qe=(e=>(e[e.Forwards=0]="Forwards",e[e.Backwards=1]="Backwards",e))(Qe||{});function Ma(){let e=g(0);return Br(!0,"keydown",t=>{t.key==="Tab"&&(e.current=t.shiftKey?1:0)},!0),e}function eo(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 Pa="div";var Me=(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))(Me||{});function Na(e,t){let n=g(null),r=re(n,t),{initialFocus:o,initialFocusFallback:i,containers:a,features:s=15,...l}=e;Xe()||(s=0);let u=Ze(n);Ha(s,{ownerDocument:u});let d=Da(s,{ownerDocument:u,container:n,initialFocus:o,initialFocusFallback:i});Oa(s,{ownerDocument:u,container:n,containers:a,previousActiveElement:d});let c=Ma(),p=D(_=>{let w=n.current;w&&(b=>b())(()=>{ve(c.current,{[Qe.Forwards]:()=>{Ke(w,fe.First,{skipElements:[_.relatedTarget,i]})},[Qe.Backwards]:()=>{Ke(w,fe.Last,{skipElements:[_.relatedTarget,i]})}})})}),f=De(!!(s&2),"focus-trap#tab-lock"),v=ht(),y=g(!1),m={ref:r,onKeyDown(_){_.key=="Tab"&&(y.current=!0,v.requestAnimationFrame(()=>{y.current=!1}))},onBlur(_){if(!(s&4))return;let w=eo(a);n.current instanceof HTMLElement&&w.add(n.current);let b=_.relatedTarget;b instanceof HTMLElement&&b.dataset.headlessuiFocusGuard!=="true"&&(to(w,b)||(y.current?Ke(n.current,ve(c.current,{[Qe.Forwards]:()=>fe.Next,[Qe.Backwards]:()=>fe.Previous})|fe.WrapAround,{relativeTo:_.target}):_.target instanceof HTMLElement&&pe(_.target)))}};return T.createElement(T.Fragment,null,f&&T.createElement(ln,{as:"button",type:"button","data-headlessui-focus-guard":!0,onFocus:p,features:mt.Focusable}),G({ourProps:m,theirProps:l,defaultTag:Pa,name:"FocusTrap"}),f&&T.createElement(ln,{as:"button",type:"button","data-headlessui-focus-guard":!0,onFocus:p,features:mt.Focusable}))}let La=q(Na),Aa=Object.assign(La,{features:Me});function Ia(e=!0){let t=g(ye.slice());return pn(([n],[r])=>{r===!0&&n===!1&&pt(()=>{t.current.splice(0)}),r===!1&&n===!0&&(t.current=ye.slice())},[e,ye,t]),D(()=>{var n;return(n=t.current.find(r=>r!=null&&r.isConnected))!=null?n:null})}function Ha(e,{ownerDocument:t}){let n=!!(e&8),r=Ia(n);pn(()=>{n||(t==null?void 0:t.activeElement)===(t==null?void 0:t.body)&&pe(r())},[n]),Kr(()=>{n&&pe(r())})}function Da(e,{ownerDocument:t,container:n,initialFocus:r,initialFocusFallback:o}){let i=g(null),a=De(!!(e&1),"focus-trap#initial-focus"),s=_n();return pn(()=>{if(e===0)return;if(!a){o!=null&&o.current&&pe(o.current);return}let l=n.current;l&&pt(()=>{if(!s.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(l.contains(u)){i.current=u;return}if(r!=null&&r.current)pe(r.current);else{if(e&16){if(Ke(l,fe.First|fe.AutoFocus)!==fn.Error)return}else if(Ke(l,fe.First)!==fn.Error)return;if(o!=null&&o.current&&(pe(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,a,e]),i}function Oa(e,{ownerDocument:t,container:n,containers:r,previousActiveElement:o}){let i=_n(),a=!!(e&4);Yr(t==null?void 0:t.defaultView,"focus",s=>{if(!a||!i.current)return;let l=eo(r);n.current instanceof HTMLElement&&l.add(n.current);let u=o.current;if(!u)return;let d=s.target;d&&d instanceof HTMLElement?to(l,d)?(o.current=d,pe(d)):(s.preventDefault(),s.stopPropagation(),pe(u)):pe(o.current)},!0)}function to(e,t){for(let n of e)if(n.contains(t))return!0;return!1}function no(e){var t;return!!(e.enter||e.enterFrom||e.enterTo||e.leave||e.leaveFrom||e.leaveTo)||((t=e.as)!=null?t:oo)!==H||T.Children.count(e.children)===1}let wt=Y(null);wt.displayName="TransitionContext";var Ra=(e=>(e.Visible="visible",e.Hidden="hidden",e))(Ra||{});function Va(){let e=j(wt);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}function Ua(){let e=j(bt);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}let bt=Y(null);bt.displayName="NestingContext";function $t(e){return"children"in e?$t(e.children):e.current.filter(({el:t})=>t.current!==null).filter(({state:t})=>t==="visible").length>0}function ro(e,t){let n=xe(e),r=g([]),o=_n(),i=ht(),a=D((f,v=me.Hidden)=>{let y=r.current.findIndex(({el:m})=>m===f);y!==-1&&(ve(v,{[me.Unmount](){r.current.splice(y,1)},[me.Hidden](){r.current[y].state="hidden"}}),i.microTask(()=>{var m;!$t(r)&&o.current&&((m=n.current)==null||m.call(n))}))}),s=D(f=>{let v=r.current.find(({el:y})=>y===f);return v?v.state!=="visible"&&(v.state="visible"):r.current.push({el:f,state:"visible"}),()=>a(f,me.Unmount)}),l=g([]),u=g(Promise.resolve()),d=g({enter:[],leave:[]}),c=D((f,v,y)=>{l.current.splice(0),t&&(t.chains.current[v]=t.chains.current[v].filter(([m])=>m!==f)),t==null||t.chains.current[v].push([f,new Promise(m=>{l.current.push(m)})]),t==null||t.chains.current[v].push([f,new Promise(m=>{Promise.all(d.current[v].map(([_,w])=>w)).then(()=>m())})]),v==="enter"?u.current=u.current.then(()=>t==null?void 0:t.wait.current).then(()=>y(v)):y(v)}),p=D((f,v,y)=>{Promise.all(d.current[v].splice(0).map(([m,_])=>_)).then(()=>{var m;(m=l.current.shift())==null||m()}).then(()=>y(v))});return M(()=>({children:r,register:s,unregister:a,onStart:c,onStop:p,wait:u,chains:d}),[s,a,r,c,p,d,u])}let oo=H,io=_t.RenderStrategy;function Wa(e,t){var n,r;let{transition:o=!0,beforeEnter:i,afterEnter:a,beforeLeave:s,afterLeave:l,enter:u,enterFrom:d,enterTo:c,entered:p,leave:f,leaveFrom:v,leaveTo:y,...m}=e,_=g(null),w=no(e),b=re(...w?[_,t]:t===null?[]:[t]),C=(n=m.unmount)==null||n?me.Unmount:me.Hidden,{show:E,appear:P,initial:R}=Va(),[V,W]=F(E?"visible":"hidden"),$=Ua(),{register:x,unregister:S}=$;B(()=>x(_),[x,_]),B(()=>{if(C===me.Hidden&&_.current){if(E&&V!=="visible"){W("visible");return}return ve(V,{hidden:()=>S(_),visible:()=>x(_)})}},[V,_,x,S,E,C]);let I=Xe();B(()=>{if(w&&I&&V==="visible"&&_.current===null)throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?")},[_,V,I,w]);let X=R&&!P,se=P&&E&&R,te=g(!1),ne=ro(()=>{te.current||(W("hidden"),S(_))},$),Re=D(kn=>{te.current=!0;let Ft=kn?"enter":"leave";ne.onStart(_,Ft,nt=>{nt==="enter"?i==null||i():nt==="leave"&&(s==null||s())})}),ge=D(kn=>{let Ft=kn?"enter":"leave";te.current=!1,ne.onStop(_,Ft,nt=>{nt==="enter"?a==null||a():nt==="leave"&&(l==null||l())}),Ft==="leave"&&!$t(ne)&&(W("hidden"),S(_))});N(()=>{w&&o||(Re(E),ge(E))},[E,w,o]);let z=!(!o||!w||!I||X),[,U]=ua(z,_,E,{start:Re,end:ge}),Zs=Fe({ref:b,className:((r=an(m.className,se&&u,se&&d,U.enter&&u,U.enter&&U.closed&&d,U.enter&&!U.closed&&c,U.leave&&f,U.leave&&!U.closed&&v,U.leave&&U.closed&&y,!U.transition&&E&&p))==null?void 0:r.trim())||void 0,...ca(U)}),tt=0;return V==="visible"&&(tt|=ee.Open),V==="hidden"&&(tt|=ee.Closed),U.enter&&(tt|=ee.Opening),U.leave&&(tt|=ee.Closing),T.createElement(bt.Provider,{value:ne},T.createElement(ha,{value:tt},G({ourProps:Zs,theirProps:m,defaultTag:oo,features:io,visible:V==="visible",name:"Transition.Child"})))}function za(e,t){let{show:n,appear:r=!1,unmount:o=!0,...i}=e,a=g(null),s=no(e),l=re(...s?[a,t]:t===null?[]:[t]);Xe();let u=gt();if(n===void 0&&u!==null&&(n=(u&ee.Open)===ee.Open),n===void 0)throw new Error("A <Transition /> is used but it is missing a `show={true | false}` prop.");let[d,c]=F(n?"visible":"hidden"),p=ro(()=>{n||c("hidden")}),[f,v]=F(!0),y=g([n]);B(()=>{f!==!1&&y.current[y.current.length-1]!==n&&(y.current.push(n),v(!1))},[y,n]);let m=M(()=>({show:n,appear:r,initial:f}),[n,r,f]);Wr(n,a,()=>c("hidden")),B(()=>{n?c("visible"):!$t(p)&&a.current!==null&&c("hidden")},[n,p]);let _={unmount:o},w=D(()=>{var C;f&&v(!1),(C=e.beforeEnter)==null||C.call(e)}),b=D(()=>{var C;f&&v(!1),(C=e.beforeLeave)==null||C.call(e)});return T.createElement(bt.Provider,{value:p},T.createElement(wt.Provider,{value:m},G({ourProps:{..._,as:H,children:T.createElement(ao,{ref:l,..._,...i,beforeEnter:w,beforeLeave:b})},theirProps:{},defaultTag:H,features:io,visible:d==="visible",name:"Transition"})))}function ja(e,t){let n=j(wt)!==null,r=gt()!==null;return T.createElement(T.Fragment,null,!n&&r?T.createElement(vn,{ref:t,...e}):T.createElement(ao,{ref:t,...e}))}let vn=q(za),ao=q(Wa),mn=q(ja),oe=Object.assign(vn,{Child:mn,Root:vn});var Ba=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(Ba||{}),qa=(e=>(e[e.SetTitleId=0]="SetTitleId",e))(qa||{});let Ya={0(e,t){return e.titleId===t.id?e:{...e,titleId:t.id}}},yn=Y(null);yn.displayName="DialogContext";function Et(e){let t=j(yn);if(t===null){let n=new Error(`<${e} /> is missing a parent <Dialog /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,Et),n}return t}function Ka(e,t){return ve(t.type,Ya,e,t)}let so=q(function(e,t){let n=he(),{id:r=`headlessui-dialog-${n}`,open:o,onClose:i,initialFocus:a,role:s="dialog",autoFocus:l=!0,__demoMode:u=!1,...d}=e,c=g(!1);s=function(){return s==="dialog"||s==="alertdialog"?s:(c.current||(c.current=!0,console.warn(`Invalid role [${s}] passed to <Dialog />. Only \`dialog\` and and \`alertdialog\` are supported. Using \`dialog\` instead.`)),"dialog")}();let p=gt();o===void 0&&p!==null&&(o=(p&ee.Open)===ee.Open);let f=g(null),v=re(f,t),y=Ze(f),m=o?0:1,[_,w]=We(Ka,{titleId:null,descriptionId:null,panelRef:Lt()}),b=D(()=>i(!1)),C=D(z=>w({type:0,id:z})),E=Xe()?m===0:!1,[P,R]=Ta(),V={get current(){var z;return(z=_.panelRef.current)!=null?z:f.current}},{resolveContainers:W,mainTreeNodeRef:$,MainTreeNode:x}=Sa({portals:P,defaultContainers:[V]}),S=p!==null?(p&ee.Closing)===ee.Closing:!1;Ui(u||S?!1:E,{allowed:D(()=>{var z,U;return[(U=(z=f.current)==null?void 0:z.closest("[data-headlessui-portal]"))!=null?U:null]}),disallowed:D(()=>{var z,U;return[(U=(z=$.current)==null?void 0:z.closest("body > *:not(#headlessui-portal-root)"))!=null?U:null]})}),Ji(E,W,z=>{z.preventDefault(),b()}),xa(E,y==null?void 0:y.defaultView,z=>{z.preventDefault(),z.stopPropagation(),document.activeElement&&"blur"in document.activeElement&&typeof document.activeElement.blur=="function"&&document.activeElement.blur(),b()}),ia(u||S?!1:E,y,W),Wr(E,f,b);let[I,X]=Ni(),se=M(()=>[{dialogState:m,close:b,setTitleId:C},_],[m,_,b,C]),te=M(()=>({open:m===0}),[m]),ne={ref:v,id:r,role:s,tabIndex:-1,"aria-modal":u?void 0:m===0?!0:void 0,"aria-labelledby":_.titleId,"aria-describedby":I},Re=!Fa(),ge=Me.None;return E&&!u&&(ge|=Me.RestoreFocus,ge|=Me.TabLock,l&&(ge|=Me.AutoFocus),Re&&(ge|=Me.InitialFocus)),T.createElement(_a,null,T.createElement(Zr,{force:!0},T.createElement(ka,null,T.createElement(yn.Provider,{value:se},T.createElement(Jr,{target:f},T.createElement(Zr,{force:!1},T.createElement(X,{slot:te},T.createElement(R,null,T.createElement(Aa,{initialFocus:a,initialFocusFallback:f,containers:W,features:ge},T.createElement(Oi,{value:b},G({ourProps:ne,theirProps:d,slot:te,defaultTag:Ga,features:Za,visible:m===0,name:"Dialog"})))))))))),T.createElement(Mi,null,T.createElement(x,null)))}),Ga="div",Za=_t.RenderStrategy|_t.Static;function Xa(e,t){let{transition:n=!1,open:r,...o}=e,i=gt(),a=e.hasOwnProperty("open")||i!==null,s=e.hasOwnProperty("onClose");if(!a&&!s)throw new Error("You have to provide an `open` and an `onClose` prop to the `Dialog` component.");if(!a)throw new Error("You provided an `onClose` prop to the `Dialog`, but forgot an `open` prop.");if(!s)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?T.createElement(oe,{show:r,transition:n,unmount:o.unmount},T.createElement(so,{ref:t,...o})):T.createElement(so,{ref:t,open:r,...o})}let Qa="div";function Ja(e,t){let n=he(),{id:r=`headlessui-dialog-panel-${n}`,transition:o=!1,...i}=e,[{dialogState:a},s]=Et("Dialog.Panel"),l=re(t,s.panelRef),u=M(()=>({open:a===0}),[a]),d=D(c=>{c.stopPropagation()});return T.createElement(o?mn:H,null,G({ourProps:{ref:l,id:r,onClick:d},theirProps:i,slot:u,defaultTag:Qa,name:"Dialog.Panel"}))}let es="div";function ts(e,t){let{transition:n=!1,...r}=e,[{dialogState:o}]=Et("Dialog.Backdrop"),i=M(()=>({open:o===0}),[o]);return T.createElement(n?mn:H,null,G({ourProps:{ref:t,"aria-hidden":!0},theirProps:r,slot:i,defaultTag:es,name:"Dialog.Backdrop"}))}let ns="h2";function rs(e,t){let n=he(),{id:r=`headlessui-dialog-title-${n}`,...o}=e,[{dialogState:i,setTitleId:a}]=Et("Dialog.Title"),s=re(t);N(()=>(a(r),()=>a(null)),[r,a]);let l=M(()=>({open:i===0}),[i]);return G({ourProps:{ref:s,id:r},theirProps:o,slot:l,defaultTag:ns,name:"Dialog.Title"})}let os=q(Xa),lo=q(Ja);q(ts);let is=q(rs),as=Object.assign(os,{Panel:lo,Title:is,Description:Hi});const Tt={root:"_root_1hpzn_1",modal:"_modal_1hpzn_10",container:"_container_1hpzn_13",page:"_page_1hpzn_16",close:"_close_1hpzn_19"},ss={root:"_root_1h6qm_1"},ie=e=>{const{children:t,size:n="md",fill:r="currentColor",stroke:o,strokeWidth:i,className:a="",viewBox:s="0 0 20 20"}=e,l=M(()=>{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 h("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:s,fill:r,stroke:o,strokeWidth:i,className:`${l} ${a}`,children:t})},ls=()=>h(ie,{children:h("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"})}),co=e=>h(ie,{...e,children:h("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"})}),cs=e=>h(ie,{...e,viewBox:"0 0 24 24",children:[h("path",{d:"M0 0h24v24H0V0z",fill:"none"}),h("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"})]}),us=e=>h(ie,{...e,viewBox:"0 0 24 24",children:[h("path",{d:"M0 0h24v24H0V0z",fill:"none"}),h("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"})]}),ds=e=>h(ie,{...e,viewBox:"0 0 24 24",children:[h("path",{d:"M0 0h24v24H0V0z",fill:"none"}),h("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"})]}),fs=e=>h(ie,{...e,children:[h("path",{d:"M0 0h24v24H0V0z",fill:"none"}),h("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"})]}),ps=e=>h(ie,{...e,children:h("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"})}),hs=e=>h(ie,{...e,viewBox:"0 0 24 24",children:h("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"})}),_s=e=>h(ie,{...e,children:h("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"})}),vs=e=>h(ie,{...e,viewBox:"0 0 99 32",children:[h("g",{clipPath:"url(#clip0_9581_165880)",children:[h("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"}),h("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"}),h("path",{d:"M68.9385 6.74805H67.1367V25.2549H68.9385V6.74805Z",fill:"white"}),h("path",{d:"M55.0725 8.52161V6.73047H47.8535V25.2683H55.0725V23.4748H49.6577V18.9874H52.9664V17.1963H49.6577V8.52161H55.0725Z",fill:"white"}),h("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"}),h("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"}),h("path",{d:"M78.6291 8.53181V6.73828H71.4102V25.2618H73.2143V18.9976H76.5231V17.2065H73.2143V8.53181H78.6291Z",fill:"white"}),h("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"}),h("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"}),h("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"})]}),h("defs",{children:h("clipPath",{id:"clip0_9581_165880",children:h("rect",{width:"98.9474",height:"32",fill:"white"})})})]});class Pe{static loadVision(){return import("https://cdn.jsdelivr.net/npm/@mediapipe/tasks-vision@0.10.3")}static async loadDetector(){try{const{FaceLandmarker:t,FilesetResolver:n}=await Pe.loadVision(),r=await n.forVisionTasks("https://cdn.jsdelivr.net/npm/@mediapipe/tasks-vision@0.10.3/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:!1,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){let n=1/0,r=-1/0,o=1/0,i=-1/0;return t.forEach(a=>{n=Math.min(n,a.x),r=Math.max(r,a.x),o=Math.min(o,a.y),i=Math.max(i,a.y)}),{xMin:n,xMax:r,yMin:o,yMax:i,width:r-n,height:i-o}}static async detectFaces(t,n){try{const{width:r,height:o}=n,{faceLandmarks:i}=await t.detect(n);if(i.length===0)return[];const a=Pe.denormalizeKeypoints(i[0],r,o),s=Pe.getBoundingBox(a);return[{keypoints:a,box:s}]}catch(r){return Promise.reject(r)}}}const ms=(e,t)=>{let n;return typeof OffscreenCanvas<"u"?n=new OffscreenCanvas(e,t):(n=document.createElement("canvas"),n.width=e,n.height=t),n},uo=(e,t,n,r)=>{let o=0,i=0,a=t,s=n;const u=ms(t,n).getContext("2d");return u.drawImage(e,0,0),u.getImageData(o,i,a,s)},ys=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(a=>t(a))});function gs(){if(MediaRecorder.isTypeSupported("video/webm; codecs=vp9"))return{mimeType:"video/webm; codecs=vp9"};if(MediaRecorder.isTypeSupported("video/webm"))return{mimeType:"video/webm"};if(MediaRecorder.isTypeSupported("video/mp4"))return{mimeType:"video/mp4"}}function fo(e={}){const{onRecord:t=()=>{},onStop:n=()=>{}}=e,r=g([]),o=g(null),i=g(null),a=A(c=>{r.current.push(c)},[]),s=A(async c=>{if(o.current)return;const p=await ys(c);o.current=p},[]),l=A(c=>{c.data.size>0&&t(c.data)},[]),u=A(()=>{!i.current||i.current.state==="inactive"||(i.current.stop(),i.current.stream.getTracks().forEach(c=>c.stop()),n())},[]),d=A(c=>{i.current||(i.current=new MediaRecorder(c,gs()),i.current.ondataavailable=l,i.current.onstop=u,i.current.start(1e3))},[]);return{saveStream:a,savePhoto:s,start:d,stop:u,savedStreams:r,savedPhoto:o}}function Oe(e,t){return Math.sqrt(e**2+t**2)}function ws(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}function bs(e,t){return new Promise((n,r)=>{const o=new File([e],`${Date.now()}`,{type:t}),i=new FileReader;i.readAsDataURL(o),i.onload=()=>n(i.result),i.onerror=a=>r(a)})}const $s=e=>e?"https://identity.staging.svc.youverify.co":"https://identity.svc.youverify.co";function Es(e){return{postData:async n=>{const{faceImage:r,publicKey:o,passed:i,metadata:a}=n,s=$s(e),l=await fetch(`${s}/v1/sdk/identity/liveness/`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({publicMerchantID:o,components:["liveness"],faceImage:r,passed:i,metadata:a})});if(!l.ok)throw l;return(await l.json()).data}}}const Ts=360,Cs="#125766",ks="https://cdn.youverify.co/1721901834404-q2nxqyng5klm918b3BDVU.jpg",po={"complete-the-circle":{Icon:cs,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:us,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:ds,name:"Motions 💫",description:"First position your face in the camera frame, then follow the instructions"},"facial-expressions":{Icon:co,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"}},ho=Y({tasks:[],namespace:"",user:void 0,currentTaskIndex:0,completedCount:0,nextTask:()=>{},completed:!1,onRequestClose:()=>{},faceDetector:null,saveStream:()=>{},savePhoto:()=>{},onComplete:()=>Promise.resolve()});let _o,vo=!1;function xs(e){const{publicKey:t,tasks:n,children:r,namespace:o,user:i,branding:a,onRequestClose:s,onSuccess:l=()=>{},metadata:u,presentation:d,sandboxEnvironment:c=!0}=e,[p,f]=F(0),[v,y]=F(0),[m,_]=F(null),{saveStream:w,savePhoto:b,savedPhoto:C}=fo(),{postData:E}=Es(c),P=M(()=>v===n.length,[n,v]),R=()=>{y(x=>x+1),f(x=>x+1)},V=x=>{const S=new Image;S.crossOrigin="Anonymous",S.src=ks,S.onload=()=>{const I=uo(S,S.width,S.height);Pe.detectFaces(x,I)}},W=async()=>{const x=await E({faceImage:C.current?await bs(C.current,"image/png"):null,publicKey:t,passed:!0,metadata:u});l(x),s()},$=async()=>{const x=await Pe.loadDetector();_o=x,V(x),_(x)};return N(()=>{if(vo){_(_o);return}$(),vo=!0},[]),h(ho.Provider,{value:{tasks:n,namespace:o,user:i,currentTaskIndex:p,completed:P,completedCount:v,nextTask:R,branding:a,onRequestClose:s,faceDetector:m,saveStream:w,savePhoto:b,onComplete:W,presentation:d},children:r})}function Ne(){return j(ho)}const K={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"},gn={root:"_root_135td_1",container:"_container_135td_1",brand:"_brand_135td_1"};function Fs(){const{branding:e}=Ne();return h("div",{className:gn.root,children:h("div",{className:gn.container,children:h("div",{className:gn.brand,children:(e==null?void 0:e.logo)&&h("img",{className:"yvlw-h-10",src:e.logo,alt:"Logo"})})})})}const mo="colorScheme";function Ss(){const{namespace:e}=Ne(),t=()=>{const o=localStorage.getItem(mo);return!o&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":o},n=(o=null)=>{o&&localStorage.setItem(mo,o);const i=`${e}-color-scheme`,a=document.documentElement;o&&o==="dark"?a==null||a.setAttribute(i,"dark"):a==null||a.removeAttribute(i)};return{setColorScheme:n,toggleColorScheme:()=>{const o=t();return n(o==="dark"?"light":"dark")},getColorScheme:t}}const Ms={root:"_root_bcsvc_1"};function Ps(){if(!(window.screen.width>=900))return 10/9}function wn(e){const{children:t,onStream:n=()=>{},onRecord:r=()=>{}}=e,o=g(null),i=g(0),a=g(null),{start:s,stop:l}=fo({onRecord:r}),u=async()=>{try{const p=await navigator.mediaDevices.getUserMedia({video:{aspectRatio:{exact:Ps()}}});a.current=p,s(p),o.current&&(o.current.srcObject=p)}catch{}},d=()=>{a.current&&(a.current.getTracks().forEach(p=>p.stop()),a.current=null,l(),o.current&&(o.current.srcObject=null))},c=()=>{n(o),i.current=requestAnimationFrame(c)};return N(()=>{const p=o.current;if(!p)return;const f=()=>{i.current=requestAnimationFrame(c)};return u(),p.addEventListener("canplay",f),()=>{p.removeEventListener("canplay",f),cancelAnimationFrame(i.current),d()}},[]),h("div",{className:Ms.root,children:[h("video",{ref:o,autoPlay:!0,loop:!0,playsInline:!0}),t]})}const Je={container:"_container_mcmsr_1",focused:"_focused_mcmsr_12",progress:"_progress_mcmsr_15",completed:"_completed_mcmsr_36",marker:"_marker_mcmsr_40"},yo=360,Ns=50;function Ls(e){const{visitedSections:t,sectionsCount:n,faceDetected:r,divisions:o=Ns}=e,i=M(()=>{const a=[Je.container];return r&&a.push(Je.focused),a.join(" ")},[r]);return h("div",{className:i,children:[h(oe,{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:h("div",{className:Je.progress,children:Array.from(Array(o).keys()).map(a=>{const s=a*yo/o,l=Math.ceil((s+1)*n/yo),u=t.includes(l),d=u?a-(l-1)*(o/n):0,c=[];u&&c.push(Je.completed);const p=u?"translateX(158px)":"translateX(150px)";return h("div",{className:c.join(" "),style:{transform:`rotate(${s}deg) ${p}`,transitionDelay:`${d*20}ms`}},`key-${a}`)})})}),h(oe,{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:h("div",{className:Je.marker,children:[h("div",{}),h("div",{}),h("div",{}),h("div",{})]})})]})}function As(){return{checkZoomLevel:(r,o)=>{const{box:i}=r,{width:a,height:s}=i,l=a*s,u=o**2,d=l/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:a}=o,{box:s}=r;if(!(s.xMin-i>=o.x&&s.yMin-a>=o.y&&s.xMax-i<=o.x+o.width&&s.yMax-a<=o.y+o.height))throw new Error("Position head in frame")}}}function bn(e={}){const{validations:t=["zoom"],frameSize:n,onFace:r=()=>{},onError:o=()=>{}}=e,{faceDetector:i,savePhoto:a}=Ne(),s=g(!1),l=g(!1),{checkFacialFeatures:u,checkZoomLevel:d,checkInFrame:c}=As(),p=g(null),f=(y,m)=>{var _;try{if(y.length===0)throw new Error("Detecting face...");if(y.length>1)throw new Error("A maximum of 1 face is allowed");const w=p.current,b=(_=p.current)==null?void 0:_.parentElement;if(!w||!b)return;const C=y[0];for(const E of t)switch(E){case"zoom":d(C,Math.min(b.clientHeight,b.clientWidth));break;case"features":u(C,Math.min(b.clientHeight,b.clientWidth));break;case"in-frame":if(!n)throw new Error("Frame size is required to check if face is in frame");const P=n+200;c(C,{x:(b.clientWidth-P)/2,y:(b.clientHeight-P)/2,width:P,height:P,offsetX:(w.videoWidth-b.clientWidth)/2,offsetY:(w.videoHeight-b.clientHeight)/2});break;default:break}if(!l.current)throw s.current||(s.current=!0,setTimeout(()=>{a(m),l.current=!0},3e3)),new Error("Keep head still for a photograph");r(C)}catch(w){const{message:b}=w;o(b)}};return{detectFaces:async y=>{if(!i)return;const{ref:m}=y;p.current=m.current;const _=p.current;if(!_)throw new Error("No Video Source detected");const{videoWidth:w,videoHeight:b}=_;if(w===0||b===0)return;const C=uo(_,w,b),E=await Pe.detectFaces(i,C);f(E,_)}}}const ae={root:"_root_1psx5_1",container:"_container_1psx5_4",progress:"_progress_1psx5_7",intro:"_intro_1psx5_12",content:"_content_1psx5_15",branding:"_branding_1psx5_18",instructionsContainer:"_instructionsContainer_1psx5_22",instructions:"_instructions_1psx5_22"},go={root:"_root_h5elg_1",spinner:"_spinner_h5elg_22"},wo={container:"_container_1vep2_1",spin:"_spin_1vep2_1",md:"_md_1vep2_7",lg:"_lg_1vep2_10"};function bo(e){const{size:t="md",className:n=""}=e;return h("span",{className:`${wo.container} ${wo[t]} ${n}`})}function et(e){const{Icon:t,description:n,title:r,actionText:o="Okay, got it",onActionClick:i=()=>{},loading:a=!1,children:s,hideButton:l=!1}=e;return h("div",{className:go.root,children:[h(t,{size:"custom",className:"yvlw-h-20 yvlw-mx-auto yvlw-mb-12"}),h("h2",{children:r}),h("p",{className:"subtext",children:n}),!l&&h("div",{className:"yvlw-mt-12",children:h(ki,{onClick:()=>i(),className:"yvlw-flex yvlw-items-center yvlw-space-x-3",disabled:a,children:[h("span",{className:"yvlw-flex-1 yvlw-flex yvlw-items-center yvlw-space-x-1 yvlw-justify-center",children:o}),a&&h(bo,{className:go.spinner})]})}),s]})}const Ct="yvlw-absolute yvlw-w-full yvlw-h-full",kt="yvlw-transform yvlw-transition yvlw-ease-in yvlw-duration-300",xt="yvlw-transform yvlw-transition yvlw-ease-in yvlw-duration-300";function $n(e){const{children:t,instruction:n,name:r,completed:o,failed:i,onStart:a=()=>{},onReset:s=()=>{}}=e,[l,u]=F(!1),{completedCount:d,tasks:c,nextTask:p}=Ne(),f=M(()=>po[r],[r]),v=M(()=>d*100/c.length,[d,c.length]);return h("div",{className:ae.root,children:h("div",{className:`${ae.container} view`,children:[h("div",{style:{width:`${v}%`},className:ae.progress}),h(oe,{show:!l&&!o&&!i,as:"div",enter:kt,enterFrom:"yvlw--translate-x-full",enterTo:"yvlw-translate-x-0",leave:xt,leaveFrom:"yvlw-translate-x-0",leaveTo:"yvlw--translate-x-full",className:Ct,children:h("div",{className:`${ae.intro}`,children:h(et,{Icon:f.Icon,title:`${f.name.slice(0,-2)}`,description:`${f.description}. Proper lightning helps with getting faster and more accurate results.`,onActionClick:async()=>{await a(),u(!0)},actionText:"Okay, got it!"})})}),h(oe,{as:"div",show:l&&!o&&!i,enter:kt,enterFrom:"yvlw-translate-x-full",enterTo:"yvlw-translate-x-0",leave:xt,leaveFrom:"yvlw-translate-x-0",leaveTo:"yvlw-translate-x-full",className:Ct,children:[h("div",{className:`${ae.content}`,children:t}),h("div",{className:ae.instructionsContainer,children:[h("div",{className:ae.instructions,children:[h("h2",{children:n.title}),h("p",{className:"subtext",children:n.description})]}),h("div",{className:ae.branding,children:[h("span",{children:"Powered by"})," ",h(vs,{size:"custom",className:"yvlw-h-3"})]})]})]}),h(oe,{show:o,as:"div",enter:kt,enterFrom:"yvlw-translate-x-full",enterTo:"yvlw-translate-x-0",leave:xt,leaveFrom:"yvlw-translate-x-0",leaveTo:"yvlw-translate-x-full",className:Ct,children:h("div",{className:`${ae.intro}`,children:h(et,{Icon:f.Icon,title:"One task down!",description:`You have completed the ${f.name.slice(0,-2)} task. Click on the button below button to proceed.`,onActionClick:()=>p(),actionText:"Next"})})}),h(oe,{show:i,as:"div",enter:kt,enterFrom:"yvlw-translate-x-full",enterTo:"yvlw-translate-x-0",leave:xt,leaveFrom:"yvlw-translate-x-0",leaveTo:"yvlw-translate-x-full",className:Ct,children:h("div",{className:`${ae.intro}`,children:h(et,{Icon:hs,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 En(e={}){const{timeout:t,onTimeout:n=()=>{}}=e,[r,o]=F(!1),i=g(null),a=A(()=>{t&&i.current&&clearTimeout(i.current)},[]),s=A(()=>{t&&(i.current=setTimeout(()=>{o(!0),n()},t))},[]),l=A(()=>{o(!1),s()},[]);return N(()=>a,[]),{timedOut:r,reset:l,start:s,stop:a}}const Is=1,Tn=8,$o="Place face in frame";function Hs(e){const{difficulty:t,timeout:n}=e,{saveStream:r}=Ne(),[o,i]=F([]),[a,s]=F($o),[l,u]=F(!1),[d,c]=F(!1),p=g(new Set),f=g(!1),v=g(null),{reset:y,start:m,stop:_,timedOut:w}=En({timeout:n}),b=()=>{i([]),s($o),u(!1),c(!1),p.current=new Set,f.current=!1,v.current=null,y()},C=$=>{const x=$*Tn,S=Math.ceil((x+1)/Ts);p.current.has(S)||(p.current.add(S),i(Array.from(p.current))),p.current.size>=Tn&&(_(),setTimeout(()=>{c(!0)},1e3))},E=($,x)=>{let I=Math.atan2(x,$)*(180/Math.PI);return I<0&&(I+=360),I},P=M(()=>{if(p.current.size===0)return 25;switch(t){case"easy":return 5;case"hard":return 15;default:return 10}},[]),R=$=>{const{keypoints:x,box:S}=$,I={x:S.width*.5,y:S.height*.5},X=x[Is],se={y:X.y-S.yMin,x:X.x-S.xMin},te=I.x-se.x,ne=se.y-I.y;return Math.abs(te)<P&&Math.abs(ne)<P?null:E(te,ne)},{detectFaces:V}=bn({frameSize:280,validations:["zoom","in-frame"],onFace:$=>{u(!0),s("Slowly move head around to complete circle");const x=R($);x&&C(x)},onError:$=>{s($),i([]),p.current.clear(),v.current=null,f.current=!1}});return h(H,{children:h($n,{instruction:{title:a,description:l?void 0:"Always ensure face is in frame"},name:"complete-the-circle",completed:d,failed:w,onReset:b,onStart:m,children:h(wn,{onStream:$=>{try{if(!$.current||d)return;const{videoWidth:x}=$.current;V({ref:$,frameSize:x})}catch{}},onRecord:r,children:h(Ls,{faceDetected:l,sectionsCount:Tn,visitedSections:o})})})})}const Cn={root:"_root_thujo_1",sticker:"_sticker_thujo_4",no:"_no_thujo_7",yes:"_yes_thujo_12"};function Ds(e){const{show:t,stickers:n}=e;return h(H,{children:t&&h("div",{className:Cn.root,children:n.map(r=>h("div",{className:`${Cn.sticker} ${Cn[r]}`,children:r.toUpperCase()},`sticker-${r}`))})})}const Os={question:"Are you alive?",errorMessage:"You have to be alive to proceed though",answer:!0},Rs="Wrong answer. Try again",Eo="Keep face in camera";function Vs(e){const{difficulty:t,questions:n=[Os],timeout:r}=e,[o,i]=F(Eo),[a,s]=F(!1),[l,u]=F(!1),{saveStream:d}=Ne(),c=g("inactive"),p=g(0),f=g(!1),v=g(null),y=g(null),m=()=>{v.current&&clearTimeout(v.current),y.current&&clearTimeout(y.current)},{reset:_,start:w,stop:b,timedOut:C}=En({timeout:r,onTimeout:m}),E=()=>{i(Eo),s(!1),u(!1),c.current="inactive",p.current=0,f.current=!1,_()},P=S=>{const{keypoints:I}=S,X=I[1],se=I[9],te=X.x-se.x,ne=X.y-se.y;return 90-Math.atan2(ne,te)*(180/Math.PI)},R=S=>{c.current="inactive",i(n[S].question),v.current=setTimeout(()=>{c.current="active"},2e3)},V=M(()=>{switch(t){case"easy":return 2;case"hard":return 6;default:return 4}},[]),W=S=>{try{if(c.current="inactive",Math.abs(S)<V)throw new Error("Tilt head further to answer");const I=S>0,X=n[p.current].answer;if(I===X)p.current+=1,p.current===n.length?(u(!0),b()):R(p.current);else throw new Error(n[p.current].errorMessage||Rs)}catch(I){i(I.message),y.current=setTimeout(()=>{R(p.current)},2e3)}},{detectFaces:$}=bn({onFace:S=>{if(f.current||(s(!0),f.current=!0,R(p.current)),c.current==="inactive")return;const I=P(S);W(I)},onError:S=>{i(S)}}),x=S=>{try{if(!S.current||l)return;const{videoWidth:I}=S.current;$({ref:S,frameSize:I})}catch{}};return N(()=>m,[]),h($n,{instruction:{title:o,description:a?"":"Move head left for No and right for Yes"},name:"yes-or-no",failed:C,onReset:E,onStart:w,completed:l,children:h(wn,{onStream:x,onRecord:d,children:h(Ds,{show:a,stickers:["yes","no"]})})})}function Us(e={}){const{onChange:t=()=>{}}=e,n=!!window.DeviceOrientationEvent,r=o=>{t({alpha:o.alpha,beta:o.beta,gamma:o.gamma})};return N(()=>(window.addEventListener("deviceorientation",r),()=>{window.removeEventListener("deviceorientation",r)}),[]),{canUse:n}}function Ws(e){const{total:t,onMessage:n,onComplete:r,difficulty:o}=e,i=g(null),a=g(!0),s=g(null),l=g(null),u=g(0),d=g(!1),c=M(()=>{switch(o){case"easy":return 6;case"hard":return 10;default:return 8}},[]),p=()=>{if(u.current<t){const m=t-u.current;let _=`Nod head ${m} `;m<t&&(_+="more "),_+=m>1?"times":"time",n(_);return}d.current=!0,n("Great, hang on..."),setTimeout(()=>{r()},500)},{canUse:f}=Us({onChange:m=>{l.current=m}});return{evaluate:m=>{if(!f){n("Cannot perform task. Transfer to mobile device to complete");return}if(!l.current||!l.current.beta){n("Cannot perform task. Transfer to mobile device to complete");return}if(l.current.beta<60||l.current.beta>100){n("Keep phone in upright position to continue");return}if(d.current)return;const{keypoints:_}=m,w=Oe(_[6].x-_[8].x,_[6].y-_[8].y),C=Oe(_[2].x-_[1].x,_[2].y-_[1].y)/w*10;if(C>c){if(i.current||!a.current)return;i.current=C,a.current=!1,s.current=setTimeout(()=>{i.current=null},3e3)}else i.current&&i.current-C>c/2&&(u.current+=1,i.current=null,s.current&&clearTimeout(s.current)),a.current=!0;p()},reset:()=>{i.current=null,a.current=!0,s.current=null,l.current=null,u.current=0,d.current=!1}}}function zs(e){const{onMessage:t,onComplete:n,difficulty:r}=e,o=g(!1),i=M(()=>{switch(r){case"easy":return 80;case"hard":return 120;default:return 100}},[]);return{evaluate:l=>{if(o.current)return;const{keypoints:u}=l,d=Oe(u[6].x-u[8].x,u[6].y-u[8].y);if(Oe(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 js(e){const{total:t,onMessage:n,onComplete:r,difficulty:o}=e,i=g(!0),a=g(!1),s=g(null),l=g(0),u=M(()=>{switch(o){case"easy":return{closed:20,open:30};case"hard":return{closed:10,open:30};default:return{closed:15,open:30}}},[]),d=y=>{i.current&&(y>=u.closed||(i.current=!1,s.current=Date.now()))},c=y=>{if(!i.current&&!(y<u.open)&&(i.current=!0,s.current)){const m=Date.now(),_=s.current;(m-_)/1e3<=2&&(l.current+=1)}},p=()=>{if(l.current<t){const y=t-l.current;let m=`Blink right eye ${y} `;y<t&&(m+="more "),m+=y>1?"times":"time",n(m);return}a.current=!0,n("Great, hang on..."),setTimeout(()=>{r()},500)};return{evaluate:y=>{if(a.current)return;const{keypoints:m}=y,_=Oe(m[6].x-m[8].x,m[6].y-m[8].y),b=Oe(m[145].x-m[159].x,m[145].y-m[159].y)/_*100;d(b),c(b),p()},reset:()=>{i.current=!0,a.current=!1,s.current=null,l.current=0}}}function Bs(){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 To=(e=>(e.nod="nod",e.open_mouth="open_mouth",e.blink="blink",e))(To||{});const Co=ws(Object.keys(To)),ko="Keep face in camera";function qs(e){const{difficulty:t,maxBlinks:n=5,maxNods:r=5,timeout:o}=e,i=g(0),[a,s]=F(ko),[l,u]=F(!1),[d,c]=F(null),p=g(!1),{requestDeviceOrientationPermission:f}=Bs(),{reset:v,start:y,stop:m,timedOut:_}=En({timeout:o}),w=()=>{if(i.current===Co.length-1){u(!0),m();return}i.current+=1},b=Ws({total:Math.floor(Math.random()*r+1),difficulty:t,onMessage:$=>s($),onComplete:w}),C=zs({difficulty:t,onMessage:$=>s($),onComplete:w}),E=js({total:Math.floor(Math.random()*n+1),difficulty:t,onMessage:$=>s($),onComplete:w}),{detectFaces:P}=bn({onFace:$=>{switch(p.current||(p.current=!0),Co[i.current]){case"nod":b.evaluate($);break;case"open_mouth":C.evaluate($);break;case"blink":E.evaluate($);break}},onError:$=>{s($)}}),R=()=>{i.current=0,s(ko),u(!1),p.current=!1,E.reset(),b.reset(),C.reset(),v()},V=async $=>{try{if(!$.current||l)return;const{videoWidth:x}=$.current;await P({ref:$,frameSize:x,throttleInterval:500})}catch{}},W=async()=>{try{await f()}catch($){const x=$;s(x.message),c(x)}};return h($n,{instruction:{title:a,description:"Follow the directives as instructed"},name:"motions",failed:_,onReset:R,completed:l,onStart:async()=>{await W(),y()},children:d?h(H,{}):h(wn,{onStream:V})})}function Ys(){var C;const{toggleColorScheme:e,getColorScheme:t,setColorScheme:n}=Ss(),{user:r,tasks:o,currentTaskIndex:i,completed:a,onComplete:s,faceDetector:l,presentation:u}=Ne(),[d,c]=F(!1),[p,f]=F(!1),[v,y]=F(null),[m,_]=F(!1);N(()=>{const E=t();n(E)},[]);const w=async()=>{try{c(!0),y(null),await s(),u==="page"&&_(!0)}catch(E){y(E.message)}finally{c(!1)}},b=A(E=>E===i?K.active:i>E?K.completed:"subtext",[i]);return h("div",{className:K.root,children:h("div",{className:K.container,children:[h("div",{className:`${K.lhs} divider`,children:[h("div",{className:K.info,children:[h(Fs,{}),h("div",{children:h("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."})}),h("ol",{children:[o.map((E,P)=>h("li",{className:b(P),children:po[E.id].name},`task-${P}`)),h("li",{className:a?K.active:"",children:"Complete! 🎉"})]})]}),h("footer",{className:"divider",children:[h("div",{children:"Powered by Youverify"}),h("div",{onClick:()=>e(),role:"button",children:[h("div",{className:"dark:yvlw-hidden",children:h(co,{})}),h("div",{className:"yvlw-hidden dark:yvlw-block",children:h(ls,{})})]})]})]}),h("div",{className:K.main,children:h("div",{className:K.content,children:[h(oe,{show:!p,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:h("div",{className:K.completed,children:l?h(et,{Icon:fs,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.",actionText:"Start Liveness Test",onActionClick:()=>f(!0)}):h(bo,{size:"lg"})})}),o.map((E,P)=>{let R;switch(E.id){case"complete-the-circle":R=h(Hs,{...E});break;case"yes-or-no":R=h(Vs,{...E});break;case"motions":R=h(qs,{...E});break;default:R=h(H,{});break}return h(oe,{show:p&&!a&&i===P,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:R},`task-${P}`)}),h(oe,{show:p&&a,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:h("div",{className:K.completed,children:h(et,{Icon:ps,title:m?"All Set!":"Completed",description:m?"You can now close or exit the window":"Your Identity verification has been completed successfully. Thanks for your patience",actionText:"Finish",loading:d,onActionClick:w,hideButton:m,children:v&&h("div",{className:"yvlw-mt-3",children:v})})})})]})}),h("div",{className:`${K.rhs} divider`,children:r&&h("div",{className:`${K.profile} divider`,children:[h("div",{children:h("div",{className:K.avatar,children:[r.firstName.charAt(0).toUpperCase(),(C=r.lastName)==null?void 0:C.charAt(0).toUpperCase()]})}),h("div",{children:[h("h4",{children:[r.firstName," ",r.lastName]}),r.email&&h("p",{className:"subtext",children:r.email})]})]})})]})})}function Ks(e){const{tasks:t,namespace:n,user:r,branding:o,onClose:i=()=>{},onSuccess:a,onFailure:s,presentation:l="modal",publicKey:u,metadata:d,sandboxEnvironment:c}=e,[p,f]=F(e.show),v=()=>{f(!1),i()};return h(xs,{namespace:n,publicKey:u,tasks:t,user:r,branding:o,onRequestClose:v,onSuccess:a,onFailure:s,metadata:d,presentation:l,sandboxEnvironment:c,children:h(as,{id:n,open:l==="page"?!0:p,onClose:v,transition:!0,className:`${ss.root} ${Tt.root} ${Tt[l]}`,style:{"--branding-color":(o==null?void 0:o.color)??Cs},children:[l==="modal"&&h("div",{onClick:v,role:"button",className:Tt.close,children:h(_s,{className:"yvlw-text-white"})}),h(lo,{className:`${Tt.container}`,children:h(Ys,{})})]})})}class Gs{constructor(t){this.tasks=[],this.container=null,this.namespace="liveness-web-sdk";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),Le(h(Ks,{namespace:this.namespace,publicKey:this.props.publicKey,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 Gs});
|
|
5
|
+
`))}else{let p=d.props,f=p==null?void 0:p.className,v=typeof f=="function"?(..._)=>an(f(..._),l.className):an(f,l.className),y=v?{className:v}:{},m=Ar(d.props,Fe(sn(l,["ref"])));for(let _ in c)_ in m&&delete c[_];return qt(d,Object.assign({},m,c,u,{ref:o(d.ref,u.ref)},y))}return Q(i,Object.assign({},sn(l,["ref"]),i!==H&&u,i!==H&&c),d)}function $i(...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 Ar(...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 a=n[r];for(let s of a){if((o instanceof Event||(o==null?void 0:o.nativeEvent)instanceof Event)&&o.defaultPrevented)return;s(o,...i)}}});return t}function Ei(...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 a of i)a==null||a(...o)}});return t}function q(e){var t;return Object.assign(jt(e),{displayName:(t=e.displayName)!=null?t:e.name})}function Fe(e){let t=Object.assign({},e);for(let n in t)t[n]===void 0&&delete t[n];return t}function sn(e,t=[]){let n=Object.assign({},e);for(let r of t)r in n&&delete n[r];return n}let Ti="button";function Ci(e,t){var n;let r=Lr(),{disabled:o=r||!1,autoFocus:i=!1,...a}=e,{isFocusVisible:s,focusProps:l}=hi({autoFocus:i}),{isHovered:u,hoverProps:d}=pi({isDisabled:o}),{pressed:c,pressProps:p}=wi({disabled:o}),f=Ei({ref:t,type:(n=a.type)!=null?n:"button",disabled:o||void 0,autoFocus:i},l,d,p),v=M(()=>({disabled:o,hover:u,focus:s,active:c,autofocus:i}),[o,u,s,c,i]);return G({ourProps:f,theirProps:a,slot:v,defaultTag:Ti,name:"Button"})}let ki=q(Ci),xi="div";var mt=(e=>(e[e.None=1]="None",e[e.Focusable=2]="Focusable",e[e.Hidden=4]="Hidden",e))(mt||{});function Fi(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 G({ourProps:i,theirProps:o,slot:{},defaultTag:xi,name:"Hidden"})}let ln=q(Fi),Si=Y(null);function Mi({children:e}){let t=j(Si);if(!t)return T.createElement(T.Fragment,null,e);let{target:n}=t;return n?lt(T.createElement(T.Fragment,null,e),n):null}let Ir=Symbol();function Pi(e,t=!0){return Object.assign(e,{[Ir]:t})}function re(...e){let t=g(e);N(()=>{t.current=e},[e]);let n=D(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[Ir]))?void 0:n}let cn=Y(null);cn.displayName="DescriptionContext";function Hr(){let e=j(cn);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,Hr),t}return e}function Ni(){let[e,t]=F([]);return[e.length>0?e.join(" "):void 0,M(()=>function(n){let r=D(i=>(t(a=>[...a,i]),()=>t(a=>{let s=a.slice(),l=s.indexOf(i);return l!==-1&&s.splice(l,1),s}))),o=M(()=>({register:r,slot:n.slot,name:n.name,props:n.props,value:n.value}),[r,n.slot,n.name,n.props,n.value]);return T.createElement(cn.Provider,{value:o},n.children)},[t])]}let Li="p";function Ai(e,t){let n=he(),r=Lr(),{id:o=`headlessui-description-${n}`,...i}=e,a=Hr(),s=re(t);B(()=>a.register(o),[o,a.register]);let l=r||!1,u=M(()=>({...a.slot,disabled:l}),[a.slot,l]),d={ref:s,...a.props,id:o};return G({ourProps:d,theirProps:i,slot:u,defaultTag:Li,name:a.name||"Description"})}let Ii=q(Ai),Hi=Object.assign(Ii,{});var Dr=(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))(Dr||{});let Di=Y(()=>{});function Oi({value:e,children:t}){return T.createElement(Di.Provider,{value:e},t)}let Ri=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 Or(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 a=t[o].call(n,...i);a&&(n=a,r.forEach(s=>s()))}}}function Rr(e){return ct(e.subscribe,e.getSnapshot,e.getSnapshot)}let Vi=new Ri(()=>Or(()=>[],{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 De(e,t){let n=Vi.get(t),r=he(),o=Rr(n);if(B(()=>{if(e)return n.dispatch("ADD",r),()=>n.dispatch("REMOVE",r)},[n,e]),!e)return!1;let i=o.indexOf(r),a=o.length;return i===-1&&(i=a,a+=1),i===a-1}let un=new Map,Ye=new Map;function Vr(e){var t;let n=(t=Ye.get(e))!=null?t:0;return Ye.set(e,n+1),n!==0?()=>Ur(e):(un.set(e,{"aria-hidden":e.getAttribute("aria-hidden"),inert:e.inert}),e.setAttribute("aria-hidden","true"),e.inert=!0,()=>Ur(e))}function Ur(e){var t;let n=(t=Ye.get(e))!=null?t:1;if(n===1?Ye.delete(e):Ye.set(e,n-1),n!==1)return;let r=un.get(e);r&&(r["aria-hidden"]===null?e.removeAttribute("aria-hidden"):e.setAttribute("aria-hidden",r["aria-hidden"]),e.inert=r.inert,un.delete(e))}function Ui(e,{allowed:t,disallowed:n}={}){let r=De(e,"inert-others");B(()=>{var o,i;if(!r)return;let a=_e();for(let l of(o=n==null?void 0:n())!=null?o:[])l&&a.add(Vr(l));let s=(i=t==null?void 0:t())!=null?i:[];for(let l of s){if(!l)continue;let u=ft(l);if(!u)continue;let d=l.parentElement;for(;d&&d!==u.body;){for(let c of d.children)s.some(p=>c.contains(p))||a.add(Vr(c));d=d.parentElement}}return a.dispose},[r,t,n])}function Wr(e,t,n){let r=xe(o=>{let i=o.getBoundingClientRect();i.x===0&&i.y===0&&i.width===0&&i.height===0&&n()});N(()=>{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 a=new ResizeObserver(()=>r.current(o));a.observe(o),i.add(()=>a.disconnect())}if(typeof IntersectionObserver<"u"){let a=new IntersectionObserver(()=>r.current(o));a.observe(o),i.add(()=>a.disconnect())}return()=>i.dispose()},[t,r,e])}let dn=["[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(","),Wi=["[data-autofocus]"].map(e=>`${e}:not([tabindex='-1'])`).join(",");var fe=(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))(fe||{}),fn=(e=>(e[e.Error=0]="Error",e[e.Overflow=1]="Overflow",e[e.Success=2]="Success",e[e.Underflow=3]="Underflow",e))(fn||{}),zi=(e=>(e[e.Previous=-1]="Previous",e[e.Next=1]="Next",e))(zi||{});function ji(e=document.body){return e==null?[]:Array.from(e.querySelectorAll(dn)).sort((t,n)=>Math.sign((t.tabIndex||Number.MAX_SAFE_INTEGER)-(n.tabIndex||Number.MAX_SAFE_INTEGER)))}function Bi(e=document.body){return e==null?[]:Array.from(e.querySelectorAll(Wi)).sort((t,n)=>Math.sign((t.tabIndex||Number.MAX_SAFE_INTEGER)-(n.tabIndex||Number.MAX_SAFE_INTEGER)))}var zr=(e=>(e[e.Strict=0]="Strict",e[e.Loose=1]="Loose",e))(zr||{});function qi(e,t=0){var n;return e===((n=ft(e))==null?void 0:n.body)?!1:ve(t,{0(){return e.matches(dn)},1(){let r=e;for(;r!==null;){if(r.matches(dn))return!0;r=r.parentElement}return!1}})}var Yi=(e=>(e[e.Keyboard=0]="Keyboard",e[e.Mouse=1]="Mouse",e))(Yi||{});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 pe(e){e==null||e.focus({preventScroll:!0})}let Ki=["textarea","input"].join(",");function Gi(e){var t,n;return(n=(t=e==null?void 0:e.matches)==null?void 0:t.call(e,Ki))!=null?n:!1}function Zi(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 a=o.compareDocumentPosition(i);return a&Node.DOCUMENT_POSITION_FOLLOWING?-1:a&Node.DOCUMENT_POSITION_PRECEDING?1:0})}function Ke(e,t,{sorted:n=!0,relativeTo:r=null,skipElements:o=[]}={}){let i=Array.isArray(e)?e.length>0?e[0].ownerDocument:document:e.ownerDocument,a=Array.isArray(e)?n?Zi(e):e:t&64?Bi(e):ji(e);o.length>0&&a.length>1&&(a=a.filter(f=>!o.some(v=>v!=null&&"current"in v?(v==null?void 0:v.current)===f:v===f))),r=r??i.activeElement;let s=(()=>{if(t&5)return 1;if(t&10)return-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),l=(()=>{if(t&1)return 0;if(t&2)return Math.max(0,a.indexOf(r))-1;if(t&4)return Math.max(0,a.indexOf(r))+1;if(t&8)return a.length-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),u=t&32?{preventScroll:!0}:{},d=0,c=a.length,p;do{if(d>=c||d+c<=0)return 0;let f=l+d;if(t&16)f=(f+c)%c;else{if(f<0)return 3;if(f>=c)return 1}p=a[f],p==null||p.focus(u),d+=s}while(p!==i.activeElement);return t&6&&Gi(p)&&p.select(),2}function jr(){return/iPhone/gi.test(window.navigator.platform)||/Mac/gi.test(window.navigator.platform)&&window.navigator.maxTouchPoints>0}function Xi(){return/Android/gi.test(window.navigator.userAgent)}function Qi(){return jr()||Xi()}function Ge(e,t,n,r){let o=xe(n);N(()=>{if(!e)return;function i(a){o.current(a)}return document.addEventListener(t,i,r),()=>document.removeEventListener(t,i,r)},[e,t,r])}function Br(e,t,n,r){let o=xe(n);N(()=>{if(!e)return;function i(a){o.current(a)}return window.addEventListener(t,i,r),()=>window.removeEventListener(t,i,r)},[e,t,r])}const qr=30;function Ji(e,t,n){let r=De(e,"outside-click"),o=xe(n),i=A(function(l,u){if(l.defaultPrevented)return;let d=u(l);if(d===null||!d.getRootNode().contains(d)||!d.isConnected)return;let c=function p(f){return typeof f=="function"?p(f()):Array.isArray(f)||f instanceof Set?f:[f]}(t);for(let p of c){if(p===null)continue;let f=p instanceof HTMLElement?p:p.current;if(f!=null&&f.contains(d)||l.composed&&l.composedPath().includes(f))return}return!qi(d,zr.Loose)&&d.tabIndex!==-1&&l.preventDefault(),o.current(l,d)},[o]),a=g(null);Ge(r,"pointerdown",l=>{var u,d;a.current=((d=(u=l.composedPath)==null?void 0:u.call(l))==null?void 0:d[0])||l.target},!0),Ge(r,"mousedown",l=>{var u,d;a.current=((d=(u=l.composedPath)==null?void 0:u.call(l))==null?void 0:d[0])||l.target},!0),Ge(r,"click",l=>{Qi()||a.current&&(i(l,()=>a.current),a.current=null)},!0);let s=g({x:0,y:0});Ge(r,"touchstart",l=>{s.current.x=l.touches[0].clientX,s.current.y=l.touches[0].clientY},!0),Ge(r,"touchend",l=>{let u={x:l.changedTouches[0].clientX,y:l.changedTouches[0].clientY};if(!(Math.abs(u.x-s.current.x)>=qr||Math.abs(u.y-s.current.y)>=qr))return i(l,()=>l.target instanceof HTMLElement?l.target:null)},!0),Br(r,"blur",l=>i(l,()=>window.document.activeElement instanceof HTMLIFrameElement?window.document.activeElement:null),!0)}function Ze(...e){return M(()=>ft(...e),[...e])}function Yr(e,t,n,r){let o=xe(n);N(()=>{e=e??window;function i(a){o.current(a)}return e.addEventListener(t,i,r),()=>e.removeEventListener(t,i,r)},[e,t,r])}function ea(){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 ta(){return jr()?{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 s=_e();s.style(e.documentElement,"scrollBehavior","auto"),t.add(()=>t.microTask(()=>s.dispose()))}let i=(o=window.scrollY)!=null?o:window.pageYOffset,a=null;t.addEventListener(e,"click",s=>{if(s.target instanceof HTMLElement)try{let l=s.target.closest("a");if(!l)return;let{hash:u}=new URL(l.href),d=e.querySelector(u);d&&!r(d)&&(a=d)}catch{}},!0),t.addEventListener(e,"touchstart",s=>{if(s.target instanceof HTMLElement)if(r(s.target)){let l=s.target;for(;l.parentElement&&r(l.parentElement);)l=l.parentElement;t.style(l,"overscrollBehavior","contain")}else t.style(s.target,"touchAction","none")}),t.addEventListener(e,"touchmove",s=>{if(s.target instanceof HTMLElement){if(s.target.tagName==="INPUT")return;if(r(s.target)){let l=s.target;for(;l.parentElement&&l.dataset.headlessuiPortal!==""&&!(l.scrollHeight>l.clientHeight||l.scrollWidth>l.clientWidth);)l=l.parentElement;l.dataset.headlessuiPortal===""&&s.preventDefault()}else s.preventDefault()}},{passive:!1}),t.add(()=>{var s;let l=(s=window.scrollY)!=null?s:window.pageYOffset;i!==l&&window.scrollTo(0,i),a&&a.isConnected&&(a.scrollIntoView({block:"nearest"}),a=null)})})}}:{}}function na(){return{before({doc:e,d:t}){t.style(e.documentElement,"overflow","hidden")}}}function ra(e){let t={};for(let n of e)Object.assign(t,n(t));return t}let Se=Or(()=>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:ra(n)},o=[ta(),ea(),na()];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)}});Se.subscribe(()=>{let e=Se.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)&&Se.dispatch(n.count>0?"SCROLL_PREVENT":"SCROLL_ALLOW",n),n.count===0&&Se.dispatch("TEARDOWN",n)}});function oa(e,t,n=()=>({containers:[]})){let r=Rr(Se),o=t?r.get(t):void 0,i=o?o.count>0:!1;return B(()=>{if(!(!t||!e))return Se.dispatch("PUSH",t,n),()=>Se.dispatch("POP",t,n)},[e,t]),i}function ia(e,t,n=()=>[document.body]){let r=De(e,"scroll-lock");oa(r,t,o=>{var i;return{containers:[...(i=o.containers)!=null?i:[],n]}})}function aa(e){let t={called:!1};return(...n)=>{if(!t.called)return t.called=!0,e(...n)}}function sa(e=0){let[t,n]=F(e),r=A(l=>n(l),[t]),o=A(l=>n(u=>u|l),[t]),i=A(l=>(t&l)===l,[t]),a=A(l=>n(u=>u&~l),[n]),s=A(l=>n(u=>u^l),[n]);return{flags:t,setFlag:r,addFlag:o,hasFlag:i,removeFlag:a,toggleFlag:s}}var la=(e=>(e[e.None=0]="None",e[e.Closed=1]="Closed",e[e.Enter=2]="Enter",e[e.Leave=4]="Leave",e))(la||{});function ca(e){let t={};for(let n in e)e[n]===!0&&(t[`data-${n}`]="");return t}function ua(e,t,n,r){let[o,i]=F(n),{hasFlag:a,addFlag:s,removeFlag:l}=sa(e&&o?3:0),u=g(!1),d=g(!1),c=ht();return B(function p(){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),da(v,{inFlight:u,prepare(){d.current?d.current=!1:d.current=u.current,u.current=!0,!d.current&&(n?(s(3),l(4)):(s(4),l(2)))},run(){d.current?n?(l(3),s(4)):(l(4),s(3)):n?l(1):s(1)},done(){var y;d.current&&typeof v.getAnimations=="function"&&v.getAnimations().length>0||(u.current=!1,l(7),n||i(!1),(y=r==null?void 0:r.end)==null||y.call(r,n))}})):n?(s(3),c.nextFrame(()=>p())):void 0},[e,n,t,c]),e?[o,{closed:a(1),enter:a(2),leave:a(4),transition:a(2)||a(4)}]:[n,{closed:void 0,enter:void 0,leave:void 0,transition:void 0}]}function da(e,{prepare:t,run:n,done:r,inFlight:o}){let i=_e();return pa(e,{prepare:t,inFlight:o}),i.nextFrame(()=>{i.add(fa(e,r)),n()}),i.dispose}function fa(e,t){let n=aa(t),r=_e();if(!e)return r.dispose;let{transitionDuration:o,transitionDelay:i}=getComputedStyle(e),[a,s]=[o,i].map(u=>{let[d=0]=u.split(",").filter(Boolean).map(c=>c.includes("ms")?parseFloat(c):parseFloat(c)*1e3).sort((c,p)=>p-c);return d}),l=a+s;if(l!==0){let u=r.group(d=>{let c=d.setTimeout(()=>{n(),d.dispose()},l);d.addEventListener(e,"transitionrun",p=>{p.target===p.currentTarget&&(c(),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 pa(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 pn(e,t){let n=g([]),r=D(e);N(()=>{let o=[...n.current];for(let[i,a]of t.entries())if(n.current[i]!==a){let s=r(t,o);return n.current=t,s}},[r,...t])}let yt=Y(null);yt.displayName="OpenClosedContext";var ee=(e=>(e[e.Open=1]="Open",e[e.Closed=2]="Closed",e[e.Closing=4]="Closing",e[e.Opening=8]="Opening",e))(ee||{});function gt(){return j(yt)}function ha({value:e,children:t}){return T.createElement(yt.Provider,{value:e},t)}function _a({children:e}){return T.createElement(yt.Provider,{value:null},e)}function va(e){function t(){document.readyState!=="loading"&&(e(),document.removeEventListener("DOMContentLoaded",t))}typeof window<"u"&&typeof document<"u"&&(document.addEventListener("DOMContentLoaded",t),t())}let ye=[];va(()=>{function e(t){t.target instanceof HTMLElement&&t.target!==document.body&&ye[0]!==t.target&&(ye.unshift(t.target),ye=ye.filter(n=>n!=null&&n.isConnected),ye.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 Kr(e){let t=D(e),n=g(!1);N(()=>(n.current=!1,()=>{n.current=!0,pt(()=>{n.current&&t()})}),[t])}function ma(){let e=typeof document>"u";return"useSyncExternalStore"in Tr?(t=>t.useSyncExternalStore)(Tr)(()=>()=>{},()=>!1,()=>!e):!1}function Xe(){let e=ma(),[t,n]=F(ke.isHandoffComplete);return t&&ke.isHandoffComplete===!1&&n(!1),N(()=>{t!==!0&&n(!0)},[t]),N(()=>ke.handoff(),[]),e?!1:t}let Gr=Y(!1);function ya(){return j(Gr)}function Zr(e){return T.createElement(Gr.Provider,{value:e.force},e.children)}function ga(e){let t=ya(),n=j(Qr),r=Ze(e),[o,i]=F(()=>{var a;if(!t&&n!==null)return(a=n.current)!=null?a:null;if(ke.isServer)return null;let s=r==null?void 0:r.getElementById("headlessui-portal-root");if(s)return s;if(r===null)return null;let l=r.createElement("div");return l.setAttribute("id","headlessui-portal-root"),r.body.appendChild(l)});return N(()=>{o!==null&&(r!=null&&r.body.contains(o)||r==null||r.body.appendChild(o))},[o,r]),N(()=>{t||n!==null&&i(n.current)},[n,i,t]),o}let Xr=H,wa=q(function(e,t){let n=e,r=g(null),o=re(Pi(d=>{r.current=d}),t),i=Ze(r),a=ga(r),[s]=F(()=>{var d;return ke.isServer?null:(d=i==null?void 0:i.createElement("div"))!=null?d:null}),l=j(hn),u=Xe();return B(()=>{!a||!s||a.contains(s)||(s.setAttribute("data-headlessui-portal",""),a.appendChild(s))},[a,s]),B(()=>{if(s&&l)return l.register(s)},[l,s]),Kr(()=>{var d;!a||!s||(s instanceof Node&&a.contains(s)&&a.removeChild(s),a.childNodes.length<=0&&((d=a.parentElement)==null||d.removeChild(a)))}),u?!a||!s?null:lt(G({ourProps:{ref:o},theirProps:n,slot:{},defaultTag:Xr,name:"Portal"}),s):null});function ba(e,t){let n=re(t),{enabled:r=!0,...o}=e;return r?T.createElement(wa,{...o,ref:n}):G({ourProps:{ref:n},theirProps:o,slot:{},defaultTag:Xr,name:"Portal"})}let $a=H,Qr=Y(null);function Ea(e,t){let{target:n,...r}=e,o={ref:re(t)};return T.createElement(Qr.Provider,{value:n},G({ourProps:o,theirProps:r,defaultTag:$a,name:"Popover.Group"}))}let hn=Y(null);function Ta(){let e=j(hn),t=g([]),n=D(i=>(t.current.push(i),e&&e.register(i),()=>r(i))),r=D(i=>{let a=t.current.indexOf(i);a!==-1&&t.current.splice(a,1),e&&e.unregister(i)}),o=M(()=>({register:n,unregister:r,portals:t}),[n,r,t]);return[t,M(()=>function({children:i}){return T.createElement(hn.Provider,{value:o},i)},[o])]}let Ca=q(ba),Jr=q(Ea),ka=Object.assign(Ca,{Group:Jr});function xa(e,t=typeof document<"u"?document.defaultView:null,n){let r=De(e,"escape");Yr(t,"keydown",o=>{r&&(o.defaultPrevented||o.key===Dr.Escape&&n(o))})}function Fa(){var e;let[t]=F(()=>typeof window<"u"&&typeof window.matchMedia=="function"?window.matchMedia("(pointer: coarse)"):null),[n,r]=F((e=t==null?void 0:t.matches)!=null?e:!1);return B(()=>{if(!t)return;function o(i){r(i.matches)}return t.addEventListener("change",o),()=>t.removeEventListener("change",o)},[t]),n}function Sa({defaultContainers:e=[],portals:t,mainTreeNodeRef:n}={}){var r;let o=g((r=n==null?void 0:n.current)!=null?r:null),i=Ze(o),a=D(()=>{var s,l,u;let d=[];for(let c of e)c!==null&&(c instanceof HTMLElement?d.push(c):"current"in c&&c.current instanceof HTMLElement&&d.push(c.current));if(t!=null&&t.current)for(let c of t.current)d.push(c);for(let c of(s=i==null?void 0:i.querySelectorAll("html > *, body > *"))!=null?s:[])c!==document.body&&c!==document.head&&c instanceof HTMLElement&&c.id!=="headlessui-portal-root"&&(c.contains(o.current)||c.contains((u=(l=o.current)==null?void 0:l.getRootNode())==null?void 0:u.host)||d.some(p=>c.contains(p))||d.push(c));return d});return{resolveContainers:a,contains:D(s=>a().some(l=>l.contains(s))),mainTreeNodeRef:o,MainTreeNode:M(()=>function(){return n!=null?null:T.createElement(ln,{features:mt.Hidden,ref:o})},[o,n])}}function _n(){let e=g(!1);return B(()=>(e.current=!0,()=>{e.current=!1}),[]),e}var Qe=(e=>(e[e.Forwards=0]="Forwards",e[e.Backwards=1]="Backwards",e))(Qe||{});function Ma(){let e=g(0);return Br(!0,"keydown",t=>{t.key==="Tab"&&(e.current=t.shiftKey?1:0)},!0),e}function eo(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 Pa="div";var Me=(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))(Me||{});function Na(e,t){let n=g(null),r=re(n,t),{initialFocus:o,initialFocusFallback:i,containers:a,features:s=15,...l}=e;Xe()||(s=0);let u=Ze(n);Ha(s,{ownerDocument:u});let d=Da(s,{ownerDocument:u,container:n,initialFocus:o,initialFocusFallback:i});Oa(s,{ownerDocument:u,container:n,containers:a,previousActiveElement:d});let c=Ma(),p=D(_=>{let w=n.current;w&&(b=>b())(()=>{ve(c.current,{[Qe.Forwards]:()=>{Ke(w,fe.First,{skipElements:[_.relatedTarget,i]})},[Qe.Backwards]:()=>{Ke(w,fe.Last,{skipElements:[_.relatedTarget,i]})}})})}),f=De(!!(s&2),"focus-trap#tab-lock"),v=ht(),y=g(!1),m={ref:r,onKeyDown(_){_.key=="Tab"&&(y.current=!0,v.requestAnimationFrame(()=>{y.current=!1}))},onBlur(_){if(!(s&4))return;let w=eo(a);n.current instanceof HTMLElement&&w.add(n.current);let b=_.relatedTarget;b instanceof HTMLElement&&b.dataset.headlessuiFocusGuard!=="true"&&(to(w,b)||(y.current?Ke(n.current,ve(c.current,{[Qe.Forwards]:()=>fe.Next,[Qe.Backwards]:()=>fe.Previous})|fe.WrapAround,{relativeTo:_.target}):_.target instanceof HTMLElement&&pe(_.target)))}};return T.createElement(T.Fragment,null,f&&T.createElement(ln,{as:"button",type:"button","data-headlessui-focus-guard":!0,onFocus:p,features:mt.Focusable}),G({ourProps:m,theirProps:l,defaultTag:Pa,name:"FocusTrap"}),f&&T.createElement(ln,{as:"button",type:"button","data-headlessui-focus-guard":!0,onFocus:p,features:mt.Focusable}))}let La=q(Na),Aa=Object.assign(La,{features:Me});function Ia(e=!0){let t=g(ye.slice());return pn(([n],[r])=>{r===!0&&n===!1&&pt(()=>{t.current.splice(0)}),r===!1&&n===!0&&(t.current=ye.slice())},[e,ye,t]),D(()=>{var n;return(n=t.current.find(r=>r!=null&&r.isConnected))!=null?n:null})}function Ha(e,{ownerDocument:t}){let n=!!(e&8),r=Ia(n);pn(()=>{n||(t==null?void 0:t.activeElement)===(t==null?void 0:t.body)&&pe(r())},[n]),Kr(()=>{n&&pe(r())})}function Da(e,{ownerDocument:t,container:n,initialFocus:r,initialFocusFallback:o}){let i=g(null),a=De(!!(e&1),"focus-trap#initial-focus"),s=_n();return pn(()=>{if(e===0)return;if(!a){o!=null&&o.current&&pe(o.current);return}let l=n.current;l&&pt(()=>{if(!s.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(l.contains(u)){i.current=u;return}if(r!=null&&r.current)pe(r.current);else{if(e&16){if(Ke(l,fe.First|fe.AutoFocus)!==fn.Error)return}else if(Ke(l,fe.First)!==fn.Error)return;if(o!=null&&o.current&&(pe(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,a,e]),i}function Oa(e,{ownerDocument:t,container:n,containers:r,previousActiveElement:o}){let i=_n(),a=!!(e&4);Yr(t==null?void 0:t.defaultView,"focus",s=>{if(!a||!i.current)return;let l=eo(r);n.current instanceof HTMLElement&&l.add(n.current);let u=o.current;if(!u)return;let d=s.target;d&&d instanceof HTMLElement?to(l,d)?(o.current=d,pe(d)):(s.preventDefault(),s.stopPropagation(),pe(u)):pe(o.current)},!0)}function to(e,t){for(let n of e)if(n.contains(t))return!0;return!1}function no(e){var t;return!!(e.enter||e.enterFrom||e.enterTo||e.leave||e.leaveFrom||e.leaveTo)||((t=e.as)!=null?t:oo)!==H||T.Children.count(e.children)===1}let wt=Y(null);wt.displayName="TransitionContext";var Ra=(e=>(e.Visible="visible",e.Hidden="hidden",e))(Ra||{});function Va(){let e=j(wt);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}function Ua(){let e=j(bt);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}let bt=Y(null);bt.displayName="NestingContext";function $t(e){return"children"in e?$t(e.children):e.current.filter(({el:t})=>t.current!==null).filter(({state:t})=>t==="visible").length>0}function ro(e,t){let n=xe(e),r=g([]),o=_n(),i=ht(),a=D((f,v=me.Hidden)=>{let y=r.current.findIndex(({el:m})=>m===f);y!==-1&&(ve(v,{[me.Unmount](){r.current.splice(y,1)},[me.Hidden](){r.current[y].state="hidden"}}),i.microTask(()=>{var m;!$t(r)&&o.current&&((m=n.current)==null||m.call(n))}))}),s=D(f=>{let v=r.current.find(({el:y})=>y===f);return v?v.state!=="visible"&&(v.state="visible"):r.current.push({el:f,state:"visible"}),()=>a(f,me.Unmount)}),l=g([]),u=g(Promise.resolve()),d=g({enter:[],leave:[]}),c=D((f,v,y)=>{l.current.splice(0),t&&(t.chains.current[v]=t.chains.current[v].filter(([m])=>m!==f)),t==null||t.chains.current[v].push([f,new Promise(m=>{l.current.push(m)})]),t==null||t.chains.current[v].push([f,new Promise(m=>{Promise.all(d.current[v].map(([_,w])=>w)).then(()=>m())})]),v==="enter"?u.current=u.current.then(()=>t==null?void 0:t.wait.current).then(()=>y(v)):y(v)}),p=D((f,v,y)=>{Promise.all(d.current[v].splice(0).map(([m,_])=>_)).then(()=>{var m;(m=l.current.shift())==null||m()}).then(()=>y(v))});return M(()=>({children:r,register:s,unregister:a,onStart:c,onStop:p,wait:u,chains:d}),[s,a,r,c,p,d,u])}let oo=H,io=_t.RenderStrategy;function Wa(e,t){var n,r;let{transition:o=!0,beforeEnter:i,afterEnter:a,beforeLeave:s,afterLeave:l,enter:u,enterFrom:d,enterTo:c,entered:p,leave:f,leaveFrom:v,leaveTo:y,...m}=e,_=g(null),w=no(e),b=re(...w?[_,t]:t===null?[]:[t]),C=(n=m.unmount)==null||n?me.Unmount:me.Hidden,{show:E,appear:P,initial:R}=Va(),[V,W]=F(E?"visible":"hidden"),$=Ua(),{register:x,unregister:S}=$;B(()=>x(_),[x,_]),B(()=>{if(C===me.Hidden&&_.current){if(E&&V!=="visible"){W("visible");return}return ve(V,{hidden:()=>S(_),visible:()=>x(_)})}},[V,_,x,S,E,C]);let I=Xe();B(()=>{if(w&&I&&V==="visible"&&_.current===null)throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?")},[_,V,I,w]);let X=R&&!P,se=P&&E&&R,te=g(!1),ne=ro(()=>{te.current||(W("hidden"),S(_))},$),Re=D(kn=>{te.current=!0;let Ft=kn?"enter":"leave";ne.onStart(_,Ft,nt=>{nt==="enter"?i==null||i():nt==="leave"&&(s==null||s())})}),ge=D(kn=>{let Ft=kn?"enter":"leave";te.current=!1,ne.onStop(_,Ft,nt=>{nt==="enter"?a==null||a():nt==="leave"&&(l==null||l())}),Ft==="leave"&&!$t(ne)&&(W("hidden"),S(_))});N(()=>{w&&o||(Re(E),ge(E))},[E,w,o]);let z=!(!o||!w||!I||X),[,U]=ua(z,_,E,{start:Re,end:ge}),Zs=Fe({ref:b,className:((r=an(m.className,se&&u,se&&d,U.enter&&u,U.enter&&U.closed&&d,U.enter&&!U.closed&&c,U.leave&&f,U.leave&&!U.closed&&v,U.leave&&U.closed&&y,!U.transition&&E&&p))==null?void 0:r.trim())||void 0,...ca(U)}),tt=0;return V==="visible"&&(tt|=ee.Open),V==="hidden"&&(tt|=ee.Closed),U.enter&&(tt|=ee.Opening),U.leave&&(tt|=ee.Closing),T.createElement(bt.Provider,{value:ne},T.createElement(ha,{value:tt},G({ourProps:Zs,theirProps:m,defaultTag:oo,features:io,visible:V==="visible",name:"Transition.Child"})))}function za(e,t){let{show:n,appear:r=!1,unmount:o=!0,...i}=e,a=g(null),s=no(e),l=re(...s?[a,t]:t===null?[]:[t]);Xe();let u=gt();if(n===void 0&&u!==null&&(n=(u&ee.Open)===ee.Open),n===void 0)throw new Error("A <Transition /> is used but it is missing a `show={true | false}` prop.");let[d,c]=F(n?"visible":"hidden"),p=ro(()=>{n||c("hidden")}),[f,v]=F(!0),y=g([n]);B(()=>{f!==!1&&y.current[y.current.length-1]!==n&&(y.current.push(n),v(!1))},[y,n]);let m=M(()=>({show:n,appear:r,initial:f}),[n,r,f]);Wr(n,a,()=>c("hidden")),B(()=>{n?c("visible"):!$t(p)&&a.current!==null&&c("hidden")},[n,p]);let _={unmount:o},w=D(()=>{var C;f&&v(!1),(C=e.beforeEnter)==null||C.call(e)}),b=D(()=>{var C;f&&v(!1),(C=e.beforeLeave)==null||C.call(e)});return T.createElement(bt.Provider,{value:p},T.createElement(wt.Provider,{value:m},G({ourProps:{..._,as:H,children:T.createElement(ao,{ref:l,..._,...i,beforeEnter:w,beforeLeave:b})},theirProps:{},defaultTag:H,features:io,visible:d==="visible",name:"Transition"})))}function ja(e,t){let n=j(wt)!==null,r=gt()!==null;return T.createElement(T.Fragment,null,!n&&r?T.createElement(vn,{ref:t,...e}):T.createElement(ao,{ref:t,...e}))}let vn=q(za),ao=q(Wa),mn=q(ja),oe=Object.assign(vn,{Child:mn,Root:vn});var Ba=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(Ba||{}),qa=(e=>(e[e.SetTitleId=0]="SetTitleId",e))(qa||{});let Ya={0(e,t){return e.titleId===t.id?e:{...e,titleId:t.id}}},yn=Y(null);yn.displayName="DialogContext";function Et(e){let t=j(yn);if(t===null){let n=new Error(`<${e} /> is missing a parent <Dialog /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,Et),n}return t}function Ka(e,t){return ve(t.type,Ya,e,t)}let so=q(function(e,t){let n=he(),{id:r=`headlessui-dialog-${n}`,open:o,onClose:i,initialFocus:a,role:s="dialog",autoFocus:l=!0,__demoMode:u=!1,...d}=e,c=g(!1);s=function(){return s==="dialog"||s==="alertdialog"?s:(c.current||(c.current=!0,console.warn(`Invalid role [${s}] passed to <Dialog />. Only \`dialog\` and and \`alertdialog\` are supported. Using \`dialog\` instead.`)),"dialog")}();let p=gt();o===void 0&&p!==null&&(o=(p&ee.Open)===ee.Open);let f=g(null),v=re(f,t),y=Ze(f),m=o?0:1,[_,w]=We(Ka,{titleId:null,descriptionId:null,panelRef:Lt()}),b=D(()=>i(!1)),C=D(z=>w({type:0,id:z})),E=Xe()?m===0:!1,[P,R]=Ta(),V={get current(){var z;return(z=_.panelRef.current)!=null?z:f.current}},{resolveContainers:W,mainTreeNodeRef:$,MainTreeNode:x}=Sa({portals:P,defaultContainers:[V]}),S=p!==null?(p&ee.Closing)===ee.Closing:!1;Ui(u||S?!1:E,{allowed:D(()=>{var z,U;return[(U=(z=f.current)==null?void 0:z.closest("[data-headlessui-portal]"))!=null?U:null]}),disallowed:D(()=>{var z,U;return[(U=(z=$.current)==null?void 0:z.closest("body > *:not(#headlessui-portal-root)"))!=null?U:null]})}),Ji(E,W,z=>{z.preventDefault(),b()}),xa(E,y==null?void 0:y.defaultView,z=>{z.preventDefault(),z.stopPropagation(),document.activeElement&&"blur"in document.activeElement&&typeof document.activeElement.blur=="function"&&document.activeElement.blur(),b()}),ia(u||S?!1:E,y,W),Wr(E,f,b);let[I,X]=Ni(),se=M(()=>[{dialogState:m,close:b,setTitleId:C},_],[m,_,b,C]),te=M(()=>({open:m===0}),[m]),ne={ref:v,id:r,role:s,tabIndex:-1,"aria-modal":u?void 0:m===0?!0:void 0,"aria-labelledby":_.titleId,"aria-describedby":I},Re=!Fa(),ge=Me.None;return E&&!u&&(ge|=Me.RestoreFocus,ge|=Me.TabLock,l&&(ge|=Me.AutoFocus),Re&&(ge|=Me.InitialFocus)),T.createElement(_a,null,T.createElement(Zr,{force:!0},T.createElement(ka,null,T.createElement(yn.Provider,{value:se},T.createElement(Jr,{target:f},T.createElement(Zr,{force:!1},T.createElement(X,{slot:te},T.createElement(R,null,T.createElement(Aa,{initialFocus:a,initialFocusFallback:f,containers:W,features:ge},T.createElement(Oi,{value:b},G({ourProps:ne,theirProps:d,slot:te,defaultTag:Ga,features:Za,visible:m===0,name:"Dialog"})))))))))),T.createElement(Mi,null,T.createElement(x,null)))}),Ga="div",Za=_t.RenderStrategy|_t.Static;function Xa(e,t){let{transition:n=!1,open:r,...o}=e,i=gt(),a=e.hasOwnProperty("open")||i!==null,s=e.hasOwnProperty("onClose");if(!a&&!s)throw new Error("You have to provide an `open` and an `onClose` prop to the `Dialog` component.");if(!a)throw new Error("You provided an `onClose` prop to the `Dialog`, but forgot an `open` prop.");if(!s)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?T.createElement(oe,{show:r,transition:n,unmount:o.unmount},T.createElement(so,{ref:t,...o})):T.createElement(so,{ref:t,open:r,...o})}let Qa="div";function Ja(e,t){let n=he(),{id:r=`headlessui-dialog-panel-${n}`,transition:o=!1,...i}=e,[{dialogState:a},s]=Et("Dialog.Panel"),l=re(t,s.panelRef),u=M(()=>({open:a===0}),[a]),d=D(c=>{c.stopPropagation()});return T.createElement(o?mn:H,null,G({ourProps:{ref:l,id:r,onClick:d},theirProps:i,slot:u,defaultTag:Qa,name:"Dialog.Panel"}))}let es="div";function ts(e,t){let{transition:n=!1,...r}=e,[{dialogState:o}]=Et("Dialog.Backdrop"),i=M(()=>({open:o===0}),[o]);return T.createElement(n?mn:H,null,G({ourProps:{ref:t,"aria-hidden":!0},theirProps:r,slot:i,defaultTag:es,name:"Dialog.Backdrop"}))}let ns="h2";function rs(e,t){let n=he(),{id:r=`headlessui-dialog-title-${n}`,...o}=e,[{dialogState:i,setTitleId:a}]=Et("Dialog.Title"),s=re(t);N(()=>(a(r),()=>a(null)),[r,a]);let l=M(()=>({open:i===0}),[i]);return G({ourProps:{ref:s,id:r},theirProps:o,slot:l,defaultTag:ns,name:"Dialog.Title"})}let os=q(Xa),lo=q(Ja);q(ts);let is=q(rs),as=Object.assign(os,{Panel:lo,Title:is,Description:Hi});const Tt={root:"_root_1hpzn_1",modal:"_modal_1hpzn_10",container:"_container_1hpzn_13",page:"_page_1hpzn_16",close:"_close_1hpzn_19"},ss={root:"_root_1h6qm_1"},ie=e=>{const{children:t,size:n="md",fill:r="currentColor",stroke:o,strokeWidth:i,className:a="",viewBox:s="0 0 20 20"}=e,l=M(()=>{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 h("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:s,fill:r,stroke:o,strokeWidth:i,className:`${l} ${a}`,children:t})},ls=()=>h(ie,{children:h("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"})}),co=e=>h(ie,{...e,children:h("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"})}),cs=e=>h(ie,{...e,viewBox:"0 0 24 24",children:[h("path",{d:"M0 0h24v24H0V0z",fill:"none"}),h("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"})]}),us=e=>h(ie,{...e,viewBox:"0 0 24 24",children:[h("path",{d:"M0 0h24v24H0V0z",fill:"none"}),h("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"})]}),ds=e=>h(ie,{...e,viewBox:"0 0 24 24",children:[h("path",{d:"M0 0h24v24H0V0z",fill:"none"}),h("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"})]}),fs=e=>h(ie,{...e,children:[h("path",{d:"M0 0h24v24H0V0z",fill:"none"}),h("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"})]}),ps=e=>h(ie,{...e,children:h("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"})}),hs=e=>h(ie,{...e,viewBox:"0 0 24 24",children:h("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"})}),_s=e=>h(ie,{...e,children:h("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"})}),vs=e=>h(ie,{...e,viewBox:"0 0 99 32",children:[h("g",{clipPath:"url(#clip0_9581_165880)",children:[h("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"}),h("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"}),h("path",{d:"M68.9385 6.74805H67.1367V25.2549H68.9385V6.74805Z",fill:"white"}),h("path",{d:"M55.0725 8.52161V6.73047H47.8535V25.2683H55.0725V23.4748H49.6577V18.9874H52.9664V17.1963H49.6577V8.52161H55.0725Z",fill:"white"}),h("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"}),h("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"}),h("path",{d:"M78.6291 8.53181V6.73828H71.4102V25.2618H73.2143V18.9976H76.5231V17.2065H73.2143V8.53181H78.6291Z",fill:"white"}),h("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"}),h("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"}),h("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"})]}),h("defs",{children:h("clipPath",{id:"clip0_9581_165880",children:h("rect",{width:"98.9474",height:"32",fill:"white"})})})]});class Pe{static loadVision(){return import("https://cdn.jsdelivr.net/npm/@mediapipe/tasks-vision@0.10.3")}static async loadDetector(){try{const{FaceLandmarker:t,FilesetResolver:n}=await Pe.loadVision(),r=await n.forVisionTasks("https://cdn.jsdelivr.net/npm/@mediapipe/tasks-vision@0.10.3/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:!1,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){let n=1/0,r=-1/0,o=1/0,i=-1/0;return t.forEach(a=>{n=Math.min(n,a.x),r=Math.max(r,a.x),o=Math.min(o,a.y),i=Math.max(i,a.y)}),{xMin:n,xMax:r,yMin:o,yMax:i,width:r-n,height:i-o}}static async detectFaces(t,n){try{const{width:r,height:o}=n,{faceLandmarks:i}=await t.detect(n);if(i.length===0)return[];const a=Pe.denormalizeKeypoints(i[0],r,o),s=Pe.getBoundingBox(a);return[{keypoints:a,box:s}]}catch(r){return Promise.reject(r)}}}const ms=(e,t)=>{let n;return typeof OffscreenCanvas<"u"?n=new OffscreenCanvas(e,t):(n=document.createElement("canvas"),n.width=e,n.height=t),n},uo=(e,t,n,r)=>{let o=0,i=0,a=t,s=n;const u=ms(t,n).getContext("2d");return u.drawImage(e,0,0),u.getImageData(o,i,a,s)},ys=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(a=>t(a))});function gs(){if(MediaRecorder.isTypeSupported("video/webm; codecs=vp9"))return{mimeType:"video/webm; codecs=vp9"};if(MediaRecorder.isTypeSupported("video/webm"))return{mimeType:"video/webm"};if(MediaRecorder.isTypeSupported("video/mp4"))return{mimeType:"video/mp4"}}function fo(e={}){const{onRecord:t=()=>{},onStop:n=()=>{}}=e,r=g([]),o=g(null),i=g(null),a=A(c=>{r.current.push(c)},[]),s=A(async c=>{if(o.current)return;const p=await ys(c);o.current=p},[]),l=A(c=>{c.data.size>0&&t(c.data)},[]),u=A(()=>{!i.current||i.current.state==="inactive"||(i.current.stop(),i.current.stream.getTracks().forEach(c=>c.stop()),n())},[]),d=A(c=>{i.current||(i.current=new MediaRecorder(c,gs()),i.current.ondataavailable=l,i.current.onstop=u,i.current.start(1e3))},[]);return{saveStream:a,savePhoto:s,start:d,stop:u,savedStreams:r,savedPhoto:o}}function Oe(e,t){return Math.sqrt(e**2+t**2)}function ws(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}function bs(e,t){return new Promise((n,r)=>{const o=new File([e],`${Date.now()}`,{type:t}),i=new FileReader;i.readAsDataURL(o),i.onload=()=>n(i.result),i.onerror=a=>r(a)})}const $s=e=>e?"https://identity.staging.svc.youverify.co":"https://identity.svc.youverify.co";function Es(e){return{postData:async n=>{const{faceImage:r,publicKey:o,passed:i,metadata:a}=n,s=$s(e),l=await fetch(`${s}/v1/sdk/identity/liveness/`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({publicMerchantID:o,components:["liveness"],faceImage:r,passed:i,metadata:a})});if(!l.ok)throw l;return(await l.json()).data}}}const Ts=360,Cs="#125766",ks="https://cdn.youverify.co/1721901834404-q2nxqyng5klm918b3BDVU.jpg",po={"complete-the-circle":{Icon:cs,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:us,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:ds,name:"Motions 💫",description:"First position your face in the camera frame, then follow the instructions"},"facial-expressions":{Icon:co,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"}},ho=Y({tasks:[],namespace:"",user:void 0,currentTaskIndex:0,completedCount:0,nextTask:()=>{},completed:!1,onRequestClose:()=>{},faceDetector:null,saveStream:()=>{},savePhoto:()=>{},onComplete:()=>Promise.resolve()});let _o,vo=!1;function xs(e){const{publicKey:t,tasks:n,children:r,namespace:o,user:i,branding:a,onRequestClose:s,onSuccess:l=()=>{},metadata:u,presentation:d,sandboxEnvironment:c=!0}=e,[p,f]=F(0),[v,y]=F(0),[m,_]=F(null),{saveStream:w,savePhoto:b,savedPhoto:C}=fo(),{postData:E}=Es(c),P=M(()=>v===n.length,[n,v]),R=()=>{y(x=>x+1),f(x=>x+1)},V=x=>{const S=new Image;S.crossOrigin="Anonymous",S.src=ks,S.onload=()=>{const I=uo(S,S.width,S.height);Pe.detectFaces(x,I)}},W=async()=>{const x=await E({faceImage:C.current?await bs(C.current,"image/png"):null,publicKey:t,passed:!0,metadata:u});l(x),s()},$=async()=>{const x=await Pe.loadDetector();_o=x,V(x),_(x)};return N(()=>{if(vo){_(_o);return}$(),vo=!0},[]),h(ho.Provider,{value:{tasks:n,namespace:o,user:i,currentTaskIndex:p,completed:P,completedCount:v,nextTask:R,branding:a,onRequestClose:s,faceDetector:m,saveStream:w,savePhoto:b,onComplete:W,presentation:d},children:r})}function Ne(){return j(ho)}const K={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"},gn={root:"_root_135td_1",container:"_container_135td_1",brand:"_brand_135td_1"};function Fs(){const{branding:e}=Ne();return h("div",{className:gn.root,children:h("div",{className:gn.container,children:h("div",{className:gn.brand,children:(e==null?void 0:e.logo)&&h("img",{className:"yvlw-h-10",src:e.logo,alt:"Logo"})})})})}const mo="colorScheme";function Ss(){const{namespace:e}=Ne(),t=()=>{const o=localStorage.getItem(mo);return!o&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":o},n=(o=null)=>{o&&localStorage.setItem(mo,o);const i=`${e}-color-scheme`,a=document.documentElement;o&&o==="dark"?a==null||a.setAttribute(i,"dark"):a==null||a.removeAttribute(i)};return{setColorScheme:n,toggleColorScheme:()=>{const o=t();return n(o==="dark"?"light":"dark")},getColorScheme:t}}const Ms={root:"_root_bcsvc_1"};function Ps(){if(!(window.screen.width>=900))return 10/9}function wn(e){const{children:t,onStream:n=()=>{},onRecord:r=()=>{}}=e,o=g(null),i=g(0),a=g(null),{start:s,stop:l}=fo({onRecord:r}),u=async()=>{try{const p=await navigator.mediaDevices.getUserMedia({video:{aspectRatio:{exact:Ps()}}});a.current=p,s(p),o.current&&(o.current.srcObject=p)}catch{}},d=()=>{a.current&&(a.current.getTracks().forEach(p=>p.stop()),a.current=null,l(),o.current&&(o.current.srcObject=null))},c=()=>{n(o),i.current=requestAnimationFrame(c)};return N(()=>{const p=o.current;if(!p)return;const f=()=>{i.current=requestAnimationFrame(c)};return u(),p.addEventListener("canplay",f),()=>{p.removeEventListener("canplay",f),cancelAnimationFrame(i.current),d()}},[]),h("div",{className:Ms.root,children:[h("video",{ref:o,autoPlay:!0,loop:!0,playsInline:!0}),t]})}const Je={container:"_container_mcmsr_1",focused:"_focused_mcmsr_12",progress:"_progress_mcmsr_15",completed:"_completed_mcmsr_36",marker:"_marker_mcmsr_40"},yo=360,Ns=50;function Ls(e){const{visitedSections:t,sectionsCount:n,faceDetected:r,divisions:o=Ns}=e,i=M(()=>{const a=[Je.container];return r&&a.push(Je.focused),a.join(" ")},[r]);return h("div",{className:i,children:[h(oe,{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:h("div",{className:Je.progress,children:Array.from(Array(o).keys()).map(a=>{const s=a*yo/o,l=Math.ceil((s+1)*n/yo),u=t.includes(l),d=u?a-(l-1)*(o/n):0,c=[];u&&c.push(Je.completed);const p=u?"translateX(158px)":"translateX(150px)";return h("div",{className:c.join(" "),style:{transform:`rotate(${s}deg) ${p}`,transitionDelay:`${d*20}ms`}},`key-${a}`)})})}),h(oe,{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:h("div",{className:Je.marker,children:[h("div",{}),h("div",{}),h("div",{}),h("div",{})]})})]})}function As(){return{checkZoomLevel:(r,o)=>{const{box:i}=r,{width:a,height:s}=i,l=a*s,u=o**2,d=l/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:a}=o,{box:s}=r;if(!(s.xMin-i>=o.x&&s.yMin-a>=o.y&&s.xMax-i<=o.x+o.width&&s.yMax-a<=o.y+o.height))throw new Error("Position head in frame")}}}function bn(e={}){const{validations:t=["zoom"],frameSize:n,onFace:r=()=>{},onError:o=()=>{}}=e,{faceDetector:i,savePhoto:a}=Ne(),s=g(!1),l=g(!1),{checkFacialFeatures:u,checkZoomLevel:d,checkInFrame:c}=As(),p=g(null),f=(y,m)=>{var _;try{if(y.length===0)throw new Error("Detecting face...");if(y.length>1)throw new Error("A maximum of 1 face is allowed");const w=p.current,b=(_=p.current)==null?void 0:_.parentElement;if(!w||!b)return;const C=y[0];for(const E of t)switch(E){case"zoom":d(C,Math.min(b.clientHeight,b.clientWidth));break;case"features":u(C,Math.min(b.clientHeight,b.clientWidth));break;case"in-frame":if(!n)throw new Error("Frame size is required to check if face is in frame");const P=n+200;c(C,{x:(b.clientWidth-P)/2,y:(b.clientHeight-P)/2,width:P,height:P,offsetX:(w.videoWidth-b.clientWidth)/2,offsetY:(w.videoHeight-b.clientHeight)/2});break;default:break}if(!l.current)throw s.current||(s.current=!0,setTimeout(()=>{a(m),l.current=!0},3e3)),new Error("Keep head still for a photograph");r(C)}catch(w){const{message:b}=w;o(b)}};return{detectFaces:async y=>{if(!i)return;const{ref:m}=y;p.current=m.current;const _=p.current;if(!_)throw new Error("No Video Source detected");const{videoWidth:w,videoHeight:b}=_;if(w===0||b===0)return;const C=uo(_,w,b),E=await Pe.detectFaces(i,C);f(E,_)}}}const ae={root:"_root_1psx5_1",container:"_container_1psx5_4",progress:"_progress_1psx5_7",intro:"_intro_1psx5_12",content:"_content_1psx5_15",branding:"_branding_1psx5_18",instructionsContainer:"_instructionsContainer_1psx5_22",instructions:"_instructions_1psx5_22"},go={root:"_root_h5elg_1",spinner:"_spinner_h5elg_22"},wo={container:"_container_1vep2_1",spin:"_spin_1vep2_1",md:"_md_1vep2_7",lg:"_lg_1vep2_10"};function bo(e){const{size:t="md",className:n=""}=e;return h("span",{className:`${wo.container} ${wo[t]} ${n}`})}function et(e){const{Icon:t,description:n,title:r,actionText:o="Okay, got it",onActionClick:i=()=>{},loading:a=!1,children:s,hideButton:l=!1}=e;return h("div",{className:go.root,children:[h(t,{size:"custom",className:"yvlw-h-20 yvlw-mx-auto yvlw-mb-12"}),h("h2",{children:r}),h("p",{className:"subtext",children:n}),!l&&h("div",{className:"yvlw-mt-12",children:h(ki,{onClick:()=>i(),className:"yvlw-flex yvlw-items-center yvlw-space-x-3",disabled:a,children:[h("span",{className:"yvlw-flex-1 yvlw-flex yvlw-items-center yvlw-space-x-1 yvlw-justify-center",children:o}),a&&h(bo,{className:go.spinner})]})}),s]})}const Ct="yvlw-absolute yvlw-w-full yvlw-h-full",kt="yvlw-transform yvlw-transition yvlw-ease-in yvlw-duration-300",xt="yvlw-transform yvlw-transition yvlw-ease-in yvlw-duration-300";function $n(e){const{children:t,instruction:n,name:r,completed:o,failed:i,onStart:a=()=>{},onReset:s=()=>{}}=e,[l,u]=F(!1),{completedCount:d,tasks:c,nextTask:p}=Ne(),f=M(()=>po[r],[r]),v=M(()=>d*100/c.length,[d,c.length]);return h("div",{className:ae.root,children:h("div",{className:`${ae.container} view`,children:[h("div",{style:{width:`${v}%`},className:ae.progress}),h(oe,{show:!l&&!o&&!i,as:"div",enter:kt,enterFrom:"yvlw--translate-x-full",enterTo:"yvlw-translate-x-0",leave:xt,leaveFrom:"yvlw-translate-x-0",leaveTo:"yvlw--translate-x-full",className:Ct,children:h("div",{className:`${ae.intro}`,children:h(et,{Icon:f.Icon,title:`${f.name.slice(0,-2)}`,description:`${f.description}. Proper lightning helps with getting faster and more accurate results.`,onActionClick:async()=>{await a(),u(!0)},actionText:"Okay, got it!"})})}),h(oe,{as:"div",show:l&&!o&&!i,enter:kt,enterFrom:"yvlw-translate-x-full",enterTo:"yvlw-translate-x-0",leave:xt,leaveFrom:"yvlw-translate-x-0",leaveTo:"yvlw-translate-x-full",className:Ct,children:[h("div",{className:`${ae.content}`,children:t}),h("div",{className:ae.instructionsContainer,children:[h("div",{className:ae.instructions,children:[h("h2",{children:n.title}),h("p",{className:"subtext",children:n.description})]}),h("div",{className:ae.branding,children:[h("span",{children:"Powered by"})," ",h(vs,{size:"custom",className:"yvlw-h-3"})]})]})]}),h(oe,{show:o,as:"div",enter:kt,enterFrom:"yvlw-translate-x-full",enterTo:"yvlw-translate-x-0",leave:xt,leaveFrom:"yvlw-translate-x-0",leaveTo:"yvlw-translate-x-full",className:Ct,children:h("div",{className:`${ae.intro}`,children:h(et,{Icon:f.Icon,title:"One task down!",description:`You have completed the ${f.name.slice(0,-2)} task. Click on the button below button to proceed.`,onActionClick:()=>p(),actionText:"Next"})})}),h(oe,{show:i,as:"div",enter:kt,enterFrom:"yvlw-translate-x-full",enterTo:"yvlw-translate-x-0",leave:xt,leaveFrom:"yvlw-translate-x-0",leaveTo:"yvlw-translate-x-full",className:Ct,children:h("div",{className:`${ae.intro}`,children:h(et,{Icon:hs,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 En(e={}){const{timeout:t,onTimeout:n=()=>{}}=e,[r,o]=F(!1),i=g(null),a=A(()=>{t&&i.current&&clearTimeout(i.current)},[]),s=A(()=>{t&&(i.current=setTimeout(()=>{o(!0),n()},t))},[]),l=A(()=>{o(!1),s()},[]);return N(()=>a,[]),{timedOut:r,reset:l,start:s,stop:a}}const Is=1,Tn=8,$o="Place face in frame";function Hs(e){const{difficulty:t,timeout:n}=e,{saveStream:r}=Ne(),[o,i]=F([]),[a,s]=F($o),[l,u]=F(!1),[d,c]=F(!1),p=g(new Set),f=g(!1),v=g(null),{reset:y,start:m,stop:_,timedOut:w}=En({timeout:n}),b=()=>{i([]),s($o),u(!1),c(!1),p.current=new Set,f.current=!1,v.current=null,y()},C=$=>{const x=$*Tn,S=Math.ceil((x+1)/Ts);p.current.has(S)||(p.current.add(S),i(Array.from(p.current))),p.current.size>=Tn&&(_(),setTimeout(()=>{c(!0)},1e3))},E=($,x)=>{let I=Math.atan2(x,$)*(180/Math.PI);return I<0&&(I+=360),I},P=M(()=>{if(p.current.size===0)return 25;switch(t){case"easy":return 5;case"hard":return 15;default:return 10}},[]),R=$=>{const{keypoints:x,box:S}=$,I={x:S.width*.5,y:S.height*.5},X=x[Is],se={y:X.y-S.yMin,x:X.x-S.xMin},te=I.x-se.x,ne=se.y-I.y;return Math.abs(te)<P&&Math.abs(ne)<P?null:E(te,ne)},{detectFaces:V}=bn({frameSize:280,validations:["zoom","in-frame"],onFace:$=>{u(!0),s("Slowly move head around to complete circle");const x=R($);x&&C(x)},onError:$=>{s($),i([]),p.current.clear(),v.current=null,f.current=!1}});return h(H,{children:h($n,{instruction:{title:a,description:l?void 0:"Always ensure face is in frame"},name:"complete-the-circle",completed:d,failed:w,onReset:b,onStart:m,children:h(wn,{onStream:$=>{try{if(!$.current||d)return;const{videoWidth:x}=$.current;V({ref:$,frameSize:x})}catch{}},onRecord:r,children:h(Ls,{faceDetected:l,sectionsCount:Tn,visitedSections:o})})})})}const Cn={root:"_root_thujo_1",sticker:"_sticker_thujo_4",no:"_no_thujo_7",yes:"_yes_thujo_12"};function Ds(e){const{show:t,stickers:n}=e;return h(H,{children:t&&h("div",{className:Cn.root,children:n.map(r=>h("div",{className:`${Cn.sticker} ${Cn[r]}`,children:r.toUpperCase()},`sticker-${r}`))})})}const Os={question:"Are you alive?",errorMessage:"You have to be alive to proceed though",answer:!0},Rs="Wrong answer. Try again",Eo="Keep face in camera";function Vs(e){const{difficulty:t,questions:n=[Os],timeout:r}=e,[o,i]=F(Eo),[a,s]=F(!1),[l,u]=F(!1),{saveStream:d}=Ne(),c=g("inactive"),p=g(0),f=g(!1),v=g(null),y=g(null),m=()=>{v.current&&clearTimeout(v.current),y.current&&clearTimeout(y.current)},{reset:_,start:w,stop:b,timedOut:C}=En({timeout:r,onTimeout:m}),E=()=>{i(Eo),s(!1),u(!1),c.current="inactive",p.current=0,f.current=!1,_()},P=S=>{const{keypoints:I}=S,X=I[1],se=I[9],te=X.x-se.x,ne=X.y-se.y;return 90-Math.atan2(ne,te)*(180/Math.PI)},R=S=>{c.current="inactive",i(n[S].question),v.current=setTimeout(()=>{c.current="active"},2e3)},V=M(()=>{switch(t){case"easy":return 2;case"hard":return 6;default:return 4}},[]),W=S=>{try{if(c.current="inactive",Math.abs(S)<V)throw new Error("Tilt head further to answer");const I=S>0,X=n[p.current].answer;if(I===X)p.current+=1,p.current===n.length?(u(!0),b()):R(p.current);else throw new Error(n[p.current].errorMessage||Rs)}catch(I){i(I.message),y.current=setTimeout(()=>{R(p.current)},2e3)}},{detectFaces:$}=bn({onFace:S=>{if(f.current||(s(!0),f.current=!0,R(p.current)),c.current==="inactive")return;const I=P(S);W(I)},onError:S=>{i(S)}}),x=S=>{try{if(!S.current||l)return;const{videoWidth:I}=S.current;$({ref:S,frameSize:I})}catch{}};return N(()=>m,[]),h($n,{instruction:{title:o,description:a?"":"Move head left for No and right for Yes"},name:"yes-or-no",failed:C,onReset:E,onStart:w,completed:l,children:h(wn,{onStream:x,onRecord:d,children:h(Ds,{show:a,stickers:["yes","no"]})})})}function Us(e={}){const{onChange:t=()=>{}}=e,n=!!window.DeviceOrientationEvent,r=o=>{t({alpha:o.alpha,beta:o.beta,gamma:o.gamma})};return N(()=>(window.addEventListener("deviceorientation",r),()=>{window.removeEventListener("deviceorientation",r)}),[]),{canUse:n}}function Ws(e){const{total:t,onMessage:n,onComplete:r,difficulty:o}=e,i=g(null),a=g(!0),s=g(null),l=g(null),u=g(0),d=g(!1),c=M(()=>{switch(o){case"easy":return 6;case"hard":return 10;default:return 8}},[]),p=()=>{if(u.current<t){const m=t-u.current;let _=`Nod head ${m} `;m<t&&(_+="more "),_+=m>1?"times":"time",n(_);return}d.current=!0,n("Great, hang on..."),setTimeout(()=>{r()},500)},{canUse:f}=Us({onChange:m=>{l.current=m}});return{evaluate:m=>{if(!f){n("Cannot perform task. Transfer to mobile device to complete");return}if(!l.current||!l.current.beta){n("Cannot perform task. Transfer to mobile device to complete");return}if(l.current.beta<60||l.current.beta>100){n("Keep phone in upright position to continue");return}if(d.current)return;const{keypoints:_}=m,w=Oe(_[6].x-_[8].x,_[6].y-_[8].y),C=Oe(_[2].x-_[1].x,_[2].y-_[1].y)/w*10;if(C>c){if(i.current||!a.current)return;i.current=C,a.current=!1,s.current=setTimeout(()=>{i.current=null},3e3)}else i.current&&i.current-C>c/2&&(u.current+=1,i.current=null,s.current&&clearTimeout(s.current)),a.current=!0;p()},reset:()=>{i.current=null,a.current=!0,s.current=null,l.current=null,u.current=0,d.current=!1}}}function zs(e){const{onMessage:t,onComplete:n,difficulty:r}=e,o=g(!1),i=M(()=>{switch(r){case"easy":return 80;case"hard":return 120;default:return 100}},[]);return{evaluate:l=>{if(o.current)return;const{keypoints:u}=l,d=Oe(u[6].x-u[8].x,u[6].y-u[8].y);if(Oe(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 js(e){const{total:t,onMessage:n,onComplete:r,difficulty:o}=e,i=g(!0),a=g(!1),s=g(null),l=g(0),u=M(()=>{switch(o){case"easy":return{closed:20,open:30};case"hard":return{closed:10,open:30};default:return{closed:15,open:30}}},[]),d=y=>{i.current&&(y>=u.closed||(i.current=!1,s.current=Date.now()))},c=y=>{if(!i.current&&!(y<u.open)&&(i.current=!0,s.current)){const m=Date.now(),_=s.current;(m-_)/1e3<=2&&(l.current+=1)}},p=()=>{if(l.current<t){const y=t-l.current;let m=`Blink right eye ${y} `;y<t&&(m+="more "),m+=y>1?"times":"time",n(m);return}a.current=!0,n("Great, hang on..."),setTimeout(()=>{r()},500)};return{evaluate:y=>{if(a.current)return;const{keypoints:m}=y,_=Oe(m[6].x-m[8].x,m[6].y-m[8].y),b=Oe(m[145].x-m[159].x,m[145].y-m[159].y)/_*100;d(b),c(b),p()},reset:()=>{i.current=!0,a.current=!1,s.current=null,l.current=0}}}function Bs(){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 To=(e=>(e.nod="nod",e.open_mouth="open_mouth",e.blink="blink",e))(To||{});const Co=ws(Object.keys(To)),ko="Keep face in camera";function qs(e){const{difficulty:t,maxBlinks:n=5,maxNods:r=5,timeout:o}=e,i=g(0),[a,s]=F(ko),[l,u]=F(!1),[d,c]=F(null),p=g(!1),{requestDeviceOrientationPermission:f}=Bs(),{reset:v,start:y,stop:m,timedOut:_}=En({timeout:o}),w=()=>{if(i.current===Co.length-1){u(!0),m();return}i.current+=1},b=Ws({total:Math.floor(Math.random()*r+1),difficulty:t,onMessage:$=>s($),onComplete:w}),C=zs({difficulty:t,onMessage:$=>s($),onComplete:w}),E=js({total:Math.floor(Math.random()*n+1),difficulty:t,onMessage:$=>s($),onComplete:w}),{detectFaces:P}=bn({onFace:$=>{switch(p.current||(p.current=!0),Co[i.current]){case"nod":b.evaluate($);break;case"open_mouth":C.evaluate($);break;case"blink":E.evaluate($);break}},onError:$=>{s($)}}),R=()=>{i.current=0,s(ko),u(!1),p.current=!1,E.reset(),b.reset(),C.reset(),v()},V=async $=>{try{if(!$.current||l)return;const{videoWidth:x}=$.current;await P({ref:$,frameSize:x,throttleInterval:500})}catch{}},W=async()=>{try{await f()}catch($){const x=$;s(x.message),c(x)}};return h($n,{instruction:{title:a,description:"Follow the directives as instructed"},name:"motions",failed:_,onReset:R,completed:l,onStart:async()=>{await W(),y()},children:d?h(H,{}):h(wn,{onStream:V})})}function Ys(){var C;const{toggleColorScheme:e,getColorScheme:t,setColorScheme:n}=Ss(),{user:r,tasks:o,currentTaskIndex:i,completed:a,onComplete:s,faceDetector:l,presentation:u}=Ne(),[d,c]=F(!1),[p,f]=F(!1),[v,y]=F(null),[m,_]=F(!1);N(()=>{const E=t();n(E)},[]);const w=async()=>{try{c(!0),y(null),await s(),u==="page"&&_(!0)}catch(E){y(E.message)}finally{c(!1)}},b=A(E=>E===i?K.active:i>E?K.completed:"subtext",[i]);return h("div",{className:K.root,children:h("div",{className:K.container,children:[h("div",{className:`${K.lhs} divider`,children:[h("div",{className:K.info,children:[h(Fs,{}),h("div",{children:h("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."})}),h("ol",{children:[o.map((E,P)=>h("li",{className:b(P),children:po[E.id].name},`task-${P}`)),h("li",{className:a?K.active:"",children:"Complete! 🎉"})]})]}),h("footer",{className:"divider",children:[h("div",{children:"Powered by Youverify"}),h("div",{onClick:()=>e(),role:"button",children:[h("div",{className:"dark:yvlw-hidden",children:h(co,{})}),h("div",{className:"yvlw-hidden dark:yvlw-block",children:h(ls,{})})]})]})]}),h("div",{className:K.main,children:h("div",{className:K.content,children:[h(oe,{show:!p,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:h("div",{className:K.completed,children:l?h(et,{Icon:fs,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.",actionText:"Start Liveness Test",onActionClick:()=>f(!0)}):h(bo,{size:"lg"})})}),o.map((E,P)=>{let R;switch(E.id){case"complete-the-circle":R=h(Hs,{...E});break;case"yes-or-no":R=h(Vs,{...E});break;case"motions":R=h(qs,{...E});break;default:R=h(H,{});break}return h(oe,{show:p&&!a&&i===P,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:R},`task-${P}`)}),h(oe,{show:p&&a,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:h("div",{className:K.completed,children:h(et,{Icon:ps,title:m?"All Set!":"Completed",description:m?"You can now close or exit the window":"Your Identity verification has been completed successfully. Thanks for your patience",actionText:"Finish",loading:d,onActionClick:w,hideButton:m,children:v&&h("div",{className:"yvlw-mt-3",children:v})})})})]})}),h("div",{className:`${K.rhs} divider`,children:r&&h("div",{className:`${K.profile} divider`,children:[h("div",{children:h("div",{className:K.avatar,children:[r.firstName.charAt(0).toUpperCase(),(C=r.lastName)==null?void 0:C.charAt(0).toUpperCase()]})}),h("div",{children:[h("h4",{children:[r.firstName," ",r.lastName]}),r.email&&h("p",{className:"subtext",children:r.email})]})]})})]})})}function Ks(e){const{tasks:t,namespace:n,user:r,branding:o,onClose:i=()=>{},onSuccess:a,onFailure:s,presentation:l="modal",publicKey:u,metadata:d,sandboxEnvironment:c}=e,[p,f]=F(e.show),v=()=>{f(!1),i()};return h(xs,{namespace:n,publicKey:u,tasks:t,user:r,branding:o,onRequestClose:v,onSuccess:a,onFailure:s,metadata:d,presentation:l,sandboxEnvironment:c,children:h(as,{id:n,open:l==="page"?!0:p,onClose:v,transition:!0,className:`${ss.root} ${Tt.root} ${Tt[l]}`,style:{"--branding-color":(o==null?void 0:o.color)??Cs},children:[l==="modal"&&h("div",{onClick:v,role:"button",className:Tt.close,children:h(_s,{className:"yvlw-text-white"})}),h(lo,{className:`${Tt.container}`,children:h(Ys,{})})]})})}class Gs{constructor(t){this.tasks=[],this.container=null,this.namespace="liveness-web-sdk";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),Le(h(Ks,{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 Gs});
|