
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=(new Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="48addc23-abd2-5eb3-9ad3-48ae590ab061")}catch(e){}}();
import{r as i,e as g}from"./index-D6da9p6-.js";import{o as f,U as b,I as v,y,l as T,C as S}from"./keyboard-CaEu2o0u.js";function O(n,t,e){let[o,r]=i.useState(e),l=n!==void 0,u=i.useRef(l),s=i.useRef(!1),a=i.useRef(!1);return l&&!u.current&&!s.current?(s.current=!0,u.current=l,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.")):!l&&u.current&&!a.current&&(a.current=!0,u.current=l,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.")),[l?n:o,f(c=>(l||r(c),t?.(c)))]}function k(n={},t=null,e=[]){for(let[o,r]of Object.entries(n))d(e,p(t,o),r);return e}function p(n,t){return n?n+"["+t+"]":t}function d(n,t,e){if(Array.isArray(e))for(let[o,r]of e.entries())d(n,p(t,o.toString()),r);else e instanceof Date?n.push([t,e.toISOString()]):typeof e=="boolean"?n.push([t,e?"1":"0"]):typeof e=="string"?n.push([t,e]):typeof e=="number"?n.push([t,`${e}`]):e==null?n.push([t,""]):k(e,t,n)}function P(n){var t,e;let o=(t=n?.form)!=null?t:n.closest("form");if(o){for(let r of o.elements)if(r!==n&&(r.tagName==="INPUT"&&r.type==="submit"||r.tagName==="BUTTON"&&r.type==="submit"||r.nodeName==="INPUT"&&r.type==="image")){r.click();return}(e=o.requestSubmit)==null||e.call(o)}}let m=i.createContext(null);function h(){let n=i.useContext(m);if(n===null){let t=new Error("You used a <Label /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(t,h),t}return n}function $(){let[n,t]=i.useState([]);return[n.length>0?n.join(" "):void 0,i.useMemo(()=>function(e){let o=f(l=>(t(u=>[...u,l]),()=>t(u=>{let s=u.slice(),a=s.indexOf(l);return a!==-1&&s.splice(a,1),s}))),r=i.useMemo(()=>({register:o,slot:e.slot,name:e.name,props:e.props}),[o,e.slot,e.name,e.props]);return g.createElement(m.Provider,{value:r},e.children)},[t])]}let C="label";function N(n,t){let e=v(),{id:o=`headlessui-label-${e}`,passive:r=!1,...l}=n,u=h(),s=y(t);T(()=>u.register(o),[o,u.register]);let a={ref:s,...u.props,id:o};return r&&("onClick"in a&&(delete a.htmlFor,delete a.onClick),"onClick"in l&&delete l.onClick),S({ourProps:a,theirProps:l,slot:u.slot||{},defaultTag:C,name:u.name||"Label"})}let x=b(N),w=Object.assign(x,{});export{w as B,$ as F,O as T,k as e,P as p};
//# sourceMappingURL=label-CGhICcle.js.map

//# debugId=48addc23-abd2-5eb3-9ad3-48ae590ab061
