hello-csv
Version:
A modern CSV importer written in Preact
4 lines • 299 kB
JavaScript
"use strict";var ja=Object.defineProperty;var Ua=(e,t,n)=>t in e?ja(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Ae=(e,t,n)=>Ua(e,typeof t!="symbol"?t+"":t,n);Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});var _n,re,ll,yt,Zo,sl,Nr,al,mo,kr,Ar,ul,dn={},cl=[],Wa=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Kn=Array.isArray;function rt(e,t){for(var n in t)e[n]=t[n];return e}function go(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function P(e,t,n){var r,o,i,l={};for(i in t)i=="key"?r=t[i]:i=="ref"?o=t[i]:l[i]=t[i];if(arguments.length>2&&(l.children=arguments.length>3?_n.call(arguments,2):n),typeof e=="function"&&e.defaultProps!=null)for(i in e.defaultProps)l[i]===void 0&&(l[i]=e.defaultProps[i]);return on(e,l,r,o,null)}function on(e,t,n,r,o){var i={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:o??++ll,__i:-1,__u:0};return o==null&&re.vnode!=null&&re.vnode(i),i}function Yn(){return{current:null}}function me(e){return e.children}function ze(e,t){this.props=e,this.context=t}function Ht(e,t){if(t==null)return e.__?Ht(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"?Ht(e):null}function dl(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 dl(e)}}function Dr(e){(!e.__d&&(e.__d=!0)&&yt.push(e)&&!Vn.__r++||Zo!==re.debounceRendering)&&((Zo=re.debounceRendering)||sl)(Vn)}function Vn(){var e,t,n,r,o,i,l,s;for(yt.sort(Nr);e=yt.shift();)e.__d&&(t=yt.length,r=void 0,i=(o=(n=e).__v).__e,l=[],s=[],n.__P&&((r=rt({},o)).__v=o.__v+1,re.vnode&&re.vnode(r),ho(n.__P,r,o,n.__n,n.__P.namespaceURI,32&o.__u?[i]:null,l,i??Ht(o),!!(32&o.__u),s),r.__v=o.__v,r.__.__k[r.__i]=r,ml(l,r,s),r.__e!=i&&dl(r)),yt.length>t&&yt.sort(Nr));Vn.__r=0}function fl(e,t,n,r,o,i,l,s,a,u,c){var d,p,f,m,h,v,w=r&&r.__k||cl,b=t.length;for(a=Ga(n,t,w,a,b),d=0;d<b;d++)(f=n.__k[d])!=null&&(p=f.__i===-1?dn:w[f.__i]||dn,f.__i=d,v=ho(e,f,p,o,i,l,s,a,u,c),m=f.__e,f.ref&&p.ref!=f.ref&&(p.ref&&vo(p.ref,null,f),c.push(f.ref,f.__c||m,f)),h==null&&m!=null&&(h=m),4&f.__u||p.__k===f.__k?a=pl(f,a,e):typeof f.type=="function"&&v!==void 0?a=v:m&&(a=m.nextSibling),f.__u&=-7);return n.__e=h,a}function Ga(e,t,n,r,o){var i,l,s,a,u,c=n.length,d=c,p=0;for(e.__k=new Array(o),i=0;i<o;i++)(l=t[i])!=null&&typeof l!="boolean"&&typeof l!="function"?(a=i+p,(l=e.__k[i]=typeof l=="string"||typeof l=="number"||typeof l=="bigint"||l.constructor==String?on(null,l,null,null,null):Kn(l)?on(me,{children:l},null,null,null):l.constructor===void 0&&l.__b>0?on(l.type,l.props,l.key,l.ref?l.ref:null,l.__v):l).__=e,l.__b=e.__b+1,s=null,(u=l.__i=qa(l,n,a,d))!==-1&&(d--,(s=n[u])&&(s.__u|=2)),s==null||s.__v===null?(u==-1&&p--,typeof l.type!="function"&&(l.__u|=4)):u!=a&&(u==a-1?p--:u==a+1?p++:(u>a?p--:p++,l.__u|=4))):e.__k[i]=null;if(d)for(i=0;i<c;i++)(s=n[i])!=null&&(2&s.__u)==0&&(s.__e==r&&(r=Ht(s)),gl(s,s));return r}function pl(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=pl(r[o],t,n));return t}e.__e!=t&&(t&&e.type&&!n.contains(t)&&(t=Ht(e)),n.insertBefore(e.__e,t||null),t=e.__e);do t=t&&t.nextSibling;while(t!=null&&t.nodeType==8);return t}function ot(e,t){return t=t||[],e==null||typeof e=="boolean"||(Kn(e)?e.some(function(n){ot(n,t)}):t.push(e)),t}function qa(e,t,n,r){var o,i,l=e.key,s=e.type,a=t[n];if(a===null||a&&l==a.key&&s===a.type&&(2&a.__u)==0)return n;if(r>(a!=null&&(2&a.__u)==0?1:0))for(o=n-1,i=n+1;o>=0||i<t.length;){if(o>=0){if((a=t[o])&&(2&a.__u)==0&&l==a.key&&s===a.type)return o;o--}if(i<t.length){if((a=t[i])&&(2&a.__u)==0&&l==a.key&&s===a.type)return i;i++}}return-1}function Jo(e,t,n){t[0]=="-"?e.setProperty(t,n??""):e[t]=n==null?"":typeof n!="number"||Wa.test(t)?n:n+"px"}function In(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||Jo(e.style,t,"");if(n)for(t in n)r&&n[t]===r[t]||Jo(e.style,t,n[t])}else if(t[0]=="o"&&t[1]=="n")i=t!=(t=t.replace(al,"$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=mo,e.addEventListener(t,i?Ar:kr,i)):e.removeEventListener(t,i?Ar:kr,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 Qo(e){return function(t){if(this.l){var n=this.l[t.type+e];if(t.t==null)t.t=mo++;else if(t.t<n.u)return;return n(re.event?re.event(t):t)}}}function ho(e,t,n,r,o,i,l,s,a,u){var c,d,p,f,m,h,v,w,b,C,E,I,M,R,_,y,x,S=t.type;if(t.constructor!==void 0)return null;128&n.__u&&(a=!!(32&n.__u),i=[s=t.__e=n.__e]),(c=re.__b)&&c(t);e:if(typeof S=="function")try{if(w=t.props,b="prototype"in S&&S.prototype.render,C=(c=S.contextType)&&r[c.__c],E=c?C?C.props.value:c.__:r,n.__c?v=(d=t.__c=n.__c).__=d.__E:(b?t.__c=d=new S(w,E):(t.__c=d=new ze(w,E),d.constructor=S,d.render=Ya),C&&C.sub(d),d.props=w,d.state||(d.state={}),d.context=E,d.__n=r,p=d.__d=!0,d.__h=[],d._sb=[]),b&&d.__s==null&&(d.__s=d.state),b&&S.getDerivedStateFromProps!=null&&(d.__s==d.state&&(d.__s=rt({},d.__s)),rt(d.__s,S.getDerivedStateFromProps(w,d.__s))),f=d.props,m=d.state,d.__v=t,p)b&&S.getDerivedStateFromProps==null&&d.componentWillMount!=null&&d.componentWillMount(),b&&d.componentDidMount!=null&&d.__h.push(d.componentDidMount);else{if(b&&S.getDerivedStateFromProps==null&&w!==f&&d.componentWillReceiveProps!=null&&d.componentWillReceiveProps(w,E),!d.__e&&(d.shouldComponentUpdate!=null&&d.shouldComponentUpdate(w,d.__s,E)===!1||t.__v==n.__v)){for(t.__v!=n.__v&&(d.props=w,d.state=d.__s,d.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.some(function(T){T&&(T.__=t)}),I=0;I<d._sb.length;I++)d.__h.push(d._sb[I]);d._sb=[],d.__h.length&&l.push(d);break e}d.componentWillUpdate!=null&&d.componentWillUpdate(w,d.__s,E),b&&d.componentDidUpdate!=null&&d.__h.push(function(){d.componentDidUpdate(f,m,h)})}if(d.context=E,d.props=w,d.__P=e,d.__e=!1,M=re.__r,R=0,b){for(d.state=d.__s,d.__d=!1,M&&M(t),c=d.render(d.props,d.state,d.context),_=0;_<d._sb.length;_++)d.__h.push(d._sb[_]);d._sb=[]}else do d.__d=!1,M&&M(t),c=d.render(d.props,d.state,d.context),d.state=d.__s;while(d.__d&&++R<25);d.state=d.__s,d.getChildContext!=null&&(r=rt(rt({},r),d.getChildContext())),b&&!p&&d.getSnapshotBeforeUpdate!=null&&(h=d.getSnapshotBeforeUpdate(f,m)),s=fl(e,Kn(y=c!=null&&c.type===me&&c.key==null?c.props.children:c)?y:[y],t,n,r,o,i,l,s,a,u),d.base=t.__e,t.__u&=-161,d.__h.length&&l.push(d),v&&(d.__E=d.__=null)}catch(T){if(t.__v=null,a||i!=null)if(T.then){for(t.__u|=a?160:128;s&&s.nodeType==8&&s.nextSibling;)s=s.nextSibling;i[i.indexOf(s)]=null,t.__e=s}else for(x=i.length;x--;)go(i[x]);else t.__e=n.__e,t.__k=n.__k;re.__e(T,t,n)}else i==null&&t.__v==n.__v?(t.__k=n.__k,t.__e=n.__e):s=t.__e=Ka(n.__e,t,n,r,o,i,l,a,u);return(c=re.diffed)&&c(t),128&t.__u?void 0:s}function ml(e,t,n){for(var r=0;r<n.length;r++)vo(n[r],n[++r],n[++r]);re.__c&&re.__c(t,e),e.some(function(o){try{e=o.__h,o.__h=[],e.some(function(i){i.call(o)})}catch(i){re.__e(i,o.__v)}})}function Ka(e,t,n,r,o,i,l,s,a){var u,c,d,p,f,m,h,v=n.props,w=t.props,b=t.type;if(b=="svg"?o="http://www.w3.org/2000/svg":b=="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==!!b&&(b?f.localName==b:f.nodeType==3)){e=f,i[u]=null;break}}if(e==null){if(b==null)return document.createTextNode(w);e=document.createElementNS(o,b,w.is&&w),s&&(re.__m&&re.__m(t,i),s=!1),i=null}if(b===null)v===w||s&&e.data===w||(e.data=w);else{if(i=i&&_n.call(e.childNodes),v=n.props||dn,!s&&i!=null)for(v={},u=0;u<e.attributes.length;u++)v[(f=e.attributes[u]).name]=f.value;for(u in v)if(f=v[u],u!="children"){if(u=="dangerouslySetInnerHTML")d=f;else if(!(u in w)){if(u=="value"&&"defaultValue"in w||u=="checked"&&"defaultChecked"in w)continue;In(e,u,null,f,o)}}for(u in w)f=w[u],u=="children"?p=f:u=="dangerouslySetInnerHTML"?c=f:u=="value"?m=f:u=="checked"?h=f:s&&typeof f!="function"||v[u]===f||In(e,u,f,v[u],o);if(c)s||d&&(c.__html===d.__html||c.__html===e.innerHTML)||(e.innerHTML=c.__html),t.__k=[];else if(d&&(e.innerHTML=""),fl(e,Kn(p)?p:[p],t,n,r,b=="foreignObject"?"http://www.w3.org/1999/xhtml":o,i,l,i?i[0]:n.__k&&Ht(n,0),s,a),i!=null)for(u=i.length;u--;)go(i[u]);s||(u="value",b=="progress"&&m==null?e.removeAttribute("value"):m!==void 0&&(m!==e[u]||b=="progress"&&!m||b=="option"&&m!==v[u])&&In(e,u,m,v[u],o),u="checked",h!==void 0&&h!==e[u]&&In(e,u,h,v[u],o))}return e}function vo(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){re.__e(o,n)}}function gl(e,t,n){var r,o;if(re.unmount&&re.unmount(e),(r=e.ref)&&(r.current&&r.current!==e.__e||vo(r,null,t)),(r=e.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(i){re.__e(i,t)}r.base=r.__P=null}if(r=e.__k)for(o=0;o<r.length;o++)r[o]&&gl(r[o],t,n||typeof e.type!="function");n||go(e.__e),e.__c=e.__=e.__e=void 0}function Ya(e,t,n){return this.constructor(e,n)}function zt(e,t,n){var r,o,i,l;t==document&&(t=document.documentElement),re.__&&re.__(e,t),o=(r=typeof n=="function")?null:n&&n.__k||t.__k,i=[],l=[],ho(t,e=(!r&&n||t).__k=P(me,null,[e]),o||dn,dn,t.namespaceURI,!r&&n?[n]:o?null:t.firstChild?_n.call(t.childNodes):null,i,!r&&n?n:o?o.__e:t.firstChild,r,l),ml(i,e,l)}function hl(e,t){zt(e,t,hl)}function Xa(e,t,n){var r,o,i,l,s=rt({},e.props);for(i in e.type&&e.type.defaultProps&&(l=e.type.defaultProps),t)i=="key"?r=t[i]:i=="ref"?o=t[i]:s[i]=t[i]===void 0&&l!==void 0?l[i]:t[i];return arguments.length>2&&(s.children=arguments.length>3?_n.call(arguments,2):n),on(e.type,s,r||e.key,o||e.ref,null)}function pe(e,t){var n={__c:t="__cC"+ul++,__:e,Consumer:function(r,o){return r.children(o)},Provider:function(r){var o,i;return this.getChildContext||(o=new Set,(i={})[t]=this,this.getChildContext=function(){return i},this.componentWillUnmount=function(){o=null},this.shouldComponentUpdate=function(l){this.props.value!==l.value&&o.forEach(function(s){s.__e=!0,Dr(s)})},this.sub=function(l){o.add(l);var s=l.componentWillUnmount;l.componentWillUnmount=function(){o&&o.delete(l),s&&s.call(l)}}),r.children}};return n.Provider.__=n.Consumer.contextType=n}_n=cl.slice,re={__e:function(e,t,n,r){for(var o,i,l;t=t.__;)if((o=t.__c)&&!o.__)try{if((i=o.constructor)&&i.getDerivedStateFromError!=null&&(o.setState(i.getDerivedStateFromError(e)),l=o.__d),o.componentDidCatch!=null&&(o.componentDidCatch(e,r||{}),l=o.__d),l)return o.__E=o}catch(s){e=s}throw e}},ll=0,ze.prototype.setState=function(e,t){var n;n=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=rt({},this.state),typeof e=="function"&&(e=e(rt({},n),this.props)),e&&rt(n,e),e!=null&&this.__v&&(t&&this._sb.push(t),Dr(this))},ze.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),Dr(this))},ze.prototype.render=me,yt=[],sl=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Nr=function(e,t){return e.__v.__b-t.__v.__b},Vn.__r=0,al=/(PointerCapture)$|Capture$/i,mo=0,kr=Qo(!1),Ar=Qo(!0),ul=0;var Za=0;function g(e,t,n,r,o,i){t||(t={});var l,s,a=t;if("ref"in a)for(s in a={},t)s=="ref"?l=t[s]:a[s]=t[s];var u={type:e,props:a,key:n,ref:l,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--Za,__i:-1,__u:0,__source:o,__self:i};if(typeof e=="function"&&(l=e.defaultProps))for(s in l)a[s]===void 0&&(a[s]=l[s]);return re.vnode&&re.vnode(u),u}var lt,fe,gr,ei,Bt=0,vl=[],_e=re,ti=_e.__b,ni=_e.__r,ri=_e.diffed,oi=_e.__c,ii=_e.unmount,li=_e.__;function Tt(e,t){_e.__h&&_e.__h(fe,e,Bt||t),Bt=0;var n=fe.__H||(fe.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function U(e){return Bt=1,st(_l,e)}function st(e,t,n){var r=Tt(lt++,2);if(r.t=e,!r.__c&&(r.__=[n?n(t):_l(void 0,t),function(s){var a=r.__N?r.__N[0]:r.__[0],u=r.t(a,s);a!==u&&(r.__N=[u,r.__[1]],r.__c.setState({}))}],r.__c=fe,!fe.u)){var o=function(s,a,u){if(!r.__c.__H)return!0;var c=r.__c.__H.__.filter(function(p){return!!p.__c});if(c.every(function(p){return!p.__N}))return!i||i.call(this,s,a,u);var d=r.__c.props!==s;return c.forEach(function(p){if(p.__N){var f=p.__[0];p.__=p.__N,p.__N=void 0,f!==p.__[0]&&(d=!0)}}),i&&i.call(this,s,a,u)||d};fe.u=!0;var i=fe.shouldComponentUpdate,l=fe.componentWillUpdate;fe.componentWillUpdate=function(s,a,u){if(this.__e){var c=i;i=void 0,o(s,a,u),i=c}l&&l.call(this,s,a,u)},fe.shouldComponentUpdate=o}return r.__N||r.__}function oe(e,t){var n=Tt(lt++,3);!_e.__s&&yo(n.__H,t)&&(n.__=e,n.i=t,fe.__H.__h.push(n))}function Ze(e,t){var n=Tt(lt++,4);!_e.__s&&yo(n.__H,t)&&(n.__=e,n.i=t,fe.__h.push(n))}function D(e){return Bt=5,W(function(){return{current:e}},[])}function _o(e,t,n){Bt=6,Ze(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 W(e,t){var n=Tt(lt++,7);return yo(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function ie(e,t){return Bt=8,W(function(){return e},t)}function ae(e){var t=fe.context[e.__c],n=Tt(lt++,9);return n.c=e,t?(n.__==null&&(n.__=!0,t.sub(fe)),t.props.value):e.__}function wo(e,t){_e.useDebugValue&&_e.useDebugValue(t?t(e):e)}function Ja(e){var t=Tt(lt++,10),n=U();return t.__=e,fe.componentDidCatch||(fe.componentDidCatch=function(r,o){t.__&&t.__(r,o),n[1](r)}),[n[0],function(){n[1](void 0)}]}function Me(){var e=Tt(lt++,11);if(!e.__){for(var t=fe.__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 Qa(){for(var e;e=vl.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(kn),e.__H.__h.forEach(Lr),e.__H.__h=[]}catch(t){e.__H.__h=[],_e.__e(t,e.__v)}}_e.__b=function(e){fe=null,ti&&ti(e)},_e.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),li&&li(e,t)},_e.__r=function(e){ni&&ni(e),lt=0;var t=(fe=e.__c).__H;t&&(gr===fe?(t.__h=[],fe.__h=[],t.__.forEach(function(n){n.__N&&(n.__=n.__N),n.i=n.__N=void 0})):(t.__h.forEach(kn),t.__h.forEach(Lr),t.__h=[],lt=0)),gr=fe},_e.diffed=function(e){ri&&ri(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(vl.push(t)!==1&&ei===_e.requestAnimationFrame||((ei=_e.requestAnimationFrame)||eu)(Qa)),t.__H.__.forEach(function(n){n.i&&(n.__H=n.i),n.i=void 0})),gr=fe=null},_e.__c=function(e,t){t.some(function(n){try{n.__h.forEach(kn),n.__h=n.__h.filter(function(r){return!r.__||Lr(r)})}catch(r){t.some(function(o){o.__h&&(o.__h=[])}),t=[],_e.__e(r,n.__v)}}),oi&&oi(e,t)},_e.unmount=function(e){ii&&ii(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach(function(r){try{kn(r)}catch(o){t=o}}),n.__H=void 0,t&&_e.__e(t,n.__v))};var si=typeof requestAnimationFrame=="function";function eu(e){var t,n=function(){clearTimeout(r),si&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,100);si&&(t=requestAnimationFrame(n))}function kn(e){var t=fe,n=e.__c;typeof n=="function"&&(e.__c=void 0,n()),fe=t}function Lr(e){var t=fe;e.__c=e.__(),fe=t}function yo(e,t){return!e||e.length!==t.length||t.some(function(n,r){return n!==e[r]})}function _l(e,t){return typeof t=="function"?t(e):t}function wl(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=wl(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function tu(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=wl(e))&&(r&&(r+=" "),r+=t);return r}const ai=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,ui=tu,It=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return ui(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:o,defaultVariants:i}=t,l=Object.keys(o).map(u=>{const c=n==null?void 0:n[u],d=i==null?void 0:i[u];if(c===null)return null;const p=ai(c)||ai(d);return o[u][p]}),s=n&&Object.entries(n).reduce((u,c)=>{let[d,p]=c;return p===void 0||(u[d]=p),u},{}),a=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((u,c)=>{let{class:d,className:p,...f}=c;return Object.entries(f).every(m=>{let[h,v]=m;return Array.isArray(v)?v.includes({...i,...s}[h]):{...i,...s}[h]===v})?[...u,d,p]:u},[]);return ui(e,l,a,n==null?void 0:n.class,n==null?void 0:n.className)},nu=It("text-center inline-block font-semibold px-3 py-2 rounded-md text-sm",{variants:{variant:{primary:"shadow-xs bg-hello-csv-primary text-white",secondary:"bg-white text-hello-csv-primary ring-1 shadow-xs ring-bg-hello-csv-primary ring-inset",tertiary:"bg-white text-gray-900 ring-1 shadow-xs ring-hello-csv-tertiary ring-inset",success:"shadow-xs bg-hello-csv-success text-white",danger:"shadow-xs bg-hello-csv-danger text-white"},withFullWidth:{true:"w-full",false:""},disabled:{true:"opacity-50 cursor-not-allowed pointer-events-none",false:"cursor-pointer"}},compoundVariants:[{variant:"primary",disabled:!1,className:"hover:bg-hello-csv-primary-light focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-hello-csv-primary"},{variant:"secondary",disabled:!1,className:"hover:opacity-80 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-hello-csv-secondary"},{variant:"tertiary",disabled:!1,className:"hover:bg-hello-csv-tertiary-light"},{variant:"success",disabled:!1,className:"hover:opacity-80 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-hello-csv-success"},{variant:"danger",disabled:!1,className:"hover:bg-hello-csv-danger-light focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-hello-csv-danger"}],defaultVariants:{withFullWidth:!1,variant:"primary",disabled:!1}});function He({children:e,variant:t,disabled:n,onClick:r,withFullWidth:o}){const i=nu({variant:t,disabled:n,withFullWidth:o});return g("div",{role:"button",tabIndex:0,className:i,onClick:r,"aria-disabled":n,children:e})}function yl(e,t){for(var n in t)e[n]=t[n];return e}function Vr(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 Xn(e,t){var n=t(),r=U({t:{__:n,u:t}}),o=r[0].t,i=r[1];return Ze(function(){o.__=n,o.u=t,hr(o)&&i({t:o})},[e,n,t]),oe(function(){return hr(o)&&i({t:o}),e(function(){hr(o)&&i({t:o})})},[e]),n}function hr(e){var t,n,r=e.u,o=e.__;try{var i=r();return!((t=o)===(n=i)&&(t!==0||1/t==1/n)||t!=t&&n!=n)}catch{return!0}}function bo(e){e()}function xo(e){return e}function Co(){return[!1,bo]}var So=Ze;function Hn(e,t){this.props=e,this.context=t}function bl(e,t){function n(o){var i=this.props.ref,l=i==o.ref;return!l&&i&&(i.call?i(null):i.current=null),t?!t(this.props,o)||!l:Vr(this.props,o)}function r(o){return this.shouldComponentUpdate=n,P(e,o)}return r.displayName="Memo("+(e.displayName||e.name)+")",r.prototype.isReactComponent=!0,r.__f=!0,r}(Hn.prototype=new ze).isPureReactComponent=!0,Hn.prototype.shouldComponentUpdate=function(e,t){return Vr(this.props,e)||Vr(this.state,t)};var ci=re.__b;re.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),ci&&ci(e)};var ru=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.forward_ref")||3911;function de(e){function t(n){var r=yl({},n);return delete r.ref,e(r,n.ref||null)}return t.$$typeof=ru,t.render=t,t.prototype.isReactComponent=t.__f=!0,t.displayName="ForwardRef("+(e.displayName||e.name)+")",t}var di=function(e,t){return e==null?null:ot(ot(e).map(t))},xl={map:di,forEach:di,count:function(e){return e?ot(e).length:0},only:function(e){var t=ot(e);if(t.length!==1)throw"Children.only";return t[0]},toArray:ot},ou=re.__e;re.__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)}ou(e,t,n,r)};var fi=re.unmount;function Cl(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=yl({},e)).__c!=null&&(e.__c.__P===n&&(e.__c.__P=t),e.__c=null),e.__k=e.__k&&e.__k.map(function(r){return Cl(r,t,n)})),e}function Sl(e,t,n){return e&&n&&(e.__v=null,e.__k=e.__k&&e.__k.map(function(r){return Sl(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 ln(){this.__u=0,this.o=null,this.__b=null}function El(e){var t=e.__.__c;return t&&t.__a&&t.__a(e)}function Rl(e){var t,n,r;function o(i){if(t||(t=e()).then(function(l){n=l.default||l},function(l){r=l}),r)throw r;if(!n)throw t;return P(n,i)}return o.displayName="Lazy",o.__f=!0,o}function At(){this.i=null,this.l=null}re.unmount=function(e){var t=e.__c;t&&t.__R&&t.__R(),t&&32&e.__u&&(e.type=null),fi&&fi(e)},(ln.prototype=new ze).__c=function(e,t){var n=t.__c,r=this;r.o==null&&(r.o=[]),r.o.push(n);var o=El(r.__v),i=!1,l=function(){i||(i=!0,n.__R=null,o?o(s):s())};n.__R=l;var s=function(){if(!--r.__u){if(r.state.__a){var a=r.state.__a;r.__v.__k[0]=Sl(a,a.__c.__P,a.__c.__O)}var u;for(r.setState({__a:r.__b=null});u=r.o.pop();)u.forceUpdate()}};r.__u++||32&t.__u||r.setState({__a:r.__b=r.__v.__k[0]}),e.then(l,l)},ln.prototype.componentWillUnmount=function(){this.o=[]},ln.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]=Cl(this.__b,n,r.__O=r.__P)}this.__b=null}var o=t.__a&&P(me,null,e.fallback);return o&&(o.__u&=-33),[P(me,null,t.__a?null:e.children),o]};var pi=function(e,t,n){if(++n[1]===n[0]&&e.l.delete(t),e.props.revealOrder&&(e.props.revealOrder[0]!=="t"||!e.l.size))for(n=e.i;n;){for(;n.length>3;)n.pop()();if(n[1]<n[0])break;e.i=n=n[2]}};function iu(e){return this.getChildContext=function(){return e.context},e.children}function lu(e){var t=this,n=e.h;t.componentWillUnmount=function(){zt(null,t.v),t.v=null,t.h=null},t.h&&t.h!==n&&t.componentWillUnmount(),t.v||(t.h=n,t.v={nodeType:1,parentNode:n,childNodes:[],contains:function(){return!0},appendChild:function(r){this.childNodes.push(r),t.h.appendChild(r)},insertBefore:function(r,o){this.childNodes.push(r),t.h.insertBefore(r,o)},removeChild:function(r){this.childNodes.splice(this.childNodes.indexOf(r)>>>1,1),t.h.removeChild(r)}}),zt(P(iu,{context:t.context},e.__v),t.v)}function wn(e,t){var n=P(lu,{__v:e,h:t});return n.containerInfo=t,n}(At.prototype=new ze).__a=function(e){var t=this,n=El(t.__v),r=t.l.get(e);return r[0]++,function(o){var i=function(){t.props.revealOrder?(r.push(o),pi(t,e,r)):o()};n?n(i):i()}},At.prototype.render=function(e){this.i=null,this.l=new Map;var t=ot(e.children);e.revealOrder&&e.revealOrder[0]==="b"&&t.reverse();for(var n=t.length;n--;)this.l.set(t[n],this.i=[1,0,this.i]);return e.children},At.prototype.componentDidUpdate=At.prototype.componentDidMount=function(){var e=this;this.l.forEach(function(t,n){pi(e,n,t)})};var $l=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.element")||60103,su=/^(?: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]/,au=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,uu=/[A-Z0-9]/g,cu=typeof document<"u",du=function(e){return(typeof Symbol<"u"&&typeof Symbol()=="symbol"?/fil|che|rad/:/fil|che|ra/).test(e)};function Tl(e,t,n){return t.__k==null&&(t.textContent=""),zt(e,t),typeof n=="function"&&n(),e?e.__c:null}function Il(e,t,n){return hl(e,t),typeof n=="function"&&n(),e?e.__c:null}ze.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(e){Object.defineProperty(ze.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})});var mi=re.event;function fu(){}function pu(){return this.cancelBubble}function mu(){return this.defaultPrevented}re.event=function(e){return mi&&(e=mi(e)),e.persist=fu,e.isPropagationStopped=pu,e.isDefaultPrevented=mu,e.nativeEvent=e};var Eo,gu={enumerable:!1,configurable:!0,get:function(){return this.class}},gi=re.vnode;re.vnode=function(e){typeof e.type=="string"&&function(t){var n=t.props,r=t.type,o={},i=r.indexOf("-")===-1;for(var l in n){var s=n[l];if(!(l==="value"&&"defaultValue"in n&&s==null||cu&&l==="children"&&r==="noscript"||l==="class"||l==="className")){var a=l.toLowerCase();l==="defaultValue"&&"value"in n&&n.value==null?l="value":l==="download"&&s===!0?s="":a==="translate"&&s==="no"?s=!1:a[0]==="o"&&a[1]==="n"?a==="ondoubleclick"?l="ondblclick":a!=="onchange"||r!=="input"&&r!=="textarea"||du(n.type)?a==="onfocus"?l="onfocusin":a==="onblur"?l="onfocusout":au.test(l)&&(l=a):a=l="oninput":i&&su.test(l)?l=l.replace(uu,"-$&").toLowerCase():s===null&&(s=void 0),a==="oninput"&&o[l=a]&&(l="oninputCapture"),o[l]=s}}r=="select"&&o.multiple&&Array.isArray(o.value)&&(o.value=ot(n.children).forEach(function(u){u.props.selected=o.value.indexOf(u.props.value)!=-1})),r=="select"&&o.defaultValue!=null&&(o.value=ot(n.children).forEach(function(u){u.props.selected=o.multiple?o.defaultValue.indexOf(u.props.value)!=-1:o.defaultValue==u.props.value})),n.class&&!n.className?(o.class=n.class,Object.defineProperty(o,"className",gu)):(n.className&&!n.class||n.class&&n.className)&&(o.class=o.className=n.className),t.props=o}(e),e.$$typeof=$l,gi&&gi(e)};var hi=re.__r;re.__r=function(e){hi&&hi(e),Eo=e.__c};var vi=re.diffed;re.diffed=function(e){vi&&vi(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),Eo=null};var Ml={ReactCurrentDispatcher:{current:{readContext:function(e){return Eo.__n[e.__c].props.value},useCallback:ie,useContext:ae,useDebugValue:wo,useDeferredValue:xo,useEffect:oe,useId:Me,useImperativeHandle:_o,useInsertionEffect:So,useLayoutEffect:Ze,useMemo:W,useReducer:st,useRef:D,useState:U,useSyncExternalStore:Xn,useTransition:Co}}},hu="18.3.1";function Ol(e){return P.bind(null,e)}function Gt(e){return!!e&&e.$$typeof===$l}function Fl(e){return Gt(e)&&e.type===me}function Pl(e){return!!e&&!!e.displayName&&(typeof e.displayName=="string"||e.displayName instanceof String)&&e.displayName.startsWith("Memo(")}function Ro(e){return Gt(e)?Xa.apply(null,arguments):e}function Nl(e){return!!e.__k&&(zt(null,e),!0)}function kl(e){return e&&(e.base||e.nodeType===1&&e)||null}var Al=function(e,t){return e(t)},De=function(e,t){return e(t)},Dl=me,Ll=Gt,L={useState:U,useId:Me,useReducer:st,useEffect:oe,useLayoutEffect:Ze,useInsertionEffect:So,useTransition:Co,useDeferredValue:xo,useSyncExternalStore:Xn,startTransition:bo,useRef:D,useImperativeHandle:_o,useMemo:W,useCallback:ie,useContext:ae,useDebugValue:wo,version:"18.3.1",Children:xl,render:Tl,hydrate:Il,unmountComponentAtNode:Nl,createPortal:wn,createElement:P,createContext:pe,createFactory:Ol,cloneElement:Ro,createRef:Yn,Fragment:me,isValidElement:Gt,isElement:Ll,isFragment:Fl,isMemo:Pl,findDOMNode:kl,Component:ze,PureComponent:Hn,memo:bl,forwardRef:de,flushSync:De,unstable_batchedUpdates:Al,StrictMode:Dl,Suspense:ln,SuspenseList:At,lazy:Rl,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:Ml};const Hr=Object.freeze(Object.defineProperty({__proto__:null,Children:xl,Component:ze,Fragment:me,PureComponent:Hn,StrictMode:Dl,Suspense:ln,SuspenseList:At,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:Ml,cloneElement:Ro,createContext:pe,createElement:P,createFactory:Ol,createPortal:wn,createRef:Yn,default:L,findDOMNode:kl,flushSync:De,forwardRef:de,hydrate:Il,isElement:Ll,isFragment:Fl,isMemo:Pl,isValidElement:Gt,lazy:Rl,memo:bl,render:Tl,startTransition:bo,unmountComponentAtNode:Nl,unstable_batchedUpdates:Al,useCallback:ie,useContext:ae,useDebugValue:wo,useDeferredValue:xo,useEffect:oe,useErrorBoundary:Ja,useId:Me,useImperativeHandle:_o,useInsertionEffect:So,useLayoutEffect:Ze,useMemo:W,useReducer:st,useRef:D,useState:U,useSyncExternalStore:Xn,useTransition:Co,version:hu},Symbol.toStringTag,{value:"Module"})),vu=It("overflow-hidden rounded-md border border-gray-200",{variants:{variant:{default:"bg-white",muted:"bg-hello-csv-muted"},withPadding:{true:"px-4 py-5 sm:p-6",false:""}},defaultVariants:{variant:"default",withPadding:!0}}),Vl=de(({children:e,className:t,variant:n,withPadding:r=!0},o)=>{const i=vu({variant:n,withPadding:r});return g("div",{ref:o,className:`${i} ${t}`,children:e})});function Hl({checked:e,setChecked:t,label:n}){const r=Me();return g("div",{className:"flex gap-3",children:[g("div",{className:"flex h-6 shrink-0 items-center",children:g("div",{className:"group grid size-4 grid-cols-1",children:[g("input",{checked:e,onChange:o=>t(o.target.checked),id:r,type:"checkbox",className:"checked:border-hello-csv-primary checked:bg-hello-csv-primary indeterminate:border-hello-csv-primary indeterminate:bg-hello-csv-primary focus-visible:outline-hello-csv-hello-csv-primary col-start-1 row-start-1 appearance-none rounded-sm border border-gray-300 bg-white focus-visible:outline-2 focus-visible:outline-offset-2 disabled:border-gray-300 disabled:bg-gray-100 disabled:checked:bg-gray-100 forced-colors:appearance-auto"}),g("svg",{fill:"none",viewBox:"0 0 14 14",className:"pointer-events-none col-start-1 row-start-1 size-3.5 self-center justify-self-center stroke-white group-has-disabled:stroke-gray-950/25",children:[g("path",{d:"M3 8L6 11L11 3.5",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",className:"opacity-0 group-has-checked:opacity-100"}),g("path",{d:"M3 7H11",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",className:"opacity-0 group-has-indeterminate:opacity-100"})]})]})}),n&&g("div",{className:"text-sm/6",children:g("label",{htmlFor:r,className:"font-medium text-gray-900",children:n})})]})}let _u=!1;function $o(){return _u}const zl=typeof document<"u"?L.useLayoutEffect:()=>{};function wu(e){const t=D(null);return zl(()=>{t.current=e},[e]),ie((...n)=>{const r=t.current;return r==null?void 0:r(...n)},[])}const vt=e=>{var t;return(t=e==null?void 0:e.ownerDocument)!==null&&t!==void 0?t:document},xt=e=>e&&"window"in e&&e.window===e?e:vt(e).defaultView||window;function yu(e){return e!==null&&typeof e=="object"&&"nodeType"in e&&typeof e.nodeType=="number"}function bu(e){return yu(e)&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&"host"in e}function Bl(e,t){if(!$o())return t&&e?e.contains(t):!1;if(!e||!t)return!1;let n=t;for(;n!==null;){if(n===e)return!0;n.tagName==="SLOT"&&n.assignedSlot?n=n.assignedSlot.parentNode:bu(n)?n=n.host:n=n.parentNode}return!1}const zr=(e=document)=>{var t;if(!$o())return e.activeElement;let n=e.activeElement;for(;n&&"shadowRoot"in n&&(!((t=n.shadowRoot)===null||t===void 0)&&t.activeElement);)n=n.shadowRoot.activeElement;return n};function jl(e){return $o()&&e.target.shadowRoot&&e.composedPath?e.composedPath()[0]:e.target}function xu(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 Cu(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 Ul(e){let t=null;return()=>(t==null&&(t=e()),t)}const Su=Ul(function(){return Cu(/^Mac/i)}),Eu=Ul(function(){return xu(/Android/i)});function Wl(){let e=D(new Map),t=ie((o,i,l,s)=>{let a=s!=null&&s.once?(...u)=>{e.current.delete(l),l(...u)}:l;e.current.set(l,{type:i,eventTarget:o,fn:a,options:s}),o.addEventListener(i,a,s)},[]),n=ie((o,i,l,s)=>{var a;let u=((a=e.current.get(l))===null||a===void 0?void 0:a.fn)||l;o.removeEventListener(i,u,s),e.current.delete(l)},[]),r=ie(()=>{e.current.forEach((o,i)=>{n(o.eventTarget,o.type,i,o.options)})},[n]);return oe(()=>r,[r]),{addGlobalListener:t,removeGlobalListener:n,removeAllGlobalListeners:r}}function Ru(e){return e.mozInputSource===0&&e.isTrusted?!0:Eu()&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function Gl(e){let t=e;return t.nativeEvent=e,t.isDefaultPrevented=()=>t.defaultPrevented,t.isPropagationStopped=()=>t.cancelBubble,t.persist=()=>{},t}function $u(e,t){Object.defineProperty(e,"target",{value:t}),Object.defineProperty(e,"currentTarget",{value:t})}function ql(e){let t=D({isFocused:!1,observer:null});zl(()=>{const r=t.current;return()=>{r.observer&&(r.observer.disconnect(),r.observer=null)}},[]);let n=wu(r=>{e==null||e(r)});return ie(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=l=>{if(t.current.isFocused=!1,o.disabled){let s=Gl(l);n(s)}t.current.observer&&(t.current.observer.disconnect(),t.current.observer=null)};o.addEventListener("focusout",i,{once:!0}),t.current.observer=new MutationObserver(()=>{if(t.current.isFocused&&o.disabled){var l;(l=t.current.observer)===null||l===void 0||l.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])}let Tu=!1,yn=null,Br=new Set,sn=new Map,Et=!1,jr=!1;const Iu={Tab:!0,Escape:!0};function To(e,t){for(let n of Br)n(e,t)}function Mu(e){return!(e.metaKey||!Su()&&e.altKey||e.ctrlKey||e.key==="Control"||e.key==="Shift"||e.key==="Meta")}function zn(e){Et=!0,Mu(e)&&(yn="keyboard",To("keyboard",e))}function Lt(e){yn="pointer",(e.type==="mousedown"||e.type==="pointerdown")&&(Et=!0,To("pointer",e))}function Kl(e){Ru(e)&&(Et=!0,yn="virtual")}function Yl(e){e.target===window||e.target===document||Tu||!e.isTrusted||(!Et&&!jr&&(yn="virtual",To("virtual",e)),Et=!1,jr=!1)}function Xl(){Et=!1,jr=!0}function Ur(e){if(typeof window>"u"||sn.get(xt(e)))return;const t=xt(e),n=vt(e);let r=t.HTMLElement.prototype.focus;t.HTMLElement.prototype.focus=function(){Et=!0,r.apply(this,arguments)},n.addEventListener("keydown",zn,!0),n.addEventListener("keyup",zn,!0),n.addEventListener("click",Kl,!0),t.addEventListener("focus",Yl,!0),t.addEventListener("blur",Xl,!1),typeof PointerEvent<"u"&&(n.addEventListener("pointerdown",Lt,!0),n.addEventListener("pointermove",Lt,!0),n.addEventListener("pointerup",Lt,!0)),t.addEventListener("beforeunload",()=>{Zl(e)},{once:!0}),sn.set(t,{focus:r})}const Zl=(e,t)=>{const n=xt(e),r=vt(e);t&&r.removeEventListener("DOMContentLoaded",t),sn.has(n)&&(n.HTMLElement.prototype.focus=sn.get(n).focus,r.removeEventListener("keydown",zn,!0),r.removeEventListener("keyup",zn,!0),r.removeEventListener("click",Kl,!0),n.removeEventListener("focus",Yl,!0),n.removeEventListener("blur",Xl,!1),typeof PointerEvent<"u"&&(r.removeEventListener("pointerdown",Lt,!0),r.removeEventListener("pointermove",Lt,!0),r.removeEventListener("pointerup",Lt,!0)),sn.delete(n))};function Ou(e){const t=vt(e);let n;return t.readyState!=="loading"?Ur(e):(n=()=>{Ur(e)},t.addEventListener("DOMContentLoaded",n)),()=>Zl(e,n)}typeof document<"u"&&Ou();function Jl(){return yn!=="pointer"}const Fu=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);function Pu(e,t,n){let r=vt(n==null?void 0:n.target);const o=typeof window<"u"?xt(n==null?void 0:n.target).HTMLInputElement:HTMLInputElement,i=typeof window<"u"?xt(n==null?void 0:n.target).HTMLTextAreaElement:HTMLTextAreaElement,l=typeof window<"u"?xt(n==null?void 0:n.target).HTMLElement:HTMLElement,s=typeof window<"u"?xt(n==null?void 0:n.target).KeyboardEvent:KeyboardEvent;return e=e||r.activeElement instanceof o&&!Fu.has(r.activeElement.type)||r.activeElement instanceof i||r.activeElement instanceof l&&r.activeElement.isContentEditable,!(e&&t==="keyboard"&&n instanceof s&&!Iu[n.key])}function Nu(e,t,n){Ur(),oe(()=>{let r=(o,i)=>{Pu(!!(n!=null&&n.isTextInput),o,i)&&e(Jl())};return Br.add(r),()=>{Br.delete(r)}},t)}function ku(e){let{isDisabled:t,onFocus:n,onBlur:r,onFocusChange:o}=e;const i=ie(a=>{if(a.target===a.currentTarget)return r&&r(a),o&&o(!1),!0},[r,o]),l=ql(i),s=ie(a=>{const u=vt(a.target),c=u?zr(u):zr();a.target===a.currentTarget&&c===jl(a.nativeEvent)&&(n&&n(a),o&&o(!0),l(a))},[o,n,l]);return{focusProps:{onFocus:!t&&(n||o||r)?s:void 0,onBlur:!t&&(r||o)?i:void 0}}}function Au(e){let{isDisabled:t,onBlurWithin:n,onFocusWithin:r,onFocusWithinChange:o}=e,i=D({isFocusWithin:!1}),{addGlobalListener:l,removeAllGlobalListeners:s}=Wl(),a=ie(d=>{d.currentTarget.contains(d.target)&&i.current.isFocusWithin&&!d.currentTarget.contains(d.relatedTarget)&&(i.current.isFocusWithin=!1,s(),n&&n(d),o&&o(!1))},[n,o,i,s]),u=ql(a),c=ie(d=>{if(!d.currentTarget.contains(d.target))return;const p=vt(d.target),f=zr(p);if(!i.current.isFocusWithin&&f===jl(d.nativeEvent)){r&&r(d),o&&o(!0),i.current.isFocusWithin=!0,u(d);let m=d.currentTarget;l(p,"focus",h=>{if(i.current.isFocusWithin&&!Bl(m,h.target)){let v=new p.defaultView.FocusEvent("blur",{relatedTarget:h.target});$u(v,m);let w=Gl(v);a(w)}},{capture:!0})}},[r,o,u,l,a]);return t?{focusWithinProps:{onFocus:void 0,onBlur:void 0}}:{focusWithinProps:{onFocus:c,onBlur:a}}}let Wr=!1,vr=0;function Du(){Wr=!0,setTimeout(()=>{Wr=!1},50)}function _i(e){e.pointerType==="touch"&&Du()}function Lu(){if(!(typeof document>"u"))return typeof PointerEvent<"u"&&document.addEventListener("pointerup",_i),vr++,()=>{vr--,!(vr>0)&&typeof PointerEvent<"u"&&document.removeEventListener("pointerup",_i)}}function Ql(e){let{onHoverStart:t,onHoverChange:n,onHoverEnd:r,isDisabled:o}=e,[i,l]=U(!1),s=D({isHovered:!1,ignoreEmulatedMouseEvents:!1,pointerType:"",target:null}).current;oe(Lu,[]);let{addGlobalListener:a,removeAllGlobalListeners:u}=Wl(),{hoverProps:c,triggerHoverEnd:d}=W(()=>{let p=(h,v)=>{if(s.pointerType=v,o||v==="touch"||s.isHovered||!h.currentTarget.contains(h.target))return;s.isHovered=!0;let w=h.currentTarget;s.target=w,a(vt(h.target),"pointerover",b=>{s.isHovered&&s.target&&!Bl(s.target,b.target)&&f(b,b.pointerType)},{capture:!0}),t&&t({type:"hoverstart",target:w,pointerType:v}),n&&n(!0),l(!0)},f=(h,v)=>{let w=s.target;s.pointerType="",s.target=null,!(v==="touch"||!s.isHovered||!w)&&(s.isHovered=!1,u(),r&&r({type:"hoverend",target:w,pointerType:v}),n&&n(!1),l(!1))},m={};return typeof PointerEvent<"u"&&(m.onPointerEnter=h=>{Wr&&h.pointerType==="mouse"||p(h,h.pointerType)},m.onPointerLeave=h=>{!o&&h.currentTarget.contains(h.target)&&f(h,h.pointerType)}),{hoverProps:m,triggerHoverEnd:f}},[t,n,r,o,s,a,u]);return oe(()=>{o&&d({currentTarget:s.target},s.pointerType)},[o]),{hoverProps:c,isHovered:i}}function es(e={}){let{autoFocus:t=!1,isTextInput:n,within:r}=e,o=D({isFocused:!1,isFocusVisible:t||Jl()}),[i,l]=U(!1),[s,a]=U(()=>o.current.isFocused&&o.current.isFocusVisible),u=ie(()=>a(o.current.isFocused&&o.current.isFocusVisible),[]),c=ie(f=>{o.current.isFocused=f,l(f),u()},[u]);Nu(f=>{o.current.isFocusVisible=f,u()},[],{isTextInput:n});let{focusProps:d}=ku({isDisabled:r,onFocusChange:c}),{focusWithinProps:p}=Au({isDisabled:!r,onFocusWithinChange:c});return{isFocused:i,isFocusVisible:s,focusProps:r?p:d}}var Vu=Object.defineProperty,Hu=(e,t,n)=>t in e?Vu(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,_r=(e,t,n)=>(Hu(e,typeof t!="symbol"?t+"":t,n),n);let zu=class{constructor(){_r(this,"current",this.detect()),_r(this,"handoffState","pending"),_r(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"}},St=new zu;function qt(e){return St.isServer?null:e instanceof Node?e.ownerDocument:e!=null&&e.hasOwnProperty("current")&&e.current instanceof Node?e.current.ownerDocument:document}function Zn(e){typeof queueMicrotask=="function"?queueMicrotask(e):Promise.resolve().then(e).catch(t=>setTimeout(()=>{throw t}))}function Ye(){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 Zn(()=>{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=Ye();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 Mt(){let[e]=U(Ye);return oe(()=>()=>e.dispose(),[e]),e}let ce=(e,t)=>{St.isServer?oe(e,t):Ze(e,t)};function _t(e){let t=D(e);return ce(()=>{t.current=e},[e]),t}let j=function(e){let t=_t(e);return L.useCallback((...n)=>t.current(...n),[t])};function Bu(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 ju(e,t){return!(!e||!t||e.right<t.left||e.left>t.right||e.bottom<t.top||e.top>t.bottom)}function Uu({disabled:e=!1}={}){let t=D(null),[n,r]=U(!1),o=Mt(),i=j(()=>{t.current=null,r(!1),o.dispose()}),l=j(s=>{if(o.dispose(),t.current===null){t.current=s.currentTarget,r(!0);{let a=qt(s.currentTarget);o.addEventListener(a,"pointerup",i,!1),o.addEventListener(a,"pointermove",u=>{if(t.current){let c=Bu(u);r(ju(c,t.current.getBoundingClientRect()))}},!1),o.addEventListener(a,"pointercancel",i,!1)}}});return{pressed:n,pressProps:e?{}:{onPointerDown:l,onPointerUp:i,onClick:i}}}let Wu=pe(void 0);function Io(){return ae(Wu)}function Gr(...e){return Array.from(new Set(e.flatMap(t=>typeof t=="string"?t.split(" "):[]))).filter(Boolean).join(" ")}function ke(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,ke),r}var jt=(e=>(e[e.None=0]="None",e[e.RenderStrategy=1]="RenderStrategy",e[e.Static=2]="Static",e))(jt||{}),dt=(e=>(e[e.Unmount=0]="Unmount",e[e.Hidden=1]="Hidden",e))(dt||{});function Se(){let e=qu();return ie(t=>Gu({mergeRefs:e,...t}),[e])}function Gu({ourProps:e,theirProps:t,slot:n,defaultTag:r,features:o,visible:i=!0,name:l,mergeRefs:s}){s=s??Ku;let a=ts(t,e);if(i)return Mn(a,n,r,l,s);let u=o??0;if(u&2){let{static:c=!1,...d}=a;if(c)return Mn(d,n,r,l,s)}if(u&1){let{unmount:c=!0,...d}=a;return ke(c?0:1,{0(){return null},1(){return Mn({...d,hidden:!0,style:{display:"none"}},n,r,l,s)}})}return Mn(a,n,r,l,s)}function Mn(e,t={},n,r,o){let{as:i=n,children:l,refName:s="ref",...a}=wr(e,["unmount","static"]),u=e.ref!==void 0?{[s]:e.ref}:{},c=typeof l=="function"?l(t):l;"className"in a&&a.className&&typeof a.className=="function"&&(a.className=a.className(t)),a["aria-labelledby"]&&a["aria-labelledby"]===a.id&&(a["aria-labelledby"]=void 0);let d={};if(t){let p=!1,f=[];for(let[m,h]of Object.entries(t))typeof h=="boolean"&&(p=!0),h===!0&&f.push(m.replace(/([A-Z])/g,v=>`-${v.toLowerCase()}`));if(p){d["data-headlessui-state"]=f.join(" ");for(let m of f)d[`data-${m}`]=""}}if(i===me&&(Object.keys(ct(a)).length>0||Object.keys(ct(d)).length>0))if(!Gt(c)||Array.isArray(c)&&c.length>1){if(Object.keys(ct(a)).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(ct(a)).concat(Object.keys(ct(d))).map(p=>` - ${p}`).join(`
`),"","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(`
`)].join(`
`))}else{let p=c.props,f=p==null?void 0:p.className,m=typeof f=="function"?(...w)=>Gr(f(...w),a.className):Gr(f,a.className),h=m?{className:m}:{},v=ts(c.props,ct(wr(a,["ref"])));for(let w in d)w in v&&delete d[w];return Ro(c,Object.assign({},v,d,u,{ref:o(Yu(c),u.ref)},h))}return P(i,Object.assign({},wr(a,["ref"]),i!==me&&u,i!==me&&d),c)}function qu(){let e=D([]),t=ie(n=>{for(let r of e.current)r!=null&&(typeof r=="function"?r(n):r.current=n)},[]);return(...n)=>{if(!n.every(r=>r==null))return e.current=n,t}}function Ku(...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 ts(...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 l=n[r];for(let s of l){if((o instanceof Event||(o==null?void 0:o.nativeEvent)instanceof Event)&&o.defaultPrevented)return;s(o,...i)}}});return t}function Mo(...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 l of i)l==null||l(...o)}});return t}function xe(e){var t;return Object.assign(de(e),{displayName:(t=e.displayName)!=null?t:e.name})}function ct(e){let t=Object.assign({},e);for(let n in t)t[n]===void 0&&delete t[n];return t}function wr(e,t=[]){let n=Object.assign({},e);for(let r of t)r in n&&delete n[r];return n}function Yu(e){return L.version.split(".")[0]>="19"?e.props.ref:e.ref}function Xu(e,t,n){let[r,o]=U(n),i=e!==void 0,l=D(i),s=D(!1),a=D(!1);return i&&!l.current&&!s.current?(s.current=!0,l.current=i,console.error("A component is changing from uncontrolled to controlled. This may be caused by the value changing from undefined to a defined value, which should not happen.")):!i&&l.current&&!a.current&&(a.current=!0,l.current=i,console.error("A component is changing from controlled to uncontrolled. This may be caused by the value changing from a defined value to undefined, which should not happen.")),[i?e:r,j(u=>(i||o(u),t==null?void 0:t(u)))]}function Zu(e){let[t]=U(e);return t}function ns(e={},t=null,n=[]){for(let[r,o]of Object.entries(e))os(n,rs(t,r),o);return n}function rs(e,t){return e?e+"["+t+"]":t}function os(e,t,n){if(Array.isArray(n))for(let[r,o]of n.entries())os(e,rs(t,r.toString()),o);else n instanceof Date?e.push([t,n.toISOString()]):typeof n=="boolean"?e.push([t,n?"1":"0"]):typeof n=="string"?e.push([t,n]):typeof n=="number"?e.push([t,`${n}`]):n==null?e.push([t,""]):ns(n,t,e)}let Ju="span";var Ut=(e=>(e[e.None=1]="None",e[e.Focusable=2]="Focusable",e[e.Hidden=4]="Hidden",e))(Ut||{});function Qu(e,t){var n;let{features:r=1,...o}=e,i={ref:t,"aria-hidden":(r&2)===2?!0:(n=o["aria-hidden"])!=null?n:void 0,hidden:(r&4)===4?!0:void 0,style:{position:"fixed",top:1,left:1,width:1,height:0,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0",...(r&4)===4&&(r&2)!==2&&{display:"none"}}};return Se()({ourProps:i,theirProps:o,slot:{},defaultTag:Ju,name:"Hidden"})}let fn=xe(Qu),ec=pe(null);function tc({children:e}){let t=ae(ec);if(!t)return L.createElement(L.Fragment,null,e);let{target:n}=t;return n?wn(L.createElement(L.Fragment,null,e),n):null}function nc({data:e,form:t,disabled:n,onReset:r,overrides:o}){let[i,l]=U(null),s=Mt();return oe(()=>{if(r&&i)return s.addEventListener(i,"reset",r)},[i,t,r]),L.createElement(tc,null,L.createElement(rc,{setForm:l,formId:t}),ns(e).map(([a,u])=>L.createElement(fn,{features:Ut.Hidden,...ct({key:a,as:"input",type:"hidden",hidden:!0,readOnly:!0,form:t,disabled:n,name:a,value:u,...o})})))}function rc({setForm:e,formId:t}){return oe(()=>{if(t){let n=document.getElementById(t);n&&e(n)}},[e,t]),t?null:L.createElement(fn,{features:Ut.Hidden,as:"input",type:"hidden",hidden:!0,readOnly:!0,ref:n=>{if(!n)return;let r=n.closest("form");r&&e(r)}})}let oc=pe(void 0);function is(){return ae(oc)}function ic(e){let t=e.parentElement,n=null;for(;t&&!(t instanceof HTMLFieldSetElement);)t instanceof HTMLLegendElement&&(n=t),t=t.parentElement;let r=(t==null?void 0:t.getAttribute("disabled"))==="";return r&&lc(n)?!1:r}function lc(e){if(!e)return!1;let t=e.previousElementSibling;for(;t!==null;){if(t instanceof HTMLLegendElement)return!1;t=t.previousElementSibling}return!0}let ls=Symbol();function sc(e,t=!0){return Object.assign(e,{[ls]:t})}function Pe(...e){let t=D(e);oe(()=>{t.current=e},[e]);let n=j(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[ls]))?void 0:n}let Jn=pe(null);Jn.displayName="DescriptionContext";function ss(){let e=ae(Jn);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,ss),t}return e}function ac(){var e,t;return(t=(e=ae(Jn))==null?void 0:e.value)!=null?t:void 0}function uc(){let[e,t]=U([]);return[e.length>0?e.join(" "):void 0,W(()=>function(n){let r=j(i=>(t(l=>[...l,i]),()=>t(l=>{let s=l.slice(),a=s.indexOf(i);return a!==-1&&s.splice(a,1),s}))),o=W(()=>({register:r,slot:n.slot,name:n.name,props:n.