UNPKG

hello-csv

Version:

A modern CSV importer written in Preact

7 lines 293 kB
(function(Ce,x){typeof exports=="object"&&typeof module<"u"?x(exports,require("preact")):typeof define=="function"&&define.amd?define(["exports","preact"],x):(Ce=typeof globalThis<"u"?globalThis:Ce||self,x(Ce["hello-csv"]={},Ce.Preact))})(this,function(Ce,x){"use strict";var Mh=Object.defineProperty;var Ph=(Ce,x,Pe)=>x in Ce?Mh(Ce,x,{enumerable:!0,configurable:!0,writable:!0,value:Pe}):Ce[x]=Pe;var _e=(Ce,x,Pe)=>Ph(Ce,typeof x!="symbol"?x+"":x,Pe);var Pe,de,Qn,Fo,$t=0,Oo=[],me=x.options,Mo=me.__b,Po=me.__r,Ao=me.diffed,No=me.__c,ko=me.unmount,Do=me.__;function gt(e,t){me.__h&&me.__h(de,e,$t||t),$t=0;var n=de.__H||(de.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function B(e){return $t=1,Je(Vo,e)}function Je(e,t,n){var r=gt(Pe++,2);if(r.t=e,!r.__c&&(r.__=[n?n(t):Vo(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=de,!de.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 p=r.__c.props!==s;return c.forEach(function(g){if(g.__N){var d=g.__[0];g.__=g.__N,g.__N=void 0,d!==g.__[0]&&(p=!0)}}),i&&i.call(this,s,a,u)||p};de.u=!0;var i=de.shouldComponentUpdate,l=de.componentWillUpdate;de.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)},de.shouldComponentUpdate=o}return r.__N||r.__}function re(e,t){var n=gt(Pe++,3);!me.__s&&rr(n.__H,t)&&(n.__=e,n.i=t,de.__H.__h.push(n))}function je(e,t){var n=gt(Pe++,4);!me.__s&&rr(n.__H,t)&&(n.__=e,n.i=t,de.__h.push(n))}function k(e){return $t=5,W(function(){return{current:e}},[])}function er(e,t,n){$t=6,je(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=gt(Pe++,7);return rr(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function oe(e,t){return $t=8,W(function(){return e},t)}function le(e){var t=de.context[e.__c],n=gt(Pe++,9);return n.c=e,t?(n.__==null&&(n.__=!0,t.sub(de)),t.props.value):e.__}function tr(e,t){me.useDebugValue&&me.useDebugValue(t?t(e):e)}function fa(e){var t=gt(Pe++,10),n=B();return t.__=e,de.componentDidCatch||(de.componentDidCatch=function(r,o){t.__&&t.__(r,o),n[1](r)}),[n[0],function(){n[1](void 0)}]}function Se(){var e=gt(Pe++,11);if(!e.__){for(var t=de.__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 pa(){for(var e;e=Oo.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(bn),e.__H.__h.forEach(nr),e.__H.__h=[]}catch(t){e.__H.__h=[],me.__e(t,e.__v)}}me.__b=function(e){de=null,Mo&&Mo(e)},me.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),Do&&Do(e,t)},me.__r=function(e){Po&&Po(e),Pe=0;var t=(de=e.__c).__H;t&&(Qn===de?(t.__h=[],de.__h=[],t.__.forEach(function(n){n.__N&&(n.__=n.__N),n.i=n.__N=void 0})):(t.__h.forEach(bn),t.__h.forEach(nr),t.__h=[],Pe=0)),Qn=de},me.diffed=function(e){Ao&&Ao(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(Oo.push(t)!==1&&Fo===me.requestAnimationFrame||((Fo=me.requestAnimationFrame)||ma)(pa)),t.__H.__.forEach(function(n){n.i&&(n.__H=n.i),n.i=void 0})),Qn=de=null},me.__c=function(e,t){t.some(function(n){try{n.__h.forEach(bn),n.__h=n.__h.filter(function(r){return!r.__||nr(r)})}catch(r){t.some(function(o){o.__h&&(o.__h=[])}),t=[],me.__e(r,n.__v)}}),No&&No(e,t)},me.unmount=function(e){ko&&ko(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach(function(r){try{bn(r)}catch(o){t=o}}),n.__H=void 0,t&&me.__e(t,n.__v))};var Lo=typeof requestAnimationFrame=="function";function ma(e){var t,n=function(){clearTimeout(r),Lo&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,100);Lo&&(t=requestAnimationFrame(n))}function bn(e){var t=de,n=e.__c;typeof n=="function"&&(e.__c=void 0,n()),de=t}function nr(e){var t=de;e.__c=e.__(),de=t}function rr(e,t){return!e||e.length!==t.length||t.some(function(n,r){return n!==e[r]})}function Vo(e,t){return typeof t=="function"?t(e):t}function Ho(e,t){for(var n in t)e[n]=t[n];return e}function or(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 yn(e,t){var n=t(),r=B({t:{__:n,u:t}}),o=r[0].t,i=r[1];return je(function(){o.__=n,o.u=t,ir(o)&&i({t:o})},[e,n,t]),re(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 lr(e){e()}function sr(e){return e}function ar(){return[!1,lr]}var ur=je;function xn(e,t){this.props=e,this.context=t}function zo(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:or(this.props,o)}function r(o){return this.shouldComponentUpdate=n,x.createElement(e,o)}return r.displayName="Memo("+(e.displayName||e.name)+")",r.prototype.isReactComponent=!0,r.__f=!0,r}(xn.prototype=new x.Component).isPureReactComponent=!0,xn.prototype.shouldComponentUpdate=function(e,t){return or(this.props,e)||or(this.state,t)};var Bo=x.options.__b;x.options.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),Bo&&Bo(e)};var ga=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.forward_ref")||3911;function ce(e){function t(n){var r=Ho({},n);return delete r.ref,e(r,n.ref||null)}return t.$$typeof=ga,t.render=t,t.prototype.isReactComponent=t.__f=!0,t.displayName="ForwardRef("+(e.displayName||e.name)+")",t}var jo=function(e,t){return e==null?null:x.toChildArray(x.toChildArray(e).map(t))},Uo={map:jo,forEach:jo,count:function(e){return e?x.toChildArray(e).length:0},only:function(e){var t=x.toChildArray(e);if(t.length!==1)throw"Children.only";return t[0]},toArray:x.toChildArray},ha=x.options.__e;x.options.__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)}ha(e,t,n,r)};var Wo=x.options.unmount;function Go(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=Ho({},e)).__c!=null&&(e.__c.__P===n&&(e.__c.__P=t),e.__c=null),e.__k=e.__k&&e.__k.map(function(r){return Go(r,t,n)})),e}function qo(e,t,n){return e&&n&&(e.__v=null,e.__k=e.__k&&e.__k.map(function(r){return qo(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 Wt(){this.__u=0,this.o=null,this.__b=null}function Ko(e){var t=e.__.__c;return t&&t.__a&&t.__a(e)}function Yo(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 x.createElement(n,i)}return o.displayName="Lazy",o.__f=!0,o}function Tt(){this.i=null,this.l=null}x.options.unmount=function(e){var t=e.__c;t&&t.__R&&t.__R(),t&&32&e.__u&&(e.type=null),Wo&&Wo(e)},(Wt.prototype=new x.Component).__c=function(e,t){var n=t.__c,r=this;r.o==null&&(r.o=[]),r.o.push(n);var o=Ko(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]=qo(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)},Wt.prototype.componentWillUnmount=function(){this.o=[]},Wt.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]=Go(this.__b,n,r.__O=r.__P)}this.__b=null}var o=t.__a&&x.createElement(x.Fragment,null,e.fallback);return o&&(o.__u&=-33),[x.createElement(x.Fragment,null,t.__a?null:e.children),o]};var Xo=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 va(e){return this.getChildContext=function(){return e.context},e.children}function wa(e){var t=this,n=e.h;t.componentWillUnmount=function(){x.render(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)}}),x.render(x.createElement(va,{context:t.context},e.__v),t.v)}function Gt(e,t){var n=x.createElement(wa,{__v:e,h:t});return n.containerInfo=t,n}(Tt.prototype=new x.Component).__a=function(e){var t=this,n=Ko(t.__v),r=t.l.get(e);return r[0]++,function(o){var i=function(){t.props.revealOrder?(r.push(o),Xo(t,e,r)):o()};n?n(i):i()}},Tt.prototype.render=function(e){this.i=null,this.l=new Map;var t=x.toChildArray(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},Tt.prototype.componentDidUpdate=Tt.prototype.componentDidMount=function(){var e=this;this.l.forEach(function(t,n){Xo(e,n,t)})};var Zo=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.element")||60103,ba=/^(?: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]/,ya=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,xa=/[A-Z0-9]/g,_a=typeof document<"u",Ca=function(e){return(typeof Symbol<"u"&&typeof Symbol()=="symbol"?/fil|che|rad/:/fil|che|ra/).test(e)};function cr(e,t,n){return t.__k==null&&(t.textContent=""),x.render(e,t),typeof n=="function"&&n(),e?e.__c:null}function Jo(e,t,n){return x.hydrate(e,t),typeof n=="function"&&n(),e?e.__c:null}x.Component.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(e){Object.defineProperty(x.Component.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})});var Qo=x.options.event;function Sa(){}function Ea(){return this.cancelBubble}function Ra(){return this.defaultPrevented}x.options.event=function(e){return Qo&&(e=Qo(e)),e.persist=Sa,e.isPropagationStopped=Ea,e.isDefaultPrevented=Ra,e.nativeEvent=e};var dr,$a={enumerable:!1,configurable:!0,get:function(){return this.class}},ei=x.options.vnode;x.options.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||_a&&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"||Ca(n.type)?a==="onfocus"?l="onfocusin":a==="onblur"?l="onfocusout":ya.test(l)&&(l=a):a=l="oninput":i&&ba.test(l)?l=l.replace(xa,"-$&").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=x.toChildArray(n.children).forEach(function(u){u.props.selected=o.value.indexOf(u.props.value)!=-1})),r=="select"&&o.defaultValue!=null&&(o.value=x.toChildArray(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",$a)):(n.className&&!n.class||n.class&&n.className)&&(o.class=o.className=n.className),t.props=o}(e),e.$$typeof=Zo,ei&&ei(e)};var ti=x.options.__r;x.options.__r=function(e){ti&&ti(e),dr=e.__c};var ni=x.options.diffed;x.options.diffed=function(e){ni&&ni(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),dr=null};var ri={ReactCurrentDispatcher:{current:{readContext:function(e){return dr.__n[e.__c].props.value},useCallback:oe,useContext:le,useDebugValue:tr,useDeferredValue:sr,useEffect:re,useId:Se,useImperativeHandle:er,useInsertionEffect:ur,useLayoutEffect:je,useMemo:W,useReducer:Je,useRef:k,useState:B,useSyncExternalStore:yn,useTransition:ar}}},Ta="18.3.1";function oi(e){return x.createElement.bind(null,e)}function It(e){return!!e&&e.$$typeof===Zo}function ii(e){return It(e)&&e.type===x.Fragment}function li(e){return!!e&&!!e.displayName&&(typeof e.displayName=="string"||e.displayName instanceof String)&&e.displayName.startsWith("Memo(")}function fr(e){return It(e)?x.cloneElement.apply(null,arguments):e}function pr(e){return!!e.__k&&(x.render(null,e),!0)}function si(e){return e&&(e.base||e.nodeType===1&&e)||null}var ai=function(e,t){return e(t)},ke=function(e,t){return e(t)},ui=x.Fragment,ci=It,D={useState:B,useId:Se,useReducer:Je,useEffect:re,useLayoutEffect:je,useInsertionEffect:ur,useTransition:ar,useDeferredValue:sr,useSyncExternalStore:yn,startTransition:lr,useRef:k,useImperativeHandle:er,useMemo:W,useCallback:oe,useContext:le,useDebugValue:tr,version:"18.3.1",Children:Uo,render:cr,hydrate:Jo,unmountComponentAtNode:pr,createPortal:Gt,createElement:x.createElement,createContext:x.createContext,createFactory:oi,cloneElement:fr,createRef:x.createRef,Fragment:x.Fragment,isValidElement:It,isElement:ci,isFragment:ii,isMemo:li,findDOMNode:si,Component:x.Component,PureComponent:xn,memo:zo,forwardRef:ce,flushSync:ke,unstable_batchedUpdates:ai,StrictMode:ui,Suspense:Wt,SuspenseList:Tt,lazy:Yo,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:ri};const mr=Object.freeze(Object.defineProperty({__proto__:null,Children:Uo,Component:x.Component,Fragment:x.Fragment,PureComponent:xn,StrictMode:ui,Suspense:Wt,SuspenseList:Tt,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:ri,cloneElement:fr,createContext:x.createContext,createElement:x.createElement,createFactory:oi,createPortal:Gt,createRef:x.createRef,default:D,findDOMNode:si,flushSync:ke,forwardRef:ce,hydrate:Jo,isElement:ci,isFragment:ii,isMemo:li,isValidElement:It,lazy:Yo,memo:zo,render:cr,startTransition:lr,unmountComponentAtNode:pr,unstable_batchedUpdates:ai,useCallback:oe,useContext:le,useDebugValue:tr,useDeferredValue:sr,useEffect:re,useErrorBoundary:fa,useId:Se,useImperativeHandle:er,useInsertionEffect:ur,useLayoutEffect:je,useMemo:W,useReducer:Je,useRef:k,useState:B,useSyncExternalStore:yn,useTransition:ar,version:Ta},Symbol.toStringTag,{value:"Module"}));function Ia(e){return{render:function(t){cr(t,e)},unmount:function(){pr(e)}}}var Fa=0;function f(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:--Fa,__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 x.options.vnode&&x.options.vnode(u),u}function di(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=di(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Oa(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=di(e))&&(r&&(r+=" "),r+=t);return r}const fi=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,pi=Oa,ht=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return pi(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],p=i==null?void 0:i[u];if(c===null)return null;const g=fi(c)||fi(p);return o[u][g]}),s=n&&Object.entries(n).reduce((u,c)=>{let[p,g]=c;return g===void 0||(u[p]=g),u},{}),a=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((u,c)=>{let{class:p,className:g,...d}=c;return Object.entries(d).every(m=>{let[h,w]=m;return Array.isArray(w)?w.includes({...i,...s}[h]):{...i,...s}[h]===w})?[...u,p,g]:u},[]);return pi(e,l,a,n==null?void 0:n.class,n==null?void 0:n.className)},Ma=ht("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 Ve({children:e,variant:t,disabled:n,onClick:r,withFullWidth:o}){const i=Ma({variant:t,disabled:n,withFullWidth:o});return f("div",{role:"button",tabIndex:0,className:i,onClick:r,"aria-disabled":n,children:e})}const Pa=ht("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}}),mi=ce(({children:e,className:t,variant:n,withPadding:r=!0},o)=>{const i=Pa({variant:n,withPadding:r});return f("div",{ref:o,className:`${i} ${t}`,children:e})});function gi({checked:e,setChecked:t,label:n}){const r=Se();return f("div",{className:"flex gap-3",children:[f("div",{className:"flex h-6 shrink-0 items-center",children:f("div",{className:"group grid size-4 grid-cols-1",children:[f("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"}),f("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:[f("path",{d:"M3 8L6 11L11 3.5",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",className:"opacity-0 group-has-checked:opacity-100"}),f("path",{d:"M3 7H11",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",className:"opacity-0 group-has-indeterminate:opacity-100"})]})]})}),n&&f("div",{className:"text-sm/6",children:f("label",{htmlFor:r,className:"font-medium text-gray-900",children:n})})]})}let Aa=!1;function gr(){return Aa}const hi=typeof document<"u"?D.useLayoutEffect:()=>{};function Na(e){const t=k(null);return hi(()=>{t.current=e},[e]),oe((...n)=>{const r=t.current;return r==null?void 0:r(...n)},[])}const ot=e=>{var t;return(t=e==null?void 0:e.ownerDocument)!==null&&t!==void 0?t:document},vt=e=>e&&"window"in e&&e.window===e?e:ot(e).defaultView||window;function ka(e){return e!==null&&typeof e=="object"&&"nodeType"in e&&typeof e.nodeType=="number"}function Da(e){return ka(e)&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&"host"in e}function vi(e,t){if(!gr())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:Da(n)?n=n.host:n=n.parentNode}return!1}const hr=(e=document)=>{var t;if(!gr())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 wi(e){return gr()&&e.target.shadowRoot&&e.composedPath?e.composedPath()[0]:e.target}function La(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 Va(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 bi(e){let t=null;return()=>(t==null&&(t=e()),t)}const Ha=bi(function(){return Va(/^Mac/i)}),za=bi(function(){return La(/Android/i)});function yi(){let e=k(new Map),t=oe((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=oe((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=oe(()=>{e.current.forEach((o,i)=>{n(o.eventTarget,o.type,i,o.options)})},[n]);return re(()=>r,[r]),{addGlobalListener:t,removeGlobalListener:n,removeAllGlobalListeners:r}}function Ba(e){return e.mozInputSource===0&&e.isTrusted?!0:za()&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function xi(e){let t=e;return t.nativeEvent=e,t.isDefaultPrevented=()=>t.defaultPrevented,t.isPropagationStopped=()=>t.cancelBubble,t.persist=()=>{},t}function ja(e,t){Object.defineProperty(e,"target",{value:t}),Object.defineProperty(e,"currentTarget",{value:t})}function _i(e){let t=k({isFocused:!1,observer:null});hi(()=>{const r=t.current;return()=>{r.observer&&(r.observer.disconnect(),r.observer=null)}},[]);let n=Na(r=>{e==null||e(r)});return oe(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=xi(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 Ua=!1,qt=null,vr=new Set,Kt=new Map,wt=!1,wr=!1;const Wa={Tab:!0,Escape:!0};function br(e,t){for(let n of vr)n(e,t)}function Ga(e){return!(e.metaKey||!Ha()&&e.altKey||e.ctrlKey||e.key==="Control"||e.key==="Shift"||e.key==="Meta")}function _n(e){wt=!0,Ga(e)&&(qt="keyboard",br("keyboard",e))}function Ft(e){qt="pointer",(e.type==="mousedown"||e.type==="pointerdown")&&(wt=!0,br("pointer",e))}function Ci(e){Ba(e)&&(wt=!0,qt="virtual")}function Si(e){e.target===window||e.target===document||Ua||!e.isTrusted||(!wt&&!wr&&(qt="virtual",br("virtual",e)),wt=!1,wr=!1)}function Ei(){wt=!1,wr=!0}function yr(e){if(typeof window>"u"||Kt.get(vt(e)))return;const t=vt(e),n=ot(e);let r=t.HTMLElement.prototype.focus;t.HTMLElement.prototype.focus=function(){wt=!0,r.apply(this,arguments)},n.addEventListener("keydown",_n,!0),n.addEventListener("keyup",_n,!0),n.addEventListener("click",Ci,!0),t.addEventListener("focus",Si,!0),t.addEventListener("blur",Ei,!1),typeof PointerEvent<"u"&&(n.addEventListener("pointerdown",Ft,!0),n.addEventListener("pointermove",Ft,!0),n.addEventListener("pointerup",Ft,!0)),t.addEventListener("beforeunload",()=>{Ri(e)},{once:!0}),Kt.set(t,{focus:r})}const Ri=(e,t)=>{const n=vt(e),r=ot(e);t&&r.removeEventListener("DOMContentLoaded",t),Kt.has(n)&&(n.HTMLElement.prototype.focus=Kt.get(n).focus,r.removeEventListener("keydown",_n,!0),r.removeEventListener("keyup",_n,!0),r.removeEventListener("click",Ci,!0),n.removeEventListener("focus",Si,!0),n.removeEventListener("blur",Ei,!1),typeof PointerEvent<"u"&&(r.removeEventListener("pointerdown",Ft,!0),r.removeEventListener("pointermove",Ft,!0),r.removeEventListener("pointerup",Ft,!0)),Kt.delete(n))};function qa(e){const t=ot(e);let n;return t.readyState!=="loading"?yr(e):(n=()=>{yr(e)},t.addEventListener("DOMContentLoaded",n)),()=>Ri(e,n)}typeof document<"u"&&qa();function $i(){return qt!=="pointer"}const Ka=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);function Ya(e,t,n){let r=ot(n==null?void 0:n.target);const o=typeof window<"u"?vt(n==null?void 0:n.target).HTMLInputElement:HTMLInputElement,i=typeof window<"u"?vt(n==null?void 0:n.target).HTMLTextAreaElement:HTMLTextAreaElement,l=typeof window<"u"?vt(n==null?void 0:n.target).HTMLElement:HTMLElement,s=typeof window<"u"?vt(n==null?void 0:n.target).KeyboardEvent:KeyboardEvent;return e=e||r.activeElement instanceof o&&!Ka.has(r.activeElement.type)||r.activeElement instanceof i||r.activeElement instanceof l&&r.activeElement.isContentEditable,!(e&&t==="keyboard"&&n instanceof s&&!Wa[n.key])}function Xa(e,t,n){yr(),re(()=>{let r=(o,i)=>{Ya(!!(n!=null&&n.isTextInput),o,i)&&e($i())};return vr.add(r),()=>{vr.delete(r)}},t)}function Za(e){let{isDisabled:t,onFocus:n,onBlur:r,onFocusChange:o}=e;const i=oe(a=>{if(a.target===a.currentTarget)return r&&r(a),o&&o(!1),!0},[r,o]),l=_i(i),s=oe(a=>{const u=ot(a.target),c=u?hr(u):hr();a.target===a.currentTarget&&c===wi(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 Ja(e){let{isDisabled:t,onBlurWithin:n,onFocusWithin:r,onFocusWithinChange:o}=e,i=k({isFocusWithin:!1}),{addGlobalListener:l,removeAllGlobalListeners:s}=yi(),a=oe(p=>{p.currentTarget.contains(p.target)&&i.current.isFocusWithin&&!p.currentTarget.contains(p.relatedTarget)&&(i.current.isFocusWithin=!1,s(),n&&n(p),o&&o(!1))},[n,o,i,s]),u=_i(a),c=oe(p=>{if(!p.currentTarget.contains(p.target))return;const g=ot(p.target),d=hr(g);if(!i.current.isFocusWithin&&d===wi(p.nativeEvent)){r&&r(p),o&&o(!0),i.current.isFocusWithin=!0,u(p);let m=p.currentTarget;l(g,"focus",h=>{if(i.current.isFocusWithin&&!vi(m,h.target)){let w=new g.defaultView.FocusEvent("blur",{relatedTarget:h.target});ja(w,m);let C=xi(w);a(C)}},{capture:!0})}},[r,o,u,l,a]);return t?{focusWithinProps:{onFocus:void 0,onBlur:void 0}}:{focusWithinProps:{onFocus:c,onBlur:a}}}let xr=!1,_r=0;function Qa(){xr=!0,setTimeout(()=>{xr=!1},50)}function Ti(e){e.pointerType==="touch"&&Qa()}function eu(){if(!(typeof document>"u"))return typeof PointerEvent<"u"&&document.addEventListener("pointerup",Ti),_r++,()=>{_r--,!(_r>0)&&typeof PointerEvent<"u"&&document.removeEventListener("pointerup",Ti)}}function Ii(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;re(eu,[]);let{addGlobalListener:a,removeAllGlobalListeners:u}=yi(),{hoverProps:c,triggerHoverEnd:p}=W(()=>{let g=(h,w)=>{if(s.pointerType=w,o||w==="touch"||s.isHovered||!h.currentTarget.contains(h.target))return;s.isHovered=!0;let C=h.currentTarget;s.target=C,a(ot(h.target),"pointerover",S=>{s.isHovered&&s.target&&!vi(s.target,S.target)&&d(S,S.pointerType)},{capture:!0}),t&&t({type:"hoverstart",target:C,pointerType:w}),n&&n(!0),l(!0)},d=(h,w)=>{let C=s.target;s.pointerType="",s.target=null,!(w==="touch"||!s.isHovered||!C)&&(s.isHovered=!1,u(),r&&r({type:"hoverend",target:C,pointerType:w}),n&&n(!1),l(!1))},m={};return typeof PointerEvent<"u"&&(m.onPointerEnter=h=>{xr&&h.pointerType==="mouse"||g(h,h.pointerType)},m.onPointerLeave=h=>{!o&&h.currentTarget.contains(h.target)&&d(h,h.pointerType)}),{hoverProps:m,triggerHoverEnd:d}},[t,n,r,o,s,a,u]);return re(()=>{o&&p({currentTarget:s.target},s.pointerType)},[o]),{hoverProps:c,isHovered:i}}function Fi(e={}){let{autoFocus:t=!1,isTextInput:n,within:r}=e,o=k({isFocused:!1,isFocusVisible:t||$i()}),[i,l]=B(!1),[s,a]=B(()=>o.current.isFocused&&o.current.isFocusVisible),u=oe(()=>a(o.current.isFocused&&o.current.isFocusVisible),[]),c=oe(d=>{o.current.isFocused=d,l(d),u()},[u]);Xa(d=>{o.current.isFocusVisible=d,u()},[],{isTextInput:n});let{focusProps:p}=Za({isDisabled:r,onFocusChange:c}),{focusWithinProps:g}=Ja({isDisabled:!r,onFocusWithinChange:c});return{isFocused:i,isFocusVisible:s,focusProps:r?g:p}}var tu=Object.defineProperty,nu=(e,t,n)=>t in e?tu(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Cr=(e,t,n)=>(nu(e,typeof t!="symbol"?t+"":t,n),n);let ru=class{constructor(){Cr(this,"current",this.detect()),Cr(this,"handoffState","pending"),Cr(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"}},bt=new ru;function Ot(e){return bt.isServer?null:e instanceof Node?e.ownerDocument:e!=null&&e.hasOwnProperty("current")&&e.current instanceof Node?e.current.ownerDocument:document}function Cn(e){typeof queueMicrotask=="function"?queueMicrotask(e):Promise.resolve().then(e).catch(t=>setTimeout(()=>{throw t}))}function Ue(){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 Cn(()=>{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=Ue();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 yt(){let[e]=B(Ue);return re(()=>()=>e.dispose(),[e]),e}let ue=(e,t)=>{bt.isServer?re(e,t):je(e,t)};function it(e){let t=k(e);return ue(()=>{t.current=e},[e]),t}let j=function(e){let t=it(e);return D.useCallback((...n)=>t.current(...n),[t])};function ou(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 iu(e,t){return!(!e||!t||e.right<t.left||e.left>t.right||e.bottom<t.top||e.top>t.bottom)}function lu({disabled:e=!1}={}){let t=k(null),[n,r]=B(!1),o=yt(),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=Ot(s.currentTarget);o.addEventListener(a,"pointerup",i,!1),o.addEventListener(a,"pointermove",u=>{if(t.current){let c=ou(u);r(iu(c,t.current.getBoundingClientRect()))}},!1),o.addEventListener(a,"pointercancel",i,!1)}}});return{pressed:n,pressProps:e?{}:{onPointerDown:l,onPointerUp:i,onClick:i}}}let su=x.createContext(void 0);function Sr(){return le(su)}function Er(...e){return Array.from(new Set(e.flatMap(t=>typeof t=="string"?t.split(" "):[]))).filter(Boolean).join(" ")}function Ae(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,Ae),r}var Mt=(e=>(e[e.None=0]="None",e[e.RenderStrategy=1]="RenderStrategy",e[e.Static=2]="Static",e))(Mt||{}),lt=(e=>(e[e.Unmount=0]="Unmount",e[e.Hidden=1]="Hidden",e))(lt||{});function ye(){let e=uu();return oe(t=>au({mergeRefs:e,...t}),[e])}function au({ourProps:e,theirProps:t,slot:n,defaultTag:r,features:o,visible:i=!0,name:l,mergeRefs:s}){s=s??cu;let a=Oi(t,e);if(i)return Sn(a,n,r,l,s);let u=o??0;if(u&2){let{static:c=!1,...p}=a;if(c)return Sn(p,n,r,l,s)}if(u&1){let{unmount:c=!0,...p}=a;return Ae(c?0:1,{0(){return null},1(){return Sn({...p,hidden:!0,style:{display:"none"}},n,r,l,s)}})}return Sn(a,n,r,l,s)}function Sn(e,t={},n,r,o){let{as:i=n,children:l,refName:s="ref",...a}=$r(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 p={};if(t){let g=!1,d=[];for(let[m,h]of Object.entries(t))typeof h=="boolean"&&(g=!0),h===!0&&d.push(m.replace(/([A-Z])/g,w=>`-${w.toLowerCase()}`));if(g){p["data-headlessui-state"]=d.join(" ");for(let m of d)p[`data-${m}`]=""}}if(i===x.Fragment&&(Object.keys(st(a)).length>0||Object.keys(st(p)).length>0))if(!It(c)||Array.isArray(c)&&c.length>1){if(Object.keys(st(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(st(a)).concat(Object.keys(st(p))).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,d=g==null?void 0:g.className,m=typeof d=="function"?(...C)=>Er(d(...C),a.className):Er(d,a.className),h=m?{className:m}:{},w=Oi(c.props,st($r(a,["ref"])));for(let C in p)C in w&&delete p[C];return fr(c,Object.assign({},w,p,u,{ref:o(du(c),u.ref)},h))}return x.createElement(i,Object.assign({},$r(a,["ref"]),i!==x.Fragment&&u,i!==x.Fragment&&p),c)}function uu(){let e=k([]),t=oe(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 cu(...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 Oi(...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 Rr(...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 we(e){var t;return Object.assign(ce(e),{displayName:(t=e.displayName)!=null?t:e.name})}function st(e){let t=Object.assign({},e);for(let n in t)t[n]===void 0&&delete t[n];return t}function $r(e,t=[]){let n=Object.assign({},e);for(let r of t)r in n&&delete n[r];return n}function du(e){return D.version.split(".")[0]>="19"?e.props.ref:e.ref}function fu(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 pu(e){let[t]=B(e);return t}function Mi(e={},t=null,n=[]){for(let[r,o]of Object.entries(e))Ai(n,Pi(t,r),o);return n}function Pi(e,t){return e?e+"["+t+"]":t}function Ai(e,t,n){if(Array.isArray(n))for(let[r,o]of n.entries())Ai(e,Pi(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,""]):Mi(n,t,e)}let mu="span";var Pt=(e=>(e[e.None=1]="None",e[e.Focusable=2]="Focusable",e[e.Hidden=4]="Hidden",e))(Pt||{});function gu(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 ye()({ourProps:i,theirProps:o,slot:{},defaultTag:mu,name:"Hidden"})}let Yt=we(gu),hu=x.createContext(null);function vu({children:e}){let t=le(hu);if(!t)return D.createElement(D.Fragment,null,e);let{target:n}=t;return n?Gt(D.createElement(D.Fragment,null,e),n):null}function wu({data:e,form:t,disabled:n,onReset:r,overrides:o}){let[i,l]=B(null),s=yt();return re(()=>{if(r&&i)return s.addEventListener(i,"reset",r)},[i,t,r]),D.createElement(vu,null,D.createElement(bu,{setForm:l,formId:t}),Mi(e).map(([a,u])=>D.createElement(Yt,{features:Pt.Hidden,...st({key:a,as:"input",type:"hidden",hidden:!0,readOnly:!0,form:t,disabled:n,name:a,value:u,...o})})))}function bu({setForm:e,formId:t}){return re(()=>{if(t){let n=document.getElementById(t);n&&e(n)}},[e,t]),t?null:D.createElement(Yt,{features:Pt.Hidden,as:"input",type:"hidden",hidden:!0,readOnly:!0,ref:n=>{if(!n)return;let r=n.closest("form");r&&e(r)}})}let yu=x.createContext(void 0);function Ni(){return le(yu)}function xu(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&&_u(n)?!1:r}function _u(e){if(!e)return!1;let t=e.previousElementSibling;for(;t!==null;){if(t instanceof HTMLLegendElement)return!1;t=t.previousElementSibling}return!0}let ki=Symbol();function Cu(e,t=!0){return Object.assign(e,{[ki]:t})}function Fe(...e){let t=k(e);re(()=>{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[ki]))?void 0:n}let En=x.createContext(null);En.displayName="DescriptionContext";function Di(){let e=le(En);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,Di),t}return e}function Su(){var e,t;return(t=(e=le(En))==null?void 0:e.value)!=null?t:void 0}function Eu(){let[e,t]=B([]);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.props,value:n.value}),[r,n.slot,n.name,n.props,n.value]);return D.createElement(En.Provider,{value:o},n.children)},[t])]}let Ru="p";function $u(e,t){let n=Se(),r=Sr(),{id:o=`headlessui-description-${n}`,...i}=e,l=Di(),s=Fe(t);ue(()=>l.register(o),[o,l.register]);let a=r||!1,u=W(()=>({...l.slot,disabled:a}),[l.slot,a]),c={ref:s,...l.props,id:o};return ye()({ourProps:c,theirProps:i,slot:u,defaultTag:Ru,name:l.name||"Description"})}let Tu=we($u),Iu=Object.assign(Tu,{});var Ee=(e=>(e.Space=" ",e.Enter="Enter",e.Escape="Escape",e.Backspace="Backspace",e.Delete="Delete",e.ArrowLeft="ArrowLeft",e.ArrowUp="ArrowUp",e.ArrowRight="ArrowRight",e.ArrowDown="ArrowDown",e.Home="Home",e.End="End",e.PageUp="PageUp",e.PageDown="PageDown",e.Tab="Tab",e))(Ee||{});let Rn=x.createContext(null);Rn.displayName="LabelContext";function Li(){let e=le(Rn);if(e===null){let t=new Error("You used a <Label /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(t,Li),t}return e}function $n(e){var t,n,r;let o=(n=(t=le(Rn))==null?void 0:t.value)!=null?n:void 0;return((r=e==null?void 0:e.length)!=null?r:0)>0?[o,...e].filter(Boolean).join(" "):o}function Fu({inherit:e=!1}={}){let t=$n(),[n,r]=B([]),o=e?[t,...n].filter(Boolean):n;return[o.length>0?o.join(" "):void 0,W(()=>function(i){let l=j(a=>(r(u=>[...u,a]),()=>r(u=>{let c=u.slice(),p=c.indexOf(a);return p!==-1&&c.splice(p,1),c}))),s=W(()=>({register:l,slot:i.slot,name:i.name,props:i.props,value:i.value}),[l,i.slot,i.name,i.props,i.value]);return D.createElement(Rn.Provider,{value:s},i.children)},[r])]}let Ou="label";function Mu(e,t){var n;let r=Se(),o=Li(),i=Ni(),l=Sr(),{id:s=`headlessui-label-${r}`,htmlFor:a=i??((n=o.props)==null?void 0:n.htmlFor),passive:u=!1,...c}=e,p=Fe(t);ue(()=>o.register(s),[s,o.register]);let g=j(w=>{let C=w.currentTarget;if(C instanceof HTMLLabelElement&&w.preventDefault(),o.props&&"onClick"in o.props&&typeof o.props.onClick=="function"&&o.props.onClick(w),C instanceof HTMLLabelElement){let S=document.getElementById(C.htmlFor);if(S){let _=S.getAttribute("disabled");if(_==="true"||_==="")return;let E=S.getAttribute("aria-disabled");if(E==="true"||E==="")return;(S instanceof HTMLInputElement&&(S.type==="radio"||S.type==="checkbox")||S.role==="radio"||S.role==="checkbox"||S.role==="switch")&&S.click(),S.focus({preventScroll:!0})}}}),d=l||!1,m=W(()=>({...o.slot,disabled:d}),[o.slot,d]),h={ref:p,...o.props,id:s,htmlFor:a,onClick:g};return u&&("onClick"in h&&(delete h.htmlFor,delete h.onClick),"onClick"in c&&delete c.onClick),ye()({ourProps:h,theirProps:c,slot:m,defaultTag:a?Ou:"div",name:o.name||"Label"})}let Pu=we(Mu),Au=Object.assign(Pu,{}),Nu=x.createContext(()=>{});function ku({value:e,children:t}){return D.createElement(Nu.Provider,{value:e},t)}function At(e,t,n){let r=n.initialDeps??[],o;function i(){var l,s,a,u;let c;n.key&&((l=n.debug)!=null&&l.call(n))&&(c=Date.now());const p=e();if(!(p.length!==r.length||p.some((m,h)=>r[h]!==m)))return o;r=p;let d;if(n.key&&((s=n.debug)!=null&&s.call(n))&&(d=Date.now()),o=t(...p),n.key&&((a=n.debug)!=null&&a.call(n))){const m=Math.round((Date.now()-c)*100)/100,h=Math.round((Date.now()-d)*100)/100,w=h/16,C=(S,_)=>{for(S=String(S);S.length<_;)S=" "+S;return S};console.info(`%c⏱ ${C(h,5)} /${C(m,5)} ms`,` font-size: .6rem; font-weight: bold; color: hsl(${Math.max(0,Math.min(120-120*w,120))}deg 100% 31%);`,n==null?void 0:n.key)}return(u=n==null?void 0:n.onChange)==null||u.call(n,o),o}return i.updateDeps=l=>{r=l},i}function Vi(e,t){if(e===void 0)throw new Error("Unexpected undefined");return e}const Du=(e,t)=>Math.abs(e-t)<=1,Lu=(e,t,n)=>{let r;return function(...o){e.clearTimeout(r),r=e.setTimeout(()=>t.apply(this,o),n)}};var Xt={NODE_ENV:"production"};const Hi=e=>{const{offsetWidth:t,offsetHeight:n}=e;return{width:t,height:n}},Vu=e=>e,Hu=e=>{const t=Math.max(e.startIndex-e.overscan,0),n=Math.min(e.endIndex+e.overscan,e.count-1),r=[];for(let o=t;o<=n;o++)r.push(o);return r},zu=(e,t)=>{const n=e.scrollElement;if(!n)return;const r=e.targetWindow;if(!r)return;const o=l=>{const{width:s,height:a}=l;t({width:Math.round(s),height:Math.round(a)})};if(o(Hi(n)),!r.ResizeObserver)return()=>{};const i=new r.ResizeObserver(l=>{const s=()=>{const a=l[0];if(a!=null&&a.borderBoxSize){const u=a.borderBoxSize[0];if(u){o({width:u.inlineSize,height:u.blockSize});return}}o(Hi(n))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(s):s()});return i.observe(n,{box:"border-box"}),()=>{i.unobserve(n)}},zi={passive:!0},Bi=typeof window>"u"?!0:"onscrollend"in window,Bu=(e,t)=>{const n=e.scrollElement;if(!n)return;const r=e.targetWindow;if(!r)return;let o=0;const i=e.options.useScrollendEvent&&Bi?()=>{}:Lu(r,()=>{t(o,!1)},e.options.isScrollingResetDelay),l=c=>()=>{const{horizontal:p,isRtl:g}=e.options;o=p?n.scrollLeft*(g&&-1||1):n.scrollTop,i(),t(o,c)},s=l(!0),a=l(!1);a(),n.addEventListener("scroll",s,zi);const u=e.options.useScrollendEvent&&Bi;return u&&n.addEventListener("scrollend",a,zi),()=>{n.removeEventListener("scroll",s),u&&n.removeEventListener("scrollend",a)}},ju=(e,t,n)=>{if(t!=null&&t.borderBoxSize){const r=t.borderBoxSize[0];if(r)return Math.round(r[n.options.horizontal?"inlineSize":"blockSize"])}return e[n.options.horizontal?"offsetWidth":"offsetHeight"]},Uu=(e,{adjustments:t=0,behavior:n},r)=>{var o,i;const l=e+t;(i=(o=r.scrollElement)==null?void 0:o.scrollTo)==null||i.call(o,{[r.options.horizontal?"left":"top"]:l,behavior:n})};class Wu{constructor(t){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollToIndexTimeoutId=null,this.measurementsCache=[],this.itemSizeCache=new Map,this.pendingMeasuredCacheIndexes=[],this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this.elementsCache=new Map,this.observer=(()=>{let n=null;const r=()=>n||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:n=new this.targetWindow.ResizeObserver(o=>{o.forEach(i=>{const l=()=>{this._measureElement(i.target,i)};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(l):l()})}));return{disconnect:()=>{var o;(o=r())==null||o.disconnect(),n=null},observe:o=>{var i;return(i=r())==null?void 0:i.observe(o,{box:"border-box"})},unobserve:o=>{var i;return(i=r())==null?void 0:i.unobserve(o)}}})(),this.range=null,this.setOptions=n=>{Object.entries(n).forEach(([r,o])=>{typeof o>"u"&&delete n[r]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:Vu,rangeExtractor:Hu,onChange:()=>{},measureElement:ju,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,...n}},this.notify=n=>{var r,o;(o=(r=this.options).onChange)==null||o.call(r,this,n)},this.maybeNotify=At(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),n=>{this.notify(n)},{key:Xt.NODE_ENV!=="production",debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(n=>n()),this.unsubs=[],this.observer.disconnect(),this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var n;const r=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==r){if(this.cleanup(),!r){this.maybeNotify();return}this.scrollElement=r,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((n=this.scrollElement)==null?void 0:n.window)??null,this.elementsCache.forEach(o=>{this.observer.observe(o)}),this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0}),this.unsubs.push(this.options.observeElementRect(this,o=>{this.scrollRect=o,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(o,i)=>{this.scrollAdjustments=0,this.scrollDirection=i?this.getScrollOffset()<o?"forward":"backward":null,this.scrollOffset=o,this.isScrolling=i,this.maybeNotify()}))}},this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(n,r)=>{const o=new Map,i=new Map;for(let l=r-1;l>=0;l--){const s=n[l];if(o.has(s.lane))continue;const a=i.get(s.lane);if(a==null||s.end>a.end?i.set(s.lane,s):s.end<a.end&&o.set(s.lane,!0),o.size===this.options.lanes)break}return i.size===this.options.lanes?Array.from(i.values()).sort((l,s)=>l.end===s.end?l.index-s.index:l.end-s.end)[0]:void 0},this.getMeasurementOptions=At(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled],(n,r,o,i,l)=>(this.pendingMeasuredCacheIndexes=[],{count:n,paddingStart:r,scrollMargin:o,getItemKey:i,enabled:l}),{key:!1}),this.getMeasurements=At(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:n,paddingStart:r,scrollMargin:o,getItemKey:i,enabled:l},s)=>{if(!l)return this.measurementsCache=[],this.itemSizeCache.clear(),[];this.measurementsCache.length===0&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(c=>{this.itemSizeCache.set(c.key,c.size)}));const a=this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[];const u=this.measurementsCache.slice(0,a);for(let c=a;c<n;c++){const p=i(c),g=this.options.lanes===1?u[c-1]:this.getFurthestMeasurement(u,c),d=g?g.end+this.options.gap:r+o,m=s.get(p),h=typeof m=="number"?m:this.options.estimateSize(c),w=d+h,C=g?g.lane:c%this.options.lanes;u[c]={index:c,start:d,size:h,end:w,key:p,lane:C}}return this.measurementsCache=u,u},{key:Xt.NODE_ENV!=="production",debug:()=>this.options.debug}),this.calculateRange=At(()=>[this.getMeasurements(),this.getSize(),t