diff --git a/assets/FileSaver.min-889a6210.js b/assets/FileSaver.min-566f6faf.js similarity index 97% rename from assets/FileSaver.min-889a6210.js rename to assets/FileSaver.min-566f6faf.js index 2fa5ef6710..868a62d1c2 100644 --- a/assets/FileSaver.min-889a6210.js +++ b/assets/FileSaver.min-566f6faf.js @@ -1 +1 @@ -import{aA as A,c as d}from"./index-f4a5abbc.js";function O(u,v){for(var l=0;lr[c]})}}}return Object.freeze(Object.defineProperty(u,Symbol.toStringTag,{value:"Module"}))}var E={exports:{}};(function(u,v){(function(l,r){r()})(d,function(){function l(e,t){return typeof t>"u"?t={autoBom:!1}:typeof t!="object"&&(t={autoBom:!t}),t.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.type)?new Blob(["\uFEFF",e],{type:e.type}):e}function r(e,t,i){var o=new XMLHttpRequest;o.open("GET",e),o.responseType="blob",o.onload=function(){p(o.response,t,i)},o.onerror=function(){},o.send()}function c(e){var t=new XMLHttpRequest;t.open("HEAD",e,!1);try{t.send()}catch{}return 200<=t.status&&299>=t.status}function s(e){try{e.dispatchEvent(new MouseEvent("click"))}catch{var t=document.createEvent("MouseEvents");t.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),e.dispatchEvent(t)}}var a=typeof window=="object"&&window.window===window?window:typeof self=="object"&&self.self===self?self:typeof d=="object"&&d.global===d?d:void 0,y=a.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),p=a.saveAs||(typeof window!="object"||window!==a?function(){}:"download"in HTMLAnchorElement.prototype&&!y?function(e,t,i){var o=a.URL||a.webkitURL,n=document.createElement("a");t=t||e.name||"download",n.download=t,n.rel="noopener",typeof e=="string"?(n.href=e,n.origin===location.origin?s(n):c(n.href)?r(e,t,i):s(n,n.target="_blank")):(n.href=o.createObjectURL(e),setTimeout(function(){o.revokeObjectURL(n.href)},4e4),setTimeout(function(){s(n)},0))}:"msSaveOrOpenBlob"in navigator?function(e,t,i){if(t=t||e.name||"download",typeof e!="string")navigator.msSaveOrOpenBlob(l(e,i),t);else if(c(e))r(e,t,i);else{var o=document.createElement("a");o.href=e,o.target="_blank",setTimeout(function(){s(o)})}}:function(e,t,i,o){if(o=o||open("","_blank"),o&&(o.document.title=o.document.body.innerText="downloading..."),typeof e=="string")return r(e,t,i);var n=e.type==="application/octet-stream",g=/constructor/i.test(a.HTMLElement)||a.safari,b=/CriOS\/[\d]+/.test(navigator.userAgent);if((b||n&&g||y)&&typeof FileReader<"u"){var m=new FileReader;m.onloadend=function(){var f=m.result;f=b?f:f.replace(/^data:[^;]*;/,"data:attachment/file;"),o?o.location.href=f:location=f,o=null},m.readAsDataURL(e)}else{var j=a.URL||a.webkitURL,w=j.createObjectURL(e);o?o.location=w:location.href=w,o=null,setTimeout(function(){j.revokeObjectURL(w)},4e4)}});a.saveAs=p.saveAs=p,u.exports=p})})(E);var h=E.exports;const L=A(h),S=O({__proto__:null,default:L},[h]);export{S as F}; +import{aA as A,c as d}from"./index-65239185.js";function O(u,v){for(var l=0;lr[c]})}}}return Object.freeze(Object.defineProperty(u,Symbol.toStringTag,{value:"Module"}))}var E={exports:{}};(function(u,v){(function(l,r){r()})(d,function(){function l(e,t){return typeof t>"u"?t={autoBom:!1}:typeof t!="object"&&(t={autoBom:!t}),t.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.type)?new Blob(["\uFEFF",e],{type:e.type}):e}function r(e,t,i){var o=new XMLHttpRequest;o.open("GET",e),o.responseType="blob",o.onload=function(){p(o.response,t,i)},o.onerror=function(){},o.send()}function c(e){var t=new XMLHttpRequest;t.open("HEAD",e,!1);try{t.send()}catch{}return 200<=t.status&&299>=t.status}function s(e){try{e.dispatchEvent(new MouseEvent("click"))}catch{var t=document.createEvent("MouseEvents");t.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),e.dispatchEvent(t)}}var a=typeof window=="object"&&window.window===window?window:typeof self=="object"&&self.self===self?self:typeof d=="object"&&d.global===d?d:void 0,y=a.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),p=a.saveAs||(typeof window!="object"||window!==a?function(){}:"download"in HTMLAnchorElement.prototype&&!y?function(e,t,i){var o=a.URL||a.webkitURL,n=document.createElement("a");t=t||e.name||"download",n.download=t,n.rel="noopener",typeof e=="string"?(n.href=e,n.origin===location.origin?s(n):c(n.href)?r(e,t,i):s(n,n.target="_blank")):(n.href=o.createObjectURL(e),setTimeout(function(){o.revokeObjectURL(n.href)},4e4),setTimeout(function(){s(n)},0))}:"msSaveOrOpenBlob"in navigator?function(e,t,i){if(t=t||e.name||"download",typeof e!="string")navigator.msSaveOrOpenBlob(l(e,i),t);else if(c(e))r(e,t,i);else{var o=document.createElement("a");o.href=e,o.target="_blank",setTimeout(function(){s(o)})}}:function(e,t,i,o){if(o=o||open("","_blank"),o&&(o.document.title=o.document.body.innerText="downloading..."),typeof e=="string")return r(e,t,i);var n=e.type==="application/octet-stream",g=/constructor/i.test(a.HTMLElement)||a.safari,b=/CriOS\/[\d]+/.test(navigator.userAgent);if((b||n&&g||y)&&typeof FileReader<"u"){var m=new FileReader;m.onloadend=function(){var f=m.result;f=b?f:f.replace(/^data:[^;]*;/,"data:attachment/file;"),o?o.location.href=f:location=f,o=null},m.readAsDataURL(e)}else{var j=a.URL||a.webkitURL,w=j.createObjectURL(e);o?o.location=w:location.href=w,o=null,setTimeout(function(){j.revokeObjectURL(w)},4e4)}});a.saveAs=p.saveAs=p,u.exports=p})})(E);var h=E.exports;const L=A(h),S=O({__proto__:null,default:L},[h]);export{S as F}; diff --git a/assets/dexie-export-import-5ca5144f.js b/assets/dexie-export-import-857980f3.js similarity index 99% rename from assets/dexie-export-import-5ca5144f.js rename to assets/dexie-export-import-857980f3.js index 5965e45eb6..36f19bb6f4 100644 --- a/assets/dexie-export-import-5ca5144f.js +++ b/assets/dexie-export-import-857980f3.js @@ -1,4 +1,4 @@ -import{aB as Ce}from"./index-f4a5abbc.js";/*! ***************************************************************************** +import{aB as Ce}from"./index-65239185.js";/*! ***************************************************************************** Copyright (c) Microsoft Corporation. Permission to use, copy, modify, and/or distribute this software for any diff --git a/assets/index-f4a5abbc.js b/assets/index-65239185.js similarity index 99% rename from assets/index-f4a5abbc.js rename to assets/index-65239185.js index aabf3cc110..be24bbb8bc 100644 --- a/assets/index-f4a5abbc.js +++ b/assets/index-65239185.js @@ -103,7 +103,7 @@ Error generating stack: `+o.message+` dark:!bg-gray-800 dark:text-gray-300 dark:shadow-lg dark:shadow-gray-700`,children:[L("div",{className:"flex gap-2",children:[y("img",{src:JX,alt:"alipay",className:" h-44 rounded shadow-lg shadow-gray-300 dark:shadow-gray-700"}),y("img",{src:QX,alt:"alipay",className:" h-44 rounded shadow-lg shadow-gray-300 dark:shadow-gray-700"})]}),L("span",{className:"mt-3 text-xs font-bold text-gray-500",children:[y(kQ,{className:"mb-[3px] mr-1 inline-block"}),"此贴纸非商品,仅用于感谢您的捐赠,不可用于任何商业用途"]})]})]}),IQ=""+new URL("redBook-code-376dffeb.jpg",import.meta.url).href;var NQ=Object.defineProperty,LQ=(e,t,r)=>t in e?NQ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,eb=(e,t,r)=>(LQ(e,typeof t!="symbol"?t+"":t,r),r);let MQ=class{constructor(){eb(this,"current",this.detect()),eb(this,"handoffState","pending"),eb(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"}},lo=new MQ,gt=(e,t)=>{lo.isServer?p.useEffect(e,t):p.useLayoutEffect(e,t)};function dr(e){let t=p.useRef(e);return gt(()=>{t.current=e},[e]),t}function tD(e,t){let[r,n]=p.useState(e),a=dr(e);return gt(()=>n(a.current),[a,n,...t]),r}function Cu(e){typeof queueMicrotask=="function"?queueMicrotask(e):Promise.resolve().then(e).catch(t=>setTimeout(()=>{throw t}))}function yo(){let e=[],t={addEventListener(r,n,a,o){return r.addEventListener(n,a,o),t.add(()=>r.removeEventListener(n,a,o))},requestAnimationFrame(...r){let n=requestAnimationFrame(...r);return t.add(()=>cancelAnimationFrame(n))},nextFrame(...r){return t.requestAnimationFrame(()=>t.requestAnimationFrame(...r))},setTimeout(...r){let n=setTimeout(...r);return t.add(()=>clearTimeout(n))},microTask(...r){let n={current:!0};return Cu(()=>{n.current&&r[0]()}),t.add(()=>{n.current=!1})},style(r,n,a){let o=r.style.getPropertyValue(n);return Object.assign(r.style,{[n]:a}),this.add(()=>{Object.assign(r.style,{[n]:o})})},group(r){let n=yo();return r(n),this.add(()=>n.dispose())},add(r){return e.push(r),()=>{let n=e.indexOf(r);if(n>=0)for(let a of e.splice(n,1))a()}},dispose(){for(let r of e.splice(0))r()}};return t}function ji(){let[e]=p.useState(yo);return p.useEffect(()=>()=>e.dispose(),[e]),e}let re=function(e){let t=dr(e);return Y.useCallback((...r)=>t.current(...r),[t])};function Tu(){let[e,t]=p.useState(lo.isHandoffComplete);return e&&lo.isHandoffComplete===!1&&t(!1),p.useEffect(()=>{e!==!0&&t(!0)},[e]),p.useEffect(()=>lo.handoff(),[]),e}var D3;let kt=(D3=Y.useId)!=null?D3:function(){let e=Tu(),[t,r]=Y.useState(e?()=>lo.nextId():null);return gt(()=>{t===null&&r(lo.nextId())},[t]),t!=null?""+t:void 0};function Re(e,t,...r){if(e in t){let a=t[e];return typeof a=="function"?a(...r):a}let n=new Error(`Tried to handle "${e}" but there is no handler defined. Only defined handlers are: ${Object.keys(t).map(a=>`"${a}"`).join(", ")}.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,Re),n}function Ah(e){return lo.isServer?null:e instanceof Node?e.ownerDocument:e!=null&&e.hasOwnProperty("current")&&e.current instanceof Node?e.current.ownerDocument:document}let o2=["[contentEditable=true]","[tabindex]","a[href]","area[href]","button:not([disabled])","iframe","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].map(e=>`${e}:not([tabindex='-1'])`).join(",");var et=(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))(et||{}),to=(e=>(e[e.Error=0]="Error",e[e.Overflow=1]="Overflow",e[e.Success=2]="Success",e[e.Underflow=3]="Underflow",e))(to||{}),DQ=(e=>(e[e.Previous=-1]="Previous",e[e.Next=1]="Next",e))(DQ||{});function F0(e=document.body){return e==null?[]:Array.from(e.querySelectorAll(o2)).sort((t,r)=>Math.sign((t.tabIndex||Number.MAX_SAFE_INTEGER)-(r.tabIndex||Number.MAX_SAFE_INTEGER)))}var B0=(e=>(e[e.Strict=0]="Strict",e[e.Loose=1]="Loose",e))(B0||{});function BE(e,t=0){var r;return e===((r=Ah(e))==null?void 0:r.body)?!1:Re(t,{[0](){return e.matches(o2)},[1](){let n=e;for(;n!==null;){if(n.matches(o2))return!0;n=n.parentElement}return!1}})}var jQ=(e=>(e[e.Keyboard=0]="Keyboard",e[e.Mouse=1]="Mouse",e))(jQ||{});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 Vs(e){e==null||e.focus({preventScroll:!0})}let FQ=["textarea","input"].join(",");function BQ(e){var t,r;return(r=(t=e==null?void 0:e.matches)==null?void 0:t.call(e,FQ))!=null?r:!1}function Ps(e,t=r=>r){return e.slice().sort((r,n)=>{let a=t(r),o=t(n);if(a===null||o===null)return 0;let i=a.compareDocumentPosition(o);return i&Node.DOCUMENT_POSITION_FOLLOWING?-1:i&Node.DOCUMENT_POSITION_PRECEDING?1:0})}function qt(e,t,{sorted:r=!0,relativeTo:n=null,skipElements:a=[]}={}){let o=Array.isArray(e)?e.length>0?e[0].ownerDocument:document:e.ownerDocument,i=Array.isArray(e)?r?Ps(e):e:F0(e);a.length>0&&i.length>1&&(i=i.filter(h=>!a.includes(h))),n=n??o.activeElement;let s=(()=>{if(t&5)return 1;if(t&10)return-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),l=(()=>{if(t&1)return 0;if(t&2)return Math.max(0,i.indexOf(n))-1;if(t&4)return Math.max(0,i.indexOf(n))+1;if(t&8)return i.length-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),u=t&32?{preventScroll:!0}:{},f=0,c=i.length,d;do{if(f>=c||f+c<=0)return 0;let h=l+f;if(t&16)h=(h+c)%c;else{if(h<0)return 3;if(h>=c)return 1}d=i[h],d==null||d.focus(u),f+=s}while(d!==o.activeElement);return t&6&&BQ(d)&&d.select(),2}function tb(e,t,r){let n=dr(t);p.useEffect(()=>{function a(o){n.current(o)}return document.addEventListener(e,a,r),()=>document.removeEventListener(e,a,r)},[e,r])}function UE(e,t,r=!0){let n=p.useRef(!1);p.useEffect(()=>{requestAnimationFrame(()=>{n.current=r})},[r]);function a(i,s){if(!n.current||i.defaultPrevented)return;let l=function f(c){return typeof c=="function"?f(c()):Array.isArray(c)||c instanceof Set?c:[c]}(e),u=s(i);if(u!==null&&u.getRootNode().contains(u)){for(let f of l){if(f===null)continue;let c=f instanceof HTMLElement?f:f.current;if(c!=null&&c.contains(u)||i.composed&&i.composedPath().includes(c))return}return!BE(u,B0.Loose)&&u.tabIndex!==-1&&i.preventDefault(),t(i,u)}}let o=p.useRef(null);tb("mousedown",i=>{var s,l;n.current&&(o.current=((l=(s=i.composedPath)==null?void 0:s.call(i))==null?void 0:l[0])||i.target)},!0),tb("click",i=>{o.current&&(a(i,()=>o.current),o.current=null)},!0),tb("blur",i=>a(i,()=>window.document.activeElement instanceof HTMLIFrameElement?window.document.activeElement:null),!0)}function j3(e){var t;if(e.type)return e.type;let r=(t=e.as)!=null?t:"button";if(typeof r=="string"&&r.toLowerCase()==="button")return"button"}function U0(e,t){let[r,n]=p.useState(()=>j3(e));return gt(()=>{n(j3(e))},[e.type,e.as]),gt(()=>{r||t.current&&t.current instanceof HTMLButtonElement&&!t.current.hasAttribute("type")&&n("button")},[r,t]),r}let rD=Symbol();function nD(e,t=!0){return Object.assign(e,{[rD]:t})}function We(...e){let t=p.useRef(e);p.useEffect(()=>{t.current=e},[e]);let r=re(n=>{for(let a of t.current)a!=null&&(typeof a=="function"?a(n):a.current=n)});return e.every(n=>n==null||(n==null?void 0:n[rD]))?void 0:r}function UQ(e){throw new Error("Unexpected object: "+e)}var Pr=(e=>(e[e.First=0]="First",e[e.Previous=1]="Previous",e[e.Next=2]="Next",e[e.Last=3]="Last",e[e.Specific=4]="Specific",e[e.Nothing=5]="Nothing",e))(Pr||{});function zQ(e,t){let r=t.resolveItems();if(r.length<=0)return null;let n=t.resolveActiveIndex(),a=n??-1,o=(()=>{switch(e.focus){case 0:return r.findIndex(i=>!t.resolveDisabled(i));case 1:{let i=r.slice().reverse().findIndex((s,l,u)=>a!==-1&&u.length-l-1>=a?!1:!t.resolveDisabled(s));return i===-1?i:r.length-1-i}case 2:return r.findIndex((i,s)=>s<=a?!1:!t.resolveDisabled(i));case 3:{let i=r.slice().reverse().findIndex(s=>!t.resolveDisabled(s));return i===-1?i:r.length-1-i}case 4:return r.findIndex(i=>t.resolveId(i)===e.id);case 5:return null;default:UQ(e)}})();return o===-1?n:o}function i2(...e){return e.filter(Boolean).join(" ")}var kn=(e=>(e[e.None=0]="None",e[e.RenderStrategy=1]="RenderStrategy",e[e.Static=2]="Static",e))(kn||{}),ro=(e=>(e[e.Unmount=0]="Unmount",e[e.Hidden=1]="Hidden",e))(ro||{});function Fe({ourProps:e,theirProps:t,slot:r,defaultTag:n,features:a,visible:o=!0,name:i}){let s=aD(t,e);if(o)return qp(s,r,n,i);let l=a??0;if(l&2){let{static:u=!1,...f}=s;if(u)return qp(f,r,n,i)}if(l&1){let{unmount:u=!0,...f}=s;return Re(u?0:1,{[0](){return null},[1](){return qp({...f,hidden:!0,style:{display:"none"}},r,n,i)}})}return qp(s,r,n,i)}function qp(e,t={},r,n){let{as:a=r,children:o,refName:i="ref",...s}=rb(e,["unmount","static"]),l=e.ref!==void 0?{[i]:e.ref}:{},u=typeof o=="function"?o(t):o;"className"in s&&s.className&&typeof s.className=="function"&&(s.className=s.className(t));let f={};if(t){let c=!1,d=[];for(let[h,g]of Object.entries(t))typeof g=="boolean"&&(c=!0),g===!0&&d.push(h);c&&(f["data-headlessui-state"]=d.join(" "))}if(a===p.Fragment&&Object.keys(wm(s)).length>0){if(!p.isValidElement(u)||Array.isArray(u)&&u.length>1)throw new Error(['Passing props on "Fragment"!',"",`The current component <${n} /> is rendering a "Fragment".`,"However we need to passthrough the following props:",Object.keys(s).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(` -`));let c=u.props,d=typeof(c==null?void 0:c.className)=="function"?(...g)=>i2(c==null?void 0:c.className(...g),s.className):i2(c==null?void 0:c.className,s.className),h=d?{className:d}:{};return p.cloneElement(u,Object.assign({},aD(u.props,wm(rb(s,["ref"]))),f,l,VQ(u.ref,l.ref),h))}return p.createElement(a,Object.assign({},rb(s,["ref"]),a!==p.Fragment&&l,a!==p.Fragment&&f),u)}function VQ(...e){return{ref:e.every(t=>t==null)?void 0:t=>{for(let r of e)r!=null&&(typeof r=="function"?r(t):r.current=t)}}}function aD(...e){if(e.length===0)return{};if(e.length===1)return e[0];let t={},r={};for(let n of e)for(let a in n)a.startsWith("on")&&typeof n[a]=="function"?(r[a]!=null||(r[a]=[]),r[a].push(n[a])):t[a]=n[a];if(t.disabled||t["aria-disabled"])return Object.assign(t,Object.fromEntries(Object.keys(r).map(n=>[n,void 0])));for(let n in r)Object.assign(t,{[n](a,...o){let i=r[n];for(let s of i){if((a instanceof Event||(a==null?void 0:a.nativeEvent)instanceof Event)&&a.defaultPrevented)return;s(a,...o)}}});return t}function Be(e){var t;return Object.assign(p.forwardRef(e),{displayName:(t=e.displayName)!=null?t:e.name})}function wm(e){let t=Object.assign({},e);for(let r in t)t[r]===void 0&&delete t[r];return t}function rb(e,t=[]){let r=Object.assign({},e);for(let n of t)n in r&&delete r[n];return r}function Rh(e){let t=e.parentElement,r=null;for(;t&&!(t instanceof HTMLFieldSetElement);)t instanceof HTMLLegendElement&&(r=t),t=t.parentElement;let n=(t==null?void 0:t.getAttribute("disabled"))==="";return n&&WQ(r)?!1:n}function WQ(e){if(!e)return!1;let t=e.previousElementSibling;for(;t!==null;){if(t instanceof HTMLLegendElement)return!1;t=t.previousElementSibling}return!0}function oD(e={},t=null,r=[]){for(let[n,a]of Object.entries(e))sD(r,iD(t,n),a);return r}function iD(e,t){return e?e+"["+t+"]":t}function sD(e,t,r){if(Array.isArray(r))for(let[n,a]of r.entries())sD(e,iD(t,n.toString()),a);else r instanceof Date?e.push([t,r.toISOString()]):typeof r=="boolean"?e.push([t,r?"1":"0"]):typeof r=="string"?e.push([t,r]):typeof r=="number"?e.push([t,`${r}`]):r==null?e.push([t,""]):oD(r,t,e)}function HQ(e){var t;let r=(t=e==null?void 0:e.form)!=null?t:e.closest("form");if(r){for(let n of r.elements)if(n.tagName==="INPUT"&&n.type==="submit"||n.tagName==="BUTTON"&&n.type==="submit"||n.nodeName==="INPUT"&&n.type==="image"){n.click();return}}}let GQ="div";var Ea=(e=>(e[e.None=1]="None",e[e.Focusable=2]="Focusable",e[e.Hidden=4]="Hidden",e))(Ea||{});function KQ(e,t){let{features:r=1,...n}=e,a={ref:t,"aria-hidden":(r&2)===2?!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 Fe({ourProps:a,theirProps:n,slot:{},defaultTag:GQ,name:"Hidden"})}let Ca=Be(KQ),zE=p.createContext(null);zE.displayName="OpenClosedContext";var ut=(e=>(e[e.Open=1]="Open",e[e.Closed=2]="Closed",e[e.Closing=4]="Closing",e[e.Opening=8]="Opening",e))(ut||{});function Au(){return p.useContext(zE)}function VE({value:e,children:t}){return Y.createElement(zE.Provider,{value:e},t)}var ye=(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))(ye||{});function lD(e,t,r){let[n,a]=p.useState(r),o=e!==void 0,i=p.useRef(o),s=p.useRef(!1),l=p.useRef(!1);return o&&!i.current&&!s.current?(s.current=!0,i.current=o):!o&&i.current&&!l.current&&(l.current=!0,i.current=o),[o?e:n,re(u=>(o||a(u),t==null?void 0:t(u)))]}function WE(e,t){let r=p.useRef([]),n=re(e);p.useEffect(()=>{let a=[...r.current];for(let[o,i]of t.entries())if(r.current[o]!==i){let s=n(t,a);return r.current=t,s}},[n,...t])}function F3(e){return[e.screenX,e.screenY]}function qQ(){let e=p.useRef([-1,-1]);return{wasMoved(t){let r=F3(t);return e.current[0]===r[0]&&e.current[1]===r[1]?!1:(e.current=r,!0)},update(t){e.current=F3(t)}}}function YQ(){return/iPhone/gi.test(window.navigator.platform)||/Mac/gi.test(window.navigator.platform)&&window.navigator.maxTouchPoints>0}function ZQ(e,t,r){let n=dr(t);p.useEffect(()=>{function a(o){n.current(o)}return window.addEventListener(e,a,r),()=>window.removeEventListener(e,a,r)},[e,r])}var Zr=(e=>(e[e.Forwards=0]="Forwards",e[e.Backwards=1]="Backwards",e))(Zr||{});function HE(){let e=p.useRef(0);return ZQ("keydown",t=>{t.key==="Tab"&&(e.current=t.shiftKey?1:0)},!0),e}function Oh(){let e=p.useRef(!1);return gt(()=>(e.current=!0,()=>{e.current=!1}),[]),e}function pl(...e){return p.useMemo(()=>Ah(...e),[...e])}function GE(e,t,r,n){let a=dr(r);p.useEffect(()=>{e=e??window;function o(i){a.current(i)}return e.addEventListener(t,o,n),()=>e.removeEventListener(t,o,n)},[e,t,n])}function XQ(e){function t(){document.readyState!=="loading"&&(e(),document.removeEventListener("DOMContentLoaded",t))}typeof window<"u"&&typeof document<"u"&&(document.addEventListener("DOMContentLoaded",t),t())}function cD(e){if(!e)return new Set;if(typeof e=="function")return new Set(e());let t=new Set;for(let r of e.current)r.current instanceof HTMLElement&&t.add(r.current);return t}let QQ="div";var uD=(e=>(e[e.None=1]="None",e[e.InitialFocus=2]="InitialFocus",e[e.TabLock=4]="TabLock",e[e.FocusLock=8]="FocusLock",e[e.RestoreFocus=16]="RestoreFocus",e[e.All=30]="All",e))(uD||{});function JQ(e,t){let r=p.useRef(null),n=We(r,t),{initialFocus:a,containers:o,features:i=30,...s}=e;Tu()||(i=1);let l=pl(r);rJ({ownerDocument:l},!!(i&16));let u=nJ({ownerDocument:l,container:r,initialFocus:a},!!(i&2));aJ({ownerDocument:l,container:r,containers:o,previousActiveElement:u},!!(i&8));let f=HE(),c=re(m=>{let w=r.current;w&&(v=>v())(()=>{Re(f.current,{[Zr.Forwards]:()=>{qt(w,et.First,{skipElements:[m.relatedTarget]})},[Zr.Backwards]:()=>{qt(w,et.Last,{skipElements:[m.relatedTarget]})}})})}),d=ji(),h=p.useRef(!1),g={ref:n,onKeyDown(m){m.key=="Tab"&&(h.current=!0,d.requestAnimationFrame(()=>{h.current=!1}))},onBlur(m){let w=cD(o);r.current instanceof HTMLElement&&w.add(r.current);let v=m.relatedTarget;v instanceof HTMLElement&&v.dataset.headlessuiFocusGuard!=="true"&&(dD(w,v)||(h.current?qt(r.current,Re(f.current,{[Zr.Forwards]:()=>et.Next,[Zr.Backwards]:()=>et.Previous})|et.WrapAround,{relativeTo:m.target}):m.target instanceof HTMLElement&&Vs(m.target)))}};return Y.createElement(Y.Fragment,null,!!(i&4)&&Y.createElement(Ca,{as:"button",type:"button","data-headlessui-focus-guard":!0,onFocus:c,features:Ea.Focusable}),Fe({ourProps:g,theirProps:s,defaultTag:QQ,name:"FocusTrap"}),!!(i&4)&&Y.createElement(Ca,{as:"button",type:"button","data-headlessui-focus-guard":!0,onFocus:c,features:Ea.Focusable}))}let eJ=Be(JQ),sd=Object.assign(eJ,{features:uD}),ni=[];XQ(()=>{function e(t){t.target instanceof HTMLElement&&t.target!==document.body&&ni[0]!==t.target&&(ni.unshift(t.target),ni=ni.filter(r=>r!=null&&r.isConnected),ni.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 tJ(e=!0){let t=p.useRef(ni.slice());return WE(([r],[n])=>{n===!0&&r===!1&&Cu(()=>{t.current.splice(0)}),n===!1&&r===!0&&(t.current=ni.slice())},[e,ni,t]),re(()=>{var r;return(r=t.current.find(n=>n!=null&&n.isConnected))!=null?r:null})}function rJ({ownerDocument:e},t){let r=tJ(t);WE(()=>{t||(e==null?void 0:e.activeElement)===(e==null?void 0:e.body)&&Vs(r())},[t]);let n=p.useRef(!1);p.useEffect(()=>(n.current=!1,()=>{n.current=!0,Cu(()=>{n.current&&Vs(r())})}),[])}function nJ({ownerDocument:e,container:t,initialFocus:r},n){let a=p.useRef(null),o=Oh();return WE(()=>{if(!n)return;let i=t.current;i&&Cu(()=>{if(!o.current)return;let s=e==null?void 0:e.activeElement;if(r!=null&&r.current){if((r==null?void 0:r.current)===s){a.current=s;return}}else if(i.contains(s)){a.current=s;return}r!=null&&r.current?Vs(r.current):(qt(i,et.First),to.Error),a.current=e==null?void 0:e.activeElement})},[n]),a}function aJ({ownerDocument:e,container:t,containers:r,previousActiveElement:n},a){let o=Oh();GE(e==null?void 0:e.defaultView,"focus",i=>{if(!a||!o.current)return;let s=cD(r);t.current instanceof HTMLElement&&s.add(t.current);let l=n.current;if(!l)return;let u=i.target;u&&u instanceof HTMLElement?dD(s,u)?(n.current=u,Vs(u)):(i.preventDefault(),i.stopPropagation(),Vs(l)):Vs(n.current)},!0)}function dD(e,t){for(let r of e)if(r.contains(t))return!0;return!1}let fD=p.createContext(!1);function oJ(){return p.useContext(fD)}function s2(e){return Y.createElement(fD.Provider,{value:e.force},e.children)}function iJ(e){let t=oJ(),r=p.useContext(hD),n=pl(e),[a,o]=p.useState(()=>{if(!t&&r!==null||lo.isServer)return null;let i=n==null?void 0:n.getElementById("headlessui-portal-root");if(i)return i;if(n===null)return null;let s=n.createElement("div");return s.setAttribute("id","headlessui-portal-root"),n.body.appendChild(s)});return p.useEffect(()=>{a!==null&&(n!=null&&n.body.contains(a)||n==null||n.body.appendChild(a))},[a,n]),p.useEffect(()=>{t||r!==null&&o(r.current)},[r,o,t]),a}let sJ=p.Fragment;function lJ(e,t){let r=e,n=p.useRef(null),a=We(nD(f=>{n.current=f}),t),o=pl(n),i=iJ(n),[s]=p.useState(()=>{var f;return lo.isServer?null:(f=o==null?void 0:o.createElement("div"))!=null?f:null}),l=Tu(),u=p.useRef(!1);return gt(()=>{if(u.current=!1,!(!i||!s))return i.contains(s)||(s.setAttribute("data-headlessui-portal",""),i.appendChild(s)),()=>{u.current=!0,Cu(()=>{var f;u.current&&(!i||!s||(s instanceof Node&&i.contains(s)&&i.removeChild(s),i.childNodes.length<=0&&((f=i.parentElement)==null||f.removeChild(i))))})}},[i,s]),l?!i||!s?null:Qi.createPortal(Fe({ourProps:{ref:a},theirProps:r,defaultTag:sJ,name:"Portal"}),s):null}let cJ=p.Fragment,hD=p.createContext(null);function uJ(e,t){let{target:r,...n}=e,a={ref:We(t)};return Y.createElement(hD.Provider,{value:r},Fe({ourProps:a,theirProps:n,defaultTag:cJ,name:"Popover.Group"}))}let dJ=Be(lJ),fJ=Be(uJ),l2=Object.assign(dJ,{Group:fJ}),pD=p.createContext(null);function gD(){let e=p.useContext(pD);if(e===null){let t=new Error("You used a component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(t,gD),t}return e}function vD(){let[e,t]=p.useState([]);return[e.length>0?e.join(" "):void 0,p.useMemo(()=>function(r){let n=re(o=>(t(i=>[...i,o]),()=>t(i=>{let s=i.slice(),l=s.indexOf(o);return l!==-1&&s.splice(l,1),s}))),a=p.useMemo(()=>({register:n,slot:r.slot,name:r.name,props:r.props}),[n,r.slot,r.name,r.props]);return Y.createElement(pD.Provider,{value:a},r.children)},[t])]}let hJ="p";function pJ(e,t){let r=kt(),{id:n=`headlessui-description-${r}`,...a}=e,o=gD(),i=We(t);gt(()=>o.register(n),[n,o.register]);let s={ref:i,...o.props,id:n};return Fe({ourProps:s,theirProps:a,slot:o.slot||{},defaultTag:hJ,name:o.name||"Description"})}let gJ=Be(pJ),mD=Object.assign(gJ,{}),KE=p.createContext(()=>{});KE.displayName="StackContext";var c2=(e=>(e[e.Add=0]="Add",e[e.Remove=1]="Remove",e))(c2||{});function vJ(){return p.useContext(KE)}function mJ({children:e,onUpdate:t,type:r,element:n,enabled:a}){let o=vJ(),i=re((...s)=>{t==null||t(...s),o(...s)});return gt(()=>{let s=a===void 0||a===!0;return s&&i(0,r,n),()=>{s&&i(1,r,n)}},[i,r,n,a]),Y.createElement(KE.Provider,{value:i},e)}function yJ(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}const bJ=typeof Object.is=="function"?Object.is:yJ,{useState:wJ,useEffect:_J,useLayoutEffect:$J,useDebugValue:xJ}=Ks;function SJ(e,t,r){const n=t(),[{inst:a},o]=wJ({inst:{value:n,getSnapshot:t}});return $J(()=>{a.value=n,a.getSnapshot=t,nb(a)&&o({inst:a})},[e,n,t]),_J(()=>(nb(a)&&o({inst:a}),e(()=>{nb(a)&&o({inst:a})})),[e]),xJ(n),n}function nb(e){const t=e.getSnapshot,r=e.value;try{const n=t();return!bJ(r,n)}catch{return!0}}function EJ(e,t,r){return t()}const CJ=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",TJ=!CJ,AJ=TJ?EJ:SJ,RJ="useSyncExternalStore"in Ks?(e=>e.useSyncExternalStore)(Ks):AJ;function OJ(e){return RJ(e.subscribe,e.getSnapshot,e.getSnapshot)}function kJ(e,t){let r=e(),n=new Set;return{getSnapshot(){return r},subscribe(a){return n.add(a),()=>n.delete(a)},dispatch(a,...o){let i=t[a].call(r,...o);i&&(r=i,n.forEach(s=>s()))}}}function PJ(){let e;return{before({doc:t}){var r;let n=t.documentElement;e=((r=t.defaultView)!=null?r:window).innerWidth-n.clientWidth},after({doc:t,d:r}){let n=t.documentElement,a=n.clientWidth-n.offsetWidth,o=e-a;r.style(n,"paddingRight",`${o}px`)}}}function IJ(){if(!YQ())return{};let e;return{before(){e=window.pageYOffset},after({doc:t,d:r,meta:n}){function a(i){return n.containers.flatMap(s=>s()).some(s=>s.contains(i))}r.style(t.body,"marginTop",`-${e}px`),window.scrollTo(0,0);let o=null;r.addEventListener(t,"click",i=>{if(i.target instanceof HTMLElement)try{let s=i.target.closest("a");if(!s)return;let{hash:l}=new URL(s.href),u=t.querySelector(l);u&&!a(u)&&(o=u)}catch{}},!0),r.addEventListener(t,"touchmove",i=>{i.target instanceof HTMLElement&&!a(i.target)&&i.preventDefault()},{passive:!1}),r.add(()=>{window.scrollTo(0,window.pageYOffset+e),o&&o.isConnected&&(o.scrollIntoView({block:"nearest"}),o=null)})}}}function NJ(){return{before({doc:e,d:t}){t.style(e.documentElement,"overflow","hidden")}}}function LJ(e){let t={};for(let r of e)Object.assign(t,r(t));return t}let Is=kJ(()=>new Map,{PUSH(e,t){var r;let n=(r=this.get(e))!=null?r:{doc:e,count:0,d:yo(),meta:new Set};return n.count++,n.meta.add(t),this.set(e,n),this},POP(e,t){let r=this.get(e);return r&&(r.count--,r.meta.delete(t)),this},SCROLL_PREVENT({doc:e,d:t,meta:r}){let n={doc:e,d:t,meta:LJ(r)},a=[IJ(),PJ(),NJ()];a.forEach(({before:o})=>o==null?void 0:o(n)),a.forEach(({after:o})=>o==null?void 0:o(n))},SCROLL_ALLOW({d:e}){e.dispose()},TEARDOWN({doc:e}){this.delete(e)}});Is.subscribe(()=>{let e=Is.getSnapshot(),t=new Map;for(let[r]of e)t.set(r,r.documentElement.style.overflow);for(let r of e.values()){let n=t.get(r.doc)==="hidden",a=r.count!==0;(a&&!n||!a&&n)&&Is.dispatch(r.count>0?"SCROLL_PREVENT":"SCROLL_ALLOW",r),r.count===0&&Is.dispatch("TEARDOWN",r)}});function MJ(e,t,r){let n=OJ(Is),a=e?n.get(e):void 0,o=a?a.count>0:!1;return gt(()=>{if(!(!e||!t))return Is.dispatch("PUSH",e,r),()=>Is.dispatch("POP",e,r)},[t,e]),o}let ab=new Map,ld=new Map;function B3(e,t=!0){gt(()=>{var r;if(!t)return;let n=typeof e=="function"?e():e.current;if(!n)return;function a(){var i;if(!n)return;let s=(i=ld.get(n))!=null?i:1;if(s===1?ld.delete(n):ld.set(n,s-1),s!==1)return;let l=ab.get(n);l&&(l["aria-hidden"]===null?n.removeAttribute("aria-hidden"):n.setAttribute("aria-hidden",l["aria-hidden"]),n.inert=l.inert,ab.delete(n))}let o=(r=ld.get(n))!=null?r:0;return ld.set(n,o+1),o!==0||(ab.set(n,{"aria-hidden":n.getAttribute("aria-hidden"),inert:n.inert}),n.setAttribute("aria-hidden","true"),n.inert=!0),a},[e,t])}var DJ=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(DJ||{}),jJ=(e=>(e[e.SetTitleId=0]="SetTitleId",e))(jJ||{});let FJ={[0](e,t){return e.titleId===t.id?e:{...e,titleId:t.id}}},_m=p.createContext(null);_m.displayName="DialogContext";function kh(e){let t=p.useContext(_m);if(t===null){let r=new Error(`<${e} /> is missing a parent component.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,kh),r}return t}function BJ(e,t,r=()=>[document.body]){MJ(e,t,n=>{var a;return{containers:[...(a=n.containers)!=null?a:[],r]}})}function UJ(e,t){return Re(t.type,FJ,e,t)}let zJ="div",VJ=kn.RenderStrategy|kn.Static;function WJ(e,t){let r=kt(),{id:n=`headlessui-dialog-${r}`,open:a,onClose:o,initialFocus:i,__demoMode:s=!1,...l}=e,[u,f]=p.useState(0),c=Au();a===void 0&&c!==null&&(a=(c&ut.Open)===ut.Open);let d=p.useRef(null),h=We(d,t),g=p.useRef(null),m=pl(d),w=e.hasOwnProperty("open")||c!==null,v=e.hasOwnProperty("onClose");if(!w&&!v)throw new Error("You have to provide an `open` and an `onClose` prop to the `Dialog` component.");if(!w)throw new Error("You provided an `onClose` prop to the `Dialog`, but forgot an `open` prop.");if(!v)throw new Error("You provided an `open` prop to the `Dialog`, but forgot an `onClose` prop.");if(typeof a!="boolean")throw new Error(`You provided an \`open\` prop to the \`Dialog\`, but the value is not a boolean. Received: ${a}`);if(typeof o!="function")throw new Error(`You provided an \`onClose\` prop to the \`Dialog\`, but the value is not a function. Received: ${o}`);let b=a?0:1,[_,$]=p.useReducer(UJ,{titleId:null,descriptionId:null,panelRef:p.createRef()}),C=re(()=>o(!1)),O=re(K=>$({type:0,id:K})),x=Tu()?s?!1:b===0:!1,S=u>1,A=p.useContext(_m)!==null,k=S?"parent":"leaf",N=c!==null?(c&ut.Closing)===ut.Closing:!1,P=(()=>A||N?!1:x)(),I=p.useCallback(()=>{var K,Q;return(Q=Array.from((K=m==null?void 0:m.querySelectorAll("body > *"))!=null?K:[]).find(J=>J.id==="headlessui-portal-root"?!1:J.contains(g.current)&&J instanceof HTMLElement))!=null?Q:null},[g]);B3(I,P);let E=(()=>S?!0:x)(),R=p.useCallback(()=>{var K,Q;return(Q=Array.from((K=m==null?void 0:m.querySelectorAll("[data-headlessui-portal]"))!=null?K:[]).find(J=>J.contains(g.current)&&J instanceof HTMLElement))!=null?Q:null},[g]);B3(R,E);let F=re(()=>{var K,Q;return[...Array.from((K=m==null?void 0:m.querySelectorAll("html > *, body > *, [data-headlessui-portal]"))!=null?K:[]).filter(J=>!(J===document.body||J===document.head||!(J instanceof HTMLElement)||J.contains(g.current)||_.panelRef.current&&J.contains(_.panelRef.current))),(Q=_.panelRef.current)!=null?Q:d.current]}),B=(()=>!(!x||S))();UE(()=>F(),C,B);let j=(()=>!(S||b!==0))();GE(m==null?void 0:m.defaultView,"keydown",K=>{j&&(K.defaultPrevented||K.key===ye.Escape&&(K.preventDefault(),K.stopPropagation(),C()))});let M=(()=>!(N||b!==0||A))();BJ(m,M,F),p.useEffect(()=>{if(b!==0||!d.current)return;let K=new ResizeObserver(Q=>{for(let J of Q){let de=J.target.getBoundingClientRect();de.x===0&&de.y===0&&de.width===0&&de.height===0&&C()}});return K.observe(d.current),()=>K.disconnect()},[b,d,C]);let[D,U]=vD(),V=p.useMemo(()=>[{dialogState:b,close:C,setTitleId:O},_],[b,_,C,O]),G=p.useMemo(()=>({open:b===0}),[b]),H={ref:h,id:n,role:"dialog","aria-modal":b===0?!0:void 0,"aria-labelledby":_.titleId,"aria-describedby":D};return Y.createElement(mJ,{type:"Dialog",enabled:b===0,element:d,onUpdate:re((K,Q)=>{Q==="Dialog"&&Re(K,{[c2.Add]:()=>f(J=>J+1),[c2.Remove]:()=>f(J=>J-1)})})},Y.createElement(s2,{force:!0},Y.createElement(l2,null,Y.createElement(_m.Provider,{value:V},Y.createElement(l2.Group,{target:d},Y.createElement(s2,{force:!1},Y.createElement(U,{slot:G,name:"Dialog.Description"},Y.createElement(sd,{initialFocus:i,containers:F,features:x?Re(k,{parent:sd.features.RestoreFocus,leaf:sd.features.All&~sd.features.FocusLock}):sd.features.None},Fe({ourProps:H,theirProps:l,slot:G,defaultTag:zJ,features:VJ,visible:b===0,name:"Dialog"})))))))),Y.createElement(Ca,{features:Ea.Hidden,ref:g}))}let HJ="div";function GJ(e,t){let r=kt(),{id:n=`headlessui-dialog-overlay-${r}`,...a}=e,[{dialogState:o,close:i}]=kh("Dialog.Overlay"),s=We(t),l=re(f=>{if(f.target===f.currentTarget){if(Rh(f.currentTarget))return f.preventDefault();f.preventDefault(),f.stopPropagation(),i()}}),u=p.useMemo(()=>({open:o===0}),[o]);return Fe({ourProps:{ref:s,id:n,"aria-hidden":!0,onClick:l},theirProps:a,slot:u,defaultTag:HJ,name:"Dialog.Overlay"})}let KJ="div";function qJ(e,t){let r=kt(),{id:n=`headlessui-dialog-backdrop-${r}`,...a}=e,[{dialogState:o},i]=kh("Dialog.Backdrop"),s=We(t);p.useEffect(()=>{if(i.panelRef.current===null)throw new Error("A component is being used, but a component is missing.")},[i.panelRef]);let l=p.useMemo(()=>({open:o===0}),[o]);return Y.createElement(s2,{force:!0},Y.createElement(l2,null,Fe({ourProps:{ref:s,id:n,"aria-hidden":!0},theirProps:a,slot:l,defaultTag:KJ,name:"Dialog.Backdrop"})))}let YJ="div";function ZJ(e,t){let r=kt(),{id:n=`headlessui-dialog-panel-${r}`,...a}=e,[{dialogState:o},i]=kh("Dialog.Panel"),s=We(t,i.panelRef),l=p.useMemo(()=>({open:o===0}),[o]),u=re(f=>{f.stopPropagation()});return Fe({ourProps:{ref:s,id:n,onClick:u},theirProps:a,slot:l,defaultTag:YJ,name:"Dialog.Panel"})}let XJ="h2";function QJ(e,t){let r=kt(),{id:n=`headlessui-dialog-title-${r}`,...a}=e,[{dialogState:o,setTitleId:i}]=kh("Dialog.Title"),s=We(t);p.useEffect(()=>(i(n),()=>i(null)),[n,i]);let l=p.useMemo(()=>({open:o===0}),[o]);return Fe({ourProps:{ref:s,id:n},theirProps:a,slot:l,defaultTag:XJ,name:"Dialog.Title"})}let JJ=Be(WJ),eee=Be(qJ),tee=Be(ZJ),ree=Be(GJ),nee=Be(QJ),yr=Object.assign(JJ,{Backdrop:eee,Panel:tee,Overlay:ree,Title:nee,Description:mD});var aee=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(aee||{}),oee=(e=>(e[e.Single=0]="Single",e[e.Multi=1]="Multi",e))(oee||{}),iee=(e=>(e[e.Pointer=0]="Pointer",e[e.Other=1]="Other",e))(iee||{}),see=(e=>(e[e.OpenListbox=0]="OpenListbox",e[e.CloseListbox=1]="CloseListbox",e[e.GoToOption=2]="GoToOption",e[e.Search=3]="Search",e[e.ClearSearch=4]="ClearSearch",e[e.RegisterOption=5]="RegisterOption",e[e.UnregisterOption=6]="UnregisterOption",e[e.RegisterLabel=7]="RegisterLabel",e))(see||{});function ob(e,t=r=>r){let r=e.activeOptionIndex!==null?e.options[e.activeOptionIndex]:null,n=Ps(t(e.options.slice()),o=>o.dataRef.current.domRef.current),a=r?n.indexOf(r):null;return a===-1&&(a=null),{options:n,activeOptionIndex:a}}let lee={[1](e){return e.dataRef.current.disabled||e.listboxState===1?e:{...e,activeOptionIndex:null,listboxState:1}},[0](e){if(e.dataRef.current.disabled||e.listboxState===0)return e;let t=e.activeOptionIndex,{isSelected:r}=e.dataRef.current,n=e.options.findIndex(a=>r(a.dataRef.current.value));return n!==-1&&(t=n),{...e,listboxState:0,activeOptionIndex:t}},[2](e,t){var r;if(e.dataRef.current.disabled||e.listboxState===1)return e;let n=ob(e),a=zQ(t,{resolveItems:()=>n.options,resolveActiveIndex:()=>n.activeOptionIndex,resolveId:o=>o.id,resolveDisabled:o=>o.dataRef.current.disabled});return{...e,...n,searchQuery:"",activeOptionIndex:a,activationTrigger:(r=t.trigger)!=null?r:1}},[3]:(e,t)=>{if(e.dataRef.current.disabled||e.listboxState===1)return e;let r=e.searchQuery!==""?0:1,n=e.searchQuery+t.value.toLowerCase(),a=(e.activeOptionIndex!==null?e.options.slice(e.activeOptionIndex+r).concat(e.options.slice(0,e.activeOptionIndex+r)):e.options).find(i=>{var s;return!i.dataRef.current.disabled&&((s=i.dataRef.current.textValue)==null?void 0:s.startsWith(n))}),o=a?e.options.indexOf(a):-1;return o===-1||o===e.activeOptionIndex?{...e,searchQuery:n}:{...e,searchQuery:n,activeOptionIndex:o,activationTrigger:1}},[4](e){return e.dataRef.current.disabled||e.listboxState===1||e.searchQuery===""?e:{...e,searchQuery:""}},[5]:(e,t)=>{let r={id:t.id,dataRef:t.dataRef},n=ob(e,a=>[...a,r]);return e.activeOptionIndex===null&&e.dataRef.current.isSelected(t.dataRef.current.value)&&(n.activeOptionIndex=n.options.indexOf(r)),{...e,...n}},[6]:(e,t)=>{let r=ob(e,n=>{let a=n.findIndex(o=>o.id===t.id);return a!==-1&&n.splice(a,1),n});return{...e,...r,activationTrigger:1}},[7]:(e,t)=>({...e,labelId:t.id})},qE=p.createContext(null);qE.displayName="ListboxActionsContext";function Ph(e){let t=p.useContext(qE);if(t===null){let r=new Error(`<${e} /> is missing a parent component.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,Ph),r}return t}let YE=p.createContext(null);YE.displayName="ListboxDataContext";function Ih(e){let t=p.useContext(YE);if(t===null){let r=new Error(`<${e} /> is missing a parent component.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,Ih),r}return t}function cee(e,t){return Re(t.type,lee,e,t)}let uee=p.Fragment;function dee(e,t){let{value:r,defaultValue:n,form:a,name:o,onChange:i,by:s=(H,K)=>H===K,disabled:l=!1,horizontal:u=!1,multiple:f=!1,...c}=e;const d=u?"horizontal":"vertical";let h=We(t),[g=f?[]:void 0,m]=lD(r,i,n),[w,v]=p.useReducer(cee,{dataRef:p.createRef(),listboxState:1,options:[],searchQuery:"",labelId:null,activeOptionIndex:null,activationTrigger:1}),b=p.useRef({static:!1,hold:!1}),_=p.useRef(null),$=p.useRef(null),C=p.useRef(null),O=re(typeof s=="string"?(H,K)=>{let Q=s;return(H==null?void 0:H[Q])===(K==null?void 0:K[Q])}:s),x=p.useCallback(H=>Re(S.mode,{[1]:()=>g.some(K=>O(K,H)),[0]:()=>O(g,H)}),[g]),S=p.useMemo(()=>({...w,value:g,disabled:l,mode:f?1:0,orientation:d,compare:O,isSelected:x,optionsPropsRef:b,labelRef:_,buttonRef:$,optionsRef:C}),[g,l,f,w]);gt(()=>{w.dataRef.current=S},[S]),UE([S.buttonRef,S.optionsRef],(H,K)=>{var Q;v({type:1}),BE(K,B0.Loose)||(H.preventDefault(),(Q=S.buttonRef.current)==null||Q.focus())},S.listboxState===0);let A=p.useMemo(()=>({open:S.listboxState===0,disabled:l,value:g}),[S,l,g]),k=re(H=>{let K=S.options.find(Q=>Q.id===H);K&&B(K.dataRef.current.value)}),N=re(()=>{if(S.activeOptionIndex!==null){let{dataRef:H,id:K}=S.options[S.activeOptionIndex];B(H.current.value),v({type:2,focus:Pr.Specific,id:K})}}),P=re(()=>v({type:0})),I=re(()=>v({type:1})),E=re((H,K,Q)=>H===Pr.Specific?v({type:2,focus:Pr.Specific,id:K,trigger:Q}):v({type:2,focus:H,trigger:Q})),R=re((H,K)=>(v({type:5,id:H,dataRef:K}),()=>v({type:6,id:H}))),F=re(H=>(v({type:7,id:H}),()=>v({type:7,id:null}))),B=re(H=>Re(S.mode,{[0](){return m==null?void 0:m(H)},[1](){let K=S.value.slice(),Q=K.findIndex(J=>O(J,H));return Q===-1?K.push(H):K.splice(Q,1),m==null?void 0:m(K)}})),j=re(H=>v({type:3,value:H})),M=re(()=>v({type:4})),D=p.useMemo(()=>({onChange:B,registerOption:R,registerLabel:F,goToOption:E,closeListbox:I,openListbox:P,selectActiveOption:N,selectOption:k,search:j,clearSearch:M}),[]),U={ref:h},V=p.useRef(null),G=ji();return p.useEffect(()=>{V.current&&n!==void 0&&G.addEventListener(V.current,"reset",()=>{B(n)})},[V,B]),Y.createElement(qE.Provider,{value:D},Y.createElement(YE.Provider,{value:S},Y.createElement(VE,{value:Re(S.listboxState,{[0]:ut.Open,[1]:ut.Closed})},o!=null&&g!=null&&oD({[o]:g}).map(([H,K],Q)=>Y.createElement(Ca,{features:Ea.Hidden,ref:Q===0?J=>{var de;V.current=(de=J==null?void 0:J.closest("form"))!=null?de:null}:void 0,...wm({key:H,as:"input",type:"hidden",hidden:!0,readOnly:!0,form:a,name:H,value:K})})),Fe({ourProps:U,theirProps:c,slot:A,defaultTag:uee,name:"Listbox"}))))}let fee="button";function hee(e,t){var r;let n=kt(),{id:a=`headlessui-listbox-button-${n}`,...o}=e,i=Ih("Listbox.Button"),s=Ph("Listbox.Button"),l=We(i.buttonRef,t),u=ji(),f=re(w=>{switch(w.key){case ye.Space:case ye.Enter:case ye.ArrowDown:w.preventDefault(),s.openListbox(),u.nextFrame(()=>{i.value||s.goToOption(Pr.First)});break;case ye.ArrowUp:w.preventDefault(),s.openListbox(),u.nextFrame(()=>{i.value||s.goToOption(Pr.Last)});break}}),c=re(w=>{switch(w.key){case ye.Space:w.preventDefault();break}}),d=re(w=>{if(Rh(w.currentTarget))return w.preventDefault();i.listboxState===0?(s.closeListbox(),u.nextFrame(()=>{var v;return(v=i.buttonRef.current)==null?void 0:v.focus({preventScroll:!0})})):(w.preventDefault(),s.openListbox())}),h=tD(()=>{if(i.labelId)return[i.labelId,a].join(" ")},[i.labelId,a]),g=p.useMemo(()=>({open:i.listboxState===0,disabled:i.disabled,value:i.value}),[i]),m={ref:l,id:a,type:U0(e,i.buttonRef),"aria-haspopup":"listbox","aria-controls":(r=i.optionsRef.current)==null?void 0:r.id,"aria-expanded":i.disabled?void 0:i.listboxState===0,"aria-labelledby":h,disabled:i.disabled,onKeyDown:f,onKeyUp:c,onClick:d};return Fe({ourProps:m,theirProps:o,slot:g,defaultTag:fee,name:"Listbox.Button"})}let pee="label";function gee(e,t){let r=kt(),{id:n=`headlessui-listbox-label-${r}`,...a}=e,o=Ih("Listbox.Label"),i=Ph("Listbox.Label"),s=We(o.labelRef,t);gt(()=>i.registerLabel(n),[n]);let l=re(()=>{var f;return(f=o.buttonRef.current)==null?void 0:f.focus({preventScroll:!0})}),u=p.useMemo(()=>({open:o.listboxState===0,disabled:o.disabled}),[o]);return Fe({ourProps:{ref:s,id:n,onClick:l},theirProps:a,slot:u,defaultTag:pee,name:"Listbox.Label"})}let vee="ul",mee=kn.RenderStrategy|kn.Static;function yee(e,t){var r;let n=kt(),{id:a=`headlessui-listbox-options-${n}`,...o}=e,i=Ih("Listbox.Options"),s=Ph("Listbox.Options"),l=We(i.optionsRef,t),u=ji(),f=ji(),c=Au(),d=(()=>c!==null?(c&ut.Open)===ut.Open:i.listboxState===0)();p.useEffect(()=>{var v;let b=i.optionsRef.current;b&&i.listboxState===0&&b!==((v=Ah(b))==null?void 0:v.activeElement)&&b.focus({preventScroll:!0})},[i.listboxState,i.optionsRef]);let h=re(v=>{switch(f.dispose(),v.key){case ye.Space:if(i.searchQuery!=="")return v.preventDefault(),v.stopPropagation(),s.search(v.key);case ye.Enter:if(v.preventDefault(),v.stopPropagation(),i.activeOptionIndex!==null){let{dataRef:b}=i.options[i.activeOptionIndex];s.onChange(b.current.value)}i.mode===0&&(s.closeListbox(),yo().nextFrame(()=>{var b;return(b=i.buttonRef.current)==null?void 0:b.focus({preventScroll:!0})}));break;case Re(i.orientation,{vertical:ye.ArrowDown,horizontal:ye.ArrowRight}):return v.preventDefault(),v.stopPropagation(),s.goToOption(Pr.Next);case Re(i.orientation,{vertical:ye.ArrowUp,horizontal:ye.ArrowLeft}):return v.preventDefault(),v.stopPropagation(),s.goToOption(Pr.Previous);case ye.Home:case ye.PageUp:return v.preventDefault(),v.stopPropagation(),s.goToOption(Pr.First);case ye.End:case ye.PageDown:return v.preventDefault(),v.stopPropagation(),s.goToOption(Pr.Last);case ye.Escape:return v.preventDefault(),v.stopPropagation(),s.closeListbox(),u.nextFrame(()=>{var b;return(b=i.buttonRef.current)==null?void 0:b.focus({preventScroll:!0})});case ye.Tab:v.preventDefault(),v.stopPropagation();break;default:v.key.length===1&&(s.search(v.key),f.setTimeout(()=>s.clearSearch(),350));break}}),g=tD(()=>{var v,b,_;return(_=(v=i.labelRef.current)==null?void 0:v.id)!=null?_:(b=i.buttonRef.current)==null?void 0:b.id},[i.labelRef.current,i.buttonRef.current]),m=p.useMemo(()=>({open:i.listboxState===0}),[i]),w={"aria-activedescendant":i.activeOptionIndex===null||(r=i.options[i.activeOptionIndex])==null?void 0:r.id,"aria-multiselectable":i.mode===1?!0:void 0,"aria-labelledby":g,"aria-orientation":i.orientation,id:a,onKeyDown:h,role:"listbox",tabIndex:0,ref:l};return Fe({ourProps:w,theirProps:o,slot:m,defaultTag:vee,features:mee,visible:d,name:"Listbox.Options"})}let bee="li";function wee(e,t){let r=kt(),{id:n=`headlessui-listbox-option-${r}`,disabled:a=!1,value:o,...i}=e,s=Ih("Listbox.Option"),l=Ph("Listbox.Option"),u=s.activeOptionIndex!==null?s.options[s.activeOptionIndex].id===n:!1,f=s.isSelected(o),c=p.useRef(null),d=dr({disabled:a,value:o,domRef:c,get textValue(){var C,O;return(O=(C=c.current)==null?void 0:C.textContent)==null?void 0:O.toLowerCase()}}),h=We(t,c);gt(()=>{if(s.listboxState!==0||!u||s.activationTrigger===0)return;let C=yo();return C.requestAnimationFrame(()=>{var O,x;(x=(O=c.current)==null?void 0:O.scrollIntoView)==null||x.call(O,{block:"nearest"})}),C.dispose},[c,u,s.listboxState,s.activationTrigger,s.activeOptionIndex]),gt(()=>l.registerOption(n,d),[d,n]);let g=re(C=>{if(a)return C.preventDefault();l.onChange(o),s.mode===0&&(l.closeListbox(),yo().nextFrame(()=>{var O;return(O=s.buttonRef.current)==null?void 0:O.focus({preventScroll:!0})}))}),m=re(()=>{if(a)return l.goToOption(Pr.Nothing);l.goToOption(Pr.Specific,n)}),w=qQ(),v=re(C=>w.update(C)),b=re(C=>{w.wasMoved(C)&&(a||u||l.goToOption(Pr.Specific,n,0))}),_=re(C=>{w.wasMoved(C)&&(a||u&&l.goToOption(Pr.Nothing))}),$=p.useMemo(()=>({active:u,selected:f,disabled:a}),[u,f,a]);return Fe({ourProps:{id:n,ref:h,role:"option",tabIndex:a===!0?void 0:-1,"aria-disabled":a===!0?!0:void 0,"aria-selected":f,disabled:void 0,onClick:g,onFocus:m,onPointerEnter:v,onMouseEnter:v,onPointerMove:b,onMouseMove:b,onPointerLeave:_,onMouseLeave:_},theirProps:i,slot:$,defaultTag:bee,name:"Listbox.Option"})}let _ee=Be(dee),$ee=Be(hee),xee=Be(gee),See=Be(yee),Eee=Be(wee),ur=Object.assign(_ee,{Button:$ee,Label:xee,Options:See,Option:Eee});var Cee=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(Cee||{}),Tee=(e=>(e[e.TogglePopover=0]="TogglePopover",e[e.ClosePopover=1]="ClosePopover",e[e.SetButton=2]="SetButton",e[e.SetButtonId=3]="SetButtonId",e[e.SetPanel=4]="SetPanel",e[e.SetPanelId=5]="SetPanelId",e))(Tee||{});let Aee={[0]:e=>({...e,popoverState:Re(e.popoverState,{[0]:1,[1]:0})}),[1](e){return e.popoverState===1?e:{...e,popoverState:1}},[2](e,t){return e.button===t.button?e:{...e,button:t.button}},[3](e,t){return e.buttonId===t.buttonId?e:{...e,buttonId:t.buttonId}},[4](e,t){return e.panel===t.panel?e:{...e,panel:t.panel}},[5](e,t){return e.panelId===t.panelId?e:{...e,panelId:t.panelId}}},ZE=p.createContext(null);ZE.displayName="PopoverContext";function z0(e){let t=p.useContext(ZE);if(t===null){let r=new Error(`<${e} /> is missing a parent component.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,z0),r}return t}let XE=p.createContext(null);XE.displayName="PopoverAPIContext";function QE(e){let t=p.useContext(XE);if(t===null){let r=new Error(`<${e} /> is missing a parent component.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,QE),r}return t}let JE=p.createContext(null);JE.displayName="PopoverGroupContext";function yD(){return p.useContext(JE)}let V0=p.createContext(null);V0.displayName="PopoverPanelContext";function Ree(){return p.useContext(V0)}function Oee(e,t){return Re(t.type,Aee,e,t)}let kee="div";function Pee(e,t){var r;let n=p.useRef(null),a=We(t,nD(P=>{n.current=P})),o=p.useRef([]),i=p.useReducer(Oee,{popoverState:1,buttons:o,button:null,buttonId:null,panel:null,panelId:null,beforePanelSentinel:p.createRef(),afterPanelSentinel:p.createRef()}),[{popoverState:s,button:l,buttonId:u,panel:f,panelId:c,beforePanelSentinel:d,afterPanelSentinel:h},g]=i,m=pl((r=n.current)!=null?r:l),w=p.useMemo(()=>{if(!l||!f)return!1;for(let j of document.querySelectorAll("body > *"))if(Number(j==null?void 0:j.contains(l))^Number(j==null?void 0:j.contains(f)))return!0;let P=F0(),I=P.indexOf(l),E=(I+P.length-1)%P.length,R=(I+1)%P.length,F=P[E],B=P[R];return!f.contains(F)&&!f.contains(B)},[l,f]),v=dr(u),b=dr(c),_=p.useMemo(()=>({buttonId:v,panelId:b,close:()=>g({type:1})}),[v,b,g]),$=yD(),C=$==null?void 0:$.registerPopover,O=re(()=>{var P;return(P=$==null?void 0:$.isFocusWithinPopoverGroup())!=null?P:(m==null?void 0:m.activeElement)&&((l==null?void 0:l.contains(m.activeElement))||(f==null?void 0:f.contains(m.activeElement)))});p.useEffect(()=>C==null?void 0:C(_),[C,_]),GE(m==null?void 0:m.defaultView,"focus",P=>{var I,E,R,F;s===0&&(O()||l&&f&&P.target!==window&&((E=(I=d.current)==null?void 0:I.contains)!=null&&E.call(I,P.target)||(F=(R=h.current)==null?void 0:R.contains)!=null&&F.call(R,P.target)||g({type:1})))},!0),UE([l,f],(P,I)=>{g({type:1}),BE(I,B0.Loose)||(P.preventDefault(),l==null||l.focus())},s===0);let x=re(P=>{g({type:1});let I=(()=>P?P instanceof HTMLElement?P:"current"in P&&P.current instanceof HTMLElement?P.current:l:l)();I==null||I.focus()}),S=p.useMemo(()=>({close:x,isPortalled:w}),[x,w]),A=p.useMemo(()=>({open:s===0,close:x}),[s,x]),k=e,N={ref:a};return Y.createElement(V0.Provider,{value:null},Y.createElement(ZE.Provider,{value:i},Y.createElement(XE.Provider,{value:S},Y.createElement(VE,{value:Re(s,{[0]:ut.Open,[1]:ut.Closed})},Fe({ourProps:N,theirProps:k,slot:A,defaultTag:kee,name:"Popover"})))))}let Iee="button";function Nee(e,t){let r=kt(),{id:n=`headlessui-popover-button-${r}`,...a}=e,[o,i]=z0("Popover.Button"),{isPortalled:s}=QE("Popover.Button"),l=p.useRef(null),u=`headlessui-focus-sentinel-${kt()}`,f=yD(),c=f==null?void 0:f.closeOthers,d=Ree()!==null;p.useEffect(()=>{if(!d)return i({type:3,buttonId:n}),()=>{i({type:3,buttonId:null})}},[d,n,i]);let[h]=p.useState(()=>Symbol()),g=We(l,t,d?null:N=>{if(N)o.buttons.current.push(h);else{let P=o.buttons.current.indexOf(h);P!==-1&&o.buttons.current.splice(P,1)}o.buttons.current.length>1,N&&i({type:2,button:N})}),m=We(l,t),w=pl(l),v=re(N=>{var P,I,E;if(d){if(o.popoverState===1)return;switch(N.key){case ye.Space:case ye.Enter:N.preventDefault(),(I=(P=N.target).click)==null||I.call(P),i({type:1}),(E=o.button)==null||E.focus();break}}else switch(N.key){case ye.Space:case ye.Enter:N.preventDefault(),N.stopPropagation(),o.popoverState===1&&(c==null||c(o.buttonId)),i({type:0});break;case ye.Escape:if(o.popoverState!==0)return c==null?void 0:c(o.buttonId);if(!l.current||w!=null&&w.activeElement&&!l.current.contains(w.activeElement))return;N.preventDefault(),N.stopPropagation(),i({type:1});break}}),b=re(N=>{d||N.key===ye.Space&&N.preventDefault()}),_=re(N=>{var P,I;Rh(N.currentTarget)||e.disabled||(d?(i({type:1}),(P=o.button)==null||P.focus()):(N.preventDefault(),N.stopPropagation(),o.popoverState===1&&(c==null||c(o.buttonId)),i({type:0}),(I=o.button)==null||I.focus()))}),$=re(N=>{N.preventDefault(),N.stopPropagation()}),C=o.popoverState===0,O=p.useMemo(()=>({open:C}),[C]),x=U0(e,l),S=d?{ref:m,type:x,onKeyDown:v,onClick:_}:{ref:g,id:o.buttonId,type:x,"aria-expanded":e.disabled?void 0:o.popoverState===0,"aria-controls":o.panel?o.panelId:void 0,onKeyDown:v,onKeyUp:b,onClick:_,onMouseDown:$},A=HE(),k=re(()=>{let N=o.panel;if(!N)return;function P(){Re(A.current,{[Zr.Forwards]:()=>qt(N,et.First),[Zr.Backwards]:()=>qt(N,et.Last)})===to.Error&&qt(F0().filter(I=>I.dataset.headlessuiFocusGuard!=="true"),Re(A.current,{[Zr.Forwards]:et.Next,[Zr.Backwards]:et.Previous}),{relativeTo:o.button})}P()});return Y.createElement(Y.Fragment,null,Fe({ourProps:S,theirProps:a,slot:O,defaultTag:Iee,name:"Popover.Button"}),C&&!d&&s&&Y.createElement(Ca,{id:u,features:Ea.Focusable,"data-headlessui-focus-guard":!0,as:"button",type:"button",onFocus:k}))}let Lee="div",Mee=kn.RenderStrategy|kn.Static;function Dee(e,t){let r=kt(),{id:n=`headlessui-popover-overlay-${r}`,...a}=e,[{popoverState:o},i]=z0("Popover.Overlay"),s=We(t),l=Au(),u=(()=>l!==null?(l&ut.Open)===ut.Open:o===0)(),f=re(d=>{if(Rh(d.currentTarget))return d.preventDefault();i({type:1})}),c=p.useMemo(()=>({open:o===0}),[o]);return Fe({ourProps:{ref:s,id:n,"aria-hidden":!0,onClick:f},theirProps:a,slot:c,defaultTag:Lee,features:Mee,visible:u,name:"Popover.Overlay"})}let jee="div",Fee=kn.RenderStrategy|kn.Static;function Bee(e,t){let r=kt(),{id:n=`headlessui-popover-panel-${r}`,focus:a=!1,...o}=e,[i,s]=z0("Popover.Panel"),{close:l,isPortalled:u}=QE("Popover.Panel"),f=`headlessui-focus-sentinel-before-${kt()}`,c=`headlessui-focus-sentinel-after-${kt()}`,d=p.useRef(null),h=We(d,t,x=>{s({type:4,panel:x})}),g=pl(d);gt(()=>(s({type:5,panelId:n}),()=>{s({type:5,panelId:null})}),[n,s]);let m=Au(),w=(()=>m!==null?(m&ut.Open)===ut.Open:i.popoverState===0)(),v=re(x=>{var S;switch(x.key){case ye.Escape:if(i.popoverState!==0||!d.current||g!=null&&g.activeElement&&!d.current.contains(g.activeElement))return;x.preventDefault(),x.stopPropagation(),s({type:1}),(S=i.button)==null||S.focus();break}});p.useEffect(()=>{var x;e.static||i.popoverState===1&&((x=e.unmount)==null||x)&&s({type:4,panel:null})},[i.popoverState,e.unmount,e.static,s]),p.useEffect(()=>{if(!a||i.popoverState!==0||!d.current)return;let x=g==null?void 0:g.activeElement;d.current.contains(x)||qt(d.current,et.First)},[a,d,i.popoverState]);let b=p.useMemo(()=>({open:i.popoverState===0,close:l}),[i,l]),_={ref:h,id:n,onKeyDown:v,onBlur:a&&i.popoverState===0?x=>{var S,A,k,N,P;let I=x.relatedTarget;I&&d.current&&((S=d.current)!=null&&S.contains(I)||(s({type:1}),((k=(A=i.beforePanelSentinel.current)==null?void 0:A.contains)!=null&&k.call(A,I)||(P=(N=i.afterPanelSentinel.current)==null?void 0:N.contains)!=null&&P.call(N,I))&&I.focus({preventScroll:!0})))}:void 0,tabIndex:-1},$=HE(),C=re(()=>{let x=d.current;if(!x)return;function S(){Re($.current,{[Zr.Forwards]:()=>{var A;qt(x,et.First)===to.Error&&((A=i.afterPanelSentinel.current)==null||A.focus())},[Zr.Backwards]:()=>{var A;(A=i.button)==null||A.focus({preventScroll:!0})}})}S()}),O=re(()=>{let x=d.current;if(!x)return;function S(){Re($.current,{[Zr.Forwards]:()=>{var A;if(!i.button)return;let k=F0(),N=k.indexOf(i.button),P=k.slice(0,N+1),I=[...k.slice(N+1),...P];for(let E of I.slice())if(E.dataset.headlessuiFocusGuard==="true"||(A=i.panel)!=null&&A.contains(E)){let R=I.indexOf(E);R!==-1&&I.splice(R,1)}qt(I,et.First,{sorted:!1})},[Zr.Backwards]:()=>{var A;qt(x,et.Previous)===to.Error&&((A=i.button)==null||A.focus())}})}S()});return Y.createElement(V0.Provider,{value:n},w&&u&&Y.createElement(Ca,{id:f,ref:i.beforePanelSentinel,features:Ea.Focusable,"data-headlessui-focus-guard":!0,as:"button",type:"button",onFocus:C}),Fe({ourProps:_,theirProps:o,slot:b,defaultTag:jee,features:Fee,visible:w,name:"Popover.Panel"}),w&&u&&Y.createElement(Ca,{id:c,ref:i.afterPanelSentinel,features:Ea.Focusable,"data-headlessui-focus-guard":!0,as:"button",type:"button",onFocus:O}))}let Uee="div";function zee(e,t){let r=p.useRef(null),n=We(r,t),[a,o]=p.useState([]),i=re(g=>{o(m=>{let w=m.indexOf(g);if(w!==-1){let v=m.slice();return v.splice(w,1),v}return m})}),s=re(g=>(o(m=>[...m,g]),()=>i(g))),l=re(()=>{var g;let m=Ah(r);if(!m)return!1;let w=m.activeElement;return(g=r.current)!=null&&g.contains(w)?!0:a.some(v=>{var b,_;return((b=m.getElementById(v.buttonId.current))==null?void 0:b.contains(w))||((_=m.getElementById(v.panelId.current))==null?void 0:_.contains(w))})}),u=re(g=>{for(let m of a)m.buttonId.current!==g&&m.close()}),f=p.useMemo(()=>({registerPopover:s,unregisterPopover:i,isFocusWithinPopoverGroup:l,closeOthers:u}),[s,i,l,u]),c=p.useMemo(()=>({}),[]),d=e,h={ref:n};return Y.createElement(JE.Provider,{value:f},Fe({ourProps:h,theirProps:d,slot:c,defaultTag:Uee,name:"Popover.Group"}))}let Vee=Be(Pee),Wee=Be(Nee),Hee=Be(Dee),Gee=Be(Bee),Kee=Be(zee),An=Object.assign(Vee,{Button:Wee,Overlay:Hee,Panel:Gee,Group:Kee});function qee(e=0){let[t,r]=p.useState(e),n=Oh(),a=p.useCallback(l=>{n.current&&r(u=>u|l)},[t,n]),o=p.useCallback(l=>!!(t&l),[t]),i=p.useCallback(l=>{n.current&&r(u=>u&~l)},[r,n]),s=p.useCallback(l=>{n.current&&r(u=>u^l)},[r]);return{flags:t,addFlag:a,hasFlag:o,removeFlag:i,toggleFlag:s}}let bD=p.createContext(null);function wD(){let e=p.useContext(bD);if(e===null){let t=new Error("You used a