hello-csv
Version:
A modern CSV importer written in Preact
4 lines • 302 kB
JavaScript
(function(Pe,Ee){typeof exports=="object"&&typeof module<"u"?Ee(exports):typeof define=="function"&&define.amd?define(["exports"],Ee):(Pe=typeof globalThis<"u"?globalThis:Pe||self,Ee(Pe["hello-csv"]={}))})(this,function(Pe){"use strict";var xv=Object.defineProperty;var Sv=(Pe,Ee,Z)=>Ee in Pe?xv(Pe,Ee,{enumerable:!0,configurable:!0,writable:!0,value:Z}):Pe[Ee]=Z;var Re=(Pe,Ee,Z)=>Sv(Pe,typeof Ee!="symbol"?Ee+"":Ee,Z);var Ee,Z,ei,xt,ti,ni,gr,ri,hr,vr,_r,oi,en={},ii=[],Xa=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,On=Array.isArray;function nt(e,t){for(var n in t)e[n]=t[n];return e}function wr(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function F(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?Ee.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 tn(e,l,r,o,null)}function tn(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??++ei,__i:-1,__u:0};return o==null&&Z.vnode!=null&&Z.vnode(i),i}function Fn(){return{current:null}}function fe(e){return e.children}function Ue(e,t){this.props=e,this.context=t}function Nt(e,t){if(t==null)return e.__?Nt(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"?Nt(e):null}function li(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 li(e)}}function yr(e){(!e.__d&&(e.__d=!0)&&xt.push(e)&&!Pn.__r++||ti!==Z.debounceRendering)&&((ti=Z.debounceRendering)||ni)(Pn)}function Pn(){var e,t,n,r,o,i,l,s;for(xt.sort(gr);e=xt.shift();)e.__d&&(t=xt.length,r=void 0,i=(o=(n=e).__v).__e,l=[],s=[],n.__P&&((r=nt({},o)).__v=o.__v+1,Z.vnode&&Z.vnode(r),br(n.__P,r,o,n.__n,n.__P.namespaceURI,32&o.__u?[i]:null,l,i??Nt(o),!!(32&o.__u),s),r.__v=o.__v,r.__.__k[r.__i]=r,di(l,r,s),r.__e!=i&&li(r)),xt.length>t&&xt.sort(gr));Pn.__r=0}function si(e,t,n,r,o,i,l,s,a,u,c){var d,g,f,m,h,v,y=r&&r.__k||ii,x=t.length;for(a=Za(n,t,y,a,x),d=0;d<x;d++)(f=n.__k[d])!=null&&(g=f.__i===-1?en:y[f.__i]||en,f.__i=d,v=br(e,f,g,o,i,l,s,a,u,c),m=f.__e,f.ref&&g.ref!=f.ref&&(g.ref&&xr(g.ref,null,f),c.push(f.ref,f.__c||m,f)),h==null&&m!=null&&(h=m),4&f.__u||g.__k===f.__k?a=ai(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 Za(e,t,n,r,o){var i,l,s,a,u,c=n.length,d=c,g=0;for(e.__k=new Array(o),i=0;i<o;i++)(l=t[i])!=null&&typeof l!="boolean"&&typeof l!="function"?(a=i+g,(l=e.__k[i]=typeof l=="string"||typeof l=="number"||typeof l=="bigint"||l.constructor==String?tn(null,l,null,null,null):On(l)?tn(fe,{children:l},null,null,null):l.constructor===void 0&&l.__b>0?tn(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=Ja(l,n,a,d))!==-1&&(d--,(s=n[u])&&(s.__u|=2)),s==null||s.__v===null?(u==-1&&g--,typeof l.type!="function"&&(l.__u|=4)):u!=a&&(u==a-1?g--:u==a+1?g++:(u>a?g--:g++,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=Nt(s)),fi(s,s));return r}function ai(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=ai(r[o],t,n));return t}e.__e!=t&&(t&&e.type&&!n.contains(t)&&(t=Nt(e)),n.insertBefore(e.__e,t||null),t=e.__e);do t=t&&t.nextSibling;while(t!=null&&t.nodeType==8);return t}function rt(e,t){return t=t||[],e==null||typeof e=="boolean"||(On(e)?e.some(function(n){rt(n,t)}):t.push(e)),t}function Ja(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 ui(e,t,n){t[0]=="-"?e.setProperty(t,n??""):e[t]=n==null?"":typeof n!="number"||Xa.test(t)?n:n+"px"}function An(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||ui(e.style,t,"");if(n)for(t in n)r&&n[t]===r[t]||ui(e.style,t,n[t])}else if(t[0]=="o"&&t[1]=="n")i=t!=(t=t.replace(ri,"$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=hr,e.addEventListener(t,i?_r:vr,i)):e.removeEventListener(t,i?_r:vr,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 ci(e){return function(t){if(this.l){var n=this.l[t.type+e];if(t.t==null)t.t=hr++;else if(t.t<n.u)return;return n(Z.event?Z.event(t):t)}}}function br(e,t,n,r,o,i,l,s,a,u){var c,d,g,f,m,h,v,y,x,S,C,T,O,I,_,w,b,E=t.type;if(t.constructor!==void 0)return null;128&n.__u&&(a=!!(32&n.__u),i=[s=t.__e=n.__e]),(c=Z.__b)&&c(t);e:if(typeof E=="function")try{if(y=t.props,x="prototype"in E&&E.prototype.render,S=(c=E.contextType)&&r[c.__c],C=c?S?S.props.value:c.__:r,n.__c?v=(d=t.__c=n.__c).__=d.__E:(x?t.__c=d=new E(y,C):(t.__c=d=new Ue(y,C),d.constructor=E,d.render=eu),S&&S.sub(d),d.props=y,d.state||(d.state={}),d.context=C,d.__n=r,g=d.__d=!0,d.__h=[],d._sb=[]),x&&d.__s==null&&(d.__s=d.state),x&&E.getDerivedStateFromProps!=null&&(d.__s==d.state&&(d.__s=nt({},d.__s)),nt(d.__s,E.getDerivedStateFromProps(y,d.__s))),f=d.props,m=d.state,d.__v=t,g)x&&E.getDerivedStateFromProps==null&&d.componentWillMount!=null&&d.componentWillMount(),x&&d.componentDidMount!=null&&d.__h.push(d.componentDidMount);else{if(x&&E.getDerivedStateFromProps==null&&y!==f&&d.componentWillReceiveProps!=null&&d.componentWillReceiveProps(y,C),!d.__e&&(d.shouldComponentUpdate!=null&&d.shouldComponentUpdate(y,d.__s,C)===!1||t.__v==n.__v)){for(t.__v!=n.__v&&(d.props=y,d.state=d.__s,d.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.some(function(R){R&&(R.__=t)}),T=0;T<d._sb.length;T++)d.__h.push(d._sb[T]);d._sb=[],d.__h.length&&l.push(d);break e}d.componentWillUpdate!=null&&d.componentWillUpdate(y,d.__s,C),x&&d.componentDidUpdate!=null&&d.__h.push(function(){d.componentDidUpdate(f,m,h)})}if(d.context=C,d.props=y,d.__P=e,d.__e=!1,O=Z.__r,I=0,x){for(d.state=d.__s,d.__d=!1,O&&O(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,O&&O(t),c=d.render(d.props,d.state,d.context),d.state=d.__s;while(d.__d&&++I<25);d.state=d.__s,d.getChildContext!=null&&(r=nt(nt({},r),d.getChildContext())),x&&!g&&d.getSnapshotBeforeUpdate!=null&&(h=d.getSnapshotBeforeUpdate(f,m)),s=si(e,On(w=c!=null&&c.type===fe&&c.key==null?c.props.children:c)?w:[w],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(R){if(t.__v=null,a||i!=null)if(R.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(b=i.length;b--;)wr(i[b]);else t.__e=n.__e,t.__k=n.__k;Z.__e(R,t,n)}else i==null&&t.__v==n.__v?(t.__k=n.__k,t.__e=n.__e):s=t.__e=Qa(n.__e,t,n,r,o,i,l,a,u);return(c=Z.diffed)&&c(t),128&t.__u?void 0:s}function di(e,t,n){for(var r=0;r<n.length;r++)xr(n[r],n[++r],n[++r]);Z.__c&&Z.__c(t,e),e.some(function(o){try{e=o.__h,o.__h=[],e.some(function(i){i.call(o)})}catch(i){Z.__e(i,o.__v)}})}function Qa(e,t,n,r,o,i,l,s,a){var u,c,d,g,f,m,h,v=n.props,y=t.props,x=t.type;if(x=="svg"?o="http://www.w3.org/2000/svg":x=="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==!!x&&(x?f.localName==x:f.nodeType==3)){e=f,i[u]=null;break}}if(e==null){if(x==null)return document.createTextNode(y);e=document.createElementNS(o,x,y.is&&y),s&&(Z.__m&&Z.__m(t,i),s=!1),i=null}if(x===null)v===y||s&&e.data===y||(e.data=y);else{if(i=i&&Ee.call(e.childNodes),v=n.props||en,!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 y)){if(u=="value"&&"defaultValue"in y||u=="checked"&&"defaultChecked"in y)continue;An(e,u,null,f,o)}}for(u in y)f=y[u],u=="children"?g=f:u=="dangerouslySetInnerHTML"?c=f:u=="value"?m=f:u=="checked"?h=f:s&&typeof f!="function"||v[u]===f||An(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=""),si(e,On(g)?g:[g],t,n,r,x=="foreignObject"?"http://www.w3.org/1999/xhtml":o,i,l,i?i[0]:n.__k&&Nt(n,0),s,a),i!=null)for(u=i.length;u--;)wr(i[u]);s||(u="value",x=="progress"&&m==null?e.removeAttribute("value"):m!==void 0&&(m!==e[u]||x=="progress"&&!m||x=="option"&&m!==v[u])&&An(e,u,m,v[u],o),u="checked",h!==void 0&&h!==e[u]&&An(e,u,h,v[u],o))}return e}function xr(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){Z.__e(o,n)}}function fi(e,t,n){var r,o;if(Z.unmount&&Z.unmount(e),(r=e.ref)&&(r.current&&r.current!==e.__e||xr(r,null,t)),(r=e.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(i){Z.__e(i,t)}r.base=r.__P=null}if(r=e.__k)for(o=0;o<r.length;o++)r[o]&&fi(r[o],t,n||typeof e.type!="function");n||wr(e.__e),e.__c=e.__=e.__e=void 0}function eu(e,t,n){return this.constructor(e,n)}function nn(e,t,n){var r,o,i,l;t==document&&(t=document.documentElement),Z.__&&Z.__(e,t),o=(r=typeof n=="function")?null:n&&n.__k||t.__k,i=[],l=[],br(t,e=(!r&&n||t).__k=F(fe,null,[e]),o||en,en,t.namespaceURI,!r&&n?[n]:o?null:t.firstChild?Ee.call(t.childNodes):null,i,!r&&n?n:o?o.__e:t.firstChild,r,l),di(i,e,l)}function pi(e,t){nn(e,t,pi)}function tu(e,t,n){var r,o,i,l,s=nt({},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?Ee.call(arguments,2):n),tn(e.type,s,r||e.key,o||e.ref,null)}function pe(e,t){var n={__c:t="__cC"+oi++,__: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,yr(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}Ee=ii.slice,Z={__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}},ei=0,Ue.prototype.setState=function(e,t){var n;n=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=nt({},this.state),typeof e=="function"&&(e=e(nt({},n),this.props)),e&&nt(n,e),e!=null&&this.__v&&(t&&this._sb.push(t),yr(this))},Ue.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),yr(this))},Ue.prototype.render=fe,xt=[],ni=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,gr=function(e,t){return e.__v.__b-t.__v.__b},Pn.__r=0,ri=/(PointerCapture)$|Capture$/i,hr=0,vr=ci(!1),_r=ci(!0),oi=0;var ot,me,Sr,mi,kt=0,gi=[],ve=Z,hi=ve.__b,vi=ve.__r,_i=ve.diffed,wi=ve.__c,yi=ve.unmount,bi=ve.__;function St(e,t){ve.__h&&ve.__h(me,e,kt||t),kt=0;var n=me.__H||(me.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function B(e){return kt=1,it(Si,e)}function it(e,t,n){var r=St(ot++,2);if(r.t=e,!r.__c&&(r.__=[n?n(t):Si(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=me,!me.u)){var o=function(s,a,u){if(!r.__c.__H)return!0;var c=r.__c.__H.__.filter(function(g){return!!g.__c});if(c.every(function(g){return!g.__N}))return!i||i.call(this,s,a,u);var d=r.__c.props!==s;return c.forEach(function(g){if(g.__N){var f=g.__[0];g.__=g.__N,g.__N=void 0,f!==g.__[0]&&(d=!0)}}),i&&i.call(this,s,a,u)||d};me.u=!0;var i=me.shouldComponentUpdate,l=me.componentWillUpdate;me.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)},me.shouldComponentUpdate=o}return r.__N||r.__}function oe(e,t){var n=St(ot++,3);!ve.__s&&$r(n.__H,t)&&(n.__=e,n.i=t,me.__H.__h.push(n))}function qe(e,t){var n=St(ot++,4);!ve.__s&&$r(n.__H,t)&&(n.__=e,n.i=t,me.__h.push(n))}function k(e){return kt=5,W(function(){return{current:e}},[])}function Cr(e,t,n){kt=6,qe(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=St(ot++,7);return $r(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function ie(e,t){return kt=8,W(function(){return e},t)}function se(e){var t=me.context[e.__c],n=St(ot++,9);return n.c=e,t?(n.__==null&&(n.__=!0,t.sub(me)),t.props.value):e.__}function Er(e,t){ve.useDebugValue&&ve.useDebugValue(t?t(e):e)}function nu(e){var t=St(ot++,10),n=B();return t.__=e,me.componentDidCatch||(me.componentDidCatch=function(r,o){t.__&&t.__(r,o),n[1](r)}),[n[0],function(){n[1](void 0)}]}function $e(){var e=St(ot++,11);if(!e.__){for(var t=me.__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 ru(){for(var e;e=gi.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(Nn),e.__H.__h.forEach(Rr),e.__H.__h=[]}catch(t){e.__H.__h=[],ve.__e(t,e.__v)}}ve.__b=function(e){me=null,hi&&hi(e)},ve.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),bi&&bi(e,t)},ve.__r=function(e){vi&&vi(e),ot=0;var t=(me=e.__c).__H;t&&(Sr===me?(t.__h=[],me.__h=[],t.__.forEach(function(n){n.__N&&(n.__=n.__N),n.i=n.__N=void 0})):(t.__h.forEach(Nn),t.__h.forEach(Rr),t.__h=[],ot=0)),Sr=me},ve.diffed=function(e){_i&&_i(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(gi.push(t)!==1&&mi===ve.requestAnimationFrame||((mi=ve.requestAnimationFrame)||ou)(ru)),t.__H.__.forEach(function(n){n.i&&(n.__H=n.i),n.i=void 0})),Sr=me=null},ve.__c=function(e,t){t.some(function(n){try{n.__h.forEach(Nn),n.__h=n.__h.filter(function(r){return!r.__||Rr(r)})}catch(r){t.some(function(o){o.__h&&(o.__h=[])}),t=[],ve.__e(r,n.__v)}}),wi&&wi(e,t)},ve.unmount=function(e){yi&&yi(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach(function(r){try{Nn(r)}catch(o){t=o}}),n.__H=void 0,t&&ve.__e(t,n.__v))};var xi=typeof requestAnimationFrame=="function";function ou(e){var t,n=function(){clearTimeout(r),xi&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,100);xi&&(t=requestAnimationFrame(n))}function Nn(e){var t=me,n=e.__c;typeof n=="function"&&(e.__c=void 0,n()),me=t}function Rr(e){var t=me;e.__c=e.__(),me=t}function $r(e,t){return!e||e.length!==t.length||t.some(function(n,r){return n!==e[r]})}function Si(e,t){return typeof t=="function"?t(e):t}function Ci(e,t){for(var n in t)e[n]=t[n];return e}function Tr(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 kn(e,t){var n=t(),r=B({t:{__:n,u:t}}),o=r[0].t,i=r[1];return qe(function(){o.__=n,o.u=t,Ir(o)&&i({t:o})},[e,n,t]),oe(function(){return Ir(o)&&i({t:o}),e(function(){Ir(o)&&i({t:o})})},[e]),n}function Ir(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 Mr(e){e()}function Or(e){return e}function Fr(){return[!1,Mr]}var Pr=qe;function Dn(e,t){this.props=e,this.context=t}function Ei(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:Tr(this.props,o)}function r(o){return this.shouldComponentUpdate=n,F(e,o)}return r.displayName="Memo("+(e.displayName||e.name)+")",r.prototype.isReactComponent=!0,r.__f=!0,r}(Dn.prototype=new Ue).isPureReactComponent=!0,Dn.prototype.shouldComponentUpdate=function(e,t){return Tr(this.props,e)||Tr(this.state,t)};var Ri=Z.__b;Z.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),Ri&&Ri(e)};var iu=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.forward_ref")||3911;function de(e){function t(n){var r=Ci({},n);return delete r.ref,e(r,n.ref||null)}return t.$$typeof=iu,t.render=t,t.prototype.isReactComponent=t.__f=!0,t.displayName="ForwardRef("+(e.displayName||e.name)+")",t}var $i=function(e,t){return e==null?null:rt(rt(e).map(t))},Ti={map:$i,forEach:$i,count:function(e){return e?rt(e).length:0},only:function(e){var t=rt(e);if(t.length!==1)throw"Children.only";return t[0]},toArray:rt},lu=Z.__e;Z.__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)}lu(e,t,n,r)};var Ii=Z.unmount;function Mi(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=Ci({},e)).__c!=null&&(e.__c.__P===n&&(e.__c.__P=t),e.__c=null),e.__k=e.__k&&e.__k.map(function(r){return Mi(r,t,n)})),e}function Oi(e,t,n){return e&&n&&(e.__v=null,e.__k=e.__k&&e.__k.map(function(r){return Oi(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 rn(){this.__u=0,this.o=null,this.__b=null}function Fi(e){var t=e.__.__c;return t&&t.__a&&t.__a(e)}function Pi(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 F(n,i)}return o.displayName="Lazy",o.__f=!0,o}function Dt(){this.i=null,this.l=null}Z.unmount=function(e){var t=e.__c;t&&t.__R&&t.__R(),t&&32&e.__u&&(e.type=null),Ii&&Ii(e)},(rn.prototype=new Ue).__c=function(e,t){var n=t.__c,r=this;r.o==null&&(r.o=[]),r.o.push(n);var o=Fi(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]=Oi(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)},rn.prototype.componentWillUnmount=function(){this.o=[]},rn.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]=Mi(this.__b,n,r.__O=r.__P)}this.__b=null}var o=t.__a&&F(fe,null,e.fallback);return o&&(o.__u&=-33),[F(fe,null,t.__a?null:e.children),o]};var Ai=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 su(e){return this.getChildContext=function(){return e.context},e.children}function au(e){var t=this,n=e.h;t.componentWillUnmount=function(){nn(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)}}),nn(F(su,{context:t.context},e.__v),t.v)}function on(e,t){var n=F(au,{__v:e,h:t});return n.containerInfo=t,n}(Dt.prototype=new Ue).__a=function(e){var t=this,n=Fi(t.__v),r=t.l.get(e);return r[0]++,function(o){var i=function(){t.props.revealOrder?(r.push(o),Ai(t,e,r)):o()};n?n(i):i()}},Dt.prototype.render=function(e){this.i=null,this.l=new Map;var t=rt(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},Dt.prototype.componentDidUpdate=Dt.prototype.componentDidMount=function(){var e=this;this.l.forEach(function(t,n){Ai(e,n,t)})};var Ni=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.element")||60103,uu=/^(?: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]/,cu=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,du=/[A-Z0-9]/g,fu=typeof document<"u",pu=function(e){return(typeof Symbol<"u"&&typeof Symbol()=="symbol"?/fil|che|rad/:/fil|che|ra/).test(e)};function Ar(e,t,n){return t.__k==null&&(t.textContent=""),nn(e,t),typeof n=="function"&&n(),e?e.__c:null}function ki(e,t,n){return pi(e,t),typeof n=="function"&&n(),e?e.__c:null}Ue.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(e){Object.defineProperty(Ue.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})});var Di=Z.event;function mu(){}function gu(){return this.cancelBubble}function hu(){return this.defaultPrevented}Z.event=function(e){return Di&&(e=Di(e)),e.persist=mu,e.isPropagationStopped=gu,e.isDefaultPrevented=hu,e.nativeEvent=e};var Nr,vu={enumerable:!1,configurable:!0,get:function(){return this.class}},Li=Z.vnode;Z.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||fu&&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"||pu(n.type)?a==="onfocus"?l="onfocusin":a==="onblur"?l="onfocusout":cu.test(l)&&(l=a):a=l="oninput":i&&uu.test(l)?l=l.replace(du,"-$&").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=rt(n.children).forEach(function(u){u.props.selected=o.value.indexOf(u.props.value)!=-1})),r=="select"&&o.defaultValue!=null&&(o.value=rt(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",vu)):(n.className&&!n.class||n.class&&n.className)&&(o.class=o.className=n.className),t.props=o}(e),e.$$typeof=Ni,Li&&Li(e)};var Vi=Z.__r;Z.__r=function(e){Vi&&Vi(e),Nr=e.__c};var Hi=Z.diffed;Z.diffed=function(e){Hi&&Hi(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),Nr=null};var zi={ReactCurrentDispatcher:{current:{readContext:function(e){return Nr.__n[e.__c].props.value},useCallback:ie,useContext:se,useDebugValue:Er,useDeferredValue:Or,useEffect:oe,useId:$e,useImperativeHandle:Cr,useInsertionEffect:Pr,useLayoutEffect:qe,useMemo:W,useReducer:it,useRef:k,useState:B,useSyncExternalStore:kn,useTransition:Fr}}},_u="18.3.1";function Bi(e){return F.bind(null,e)}function Lt(e){return!!e&&e.$$typeof===Ni}function ji(e){return Lt(e)&&e.type===fe}function Ui(e){return!!e&&!!e.displayName&&(typeof e.displayName=="string"||e.displayName instanceof String)&&e.displayName.startsWith("Memo(")}function kr(e){return Lt(e)?tu.apply(null,arguments):e}function Dr(e){return!!e.__k&&(nn(null,e),!0)}function Wi(e){return e&&(e.base||e.nodeType===1&&e)||null}var Gi=function(e,t){return e(t)},Ve=function(e,t){return e(t)},qi=fe,Ki=Lt,D={useState:B,useId:$e,useReducer:it,useEffect:oe,useLayoutEffect:qe,useInsertionEffect:Pr,useTransition:Fr,useDeferredValue:Or,useSyncExternalStore:kn,startTransition:Mr,useRef:k,useImperativeHandle:Cr,useMemo:W,useCallback:ie,useContext:se,useDebugValue:Er,version:"18.3.1",Children:Ti,render:Ar,hydrate:ki,unmountComponentAtNode:Dr,createPortal:on,createElement:F,createContext:pe,createFactory:Bi,cloneElement:kr,createRef:Fn,Fragment:fe,isValidElement:Lt,isElement:Ki,isFragment:ji,isMemo:Ui,findDOMNode:Wi,Component:Ue,PureComponent:Dn,memo:Ei,forwardRef:de,flushSync:Ve,unstable_batchedUpdates:Gi,StrictMode:qi,Suspense:rn,SuspenseList:Dt,lazy:Pi,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:zi};const Lr=Object.freeze(Object.defineProperty({__proto__:null,Children:Ti,Component:Ue,Fragment:fe,PureComponent:Dn,StrictMode:qi,Suspense:rn,SuspenseList:Dt,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:zi,cloneElement:kr,createContext:pe,createElement:F,createFactory:Bi,createPortal:on,createRef:Fn,default:D,findDOMNode:Wi,flushSync:Ve,forwardRef:de,hydrate:ki,isElement:Ki,isFragment:ji,isMemo:Ui,isValidElement:Lt,lazy:Pi,memo:Ei,render:Ar,startTransition:Mr,unmountComponentAtNode:Dr,unstable_batchedUpdates:Gi,useCallback:ie,useContext:se,useDebugValue:Er,useDeferredValue:Or,useEffect:oe,useErrorBoundary:nu,useId:$e,useImperativeHandle:Cr,useInsertionEffect:Pr,useLayoutEffect:qe,useMemo:W,useReducer:it,useRef:k,useState:B,useSyncExternalStore:kn,useTransition:Fr,version:_u},Symbol.toStringTag,{value:"Module"}));function wu(e){return{render:function(t){Ar(t,e)},unmount:function(){Dr(e)}}}var yu=0;function p(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:--yu,__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 Z.vnode&&Z.vnode(u),u}function Yi(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=Yi(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function bu(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=Yi(e))&&(r&&(r+=" "),r+=t);return r}const Xi=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Zi=bu,Ct=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return Zi(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 g=Xi(c)||Xi(d);return o[u][g]}),s=n&&Object.entries(n).reduce((u,c)=>{let[d,g]=c;return g===void 0||(u[d]=g),u},{}),a=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((u,c)=>{let{class:d,className:g,...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,g]:u},[]);return Zi(e,l,a,n==null?void 0:n.class,n==null?void 0:n.className)},xu=Ct("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 Be({children:e,variant:t,disabled:n,onClick:r,withFullWidth:o}){const i=xu({variant:t,disabled:n,withFullWidth:o});return p("div",{role:"button",tabIndex:0,className:i,onClick:r,"aria-disabled":n,children:e})}const Su=Ct("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}}),Ji=de(({children:e,className:t,variant:n,withPadding:r=!0},o)=>{const i=Su({variant:n,withPadding:r});return p("div",{ref:o,className:`${i} ${t}`,children:e})});function Qi({checked:e,setChecked:t,label:n}){const r=$e();return p("div",{className:"flex gap-3",children:[p("div",{className:"flex h-6 shrink-0 items-center",children:p("div",{className:"group grid size-4 grid-cols-1",children:[p("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"}),p("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:[p("path",{d:"M3 8L6 11L11 3.5",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",className:"opacity-0 group-has-checked:opacity-100"}),p("path",{d:"M3 7H11",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",className:"opacity-0 group-has-indeterminate:opacity-100"})]})]})}),n&&p("div",{className:"text-sm/6",children:p("label",{htmlFor:r,className:"font-medium text-gray-900",children:n})})]})}let Cu=!1;function Vr(){return Cu}const el=typeof document<"u"?D.useLayoutEffect:()=>{};function Eu(e){const t=k(null);return el(()=>{t.current=e},[e]),ie((...n)=>{const r=t.current;return r==null?void 0:r(...n)},[])}const dt=e=>{var t;return(t=e==null?void 0:e.ownerDocument)!==null&&t!==void 0?t:document},Et=e=>e&&"window"in e&&e.window===e?e:dt(e).defaultView||window;function Ru(e){return e!==null&&typeof e=="object"&&"nodeType"in e&&typeof e.nodeType=="number"}function $u(e){return Ru(e)&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&"host"in e}function tl(e,t){if(!Vr())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:$u(n)?n=n.host:n=n.parentNode}return!1}const Hr=(e=document)=>{var t;if(!Vr())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 nl(e){return Vr()&&e.target.shadowRoot&&e.composedPath?e.composedPath()[0]:e.target}function Tu(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 Iu(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 rl(e){let t=null;return()=>(t==null&&(t=e()),t)}const Mu=rl(function(){return Iu(/^Mac/i)}),Ou=rl(function(){return Tu(/Android/i)});function ol(){let e=k(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 Fu(e){return e.mozInputSource===0&&e.isTrusted?!0:Ou()&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function il(e){let t=e;return t.nativeEvent=e,t.isDefaultPrevented=()=>t.defaultPrevented,t.isPropagationStopped=()=>t.cancelBubble,t.persist=()=>{},t}function Pu(e,t){Object.defineProperty(e,"target",{value:t}),Object.defineProperty(e,"currentTarget",{value:t})}function ll(e){let t=k({isFocused:!1,observer:null});el(()=>{const r=t.current;return()=>{r.observer&&(r.observer.disconnect(),r.observer=null)}},[]);let n=Eu(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=il(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 Au=!1,ln=null,zr=new Set,sn=new Map,Rt=!1,Br=!1;const Nu={Tab:!0,Escape:!0};function jr(e,t){for(let n of zr)n(e,t)}function ku(e){return!(e.metaKey||!Mu()&&e.altKey||e.ctrlKey||e.key==="Control"||e.key==="Shift"||e.key==="Meta")}function Ln(e){Rt=!0,ku(e)&&(ln="keyboard",jr("keyboard",e))}function Vt(e){ln="pointer",(e.type==="mousedown"||e.type==="pointerdown")&&(Rt=!0,jr("pointer",e))}function sl(e){Fu(e)&&(Rt=!0,ln="virtual")}function al(e){e.target===window||e.target===document||Au||!e.isTrusted||(!Rt&&!Br&&(ln="virtual",jr("virtual",e)),Rt=!1,Br=!1)}function ul(){Rt=!1,Br=!0}function Ur(e){if(typeof window>"u"||sn.get(Et(e)))return;const t=Et(e),n=dt(e);let r=t.HTMLElement.prototype.focus;t.HTMLElement.prototype.focus=function(){Rt=!0,r.apply(this,arguments)},n.addEventListener("keydown",Ln,!0),n.addEventListener("keyup",Ln,!0),n.addEventListener("click",sl,!0),t.addEventListener("focus",al,!0),t.addEventListener("blur",ul,!1),typeof PointerEvent<"u"&&(n.addEventListener("pointerdown",Vt,!0),n.addEventListener("pointermove",Vt,!0),n.addEventListener("pointerup",Vt,!0)),t.addEventListener("beforeunload",()=>{cl(e)},{once:!0}),sn.set(t,{focus:r})}const cl=(e,t)=>{const n=Et(e),r=dt(e);t&&r.removeEventListener("DOMContentLoaded",t),sn.has(n)&&(n.HTMLElement.prototype.focus=sn.get(n).focus,r.removeEventListener("keydown",Ln,!0),r.removeEventListener("keyup",Ln,!0),r.removeEventListener("click",sl,!0),n.removeEventListener("focus",al,!0),n.removeEventListener("blur",ul,!1),typeof PointerEvent<"u"&&(r.removeEventListener("pointerdown",Vt,!0),r.removeEventListener("pointermove",Vt,!0),r.removeEventListener("pointerup",Vt,!0)),sn.delete(n))};function Du(e){const t=dt(e);let n;return t.readyState!=="loading"?Ur(e):(n=()=>{Ur(e)},t.addEventListener("DOMContentLoaded",n)),()=>cl(e,n)}typeof document<"u"&&Du();function dl(){return ln!=="pointer"}const Lu=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);function Vu(e,t,n){let r=dt(n==null?void 0:n.target);const o=typeof window<"u"?Et(n==null?void 0:n.target).HTMLInputElement:HTMLInputElement,i=typeof window<"u"?Et(n==null?void 0:n.target).HTMLTextAreaElement:HTMLTextAreaElement,l=typeof window<"u"?Et(n==null?void 0:n.target).HTMLElement:HTMLElement,s=typeof window<"u"?Et(n==null?void 0:n.target).KeyboardEvent:KeyboardEvent;return e=e||r.activeElement instanceof o&&!Lu.has(r.activeElement.type)||r.activeElement instanceof i||r.activeElement instanceof l&&r.activeElement.isContentEditable,!(e&&t==="keyboard"&&n instanceof s&&!Nu[n.key])}function Hu(e,t,n){Ur(),oe(()=>{let r=(o,i)=>{Vu(!!(n!=null&&n.isTextInput),o,i)&&e(dl())};return zr.add(r),()=>{zr.delete(r)}},t)}function zu(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=ll(i),s=ie(a=>{const u=dt(a.target),c=u?Hr(u):Hr();a.target===a.currentTarget&&c===nl(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 Bu(e){let{isDisabled:t,onBlurWithin:n,onFocusWithin:r,onFocusWithinChange:o}=e,i=k({isFocusWithin:!1}),{addGlobalListener:l,removeAllGlobalListeners:s}=ol(),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=ll(a),c=ie(d=>{if(!d.currentTarget.contains(d.target))return;const g=dt(d.target),f=Hr(g);if(!i.current.isFocusWithin&&f===nl(d.nativeEvent)){r&&r(d),o&&o(!0),i.current.isFocusWithin=!0,u(d);let m=d.currentTarget;l(g,"focus",h=>{if(i.current.isFocusWithin&&!tl(m,h.target)){let v=new g.defaultView.FocusEvent("blur",{relatedTarget:h.target});Pu(v,m);let y=il(v);a(y)}},{capture:!0})}},[r,o,u,l,a]);return t?{focusWithinProps:{onFocus:void 0,onBlur:void 0}}:{focusWithinProps:{onFocus:c,onBlur:a}}}let Wr=!1,Gr=0;function ju(){Wr=!0,setTimeout(()=>{Wr=!1},50)}function fl(e){e.pointerType==="touch"&&ju()}function Uu(){if(!(typeof document>"u"))return typeof PointerEvent<"u"&&document.addEventListener("pointerup",fl),Gr++,()=>{Gr--,!(Gr>0)&&typeof PointerEvent<"u"&&document.removeEventListener("pointerup",fl)}}function pl(e){let{onHoverStart:t,onHoverChange:n,onHoverEnd:r,isDisabled:o}=e,[i,l]=B(!1),s=k({isHovered:!1,ignoreEmulatedMouseEvents:!1,pointerType:"",target:null}).current;oe(Uu,[]);let{addGlobalListener:a,removeAllGlobalListeners:u}=ol(),{hoverProps:c,triggerHoverEnd:d}=W(()=>{let g=(h,v)=>{if(s.pointerType=v,o||v==="touch"||s.isHovered||!h.currentTarget.contains(h.target))return;s.isHovered=!0;let y=h.currentTarget;s.target=y,a(dt(h.target),"pointerover",x=>{s.isHovered&&s.target&&!tl(s.target,x.target)&&f(x,x.pointerType)},{capture:!0}),t&&t({type:"hoverstart",target:y,pointerType:v}),n&&n(!0),l(!0)},f=(h,v)=>{let y=s.target;s.pointerType="",s.target=null,!(v==="touch"||!s.isHovered||!y)&&(s.isHovered=!1,u(),r&&r({type:"hoverend",target:y,pointerType:v}),n&&n(!1),l(!1))},m={};return typeof PointerEvent<"u"&&(m.onPointerEnter=h=>{Wr&&h.pointerType==="mouse"||g(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 ml(e={}){let{autoFocus:t=!1,isTextInput:n,within:r}=e,o=k({isFocused:!1,isFocusVisible:t||dl()}),[i,l]=B(!1),[s,a]=B(()=>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]);Hu(f=>{o.current.isFocusVisible=f,u()},[],{isTextInput:n});let{focusProps:d}=zu({isDisabled:r,onFocusChange:c}),{focusWithinProps:g}=Bu({isDisabled:!r,onFocusWithinChange:c});return{isFocused:i,isFocusVisible:s,focusProps:r?g:d}}var Wu=Object.defineProperty,Gu=(e,t,n)=>t in e?Wu(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,qr=(e,t,n)=>(Gu(e,typeof t!="symbol"?t+"":t,n),n);let qu=class{constructor(){qr(this,"current",this.detect()),qr(this,"handoffState","pending"),qr(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"}},$t=new qu;function Ht(e){return $t.isServer?null:e instanceof Node?e.ownerDocument:e!=null&&e.hasOwnProperty("current")&&e.current instanceof Node?e.current.ownerDocument:document}function Vn(e){typeof queueMicrotask=="function"?queueMicrotask(e):Promise.resolve().then(e).catch(t=>setTimeout(()=>{throw t}))}function Ke(){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 Vn(()=>{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=Ke();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 Tt(){let[e]=B(Ke);return oe(()=>()=>e.dispose(),[e]),e}let ce=(e,t)=>{$t.isServer?oe(e,t):qe(e,t)};function ft(e){let t=k(e);return ce(()=>{t.current=e},[e]),t}let j=function(e){let t=ft(e);return D.useCallback((...n)=>t.current(...n),[t])};function Ku(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 Yu(e,t){return!(!e||!t||e.right<t.left||e.left>t.right||e.bottom<t.top||e.top>t.bottom)}function Xu({disabled:e=!1}={}){let t=k(null),[n,r]=B(!1),o=Tt(),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=Ht(s.currentTarget);o.addEventListener(a,"pointerup",i,!1),o.addEventListener(a,"pointermove",u=>{if(t.current){let c=Ku(u);r(Yu(c,t.current.getBoundingClientRect()))}},!1),o.addEventListener(a,"pointercancel",i,!1)}}});return{pressed:n,pressProps:e?{}:{onPointerDown:l,onPointerUp:i,onClick:i}}}let Zu=pe(void 0);function Kr(){return se(Zu)}function Yr(...e){return Array.from(new Set(e.flatMap(t=>typeof t=="string"?t.split(" "):[]))).filter(Boolean).join(" ")}function De(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,De),r}var zt=(e=>(e[e.None=0]="None",e[e.RenderStrategy=1]="RenderStrategy",e[e.Static=2]="Static",e))(zt||{}),pt=(e=>(e[e.Unmount=0]="Unmount",e[e.Hidden=1]="Hidden",e))(pt||{});function Se(){let e=Qu();return ie(t=>Ju({mergeRefs:e,...t}),[e])}function Ju({ourProps:e,theirProps:t,slot:n,defaultTag:r,features:o,visible:i=!0,name:l,mergeRefs:s}){s=s??ec;let a=gl(t,e);if(i)return Hn(a,n,r,l,s);let u=o??0;if(u&2){let{static:c=!1,...d}=a;if(c)return Hn(d,n,r,l,s)}if(u&1){let{unmount:c=!0,...d}=a;return De(c?0:1,{0(){return null},1(){return Hn({...d,hidden:!0,style:{display:"none"}},n,r,l,s)}})}return Hn(a,n,r,l,s)}function Hn(e,t={},n,r,o){let{as:i=n,children:l,refName:s="ref",...a}=Zr(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 g=!1,f=[];for(let[m,h]of Object.entries(t))typeof h=="boolean"&&(g=!0),h===!0&&f.push(m.replace(/([A-Z])/g,v=>`-${v.toLowerCase()}`));if(g){d["data-headlessui-state"]=f.join(" ");for(let m of f)d[`data-${m}`]=""}}if(i===fe&&(Object.keys(mt(a)).length>0||Object.keys(mt(d)).length>0))if(!Lt(c)||Array.isArray(c)&&c.length>1){if(Object.keys(mt(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(mt(a)).concat(Object.keys(mt(d))).map(g=>` - ${g}`).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(g=>` - ${g}`).join(`
`)].join(`
`))}else{let g=c.props,f=g==null?void 0:g.className,m=typeof f=="function"?(...y)=>Yr(f(...y),a.className):Yr(f,a.className),h=m?{className:m}:{},v=gl(c.props,mt(Zr(a,["ref"])));for(let y in d)y in v&&delete d[y];return kr(c,Object.assign({},v,d,u,{ref:o(tc(c),u.ref)},h))}return F(i,Object.assign({},Zr(a,["ref"]),i!==fe&&u,i!==fe&&d),c)}function Qu(){let e=k([]),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 ec(...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 gl(...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 Xr(...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 be(e){var t;return Object.assign(de(e),{displayName:(t=e.displayName)!=null?t:e.name})}function mt(e){let t=Object.assign({},e);for(let n in t)t[n]===void 0&&delete t[n];return t}function Zr(e,t=[]){let n=Object.assign({},e);for(let r of t)r in n&&delete n[r];return n}function tc(e){return D.version.split(".")[0]>="19"?e.props.ref:e.ref}function nc(e,t,n){let[r,o]=B(n),i=e!==void 0,l=k(i),s=k(!1),a=k(!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 rc(e){let[t]=B(e);return t}function hl(e={},t=null,n=[]){for(let[r,o]of Object.entries(e))_l(n,vl(t,r),o);return n}function vl(e,t){return e?e+"["+t+"]":t}function _l(e,t,n){if(Array.isArray(n))for(let[r,o]of n.entries())_l(e,vl(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,""]):hl(n,t,e)}let oc="span";var Bt=(e=>(e[e.None=1]="None",e[e.Focusable=2]="Focusable",e[e.Hidden=4]="Hidden",e))(Bt||{});function ic(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:oc,name:"Hidden"})}let an=be(ic),lc=pe(null);function sc({children:e}){let t=se(lc);if(!t)return D.createElement(D.Fragment,null,e);let{target:n}=t;return n?on(D.createElement(D.Fragment,null,e),n):null}function ac({data:e,form:t,disabled:n,onReset:r,overrides:o}){let[i,l]=B(null),s=Tt();return oe(()=>{if(r&&i)return s.addEventListener(i,"reset",r)},[i,t,r]),D.createElement(sc,null,D.createElement(uc,{setForm:l,formId:t}),hl(e).map(([a,u])=>D.createElement(an,{features:Bt.Hidden,...mt({key:a,as:"input",type:"hidden",hidden:!0,readOnly:!0,form:t,disabled:n,name:a,value:u,...o})})))}function uc({setForm:e,formId:t}){return oe(()=>{if(t){let n=document.getElementById(t);n&&e(n)}},[e,t]),t?null:D.createElement(an,{features:Bt.Hidden,as:"input",type:"hidden",hidden:!0,readOnly:!0,ref:n=>{if(!n)return;let r=n.closest("form");r&&e(r)}})}let cc=pe(void 0);function wl(){return se(cc)}function dc(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&&fc(n)?!1:r}function fc(e){if(!e)return!1;let t=e.previousElementSibling;for(;t!==null;){if(t instanceof HTMLLegendElement)return!1;t=t.previousElementSibling}return!0}let yl=Symbol();function pc(e,t=!0){return Object.assign(e,{[yl]:t})}function Ae(...e){let t=k(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[yl]))?void 0:n}let zn=pe(null);zn.displayName="DescriptionContext";function bl(){let e=se(zn);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,bl),t}return e}function mc(){var e,t;return(t=(e=se(zn))==null?void 0:e.value)!=null?t:void 0}function gc(){let[e,t]=B([]);return[e.length>0?e.join("