import{a as e,c as t,d as n,s as r,t as i,u as a}from"./app-DydVzIzS.js";import{C as o,S as s,_ as c,a as l,b as u,c as d,d as f,f as p,g as m,h,i as g,l as ee,m as _,n as v,o as y,p as b,r as x,s as te,t as S,u as C,v as w,x as T,y as E}from"./TextInput-DIBT30cO.js";var D=i();function O({className:e=``,disabled:t,children:n,...r}){return(0,D.jsx)(`button`,{...r,className:`inline-flex items-center rounded-md border border-transparent bg-red-600 px-4 py-2 text-xs font-semibold uppercase tracking-widest text-white transition duration-150 ease-in-out hover:bg-red-500 focus:outline-none focus:ring-2 focus:ring-red-500 focus:ring-offset-2 active:bg-red-700 ${t&&`opacity-25`} `+e,disabled:t,children:n})}function k(e){return T.isServer?null:e==null?document:e?.ownerDocument??document}function A(e){return T.isServer?null:e==null?document:(e?.getRootNode)?.call(e)??document}function ne(e){return A(e)?.activeElement??null}function re(e){return ne(e)===e}var j=n(t(),1);function M(e){return(0,j.useMemo)(()=>e,Object.values(e))}var N=(0,j.createContext)(void 0);function ie(){return(0,j.useContext)(N)}var P=`span`,F=(e=>(e[e.None=1]=`None`,e[e.Focusable=2]=`Focusable`,e[e.Hidden=4]=`Hidden`,e))(F||{});function ae(e,t){let{features:n=1,...r}=e,i={ref:t,"aria-hidden":(n&2)==2?!0:r[`aria-hidden`]??void 0,hidden:(n&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`,...(n&4)==4&&(n&2)!=2&&{display:`none`}}};return p()({ourProps:i,theirProps:r,slot:{},defaultTag:P,name:`Hidden`})}var oe=b(ae);function se(e){return typeof e!=`object`||!e?!1:`nodeType`in e}function I(e){return se(e)&&`tagName`in e}function L(e){return I(e)&&`accessKey`in e}function R(e){return I(e)&&`tabIndex`in e}function z(e){return I(e)&&`style`in e}function ce(e){return L(e)&&e.nodeName===`IFRAME`}function le(e){return L(e)&&e.nodeName===`INPUT`}var ue=(0,j.createContext)(null);ue.displayName=`DescriptionContext`;function de(){let e=(0,j.useContext)(ue);if(e===null){let e=Error(`You used a component, but it is not inside a relevant parent.`);throw Error.captureStackTrace&&Error.captureStackTrace(e,de),e}return e}function fe(){let[e,t]=(0,j.useState)([]);return[e.length>0?e.join(` `):void 0,(0,j.useMemo)(()=>function(e){let n=h(e=>(t(t=>[...t,e]),()=>t(t=>{let n=t.slice(),r=n.indexOf(e);return r!==-1&&n.splice(r,1),n}))),r=(0,j.useMemo)(()=>({register:n,slot:e.slot,name:e.name,props:e.props,value:e.value}),[n,e.slot,e.name,e.props,e.value]);return j.createElement(ue.Provider,{value:r},e.children)},[t])]}var pe=`p`;function me(e,t){let n=(0,j.useId)(),r=ie(),{id:i=`headlessui-description-${n}`,...a}=e,o=de(),s=C(t);c(()=>o.register(i),[i,o.register]);let l=M({...o.slot,disabled:r||!1}),u={ref:s,...o.props,id:i};return p()({ourProps:u,theirProps:a,slot:l,defaultTag:pe,name:o.name||`Description`})}var he=b(me),ge=Object.assign(he,{}),_e=(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))(_e||{}),ve=(0,j.createContext)(()=>{});function ye({value:e,children:t}){return j.createElement(ve.Provider,{value:e},t)}var be=class extends Map{constructor(e){super(),this.factory=e}get(e){let t=super.get(e);return t===void 0&&(t=this.factory(e),this.set(e,t)),t}},xe=Object.defineProperty,Se=(e,t,n)=>t in e?xe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Ce=(e,t,n)=>(Se(e,typeof t==`symbol`?t:t+``,n),n),we=(e,t,n)=>{if(!t.has(e))throw TypeError(`Cannot `+n)},B=(e,t,n)=>(we(e,t,`read from private field`),n?n.call(e):t.get(e)),Te=(e,t,n)=>{if(t.has(e))throw TypeError(`Cannot add the same private member more than once`);t instanceof WeakSet?t.add(e):t.set(e,n)},Ee=(e,t,n,r)=>(we(e,t,`write to private field`),r?r.call(e,n):t.set(e,n),n),V,H,U,De=class{constructor(e){Te(this,V,{}),Te(this,H,new be(()=>new Set)),Te(this,U,new Set),Ce(this,`disposables`,E()),Ee(this,V,e),T.isServer&&this.disposables.microTask(()=>{this.dispose()})}dispose(){this.disposables.dispose()}get state(){return B(this,V)}subscribe(e,t){if(T.isServer)return()=>{};let n={selector:e,callback:t,current:e(B(this,V))};return B(this,U).add(n),this.disposables.add(()=>{B(this,U).delete(n)})}on(e,t){return T.isServer?()=>{}:(B(this,H).get(e).add(t),this.disposables.add(()=>{B(this,H).get(e).delete(t)}))}send(e){let t=this.reduce(B(this,V),e);if(t!==B(this,V)){Ee(this,V,t);for(let e of B(this,U)){let t=e.selector(B(this,V));Oe(e.current,t)||(e.current=t,e.callback(t))}for(let t of B(this,H).get(e.type))t(B(this,V),e)}}};V=new WeakMap,H=new WeakMap,U=new WeakMap;function Oe(e,t){return Object.is(e,t)?!0:typeof e!=`object`||!e||typeof t!=`object`||!t?!1:Array.isArray(e)&&Array.isArray(t)?e.length===t.length?ke(e[Symbol.iterator](),t[Symbol.iterator]()):!1:e instanceof Map&&t instanceof Map||e instanceof Set&&t instanceof Set?e.size===t.size?ke(e.entries(),t.entries()):!1:Ae(e)&&Ae(t)?ke(Object.entries(e)[Symbol.iterator](),Object.entries(t)[Symbol.iterator]()):!1}function ke(e,t){do{let n=e.next(),r=t.next();if(n.done&&r.done)return!0;if(n.done||r.done||!Object.is(n.value,r.value))return!1}while(!0)}function Ae(e){if(Object.prototype.toString.call(e)!==`[object Object]`)return!1;let t=Object.getPrototypeOf(e);return t===null||Object.getPrototypeOf(t)===null}var je=Object.defineProperty,Me=(e,t,n)=>t in e?je(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Ne=(e,t,n)=>(Me(e,typeof t==`symbol`?t:t+``,n),n),Pe=(e=>(e[e.Push=0]=`Push`,e[e.Pop=1]=`Pop`,e))(Pe||{}),Fe={0(e,t){let n=t.id,r=e.stack,i=e.stack.indexOf(n);if(i!==-1){let t=e.stack.slice();return t.splice(i,1),t.push(n),r=t,{...e,stack:r}}return{...e,stack:[...e.stack,n]}},1(e,t){let n=t.id,r=e.stack.indexOf(n);if(r===-1)return e;let i=e.stack.slice();return i.splice(r,1),{...e,stack:i}}},Ie=class e extends De{constructor(){super(...arguments),Ne(this,`actions`,{push:e=>this.send({type:0,id:e}),pop:e=>this.send({type:1,id:e})}),Ne(this,`selectors`,{isTop:(e,t)=>e.stack[e.stack.length-1]===t,inStack:(e,t)=>e.stack.includes(t)})}static new(){return new e({stack:[]})}reduce(e,t){return _(t.type,Fe,e,t)}},Le=new be(()=>Ie.new()),Re=a((e=>{var n=t();function r(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var i=typeof Object.is==`function`?Object.is:r,a=n.useSyncExternalStore,o=n.useRef,s=n.useEffect,c=n.useMemo,l=n.useDebugValue;e.useSyncExternalStoreWithSelector=function(e,t,n,r,u){var d=o(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=c(function(){function e(e){if(!a){if(a=!0,o=e,e=r(e),u!==void 0&&f.hasValue){var t=f.value;if(u(t,e))return s=t}return s=e}if(t=s,i(o,e))return t;var n=r(e);return u!==void 0&&u(t,n)?(o=e,t):(o=e,s=n)}var a=!1,o,s,c=n===void 0?null:n;return[function(){return e(t())},c===null?void 0:function(){return e(c())}]},[t,n,r,u]);var p=a(e,d[0],d[1]);return s(function(){f.hasValue=!0,f.value=p},[p]),l(p),p}})),ze=a(((e,t)=>{t.exports=Re()}))();function Be(e,t,n=Oe){return(0,ze.useSyncExternalStoreWithSelector)(h(t=>e.subscribe(Ve,t)),h(()=>e.state),h(()=>e.state),h(t),n)}function Ve(e){return e}function W(e,t){let n=(0,j.useId)(),r=Le.get(t),[i,a]=Be(r,(0,j.useCallback)(e=>[r.selectors.isTop(e,n),r.selectors.inStack(e,n)],[r,n]));return c(()=>{if(e)return r.actions.push(n),()=>r.actions.pop(n)},[r,e,n]),e?a?i:!0:!1}var He=new Map,G=new Map;function Ue(e){let t=G.get(e)??0;return G.set(e,t+1),t===0?(He.set(e,{"aria-hidden":e.getAttribute(`aria-hidden`),inert:e.inert}),e.setAttribute(`aria-hidden`,`true`),e.inert=!0,()=>We(e)):()=>We(e)}function We(e){let t=G.get(e)??1;if(t===1?G.delete(e):G.set(e,t-1),t!==1)return;let n=He.get(e);n&&(n[`aria-hidden`]===null?e.removeAttribute(`aria-hidden`):e.setAttribute(`aria-hidden`,n[`aria-hidden`]),e.inert=n.inert,He.delete(e))}function Ge(e,{allowed:t,disallowed:n}={}){let r=W(e,`inert-others`);c(()=>{if(!r)return;let e=E();for(let t of n?.()??[])t&&e.add(Ue(t));let i=t?.()??[];for(let t of i){if(!t)continue;let n=k(t);if(!n)continue;let r=t.parentElement;for(;r&&r!==n.body;){for(let t of r.children)i.some(e=>t.contains(e))||e.add(Ue(t));r=r.parentElement}}return e.dispose},[r,t,n])}function Ke(e,t,n){let r=m(e=>{let t=e.getBoundingClientRect();t.x===0&&t.y===0&&t.width===0&&t.height===0&&n()});(0,j.useEffect)(()=>{if(!e)return;let n=t===null?null:L(t)?t:t.current;if(!n)return;let i=E();if(typeof ResizeObserver<`u`){let e=new ResizeObserver(()=>r.current(n));e.observe(n),i.add(()=>e.disconnect())}if(typeof IntersectionObserver<`u`){let e=new IntersectionObserver(()=>r.current(n));e.observe(n),i.add(()=>e.disconnect())}return()=>i.dispose()},[t,r,e])}var K=[`[contentEditable=true]`,`[tabindex]`,`a[href]`,`area[href]`,`button:not([disabled])`,`iframe`,`input:not([disabled])`,`select:not([disabled])`,`details>summary`,`textarea:not([disabled])`].map(e=>`${e}:not([tabindex='-1'])`).join(`,`),qe=[`[data-autofocus]`].map(e=>`${e}:not([tabindex='-1'])`).join(`,`),q=(e=>(e[e.First=1]=`First`,e[e.Previous=2]=`Previous`,e[e.Next=4]=`Next`,e[e.Last=8]=`Last`,e[e.WrapAround=16]=`WrapAround`,e[e.NoScroll=32]=`NoScroll`,e[e.AutoFocus=64]=`AutoFocus`,e))(q||{}),Je=(e=>(e[e.Error=0]=`Error`,e[e.Overflow=1]=`Overflow`,e[e.Success=2]=`Success`,e[e.Underflow=3]=`Underflow`,e))(Je||{}),Ye=(e=>(e[e.Previous=-1]=`Previous`,e[e.Next=1]=`Next`,e))(Ye||{});function Xe(e=document.body){return e==null?[]:Array.from(e.querySelectorAll(K)).sort((e,t)=>Math.sign((e.tabIndex||2**53-1)-(t.tabIndex||2**53-1)))}function Ze(e=document.body){return e==null?[]:Array.from(e.querySelectorAll(qe)).sort((e,t)=>Math.sign((e.tabIndex||2**53-1)-(t.tabIndex||2**53-1)))}var Qe=(e=>(e[e.Strict=0]=`Strict`,e[e.Loose=1]=`Loose`,e))(Qe||{});function $e(e,t=0){return e===k(e)?.body?!1:_(t,{0(){return e.matches(K)},1(){let t=e;for(;t!==null;){if(t.matches(K))return!0;t=t.parentElement}return!1}})}var et=(e=>(e[e.Keyboard=0]=`Keyboard`,e[e.Mouse=1]=`Mouse`,e))(et||{});typeof window<`u`&&typeof document<`u`&&(document.addEventListener(`keydown`,e=>{e.metaKey||e.altKey||e.ctrlKey||(document.documentElement.dataset.headlessuiFocusVisible=``)},!0),document.addEventListener(`click`,e=>{e.detail===1?delete document.documentElement.dataset.headlessuiFocusVisible:e.detail===0&&(document.documentElement.dataset.headlessuiFocusVisible=``)},!0));function J(e){e?.focus({preventScroll:!0})}var tt=[`textarea`,`input`].join(`,`);function nt(e){return(e?.matches)?.call(e,tt)??!1}function rt(e,t=e=>e){return e.slice().sort((e,n)=>{let r=t(e),i=t(n);if(r===null||i===null)return 0;let a=r.compareDocumentPosition(i);return a&Node.DOCUMENT_POSITION_FOLLOWING?-1:a&Node.DOCUMENT_POSITION_PRECEDING?1:0})}function Y(e,t,{sorted:n=!0,relativeTo:r=null,skipElements:i=[]}={}){let a=Array.isArray(e)?e.length>0?A(e[0]):document:A(e),o=Array.isArray(e)?n?rt(e):e:t&64?Ze(e):Xe(e);i.length>0&&o.length>1&&(o=o.filter(e=>!i.some(t=>t!=null&&`current`in t?t?.current===e:t===e))),r??=a?.activeElement;let s=(()=>{if(t&5)return 1;if(t&10)return-1;throw Error(`Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last`)})(),c=(()=>{if(t&1)return 0;if(t&2)return Math.max(0,o.indexOf(r))-1;if(t&4)return Math.max(0,o.indexOf(r))+1;if(t&8)return o.length-1;throw Error(`Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last`)})(),l=t&32?{preventScroll:!0}:{},u=0,d=o.length,f;do{if(u>=d||u+d<=0)return 0;let e=c+u;if(t&16)e=(e+d)%d;else{if(e<0)return 3;if(e>=d)return 1}f=o[e],f?.focus(l),u+=s}while(f!==ne(f));return t&6&&nt(f)&&f.select(),2}function it(){return/iPhone/gi.test(window.navigator.platform)||/Mac/gi.test(window.navigator.platform)&&window.navigator.maxTouchPoints>0}function at(){return/Android/gi.test(window.navigator.userAgent)}function ot(){return it()||at()}function st(e,t,n,r){let i=m(n);(0,j.useEffect)(()=>{if(!e)return;function n(e){i.current(e)}return document.addEventListener(t,n,r),()=>document.removeEventListener(t,n,r)},[e,t,r])}function ct(e,t,n,r){let i=m(n);(0,j.useEffect)(()=>{if(!e)return;function n(e){i.current(e)}return window.addEventListener(t,n,r),()=>window.removeEventListener(t,n,r)},[e,t,r])}var lt=30;function ut(e,t,n){let r=m(n),i=(0,j.useCallback)(function(e,n){if(e.defaultPrevented)return;let i=n(e);if(i===null||!i.getRootNode().contains(i)||!i.isConnected)return;let a=function e(t){return typeof t==`function`?e(t()):Array.isArray(t)||t instanceof Set?t:[t]}(t);for(let t of a)if(t!==null&&(t.contains(i)||e.composed&&e.composedPath().includes(t)))return;return!$e(i,Qe.Loose)&&i.tabIndex!==-1&&e.preventDefault(),r.current(e,i)},[r,t]),a=(0,j.useRef)(null);st(e,`pointerdown`,e=>{ot()||(a.current=e.composedPath?.call(e)?.[0]||e.target)},!0),st(e,`pointerup`,e=>{if(ot()||!a.current)return;let t=a.current;return a.current=null,i(e,()=>t)},!0);let o=(0,j.useRef)({x:0,y:0});st(e,`touchstart`,e=>{o.current.x=e.touches[0].clientX,o.current.y=e.touches[0].clientY},!0),st(e,`touchend`,e=>{let t={x:e.changedTouches[0].clientX,y:e.changedTouches[0].clientY};if(!(Math.abs(t.x-o.current.x)>=lt||Math.abs(t.y-o.current.y)>=lt))return i(e,()=>R(e.target)?e.target:null)},!0),ct(e,`blur`,e=>i(e,()=>ce(window.document.activeElement)?window.document.activeElement:null),!0)}function dt(...e){return(0,j.useMemo)(()=>k(...e),[...e])}function ft(e,t,n,r){let i=m(n);(0,j.useEffect)(()=>{e??=window;function n(e){i.current(e)}return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)},[e,t,r])}function pt(e){return(0,j.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getSnapshot)}function mt(e,t){let n=e(),r=new Set;return{getSnapshot(){return n},subscribe(e){return r.add(e),()=>r.delete(e)},dispatch(e,...i){let a=t[e].call(n,...i);a&&(n=a,r.forEach(e=>e()))}}}function ht(){let e;return{before({doc:t}){let n=t.documentElement,r=t.defaultView??window;e=Math.max(0,r.innerWidth-n.clientWidth)},after({doc:t,d:n}){let r=t.documentElement,i=Math.max(0,r.clientWidth-r.offsetWidth),a=Math.max(0,e-i);n.style(r,`paddingRight`,`${a}px`)}}}function gt(){return it()?{before({doc:e,d:t,meta:n}){function r(e){for(let t of n().containers)for(let n of t())if(n.contains(e))return!0;return!1}t.microTask(()=>{if(window.getComputedStyle(e.documentElement).scrollBehavior!==`auto`){let n=E();n.style(e.documentElement,`scrollBehavior`,`auto`),t.add(()=>t.microTask(()=>n.dispose()))}let n=window.scrollY??window.pageYOffset,i=null;t.addEventListener(e,`click`,t=>{if(R(t.target))try{let n=t.target.closest(`a`);if(!n)return;let{hash:a}=new URL(n.href),o=e.querySelector(a);R(o)&&!r(o)&&(i=o)}catch{}},!0),t.group(n=>{t.addEventListener(e,`touchstart`,e=>{if(n.dispose(),R(e.target)&&z(e.target))if(r(e.target)){let t=e.target;for(;t.parentElement&&r(t.parentElement);)t=t.parentElement;n.style(t,`overscrollBehavior`,`contain`)}else n.style(e.target,`touchAction`,`none`)})}),t.addEventListener(e,`touchmove`,e=>{if(R(e.target)){if(le(e.target))return;if(r(e.target)){let t=e.target;for(;t.parentElement&&t.dataset.headlessuiPortal!==``&&!(t.scrollHeight>t.clientHeight||t.scrollWidth>t.clientWidth);)t=t.parentElement;t.dataset.headlessuiPortal===``&&e.preventDefault()}else e.preventDefault()}},{passive:!1}),t.add(()=>{n!==(window.scrollY??window.pageYOffset)&&window.scrollTo(0,n),i&&i.isConnected&&(i.scrollIntoView({block:`nearest`}),i=null)})})}}:{}}function _t(){return{before({doc:e,d:t}){t.style(e.documentElement,`overflow`,`hidden`)}}}function vt(e){let t={};for(let n of e)Object.assign(t,n(t));return t}var X=mt(()=>new Map,{PUSH(e,t){let n=this.get(e)??{doc:e,count:0,d:E(),meta:new Set,computedMeta:{}};return n.count++,n.meta.add(t),n.computedMeta=vt(n.meta),this.set(e,n),this},POP(e,t){let n=this.get(e);return n&&(n.count--,n.meta.delete(t),n.computedMeta=vt(n.meta)),this},SCROLL_PREVENT(e){let t={doc:e.doc,d:e.d,meta(){return e.computedMeta}},n=[gt(),ht(),_t()];n.forEach(({before:e})=>e?.(t)),n.forEach(({after:e})=>e?.(t))},SCROLL_ALLOW({d:e}){e.dispose()},TEARDOWN({doc:e}){this.delete(e)}});X.subscribe(()=>{let e=X.getSnapshot(),t=new Map;for(let[n]of e)t.set(n,n.documentElement.style.overflow);for(let n of e.values()){let e=t.get(n.doc)===`hidden`,r=n.count!==0;(r&&!e||!r&&e)&&X.dispatch(n.count>0?`SCROLL_PREVENT`:`SCROLL_ALLOW`,n),n.count===0&&X.dispatch(`TEARDOWN`,n)}});function yt(e,t,n=()=>({containers:[]})){let r=pt(X),i=t?r.get(t):void 0,a=i?i.count>0:!1;return c(()=>{if(!(!t||!e))return X.dispatch(`PUSH`,t,n),()=>X.dispatch(`POP`,t,n)},[e,t]),a}function bt(e,t,n=()=>[document.body]){yt(W(e,`scroll-lock`),t,e=>({containers:[...e.containers??[],n]}))}function xt(e,t){let n=(0,j.useRef)([]),r=h(e);(0,j.useEffect)(()=>{let e=[...n.current];for(let[i,a]of t.entries())if(n.current[i]!==a){let i=r(t,e);return n.current=t,i}},[r,...t])}function St(e){function t(){document.readyState!==`loading`&&(e(),document.removeEventListener(`DOMContentLoaded`,t))}typeof window<`u`&&typeof document<`u`&&(document.addEventListener(`DOMContentLoaded`,t),t())}var Z=[];St(()=>{function e(e){if(!R(e.target)||e.target===document.body||Z[0]===e.target)return;let t=e.target;t=t.closest(K),Z.unshift(t??e.target),Z=Z.filter(e=>e!=null&&e.isConnected),Z.splice(10)}window.addEventListener(`click`,e,{capture:!0}),window.addEventListener(`mousedown`,e,{capture:!0}),window.addEventListener(`focus`,e,{capture:!0}),document.body.addEventListener(`click`,e,{capture:!0}),document.body.addEventListener(`mousedown`,e,{capture:!0}),document.body.addEventListener(`focus`,e,{capture:!0})});function Ct(e){let t=h(e),n=(0,j.useRef)(!1);(0,j.useEffect)(()=>(n.current=!1,()=>{n.current=!0,u(()=>{n.current&&t()})}),[t])}var wt=(0,j.createContext)(!1);function Tt(){return(0,j.useContext)(wt)}function Et(e){return j.createElement(wt.Provider,{value:e.force},e.children)}var Dt=n(r(),1);function Ot(e){let t=Tt(),n=(0,j.useContext)(Nt),[r,i]=(0,j.useState)(()=>{if(!t&&n!==null)return n.current??null;if(T.isServer)return null;let r=e?.getElementById(`headlessui-portal-root`);if(r)return r;if(e===null)return null;let i=e.createElement(`div`);return i.setAttribute(`id`,`headlessui-portal-root`),e.body.appendChild(i)});return(0,j.useEffect)(()=>{r!==null&&(e!=null&&e.body.contains(r)||e==null||e.body.appendChild(r))},[r,e]),(0,j.useEffect)(()=>{t||n!==null&&i(n.current)},[n,i,t]),r}var kt=j.Fragment,At=b(function(e,t){let{ownerDocument:n=null,...r}=e,i=(0,j.useRef)(null),a=C(ee(e=>{i.current=e}),t),o=dt(i.current),s=Ot(n??o),c=(0,j.useContext)(Ft),u=w(),d=l(),f=p();return Ct(()=>{var e;s&&s.childNodes.length<=0&&((e=s.parentElement)==null||e.removeChild(s))}),!s||!d?null:(0,Dt.createPortal)(j.createElement(`div`,{"data-headlessui-portal":``,ref:e=>{u.dispose(),c&&e&&u.add(c.register(e))}},f({ourProps:{ref:a},theirProps:r,slot:{},defaultTag:kt,name:`Portal`})),s)});function jt(e,t){let n=C(t),{enabled:r=!0,ownerDocument:i,...a}=e,o=p();return r?j.createElement(At,{...a,ownerDocument:i,ref:n}):o({ourProps:{ref:n},theirProps:a,slot:{},defaultTag:kt,name:`Portal`})}var Mt=j.Fragment,Nt=(0,j.createContext)(null);function Pt(e,t){let{target:n,...r}=e,i={ref:C(t)},a=p();return j.createElement(Nt.Provider,{value:n},a({ourProps:i,theirProps:r,defaultTag:Mt,name:`Popover.Group`}))}var Ft=(0,j.createContext)(null);function It(){let e=(0,j.useContext)(Ft),t=(0,j.useRef)([]),n=h(n=>(t.current.push(n),e&&e.register(n),()=>r(n))),r=h(n=>{let r=t.current.indexOf(n);r!==-1&&t.current.splice(r,1),e&&e.unregister(n)}),i=(0,j.useMemo)(()=>({register:n,unregister:r,portals:t}),[n,r,t]);return[t,(0,j.useMemo)(()=>function({children:e}){return j.createElement(Ft.Provider,{value:i},e)},[i])]}var Lt=b(jt),Rt=b(Pt),zt=Object.assign(Lt,{Group:Rt});function Bt(e,t=typeof document<`u`?document.defaultView:null,n){let r=W(e,`escape`);ft(t,`keydown`,e=>{r&&(e.defaultPrevented||e.key===_e.Escape&&n(e))})}function Vt(){let[e]=(0,j.useState)(()=>typeof window<`u`&&typeof window.matchMedia==`function`?window.matchMedia(`(pointer: coarse)`):null),[t,n]=(0,j.useState)(e?.matches??!1);return c(()=>{if(!e)return;function t(e){n(e.matches)}return e.addEventListener(`change`,t),()=>e.removeEventListener(`change`,t)},[e]),t}function Ht({defaultContainers:e=[],portals:t,mainTreeNode:n}={}){let r=h(()=>{let r=k(n),i=[];for(let t of e)t!==null&&(I(t)?i.push(t):`current`in t&&I(t.current)&&i.push(t.current));if(t!=null&&t.current)for(let e of t.current)i.push(e);for(let e of r?.querySelectorAll(`html > *, body > *`)??[])e!==document.body&&e!==document.head&&I(e)&&e.id!==`headlessui-portal-root`&&(n&&(e.contains(n)||e.contains(n?.getRootNode()?.host))||i.some(t=>e.contains(t))||i.push(e));return i});return{resolveContainers:r,contains:h(e=>r().some(t=>t.contains(e)))}}var Ut=(0,j.createContext)(null);function Wt({children:e,node:t}){let[n,r]=(0,j.useState)(null),i=Gt(t??n);return j.createElement(Ut.Provider,{value:i},e,i===null&&j.createElement(oe,{features:F.Hidden,ref:e=>{if(e){for(let t of k(e)?.querySelectorAll(`html > *, body > *`)??[])if(t!==document.body&&t!==document.head&&I(t)&&t!=null&&t.contains(e)){r(t);break}}}}))}function Gt(e=null){return(0,j.useContext)(Ut)??e}var Q=(e=>(e[e.Forwards=0]=`Forwards`,e[e.Backwards=1]=`Backwards`,e))(Q||{});function Kt(){let e=(0,j.useRef)(0);return ct(!0,`keydown`,t=>{t.key===`Tab`&&(e.current=+!!t.shiftKey)},!0),e}function qt(e){if(!e)return new Set;if(typeof e==`function`)return new Set(e());let t=new Set;for(let n of e.current)I(n.current)&&t.add(n.current);return t}var Jt=`div`,$=(e=>(e[e.None=0]=`None`,e[e.InitialFocus=1]=`InitialFocus`,e[e.TabLock=2]=`TabLock`,e[e.FocusLock=4]=`FocusLock`,e[e.RestoreFocus=8]=`RestoreFocus`,e[e.AutoFocus=16]=`AutoFocus`,e))($||{});function Yt(e,t){let n=(0,j.useRef)(null),r=C(n,t),{initialFocus:i,initialFocusFallback:a,containers:o,features:s=15,...c}=e;l()||(s=0);let u=dt(n.current);$t(s,{ownerDocument:u});let d=en(s,{ownerDocument:u,container:n,initialFocus:i,initialFocusFallback:a});tn(s,{ownerDocument:u,container:n,containers:o,previousActiveElement:d});let f=Kt(),m=h(e=>{if(!L(n.current))return;let t=n.current;(e=>e())(()=>{_(f.current,{[Q.Forwards]:()=>{Y(t,q.First,{skipElements:[e.relatedTarget,a]})},[Q.Backwards]:()=>{Y(t,q.Last,{skipElements:[e.relatedTarget,a]})}})})}),g=W(!!(s&2),`focus-trap#tab-lock`),ee=w(),v=(0,j.useRef)(!1),y={ref:r,onKeyDown(e){e.key==`Tab`&&(v.current=!0,ee.requestAnimationFrame(()=>{v.current=!1}))},onBlur(e){if(!(s&4))return;let t=qt(o);L(n.current)&&t.add(n.current);let r=e.relatedTarget;R(r)&&r.dataset.headlessuiFocusGuard!==`true`&&(nn(t,r)||(v.current?Y(n.current,_(f.current,{[Q.Forwards]:()=>q.Next,[Q.Backwards]:()=>q.Previous})|q.WrapAround,{relativeTo:e.target}):R(e.target)&&J(e.target)))}},b=p();return j.createElement(j.Fragment,null,g&&j.createElement(oe,{as:`button`,type:`button`,"data-headlessui-focus-guard":!0,onFocus:m,features:F.Focusable}),b({ourProps:y,theirProps:c,defaultTag:Jt,name:`FocusTrap`}),g&&j.createElement(oe,{as:`button`,type:`button`,"data-headlessui-focus-guard":!0,onFocus:m,features:F.Focusable}))}var Xt=b(Yt),Zt=Object.assign(Xt,{features:$});function Qt(e=!0){let t=(0,j.useRef)(Z.slice());return xt(([e],[n])=>{n===!0&&e===!1&&u(()=>{t.current.splice(0)}),n===!1&&e===!0&&(t.current=Z.slice())},[e,Z,t]),h(()=>t.current.find(e=>e!=null&&e.isConnected)??null)}function $t(e,{ownerDocument:t}){let n=!!(e&8),r=Qt(n);xt(()=>{n||re(t?.body)&&J(r())},[n]),Ct(()=>{n&&J(r())})}function en(e,{ownerDocument:t,container:n,initialFocus:r,initialFocusFallback:i}){let a=(0,j.useRef)(null),o=W(!!(e&1),`focus-trap#initial-focus`),s=g();return xt(()=>{if(e===0)return;if(!o){i!=null&&i.current&&J(i.current);return}let c=n.current;c&&u(()=>{if(!s.current)return;let n=t?.activeElement;if(r!=null&&r.current){if(r?.current===n){a.current=n;return}}else if(c.contains(n)){a.current=n;return}if(r!=null&&r.current)J(r.current);else{if(e&16){if(Y(c,q.First|q.AutoFocus)!==Je.Error)return}else if(Y(c,q.First)!==Je.Error)return;if(i!=null&&i.current&&(J(i.current),t?.activeElement===i.current))return;console.warn(`There are no focusable elements inside the `)}a.current=t?.activeElement})},[i,o,e]),a}function tn(e,{ownerDocument:t,container:n,containers:r,previousActiveElement:i}){let a=g(),o=!!(e&4);ft(t?.defaultView,`focus`,e=>{if(!o||!a.current)return;let t=qt(r);L(n.current)&&t.add(n.current);let s=i.current;if(!s)return;let c=e.target;L(c)?nn(t,c)?(i.current=c,J(c)):(e.preventDefault(),e.stopPropagation(),J(s)):J(i.current)},!0)}function nn(e,t){for(let n of e)if(n.contains(t))return!0;return!1}var rn=(e=>(e[e.Open=0]=`Open`,e[e.Closed=1]=`Closed`,e))(rn||{}),an=(e=>(e[e.SetTitleId=0]=`SetTitleId`,e))(an||{}),on={0(e,t){return e.titleId===t.id?e:{...e,titleId:t.id}}},sn=(0,j.createContext)(null);sn.displayName=`DialogContext`;function cn(e){let t=(0,j.useContext)(sn);if(t===null){let t=Error(`<${e} /> is missing a parent component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,cn),t}return t}function ln(e,t){return _(t.type,on,e,t)}var un=b(function(e,t){let n=(0,j.useId)(),{id:r=`headlessui-dialog-${n}`,open:i,onClose:a,initialFocus:o,role:s=`dialog`,autoFocus:u=!0,__demoMode:f=!1,unmount:m=!1,...g}=e,ee=(0,j.useRef)(!1);s=function(){return s===`dialog`||s===`alertdialog`?s:(ee.current||(ee.current=!0,console.warn(`Invalid role [${s}] passed to . Only \`dialog\` and and \`alertdialog\` are supported. Using \`dialog\` instead.`)),`dialog`)}();let _=d();i===void 0&&_!==null&&(i=(_&y.Open)===y.Open);let v=(0,j.useRef)(null),b=C(v,t),x=dt(v.current),S=+!i,[w,T]=(0,j.useReducer)(ln,{titleId:null,descriptionId:null,panelRef:(0,j.createRef)()}),E=h(()=>a(!1)),D=h(e=>T({type:0,id:e})),O=l()?S===0:!1,[k,A]=It(),ne={get current(){return w.panelRef.current??v.current}},re=Gt(),{resolveContainers:N}=Ht({mainTreeNode:re,portals:k,defaultContainers:[ne]}),ie=_===null?!1:(_&y.Closing)===y.Closing;Ge(f||ie?!1:O,{allowed:h(()=>[v.current?.closest(`[data-headlessui-portal]`)??null]),disallowed:h(()=>[re?.closest(`body > *:not(#headlessui-portal-root)`)??null])});let P=Le.get(null);c(()=>{if(O)return P.actions.push(r),()=>P.actions.pop(r)},[P,r,O]);let F=Be(P,(0,j.useCallback)(e=>P.selectors.isTop(e,r),[P,r]));ut(F,N,e=>{e.preventDefault(),E()}),Bt(F,x?.defaultView,e=>{e.preventDefault(),e.stopPropagation(),document.activeElement&&`blur`in document.activeElement&&typeof document.activeElement.blur==`function`&&document.activeElement.blur(),E()}),bt(f||ie?!1:O,x,N),Ke(O,v,E);let[ae,oe]=fe(),se=(0,j.useMemo)(()=>[{dialogState:S,close:E,setTitleId:D,unmount:m},w],[S,E,D,m,w]),I=M({open:S===0}),L={ref:b,id:r,role:s,tabIndex:-1,"aria-modal":f?void 0:S===0?!0:void 0,"aria-labelledby":w.titleId,"aria-describedby":ae,unmount:m},R=!Vt(),z=$.None;O&&!f&&(z|=$.RestoreFocus,z|=$.TabLock,u&&(z|=$.AutoFocus),R&&(z|=$.InitialFocus));let ce=p();return j.createElement(te,null,j.createElement(Et,{force:!0},j.createElement(zt,null,j.createElement(sn.Provider,{value:se},j.createElement(Rt,{target:v},j.createElement(Et,{force:!1},j.createElement(oe,{slot:I},j.createElement(A,null,j.createElement(Zt,{initialFocus:o,initialFocusFallback:v,containers:N,features:z},j.createElement(ye,{value:E},ce({ourProps:L,theirProps:g,slot:I,defaultTag:dn,features:fn,visible:S===0,name:`Dialog`})))))))))))}),dn=`div`,fn=f.RenderStrategy|f.Static;function pn(e,t){let{transition:n=!1,open:r,...i}=e,a=d(),o=e.hasOwnProperty(`open`)||a!==null,s=e.hasOwnProperty(`onClose`);if(!o&&!s)throw Error("You have to provide an `open` and an `onClose` prop to the `Dialog` component.");if(!o)throw Error("You provided an `onClose` prop to the `Dialog`, but forgot an `open` prop.");if(!s)throw Error("You provided an `open` prop to the `Dialog`, but forgot an `onClose` prop.");if(!a&&typeof e.open!=`boolean`)throw Error(`You provided an \`open\` prop to the \`Dialog\`, but the value is not a boolean. Received: ${e.open}`);if(typeof e.onClose!=`function`)throw Error(`You provided an \`onClose\` prop to the \`Dialog\`, but the value is not a function. Received: ${e.onClose}`);return(r!==void 0||n)&&!i.static?j.createElement(Wt,null,j.createElement(v,{show:r,transition:n,unmount:i.unmount},j.createElement(un,{ref:t,...i}))):j.createElement(Wt,null,j.createElement(un,{ref:t,open:r,...i}))}var mn=`div`;function hn(e,t){let n=(0,j.useId)(),{id:r=`headlessui-dialog-panel-${n}`,transition:i=!1,...a}=e,[{dialogState:o,unmount:s},c]=cn(`Dialog.Panel`),l=C(t,c.panelRef),u=M({open:o===0}),d={ref:l,id:r,onClick:h(e=>{e.stopPropagation()})},f=i?x:j.Fragment,m=i?{unmount:s}:{},g=p();return j.createElement(f,{...m},g({ourProps:d,theirProps:a,slot:u,defaultTag:mn,name:`Dialog.Panel`}))}var gn=`div`;function _n(e,t){let{transition:n=!1,...r}=e,[{dialogState:i,unmount:a}]=cn(`Dialog.Backdrop`),o=M({open:i===0}),s={ref:t,"aria-hidden":!0},c=n?x:j.Fragment,l=n?{unmount:a}:{},u=p();return j.createElement(c,{...l},u({ourProps:s,theirProps:r,slot:o,defaultTag:gn,name:`Dialog.Backdrop`}))}var vn=`h2`;function yn(e,t){let n=(0,j.useId)(),{id:r=`headlessui-dialog-title-${n}`,...i}=e,[{dialogState:a,setTitleId:o}]=cn(`Dialog.Title`),s=C(t);(0,j.useEffect)(()=>(o(r),()=>o(null)),[r,o]);let c=M({open:a===0}),l={ref:s,id:r};return p()({ourProps:l,theirProps:i,slot:c,defaultTag:vn,name:`Dialog.Title`})}var bn=b(pn),xn=b(hn);b(_n);var Sn=b(yn),Cn=Object.assign(bn,{Panel:xn,Title:Sn,Description:ge});function wn({children:e,show:t=!1,maxWidth:n=`2xl`,closeable:r=!0,onClose:i=()=>{}}){let a=()=>{r&&i()},o={sm:`sm:max-w-sm`,md:`sm:max-w-md`,lg:`sm:max-w-lg`,xl:`sm:max-w-xl`,"2xl":`sm:max-w-2xl`}[n];return(0,D.jsx)(v,{show:t,leave:`duration-200`,children:(0,D.jsxs)(Cn,{as:`div`,id:`modal`,className:`fixed inset-0 z-50 flex transform items-center overflow-y-auto px-4 py-6 transition-all sm:px-0`,onClose:a,children:[(0,D.jsx)(x,{enter:`ease-out duration-300`,enterFrom:`opacity-0`,enterTo:`opacity-100`,leave:`ease-in duration-200`,leaveFrom:`opacity-100`,leaveTo:`opacity-0`,children:(0,D.jsx)(`div`,{className:`absolute inset-0 bg-gray-500/75`})}),(0,D.jsx)(x,{enter:`ease-out duration-300`,enterFrom:`opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95`,enterTo:`opacity-100 translate-y-0 sm:scale-100`,leave:`ease-in duration-200`,leaveFrom:`opacity-100 translate-y-0 sm:scale-100`,leaveTo:`opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95`,children:(0,D.jsx)(xn,{className:`mb-6 transform overflow-hidden rounded-lg bg-white shadow-xl transition-all sm:mx-auto sm:w-full ${o}`,children:e})})]})})}function Tn({type:e=`button`,className:t=``,disabled:n,children:r,...i}){return(0,D.jsx)(`button`,{...i,type:e,className:`inline-flex items-center rounded-xl border border-gray-200 bg-white px-4 py-2 text-sm font-bold tracking-tight text-[#3D4E4B] transition-all hover:bg-gray-50 hover:border-gray-300 focus:outline-none focus:ring-2 focus:ring-[#D4A017] focus:ring-offset-2 disabled:opacity-25 ${n&&`opacity-25`} `+t,disabled:n,children:r})}function En({className:t=``}){let[n,r]=(0,j.useState)(!1),i=(0,j.useRef)(),{data:a,setData:c,delete:l,processing:u,reset:d,errors:f,clearErrors:p}=e({password:``}),m=()=>{r(!0)},h=e=>{e.preventDefault(),l(route(`profile.destroy`),{preserveScroll:!0,onSuccess:()=>g(),onError:()=>i.current.focus(),onFinish:()=>d()})},g=()=>{r(!1),p(),d()};return(0,D.jsxs)(`section`,{className:`space-y-6 ${t}`,children:[(0,D.jsxs)(`header`,{children:[(0,D.jsx)(`h2`,{className:`text-lg font-medium text-gray-900`,children:`Delete Account`}),(0,D.jsx)(`p`,{className:`mt-1 text-sm text-gray-600`,children:`Once your account is deleted, all of its resources and data will be permanently deleted. Before deleting your account, please download any data or information that you wish to retain.`})]}),(0,D.jsx)(O,{onClick:m,children:`Delete Account`}),(0,D.jsx)(wn,{show:n,onClose:g,children:(0,D.jsxs)(`form`,{onSubmit:h,className:`p-6`,children:[(0,D.jsx)(`h2`,{className:`text-lg font-medium text-gray-900`,children:`Are you sure you want to delete your account?`}),(0,D.jsx)(`p`,{className:`mt-1 text-sm text-gray-600`,children:`Once your account is deleted, all of its resources and data will be permanently deleted. Please enter your password to confirm you would like to permanently delete your account.`}),(0,D.jsxs)(`div`,{className:`mt-6`,children:[(0,D.jsx)(s,{htmlFor:`password`,value:`Password`,className:`sr-only`}),(0,D.jsx)(S,{id:`password`,type:`password`,name:`password`,ref:i,value:a.password,onChange:e=>c(`password`,e.target.value),className:`mt-1 block w-3/4`,isFocused:!0,placeholder:`Password`}),(0,D.jsx)(o,{message:f.password,className:`mt-2`})]}),(0,D.jsxs)(`div`,{className:`mt-6 flex justify-end`,children:[(0,D.jsx)(Tn,{onClick:g,children:`Cancel`}),(0,D.jsx)(O,{className:`ms-3`,disabled:u,children:`Delete Account`})]})]})})]})}export{En as default};