@openpawlabs/diy-guides-ui 1.5.5 → 1.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/GuideLayout/GuideLayout.d.ts +9 -4
- package/dist/components/GuideLayout/GuideLayout.d.ts.map +1 -1
- package/dist/components/GuideLayout/GuideLayout.stories.d.ts +2 -1
- package/dist/components/GuideLayout/GuideLayout.stories.d.ts.map +1 -1
- package/dist/diy-guides-ui.cjs +1 -1
- package/dist/diy-guides-ui.cjs.map +1 -1
- package/dist/diy-guides-ui.js +443 -430
- package/dist/diy-guides-ui.js.map +1 -1
- package/dist/stories/Welcome.stories.d.ts.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/dist/diy-guides-ui.cjs
CHANGED
|
@@ -25,5 +25,5 @@
|
|
|
25
25
|
*
|
|
26
26
|
* This source code is licensed under the MIT license found in the
|
|
27
27
|
* LICENSE file in the root directory of this source tree.
|
|
28
|
-
*/var ji;function Fh(){return ji||(ji=1,process.env.NODE_ENV!=="production"&&(function(){function t(p,g){return p===g&&(p!==0||1/p===1/g)||p!==p&&g!==g}function e(p,g){d||o.startTransition===void 0||(d=!0,console.error("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var y=g();if(!f){var v=g();i(y,v)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),f=!0)}v=l({inst:{value:y,getSnapshot:g}});var w=v[0].inst,x=v[1];return c(function(){w.value=y,w.getSnapshot=g,n(w)&&x({inst:w})},[p,y,g]),s(function(){return n(w)&&x({inst:w}),p(function(){n(w)&&x({inst:w})})},[p]),u(y),y}function n(p){var g=p.getSnapshot;p=p.value;try{var y=g();return!i(p,y)}catch{return!0}}function r(p,g){return g()}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var o=a,i=typeof Object.is=="function"?Object.is:t,l=o.useState,s=o.useEffect,c=o.useLayoutEffect,u=o.useDebugValue,d=!1,f=!1,b=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?r:e;$r.useSyncExternalStore=o.useSyncExternalStore!==void 0?o.useSyncExternalStore:b,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()),$r}var _i;function jh(){return _i||(_i=1,process.env.NODE_ENV==="production"?bn.exports=Oh():bn.exports=Fh()),bn.exports}var _h=jh();const ba=a.createContext(!1),Gt=a.createContext(null);function Bh(t){if(a.useContext(Gt))return t.content;let{collection:n,document:r}=Uh(t.createCollection);return a.createElement(a.Fragment,null,a.createElement(nf,null,a.createElement(Gt.Provider,{value:r},t.content)),a.createElement(Vh,{render:t.children,collection:n}))}function Vh({collection:t,render:e}){return e(t)}function zh(t,e,n){let r=Ze(),o=a.useRef(r);o.current=r;let i=a.useCallback(()=>o.current?n():e(),[e,n]);return _h.useSyncExternalStore(t,i)}const Hh=typeof a.useSyncExternalStore=="function"?a.useSyncExternalStore:zh;function Uh(t){let[e]=a.useState(()=>new Kh((t==null?void 0:t())||new Lh)),n=a.useCallback(l=>e.subscribe(l),[e]),r=a.useCallback(()=>{let l=e.getCollection();return e.isSSR&&e.resetAfterSSR(),l},[e]),o=a.useCallback(()=>(e.isSSR=!0,e.getCollection()),[e]);return{collection:Hh(n,r,o),document:e}}const Yr=a.createContext(null);function Wh(t){var n;return n=class extends St{},n.type=t,n}function ma(t,e,n,r,o,i){typeof t=="string"&&(t=Wh(t));let l=a.useCallback(c=>{c==null||c.setProps(e,n,t,r,i)},[e,n,r,i,t]),s=a.useContext(Yr);if(s){let c=s.ownerDocument.nodesByProps.get(e);return c||(c=s.ownerDocument.createElement(t.type),c.setProps(e,n,t,r,i),s.appendChild(c),s.ownerDocument.updateCollection(),s.ownerDocument.nodesByProps.set(e,c)),o?a.createElement(Yr.Provider,{value:c},o):null}return a.createElement(t.type,{ref:l},o)}function ga(t,e){let n=({node:o})=>e(o.props,o.props.ref,o),r=a.forwardRef((o,i)=>{let l=a.useContext(Fr);if(!a.useContext(ba)){if(e.length>=3)throw new Error(e.name+" cannot be rendered outside a collection.");return e(o,i)}return ma(t,o,i,"children"in o?o.children:null,null,c=>a.createElement(Fr.Provider,{value:l},a.createElement(n,{node:c})))});return r.displayName=e.name,r}function ya(t,e,n=va){let r=({node:i})=>e(i.props,i.props.ref,i),o=a.forwardRef((i,l)=>{let s=n(i);return ma(t,i,l,null,s,c=>a.createElement(r,{node:c}))??a.createElement(a.Fragment,null)});return o.displayName=e.name,o}function va(t){return pa({...t,addIdAndValue:!0})}const Bi=a.createContext(null);function Gh(t){let e=a.useContext(Bi),n=((e==null?void 0:e.dependencies)||[]).concat(t.dependencies),r=t.idScope??(e==null?void 0:e.idScope),o=va({...t,idScope:r,dependencies:n});return a.useContext(Gt)&&(o=a.createElement(qh,null,o)),e=a.useMemo(()=>({dependencies:n,idScope:r}),[r,...n]),a.createElement(Bi.Provider,{value:e},o)}function qh({children:t}){let e=a.useContext(Gt),n=a.useMemo(()=>a.createElement(Gt.Provider,{value:null},a.createElement(ba.Provider,{value:!0},t)),[t]);return Ze()?a.createElement(Yr.Provider,{value:e},n):Yt.createPortal(n,e)}const Yh=a.createContext(null),Xh={CollectionRoot({collection:t,renderDropIndicator:e}){return Vi(t,null,e)},CollectionBranch({collection:t,parent:e,renderDropIndicator:n}){return Vi(t,e,n)}};function Vi(t,e,n){return pa({items:e?t.getChildren(e.key):t,dependencies:[n],children(r){if(r.type==="content")return a.createElement(a.Fragment,null);let o=r.render(r);return!n||r.type!=="item"?o:a.createElement(a.Fragment,null,n({type:"item",key:r.key,dropPosition:"before"}),o,Zh(t,r,n))}})}function Zh(t,e,n){let r=e.key,o=t.getKeyAfter(r),i=o!=null?t.getItem(o):null;for(;i!=null&&i.type!=="item";)o=t.getKeyAfter(i.key),i=o!=null?t.getItem(o):null;let l=e.nextKey!=null?t.getItem(e.nextKey):null;for(;l!=null&&l.type!=="item";)l=l.nextKey!=null?t.getItem(l.nextKey):null;let s=[];if(l==null){let c=e;for(;(c==null?void 0:c.type)==="item"&&(!i||c.parentKey!==i.parentKey&&i.level<c.level);){let u=n({type:"item",key:c.key,dropPosition:"after"});a.isValidElement(u)&&s.push(a.cloneElement(u,{key:`${c.key}-after`})),c=c.parentKey!=null?t.getItem(c.parentKey):null}}return s}const Qn=a.createContext(Xh);function Jh(t){return a.useMemo(()=>t!=null?new Set([t]):null,[t])}function xa(t){let e=ep(Q(t));e!==t&&(e&&Qh(e,t),t&&$a(t,e))}function Qh(t,e){t.dispatchEvent(new FocusEvent("blur",{relatedTarget:e})),t.dispatchEvent(new FocusEvent("focusout",{bubbles:!0,relatedTarget:e}))}function $a(t,e){t.dispatchEvent(new FocusEvent("focus",{relatedTarget:e})),t.dispatchEvent(new FocusEvent("focusin",{bubbles:!0,relatedTarget:e}))}function ep(t){let e=ne(t),n=e==null?void 0:e.getAttribute("aria-activedescendant");return n&&t.getElementById(n)||e}const zi=a.createContext(null),tp=a.createContext(null),np=a.createContext({}),rp=a.createContext({}),op=a.createContext(null);function ip(t){let e=a.useRef({});return a.createElement(op.Provider,{value:e},t.children)}const lp=a.createContext({isSelected:!1});function sp(t){let e=ae(t,{labelable:!0}),n;return t.orientation==="vertical"&&(n="vertical"),t.elementType!=="hr"?{separatorProps:{...e,role:"separator","aria-orientation":n}}:{separatorProps:e}}const Eo=a.createContext({}),Ao=class Ao extends St{filter(e,n){let r=n.getItem(this.prevKey);if(r&&r.type!=="separator"){let o=this.clone();return n.addDescendants(o,e),o}return null}};Ao.type="separator";let Xr=Ao;const ap=ga(Xr,function(e,n){[e,n]=Me(e,n,Eo);let{elementType:r,orientation:o,style:i,className:l,slot:s,...c}=e,u=r||"hr";u==="hr"&&o==="vertical"&&(u="div");let d=pe[u],{separatorProps:f}=sp({...c,elementType:r,orientation:o}),b=ae(e,{global:!0});return a.createElement(d,{render:e.render,...Y(b,f),style:i,className:l??"react-aria-Separator",ref:n,slot:s||void 0})}),wa=a.createContext({});var Ea={};Ea={longPressMessage:"اضغط مطولاً أو اضغط على Alt + السهم لأسفل لفتح القائمة"};var Ca={};Ca={longPressMessage:"Натиснете продължително или натиснете Alt+ стрелка надолу, за да отворите менюто"};var Sa={};Sa={longPressMessage:"Dlouhým stiskem nebo stisknutím kláves Alt + šipka dolů otevřete nabídku"};var Pa={};Pa={longPressMessage:"Langt tryk eller tryk på Alt + pil ned for at åbne menuen"};var ka={};ka={longPressMessage:"Drücken Sie lange oder drücken Sie Alt + Nach-unten, um das Menü zu öffnen"};var Ta={};Ta={longPressMessage:"Πιέστε παρατεταμένα ή πατήστε Alt + κάτω βέλος για να ανοίξετε το μενού"};var Ma={};Ma={longPressMessage:"Long press or press Alt + ArrowDown to open menu"};var Ra={};Ra={longPressMessage:"Mantenga pulsado o pulse Alt + flecha abajo para abrir el menú"};var Da={};Da={longPressMessage:"Menüü avamiseks vajutage pikalt või vajutage klahve Alt + allanool"};var Na={};Na={longPressMessage:"Avaa valikko painamalla pohjassa tai näppäinyhdistelmällä Alt + Alanuoli"};var Ia={};Ia={longPressMessage:"Appuyez de manière prolongée ou appuyez sur Alt + Flèche vers le bas pour ouvrir le menu."};var La={};La={longPressMessage:"לחץ לחיצה ארוכה או הקש Alt + ArrowDown כדי לפתוח את התפריט"};var Ka={};Ka={longPressMessage:"Dugo pritisnite ili pritisnite Alt + strelicu prema dolje za otvaranje izbornika"};var Aa={};Aa={longPressMessage:"Nyomja meg hosszan, vagy nyomja meg az Alt + lefele nyíl gombot a menü megnyitásához"};var Oa={};Oa={longPressMessage:"Premi a lungo o premi Alt + Freccia giù per aprire il menu"};var Fa={};Fa={longPressMessage:"長押しまたは Alt+下矢印キーでメニューを開く"};var ja={};ja={longPressMessage:"길게 누르거나 Alt + 아래쪽 화살표를 눌러 메뉴 열기"};var _a={};_a={longPressMessage:"Norėdami atidaryti meniu, nuspaudę palaikykite arba paspauskite „Alt + ArrowDown“."};var Ba={};Ba={longPressMessage:"Lai atvērtu izvēlni, turiet nospiestu vai nospiediet taustiņu kombināciju Alt + lejupvērstā bultiņa"};var Va={};Va={longPressMessage:"Langt trykk eller trykk Alt + PilNed for å åpne menyen"};var za={};za={longPressMessage:"Druk lang op Alt + pijl-omlaag of druk op Alt om het menu te openen"};var Ha={};Ha={longPressMessage:"Naciśnij i przytrzymaj lub naciśnij klawisze Alt + Strzałka w dół, aby otworzyć menu"};var Ua={};Ua={longPressMessage:"Pressione e segure ou pressione Alt + Seta para baixo para abrir o menu"};var Wa={};Wa={longPressMessage:"Prima continuamente ou prima Alt + Seta Para Baixo para abrir o menu"};var Ga={};Ga={longPressMessage:"Apăsați lung sau apăsați pe Alt + săgeată în jos pentru a deschide meniul"};var qa={};qa={longPressMessage:"Нажмите и удерживайте или нажмите Alt + Стрелка вниз, чтобы открыть меню"};var Ya={};Ya={longPressMessage:"Ponuku otvoríte dlhým stlačením alebo stlačením klávesu Alt + klávesu so šípkou nadol"};var Xa={};Xa={longPressMessage:"Za odprtje menija pritisnite in držite gumb ali pritisnite Alt+puščica navzdol"};var Za={};Za={longPressMessage:"Dugo pritisnite ili pritisnite Alt + strelicu prema dole da otvorite meni"};var Ja={};Ja={longPressMessage:"Håll nedtryckt eller tryck på Alt + pil nedåt för att öppna menyn"};var Qa={};Qa={longPressMessage:"Menüyü açmak için uzun basın veya Alt + Aşağı Ok tuşuna basın"};var ec={};ec={longPressMessage:"Довго або звичайно натисніть комбінацію клавіш Alt і стрілка вниз, щоб відкрити меню"};var tc={};tc={longPressMessage:"长按或按 Alt + 向下方向键以打开菜单"};var nc={};nc={longPressMessage:"長按或按 Alt+向下鍵以開啟功能表"};var rc={};rc={"ar-AE":Ea,"bg-BG":Ca,"cs-CZ":Sa,"da-DK":Pa,"de-DE":ka,"el-GR":Ta,"en-US":Ma,"es-ES":Ra,"et-EE":Da,"fi-FI":Na,"fr-FR":Ia,"he-IL":La,"hr-HR":Ka,"hu-HU":Aa,"it-IT":Oa,"ja-JP":Fa,"ko-KR":ja,"lt-LT":_a,"lv-LV":Ba,"nb-NO":Va,"nl-NL":za,"pl-PL":Ha,"pt-BR":Ua,"pt-PT":Wa,"ro-RO":Ga,"ru-RU":qa,"sk-SK":Ya,"sl-SI":Xa,"sr-SP":Za,"sv-SE":Ja,"tr-TR":Qa,"uk-UA":ec,"zh-CN":tc,"zh-TW":nc};const cp=500;function oc(t){let{isDisabled:e,onLongPressStart:n,onLongPressEnd:r,onLongPress:o,threshold:i=cp,accessibilityDescription:l}=t;const s=a.useRef(void 0);let{addGlobalListener:c,removeGlobalListener:u}=Wn(),{pressProps:d}=Xe({isDisabled:e,onPressStart(b){if(b.continuePropagation(),(b.pointerType==="mouse"||b.pointerType==="touch")&&(n&&n({...b,type:"longpressstart"}),s.current=setTimeout(()=>{b.target.dispatchEvent(new PointerEvent("pointercancel",{bubbles:!0})),Q(b.target).activeElement!==b.target&&de(b.target),o&&o({...b,type:"longpress"}),s.current=void 0},i),b.pointerType==="touch")){let p=y=>{y.preventDefault()},g=fe(b.target);c(b.target,"contextmenu",p,{once:!0}),c(g,"pointerup",()=>{setTimeout(()=>{u(b.target,"contextmenu",p)},30)},{once:!0})}},onPressEnd(b){s.current&&clearTimeout(s.current),r&&(b.pointerType==="mouse"||b.pointerType==="touch")&&r({...b,type:"longpressend"})}}),f=Au(o&&!e?l:void 0);return{longPressProps:Y(d,f)}}function ic(t,e,n){let{type:r}=t,{isOpen:o}=e;a.useEffect(()=>{n&&n.current&&vs.set(n.current,e.close)});let i;r==="menu"?i=!0:r==="listbox"&&(i="listbox");let l=he();return{triggerProps:{"aria-haspopup":i,"aria-expanded":o,"aria-controls":o?l:void 0,onPress:e.toggle},overlayProps:{id:l}}}function up(t){return t&&t.__esModule?t.default:t}function dp(t,e,n){let{type:r="menu",isDisabled:o,trigger:i="press"}=t,l=he(),{triggerProps:s,overlayProps:c}=ic({type:r},e,n),u=p=>{if(!o&&!(i==="longPress"&&!p.altKey)&&n&&n.current)switch(p.key){case"Enter":case" ":if(i==="longPress"||p.isDefaultPrevented())return;case"ArrowDown":"continuePropagation"in p||p.stopPropagation(),p.preventDefault(),e.toggle("first");break;case"ArrowUp":"continuePropagation"in p||p.stopPropagation(),p.preventDefault(),e.toggle("last");break;default:"continuePropagation"in p&&p.continuePropagation()}},d=la(up(rc),"@react-aria/menu"),{longPressProps:f}=oc({isDisabled:o||i!=="longPress",accessibilityDescription:d.format("longPressMessage"),onLongPressStart(){e.close()},onLongPress(){e.open("first")}}),b={preventFocusOnPress:!0,onPressStart(p){p.pointerType!=="touch"&&p.pointerType!=="keyboard"&&!o&&(de(p.target),e.open(p.pointerType==="virtual"?"first":null))},onPress(p){p.pointerType==="touch"&&!o&&(de(p.target),e.toggle())}};return delete s.onPress,{menuTriggerProps:{...s,...i==="press"?b:f,id:l,onKeyDown:u},menuProps:{...c,"aria-labelledby":l,autoFocus:e.focusStrategy||!0,onClose:e.close}}}const lc=new WeakMap;function Zr(t){return Qc()?t.altKey:t.ctrlKey}function En(t,e){var o,i;let n=`[data-key="${CSS.escape(String(e))}"]`,r=(o=t.current)==null?void 0:o.dataset.collection;return r&&(n=`[data-collection="${CSS.escape(r)}"]${n}`),(i=t.current)==null?void 0:i.querySelector(n)}const sc=new WeakMap;function fp(t){let e=he();return sc.set(t,e),e}function hp(t){return sc.get(t)}const pp=1e3;function bp(t){let{keyboardDelegate:e,selectionManager:n,onTypeSelect:r}=t,o=a.useRef({search:"",timeout:void 0}).current,i=l=>{let s=mp(l.key);if(!(!s||l.ctrlKey||l.metaKey||!H(l.currentTarget,F(l))||o.search.length===0&&s===" ")){if(s===" "&&o.search.trim().length>0&&(l.preventDefault(),"continuePropagation"in l||l.stopPropagation()),o.search+=s,e.getKeyForSearch!=null){let c=e.getKeyForSearch(o.search,n.focusedKey);c==null&&(c=e.getKeyForSearch(o.search)),c!=null&&(n.setFocusedKey(c),r&&r(c))}clearTimeout(o.timeout),o.timeout=setTimeout(()=>{o.search=""},pp)}};return{typeSelectProps:{onKeyDownCapture:e.getKeyForSearch?i:void 0}}}function mp(t){return t.length===1||!/^[A-Z]/i.test(t)?t:""}function gp(t){let{selectionManager:e,keyboardDelegate:n,ref:r,autoFocus:o=!1,shouldFocusWrap:i=!1,disallowEmptySelection:l=!1,disallowSelectAll:s=!1,escapeKeyBehavior:c="clearSelection",selectOnFocus:u=e.selectionBehavior==="replace",disallowTypeAhead:d=!1,shouldUseVirtualFocus:f,allowsTabNavigation:b=!1,scrollRef:p=r,linkBehavior:g="action"}=t,{direction:y}=dt(),v=Xt(),w=m=>{var I,C,D,$,S,L,U,W,G,ee,le,Z,be,Ie;if(m.altKey&&m.key==="Tab"&&m.preventDefault(),!r.current||!H(r.current,F(m)))return;const E=(z,$e)=>{if(z!=null){if(e.isLink(z)&&g==="selection"&&u&&!Zr(m)){Yt.flushSync(()=>{e.setFocusedKey(z,$e)});let me=En(r,z),et=e.getItemProps(z);me&&v.open(me,m,et.href,et.routerOptions);return}if(e.setFocusedKey(z,$e),e.isLink(z)&&g==="override")return;m.shiftKey&&e.selectionMode==="multiple"?e.extendSelection(z):u&&!Zr(m)&&e.replaceSelection(z)}};switch(m.key){case"ArrowDown":if(n.getKeyBelow){let z=e.focusedKey!=null?(I=n.getKeyBelow)==null?void 0:I.call(n,e.focusedKey):(C=n.getFirstKey)==null?void 0:C.call(n);z==null&&i&&(z=(D=n.getFirstKey)==null?void 0:D.call(n,e.focusedKey)),z!=null&&(m.preventDefault(),E(z))}break;case"ArrowUp":if(n.getKeyAbove){let z=e.focusedKey!=null?($=n.getKeyAbove)==null?void 0:$.call(n,e.focusedKey):(S=n.getLastKey)==null?void 0:S.call(n);z==null&&i&&(z=(L=n.getLastKey)==null?void 0:L.call(n,e.focusedKey)),z!=null&&(m.preventDefault(),E(z))}break;case"ArrowLeft":if(n.getKeyLeftOf){let z=e.focusedKey!=null?(U=n.getKeyLeftOf)==null?void 0:U.call(n,e.focusedKey):(W=n.getFirstKey)==null?void 0:W.call(n);z==null&&i&&(z=y==="rtl"?(G=n.getFirstKey)==null?void 0:G.call(n,e.focusedKey):(ee=n.getLastKey)==null?void 0:ee.call(n,e.focusedKey)),z!=null&&(m.preventDefault(),E(z,y==="rtl"?"first":"last"))}break;case"ArrowRight":if(n.getKeyRightOf){let z=e.focusedKey!=null?(le=n.getKeyRightOf)==null?void 0:le.call(n,e.focusedKey):(Z=n.getFirstKey)==null?void 0:Z.call(n);z==null&&i&&(z=y==="rtl"?(be=n.getLastKey)==null?void 0:be.call(n,e.focusedKey):(Ie=n.getFirstKey)==null?void 0:Ie.call(n,e.focusedKey)),z!=null&&(m.preventDefault(),E(z,y==="rtl"?"last":"first"))}break;case"Home":if(n.getFirstKey){if(e.focusedKey===null&&m.shiftKey)return;m.preventDefault();let z=n.getFirstKey(e.focusedKey,bt(m));e.setFocusedKey(z),z!=null&&(bt(m)&&m.shiftKey&&e.selectionMode==="multiple"?e.extendSelection(z):u&&e.replaceSelection(z))}break;case"End":if(n.getLastKey){if(e.focusedKey===null&&m.shiftKey)return;m.preventDefault();let z=n.getLastKey(e.focusedKey,bt(m));e.setFocusedKey(z),z!=null&&(bt(m)&&m.shiftKey&&e.selectionMode==="multiple"?e.extendSelection(z):u&&e.replaceSelection(z))}break;case"PageDown":if(n.getKeyPageBelow&&e.focusedKey!=null){let z=n.getKeyPageBelow(e.focusedKey);z!=null&&(m.preventDefault(),E(z))}break;case"PageUp":if(n.getKeyPageAbove&&e.focusedKey!=null){let z=n.getKeyPageAbove(e.focusedKey);z!=null&&(m.preventDefault(),E(z))}break;case"a":bt(m)&&e.selectionMode==="multiple"&&s!==!0&&(m.preventDefault(),e.selectAll());break;case"Escape":c==="clearSelection"&&!l&&e.selectedKeys.size!==0&&(m.stopPropagation(),m.preventDefault(),e.clearSelection());break;case"Tab":if(!b){if(m.shiftKey)r.current.focus();else{let z=Fe(r.current,{tabbable:!0}),$e,me;do me=z.lastChild(),me&&($e=me);while(me);let et=ne();$e&&(!$t($e)||et&&!Ll(et))&&de($e)}break}}},x=a.useRef({top:0,left:0});It(p,"scroll",()=>{var m,E;x.current={top:((m=p.current)==null?void 0:m.scrollTop)??0,left:((E=p.current)==null?void 0:E.scrollLeft)??0}});let P=m=>{var E,I;if(e.isFocused){H(m.currentTarget,F(m))||e.setFocused(!1);return}if(H(m.currentTarget,F(m))){if(e.setFocused(!0),e.focusedKey==null){let C=$=>{$!=null&&(e.setFocusedKey($),u&&!e.isSelected($)&&e.replaceSelection($))},D=m.relatedTarget;D&&m.currentTarget.compareDocumentPosition(D)&Node.DOCUMENT_POSITION_FOLLOWING?C(e.lastSelectedKey??((E=n.getLastKey)==null?void 0:E.call(n))):C(e.firstSelectedKey??((I=n.getFirstKey)==null?void 0:I.call(n)))}else p.current&&(p.current.scrollTop=x.current.top,p.current.scrollLeft=x.current.left);if(e.focusedKey!=null&&p.current){let C=En(r,e.focusedKey);C instanceof HTMLElement&&(!$t(C)&&!f&&de(C),Ht()==="keyboard"&&Xo(C,{containingElement:r.current}))}}},T=m=>{H(m.currentTarget,m.relatedTarget)||e.setFocused(!1)},R=a.useRef(!1);It(r,Zc,f?m=>{let{detail:E}=m;m.stopPropagation(),e.setFocused(!0),(E==null?void 0:E.focusStrategy)==="first"&&(R.current=!0)}:void 0),Yo(()=>{var m;if(R.current){let E=((m=n.getFirstKey)==null?void 0:m.call(n))??null;if(E==null){let I=ne();xa(r.current),$a(I,null),e.collection.size>0&&(R.current=!1)}else e.setFocusedKey(E),R.current=!1}},[e.collection]),Yo(()=>{e.collection.size>0&&(R.current=!1)},[e.focusedKey]),It(r,Xc,f?m=>{var E;m.stopPropagation(),e.setFocused(!1),(E=m.detail)!=null&&E.clearFocusKey&&e.setFocusedKey(null)}:void 0);const K=a.useRef(o),M=a.useRef(!1);a.useEffect(()=>{var m,E;if(K.current){let I=null;o==="first"&&(I=((m=n.getFirstKey)==null?void 0:m.call(n))??null),o==="last"&&(I=((E=n.getLastKey)==null?void 0:E.call(n))??null);let C=e.selectedKeys;if(C.size){for(let D of C)if(e.canSelectItem(D)){I=D;break}}e.setFocused(!0),e.setFocusedKey(I),I==null&&!f&&r.current&&Ye(r.current),e.collection.size>0&&(K.current=!1,M.current=!0)}});let N=a.useRef(e.focusedKey),O=a.useRef(null);a.useEffect(()=>{if(e.isFocused&&e.focusedKey!=null&&(e.focusedKey!==N.current||M.current)&&p.current&&r.current){let m=Ht(),E=En(r,e.focusedKey);if(!(E instanceof HTMLElement))return;(m==="keyboard"||M.current)&&(O.current&&cancelAnimationFrame(O.current),O.current=requestAnimationFrame(()=>{p.current&&(xn(p.current,E),m!=="virtual"&&Xo(E,{containingElement:r.current}))}))}!f&&e.isFocused&&e.focusedKey==null&&N.current!=null&&r.current&&Ye(r.current),N.current=e.focusedKey,M.current=!1}),a.useEffect(()=>()=>{O.current&&cancelAnimationFrame(O.current)},[]),It(r,"react-aria-focus-scope-restore",m=>{m.preventDefault(),e.setFocused(!0)});let k={onKeyDown:w,onFocus:P,onBlur:T,onMouseDown(m){p.current===F(m)&&m.preventDefault()}},{typeSelectProps:A}=bp({keyboardDelegate:n,selectionManager:e});d||(k=Y(A,k));let V;f||(V=e.focusedKey==null?0:-1);let j=fp(e.collection);return{collectionProps:Y(k,{tabIndex:V,"data-collection":j})}}class Hi{constructor(e){this.ref=e}getItemRect(e){let n=this.ref.current;if(!n)return null;let r=e!=null?En(this.ref,e):null;if(!r)return null;let o=n.getBoundingClientRect(),i=r.getBoundingClientRect();return{x:i.left-o.left-n.clientLeft+n.scrollLeft,y:i.top-o.top-n.clientTop+n.scrollTop,width:i.width,height:i.height}}getContentSize(){let e=this.ref.current;return{width:(e==null?void 0:e.scrollWidth)??0,height:(e==null?void 0:e.scrollHeight)??0}}getVisibleRect(){let e=this.ref.current;return{x:(e==null?void 0:e.scrollLeft)??0,y:(e==null?void 0:e.scrollTop)??0,width:(e==null?void 0:e.clientWidth)??0,height:(e==null?void 0:e.clientHeight)??0}}}class yp{constructor(...e){if(e.length===1){let n=e[0];this.collection=n.collection,this.ref=n.ref,this.collator=n.collator,this.disabledKeys=n.disabledKeys||new Set,this.disabledBehavior=n.disabledBehavior||"all",this.orientation=n.orientation||"vertical",this.direction=n.direction,this.layout=n.layout||"stack",this.layoutDelegate=n.layoutDelegate||new Hi(n.ref)}else this.collection=e[0],this.disabledKeys=e[1],this.ref=e[2],this.collator=e[3],this.layout="stack",this.orientation="vertical",this.disabledBehavior="all",this.layoutDelegate=new Hi(this.ref);this.layout==="stack"&&this.orientation==="vertical"&&(this.getKeyLeftOf=void 0,this.getKeyRightOf=void 0)}isDisabled(e){var n,r;return this.disabledBehavior==="all"&&(((n=e.props)==null?void 0:n.isDisabled)||this.disabledKeys.has(e.key))&&((r=e.props)==null?void 0:r.disabledBehavior)!=="selection"}findNextNonDisabled(e,n,r=!1){let o=e;for(;o!=null;){let i=this.collection.getItem(o);if((i==null?void 0:i.type)==="item"&&(r||!this.isDisabled(i)))return o;o=n(o)}return null}getNextKey(e,n){let r=e;return r=this.collection.getKeyAfter(r),this.findNextNonDisabled(r,o=>this.collection.getKeyAfter(o),n==null?void 0:n.includeDisabled)}getPreviousKey(e,n){let r=e;return r=this.collection.getKeyBefore(r),this.findNextNonDisabled(r,o=>this.collection.getKeyBefore(o),n==null?void 0:n.includeDisabled)}findKey(e,n,r){let o=e,i=this.layoutDelegate.getItemRect(o);if(!i||o==null)return null;let l=i;do{if(o=n(o),o==null)break;i=this.layoutDelegate.getItemRect(o)}while(i&&r(l,i)&&o!=null);return o}isSameRow(e,n){return e.y===n.y||e.x!==n.x}isSameColumn(e,n){return e.x===n.x||e.y!==n.y}getKeyBelow(e,n){return this.layout==="grid"&&this.orientation==="vertical"?this.findKey(e,r=>this.getNextKey(r,n),this.isSameRow):this.getNextKey(e,n)}getKeyAbove(e,n){return this.layout==="grid"&&this.orientation==="vertical"?this.findKey(e,r=>this.getPreviousKey(r,n),this.isSameRow):this.getPreviousKey(e,n)}getNextColumn(e,n,r){return n?this.getPreviousKey(e,r):this.getNextKey(e,r)}getKeyRightOf(e,n){let r=this.direction==="ltr"?"getKeyRightOf":"getKeyLeftOf";return this.layoutDelegate[r]?(e=this.layoutDelegate[r](e),this.findNextNonDisabled(e,o=>this.layoutDelegate[r](o),n==null?void 0:n.includeDisabled)):this.layout==="grid"?this.orientation==="vertical"?this.getNextColumn(e,this.direction==="rtl",n):this.findKey(e,o=>this.getNextColumn(o,this.direction==="rtl",n),this.isSameColumn):this.orientation==="horizontal"?this.getNextColumn(e,this.direction==="rtl",n):null}getKeyLeftOf(e,n){let r=this.direction==="ltr"?"getKeyLeftOf":"getKeyRightOf";return this.layoutDelegate[r]?(e=this.layoutDelegate[r](e),this.findNextNonDisabled(e,o=>this.layoutDelegate[r](o),n==null?void 0:n.includeDisabled)):this.layout==="grid"?this.orientation==="vertical"?this.getNextColumn(e,this.direction==="ltr",n):this.findKey(e,o=>this.getNextColumn(o,this.direction==="ltr",n),this.isSameColumn):this.orientation==="horizontal"?this.getNextColumn(e,this.direction==="ltr",n):null}getFirstKey(){let e=this.collection.getFirstKey();return this.findNextNonDisabled(e,n=>this.collection.getKeyAfter(n))}getLastKey(){let e=this.collection.getLastKey();return this.findNextNonDisabled(e,n=>this.collection.getKeyBefore(n))}getKeyPageAbove(e){let n=this.ref.current,r=this.layoutDelegate.getItemRect(e);if(!r)return null;if(n&&!st(n))return this.getFirstKey();let o=e;if(this.orientation==="horizontal"){let i=Math.max(0,r.x+r.width-this.layoutDelegate.getVisibleRect().width);for(;r&&r.x>i&&o!=null;)o=this.getKeyAbove(o),r=o==null?null:this.layoutDelegate.getItemRect(o)}else{let i=Math.max(0,r.y+r.height-this.layoutDelegate.getVisibleRect().height);for(;r&&r.y>i&&o!=null;)o=this.getKeyAbove(o),r=o==null?null:this.layoutDelegate.getItemRect(o)}return o??this.getFirstKey()}getKeyPageBelow(e){let n=this.ref.current,r=this.layoutDelegate.getItemRect(e);if(!r)return null;if(n&&!st(n))return this.getLastKey();let o=e;if(this.orientation==="horizontal"){let i=Math.min(this.layoutDelegate.getContentSize().width,r.x-r.width+this.layoutDelegate.getVisibleRect().width);for(;r&&r.x<i&&o!=null;)o=this.getKeyBelow(o),r=o==null?null:this.layoutDelegate.getItemRect(o)}else{let i=Math.min(this.layoutDelegate.getContentSize().height,r.y-r.height+this.layoutDelegate.getVisibleRect().height);for(;r&&r.y<i&&o!=null;)o=this.getKeyBelow(o),r=o==null?null:this.layoutDelegate.getItemRect(o)}return o??this.getLastKey()}getKeyForSearch(e,n){if(!this.collator)return null;let r=this.collection,o=n||this.getFirstKey();for(;o!=null;){let i=r.getItem(o);if(!i)return null;let l=i.textValue.slice(0,e.length);if(i.textValue&&this.collator.compare(l,e)===0)return o;o=this.getNextKey(o)}return null}}let wr=new Map;function vp(t){let{locale:e}=dt(),n=e+(t?Object.entries(t).sort((o,i)=>o[0]<i[0]?-1:1).join():"");if(wr.has(n))return wr.get(n);let r=new Intl.Collator(e,t);return wr.set(n,r),r}function xp(t){let{selectionManager:e,collection:n,disabledKeys:r,ref:o,keyboardDelegate:i,layoutDelegate:l,orientation:s}=t,c=vp({usage:"search",sensitivity:"base"}),u=e.disabledBehavior,d=a.useMemo(()=>i||new yp({collection:n,disabledKeys:r,disabledBehavior:u,ref:o,collator:c,layoutDelegate:l,orientation:s}),[i,l,n,r,o,c,u,s]),{collectionProps:f}=gp({...t,ref:o,selectionManager:e,keyboardDelegate:d});return{listProps:f}}function $p(t,e,n){let{shouldFocusWrap:r=!0,onKeyDown:o,onKeyUp:i,...l}=t;!t["aria-label"]&&!t["aria-labelledby"]&&process.env.NODE_ENV!=="production"&&console.warn("An aria-label or aria-labelledby prop is required for accessibility.");let s=ae(t,{labelable:!0}),{listProps:c}=xp({...l,ref:n,selectionManager:e.selectionManager,collection:e.collection,disabledKeys:e.disabledKeys,shouldFocusWrap:r,linkBehavior:"override"});return lc.set(e,{onClose:t.onClose,onAction:t.onAction,shouldUseVirtualFocus:t.shouldUseVirtualFocus}),{menuProps:Y(s,{onKeyDown:o,onKeyUp:i},{role:"menu",...c,onKeyDown:u=>{var d;(u.key!=="Escape"||t.shouldUseVirtualFocus)&&((d=c.onKeyDown)==null||d.call(c,u))}})}}function wp(t){let{id:e,selectionManager:n,key:r,ref:o,shouldSelectOnPressUp:i,shouldUseVirtualFocus:l,focus:s,isDisabled:c,onAction:u,allowsDifferentPressOrigin:d,linkBehavior:f="action"}=t,b=Xt();e=he(e);let p=S=>{if(S.pointerType==="keyboard"&&Zr(S))n.toggleSelection(r);else{if(n.selectionMode==="none")return;if(n.isLink(r)){if(f==="selection"&&o.current){let L=n.getItemProps(r);b.open(o.current,S,L.href,L.routerOptions),n.setSelectedKeys(n.selectedKeys);return}else if(f==="override"||f==="none")return}n.selectionMode==="single"?n.isSelected(r)&&!n.disallowEmptySelection?n.toggleSelection(r):n.replaceSelection(r):S&&S.shiftKey?n.extendSelection(r):n.selectionBehavior==="toggle"||S&&(bt(S)||S.pointerType==="touch"||S.pointerType==="virtual")?n.toggleSelection(r):n.replaceSelection(r)}};a.useEffect(()=>{r===n.focusedKey&&n.isFocused&&(l?xa(o.current):s?s():ne()!==o.current&&o.current&&Ye(o.current))},[o,r,n.focusedKey,n.childFocusStrategy,n.isFocused,l]),c=c||n.isDisabled(r);let g={};!l&&!c?g={tabIndex:r===n.focusedKey?0:-1,onFocus(S){F(S)===o.current&&n.setFocusedKey(r)}}:c&&(g.onMouseDown=S=>{S.preventDefault()}),a.useEffect(()=>{c&&n.focusedKey===r&&n.setFocusedKey(null)},[n,c,r]);let y=n.isLink(r)&&f==="override",v=u&&t.UNSTABLE_itemBehavior==="action",w=n.isLink(r)&&f!=="selection"&&f!=="none",x=!c&&n.canSelectItem(r)&&!y&&!v,P=(u||w)&&!c,T=P&&(n.selectionBehavior==="replace"?!x:!x||n.isEmpty),R=P&&x&&n.selectionBehavior==="replace",K=T||R,M=a.useRef(null),N=K&&x,O=a.useRef(!1),k=a.useRef(!1),A=n.getItemProps(r),V=S=>{var L;u&&(u(),(L=o.current)==null||L.dispatchEvent(new CustomEvent("react-aria-item-action",{bubbles:!0}))),w&&o.current&&b.open(o.current,S,A.href,A.routerOptions)},j={ref:o};if(i?(j.onPressStart=S=>{M.current=S.pointerType,O.current=N,S.pointerType==="keyboard"&&(!K||Wi(S.key))&&p(S)},d?(j.onPressUp=T?void 0:S=>{S.pointerType==="mouse"&&x&&p(S)},j.onPress=T?V:S=>{S.pointerType!=="keyboard"&&S.pointerType!=="mouse"&&x&&p(S)}):j.onPress=S=>{if(T||R&&S.pointerType!=="mouse"){if(S.pointerType==="keyboard"&&!Ui(S.key))return;V(S)}else S.pointerType!=="keyboard"&&x&&p(S)}):(j.onPressStart=S=>{M.current=S.pointerType,O.current=N,k.current=T,x&&(S.pointerType==="mouse"&&!T||S.pointerType==="keyboard"&&(!P||Wi(S.key)))&&p(S)},j.onPress=S=>{(S.pointerType==="touch"||S.pointerType==="pen"||S.pointerType==="virtual"||S.pointerType==="keyboard"&&K&&Ui(S.key)||S.pointerType==="mouse"&&k.current)&&(K?V(S):x&&p(S))}),g["data-collection"]=hp(n.collection),g["data-key"]=r,j.preventFocusOnPress=l,l&&(j=Y(j,{onPressStart(S){S.pointerType!=="touch"&&(n.setFocused(!0),n.setFocusedKey(r))},onPress(S){S.pointerType==="touch"&&(n.setFocused(!0),n.setFocusedKey(r))}})),A)for(let S of["onPressStart","onPressEnd","onPressChange","onPress","onPressUp","onClick"])A[S]&&(j[S]=Zt(j[S],A[S]));let{pressProps:m,isPressed:E}=Xe(j),I=R?S=>{M.current==="mouse"&&(S.stopPropagation(),S.preventDefault(),V(S))}:void 0,{longPressProps:C}=oc({isDisabled:!N,onLongPress(S){S.pointerType==="touch"&&(p(S),n.setSelectionBehavior("toggle"))}}),D=S=>{M.current==="touch"&&O.current&&S.preventDefault()},$=f!=="none"&&n.isLink(r)?S=>{_e.isOpening||S.preventDefault()}:void 0;return{itemProps:Y(g,x||T||l&&!c?m:{},N?C:{},{onDoubleClick:I,onDragStartCapture:D,onClick:$,id:e},l?{onMouseDown:S=>S.preventDefault()}:void 0),isPressed:E,isSelected:n.isSelected(r),isFocused:n.isFocused&&n.focusedKey===r,isDisabled:c,allowsSelection:x,hasAction:K}}function Ui(t){return t==="Enter"}function Wi(t){return t===" "}function Ep(t,e){return typeof e.getChildren=="function"?e.getChildren(t.key):t.childNodes}const Gi=new WeakMap;function Cp(t){let e=Gi.get(t);if(e!=null)return e;let n=0,r=o=>{for(let i of o)i.type==="section"?r(Ep(i,t)):i.type==="item"&&n++};return r(t),Gi.set(t,n),n}function Sp(t,e,n){let{id:r,key:o,closeOnSelect:i,shouldCloseOnSelect:l,isVirtualized:s,"aria-haspopup":c,onPressStart:u,onPressUp:d,onPress:f,onPressChange:b,onPressEnd:p,onClick:g,onHoverStart:y,onHoverChange:v,onHoverEnd:w,onKeyDown:x,onKeyUp:P,onFocus:T,onFocusChange:R,onBlur:K,selectionManager:M=e.selectionManager}=t,N=!!c,O=N&&t["aria-expanded"]==="true",k=t.isDisabled??M.isDisabled(o),A=t.isSelected??M.isSelected(o),V=lc.get(e),j=e.collection.getItem(o),m=t.onClose||V.onClose,E=Xt(),I=()=>{var te;if(!N&&((te=j==null?void 0:j.props)!=null&&te.onAction?j.props.onAction():t.onAction&&t.onAction(o),V.onAction)){let kt=V.onAction;kt(o)}},C="menuitem";N||(M.selectionMode==="single"?C="menuitemradio":M.selectionMode==="multiple"&&(C="menuitemcheckbox"));let D=vn(),$=vn(),S=vn(),L={id:r,"aria-disabled":k||void 0,role:C,"aria-label":t["aria-label"],"aria-labelledby":D,"aria-describedby":[t["aria-describedby"],$,S].filter(Boolean).join(" ")||void 0,"aria-controls":t["aria-controls"],"aria-haspopup":c,"aria-expanded":t["aria-expanded"]};if(M.selectionMode!=="none"&&!N&&(L["aria-checked"]=A),s){let te=Number(j==null?void 0:j.index);L["aria-posinset"]=Number.isNaN(te)?void 0:te+1,L["aria-setsize"]=Cp(e.collection)}let U=a.useRef(!1),W=te=>{b==null||b(te),U.current=te},G=a.useRef(null),ee=te=>{te.pointerType!=="keyboard"&&(G.current={pointerType:te.pointerType}),te.pointerType==="mouse"&&(U.current||te.target.click()),d==null||d(te)},le=te=>{var jo,_o;g==null||g(te),I(),Pl(te,E,j.props.href,j==null?void 0:j.props.routerOptions);let kt=((jo=G.current)==null?void 0:jo.pointerType)==="keyboard"?((_o=G.current)==null?void 0:_o.key)==="Enter"||M.selectionMode==="none"||M.isLink(o):M.selectionMode!=="multiple"||M.isLink(o);kt=l??i??kt,m&&!N&&kt&&m(),G.current=null},{itemProps:Z,isFocused:be}=wp({id:r,selectionManager:M,key:o,ref:n,shouldSelectOnPressUp:!0,allowsDifferentPressOrigin:!0,linkBehavior:"none",shouldUseVirtualFocus:V.shouldUseVirtualFocus}),{pressProps:Ie,isPressed:z}=Xe({onPressStart:u,onPress:f,onPressUp:ee,onPressChange:W,onPressEnd:p,isDisabled:k}),{hoverProps:$e}=en({isDisabled:k,onHoverStart(te){!zt()&&!(O&&c)&&(M.setFocused(!0),M.setFocusedKey(o)),y==null||y(te)},onHoverChange:v,onHoverEnd:w}),{keyboardProps:me}=hs({onKeyDown:te=>{if(te.repeat){te.continuePropagation();return}switch(te.key){case" ":G.current={pointerType:"keyboard",key:" "},F(te).click(),Or("keyboard");break;case"Enter":G.current={pointerType:"keyboard",key:"Enter"},F(te).tagName!=="A"&&F(te).click(),Or("keyboard");break;default:N||te.continuePropagation(),x==null||x(te);break}},onKeyUp:P}),{focusableProps:et}=Qt({onBlur:K,onFocus:T,onFocusChange:R},n),Fo=ae(j==null?void 0:j.props);delete Fo.id;let Vc=Sl(j==null?void 0:j.props);return{menuItemProps:{...L,...Y(Fo,Vc,N?{onFocus:Z.onFocus,"data-collection":Z["data-collection"],"data-key":Z["data-key"]}:Z,Ie,$e,me,et,V.shouldUseVirtualFocus||N?{onMouseDown:te=>te.preventDefault()}:void 0,k?void 0:{onClick:le}),tabIndex:Z.tabIndex!=null&&O&&!V.shouldUseVirtualFocus?-1:Z.tabIndex},labelProps:{id:D},descriptionProps:{id:$},keyboardShortcutProps:{id:S},isFocused:be,isFocusVisible:be&&M.isFocused&&zt()&&!O,isSelected:A,isPressed:z,isDisabled:k}}function Pp(t){let{heading:e,"aria-label":n}=t,r=he();return{itemProps:{role:"presentation"},headingProps:e?{id:r,role:"presentation"}:{},groupProps:{role:"group","aria-label":n,"aria-labelledby":e?r:void 0}}}const mn=2,kp=50,Tp=1e3,qi=Math.PI/12;function Mp(t){let{menuRef:e,submenuRef:n,isOpen:r,isDisabled:o}=t,i=a.useRef(void 0),l=a.useRef(void 0),s=a.useRef(0),c=a.useRef(void 0),u=a.useRef(void 0),d=a.useRef(void 0),f=a.useRef(2),[b,p]=a.useState(!1);Pn({ref:r?n:void 0,onResize:()=>{n.current&&(l.current=n.current.getBoundingClientRect(),d.current=void 0)}});let y=()=>{p(!1),f.current=mn,i.current=void 0},v=Ef(),w=Pe(x=>{b&&x.preventDefault()});a.useEffect(()=>{b&&e.current?e.current.style.pointerEvents="none":e.current.style.pointerEvents=""},[e,b]),J(()=>{let x=n.current,P=e.current;if(o||!x||!r||v!=="pointer"||!P){y();return}l.current=x.getBoundingClientRect();let T=R=>{if(R.pointerType==="touch"||R.pointerType==="pen")return;let K=Date.now();if(K-s.current<kp)return;clearTimeout(c.current),clearTimeout(u.current);let{clientX:M,clientY:N}=R;if(!i.current){i.current={x:M,y:N};return}if(!l.current)return;if(d.current||(d.current=M>l.current.right?"left":"right"),M<P.getBoundingClientRect().left||M>P.getBoundingClientRect().right||N<P.getBoundingClientRect().top||N>P.getBoundingClientRect().bottom){y();return}let O=i.current.x,k=i.current.y,A=d.current==="right"?l.current.left-O:O-l.current.right,V=Math.atan2(k-l.current.top,A)+qi,j=Math.atan2(k-l.current.bottom,A)-qi,m=Math.atan2(k-N,d.current==="left"?-(M-O):M-O),E=m<V&&m>j;f.current=E?Math.min(f.current+1,mn):Math.max(f.current-1,0),f.current>=mn?p(!0):p(!1),s.current=K,i.current={x:M,y:N},E&&(c.current=setTimeout(()=>{y(),u.current=setTimeout(()=>{let I=document.elementFromPoint(M,N);I&&H(P,I)&&I.dispatchEvent(new PointerEvent("pointerover",{bubbles:!0,cancelable:!0}))},100)},Tp))};return window.addEventListener("pointermove",T),process.env.NODE_ENV!=="test"&&window.addEventListener("pointerdown",w,!0),()=>{window.removeEventListener("pointermove",T),process.env.NODE_ENV!=="test"&&window.removeEventListener("pointerdown",w,!0),clearTimeout(c.current),clearTimeout(u.current),f.current=mn}},[o,r,e,v,p,n])}function Rp(t,e,n){let{parentMenuRef:r,submenuRef:o,type:i="menu",isDisabled:l,delay:s=200,shouldUseVirtualFocus:c}=t,u=he(),d=he(),{direction:f}=dt(),b=a.useRef(void 0),p=a.useCallback(()=>{b.current&&(clearTimeout(b.current),b.current=void 0)},[b]),g=a.useCallback(M=>{p(),e.open(M)},[e,p]),y=a.useCallback(()=>{p(),e.close()},[e,p]);J(()=>()=>{p()},[p]);let v=M=>{if($t(M.currentTarget))switch(M.key){case"ArrowLeft":f==="ltr"&&H(M.currentTarget,F(M))&&(M.preventDefault(),M.stopPropagation(),y(),!c&&n.current&&de(n.current));break;case"ArrowRight":f==="rtl"&&H(M.currentTarget,F(M))&&(M.preventDefault(),M.stopPropagation(),y(),!c&&n.current&&de(n.current));break;case"Escape":H(o.current,F(M))&&(M.stopPropagation(),y(),!c&&n.current&&de(n.current));break}},w={id:d,"aria-labelledby":u,submenuLevel:e.submenuLevel,...i==="menu"&&{onClose:e.closeAll,autoFocus:e.focusStrategy??void 0,onKeyDown:v}},x=M=>{switch(M.key){case"ArrowRight":l||(f==="ltr"?(M.preventDefault(),e.isOpen||g("first"),i==="menu"&&(o!=null&&o.current)&&ne()===(n==null?void 0:n.current)&&de(o.current)):e.isOpen?y():M.continuePropagation());break;case"ArrowLeft":l||(f==="rtl"?(M.preventDefault(),e.isOpen||g("first"),i==="menu"&&(o!=null&&o.current)&&ne()===(n==null?void 0:n.current)&&de(o.current)):e.isOpen?y():M.continuePropagation());break;default:M.continuePropagation();break}},P=M=>{!l&&(M.pointerType==="virtual"||M.pointerType==="keyboard")&&g("first")},T=M=>{!l&&(M.pointerType==="touch"||M.pointerType==="mouse")&&g()},R=M=>{l||(M&&!e.isOpen?b.current||(b.current=setTimeout(()=>{g()},s)):M||p())};It(r,"focusin",M=>{e.isOpen&&H(r.current,F(M))&&F(M)!==n.current&&y()});let K=M=>M!==n.current;return Mp({menuRef:r,submenuRef:o,isOpen:e.isOpen,isDisabled:l}),{submenuTriggerProps:{id:u,"aria-controls":e.isOpen?d:void 0,"aria-haspopup":l?void 0:i,"aria-expanded":e.isOpen?"true":"false",onPressStart:P,onPress:T,onHoverChange:R,onKeyDown:x,isOpen:e.isOpen},submenuProps:w,popoverProps:{isNonModal:!0,shouldCloseOnInteractOutside:K}}}function Co(t){let e=wo(t),[n,r]=a.useState(null),[o,i]=a.useState([]),l=()=>{i([]),e.close()};return{focusStrategy:n,...e,open(u=null){r(u),e.open()},toggle(u=null){r(u),e.toggle()},close(){l()},expandedKeysStack:o,openSubmenu:(u,d)=>{i(f=>d>f.length?f:[...f.slice(0,d),u])},closeSubmenu:(u,d)=>{i(f=>f[d]===u?f.slice(0,d):f)}}}function Dp(t,e){let{triggerKey:n}=t,{expandedKeysStack:r,openSubmenu:o,closeSubmenu:i,close:l}=e,[s]=a.useState(r==null?void 0:r.length),c=a.useMemo(()=>r[s]===n,[r,n,s]),[u,d]=a.useState(null),f=a.useCallback(g=>{d(g??null),o(n,s)},[o,s,n]),b=a.useCallback(()=>{d(null),i(n,s)},[i,s,n]),p=a.useCallback(g=>{d(g??null),c?b():f(g)},[b,f,c]);return a.useMemo(()=>({focusStrategy:u,isOpen:c,open:f,close:b,closeAll:l,submenuLevel:s,setOpen:()=>{},toggle:p}),[c,f,b,l,u,p,s])}function Np(t,e){return typeof e.getChildren=="function"?e.getChildren(t.key):t.childNodes}function Ip(t){return Lp(t)}function Lp(t,e){for(let n of t)return n}function Er(t,e,n){if(e.parentKey===n.parentKey)return e.index-n.index;let r=[...Yi(t,e),e],o=[...Yi(t,n),n],i=r.slice(0,o.length).findIndex((l,s)=>l!==o[s]);return i!==-1?(e=r[i],n=o[i],e.index-n.index):r.findIndex(l=>l===n)>=0?1:(o.findIndex(l=>l===e)>=0,-1)}function Yi(t,e){let n=[],r=e;for(;(r==null?void 0:r.parentKey)!=null;)r=t.getItem(r.parentKey),r&&n.unshift(r);return n}class Re extends Set{constructor(e,n,r){super(e),e instanceof Re?(this.anchorKey=n??e.anchorKey,this.currentKey=r??e.currentKey):(this.anchorKey=n??null,this.currentKey=r??null)}}class er{constructor(e,n,r){this.collection=e,this.state=n,this.allowsCellSelection=(r==null?void 0:r.allowsCellSelection)??!1,this._isSelectAll=null,this.layoutDelegate=(r==null?void 0:r.layoutDelegate)||null,this.fullCollection=(r==null?void 0:r.fullCollection)||null}get selectionMode(){return this.state.selectionMode}get disallowEmptySelection(){return this.state.disallowEmptySelection}get selectionBehavior(){return this.state.selectionBehavior}setSelectionBehavior(e){this.state.setSelectionBehavior(e)}get isFocused(){return this.state.isFocused}setFocused(e){this.state.setFocused(e)}get focusedKey(){return this.state.focusedKey}get childFocusStrategy(){return this.state.childFocusStrategy}setFocusedKey(e,n){(e==null||this.collection.getItem(e))&&this.state.setFocusedKey(e,n)}get selectedKeys(){return this.state.selectedKeys==="all"?new Set(this.getSelectAllKeys()):this.state.selectedKeys}get rawSelection(){return this.state.selectedKeys}isSelected(e){if(this.state.selectionMode==="none")return!1;let n=this.getKey(e);return n==null?!1:this.state.selectedKeys==="all"?this.canSelectItem(n):this.state.selectedKeys.has(n)}get isEmpty(){return this.state.selectedKeys!=="all"&&this.state.selectedKeys.size===0}get isSelectAll(){if(this.isEmpty)return!1;if(this.state.selectedKeys==="all")return!0;if(this._isSelectAll!=null)return this._isSelectAll;let e=this.getSelectAllKeys(),n=this.state.selectedKeys;return this._isSelectAll=e.every(r=>n.has(r)),this._isSelectAll}get firstSelectedKey(){let e=null;for(let n of this.state.selectedKeys){let r=this.collection.getItem(n);(!e||r&&Er(this.collection,r,e)<0)&&(e=r)}return(e==null?void 0:e.key)??null}get lastSelectedKey(){let e=null;for(let n of this.state.selectedKeys){let r=this.collection.getItem(n);(!e||r&&Er(this.collection,r,e)>0)&&(e=r)}return(e==null?void 0:e.key)??null}get disabledKeys(){return this.state.disabledKeys}get disabledBehavior(){return this.state.disabledBehavior}extendSelection(e){if(this.selectionMode==="none")return;if(this.selectionMode==="single"){this.replaceSelection(e);return}let n=this.getKey(e);if(n==null)return;let r;if(this.state.selectedKeys==="all")r=new Re([n],n,n);else{let o=this.state.selectedKeys,i=o.anchorKey??n;r=new Re(o,i,n);for(let l of this.getKeyRange(i,o.currentKey??n))r.delete(l);for(let l of this.getKeyRange(n,i))this.canSelectItem(l)&&r.add(l)}this.state.setSelectedKeys(r)}getKeyRange(e,n){let r=this.collection.getItem(e),o=this.collection.getItem(n);return r&&o?Er(this.collection,r,o)<=0?this.getKeyRangeInternal(e,n):this.getKeyRangeInternal(n,e):[]}getKeyRangeInternal(e,n){var i;if((i=this.layoutDelegate)!=null&&i.getKeyRange)return this.layoutDelegate.getKeyRange(e,n);let r=[],o=e;for(;o!=null;){let l=this.collection.getItem(o);if(l&&(l.type==="item"||l.type==="cell"&&this.allowsCellSelection)&&r.push(o),o===n)return r;o=this.collection.getKeyAfter(o)}return[]}getKey(e){let n=this.collection.getItem(e);if(!n||n.type==="cell"&&this.allowsCellSelection)return e;for(;n&&n.type!=="item"&&n.parentKey!=null;)n=this.collection.getItem(n.parentKey);return!n||n.type!=="item"?null:n.key}toggleSelection(e){if(this.selectionMode==="none")return;if(this.selectionMode==="single"&&!this.isSelected(e)){this.replaceSelection(e);return}let n=this.getKey(e);if(n==null)return;let r=new Re(this.state.selectedKeys==="all"?this.getSelectAllKeys():this.state.selectedKeys);r.has(n)?r.delete(n):this.canSelectItem(n)&&(r.add(n),r.anchorKey=n,r.currentKey=n),!(this.disallowEmptySelection&&r.size===0)&&this.state.setSelectedKeys(r)}replaceSelection(e){if(this.selectionMode==="none")return;let n=this.getKey(e);if(n==null)return;let r=this.canSelectItem(n)?new Re([n],n,n):new Re;this.state.setSelectedKeys(r)}setSelectedKeys(e){if(this.selectionMode==="none")return;let n=new Re;for(let r of e){let o=this.getKey(r);if(o!=null&&(n.add(o),this.selectionMode==="single"))break}this.state.setSelectedKeys(n)}getSelectAllKeys(){let e=this.fullCollection??this.collection,n=[],r=o=>{var i;for(;o!=null;){if(this.canSelectItemIn(o,e)){let l=e.getItem(o);(l==null?void 0:l.type)==="item"&&n.push(o),l!=null&&l.hasChildNodes&&(this.allowsCellSelection||l.type!=="item")&&r(((i=Ip(Np(l,e)))==null?void 0:i.key)??null)}o=e.getKeyAfter(o)}};return r(e.getFirstKey()),n}selectAll(){!this.isSelectAll&&this.selectionMode==="multiple"&&this.state.setSelectedKeys("all")}clearSelection(){!this.disallowEmptySelection&&(this.state.selectedKeys==="all"||this.state.selectedKeys.size>0)&&this.state.setSelectedKeys(new Re)}toggleSelectAll(){this.isSelectAll?this.clearSelection():this.selectAll()}select(e,n){this.selectionMode!=="none"&&(this.selectionMode==="single"?this.isSelected(e)&&!this.disallowEmptySelection?this.toggleSelection(e):this.replaceSelection(e):this.selectionBehavior==="toggle"||n&&(n.pointerType==="touch"||n.pointerType==="virtual")?this.toggleSelection(e):this.replaceSelection(e))}isSelectionEqual(e){if(e===this.state.selectedKeys)return!0;let n=this.selectedKeys;if(e.size!==n.size)return!1;for(let r of e)if(!n.has(r))return!1;for(let r of n)if(!e.has(r))return!1;return!0}canSelectItem(e){return this.canSelectItemIn(e,this.collection)}canSelectItemIn(e,n){var o;if(this.state.selectionMode==="none"||this.state.disabledKeys.has(e))return!1;let r=n.getItem(e);return!(!r||(o=r==null?void 0:r.props)!=null&&o.isDisabled||r.type==="cell"&&!this.allowsCellSelection)}isDisabled(e){var r,o;let n=this.collection.getItem(e);return this.state.disabledBehavior==="all"&&(this.state.disabledKeys.has(e)||!!((r=n==null?void 0:n.props)!=null&&r.isDisabled))&&((o=n==null?void 0:n.props)==null?void 0:o.disabledBehavior)!=="selection"}isLink(e){var n,r;return!!((r=(n=this.collection.getItem(e))==null?void 0:n.props)!=null&&r.href)}getItemProps(e){var n;return(n=this.collection.getItem(e))==null?void 0:n.props}withCollection(e){return new er(e,this.state,{allowsCellSelection:this.allowsCellSelection,layoutDelegate:this.layoutDelegate||void 0,fullCollection:this.fullCollection??this.collection})}}class Kp{constructor(e,{expandedKeys:n}={}){this.keyMap=new Map,this.firstKey=null,this.lastKey=null,this.iterable=e,n=n||new Set;let r=l=>{if(this.keyMap.set(l.key,l),l.childNodes&&(l.type==="section"||n.has(l.key)))for(let s of l.childNodes)r(s)};for(let l of e)r(l);let o=null,i=0;for(let[l,s]of this.keyMap)o?(o.nextKey=l,s.prevKey=o.key):(this.firstKey=l,s.prevKey=void 0),s.type==="item"&&(s.index=i++),o=s,o.nextKey=void 0;this.lastKey=(o==null?void 0:o.key)??null}*[Symbol.iterator](){yield*this.iterable}get size(){return this.keyMap.size}getKeys(){return this.keyMap.keys()}getKeyBefore(e){let n=this.keyMap.get(e);return n?n.prevKey??null:null}getKeyAfter(e){let n=this.keyMap.get(e);return n?n.nextKey??null:null}getFirstKey(){return this.firstKey}getLastKey(){return this.lastKey}getItem(e){return this.keyMap.get(e)??null}at(e){const n=[...this.getKeys()];return this.getItem(n[e])}}class Ap{build(e,n){return this.context=n,Xi(()=>this.iterateCollection(e))}*iterateCollection(e){let{children:n,items:r}=e;if(a.isValidElement(n)&&n.type===a.Fragment)yield*this.iterateCollection({children:n.props.children,items:r});else if(typeof n=="function"){if(!r)throw new Error("props.children was a function but props.items is missing");let o=0;for(let i of r)yield*this.getFullNode({value:i,index:o},{renderer:n}),o++}else{let o=[];a.Children.forEach(n,l=>{l&&o.push(l)});let i=0;for(let l of o){let s=this.getFullNode({element:l,index:i},{});for(let c of s)i++,yield c}}}getKey(e,n,r,o){if(e.key!=null)return e.key;if(n.type==="cell"&&n.key!=null)return`${o}${n.key}`;let i=n.value;if(i!=null){let l=i.key??i.id;if(l==null)throw new Error("No key found for item");return l}return o?`${o}.${n.index}`:`$.${n.index}`}getChildState(e,n){return{renderer:n.renderer||e.renderer}}*getFullNode(e,n,r,o){if(a.isValidElement(e.element)&&e.element.type===a.Fragment){let c=[];a.Children.forEach(e.element.props.children,d=>{c.push(d)});let u=e.index??0;for(const d of c)yield*this.getFullNode({element:d,index:u++},n,r,o);return}let i=e.element;if(!i&&e.value&&n&&n.renderer){let c=this.cache.get(e.value);if(c&&(!c.shouldInvalidate||!c.shouldInvalidate(this.context))){c.index=e.index,c.parentKey=o?o.key:null,yield c;return}i=n.renderer(e.value)}if(a.isValidElement(i)){let c=i.type;if(typeof c!="function"&&typeof c.getCollectionNode!="function"){let b=i.type;throw new Error(`Unknown element <${b}> in collection.`)}let u=c.getCollectionNode(i.props,this.context),d=e.index??0,f=u.next();for(;!f.done&&f.value;){let b=f.value;e.index=d;let p=b.key??null;p==null&&(p=b.element?null:this.getKey(i,e,n,r));let y=[...this.getFullNode({...b,key:p,index:d,wrapper:Op(e.wrapper,b.wrapper)},this.getChildState(n,b),r?`${r}${i.key}`:i.key,o)];for(let v of y){if(v.value=b.value??e.value??null,v.value&&this.cache.set(v.value,v),e.type&&v.type!==e.type)throw new Error(`Unsupported type <${Cr(v.type)}> in <${Cr((o==null?void 0:o.type)??"unknown parent type")}>. Only <${Cr(e.type)}> is supported.`);d++,yield v}f=u.next(y)}return}if(e.key==null||e.type==null)return;let l=this,s={type:e.type,props:e.props,key:e.key,parentKey:o?o.key:null,value:e.value??null,level:((o==null?void 0:o.level)??0)+((o==null?void 0:o.type)==="item"?1:0),index:e.index,rendered:e.rendered,textValue:e.textValue??"","aria-label":e["aria-label"],wrapper:e.wrapper,shouldInvalidate:e.shouldInvalidate,hasChildNodes:e.hasChildNodes||!1,childNodes:Xi(function*(){if(!e.hasChildNodes||!e.childNodes)return;let c=0;for(let u of e.childNodes()){u.key!=null&&(u.key=`${s.key}${u.key}`);let d=l.getFullNode({...u,index:c},l.getChildState(n,u),s.key,s);for(let f of d)c++,yield f}})};yield s}constructor(){this.cache=new WeakMap}}function Xi(t){let e=[],n=null;return{*[Symbol.iterator](){for(let r of e)yield r;n||(n=t());for(let r of n)e.push(r),yield r}}}function Op(t,e){if(t&&e)return n=>t(e(n));if(t)return t;if(e)return e}function Cr(t){return t[0].toUpperCase()+t.slice(1)}function Fp(t,e,n){let r=a.useMemo(()=>new Ap,[]),{children:o,items:i,collection:l}=t;return a.useMemo(()=>{if(l)return l;let c=r.build({children:o,items:i},n);return e(c)},[r,o,i,l,n,e])}function jp(t,e){if(t.size!==e.size)return!1;for(let n of t)if(!e.has(n))return!1;return!0}function ac(t){let{selectionMode:e="none",disallowEmptySelection:n=!1,allowDuplicateSelectionEvents:r,selectionBehavior:o="toggle",disabledBehavior:i="all"}=t,l=a.useRef(!1),[,s]=a.useState(!1),c=a.useRef(null),u=a.useRef(null),[,d]=a.useState(null),f=a.useMemo(()=>Zi(t.selectedKeys),[t.selectedKeys]),b=a.useMemo(()=>Zi(t.defaultSelectedKeys,new Re),[t.defaultSelectedKeys]),[p,g]=qn(f,b,t.onSelectionChange),y=a.useMemo(()=>t.disabledKeys?new Set(t.disabledKeys):new Set,[t.disabledKeys]),[v,w]=a.useState(o);o==="replace"&&v==="toggle"&&typeof p=="object"&&p.size===0&&w("replace");let x=a.useRef(o);return a.useEffect(()=>{o!==x.current&&(w(o),x.current=o)},[o]),{selectionMode:e,disallowEmptySelection:n,selectionBehavior:v,setSelectionBehavior:w,get isFocused(){return l.current},setFocused(P){l.current=P,s(P)},get focusedKey(){return c.current},get childFocusStrategy(){return u.current},setFocusedKey(P,T="first"){c.current=P,u.current=T,d(P)},selectedKeys:p,setSelectedKeys(P){(r||!jp(P,p))&&g(P)},disabledKeys:y,disabledBehavior:i}}function Zi(t,e){return t?t==="all"?"all":new Re(t):e}function _p(t){let{onExpandedChange:e}=t,[n,r]=qn(t.expandedKeys?new Set(t.expandedKeys):void 0,t.defaultExpandedKeys?new Set(t.defaultExpandedKeys):new Set,e),o=ac(t),i=a.useMemo(()=>t.disabledKeys?new Set(t.disabledKeys):new Set,[t.disabledKeys]),l=Fp(t,a.useCallback(c=>new Kp(c,{expandedKeys:n}),[n]),null);return a.useEffect(()=>{o.focusedKey!=null&&!l.getItem(o.focusedKey)&&o.setFocusedKey(null)},[l,o.focusedKey]),{collection:l,expandedKeys:n,disabledKeys:i,toggleKey:c=>{r(Bp(n,c))},setExpandedKeys:r,selectionManager:new er(l,o)}}function Bp(t,e){let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n}const So=a.createContext(null),tr=a.createContext(null),qt=a.createContext(null),Fn=a.createContext(null);function Vp(t){let e=Co(t),n=a.useRef(null),{menuTriggerProps:r,menuProps:o}=dp({...t,type:"menu"},e,n),i=a.useRef(null);return es()?null:a.createElement(ze,{values:[[So,{...o,ref:i}],[Qe,e],[qt,e],[Jn,{trigger:"MenuTrigger",triggerRef:n,scrollRef:i,placement:"bottom start","aria-labelledby":o["aria-labelledby"]}]]},a.createElement(aa,{...r,ref:n,isPressed:e.isOpen},t.children))}const cc=a.createContext(null),Oo=class Oo extends St{filter(e,n,r){let o=e.getItem(this.firstChildKey);if(o&&r(o.textValue,this)){let i=this.clone();return n.addDescendants(i,e),i}return null}};Oo.type="submenutrigger";let Jr=Oo;const zp=ya(Jr,(t,e,n)=>{let{CollectionBranch:r}=a.useContext(Qn),o=a.useContext(tr),i=a.useContext(qt),l=Dp({triggerKey:n.key},i),s=a.useRef(null),c=Je(e),{parentMenuRef:u,shouldUseVirtualFocus:d}=a.useContext(cc),{submenuTriggerProps:f,submenuProps:b,popoverProps:p}=Rp({parentMenuRef:u,submenuRef:s,delay:t.delay,shouldUseVirtualFocus:d},l,c);return a.createElement(ze,{values:[[wt,{...f,onAction:void 0,ref:c}],[So,{ref:s,...b}],[Qe,l],[Jn,{trigger:"SubmenuTrigger",triggerRef:c,placement:"end top","aria-labelledby":b["aria-labelledby"],...p}]]},a.createElement(r,{collection:o.collection,parent:n}),t.children[1])},t=>t.children[0]),Hp=a.forwardRef(function(e,n){return[e,n]=Me(e,n,So),a.createElement(Bh,{content:a.createElement(Gh,e)},r=>a.createElement(Up,{props:e,collection:r,menuRef:n}))});function Up({props:t,collection:e,menuRef:n}){[t,n]=Me(t,n,zi);let{filter:r,...o}=t,i=a.useMemo(()=>r?e.filter(r):e,[e,r]),l=_p({...t,collection:i,children:void 0}),s=a.useContext(qt),{isVirtualized:c,CollectionRoot:u}=a.useContext(Qn),{menuProps:d}=$p({...t,isVirtualized:c,onClose:t.onClose||(s==null?void 0:s.close)},l,n),f=Te({...t,children:void 0,defaultClassName:"react-aria-Menu",values:{isEmpty:l.collection.size===0}}),b=null;l.collection.size===0&&t.renderEmptyState&&(b=a.createElement("div",{role:"menuitem",style:{display:"contents"}},t.renderEmptyState()));let p=ae(t,{global:!0});return a.createElement(xs,null,a.createElement(pe.div,{...Y(p,f,d),ref:n,slot:t.slot||void 0,"data-empty":l.collection.size===0||void 0,onScroll:t.onScroll},a.createElement(ze,{values:[[tr,l],[Eo,{elementType:"div"}],[Yh,{name:"MenuSection",render:uc}],[cc,{parentMenuRef:n,shouldUseVirtualFocus:o==null?void 0:o.shouldUseVirtualFocus}],[wt,{shouldCloseOnSelect:t.shouldCloseOnSelect}],[zi,null],[tp,null],[Fn,l.selectionManager],[qt,s??Co({})]]},a.createElement(ip,null,a.createElement(u,{collection:l.collection,persistedKeys:Jh(l.selectionManager.focusedKey),scrollRef:n}))),b))}class Wp extends er{constructor(e,n){super(e.collection,n),this.parent=e}get focusedKey(){return this.parent.focusedKey}get isFocused(){return this.parent.isFocused}setFocusedKey(e,n){return this.parent.setFocusedKey(e,n)}setFocused(e){this.parent.setFocused(e)}get childFocusStrategy(){return this.parent.childFocusStrategy}}function uc(t,e,n,r="react-aria-MenuSection"){var v,w,x;let o=a.useContext(tr),{CollectionBranch:i}=a.useContext(Qn),[l,s]=Ql(),{headingProps:c,groupProps:u}=Pp({heading:s,"aria-label":n.props["aria-label"]??void 0}),d=Te({...t,id:void 0,children:void 0,defaultClassName:r,className:(v=n.props)==null?void 0:v.className,style:(w=n.props)==null?void 0:w.style,values:void 0}),f=a.useContext(Fn),b=ac(t),p=t.selectionMode!=null?new Wp(f,b):f,g=(x=Jt(wt))==null?void 0:x.shouldCloseOnSelect,y=ae(t,{global:!0});return delete y.id,a.createElement(pe.section,{...Y(y,d,u),ref:e},a.createElement(ze,{values:[[np,{...c,ref:l}],[Fn,p],[wt,{shouldCloseOnSelect:t.shouldCloseOnSelect??g}]]},a.createElement(i,{collection:o.collection,parent:n})))}const Gp=ya(qr,uc),wt=a.createContext(null),qp=ga(Gr,function(e,n,r){var P;[e,n]=Me(e,n,wt);let o=(P=Jt(wt))==null?void 0:P.id,i=a.useContext(tr),l=Je(n),s=a.useContext(Fn),{isVirtualized:c}=a.useContext(Qn),{menuItemProps:u,labelProps:d,descriptionProps:f,keyboardShortcutProps:b,...p}=Sp({...e,id:o,key:r.key,selectionManager:s,isVirtualized:c},i,l),{hoverProps:g,isHovered:y}=en({isDisabled:p.isDisabled}),v=Te({...e,id:void 0,children:r.rendered,defaultClassName:"react-aria-MenuItem",values:{...p,isHovered:y,isFocusVisible:p.isFocusVisible,selectionMode:s.selectionMode,selectionBehavior:s.selectionBehavior,hasSubmenu:!!e["aria-haspopup"],isOpen:e["aria-expanded"]==="true"}}),w=e.href?pe.a:pe.div,x=ae(e,{global:!0});return delete x.id,delete x.onClick,a.createElement(w,{...Y(x,v,u,g),ref:l,"data-disabled":p.isDisabled||void 0,"data-hovered":y||void 0,"data-focused":p.isFocused||void 0,"data-focus-visible":p.isFocusVisible||void 0,"data-pressed":p.isPressed||void 0,"data-selected":p.isSelected||void 0,"data-selection-mode":s.selectionMode==="none"?void 0:s.selectionMode,"data-has-submenu":!!e["aria-haspopup"]||void 0,"data-open":e["aria-expanded"]==="true"||void 0},a.createElement(ze,{values:[[wa,{slots:{[Tn]:d,label:d,description:f}}],[rp,b],[lp,{isSelected:p.isSelected}]]},v.children))});function Yp(t,e){let{role:n="dialog"}=t,r=vn();r=t["aria-label"]?void 0:r;let o=a.useRef(!1);a.useEffect(()=>{if(e.current&&!$t(e.current)){Ye(e.current);let l=setTimeout(()=>{(ne()===e.current||ne()===document.body)&&(o.current=!0,e.current&&(e.current.blur(),Ye(e.current)),o.current=!1)},500);return()=>{clearTimeout(l)}}},[e]),ua();let i=a.useRef(!1);return a.useEffect(()=>{if(process.env.NODE_ENV!=="production"&&!i.current&&e.current){let l=e.current,s=l.hasAttribute("aria-label"),c=l.hasAttribute("aria-labelledby");!s&&!c&&(console.warn("A dialog must have a title for accessibility. Either provide an aria-label or aria-labelledby prop, or render a heading element inside the dialog."),i.current=!0)}}),{dialogProps:{...ae(t,{labelable:!0}),role:n,tabIndex:-1,"aria-labelledby":t["aria-labelledby"]||r,onBlur:l=>{o.current&&l.stopPropagation()}},titleProps:{id:r}}}const dc=a.createContext(null),Qe=a.createContext(null);function Xp(t){let e=Co(t),n=a.useRef(null),{triggerProps:r,overlayProps:o}=ic({type:"dialog"},e,n);return r.id=he(),o["aria-labelledby"]=r.id,a.createElement(ze,{values:[[Qe,e],[qt,e],[dc,o],[Jn,{trigger:"DialogTrigger",triggerRef:n,"aria-labelledby":o["aria-labelledby"]}]]},a.createElement(aa,{...r,ref:n,isPressed:e.isOpen},t.children))}const Zp=a.forwardRef(function(e,n){let r=e["aria-labelledby"];[e,n]=Me(e,n,dc);let{dialogProps:o,titleProps:i}=Yp({...e,"aria-labelledby":r},n),l=a.useContext(Qe);!o["aria-label"]&&!o["aria-labelledby"]&&(e["aria-labelledby"]?o["aria-labelledby"]=e["aria-labelledby"]:process.env.NODE_ENV!=="production"&&console.warn('If a Dialog does not contain a <Heading slot="title">, it must have an aria-label or aria-labelledby attribute for accessibility.'));let s=Te({defaultClassName:"react-aria-Dialog",className:e.className,style:e.style,children:e.children,values:{close:(l==null?void 0:l.close)||(()=>{})}}),c=ae(e,{global:!0});return a.createElement(pe.section,{...Y(c,s,o),render:e.render,ref:n,slot:e.slot||void 0},a.createElement(ze,{values:[[ms,{slots:{[Tn]:{},title:{...i,level:2}}}],[bs,{slots:{[Tn]:{},close:{onPress:()=>l==null?void 0:l.close()}}}]]},s.children))});function Jp(t,e,n){let{overlayProps:r,underlayProps:o}=Es({...t,isOpen:e.isOpen,onClose:e.close},n);return Cs({isDisabled:!e.isOpen}),ua(),a.useEffect(()=>{if(e.isOpen&&n.current)return gs([n.current],{shouldUseInert:!0})},[e.isOpen,n]),{modalProps:Y(r),underlayProps:o}}const Qp=a.createContext(null),Po=a.createContext(null),eb=a.forwardRef(function(e,n){if(a.useContext(Po)){if(process.env.NODE_ENV!=="production"&&(e.onOpenChange||e.defaultOpen!==void 0||e.isOpen!==void 0)){const y=new Set(["isDismissable","isKeyboardDismissDisabled","isOpen","defaultOpen","onOpenChange","isEntering","isExiting","UNSTABLE_portalContainer","shouldCloseOnInteractOutside"]),v=Object.keys(e).filter(w=>y.has(w));console.warn(`This modal is already wrapped in a ModalOverlay, props [${v.join(", ")}] should be placed on the ModalOverlay instead.`)}return a.createElement(Ji,{...e,modalRef:n},e.children)}let{isDismissable:o,isKeyboardDismissDisabled:i,isOpen:l,defaultOpen:s,onOpenChange:c,children:u,isEntering:d,isExiting:f,UNSTABLE_portalContainer:b,shouldCloseOnInteractOutside:p,...g}=e;return a.createElement(fc,{isDismissable:o,isKeyboardDismissDisabled:i,isOpen:l,defaultOpen:s,onOpenChange:c,isEntering:d,isExiting:f,UNSTABLE_portalContainer:b,shouldCloseOnInteractOutside:p},a.createElement(Ji,{...g,modalRef:n},u))});function tb(t,e){[t,e]=Me(t,e,Qp);let n=a.useContext(Qe),r=wo(t),o=t.isOpen!=null||t.defaultOpen!=null||!n?r:n;o===n&&process.env.NODE_ENV!=="production"&&(t.onOpenChange||t.defaultOpen!==void 0||t.isOpen!==void 0)&&console.warn("This modals state is controlled by a trigger, place onOpenChange on the trigger instead.");let i=Je(e),l=a.useRef(null),s=Mr(i,o.isOpen),c=Mr(l,o.isOpen),u=s||c||t.isExiting||!1,d=Ze();return!o.isOpen&&!u||d?null:a.createElement(nb,{...t,state:o,isExiting:u,overlayRef:i,modalRef:l})}const fc=a.forwardRef(tb);function nb({UNSTABLE_portalContainer:t,...e}){let n=e.modalRef,{state:r}=e,{modalProps:o,underlayProps:i}=Jp(e,r,n),l=ao(e.overlayRef)||e.isEntering||!1,s=Te({...e,defaultClassName:"react-aria-ModalOverlay",values:{isEntering:l,isExiting:e.isExiting,state:r}}),c=Lu(),u,d;if(typeof document<"u"){let b=st(document.body)?document.body:document.scrollingElement||document.documentElement,p=b.getBoundingClientRect().width%1,g=b.getBoundingClientRect().height%1;u=b.scrollWidth-p,d=b.scrollHeight-g}let f={...s.style,"--visual-viewport-width":c.width+"px","--visual-viewport-height":c.height+"px","--page-width":u!==void 0?u+"px":void 0,"--page-height":d!==void 0?d+"px":void 0};return a.createElement(Wr,{isExiting:e.isExiting,portalContainer:t},a.createElement(pe.div,{...Y(ae(e,{global:!0}),i),...s,style:f,ref:e.overlayRef,"data-entering":l||void 0,"data-exiting":e.isExiting||void 0},a.createElement(ze,{values:[[Po,{modalProps:o,modalRef:n,isExiting:e.isExiting,isDismissable:e.isDismissable}],[Qe,r]]},s.children)))}function Ji(t){let{modalProps:e,modalRef:n,isExiting:r,isDismissable:o}=a.useContext(Po),i=a.useContext(Qe),l=a.useMemo(()=>ut(t.modalRef,n),[t.modalRef,n]),s=Je(l),c=ao(s),u=Te({...t,defaultClassName:"react-aria-Modal",values:{isEntering:c,isExiting:r,state:i}});return a.createElement(pe.div,{...Y(ae(t,{global:!0}),e),...u,ref:s,"data-entering":c||void 0,"data-exiting":r||void 0},o&&a.createElement(Ur,{onDismiss:i.close}),u.children)}const rb=a.forwardRef(({children:t,...e},n)=>{n=Je(n);let{pressProps:r}=Xe({...e,ref:n}),{focusableProps:o}=Qt(e,n),i=a.Children.only(t);a.useEffect(()=>{if(process.env.NODE_ENV==="production")return;let s=n.current;if(!s||!(s instanceof fe(s).Element)){console.error("<Pressable> child must forward its ref to a DOM element.");return}if(!e.isDisabled&&!fo(s)){console.warn("<Pressable> child must be focusable. Please ensure the tabIndex prop is passed through.");return}if(s.localName!=="button"&&s.localName!=="input"&&s.localName!=="select"&&s.localName!=="textarea"&&s.localName!=="a"&&s.localName!=="area"&&s.localName!=="summary"){let c=s.getAttribute("role");c?c!=="application"&&c!=="button"&&c!=="checkbox"&&c!=="combobox"&&c!=="gridcell"&&c!=="link"&&c!=="menuitem"&&c!=="menuitemcheckbox"&&c!=="menuitemradio"&&c!=="option"&&c!=="radio"&&c!=="searchbox"&&c!=="separator"&&c!=="slider"&&c!=="spinbutton"&&c!=="switch"&&c!=="tab"&&c!=="textbox"&&c!=="treeitem"&&console.warn(`<Pressable> child must have an interactive ARIA role. Got "${c}".`):console.warn("<Pressable> child must have an interactive ARIA role.")}},[n,e.isDisabled]);let l=parseInt(a.version,10)<19?i.ref:i.props.ref;return a.cloneElement(i,{...Y(r,o,i.props),ref:ut(l,n)})}),Qi=({children:t,className:e,slot:n,style:r,variant:o,...i})=>{const l=a.useMemo(()=>Wd({variant:o}),[o]);return h.jsx(xo,{"aria-label":"Close",className:Ee(e,l),"data-slot":"close-button",slot:n,style:r,...i,children:s=>typeof t=="function"?t(s):t??h.jsx(zf,{"data-slot":"close-button-icon"})})},ob=Object.assign(Qi,{Root:Qi}),ib=a.createContext(null),lb=a.createContext(null);function sb(t,e,n){let{validationBehavior:r,focus:o}=t;J(()=>{if(r==="native"&&(n!=null&&n.current)&&!n.current.disabled){let u=e.realtimeValidation.isInvalid?e.realtimeValidation.validationErrors.join(" ")||"Invalid value.":"";n.current.setCustomValidity(u),n.current.hasAttribute("title")||(n.current.title=""),e.realtimeValidation.isInvalid||e.updateValidation(cb(n.current))}});let i=a.useRef(!1),l=Pe(()=>{i.current||e.resetValidation()}),s=Pe(u=>{var f,b;e.displayValidation.isInvalid||e.commitValidation();let d=(f=n==null?void 0:n.current)==null?void 0:f.form;!u.defaultPrevented&&n&&d&&ub(d)===n.current&&(o?o():(b=n.current)==null||b.focus(),Or("keyboard")),u.preventDefault()}),c=Pe(()=>{e.commitValidation()});a.useEffect(()=>{let u=n==null?void 0:n.current;if(!u)return;let d=u.form,f=d==null?void 0:d.reset;return d&&(d.reset=()=>{i.current=!window.event||window.event.type==="message"&&F(window.event)instanceof MessagePort,f==null||f.call(d),i.current=!1}),u.addEventListener("invalid",s),u.addEventListener("change",c),d==null||d.addEventListener("reset",l),()=>{u.removeEventListener("invalid",s),u.removeEventListener("change",c),d==null||d.removeEventListener("reset",l),d&&(d.reset=f)}},[n,r])}function ab(t){let e=t.validity;return{badInput:e.badInput,customError:e.customError,patternMismatch:e.patternMismatch,rangeOverflow:e.rangeOverflow,rangeUnderflow:e.rangeUnderflow,stepMismatch:e.stepMismatch,tooLong:e.tooLong,tooShort:e.tooShort,typeMismatch:e.typeMismatch,valueMissing:e.valueMissing,valid:e.valid}}function cb(t){return{isInvalid:!t.validity.valid,validationDetails:ab(t),validationErrors:t.validationMessage?[t.validationMessage]:[]}}function ub(t){var e;for(let n=0;n<t.elements.length;n++){let r=t.elements[n];if(((e=r.validity)==null?void 0:e.valid)===!1)return r}return null}function db(t,e){let{elementType:n="a",onPress:r,onPressStart:o,onPressEnd:i,onClick:l,isDisabled:s,...c}=t,u={};n!=="a"&&(u={role:"link",tabIndex:s?void 0:0});let{focusableProps:d}=Qt(t,e),{pressProps:f,isPressed:b}=Xe({onPress:r,onPressStart:o,onPressEnd:i,onClick:l,isDisabled:s,ref:e}),p=ae(c,{labelable:!0}),g=Y(d,f),y=Xt(),v=Sl(t);return{isPressed:b,linkProps:Y(p,v,{...g,...u,"aria-disabled":s||void 0,"aria-current":t["aria-current"],onClick:w=>{var x;(x=f.onClick)==null||x.call(f,w),Pl(w,y,t.href,t.routerOptions)}})}}const fb=a.createContext(null),hb=a.forwardRef(function(e,n){[e,n]=Me(e,n,fb);let r=e.href&&!e.isDisabled?"a":"span",{linkProps:o,isPressed:i}=db({...e,elementType:r},n),l=pe[r],{hoverProps:s,isHovered:c}=en(e),{focusProps:u,isFocused:d,isFocusVisible:f}=vo(),b=Te({...e,defaultClassName:"react-aria-Link",values:{isCurrent:!!e["aria-current"],isDisabled:e.isDisabled||!1,isPressed:i,isHovered:c,isFocused:d,isFocusVisible:f}}),p=ae(e,{global:!0});return delete p.onClick,a.createElement(l,{ref:n,slot:e.slot||void 0,...Y(p,b,o,s,u),"data-focused":d||void 0,"data-hovered":c||void 0,"data-pressed":i||void 0,"data-focus-visible":f||void 0,"data-current":!!e["aria-current"]||void 0,"data-disabled":e.isDisabled||void 0},b.children)}),hc=a.createContext({}),el=({children:t,className:e,...n})=>{const r=a.useMemo(()=>qd(),[]);return h.jsx(hc,{value:{slots:r},children:h.jsx(hb,{...n,className:Ee(e,r==null?void 0:r.base()),children:o=>h.jsx(h.Fragment,{children:typeof t=="function"?t(o):t})})})},pb=({children:t,className:e,...n})=>{const{slots:r}=a.useContext(hc);return h.jsx(oe.span,{className:ie(r==null?void 0:r.icon,e),"data-default-icon":_f(!t),"data-slot":"link-icon",...n,children:t??h.jsx(Vf,{"data-slot":"link-default-icon"})})},ko=Object.assign(el,{Root:el,Icon:pb});function bb(t={}){let{isReadOnly:e}=t,[n,r]=qn(t.isSelected,t.defaultSelected||!1,t.onChange),[o]=a.useState(n);function i(s){e||r(s)}function l(){e||r(!n)}return{isSelected:n,defaultSelected:t.defaultSelected??o,setSelected:i,toggle:l}}const mb=a.createContext({}),gb="__button_group_child",tl=({children:t,className:e,fullWidth:n,isDisabled:r,isIconOnly:o,size:i,slot:l,style:s,variant:c,[gb]:u,...d})=>{const f=a.useContext(mb),b=u===!0,p=i??(b?f==null?void 0:f.size:void 0),g=c??(b?f==null?void 0:f.variant:void 0),y=r??(b?f==null?void 0:f.isDisabled:void 0),v=n??(b?f==null?void 0:f.fullWidth:void 0),w=qe({fullWidth:v,isIconOnly:o,size:p,variant:g});return h.jsx(xo,{className:Ee(e,w),"data-slot":"button",isDisabled:y,slot:l,style:s,...d,children:x=>typeof t=="function"?t(x):t})},yb=Object.assign(tl,{Root:tl}),Pt=a.createContext({}),nl=({children:t,className:e,variant:n="default",...r})=>{const o=a.useMemo(()=>zd({variant:n}),[n]),i=h.jsx(oe.div,{className:o.base({className:e}),"data-slot":"card",...r,children:t});return h.jsx(Pt,{value:{slots:o},children:n==="transparent"?i:h.jsx(Yn,{value:{variant:n},children:i})})},vb=({className:t,...e})=>{const{slots:n}=a.useContext(Pt);return h.jsx(oe.div,{className:ie(n==null?void 0:n.header,t),"data-slot":"card-header",...e})},xb=({children:t,className:e,...n})=>{const{slots:r}=a.useContext(Pt);return h.jsx(oe.h3,{className:ie(r==null?void 0:r.title,e),"data-slot":"card-title",...n,children:t})},$b=({children:t,className:e,...n})=>{const{slots:r}=a.useContext(Pt);return h.jsx(oe.p,{className:ie(r==null?void 0:r.description,e),"data-slot":"card-description",...n,children:t})},wb=({className:t,...e})=>{const{slots:n}=a.useContext(Pt);return h.jsx(oe.div,{className:ie(n==null?void 0:n.content,t),"data-slot":"card-content",...e})},Eb=({className:t,...e})=>{const{slots:n}=a.useContext(Pt);return h.jsx(oe.div,{className:ie(n==null?void 0:n.footer,t),"data-slot":"card-footer",...e})},Ot=Object.assign(nl,{Root:nl,Header:vb,Title:xb,Description:$b,Content:wb,Footer:Eb}),Cb=new WeakMap;function Sb(t=!0){let[e,n]=a.useState(t),r=a.useRef(!1),o=a.useCallback(i=>{r.current=!0,n(!!i)},[]);return J(()=>{r.current||n(!1)},[]),[o,e]}function rl(t=!0){let e=he(),[n,r]=Sb(t);return{id:r?e:void 0,ref:n}}const pc={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valueMissing:!1,valid:!0},bc={...pc,customError:!0,valid:!1},mt={isInvalid:!1,validationDetails:pc,validationErrors:[]},Pb=a.createContext({}),jn="__reactAriaFormValidationState";function mc(t){if(t[jn]){let{realtimeValidation:e,displayValidation:n,updateValidation:r,resetValidation:o,commitValidation:i}=t[jn];return{realtimeValidation:e,displayValidation:n,updateValidation:r,resetValidation:o,commitValidation:i}}return kb(t)}function kb(t){let{isInvalid:e,validationState:n,name:r,value:o,builtinValidation:i,validate:l,validationBehavior:s="aria"}=t;n&&(e||(e=n==="invalid"));let c=e!==void 0?{isInvalid:e,validationErrors:[],validationDetails:bc}:null,u=a.useMemo(()=>{if(!l||o==null)return null;let k=Tb(l,o);return ol(k)},[l,o]);i!=null&&i.validationDetails.valid&&(i=void 0);let d=a.useContext(Pb),f=a.useMemo(()=>r?Array.isArray(r)?r.flatMap(k=>Qr(d[k])):Qr(d[r]):[],[d,r]),[b,p]=a.useState(d),[g,y]=a.useState(!1);d!==b&&(p(d),y(!1));let v=a.useMemo(()=>ol(g?[]:f),[g,f]),w=a.useRef(mt),[x,P]=a.useState(mt),T=a.useRef(mt),R=()=>{if(!K)return;M(!1);let k=u||i||w.current;Sr(k,T.current)||(T.current=k,P(k))},[K,M]=a.useState(!1);return a.useEffect(R),{realtimeValidation:c||v||u||i||mt,displayValidation:s==="native"?c||v||x:c||v||u||i||x,updateValidation(k){s==="aria"&&!Sr(x,k)?P(k):w.current=k},resetValidation(){let k=mt;Sr(k,T.current)||(T.current=k,P(k)),s==="native"&&M(!1),y(!0)},commitValidation(){s==="native"&&M(!0),y(!0)}}}function Qr(t){return t?Array.isArray(t)?t:[t]:[]}function Tb(t,e){if(typeof t=="function"){let n=t(e);if(n&&typeof n!="boolean")return Qr(n)}return[]}function ol(t){return t.length?{isInvalid:!0,validationErrors:t,validationDetails:bc}:null}function Sr(t,e){return t===e?!0:!!t&&!!e&&t.isInvalid===e.isInvalid&&t.validationErrors.length===e.validationErrors.length&&t.validationErrors.every((n,r)=>n===e.validationErrors[r])&&Object.entries(t.validationDetails).every(([n,r])=>e.validationDetails[n]===r)}function Mb(t,e,n){let{isDisabled:r=!1,isReadOnly:o=!1,value:i,name:l,form:s,children:c,isRequired:u,validationBehavior:d="aria","aria-label":f,"aria-labelledby":b,"aria-describedby":p,onPressStart:g,onPressEnd:y,onPressChange:v,onPress:w,onPressUp:x,onClick:P}=t,T=mc({...t,value:e.isSelected}),{isInvalid:R,validationErrors:K,validationDetails:M}=T.displayValidation;sb(t,T,n);let N=L=>{L.stopPropagation(),e.setSelected(F(L).checked)},O=c!=null,k=f!=null||b!=null;!O&&!k&&process.env.NODE_ENV!=="production"&&console.warn("If you do not provide children, you must specify an aria-label for accessibility");let{pressProps:A,isPressed:V}=Xe({onPressStart:g,onPressEnd:y,onPressChange:v,onPress:w,onPressUp:x,onClick:P,isDisabled:r}),[j,m]=a.useState(!1),{pressProps:E}=Xe({onPressStart(L){if(L.pointerType==="keyboard"||L.pointerType==="virtual"){L.continuePropagation();return}g==null||g(L),v==null||v(!0),m(!0)},onPressEnd(L){if(L.pointerType==="keyboard"||L.pointerType==="virtual"){L.continuePropagation();return}y==null||y(L),v==null||v(!1),m(!1)},onPressUp(L){if(L.pointerType==="keyboard"||L.pointerType==="virtual"){L.continuePropagation();return}x==null||x(L)},onClick:P,onPress(L){var G;if(L.pointerType==="keyboard"||L.pointerType==="virtual"){L.continuePropagation();return}w==null||w(L),e.toggle(),(G=n.current)==null||G.focus();let{[jn]:U}=t,{commitValidation:W}=U||T;W()},isDisabled:r||o}),{focusableProps:I}=Qt(t,n),C=Y(A,I),D=ae(t,{labelable:!0});Fu(n,e.defaultSelected,e.setSelected);let $=rl(),S=rl();return{labelProps:Y(E,{onClick:L=>L.preventDefault()}),inputProps:Y(D,{checked:e.isSelected,"aria-required":u&&d==="aria"||void 0,required:u&&d==="native","aria-invalid":R||t.validationState==="invalid"||void 0,"aria-errormessage":t["aria-errormessage"],"aria-controls":t["aria-controls"],"aria-readonly":o||void 0,"aria-describedby":[$.id,S.id,p].filter(Boolean).join(" ")||void 0,onChange:N,disabled:r,...i==null?{}:{value:i},name:l,form:s,type:"checkbox",...C}),descriptionProps:$,errorMessageProps:S,isSelected:e.isSelected,isPressed:V||j,isDisabled:r,isReadOnly:o,isInvalid:R||t.validationState==="invalid",validationErrors:K,validationDetails:M}}function gc(t,e,n){let{labelProps:r,inputProps:o,descriptionProps:i,errorMessageProps:l,isSelected:s,isPressed:c,isDisabled:u,isReadOnly:d,isInvalid:f,validationErrors:b,validationDetails:p}=Mb(t,e,n),{isIndeterminate:g}=t;return a.useEffect(()=>{n.current&&(n.current.indeterminate=!!g)}),{labelProps:Y(r,a.useMemo(()=>({onMouseDown:y=>y.preventDefault()}),[])),inputProps:o,descriptionProps:i,errorMessageProps:l,isSelected:s,isPressed:c,isDisabled:u,isReadOnly:d,isInvalid:f,validationErrors:b,validationDetails:p}}const Rb=typeof document<"u"?a.useInsertionEffect??a.useLayoutEffect:()=>{};function Db(t,e,n){let[r,o]=a.useState(t||e),i=a.useRef(r),l=a.useRef(t!==void 0),s=t!==void 0;a.useEffect(()=>{let f=l.current;f!==s&&process.env.NODE_ENV!=="production"&&console.warn(`WARN: A component changed from ${f?"controlled":"uncontrolled"} to ${s?"controlled":"uncontrolled"}.`),l.current=s},[s]);let c=s?t:r;Rb(()=>{i.current=c});let[,u]=a.useReducer(()=>({}),{}),d=a.useCallback((f,...b)=>{let p=typeof f=="function"?f(i.current):f;Object.is(i.current,p)||(i.current=p,o(p),u(),n==null||n(p,...b))},[n]);return[c,d]}function Nb(t={}){let{isReadOnly:e}=t,[n,r]=Db(t.isSelected,t.defaultSelected||!1,t.onChange),[o]=a.useState(n);function i(s){e||r(s)}function l(){e||r(!n)}return{isSelected:n,defaultSelected:t.defaultSelected??o,setSelected:i,toggle:l}}function Ib(t,e,n){const r=Nb({isReadOnly:t.isReadOnly||e.isReadOnly,isSelected:e.isSelected(t.value),defaultSelected:e.defaultValue.includes(t.value),onChange(y){y?e.addValue(t.value):e.removeValue(t.value),t.onChange&&t.onChange(y)}});let{name:o,form:i,descriptionId:l,errorMessageId:s,validationBehavior:c}=Cb.get(e);c=t.validationBehavior??c;let{realtimeValidation:u}=mc({...t,value:r.isSelected,name:void 0,validationBehavior:"aria"}),d=a.useRef(mt),f=()=>{e.setInvalid(t.value,u.isInvalid?u:d.current)};a.useEffect(f);let b=e.realtimeValidation.isInvalid?e.realtimeValidation:u,p=c==="native"?e.displayValidation:b,g=gc({...t,isReadOnly:t.isReadOnly||e.isReadOnly,isDisabled:t.isDisabled||e.isDisabled,name:t.name||o,form:t.form||i,isRequired:t.isRequired??e.isRequired,validationBehavior:c,[jn]:{realtimeValidation:b,displayValidation:p,resetValidation:e.resetValidation,commitValidation:e.commitValidation,updateValidation(y){d.current=y,f()}}},r,n);return{...g,inputProps:{...g.inputProps,"aria-describedby":[g.inputProps["aria-describedby"],e.isInvalid?s:null,l].filter(Boolean).join(" ")||void 0}}}const Lb=a.createContext(null),yc=a.createContext(null),vc=a.createContext(null),Kb=a.forwardRef(function(e,n){let{inputRef:r=null,...o}=e;[e,n]=Me(o,n,Lb);let i=a.useContext(yc),[l,s]=Ab(e,r),{descriptionProps:c,errorMessageProps:u,isSelected:d,isDisabled:f,isReadOnly:b,isInvalid:p,validationDetails:g,validationErrors:y}=l,v=Te({...e,defaultClassName:"react-aria-CheckboxField",values:{isSelected:d,isIndeterminate:e.isIndeterminate||!1,isDisabled:f,isReadOnly:b,isInvalid:p,isRequired:e.isRequired||!1}}),w=ae(e,{global:!0});return delete w.id,delete w.onClick,a.createElement(pe.div,{...Y(w,v),ref:n,slot:e.slot||void 0,"data-selected":d||void 0,"data-indeterminate":e.isIndeterminate||void 0,"data-disabled":f||void 0,"data-readonly":b||void 0,"data-invalid":p||void 0,"data-required":e.isRequired||void 0},a.createElement(ze,{values:[[vc,{...l,inputRef:s,defaultClassName:"react-aria-CheckboxButton",isIndeterminate:e.isIndeterminate,isRequired:e.isRequired}],[wa,{slots:{description:c,errorMessage:u}}],[ib,i?null:{isInvalid:p,validationDetails:g,validationErrors:y}]]},v.children))});function Ab(t,e){let{validationBehavior:n}=Jt(lb)||{},r=t.validationBehavior??n??"native",o=a.useContext(yc),i=Je(a.useMemo(()=>ut(e,t.inputRef!==void 0?t.inputRef:null),[e,t.inputRef])),l={...ef(t),children:typeof t.children=="function"?!0:t.children,value:t.value,validationBehavior:r};return[o?Ib(l,o,i):gc(l,bb(t),i),i]}const Ob=a.forwardRef(function(e,n){let{labelProps:r,inputProps:o,isSelected:i,isDisabled:l,isReadOnly:s,isPressed:c,isInvalid:u,inputRef:d,defaultClassName:f,isIndeterminate:b,isRequired:p}=a.useContext(vc),{isFocused:g,isFocusVisible:y,focusProps:v}=vo(),w=l||s,{hoverProps:x,isHovered:P}=en({...e,isDisabled:w}),T=Te({...e,defaultClassName:f,values:{isSelected:i,isIndeterminate:b||!1,isPressed:c,isHovered:P,isFocused:g,isFocusVisible:y,isDisabled:l,isReadOnly:s,isInvalid:u,isRequired:p||!1}}),R=ae(e,{global:!0});return delete R.id,delete R.onClick,a.createElement(pe.label,{...Y(R,r,x,T),ref:n,slot:e.slot||void 0,"data-selected":i||void 0,"data-indeterminate":b||void 0,"data-pressed":c||void 0,"data-hovered":P||void 0,"data-focused":g||void 0,"data-focus-visible":y||void 0,"data-disabled":l||void 0,"data-readonly":s||void 0,"data-invalid":u||void 0,"data-required":p||void 0},a.createElement(sa,{elementType:"span"},a.createElement("input",{...Y(o,v),ref:d})),T.children)}),Fb=a.createContext({}),nr=a.createContext({}),eo=({children:t,className:e,variant:n,...r})=>{const o=a.useContext(Fb),i=n??o.variant,l=a.useMemo(()=>Hd({variant:i}),[i]);return h.jsx(Kb,{"data-slot":"checkbox",...r,className:Ee(e,l.base()),children:s=>h.jsx(nr,{value:{slots:l,state:s},children:typeof t=="function"?t(s):t})})};eo.displayName="HeroUI.Checkbox";const xc=({children:t,className:e,...n})=>{const{slots:r}=a.useContext(nr);return h.jsx(Ob,{"data-slot":"checkbox-content",...n,className:Ee(e,r==null?void 0:r.content()),children:t})};xc.displayName="HeroUI.Checkbox.Content";const $c=({children:t,className:e,...n})=>{const{slots:r}=a.useContext(nr);return h.jsx(oe.span,{className:ie(r==null?void 0:r.control,e),"data-slot":"checkbox-control",...n,children:t})};$c.displayName="HeroUI.Checkbox.Control";const wc=({children:t,className:e,...n})=>{const{slots:r,state:o}=a.useContext(nr),i=o==null?void 0:o.isSelected,l=o==null?void 0:o.isIndeterminate,s=typeof t=="function"?t(o??{}):t||(l?h.jsx("svg",{"aria-hidden":"true","data-slot":"checkbox-default-indicator--indeterminate",fill:"none",role:"presentation",stroke:"currentColor",strokeLinecap:"round",strokeWidth:3,viewBox:"0 0 24 24",children:h.jsx("line",{x1:"21",x2:"3",y1:"12",y2:"12"})}):h.jsx("svg",{"aria-hidden":"true","data-slot":"checkbox-default-indicator--checkmark",fill:"none",role:"presentation",stroke:"currentColor",strokeDasharray:22,strokeDashoffset:i?44:66,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,viewBox:"0 0 17 18",children:h.jsx("polyline",{points:"1 9 7 14 15 4"})}));return h.jsx(oe.span,{"aria-hidden":"true",className:ie(r==null?void 0:r.indicator,e),"data-slot":"checkbox-indicator",...n,children:s})};wc.displayName="HeroUI.Checkbox.Indicator";const gn=Object.assign(eo,{Root:eo,Content:xc,Control:$c,Indicator:wc}),Ec=a.createContext({}),il=({children:t,className:e,color:n,size:r,variant:o,...i})=>{const l=a.useMemo(()=>Ud({color:n,size:r,variant:o}),[n,r,o]),s=a.useMemo(()=>typeof t=="string"||typeof t=="number"?h.jsx(Cc,{children:t}):t,[t]);return h.jsx(Ec,{value:{slots:l},children:h.jsx(oe.span,{...i,className:ie(l.base,e),"data-slot":"chip",children:s})})},Cc=({children:t,className:e,...n})=>{const{slots:r}=a.useContext(Ec);return h.jsx(oe.span,{className:ie(r==null?void 0:r.label,e),"data-slot":"chip-label",...n,children:t})},_n=Object.assign(il,{Root:il,Label:Cc}),rr=a.createContext({}),to=({children:t,className:e,color:n,size:r,...o})=>{const i=a.useMemo(()=>Yd({color:n,size:r}),[n,r]);return h.jsx(yf,{"data-slot":"progress-bar",...o,className:Ee(e,i.base()),children:l=>h.jsx(rr,{value:{slots:i,state:l},children:typeof t=="function"?t(l):t})})};to.displayName="HeroUI.ProgressBar";const Sc=({children:t,className:e,...n})=>{const{slots:r,state:o}=a.useContext(rr);return h.jsx(oe.span,{className:ie(r==null?void 0:r.output,e),"data-slot":"progress-bar-output",...n,children:t??(o==null?void 0:o.valueText)})};Sc.displayName="HeroUI.ProgressBar.Output";const Pc=({children:t,className:e,...n})=>{const{slots:r}=a.useContext(rr);return h.jsx(oe.div,{className:ie(r==null?void 0:r.track,e),"data-slot":"progress-bar-track",...n,children:t})};Pc.displayName="HeroUI.ProgressBar.Track";const kc=({className:t,style:e,...n})=>{const{slots:r,state:o}=a.useContext(rr);return h.jsx(oe.div,{className:ie(r==null?void 0:r.fill,t),"data-slot":"progress-bar-fill",style:{...e,width:o!=null&&o.isIndeterminate?void 0:`${(o==null?void 0:o.percentage)??0}%`},...n})};kc.displayName="HeroUI.ProgressBar.Fill";const yn=Object.assign(to,{Root:to,Output:Sc,Track:Pc,Fill:kc}),ll=({className:t,orientation:e,variant:n,...r})=>{const o=Jt(Eo),i=e??(o==null?void 0:o.orientation)??"horizontal";return h.jsx(ap,{"data-orientation":i,"data-slot":"separator",orientation:i,className:Jd({orientation:i,variant:n,className:t}),...r})},jb=Object.assign(ll,{Root:ll}),tn=a.createContext({}),sl=({children:t,className:e,status:n,...r})=>{const o=a.useMemo(()=>Vd({status:n}),[n]);return h.jsx(tn,{value:{slots:o,status:n},children:h.jsx(Yn,{value:{variant:"default"},children:h.jsx(oe.div,{className:o==null?void 0:o.base({className:e}),"data-slot":"alert-root",...r,children:t})})})},_b=({children:t,className:e,...n})=>{const{slots:r,status:o}=a.useContext(tn),i=()=>{switch(o){case"accent":return h.jsx(yi,{"data-slot":"alert-default-icon"});case"success":return h.jsx(Wf,{"data-slot":"alert-default-icon"});case"warning":return h.jsx(Hf,{"data-slot":"alert-default-icon"});case"danger":return h.jsx(Uf,{"data-slot":"alert-default-icon"});default:return h.jsx(yi,{"data-slot":"alert-default-icon"})}};return h.jsx(oe.div,{className:ie(r==null?void 0:r.indicator,e),"data-slot":"alert-indicator",...n,children:t??i()})},Bb=({children:t,className:e,...n})=>{const{slots:r}=a.useContext(tn);return h.jsx(oe.div,{className:ie(r==null?void 0:r.content,e),"data-slot":"alert-content",...n,children:t})},Vb=({children:t,className:e,...n})=>{const{slots:r}=a.useContext(tn);return h.jsx(oe.p,{className:ie(r==null?void 0:r.title,e),"data-slot":"alert-title",...n,children:t})},zb=({children:t,className:e,...n})=>{const{slots:r}=a.useContext(tn);return h.jsx(oe.span,{className:ie(r==null?void 0:r.description,e),"data-slot":"alert-description",...n,children:t})},Rt=Object.assign(sl,{Root:sl,Indicator:_b,Content:Bb,Title:Vb,Description:zb}),To=a.createContext({}),Hb=({children:t,className:e,variant:n,...r})=>{const o=a.useMemo(()=>Xd({variant:n}),[n]);return h.jsx(qp,{className:Ee(e,o.item()),"data-slot":"menu-item",...r,children:i=>h.jsx(To,{value:{slots:o,state:i},children:typeof t=="function"?t(i):t})})},Ub=({children:t,className:e,type:n="checkmark",...r})=>{const{slots:o,state:i}=a.useContext(To),l=i==null?void 0:i.isSelected,s=typeof t=="function"?t(i??{}):t||(n==="dot"?h.jsx("svg",{"aria-hidden":"true","data-slot":"menu-item-indicator--dot",fill:"currentColor",fillRule:"evenodd",role:"presentation",viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg",children:h.jsx("path",{clipRule:"evenodd",d:"M8 15A7 7 0 1 0 8 1a7 7 0 0 0 0 14",fillRule:"evenodd"})}):h.jsx("svg",{"aria-hidden":"true","data-slot":"menu-item-indicator--checkmark",fill:"none",role:"presentation",stroke:"currentColor",strokeDasharray:22,strokeDashoffset:l?44:66,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,viewBox:"0 0 17 18",children:h.jsx("polyline",{points:"1 9 7 14 15 4"})}));return h.jsx(oe.span,{"aria-hidden":"true",className:ie(o==null?void 0:o.indicator,e),"data-slot":"menu-item-indicator","data-type":n,"data-visible":l||void 0,...r,children:s})},Wb=({children:t,className:e,...n})=>{const{slots:r,state:o}=a.useContext(To);if(!(o==null?void 0:o.hasSubmenu))return null;const s=t??h.jsx(Bf,{});return h.jsx(oe.span,{"aria-hidden":"true",className:ie(r==null?void 0:r.submenuIndicator,e),"data-slot":"submenu-indicator",...n,children:s})},Gb=({children:t,className:e,...n})=>{const r=a.useMemo(()=>Zd({class:typeof e=="string"?e:void 0}),[e]);return h.jsx(Gp,{className:r,...n,children:t})},or=a.createContext({}),al=({children:t,...e})=>{const n=a.useMemo(()=>Gd(),[]);return h.jsx(or,{value:{slots:n},children:h.jsx(Vp,{...e,children:t})})},qb=({children:t,className:e,...n})=>{const{slots:r}=a.useContext(or);return h.jsx(xo,{className:Ee(e,r==null?void 0:r.trigger()),"data-slot":"dropdown-trigger",...n,children:o=>h.jsx(h.Fragment,{children:typeof t=="function"?t(o):t})})},Yb=({children:t,className:e,placement:n,...r})=>{const{slots:o}=a.useContext(or);return h.jsx(Yn,{value:{variant:"default"},children:h.jsx(Nh,{...r,className:Ee(e,o==null?void 0:o.popover()),"data-slot":"dropdown-popover",placement:n,children:t})})};function Xb({className:t,...e}){const{slots:n}=a.useContext(or);return h.jsx(Hp,{className:Ee(t,n==null?void 0:n.menu()),"data-selection-mode":e.selectionMode,"data-slot":"dropdown-menu",...e})}const Zb=t=>h.jsx(Hb,{...t}),Jb=t=>h.jsx(Wb,{...t}),Qb=({children:t,...e})=>h.jsx(zp,{"data-slot":"dropdown-submenu-trigger",...e,children:t}),em=t=>h.jsx(Ub,{...t}),tm=t=>h.jsx(Gb,{...t}),Dt=Object.assign(al,{Root:al,Trigger:qb,Popover:Yb,Menu:Xb,Section:tm,Item:Zb,ItemIndicator:em,SubmenuIndicator:Jb,SubmenuTrigger:Qb}),we=a.createContext({}),cl=({children:t,state:e,...n})=>{const r=a.useMemo(()=>({slots:bo(),placement:void 0}),[]),o=a.useMemo(()=>e?{isOpen:e.isOpen,onOpenChange:e.setOpen}:{},[e]);return h.jsx(we,{value:r,children:h.jsx(Xp,{"data-slot":"modal-root",...Y(n,o),children:t})})},nm=({children:t,className:e,...n})=>{const{slots:r}=a.useContext(we);return h.jsx(rb,{children:h.jsx(oe.div,{className:ie(r==null?void 0:r.trigger,e),"data-slot":"modal-trigger",role:"button",...n,children:t})})},rm=({children:t,className:e,isDismissable:n=!0,onClick:r,variant:o,...i})=>{const{slots:l}=a.useContext(we),s=a.useMemo(()=>bo({variant:o}),[o]),c=a.useMemo(()=>({slots:{...l,...s}}),[l,s]);return h.jsx(fc,{className:Ee(e,s==null?void 0:s.backdrop()),"data-slot":"modal-backdrop",isDismissable:n,onClick:u=>{u.stopPropagation(),r==null||r(u)},...i,children:u=>h.jsxs(we,{value:c,children:[typeof t=="function"?t(u):t," "]})})},om=({children:t,className:e,placement:n="auto",scroll:r,size:o,...i})=>{const{slots:l}=a.useContext(we),s=a.useMemo(()=>bo({scroll:r,size:o}),[r,o]),c=a.useMemo(()=>({placement:n,slots:{...l,...s}}),[l,n,s]);return h.jsx(eb,{className:Ee(e,s==null?void 0:s.container()),"data-placement":n,"data-slot":"modal-container",...i,children:u=>h.jsx(we,{value:c,children:typeof t=="function"?t(u):t})})},im=({children:t,className:e,...n})=>{const{placement:r,slots:o}=a.useContext(we);return h.jsx(Yn,{value:{variant:"default"},children:h.jsx(Zp,{className:ie(o==null?void 0:o.dialog,e),"data-placement":r,"data-slot":"modal-dialog",...n,children:t})})},lm=({children:t,className:e,...n})=>{const{slots:r}=a.useContext(we);return h.jsx(oe.div,{className:ie(r==null?void 0:r.header,e),"data-slot":"modal-header",...n,children:t})},sm=({children:t,className:e,...n})=>{const{slots:r}=a.useContext(we);return h.jsx(oe.div,{className:ie(r==null?void 0:r.body,e),"data-slot":"modal-body",...n,children:t})},am=({children:t,className:e,...n})=>{const{slots:r}=a.useContext(we);return h.jsx(oe.div,{className:ie(r==null?void 0:r.footer,e),"data-slot":"modal-footer",...n,children:t})},cm=({children:t,className:e,...n})=>{const{slots:r}=a.useContext(we);return h.jsx(jf,{className:ie(r==null?void 0:r.heading,e),"data-slot":"modal-heading",slot:"title",...n,children:t})},um=({children:t,className:e,...n})=>{const{slots:r}=a.useContext(we);return h.jsx(oe.div,{className:ie(r==null?void 0:r.icon,e),"data-slot":"modal-icon",...n,children:t})},dm=({className:t,...e})=>{const{slots:n}=a.useContext(we);return h.jsx(ob,{className:Ee(t,n==null?void 0:n.closeTrigger()),"data-slot":"modal-close-trigger",slot:"close",...e})},pt=Object.assign(cl,{Root:cl,Trigger:nm,Backdrop:rm,Container:om,Dialog:im,Header:lm,Icon:um,Heading:cm,Body:sm,Footer:am,CloseTrigger:dm}),fm={easy:"GREEN",moderate:"ORANGE",difficult:"RED"},hm={easy:"Easy",moderate:"Moderate",difficult:"Difficult"};function pm(){return h.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",className:"size-[1em]",children:[h.jsx("path",{d:"M12 14a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z"}),h.jsx("path",{d:"m13.4 10.6 3.6-3.6"}),h.jsx("path",{d:"M3.3 16a9 9 0 1 1 17.4 0"})]})}function Tc({difficulty:t,label:e,showIcon:n=!0,size:r="md",className:o}){const i=je[fm[t]];return h.jsxs(_n,{variant:"soft",size:r,className:q(o),style:{backgroundColor:ot(i,.15),color:i},children:[n&&h.jsx(pm,{}),h.jsx(_n.Label,{children:e??hm[t]})]})}const ul=h.jsx("path",{d:"M10.29 3.86 1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0ZM12 9v4M12 17h.01"}),dl=h.jsxs(h.Fragment,{children:[h.jsx("circle",{cx:"12",cy:"12",r:"9"}),h.jsx("path",{d:"M12 16v-4M12 8h.01"})]}),bm=h.jsxs(h.Fragment,{children:[h.jsx("circle",{cx:"12",cy:"12",r:"9"}),h.jsx("path",{d:"m8.5 12 2.5 2.5 4.5-5"})]}),mm={note:dl,info:dl,tip:bm,caution:ul,danger:ul};function gm({type:t}){return h.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",className:"size-5",children:mm[t]})}function ym({type:t="caution",title:e,icon:n,children:r,className:o}){const i=e===void 0?Cn[t]:e,l=$l(t);return h.jsxs(Rt,{className:q("border",o),style:{backgroundColor:ot(l,.1),borderColor:l},children:[h.jsx(Rt.Indicator,{style:{color:l},children:n??h.jsx(gm,{type:t})}),h.jsxs(Rt.Content,{children:[i!=null&&h.jsx(Rt.Title,{children:i}),h.jsx(Rt.Description,{children:r})]})]})}const Mc="media-figure-point-marker absolute flex -translate-x-1/2 -translate-y-1/2 items-center justify-center rounded-full font-semibold shadow ring-2 ring-background",Bn="media-figure-shape-outline";function vm(t){return t.type==="circle"}function xm(t){return t.type==="rectangle"}function $m(t,e){const n=t.id??e,r=t.color??"GREY",o=je[r];if(vm(t))return h.jsx("div",{role:"img","aria-label":t.title,className:q("pointer-events-none absolute rounded-full",Bn),style:{left:`${t.x}%`,top:`${t.y}%`,width:`${t.radius*2}%`,aspectRatio:"1",transform:"translate(-50%, -50%)",borderColor:o,backgroundColor:ot(o,.1)}},n);if(xm(t)){const i=Math.min(t.x1,t.x2),l=Math.min(t.y1,t.y2),s=Math.abs(t.x2-t.x1),c=Math.abs(t.y2-t.y1);return h.jsx("div",{role:"img","aria-label":t.title,className:q("pointer-events-none absolute",Bn),style:{left:`${i}%`,top:`${l}%`,width:`${s}%`,height:`${c}%`,borderColor:o,backgroundColor:ot(o,.1)}},n)}return h.jsx("span",{role:"img","aria-label":t.title,style:{left:`${t.x}%`,top:`${t.y}%`,backgroundColor:o,color:Hn(o)},className:Mc,children:t.label},n)}function no({annotations:t}){return h.jsx(h.Fragment,{children:t.map($m)})}const Vn=4/3,Mo=16;function ct(t){return Math.round(t*3/4)}const Pr=(t,e,n)=>Math.min(Math.max(t,e),n);function nn(t,e,n){const r=Math.min(e,Math.floor(n*Vn)),o=Pr(Math.round(t.width),Math.min(Mo,r),r),i=ct(o);return{width:o,x:Pr(Math.round(t.x),0,e-o),y:Pr(Math.round(t.y),0,n-i)}}function Rc(t,e){const r=t/e<=Vn?t:Math.round(e*Vn),o=ct(r);return nn({x:(t-r)/2,y:(e-o)/2,width:r},t,e)}function wm(t,e,n){const{x:r,y:o,width:i}=t;if(i<=0||r<0||o<0)return!1;const l=ct(i);return r+i<=e&&o+l<=n}function Em(t,e,n,r,o){if(r<=0||o<=0||e<=0||n<=0||!wm(t,e,n))return null;const i=r/t.width;return{position:"absolute",width:i*e,height:i*n,left:-t.x*i,top:-t.y*i,maxWidth:"none"}}function Cm(t,e){t(),requestAnimationFrame(()=>{t(),requestAnimationFrame(t)});const n=[];for(let r=50;r<=e;r+=50)n.push(setTimeout(t,r));return()=>{for(const r of n)clearTimeout(r)}}function Sm(t={}){const{settleMs:e=0,observeParent:n=!1,remeasureWhenVisible:r=!1,layoutSettleKey:o}=t,i=a.useRef(null),[l,s]=a.useState(null),c=a.useCallback(()=>{const d=i.current;if(!d)return;const{width:f,height:b}=d.getBoundingClientRect();f<=0||b<=0||s(p=>(p==null?void 0:p.width)===f&&(p==null?void 0:p.height)===b?p:{width:f,height:b})},[]),u=a.useCallback(()=>{c(),requestAnimationFrame(()=>{c(),requestAnimationFrame(()=>{c(),setTimeout(c,0)})})},[c]);return a.useLayoutEffect(()=>{c();const d=i.current;if(!d)return;const f=new ResizeObserver(()=>c());f.observe(d),n&&d.parentElement&&f.observe(d.parentElement);const b=[];let p=d;for(let y=0;p&&y<6;y+=1)b.push(p),p=p.parentElement;const g=()=>u();for(const y of b)y.addEventListener("transitionend",g);return()=>{f.disconnect();for(const y of b)y.removeEventListener("transitionend",g)}},[c,u,n]),a.useEffect(()=>{if(!(e<=0))return Cm(c,e)},[o,c,e]),a.useEffect(()=>{if(!r)return;const d=i.current;if(!d)return;const f=new IntersectionObserver(b=>{for(const p of b)p.isIntersecting&&p.intersectionRatio>=.99&&u()},{threshold:[0,.25,.5,.75,.99,1]});return f.observe(d),()=>f.disconnect()},[o,u,r]),a.useEffect(()=>{o!==void 0&&u()},[o,u]),{ref:i,size:l,measure:c,measureAfterLayout:u}}function Pm(t){const e=t.split(/[?#]/)[0]??t,n=e.lastIndexOf("/"),r=e.lastIndexOf(".");return r<=n?null:e.slice(r+1).toLowerCase()||null}function km({src:t,modelFileName:e}){const n=a.useRef(null);return a.useEffect(()=>{const r=n.current;if(!r)return;let o=!1,i=null,l=null;return import("online-3d-viewer").then(s=>{if(o)return;const c=new s.EmbeddedViewer(r,{projectionMode:s.ProjectionMode.Orthographic,backgroundColor:new s.RGBAColor(219,234,254,255),defaultColor:new s.RGBColor(30,64,175),onModelLoaded:()=>{const d=c.GetViewer();d.SetNavigationMode(s.NavigationMode.FreeOrbit),d.SetUpVector(s.Direction.Z,!1);const f=d.GetBoundingSphere(()=>!0);d.FitSphereToWindow(f,!1)}});l=c,(t.startsWith("blob:")||Pm(t)===null&&!!e)&&e?c.LoadModelFromInputFiles([new s.InputFile(e,s.FileSource.Url,t)]):c.LoadModelFromUrlList([t]),typeof ResizeObserver<"u"&&(i=new ResizeObserver(()=>{c.Resize()}),i.observe(r))}),()=>{o=!0,i==null||i.disconnect(),l==null||l.Destroy()}},[t,e]),h.jsx("div",{ref:n,className:"absolute inset-0 [&_canvas]:size-full!","aria-label":"Interactive 3D model",role:"img"})}const Tm=400;function Ro({className:t,src:e,type:n="image",displayRegion:r,modelFileName:o,layoutSettleKey:i,remeasureWhenVisible:l=!1,children:s}){const c=!!r,{ref:u,size:d,measureAfterLayout:f}=Sm({settleMs:c?Tm:0,observeParent:c,remeasureWhenVisible:c&&l,layoutSettleKey:i}),[b,p]=a.useState(null),g=r&&b&&d&&Em(r,b.width,b.height,d.width,d.height),y=!!g,v=!!(r&&b&&!g),w="size-full object-cover object-center",x=T=>{const R=T.currentTarget;R.naturalWidth>0&&R.naturalHeight>0&&(p({width:R.naturalWidth,height:R.naturalHeight}),f())},P=T=>{const R=T.currentTarget;R.videoWidth>0&&R.videoHeight>0&&(p({width:R.videoWidth,height:R.videoHeight}),f())};return a.useEffect(()=>{p(null)},[e]),n==="model"?h.jsxs("div",{ref:u,className:q("@container relative overflow-hidden",t),children:[h.jsx(km,{src:e,modelFileName:o}),s]}):h.jsxs("div",{ref:u,className:q("@container relative overflow-hidden",t),children:[n==="video"?h.jsx("video",{src:e,controls:!0,className:y?"absolute max-w-none":w,style:{...y&&g?g:void 0,opacity:v?0:1},onLoadedMetadata:r?P:void 0}):h.jsx("img",{src:e,alt:"",className:y?"absolute max-w-none":w,style:{...y&&g?g:void 0,opacity:v?0:1},onLoad:r?x:void 0}),s]})}function Mm({className:t="absolute inset-0",...e}){return h.jsx(Ro,{className:t,...e})}const Rm=2,fl=3,zn=(t,e,n)=>Math.min(Math.max(t,e),n),Dc=t=>t.type==="circle",rn=t=>t.type==="rectangle",hl=t=>rn(t)?[t.x1,t.x2]:[t.x],pl=t=>rn(t)?[t.y1,t.y2]:[t.y];function Dm(t,e,n){const r=zn(e,-Math.min(...hl(t)),100-Math.max(...hl(t))),o=zn(n,-Math.min(...pl(t)),100-Math.max(...pl(t)));return rn(t)?{...t,x1:t.x1+r,y1:t.y1+o,x2:t.x2+r,y2:t.y2+o}:{...t,x:t.x+r,y:t.y+o}}function bl(t,e,n){return Math.hypot(e.x-t.x,(e.y-t.y)/n)}function Nc(t){return{...t,x1:Math.min(t.x1,t.x2),y1:Math.min(t.y1,t.y2),x2:Math.max(t.x1,t.x2),y2:Math.max(t.y1,t.y2)}}function Nm(t,e,n){return t==="circle"?{type:"circle",x:e.x,y:e.y,radius:0,color:n}:t==="rectangle"?{type:"rectangle",x1:e.x,y1:e.y,x2:e.x,y2:e.y,color:n}:{type:"point",x:e.x,y:e.y,color:n}}function Im(t){return t==="circle"?"create-circle":t==="rectangle"?"create-rectangle":"create-point"}function Lm(t,e,n){switch(t.mode){case"create-point":return{...t.base,x:e.x,y:e.y};case"move":return Dm(t.base,e.x-t.start.x,e.y-t.start.y);case"create-circle":return{...t.base,radius:bl(t.start,e,n)};case"resize-circle":{const r=t.base;return{...r,radius:bl({x:r.x,y:r.y},e,n)}}case"create-rectangle":return{...t.base,x2:e.x,y2:e.y};case"resize-rect":{const r=t.base,o=t.corner==="nw"||t.corner==="sw",i=t.corner==="nw"||t.corner==="ne";return{...r,x1:o?e.x:r.x1,x2:o?r.x2:e.x,y1:i?e.y:r.y1,y2:i?r.y2:e.y}}}}function ml(t){if(Dc(t))return{...t,radius:Math.max(t.radius,Rm)};if(rn(t)){const e=Nc(t);return{...e,x2:Math.max(e.x2,e.x1+fl),y2:Math.max(e.y2,e.y1+fl)}}return t}function gl({x:t,y:e,cursor:n,onPointerDown:r}){return h.jsx("span",{onPointerDown:r,className:"annotation-handle pointer-events-auto absolute size-3 -translate-x-1/2 -translate-y-1/2 rounded-sm border border-background bg-accent shadow",style:{left:`${t}%`,top:`${e}%`,cursor:n}})}function Km({annotations:t,editing:e}){const{tool:n,color:r,selectedId:o,onSelect:i,onAdd:l,onChange:s,onRemove:c}=e,u=a.useRef(null),d=a.useRef(!1),[f,b]=a.useState(null),[p,g]=a.useState(null),y=n==="select",v=k=>{const A=u.current.getBoundingClientRect();return{x:zn((k.clientX-A.left)/A.width*100,0,100),y:zn((k.clientY-A.top)/A.height*100,0,100)}},w=(k,A)=>{var V;(V=u.current)==null||V.setPointerCapture(k.pointerId),d.current=!1,b(A),g(ml(A.base))},x=k=>{if(y){i==null||i(null);return}const A=v(k);w(k,{mode:Im(n),id:null,start:A,base:Nm(n,A,r)})},P=k=>{if(!f)return;const A=u.current.getBoundingClientRect();d.current=!0,g(ml(Lm(f,v(k),A.width/A.height)))},T=k=>{var A;f&&p&&((A=u.current)==null||A.releasePointerCapture(k.pointerId),f.id===null?l==null||l(p):d.current&&(s==null||s(f.id,p))),b(null),g(null)},R=(k,A,V)=>{var j;k.stopPropagation(),(j=u.current)==null||j.focus(),i==null||i(A),w(k,{mode:"move",id:A,start:v(k),base:V})},K=(k,A,V)=>{k.stopPropagation(),w(k,{mode:"resize-circle",id:A,start:v(k),base:V})},M=(k,A,V,j)=>{k.stopPropagation(),w(k,{mode:"resize-rect",id:A,start:v(k),base:Nc(V),corner:j})},N=k=>{(k.key==="Delete"||k.key==="Backspace")&&o!=null&&(k.preventDefault(),c==null||c(o))},O=(k,A,V)=>{const j=V&&A===o,m=je[k.color??"GREY"],E=V?"pointer-events-auto cursor-move":"pointer-events-none",I=V?C=>R(C,A,k):void 0;if(Dc(k))return h.jsxs("div",{children:[h.jsx("div",{role:"img","aria-label":k.title,onPointerDown:I,className:q("absolute rounded-full",Bn,E,j&&"outline outline-2 outline-offset-2 outline-accent"),style:{left:`${k.x}%`,top:`${k.y}%`,width:`${k.radius*2}%`,aspectRatio:"1",transform:"translate(-50%, -50%)",borderColor:m,backgroundColor:ot(m,.1)}}),j&&h.jsx(gl,{x:k.x+k.radius,y:k.y,cursor:"ew-resize",onPointerDown:C=>K(C,A,k)})]},A);if(rn(k)){const C=Math.min(k.x1,k.x2),D=Math.min(k.y1,k.y2),$=Math.abs(k.x2-k.x1),S=Math.abs(k.y2-k.y1),L=[{corner:"nw",x:C,y:D,cursor:"nwse-resize"},{corner:"ne",x:C+$,y:D,cursor:"nesw-resize"},{corner:"sw",x:C,y:D+S,cursor:"nesw-resize"},{corner:"se",x:C+$,y:D+S,cursor:"nwse-resize"}];return h.jsxs("div",{children:[h.jsx("div",{role:"img","aria-label":k.title,onPointerDown:I,className:q("absolute",Bn,E,j&&"outline outline-2 outline-offset-2 outline-accent"),style:{left:`${C}%`,top:`${D}%`,width:`${$}%`,height:`${S}%`,borderColor:m,backgroundColor:ot(m,.1)}}),j&&L.map(({corner:U,x:W,y:G,cursor:ee})=>h.jsx(gl,{x:W,y:G,cursor:ee,onPointerDown:le=>M(le,A,k,U)},U))]},A)}return h.jsx("span",{role:"img","aria-label":k.title,onPointerDown:I,style:{left:`${k.x}%`,top:`${k.y}%`,backgroundColor:m,color:Hn(m)},className:q(Mc,E,j&&"outline outline-2 outline-offset-2 outline-accent"),children:k.label},A)};return h.jsxs("div",{ref:u,tabIndex:0,role:"application","aria-label":"Annotation editor",onPointerDown:x,onPointerMove:P,onPointerUp:T,onKeyDown:N,className:q("absolute inset-0 focus:outline-none",y?"cursor-default":"cursor-crosshair"),children:[t.map((k,A)=>{const V=k.id??String(A),j=(f==null?void 0:f.id)===V&&p?p:k;return O(j,V,y)}),(f==null?void 0:f.id)===null&&p&&O(p,"__draft__",!1)]})}function ir({src:t,type:e="image",modelFileName:n,annotations:r=[],displayRegion:o,zoomable:i=!0,annotationEditing:l,layoutSettleKey:s,className:c}){const u="@container relative aspect-[4/3] overflow-hidden rounded-lg border border-default bg-default-soft",d=h.jsxs(h.Fragment,{children:[h.jsx(Mm,{src:t,type:e,displayRegion:o,modelFileName:n,layoutSettleKey:s}),l?h.jsx(Km,{annotations:r,editing:l}):h.jsx(no,{annotations:r})]});return h.jsx("figure",{className:q("flex flex-col gap-2",c),children:i&&e==="image"&&!l?h.jsxs(pt,{children:[h.jsx(pt.Trigger,{"aria-label":"View image full size",className:q(u,"cursor-zoom-in"),children:d}),h.jsx(pt.Backdrop,{variant:"blur",children:h.jsx(pt.Container,{placement:"center",children:h.jsxs(pt.Dialog,{"aria-label":"Full size image",className:"w-auto max-w-[95vw] overflow-hidden bg-transparent p-0 shadow-none",children:[h.jsx(Ro,{className:"aspect-[4/3] max-h-[88vh] w-[min(95vw,calc(88vh*4/3))] rounded-lg border border-default bg-default-soft",src:t,type:"image",displayRegion:o,remeasureWhenVisible:!0,children:h.jsx(no,{annotations:r})}),h.jsx(pt.CloseTrigger,{})]})})})]}):h.jsx("div",{className:u,children:d})})}const Do=Symbol.for("@openpawlabs/diy-guides-ui/MediaFigure");ir[Do]=!0;function Am(){return h.jsx("svg",{viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",className:"size-2/3",children:h.jsx("path",{d:"M8 5v14l11-7z"})})}const Om={model:{hex:je.BLUE,content:h.jsx("span",{className:"text-lg font-bold",children:"3D"})},video:{hex:je.MAGENTA,content:h.jsx(Am,{})}};function Ic({src:t,type:e="image",annotations:n=[],displayRegion:r,className:o}){if(e==="image")return h.jsx(Ro,{className:q("aspect-[4/3]",o),src:t,type:"image",displayRegion:r,children:h.jsx(no,{annotations:n})});const{hex:i,content:l}=Om[e];return h.jsx("div",{"aria-hidden":"true",className:q("flex aspect-[4/3] items-center justify-center",o),style:{backgroundColor:i,color:Hn(i)},children:l})}const Fm=[{corner:"nw",cursor:"nwse-resize"},{corner:"ne",cursor:"nesw-resize"},{corner:"sw",cursor:"nesw-resize"},{corner:"se",cursor:"nwse-resize"}],jm=(t,e,n)=>Math.min(Math.max(t,e),n);function _m(t,e,n,r,o){return nn({x:t.x+e,y:t.y+n,width:t.width},r,o)}function Bm(t,e,n,r,o){const i=e==="nw"||e==="sw",l=e==="nw"||e==="ne",s=i?t.x+t.width:t.x,c=l?t.y+ct(t.width):t.y,u=i?s:r-s,d=l?c:o-c,f=Math.min(u,d*(4/3)),b=jm(Math.abs(n.x-s),Mo,f),p=ct(b);return nn({x:i?s-b:s,y:l?c-p:c,width:b},r,o)}function Vm({src:t,region:e,onChange:n,className:r}){const o=a.useRef(null),[i,l]=a.useState(null),[s,c]=a.useState(null),[u,d]=a.useState(null),f=x=>{const P=x.currentTarget;P.naturalWidth>0&&P.naturalHeight>0&&l({width:P.naturalWidth,height:P.naturalHeight})},b=u??(i?e?nn(e,i.width,i.height):Rc(i.width,i.height):null),p=x=>{const P=o.current.getBoundingClientRect();return{x:(x.clientX-P.left)/P.width*i.width,y:(x.clientY-P.top)/P.height*i.height}},g=(x,P)=>{var T;x.stopPropagation(),(T=o.current)==null||T.setPointerCapture(x.pointerId),c(P),d(P.base)},y=x=>{if(!s||!i)return;const P=p(x),T=s.mode==="move"?_m(s.base,P.x-s.start.x,P.y-s.start.y,i.width,i.height):Bm(s.base,s.corner,P,i.width,i.height);d(T)},v=x=>{var P;s&&u&&((P=o.current)==null||P.releasePointerCapture(x.pointerId),n(u)),c(null),d(null)},w=b&&i?{left:b.x/i.width*100,top:b.y/i.height*100,width:b.width/i.width*100,height:ct(b.width)/i.height*100}:null;return h.jsxs("div",{ref:o,role:"application","aria-label":"Crop editor",className:q("relative inline-block touch-none select-none overflow-hidden leading-none",r),style:i?{"--crop-aspect":i.width/i.height}:void 0,onPointerMove:y,onPointerUp:v,children:[h.jsx("img",{src:t,alt:"",draggable:!1,onLoad:f,className:"block h-auto w-full select-none"}),w&&h.jsx("div",{className:"crop-region absolute cursor-move border-2 border-background",style:{left:`${w.left}%`,top:`${w.top}%`,width:`${w.width}%`,height:`${w.height}%`,boxShadow:"0 0 0 9999px rgba(0, 0, 0, 0.5)"},onPointerDown:x=>g(x,{mode:"move",start:p(x),base:b}),children:Fm.map(({corner:x,cursor:P})=>h.jsx("span",{className:"crop-handle pointer-events-auto absolute size-3 -translate-x-1/2 -translate-y-1/2 rounded-sm border border-background bg-accent shadow",style:{left:x==="nw"||x==="sw"?"0%":"100%",top:x==="nw"||x==="ne"?"0%":"100%",cursor:P},onPointerDown:T=>g(T,{mode:"resize",corner:x,start:p(T),base:b})},x))})]})}function zm({name:t,thumbnail:e,href:n,quantity:r,price:o,children:i,className:l}){return h.jsxs("li",{className:q("flex items-center gap-3 py-3 first:pt-0 last:pb-0",l),children:[e&&h.jsx("img",{src:e,alt:"",className:"size-12 shrink-0 rounded-md border border-default object-cover"}),h.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[n?h.jsx(ko,{href:n,className:"font-medium",children:t}):h.jsx("span",{className:"font-medium",children:t}),i!=null&&h.jsx("span",{className:"text-sm text-default-500",children:i})]}),r!=null&&h.jsxs("span",{className:"shrink-0 text-sm text-default-500",children:["×",r]}),o!=null&&h.jsx("span",{className:"shrink-0 text-sm font-medium",children:o})]})}function Hm({title:t="What you need",children:e,className:n}){return h.jsxs(Ot,{className:q("w-full",n),children:[t!=null&&h.jsx(Ot.Header,{children:h.jsx(Ot.Title,{children:t})}),h.jsx(Ot.Content,{children:h.jsx("ul",{className:"flex flex-col divide-y divide-default",children:e})})]})}const Um=Object.assign(Hm,{Item:zm});function Lc(t){return null}function Wm(t){return a.isValidElement(t)&&t.type===Lc}function Kc(){return h.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2.5,strokeLinecap:"round",strokeLinejoin:"round",className:"mr-1 size-4 shrink-0",children:h.jsx("path",{d:"m6 9 6 6 6-6"})})}function yl(){return h.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",className:"size-4",children:h.jsx("path",{d:"M10 13a5 5 0 0 0 7.07 0l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71M14 11a5 5 0 0 0-7.07 0l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"})})}function Gm(){return h.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",className:"size-4",children:h.jsx("path",{d:"M12 19V5M5 12l7-7 7 7"})})}function qm(){return h.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2.5,strokeLinecap:"round",strokeLinejoin:"round",className:"size-3.5",children:h.jsx("path",{d:"M18 6 6 18M6 6l12 12"})})}function Ym(){return h.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",fill:"currentColor",className:"size-4",children:[h.jsx("circle",{cx:"9",cy:"6",r:"1.4"}),h.jsx("circle",{cx:"15",cy:"6",r:"1.4"}),h.jsx("circle",{cx:"9",cy:"12",r:"1.4"}),h.jsx("circle",{cx:"15",cy:"12",r:"1.4"}),h.jsx("circle",{cx:"9",cy:"18",r:"1.4"}),h.jsx("circle",{cx:"15",cy:"18",r:"1.4"})]})}function ro(t){const{href:e,download:n,external:r}=t.props;return{href:e,download:n,...r?{target:"_blank",rel:"noreferrer noopener"}:{}}}function Xm(t,e,n,r){return q(qe({variant:t,size:e,fullWidth:!0}),"!min-h-0 !justify-center !rounded-none",n&&"!rounded-b-3xl",r&&"border-b border-separator","hover:!bg-[var(--button-bg-hover)] data-[hovered=true]:!bg-[var(--button-bg-hover)]")}function oo(){return h.jsx("span",{"aria-hidden":"true",className:po({orientation:"horizontal"}).separator()})}function Zm({variant:t="primary",size:e="md",icon:n,menuLabel:r="More download options",editing:o,children:i,className:l}){const s=a.Children.toArray(i).filter(Wm);if(o)return h.jsx(Qm,{items:s,variant:t,size:e,icon:n,menuLabel:r,editing:o,className:l});if(s.length===0)return null;const[c,...u]=s;if(u.length===0){const d=qe({variant:"secondary",size:e});return h.jsxs(ko,{...ro(c),className:q(d,l),children:[n,c.props.children]})}return h.jsx(Jm,{items:s,variant:t,size:e,icon:n,menuLabel:r,className:l})}function Jm({items:t,variant:e,size:n,icon:r,menuLabel:o,className:i}){const l=a.useRef(null),[s,c]=a.useState(),[u]=t,d=qe({variant:e,size:n});return a.useLayoutEffect(()=>{const f=l.current;if(!f)return;const b=()=>c(f.offsetWidth);b();const p=new ResizeObserver(b);return p.observe(f),()=>p.disconnect()},[t,e,n]),h.jsxs("div",{ref:l,className:q(po({orientation:"horizontal"}).base(),i),children:[h.jsxs(ko,{...ro(u),className:d,children:[r,u.props.children]}),h.jsxs(Dt,{children:[h.jsxs(Dt.Trigger,{"aria-label":o,className:q(qe({variant:e,size:n,isIconOnly:!0}),"!inline-flex items-center justify-center"),children:[h.jsx(oo,{}),h.jsx(Kc,{})]}),h.jsx(Dt.Popover,{placement:"bottom",offset:0,triggerRef:l,className:"!max-w-none !p-0",style:s?{minWidth:s}:void 0,children:h.jsx(Dt.Menu,{className:"!gap-0 !p-0",children:t.map((f,b)=>h.jsxs(Dt.Item,{...ro(f),className:Xm("secondary",n,b===t.length-1,b<t.length-1),children:[b===0?r:null,f.props.children]},b))})})]})]})}function Qm({items:t,variant:e,size:n,icon:r,menuLabel:o,editing:i,className:l}){const[s,c]=a.useState(!1),[u,d]=a.useState(null),[f,b]=a.useState(null),{onAddItem:p,onRemoveItem:g,onReorderItem:y,onSelectItem:v}=i,w=t[0],x=t.slice(1),P=qe({variant:e,size:n}),T=y!=null,R=()=>{d(null),b(null)},K=M=>{u!=null&&u!==M&&(y==null||y(u,M)),R()};return h.jsxs("div",{className:q("relative inline-flex flex-col items-start",l),children:[h.jsxs("div",{className:po({orientation:"horizontal"}).base(),children:[h.jsxs("span",{className:q(P,"cursor-text"),children:[r,w?w.props.children:h.jsx("span",{className:"opacity-60",children:"Add a link"})]}),w&&v&&h.jsxs("button",{type:"button",onClick:()=>v(0),"aria-label":"Edit primary link",className:qe({variant:e,size:n,isIconOnly:!0}),children:[h.jsx(oo,{}),h.jsx(yl,{})]}),h.jsxs("button",{type:"button",onClick:()=>c(M=>!M),"aria-label":o,"aria-expanded":s,className:qe({variant:e,size:n,isIconOnly:!0}),children:[!(w&&v)&&h.jsx(oo,{}),h.jsx(Kc,{})]})]}),s&&h.jsxs(h.Fragment,{children:[h.jsx("div",{className:"fixed inset-0 z-40",onClick:()=>c(!1),"aria-hidden":"true"}),h.jsxs("div",{className:"absolute left-0 top-full z-50 mt-2 w-64 rounded-lg border border-default-200 bg-background p-2 shadow-lg",children:[x.length>0?h.jsx("ul",{className:"flex flex-col gap-0.5",children:x.map((M,N)=>{const O=N+1;return h.jsxs("li",{draggable:T||void 0,onDragStart:T?()=>d(O):void 0,onDragOver:T?k=>{k.preventDefault(),b(O)}:void 0,onDrop:T?k=>{k.preventDefault(),K(O)}:void 0,onDragEnd:T?R:void 0,className:q("flex items-center gap-1.5 rounded-md px-1.5 py-1 transition",T&&"cursor-grab",u===O&&"opacity-40",f===O&&u!==O&&"ring-2 ring-accent"),children:[T&&h.jsx("span",{className:"shrink-0 text-default-400",children:h.jsx(Ym,{})}),h.jsx("span",{className:"min-w-0 flex-1 text-sm",children:M.props.children}),y&&h.jsx("button",{type:"button",onClick:()=>y(O,0),"aria-label":"Make default download",className:"shrink-0 rounded p-0.5 text-default-500 transition hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent",children:h.jsx(Gm,{})}),v&&h.jsx("button",{type:"button",onClick:()=>v(O),"aria-label":"Edit link",className:"shrink-0 rounded p-0.5 text-default-500 transition hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent",children:h.jsx(yl,{})}),g&&h.jsx("button",{type:"button",onClick:()=>g(O),"aria-label":"Remove option",className:"shrink-0 rounded p-0.5 text-default-500 transition hover:text-danger focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent",children:h.jsx(qm,{})})]},O)})}):h.jsx("p",{className:"px-1.5 py-1 text-sm text-default-500",children:"No other options yet."}),p&&h.jsx("button",{type:"button",onClick:p,className:"mt-1 w-full rounded-md px-1.5 py-1 text-left text-sm font-medium text-accent transition hover:bg-default-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent",children:"+ Add option"})]})]})]})}const eg=Object.assign(Zm,{Item:Lc});function tg(t,e,n){const[r,o]=a.useState(e),i=t!==void 0,l=i?t:r,s=a.useCallback(c=>{i||o(c),n==null||n(c)},[i,n]);return[l,s]}const Ac=3,ng="#3ABF84",rg="#34B07A",og="#0B7A47",ig={caution:Cn.caution,reminder:"Reminder",note:Cn.note};function lg(){return h.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",className:"size-5 shrink-0 text-danger",children:h.jsx("path",{d:"M10.29 3.86 1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0ZM12 9v4M12 17h.01"})})}function sg(){return h.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",className:"size-5 shrink-0 text-default-500",children:[h.jsx("circle",{cx:"12",cy:"12",r:"9"}),h.jsx("path",{d:"M12 16v-4M12 8h.01"})]})}function ag(){return h.jsx("span",{"aria-hidden":"true",className:"mt-0.5 flex size-6 shrink-0 items-center justify-center rounded bg-default-100",children:h.jsx("svg",{viewBox:"0 0 24 24",fill:"currentColor",className:"size-3.5 text-default-500",children:h.jsx("path",{d:"M16 12V4h1V3H7v1h1v8l-2 2v1h5.2c-.2.6-.3 1.2-.3 1.8 0 2.2 1.8 4 4 4s4-1.8 4-4c0-.6-.1-1.2-.3-1.8H18v-1l-2-2z"})})})}function cg(){return h.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",className:"size-7",children:h.jsx("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4M17 8l-5-5-5 5M12 3v12"})})}function Oc(){return h.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2.5,strokeLinecap:"round",strokeLinejoin:"round",className:"size-3",children:h.jsx("path",{d:"M18 6 6 18M6 6l12 12"})})}function ug(){return h.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",className:"size-4",children:h.jsx("path",{d:"M12 20h9M16.5 3.5a2.121 2.121 0 0 1 3 3L7 19l-4 1 1-4Z"})})}function dg(){return h.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",className:"size-4",children:h.jsx("path",{d:"M6 2v14a2 2 0 0 0 2 2h14M2 6h14a2 2 0 0 1 2 2v14"})})}function fg(){return h.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",fill:"currentColor",className:"size-3.5",children:[h.jsx("circle",{cx:"9",cy:"6",r:"1.4"}),h.jsx("circle",{cx:"15",cy:"6",r:"1.4"}),h.jsx("circle",{cx:"9",cy:"12",r:"1.4"}),h.jsx("circle",{cx:"15",cy:"12",r:"1.4"}),h.jsx("circle",{cx:"9",cy:"18",r:"1.4"}),h.jsx("circle",{cx:"15",cy:"18",r:"1.4"})]})}function hg(t){return a.isValidElement(t)?t.type===ir?!0:typeof t.type=="function"&&t.type[Do]===!0:!1}function vl(t,e){return t.type===ir?h.jsx(Ic,{src:t.props.src,type:t.props.type,annotations:t.props.annotations,displayRegion:t.props.displayRegion,className:e}):a.cloneElement(t,{thumbnailPreview:!0,className:e})}function Fc(t){return a.isValidElement(t)&&t.type===Bc}function pg(t){return a.isValidElement(t)?a.Children.toArray(t.props.children).filter(Fc).length:0}function bg(t,e=!1){let n=null,r=null;for(const i of a.Children.toArray(t))a.isValidElement(i)&&(i.type===jc&&(n=i.props.children),i.type===_c&&(r=i));const o=a.Children.toArray(n).filter(hg);return pg(r),{figures:o.slice(0,Ac),bullets:r}}function jc(t){return null}function _c({children:t,className:e,editing:n}){const[r,o]=a.useState(null),[i,l]=a.useState(null);if(!n)return h.jsx("ul",{className:q("flex flex-col gap-2",e),children:t});const{onAddBullet:s,onRemoveBullet:c,onReorderBullet:u}=n,d=a.Children.toArray(t).filter(Fc),f=u!=null&&d.length>1,b=c!=null&&d.length>1,p=()=>{o(null),l(null)},g=y=>{r!=null&&r!==y&&(u==null||u(r,y)),p()};return h.jsxs("ul",{className:q("flex flex-col gap-2",e),children:[d.map((y,v)=>a.cloneElement(y,{key:y.key??v,__edit:{canReorder:f,isDragging:r===v,isOver:i===v&&r!==v,onRemove:b?()=>c==null?void 0:c(v):void 0,onDragStart:()=>o(v),onDragOver:()=>l(v),onDrop:()=>g(v),onDragEnd:p}})),s&&h.jsx("li",{className:"list-none",children:h.jsx("button",{type:"button",onClick:s,className:"rounded-md px-1 py-0.5 text-sm font-medium text-default-500 transition hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent",children:"+ New bullet"})})]})}function Bc(t){const{variant:e="dot",color:n="GREY",label:r,hideLabel:o=!1,onMarkerPress:i,markerAriaLabel:l,children:s,className:c}=t,u=t.__edit,[d,f]=a.useState(!1);let b=null,p;if(e==="dot")b=i?h.jsx("button",{type:"button",onClick:i,"aria-label":l??"Change bullet style",className:"mt-1.5 size-2 shrink-0 cursor-pointer rounded-full outline-none transition hover:ring-2 hover:ring-accent focus-visible:ring-2 focus-visible:ring-accent",style:{backgroundColor:je[n]}}):h.jsx("span",{"aria-hidden":"true",className:"mt-1.5 size-2 shrink-0 rounded-full",style:{backgroundColor:je[n]}}),p=h.jsx("span",{className:"flex-1",children:s});else if(e==="button")b=i?h.jsx("button",{type:"button",onClick:i,"aria-label":l??"Change bullet style",className:"size-2 shrink-0 cursor-pointer rounded-full bg-default-300 outline-none transition hover:ring-2 hover:ring-accent focus-visible:ring-2 focus-visible:ring-accent"}):null,p=h.jsx("div",{className:"min-w-0 flex-1",children:s});else{const P=r??ig[e],T=e==="caution"?h.jsx(lg,{}):e==="reminder"?h.jsx(ag,{}):h.jsx(sg,{});b=i?h.jsx("button",{type:"button",onClick:i,"aria-label":l??"Change bullet style",className:"shrink-0 cursor-pointer rounded outline-none transition hover:opacity-70 focus-visible:ring-2 focus-visible:ring-accent",children:T}):T,p=h.jsxs("span",{className:"flex-1",children:[!o&&h.jsxs(h.Fragment,{children:[h.jsxs("span",{className:"font-semibold",children:[P,":"]})," "]}),s]})}const g=q("flex gap-2.5",e==="button"&&"items-center",e==="caution"&&"text-danger",c);if(!u)return h.jsxs("li",{className:g,children:[b,p]});const{canReorder:y,isDragging:v,isOver:w,onRemove:x}=u;return h.jsxs("li",{className:q("group rounded-md",g,v&&"opacity-40",w&&"ring-2 ring-accent"),draggable:y&&d?!0:void 0,onDragStart:y?P=>{P.dataTransfer.effectAllowed="move",u.onDragStart()}:void 0,onDragOver:y?P=>{P.preventDefault(),P.dataTransfer.dropEffect="move",u.onDragOver()}:void 0,onDrop:y?P=>{P.preventDefault(),u.onDrop()}:void 0,onDragEnd:y?()=>{f(!1),u.onDragEnd()}:void 0,children:[y&&h.jsx("span",{"aria-hidden":"true",onPointerDown:()=>f(!0),onPointerUp:()=>f(!1),className:"mt-1 shrink-0 cursor-grab text-default-400 transition hover:text-default-500",children:h.jsx(fg,{})}),b,p,x&&h.jsx("button",{type:"button",onClick:x,"aria-label":"Remove bullet",className:"mt-1 shrink-0 rounded p-0.5 text-default-400 opacity-0 transition hover:text-danger focus-visible:opacity-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent group-hover:opacity-100",children:h.jsx(Oc,{})})]})}function mg(){return h.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:3,strokeLinecap:"round",strokeLinejoin:"round",className:"size-4",children:h.jsx("path",{d:"m5 12 5 5 9-11"})})}function gg({figures:t,bullets:e,mediaEditing:n}){const r=n!=null,[o,i]=a.useState(0),[l,s]=a.useState(null),[c,u]=a.useState(null),d=(n==null?void 0:n.activeIndex)??o,f=t[d]??t[0],p=((f==null?void 0:f.props.type)??"image")==="image",g=R=>{var K;i(R),(K=n==null?void 0:n.onSelectImage)==null||K.call(n,R)},y=r&&(n==null?void 0:n.onReorderImage)!=null&&t.length>1,v=()=>{s(null),u(null)},w=R=>{var K;l!=null&&l!==R&&((K=n==null?void 0:n.onReorderImage)==null||K.call(n,l,R)),v()},x=r&&((n==null?void 0:n.canAddImage)??!0)&&t.length>=1&&t.length<Ac,P=r?t.length>=1:t.length>1,T="aspect-[4/3] w-28 sm:w-26 lg:w-30";return h.jsxs("div",{className:"grid grid-cols-1 gap-6 sm:grid-cols-2",children:[h.jsx("div",{className:"min-w-0",children:f?r?h.jsxs("div",{className:"group relative",children:[a.cloneElement(f,{className:q("w-full",f.props.className),zoomable:!1}),h.jsxs("div",{className:"absolute inset-0 flex items-center justify-center gap-2 rounded-lg opacity-0 transition group-hover:bg-foreground/40 group-hover:opacity-100 focus-within:bg-foreground/40 focus-within:opacity-100",children:[p&&h.jsxs("button",{type:"button",onClick:()=>{var R;return(R=n==null?void 0:n.onEditAnnotations)==null?void 0:R.call(n,d)},className:"flex items-center gap-1.5 rounded-md bg-background/90 px-2.5 py-1.5 text-sm font-semibold text-foreground shadow transition hover:bg-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent",children:[h.jsx(ug,{}),"Edit annotations"]}),p&&(n==null?void 0:n.onEditCrop)&&h.jsxs("button",{type:"button",onClick:()=>{var R;return(R=n==null?void 0:n.onEditCrop)==null?void 0:R.call(n,d)},className:"flex items-center gap-1.5 rounded-md bg-background/90 px-2.5 py-1.5 text-sm font-semibold text-foreground shadow transition hover:bg-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent",children:[h.jsx(dg,{}),"Adjust crop"]})]})]}):a.cloneElement(f,{className:q("w-full",f.props.className)}):r&&h.jsxs("button",{type:"button",onClick:()=>{var R;return(R=n==null?void 0:n.onAddImage)==null?void 0:R.call(n)},className:"flex aspect-[4/3] w-full flex-col items-center justify-center gap-2 rounded-lg border-2 border-dashed border-default bg-default-soft text-default-500 transition hover:border-accent hover:text-accent focus-visible:border-accent focus-visible:text-accent focus-visible:outline-none",children:[h.jsx(cg,{}),h.jsx("span",{className:"text-sm font-medium",children:"Add image"})]})}),h.jsxs("div",{className:"flex min-w-0 flex-col gap-4",children:[(P||x)&&h.jsxs("div",{className:"flex flex-wrap gap-2",role:"group","aria-label":"Step images",children:[t.map((R,K)=>r?h.jsxs("div",{className:q("relative rounded-md transition-shadow",y&&"cursor-grab",l===K&&"opacity-40",c===K&&l!==K&&"ring-2 ring-accent ring-offset-2 ring-offset-background"),draggable:y||void 0,onDragStart:y?M=>{M.dataTransfer.effectAllowed="move",s(K)}:void 0,onDragOver:y?M=>{M.preventDefault(),M.dataTransfer.dropEffect="move",u(K)}:void 0,onDrop:y?M=>{M.preventDefault(),w(K)}:void 0,onDragEnd:y?v:void 0,children:[h.jsx("button",{type:"button",className:q("block overflow-hidden rounded-md border-2 transition-[box-shadow,opacity,border-color]",K===d?"border-accent shadow-md":"border-default opacity-80 hover:opacity-100"),onClick:()=>g(K),"aria-label":`Image ${K+1}`,"aria-pressed":K===d,children:vl(R,T)}),h.jsx("button",{type:"button",onClick:()=>{var M;return(M=n==null?void 0:n.onRemoveImage)==null?void 0:M.call(n,K)},"aria-label":`Remove image ${K+1}`,className:"absolute -right-1.5 -top-1.5 flex size-5 items-center justify-center rounded-full bg-foreground text-background shadow transition hover:bg-danger focus-visible:bg-danger focus-visible:outline-none",children:h.jsx(Oc,{})})]},R.key??R.props.src??K):h.jsx("button",{type:"button",className:q("overflow-hidden rounded-md border-2 transition-[box-shadow,opacity,border-color]",K===d?"border-accent shadow-md":"border-default opacity-80 hover:opacity-100"),onMouseEnter:()=>g(K),onFocus:()=>g(K),"aria-label":`Image ${K+1}`,"aria-pressed":K===d,children:vl(R,T)},R.key??R.props.src??K)),x&&h.jsx("button",{type:"button",onClick:()=>{var R;return(R=n==null?void 0:n.onAddImage)==null?void 0:R.call(n)},"aria-label":"Add image",className:q(T,"flex items-center justify-center rounded-md border-2 border-dashed border-default text-default-500 transition hover:border-accent hover:text-accent focus-visible:border-accent focus-visible:text-accent focus-visible:outline-none"),children:h.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",className:"size-6",children:h.jsx("path",{d:"M12 5v14M5 12h14"})})})]}),e]})]})}function yg({number:t,title:e,isCompleted:n,defaultCompleted:r=!1,onCompletedChange:o,completable:i=!0,mediaEditing:l,children:s,className:c}){const[u,d]=tg(n,r,o),f=a.useId(),{figures:b,bullets:p}=bg(s,l!=null);return h.jsxs("section",{"aria-labelledby":e!=null?f:void 0,"data-completed":u||void 0,className:q("flex flex-col gap-4 transition-opacity",u&&"opacity-60",c),children:[h.jsxs("header",{className:"flex flex-col gap-3 sm:flex-row sm:items-center",children:[h.jsxs("div",{className:"flex min-w-0 items-center gap-3 sm:flex-1",children:[t!=null&&h.jsx("span",{className:q("flex size-8 shrink-0 items-center justify-center rounded-md text-sm font-bold tabular-nums",u?"bg-success text-success-foreground":"bg-foreground text-background"),children:u?h.jsx(mg,{}):t}),e!=null&&h.jsx("h3",{id:f,className:"min-w-0 flex-1 text-lg font-semibold leading-tight",children:e})]}),i&&h.jsx(yb,{variant:u?"primary":"secondary",size:"lg",onPress:()=>d(!u),"aria-pressed":u,className:q("ml-auto shrink-0",u&&"guide-step-complete-button"),style:u?{"--guide-step-complete-bg":ng,"--guide-step-complete-bg-hover":rg,"--guide-step-complete-checkbox":og}:void 0,children:h.jsx(gn,{isSelected:u,isReadOnly:!0,"aria-hidden":!0,className:"pointer-events-none gap-2 text-inherit",children:h.jsxs(gn.Content,{className:"flex items-center gap-2 whitespace-nowrap",children:[h.jsx(gn.Control,{children:h.jsx(gn.Indicator,{})}),"Mark complete"]})})})]}),h.jsx(gg,{figures:b,bullets:p,mediaEditing:l})]})}const vg=Object.assign(yg,{Media:jc,Bullets:_c,Bullet:Bc});function xg(t){return a.isValidElement(t)}function $g({children:t,showProgress:e=!0,onProgressChange:n,className:r}){const o=a.Children.toArray(t).filter(xg),i=o.length,[l,s]=a.useState(()=>Object.fromEntries(o.map((u,d)=>[u.props.number??d+1,!!(u.props.defaultCompleted??u.props.isCompleted)]))),c=Object.values(l).filter(Boolean).length;return a.useEffect(()=>{n==null||n({completed:c,total:i})},[c,i,n]),h.jsxs("div",{className:q("flex flex-col gap-8",r),children:[e&&i>0&&h.jsx("div",{className:"sticky top-2 mx-2 z-10",children:h.jsx(Ot,{className:"w-full px-6 py-4",children:h.jsxs(yn,{value:c,maxValue:i,"aria-label":"Guide progress",className:"flex flex-col gap-1.5",children:[h.jsxs("div",{className:"flex items-center justify-between text-sm text-default-500",children:[h.jsx("span",{children:"Guide Progress"}),h.jsxs(yn.Output,{children:[c," / ",i," steps"]})]}),h.jsx(yn.Track,{className:"h-2 overflow-hidden rounded-full bg-default-soft",children:h.jsx(yn.Fill,{className:"h-full rounded-full bg-success transition-[width]"})})]})})}),h.jsx("ol",{className:"flex flex-col",children:o.map((u,d)=>{const f=u.props.number??d+1;return h.jsxs("li",{children:[a.cloneElement(u,{number:f,isCompleted:l[f]??!1,onCompletedChange:b=>{var p,g;s(y=>({...y,[f]:b})),(g=(p=u.props).onCompletedChange)==null||g.call(p,b)}}),d<o.length-1&&h.jsx(jb,{className:"my-8"})]},u.key??f)})})]})}function wg({title:t,difficulty:e,timeEstimate:n,meta:r,className:o}){const i=e!=null||n!=null;return h.jsxs("header",{className:q("flex flex-col gap-4 border-b border-default pb-6 md:[grid-area:header]",o),children:[h.jsxs("div",{className:"flex flex-col gap-1.5",children:[h.jsx("h1",{className:"text-3xl font-bold tracking-tight",children:t}),r!=null&&h.jsx("div",{className:"text-sm text-default-500",children:r})]}),i&&h.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e!=null&&h.jsx(Tc,{difficulty:e}),n!=null&&h.jsx(_n,{variant:"soft",color:"default",children:h.jsx(_n.Label,{children:n})})]})]})}function Eg({children:t,className:e}){return h.jsx("div",{className:q("min-w-0 md:[grid-area:intro]",e),children:h.jsx("div",{className:"max-w-prose text-default-700",children:t})})}function Cg({children:t,className:e}){return h.jsx("aside",{className:q("min-w-0 md:[grid-area:sidebar]",e),children:h.jsx("div",{className:"flex flex-col gap-4",children:t})})}function Sg({children:t,className:e}){return h.jsx("main",{className:q("min-w-0 w-full md:[grid-area:main]",e),children:t})}const Pg=Object.assign(function({children:e,className:n}){return h.jsx("div",{className:q("mx-auto grid w-full max-w-6xl grid-cols-1 gap-x-8 gap-y-8 md:grid-cols-[minmax(0,1fr)_20rem] md:[grid-template-areas:'header_header'_'intro_sidebar'_'main_main']",n),children:e})},{Header:wg,Intro:Eg,Sidebar:Cg,Content:Sg});exports.COLORS=je;exports.Callout=ym;exports.DISPLAY_REGION_ASPECT=Vn;exports.DifficultyBadge=Tc;exports.GuideLayout=Pg;exports.GuideStep=vg;exports.GuideStepList=$g;exports.LinkButton=eg;exports.MIN_REGION_WIDTH=Mo;exports.MediaCropEditor=Vm;exports.MediaFigure=ir;exports.MediaFigureThumbnail=Ic;exports.ToolList=Um;exports.calloutTypeColor=xl;exports.calloutTypeHex=$l;exports.calloutTypeLabel=Cn;exports.centeredDisplayRegion=Rc;exports.clampDisplayRegion=nn;exports.displayRegionHeight=ct;exports.hexToRgba=ot;exports.markerTextColor=Hn;exports.mediaFigureType=Do;
|
|
28
|
+
*/var ji;function Fh(){return ji||(ji=1,process.env.NODE_ENV!=="production"&&(function(){function t(p,g){return p===g&&(p!==0||1/p===1/g)||p!==p&&g!==g}function e(p,g){d||o.startTransition===void 0||(d=!0,console.error("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var y=g();if(!f){var v=g();i(y,v)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),f=!0)}v=l({inst:{value:y,getSnapshot:g}});var w=v[0].inst,x=v[1];return c(function(){w.value=y,w.getSnapshot=g,n(w)&&x({inst:w})},[p,y,g]),s(function(){return n(w)&&x({inst:w}),p(function(){n(w)&&x({inst:w})})},[p]),u(y),y}function n(p){var g=p.getSnapshot;p=p.value;try{var y=g();return!i(p,y)}catch{return!0}}function r(p,g){return g()}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var o=a,i=typeof Object.is=="function"?Object.is:t,l=o.useState,s=o.useEffect,c=o.useLayoutEffect,u=o.useDebugValue,d=!1,f=!1,b=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?r:e;$r.useSyncExternalStore=o.useSyncExternalStore!==void 0?o.useSyncExternalStore:b,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()),$r}var _i;function jh(){return _i||(_i=1,process.env.NODE_ENV==="production"?bn.exports=Oh():bn.exports=Fh()),bn.exports}var _h=jh();const ba=a.createContext(!1),Gt=a.createContext(null);function Bh(t){if(a.useContext(Gt))return t.content;let{collection:n,document:r}=Uh(t.createCollection);return a.createElement(a.Fragment,null,a.createElement(nf,null,a.createElement(Gt.Provider,{value:r},t.content)),a.createElement(Vh,{render:t.children,collection:n}))}function Vh({collection:t,render:e}){return e(t)}function zh(t,e,n){let r=Ze(),o=a.useRef(r);o.current=r;let i=a.useCallback(()=>o.current?n():e(),[e,n]);return _h.useSyncExternalStore(t,i)}const Hh=typeof a.useSyncExternalStore=="function"?a.useSyncExternalStore:zh;function Uh(t){let[e]=a.useState(()=>new Kh((t==null?void 0:t())||new Lh)),n=a.useCallback(l=>e.subscribe(l),[e]),r=a.useCallback(()=>{let l=e.getCollection();return e.isSSR&&e.resetAfterSSR(),l},[e]),o=a.useCallback(()=>(e.isSSR=!0,e.getCollection()),[e]);return{collection:Hh(n,r,o),document:e}}const Yr=a.createContext(null);function Wh(t){var n;return n=class extends St{},n.type=t,n}function ma(t,e,n,r,o,i){typeof t=="string"&&(t=Wh(t));let l=a.useCallback(c=>{c==null||c.setProps(e,n,t,r,i)},[e,n,r,i,t]),s=a.useContext(Yr);if(s){let c=s.ownerDocument.nodesByProps.get(e);return c||(c=s.ownerDocument.createElement(t.type),c.setProps(e,n,t,r,i),s.appendChild(c),s.ownerDocument.updateCollection(),s.ownerDocument.nodesByProps.set(e,c)),o?a.createElement(Yr.Provider,{value:c},o):null}return a.createElement(t.type,{ref:l},o)}function ga(t,e){let n=({node:o})=>e(o.props,o.props.ref,o),r=a.forwardRef((o,i)=>{let l=a.useContext(Fr);if(!a.useContext(ba)){if(e.length>=3)throw new Error(e.name+" cannot be rendered outside a collection.");return e(o,i)}return ma(t,o,i,"children"in o?o.children:null,null,c=>a.createElement(Fr.Provider,{value:l},a.createElement(n,{node:c})))});return r.displayName=e.name,r}function ya(t,e,n=va){let r=({node:i})=>e(i.props,i.props.ref,i),o=a.forwardRef((i,l)=>{let s=n(i);return ma(t,i,l,null,s,c=>a.createElement(r,{node:c}))??a.createElement(a.Fragment,null)});return o.displayName=e.name,o}function va(t){return pa({...t,addIdAndValue:!0})}const Bi=a.createContext(null);function Gh(t){let e=a.useContext(Bi),n=((e==null?void 0:e.dependencies)||[]).concat(t.dependencies),r=t.idScope??(e==null?void 0:e.idScope),o=va({...t,idScope:r,dependencies:n});return a.useContext(Gt)&&(o=a.createElement(qh,null,o)),e=a.useMemo(()=>({dependencies:n,idScope:r}),[r,...n]),a.createElement(Bi.Provider,{value:e},o)}function qh({children:t}){let e=a.useContext(Gt),n=a.useMemo(()=>a.createElement(Gt.Provider,{value:null},a.createElement(ba.Provider,{value:!0},t)),[t]);return Ze()?a.createElement(Yr.Provider,{value:e},n):Yt.createPortal(n,e)}const Yh=a.createContext(null),Xh={CollectionRoot({collection:t,renderDropIndicator:e}){return Vi(t,null,e)},CollectionBranch({collection:t,parent:e,renderDropIndicator:n}){return Vi(t,e,n)}};function Vi(t,e,n){return pa({items:e?t.getChildren(e.key):t,dependencies:[n],children(r){if(r.type==="content")return a.createElement(a.Fragment,null);let o=r.render(r);return!n||r.type!=="item"?o:a.createElement(a.Fragment,null,n({type:"item",key:r.key,dropPosition:"before"}),o,Zh(t,r,n))}})}function Zh(t,e,n){let r=e.key,o=t.getKeyAfter(r),i=o!=null?t.getItem(o):null;for(;i!=null&&i.type!=="item";)o=t.getKeyAfter(i.key),i=o!=null?t.getItem(o):null;let l=e.nextKey!=null?t.getItem(e.nextKey):null;for(;l!=null&&l.type!=="item";)l=l.nextKey!=null?t.getItem(l.nextKey):null;let s=[];if(l==null){let c=e;for(;(c==null?void 0:c.type)==="item"&&(!i||c.parentKey!==i.parentKey&&i.level<c.level);){let u=n({type:"item",key:c.key,dropPosition:"after"});a.isValidElement(u)&&s.push(a.cloneElement(u,{key:`${c.key}-after`})),c=c.parentKey!=null?t.getItem(c.parentKey):null}}return s}const Qn=a.createContext(Xh);function Jh(t){return a.useMemo(()=>t!=null?new Set([t]):null,[t])}function xa(t){let e=ep(Q(t));e!==t&&(e&&Qh(e,t),t&&$a(t,e))}function Qh(t,e){t.dispatchEvent(new FocusEvent("blur",{relatedTarget:e})),t.dispatchEvent(new FocusEvent("focusout",{bubbles:!0,relatedTarget:e}))}function $a(t,e){t.dispatchEvent(new FocusEvent("focus",{relatedTarget:e})),t.dispatchEvent(new FocusEvent("focusin",{bubbles:!0,relatedTarget:e}))}function ep(t){let e=ne(t),n=e==null?void 0:e.getAttribute("aria-activedescendant");return n&&t.getElementById(n)||e}const zi=a.createContext(null),tp=a.createContext(null),np=a.createContext({}),rp=a.createContext({}),op=a.createContext(null);function ip(t){let e=a.useRef({});return a.createElement(op.Provider,{value:e},t.children)}const lp=a.createContext({isSelected:!1});function sp(t){let e=ae(t,{labelable:!0}),n;return t.orientation==="vertical"&&(n="vertical"),t.elementType!=="hr"?{separatorProps:{...e,role:"separator","aria-orientation":n}}:{separatorProps:e}}const Eo=a.createContext({}),Ao=class Ao extends St{filter(e,n){let r=n.getItem(this.prevKey);if(r&&r.type!=="separator"){let o=this.clone();return n.addDescendants(o,e),o}return null}};Ao.type="separator";let Xr=Ao;const ap=ga(Xr,function(e,n){[e,n]=Me(e,n,Eo);let{elementType:r,orientation:o,style:i,className:l,slot:s,...c}=e,u=r||"hr";u==="hr"&&o==="vertical"&&(u="div");let d=pe[u],{separatorProps:f}=sp({...c,elementType:r,orientation:o}),b=ae(e,{global:!0});return a.createElement(d,{render:e.render,...Y(b,f),style:i,className:l??"react-aria-Separator",ref:n,slot:s||void 0})}),wa=a.createContext({});var Ea={};Ea={longPressMessage:"اضغط مطولاً أو اضغط على Alt + السهم لأسفل لفتح القائمة"};var Ca={};Ca={longPressMessage:"Натиснете продължително или натиснете Alt+ стрелка надолу, за да отворите менюто"};var Sa={};Sa={longPressMessage:"Dlouhým stiskem nebo stisknutím kláves Alt + šipka dolů otevřete nabídku"};var Pa={};Pa={longPressMessage:"Langt tryk eller tryk på Alt + pil ned for at åbne menuen"};var ka={};ka={longPressMessage:"Drücken Sie lange oder drücken Sie Alt + Nach-unten, um das Menü zu öffnen"};var Ta={};Ta={longPressMessage:"Πιέστε παρατεταμένα ή πατήστε Alt + κάτω βέλος για να ανοίξετε το μενού"};var Ma={};Ma={longPressMessage:"Long press or press Alt + ArrowDown to open menu"};var Ra={};Ra={longPressMessage:"Mantenga pulsado o pulse Alt + flecha abajo para abrir el menú"};var Da={};Da={longPressMessage:"Menüü avamiseks vajutage pikalt või vajutage klahve Alt + allanool"};var Na={};Na={longPressMessage:"Avaa valikko painamalla pohjassa tai näppäinyhdistelmällä Alt + Alanuoli"};var Ia={};Ia={longPressMessage:"Appuyez de manière prolongée ou appuyez sur Alt + Flèche vers le bas pour ouvrir le menu."};var La={};La={longPressMessage:"לחץ לחיצה ארוכה או הקש Alt + ArrowDown כדי לפתוח את התפריט"};var Ka={};Ka={longPressMessage:"Dugo pritisnite ili pritisnite Alt + strelicu prema dolje za otvaranje izbornika"};var Aa={};Aa={longPressMessage:"Nyomja meg hosszan, vagy nyomja meg az Alt + lefele nyíl gombot a menü megnyitásához"};var Oa={};Oa={longPressMessage:"Premi a lungo o premi Alt + Freccia giù per aprire il menu"};var Fa={};Fa={longPressMessage:"長押しまたは Alt+下矢印キーでメニューを開く"};var ja={};ja={longPressMessage:"길게 누르거나 Alt + 아래쪽 화살표를 눌러 메뉴 열기"};var _a={};_a={longPressMessage:"Norėdami atidaryti meniu, nuspaudę palaikykite arba paspauskite „Alt + ArrowDown“."};var Ba={};Ba={longPressMessage:"Lai atvērtu izvēlni, turiet nospiestu vai nospiediet taustiņu kombināciju Alt + lejupvērstā bultiņa"};var Va={};Va={longPressMessage:"Langt trykk eller trykk Alt + PilNed for å åpne menyen"};var za={};za={longPressMessage:"Druk lang op Alt + pijl-omlaag of druk op Alt om het menu te openen"};var Ha={};Ha={longPressMessage:"Naciśnij i przytrzymaj lub naciśnij klawisze Alt + Strzałka w dół, aby otworzyć menu"};var Ua={};Ua={longPressMessage:"Pressione e segure ou pressione Alt + Seta para baixo para abrir o menu"};var Wa={};Wa={longPressMessage:"Prima continuamente ou prima Alt + Seta Para Baixo para abrir o menu"};var Ga={};Ga={longPressMessage:"Apăsați lung sau apăsați pe Alt + săgeată în jos pentru a deschide meniul"};var qa={};qa={longPressMessage:"Нажмите и удерживайте или нажмите Alt + Стрелка вниз, чтобы открыть меню"};var Ya={};Ya={longPressMessage:"Ponuku otvoríte dlhým stlačením alebo stlačením klávesu Alt + klávesu so šípkou nadol"};var Xa={};Xa={longPressMessage:"Za odprtje menija pritisnite in držite gumb ali pritisnite Alt+puščica navzdol"};var Za={};Za={longPressMessage:"Dugo pritisnite ili pritisnite Alt + strelicu prema dole da otvorite meni"};var Ja={};Ja={longPressMessage:"Håll nedtryckt eller tryck på Alt + pil nedåt för att öppna menyn"};var Qa={};Qa={longPressMessage:"Menüyü açmak için uzun basın veya Alt + Aşağı Ok tuşuna basın"};var ec={};ec={longPressMessage:"Довго або звичайно натисніть комбінацію клавіш Alt і стрілка вниз, щоб відкрити меню"};var tc={};tc={longPressMessage:"长按或按 Alt + 向下方向键以打开菜单"};var nc={};nc={longPressMessage:"長按或按 Alt+向下鍵以開啟功能表"};var rc={};rc={"ar-AE":Ea,"bg-BG":Ca,"cs-CZ":Sa,"da-DK":Pa,"de-DE":ka,"el-GR":Ta,"en-US":Ma,"es-ES":Ra,"et-EE":Da,"fi-FI":Na,"fr-FR":Ia,"he-IL":La,"hr-HR":Ka,"hu-HU":Aa,"it-IT":Oa,"ja-JP":Fa,"ko-KR":ja,"lt-LT":_a,"lv-LV":Ba,"nb-NO":Va,"nl-NL":za,"pl-PL":Ha,"pt-BR":Ua,"pt-PT":Wa,"ro-RO":Ga,"ru-RU":qa,"sk-SK":Ya,"sl-SI":Xa,"sr-SP":Za,"sv-SE":Ja,"tr-TR":Qa,"uk-UA":ec,"zh-CN":tc,"zh-TW":nc};const cp=500;function oc(t){let{isDisabled:e,onLongPressStart:n,onLongPressEnd:r,onLongPress:o,threshold:i=cp,accessibilityDescription:l}=t;const s=a.useRef(void 0);let{addGlobalListener:c,removeGlobalListener:u}=Wn(),{pressProps:d}=Xe({isDisabled:e,onPressStart(b){if(b.continuePropagation(),(b.pointerType==="mouse"||b.pointerType==="touch")&&(n&&n({...b,type:"longpressstart"}),s.current=setTimeout(()=>{b.target.dispatchEvent(new PointerEvent("pointercancel",{bubbles:!0})),Q(b.target).activeElement!==b.target&&de(b.target),o&&o({...b,type:"longpress"}),s.current=void 0},i),b.pointerType==="touch")){let p=y=>{y.preventDefault()},g=fe(b.target);c(b.target,"contextmenu",p,{once:!0}),c(g,"pointerup",()=>{setTimeout(()=>{u(b.target,"contextmenu",p)},30)},{once:!0})}},onPressEnd(b){s.current&&clearTimeout(s.current),r&&(b.pointerType==="mouse"||b.pointerType==="touch")&&r({...b,type:"longpressend"})}}),f=Au(o&&!e?l:void 0);return{longPressProps:Y(d,f)}}function ic(t,e,n){let{type:r}=t,{isOpen:o}=e;a.useEffect(()=>{n&&n.current&&vs.set(n.current,e.close)});let i;r==="menu"?i=!0:r==="listbox"&&(i="listbox");let l=he();return{triggerProps:{"aria-haspopup":i,"aria-expanded":o,"aria-controls":o?l:void 0,onPress:e.toggle},overlayProps:{id:l}}}function up(t){return t&&t.__esModule?t.default:t}function dp(t,e,n){let{type:r="menu",isDisabled:o,trigger:i="press"}=t,l=he(),{triggerProps:s,overlayProps:c}=ic({type:r},e,n),u=p=>{if(!o&&!(i==="longPress"&&!p.altKey)&&n&&n.current)switch(p.key){case"Enter":case" ":if(i==="longPress"||p.isDefaultPrevented())return;case"ArrowDown":"continuePropagation"in p||p.stopPropagation(),p.preventDefault(),e.toggle("first");break;case"ArrowUp":"continuePropagation"in p||p.stopPropagation(),p.preventDefault(),e.toggle("last");break;default:"continuePropagation"in p&&p.continuePropagation()}},d=la(up(rc),"@react-aria/menu"),{longPressProps:f}=oc({isDisabled:o||i!=="longPress",accessibilityDescription:d.format("longPressMessage"),onLongPressStart(){e.close()},onLongPress(){e.open("first")}}),b={preventFocusOnPress:!0,onPressStart(p){p.pointerType!=="touch"&&p.pointerType!=="keyboard"&&!o&&(de(p.target),e.open(p.pointerType==="virtual"?"first":null))},onPress(p){p.pointerType==="touch"&&!o&&(de(p.target),e.toggle())}};return delete s.onPress,{menuTriggerProps:{...s,...i==="press"?b:f,id:l,onKeyDown:u},menuProps:{...c,"aria-labelledby":l,autoFocus:e.focusStrategy||!0,onClose:e.close}}}const lc=new WeakMap;function Zr(t){return Qc()?t.altKey:t.ctrlKey}function En(t,e){var o,i;let n=`[data-key="${CSS.escape(String(e))}"]`,r=(o=t.current)==null?void 0:o.dataset.collection;return r&&(n=`[data-collection="${CSS.escape(r)}"]${n}`),(i=t.current)==null?void 0:i.querySelector(n)}const sc=new WeakMap;function fp(t){let e=he();return sc.set(t,e),e}function hp(t){return sc.get(t)}const pp=1e3;function bp(t){let{keyboardDelegate:e,selectionManager:n,onTypeSelect:r}=t,o=a.useRef({search:"",timeout:void 0}).current,i=l=>{let s=mp(l.key);if(!(!s||l.ctrlKey||l.metaKey||!H(l.currentTarget,F(l))||o.search.length===0&&s===" ")){if(s===" "&&o.search.trim().length>0&&(l.preventDefault(),"continuePropagation"in l||l.stopPropagation()),o.search+=s,e.getKeyForSearch!=null){let c=e.getKeyForSearch(o.search,n.focusedKey);c==null&&(c=e.getKeyForSearch(o.search)),c!=null&&(n.setFocusedKey(c),r&&r(c))}clearTimeout(o.timeout),o.timeout=setTimeout(()=>{o.search=""},pp)}};return{typeSelectProps:{onKeyDownCapture:e.getKeyForSearch?i:void 0}}}function mp(t){return t.length===1||!/^[A-Z]/i.test(t)?t:""}function gp(t){let{selectionManager:e,keyboardDelegate:n,ref:r,autoFocus:o=!1,shouldFocusWrap:i=!1,disallowEmptySelection:l=!1,disallowSelectAll:s=!1,escapeKeyBehavior:c="clearSelection",selectOnFocus:u=e.selectionBehavior==="replace",disallowTypeAhead:d=!1,shouldUseVirtualFocus:f,allowsTabNavigation:b=!1,scrollRef:p=r,linkBehavior:g="action"}=t,{direction:y}=dt(),v=Xt(),w=m=>{var I,C,D,$,S,L,U,W,G,ee,le,Z,be,Ie;if(m.altKey&&m.key==="Tab"&&m.preventDefault(),!r.current||!H(r.current,F(m)))return;const E=(z,$e)=>{if(z!=null){if(e.isLink(z)&&g==="selection"&&u&&!Zr(m)){Yt.flushSync(()=>{e.setFocusedKey(z,$e)});let me=En(r,z),et=e.getItemProps(z);me&&v.open(me,m,et.href,et.routerOptions);return}if(e.setFocusedKey(z,$e),e.isLink(z)&&g==="override")return;m.shiftKey&&e.selectionMode==="multiple"?e.extendSelection(z):u&&!Zr(m)&&e.replaceSelection(z)}};switch(m.key){case"ArrowDown":if(n.getKeyBelow){let z=e.focusedKey!=null?(I=n.getKeyBelow)==null?void 0:I.call(n,e.focusedKey):(C=n.getFirstKey)==null?void 0:C.call(n);z==null&&i&&(z=(D=n.getFirstKey)==null?void 0:D.call(n,e.focusedKey)),z!=null&&(m.preventDefault(),E(z))}break;case"ArrowUp":if(n.getKeyAbove){let z=e.focusedKey!=null?($=n.getKeyAbove)==null?void 0:$.call(n,e.focusedKey):(S=n.getLastKey)==null?void 0:S.call(n);z==null&&i&&(z=(L=n.getLastKey)==null?void 0:L.call(n,e.focusedKey)),z!=null&&(m.preventDefault(),E(z))}break;case"ArrowLeft":if(n.getKeyLeftOf){let z=e.focusedKey!=null?(U=n.getKeyLeftOf)==null?void 0:U.call(n,e.focusedKey):(W=n.getFirstKey)==null?void 0:W.call(n);z==null&&i&&(z=y==="rtl"?(G=n.getFirstKey)==null?void 0:G.call(n,e.focusedKey):(ee=n.getLastKey)==null?void 0:ee.call(n,e.focusedKey)),z!=null&&(m.preventDefault(),E(z,y==="rtl"?"first":"last"))}break;case"ArrowRight":if(n.getKeyRightOf){let z=e.focusedKey!=null?(le=n.getKeyRightOf)==null?void 0:le.call(n,e.focusedKey):(Z=n.getFirstKey)==null?void 0:Z.call(n);z==null&&i&&(z=y==="rtl"?(be=n.getLastKey)==null?void 0:be.call(n,e.focusedKey):(Ie=n.getFirstKey)==null?void 0:Ie.call(n,e.focusedKey)),z!=null&&(m.preventDefault(),E(z,y==="rtl"?"last":"first"))}break;case"Home":if(n.getFirstKey){if(e.focusedKey===null&&m.shiftKey)return;m.preventDefault();let z=n.getFirstKey(e.focusedKey,bt(m));e.setFocusedKey(z),z!=null&&(bt(m)&&m.shiftKey&&e.selectionMode==="multiple"?e.extendSelection(z):u&&e.replaceSelection(z))}break;case"End":if(n.getLastKey){if(e.focusedKey===null&&m.shiftKey)return;m.preventDefault();let z=n.getLastKey(e.focusedKey,bt(m));e.setFocusedKey(z),z!=null&&(bt(m)&&m.shiftKey&&e.selectionMode==="multiple"?e.extendSelection(z):u&&e.replaceSelection(z))}break;case"PageDown":if(n.getKeyPageBelow&&e.focusedKey!=null){let z=n.getKeyPageBelow(e.focusedKey);z!=null&&(m.preventDefault(),E(z))}break;case"PageUp":if(n.getKeyPageAbove&&e.focusedKey!=null){let z=n.getKeyPageAbove(e.focusedKey);z!=null&&(m.preventDefault(),E(z))}break;case"a":bt(m)&&e.selectionMode==="multiple"&&s!==!0&&(m.preventDefault(),e.selectAll());break;case"Escape":c==="clearSelection"&&!l&&e.selectedKeys.size!==0&&(m.stopPropagation(),m.preventDefault(),e.clearSelection());break;case"Tab":if(!b){if(m.shiftKey)r.current.focus();else{let z=Fe(r.current,{tabbable:!0}),$e,me;do me=z.lastChild(),me&&($e=me);while(me);let et=ne();$e&&(!$t($e)||et&&!Ll(et))&&de($e)}break}}},x=a.useRef({top:0,left:0});It(p,"scroll",()=>{var m,E;x.current={top:((m=p.current)==null?void 0:m.scrollTop)??0,left:((E=p.current)==null?void 0:E.scrollLeft)??0}});let P=m=>{var E,I;if(e.isFocused){H(m.currentTarget,F(m))||e.setFocused(!1);return}if(H(m.currentTarget,F(m))){if(e.setFocused(!0),e.focusedKey==null){let C=$=>{$!=null&&(e.setFocusedKey($),u&&!e.isSelected($)&&e.replaceSelection($))},D=m.relatedTarget;D&&m.currentTarget.compareDocumentPosition(D)&Node.DOCUMENT_POSITION_FOLLOWING?C(e.lastSelectedKey??((E=n.getLastKey)==null?void 0:E.call(n))):C(e.firstSelectedKey??((I=n.getFirstKey)==null?void 0:I.call(n)))}else p.current&&(p.current.scrollTop=x.current.top,p.current.scrollLeft=x.current.left);if(e.focusedKey!=null&&p.current){let C=En(r,e.focusedKey);C instanceof HTMLElement&&(!$t(C)&&!f&&de(C),Ht()==="keyboard"&&Xo(C,{containingElement:r.current}))}}},T=m=>{H(m.currentTarget,m.relatedTarget)||e.setFocused(!1)},R=a.useRef(!1);It(r,Zc,f?m=>{let{detail:E}=m;m.stopPropagation(),e.setFocused(!0),(E==null?void 0:E.focusStrategy)==="first"&&(R.current=!0)}:void 0),Yo(()=>{var m;if(R.current){let E=((m=n.getFirstKey)==null?void 0:m.call(n))??null;if(E==null){let I=ne();xa(r.current),$a(I,null),e.collection.size>0&&(R.current=!1)}else e.setFocusedKey(E),R.current=!1}},[e.collection]),Yo(()=>{e.collection.size>0&&(R.current=!1)},[e.focusedKey]),It(r,Xc,f?m=>{var E;m.stopPropagation(),e.setFocused(!1),(E=m.detail)!=null&&E.clearFocusKey&&e.setFocusedKey(null)}:void 0);const K=a.useRef(o),M=a.useRef(!1);a.useEffect(()=>{var m,E;if(K.current){let I=null;o==="first"&&(I=((m=n.getFirstKey)==null?void 0:m.call(n))??null),o==="last"&&(I=((E=n.getLastKey)==null?void 0:E.call(n))??null);let C=e.selectedKeys;if(C.size){for(let D of C)if(e.canSelectItem(D)){I=D;break}}e.setFocused(!0),e.setFocusedKey(I),I==null&&!f&&r.current&&Ye(r.current),e.collection.size>0&&(K.current=!1,M.current=!0)}});let N=a.useRef(e.focusedKey),O=a.useRef(null);a.useEffect(()=>{if(e.isFocused&&e.focusedKey!=null&&(e.focusedKey!==N.current||M.current)&&p.current&&r.current){let m=Ht(),E=En(r,e.focusedKey);if(!(E instanceof HTMLElement))return;(m==="keyboard"||M.current)&&(O.current&&cancelAnimationFrame(O.current),O.current=requestAnimationFrame(()=>{p.current&&(xn(p.current,E),m!=="virtual"&&Xo(E,{containingElement:r.current}))}))}!f&&e.isFocused&&e.focusedKey==null&&N.current!=null&&r.current&&Ye(r.current),N.current=e.focusedKey,M.current=!1}),a.useEffect(()=>()=>{O.current&&cancelAnimationFrame(O.current)},[]),It(r,"react-aria-focus-scope-restore",m=>{m.preventDefault(),e.setFocused(!0)});let k={onKeyDown:w,onFocus:P,onBlur:T,onMouseDown(m){p.current===F(m)&&m.preventDefault()}},{typeSelectProps:A}=bp({keyboardDelegate:n,selectionManager:e});d||(k=Y(A,k));let V;f||(V=e.focusedKey==null?0:-1);let j=fp(e.collection);return{collectionProps:Y(k,{tabIndex:V,"data-collection":j})}}class Hi{constructor(e){this.ref=e}getItemRect(e){let n=this.ref.current;if(!n)return null;let r=e!=null?En(this.ref,e):null;if(!r)return null;let o=n.getBoundingClientRect(),i=r.getBoundingClientRect();return{x:i.left-o.left-n.clientLeft+n.scrollLeft,y:i.top-o.top-n.clientTop+n.scrollTop,width:i.width,height:i.height}}getContentSize(){let e=this.ref.current;return{width:(e==null?void 0:e.scrollWidth)??0,height:(e==null?void 0:e.scrollHeight)??0}}getVisibleRect(){let e=this.ref.current;return{x:(e==null?void 0:e.scrollLeft)??0,y:(e==null?void 0:e.scrollTop)??0,width:(e==null?void 0:e.clientWidth)??0,height:(e==null?void 0:e.clientHeight)??0}}}class yp{constructor(...e){if(e.length===1){let n=e[0];this.collection=n.collection,this.ref=n.ref,this.collator=n.collator,this.disabledKeys=n.disabledKeys||new Set,this.disabledBehavior=n.disabledBehavior||"all",this.orientation=n.orientation||"vertical",this.direction=n.direction,this.layout=n.layout||"stack",this.layoutDelegate=n.layoutDelegate||new Hi(n.ref)}else this.collection=e[0],this.disabledKeys=e[1],this.ref=e[2],this.collator=e[3],this.layout="stack",this.orientation="vertical",this.disabledBehavior="all",this.layoutDelegate=new Hi(this.ref);this.layout==="stack"&&this.orientation==="vertical"&&(this.getKeyLeftOf=void 0,this.getKeyRightOf=void 0)}isDisabled(e){var n,r;return this.disabledBehavior==="all"&&(((n=e.props)==null?void 0:n.isDisabled)||this.disabledKeys.has(e.key))&&((r=e.props)==null?void 0:r.disabledBehavior)!=="selection"}findNextNonDisabled(e,n,r=!1){let o=e;for(;o!=null;){let i=this.collection.getItem(o);if((i==null?void 0:i.type)==="item"&&(r||!this.isDisabled(i)))return o;o=n(o)}return null}getNextKey(e,n){let r=e;return r=this.collection.getKeyAfter(r),this.findNextNonDisabled(r,o=>this.collection.getKeyAfter(o),n==null?void 0:n.includeDisabled)}getPreviousKey(e,n){let r=e;return r=this.collection.getKeyBefore(r),this.findNextNonDisabled(r,o=>this.collection.getKeyBefore(o),n==null?void 0:n.includeDisabled)}findKey(e,n,r){let o=e,i=this.layoutDelegate.getItemRect(o);if(!i||o==null)return null;let l=i;do{if(o=n(o),o==null)break;i=this.layoutDelegate.getItemRect(o)}while(i&&r(l,i)&&o!=null);return o}isSameRow(e,n){return e.y===n.y||e.x!==n.x}isSameColumn(e,n){return e.x===n.x||e.y!==n.y}getKeyBelow(e,n){return this.layout==="grid"&&this.orientation==="vertical"?this.findKey(e,r=>this.getNextKey(r,n),this.isSameRow):this.getNextKey(e,n)}getKeyAbove(e,n){return this.layout==="grid"&&this.orientation==="vertical"?this.findKey(e,r=>this.getPreviousKey(r,n),this.isSameRow):this.getPreviousKey(e,n)}getNextColumn(e,n,r){return n?this.getPreviousKey(e,r):this.getNextKey(e,r)}getKeyRightOf(e,n){let r=this.direction==="ltr"?"getKeyRightOf":"getKeyLeftOf";return this.layoutDelegate[r]?(e=this.layoutDelegate[r](e),this.findNextNonDisabled(e,o=>this.layoutDelegate[r](o),n==null?void 0:n.includeDisabled)):this.layout==="grid"?this.orientation==="vertical"?this.getNextColumn(e,this.direction==="rtl",n):this.findKey(e,o=>this.getNextColumn(o,this.direction==="rtl",n),this.isSameColumn):this.orientation==="horizontal"?this.getNextColumn(e,this.direction==="rtl",n):null}getKeyLeftOf(e,n){let r=this.direction==="ltr"?"getKeyLeftOf":"getKeyRightOf";return this.layoutDelegate[r]?(e=this.layoutDelegate[r](e),this.findNextNonDisabled(e,o=>this.layoutDelegate[r](o),n==null?void 0:n.includeDisabled)):this.layout==="grid"?this.orientation==="vertical"?this.getNextColumn(e,this.direction==="ltr",n):this.findKey(e,o=>this.getNextColumn(o,this.direction==="ltr",n),this.isSameColumn):this.orientation==="horizontal"?this.getNextColumn(e,this.direction==="ltr",n):null}getFirstKey(){let e=this.collection.getFirstKey();return this.findNextNonDisabled(e,n=>this.collection.getKeyAfter(n))}getLastKey(){let e=this.collection.getLastKey();return this.findNextNonDisabled(e,n=>this.collection.getKeyBefore(n))}getKeyPageAbove(e){let n=this.ref.current,r=this.layoutDelegate.getItemRect(e);if(!r)return null;if(n&&!st(n))return this.getFirstKey();let o=e;if(this.orientation==="horizontal"){let i=Math.max(0,r.x+r.width-this.layoutDelegate.getVisibleRect().width);for(;r&&r.x>i&&o!=null;)o=this.getKeyAbove(o),r=o==null?null:this.layoutDelegate.getItemRect(o)}else{let i=Math.max(0,r.y+r.height-this.layoutDelegate.getVisibleRect().height);for(;r&&r.y>i&&o!=null;)o=this.getKeyAbove(o),r=o==null?null:this.layoutDelegate.getItemRect(o)}return o??this.getFirstKey()}getKeyPageBelow(e){let n=this.ref.current,r=this.layoutDelegate.getItemRect(e);if(!r)return null;if(n&&!st(n))return this.getLastKey();let o=e;if(this.orientation==="horizontal"){let i=Math.min(this.layoutDelegate.getContentSize().width,r.x-r.width+this.layoutDelegate.getVisibleRect().width);for(;r&&r.x<i&&o!=null;)o=this.getKeyBelow(o),r=o==null?null:this.layoutDelegate.getItemRect(o)}else{let i=Math.min(this.layoutDelegate.getContentSize().height,r.y-r.height+this.layoutDelegate.getVisibleRect().height);for(;r&&r.y<i&&o!=null;)o=this.getKeyBelow(o),r=o==null?null:this.layoutDelegate.getItemRect(o)}return o??this.getLastKey()}getKeyForSearch(e,n){if(!this.collator)return null;let r=this.collection,o=n||this.getFirstKey();for(;o!=null;){let i=r.getItem(o);if(!i)return null;let l=i.textValue.slice(0,e.length);if(i.textValue&&this.collator.compare(l,e)===0)return o;o=this.getNextKey(o)}return null}}let wr=new Map;function vp(t){let{locale:e}=dt(),n=e+(t?Object.entries(t).sort((o,i)=>o[0]<i[0]?-1:1).join():"");if(wr.has(n))return wr.get(n);let r=new Intl.Collator(e,t);return wr.set(n,r),r}function xp(t){let{selectionManager:e,collection:n,disabledKeys:r,ref:o,keyboardDelegate:i,layoutDelegate:l,orientation:s}=t,c=vp({usage:"search",sensitivity:"base"}),u=e.disabledBehavior,d=a.useMemo(()=>i||new yp({collection:n,disabledKeys:r,disabledBehavior:u,ref:o,collator:c,layoutDelegate:l,orientation:s}),[i,l,n,r,o,c,u,s]),{collectionProps:f}=gp({...t,ref:o,selectionManager:e,keyboardDelegate:d});return{listProps:f}}function $p(t,e,n){let{shouldFocusWrap:r=!0,onKeyDown:o,onKeyUp:i,...l}=t;!t["aria-label"]&&!t["aria-labelledby"]&&process.env.NODE_ENV!=="production"&&console.warn("An aria-label or aria-labelledby prop is required for accessibility.");let s=ae(t,{labelable:!0}),{listProps:c}=xp({...l,ref:n,selectionManager:e.selectionManager,collection:e.collection,disabledKeys:e.disabledKeys,shouldFocusWrap:r,linkBehavior:"override"});return lc.set(e,{onClose:t.onClose,onAction:t.onAction,shouldUseVirtualFocus:t.shouldUseVirtualFocus}),{menuProps:Y(s,{onKeyDown:o,onKeyUp:i},{role:"menu",...c,onKeyDown:u=>{var d;(u.key!=="Escape"||t.shouldUseVirtualFocus)&&((d=c.onKeyDown)==null||d.call(c,u))}})}}function wp(t){let{id:e,selectionManager:n,key:r,ref:o,shouldSelectOnPressUp:i,shouldUseVirtualFocus:l,focus:s,isDisabled:c,onAction:u,allowsDifferentPressOrigin:d,linkBehavior:f="action"}=t,b=Xt();e=he(e);let p=S=>{if(S.pointerType==="keyboard"&&Zr(S))n.toggleSelection(r);else{if(n.selectionMode==="none")return;if(n.isLink(r)){if(f==="selection"&&o.current){let L=n.getItemProps(r);b.open(o.current,S,L.href,L.routerOptions),n.setSelectedKeys(n.selectedKeys);return}else if(f==="override"||f==="none")return}n.selectionMode==="single"?n.isSelected(r)&&!n.disallowEmptySelection?n.toggleSelection(r):n.replaceSelection(r):S&&S.shiftKey?n.extendSelection(r):n.selectionBehavior==="toggle"||S&&(bt(S)||S.pointerType==="touch"||S.pointerType==="virtual")?n.toggleSelection(r):n.replaceSelection(r)}};a.useEffect(()=>{r===n.focusedKey&&n.isFocused&&(l?xa(o.current):s?s():ne()!==o.current&&o.current&&Ye(o.current))},[o,r,n.focusedKey,n.childFocusStrategy,n.isFocused,l]),c=c||n.isDisabled(r);let g={};!l&&!c?g={tabIndex:r===n.focusedKey?0:-1,onFocus(S){F(S)===o.current&&n.setFocusedKey(r)}}:c&&(g.onMouseDown=S=>{S.preventDefault()}),a.useEffect(()=>{c&&n.focusedKey===r&&n.setFocusedKey(null)},[n,c,r]);let y=n.isLink(r)&&f==="override",v=u&&t.UNSTABLE_itemBehavior==="action",w=n.isLink(r)&&f!=="selection"&&f!=="none",x=!c&&n.canSelectItem(r)&&!y&&!v,P=(u||w)&&!c,T=P&&(n.selectionBehavior==="replace"?!x:!x||n.isEmpty),R=P&&x&&n.selectionBehavior==="replace",K=T||R,M=a.useRef(null),N=K&&x,O=a.useRef(!1),k=a.useRef(!1),A=n.getItemProps(r),V=S=>{var L;u&&(u(),(L=o.current)==null||L.dispatchEvent(new CustomEvent("react-aria-item-action",{bubbles:!0}))),w&&o.current&&b.open(o.current,S,A.href,A.routerOptions)},j={ref:o};if(i?(j.onPressStart=S=>{M.current=S.pointerType,O.current=N,S.pointerType==="keyboard"&&(!K||Wi(S.key))&&p(S)},d?(j.onPressUp=T?void 0:S=>{S.pointerType==="mouse"&&x&&p(S)},j.onPress=T?V:S=>{S.pointerType!=="keyboard"&&S.pointerType!=="mouse"&&x&&p(S)}):j.onPress=S=>{if(T||R&&S.pointerType!=="mouse"){if(S.pointerType==="keyboard"&&!Ui(S.key))return;V(S)}else S.pointerType!=="keyboard"&&x&&p(S)}):(j.onPressStart=S=>{M.current=S.pointerType,O.current=N,k.current=T,x&&(S.pointerType==="mouse"&&!T||S.pointerType==="keyboard"&&(!P||Wi(S.key)))&&p(S)},j.onPress=S=>{(S.pointerType==="touch"||S.pointerType==="pen"||S.pointerType==="virtual"||S.pointerType==="keyboard"&&K&&Ui(S.key)||S.pointerType==="mouse"&&k.current)&&(K?V(S):x&&p(S))}),g["data-collection"]=hp(n.collection),g["data-key"]=r,j.preventFocusOnPress=l,l&&(j=Y(j,{onPressStart(S){S.pointerType!=="touch"&&(n.setFocused(!0),n.setFocusedKey(r))},onPress(S){S.pointerType==="touch"&&(n.setFocused(!0),n.setFocusedKey(r))}})),A)for(let S of["onPressStart","onPressEnd","onPressChange","onPress","onPressUp","onClick"])A[S]&&(j[S]=Zt(j[S],A[S]));let{pressProps:m,isPressed:E}=Xe(j),I=R?S=>{M.current==="mouse"&&(S.stopPropagation(),S.preventDefault(),V(S))}:void 0,{longPressProps:C}=oc({isDisabled:!N,onLongPress(S){S.pointerType==="touch"&&(p(S),n.setSelectionBehavior("toggle"))}}),D=S=>{M.current==="touch"&&O.current&&S.preventDefault()},$=f!=="none"&&n.isLink(r)?S=>{_e.isOpening||S.preventDefault()}:void 0;return{itemProps:Y(g,x||T||l&&!c?m:{},N?C:{},{onDoubleClick:I,onDragStartCapture:D,onClick:$,id:e},l?{onMouseDown:S=>S.preventDefault()}:void 0),isPressed:E,isSelected:n.isSelected(r),isFocused:n.isFocused&&n.focusedKey===r,isDisabled:c,allowsSelection:x,hasAction:K}}function Ui(t){return t==="Enter"}function Wi(t){return t===" "}function Ep(t,e){return typeof e.getChildren=="function"?e.getChildren(t.key):t.childNodes}const Gi=new WeakMap;function Cp(t){let e=Gi.get(t);if(e!=null)return e;let n=0,r=o=>{for(let i of o)i.type==="section"?r(Ep(i,t)):i.type==="item"&&n++};return r(t),Gi.set(t,n),n}function Sp(t,e,n){let{id:r,key:o,closeOnSelect:i,shouldCloseOnSelect:l,isVirtualized:s,"aria-haspopup":c,onPressStart:u,onPressUp:d,onPress:f,onPressChange:b,onPressEnd:p,onClick:g,onHoverStart:y,onHoverChange:v,onHoverEnd:w,onKeyDown:x,onKeyUp:P,onFocus:T,onFocusChange:R,onBlur:K,selectionManager:M=e.selectionManager}=t,N=!!c,O=N&&t["aria-expanded"]==="true",k=t.isDisabled??M.isDisabled(o),A=t.isSelected??M.isSelected(o),V=lc.get(e),j=e.collection.getItem(o),m=t.onClose||V.onClose,E=Xt(),I=()=>{var te;if(!N&&((te=j==null?void 0:j.props)!=null&&te.onAction?j.props.onAction():t.onAction&&t.onAction(o),V.onAction)){let kt=V.onAction;kt(o)}},C="menuitem";N||(M.selectionMode==="single"?C="menuitemradio":M.selectionMode==="multiple"&&(C="menuitemcheckbox"));let D=vn(),$=vn(),S=vn(),L={id:r,"aria-disabled":k||void 0,role:C,"aria-label":t["aria-label"],"aria-labelledby":D,"aria-describedby":[t["aria-describedby"],$,S].filter(Boolean).join(" ")||void 0,"aria-controls":t["aria-controls"],"aria-haspopup":c,"aria-expanded":t["aria-expanded"]};if(M.selectionMode!=="none"&&!N&&(L["aria-checked"]=A),s){let te=Number(j==null?void 0:j.index);L["aria-posinset"]=Number.isNaN(te)?void 0:te+1,L["aria-setsize"]=Cp(e.collection)}let U=a.useRef(!1),W=te=>{b==null||b(te),U.current=te},G=a.useRef(null),ee=te=>{te.pointerType!=="keyboard"&&(G.current={pointerType:te.pointerType}),te.pointerType==="mouse"&&(U.current||te.target.click()),d==null||d(te)},le=te=>{var jo,_o;g==null||g(te),I(),Pl(te,E,j.props.href,j==null?void 0:j.props.routerOptions);let kt=((jo=G.current)==null?void 0:jo.pointerType)==="keyboard"?((_o=G.current)==null?void 0:_o.key)==="Enter"||M.selectionMode==="none"||M.isLink(o):M.selectionMode!=="multiple"||M.isLink(o);kt=l??i??kt,m&&!N&&kt&&m(),G.current=null},{itemProps:Z,isFocused:be}=wp({id:r,selectionManager:M,key:o,ref:n,shouldSelectOnPressUp:!0,allowsDifferentPressOrigin:!0,linkBehavior:"none",shouldUseVirtualFocus:V.shouldUseVirtualFocus}),{pressProps:Ie,isPressed:z}=Xe({onPressStart:u,onPress:f,onPressUp:ee,onPressChange:W,onPressEnd:p,isDisabled:k}),{hoverProps:$e}=en({isDisabled:k,onHoverStart(te){!zt()&&!(O&&c)&&(M.setFocused(!0),M.setFocusedKey(o)),y==null||y(te)},onHoverChange:v,onHoverEnd:w}),{keyboardProps:me}=hs({onKeyDown:te=>{if(te.repeat){te.continuePropagation();return}switch(te.key){case" ":G.current={pointerType:"keyboard",key:" "},F(te).click(),Or("keyboard");break;case"Enter":G.current={pointerType:"keyboard",key:"Enter"},F(te).tagName!=="A"&&F(te).click(),Or("keyboard");break;default:N||te.continuePropagation(),x==null||x(te);break}},onKeyUp:P}),{focusableProps:et}=Qt({onBlur:K,onFocus:T,onFocusChange:R},n),Fo=ae(j==null?void 0:j.props);delete Fo.id;let Vc=Sl(j==null?void 0:j.props);return{menuItemProps:{...L,...Y(Fo,Vc,N?{onFocus:Z.onFocus,"data-collection":Z["data-collection"],"data-key":Z["data-key"]}:Z,Ie,$e,me,et,V.shouldUseVirtualFocus||N?{onMouseDown:te=>te.preventDefault()}:void 0,k?void 0:{onClick:le}),tabIndex:Z.tabIndex!=null&&O&&!V.shouldUseVirtualFocus?-1:Z.tabIndex},labelProps:{id:D},descriptionProps:{id:$},keyboardShortcutProps:{id:S},isFocused:be,isFocusVisible:be&&M.isFocused&&zt()&&!O,isSelected:A,isPressed:z,isDisabled:k}}function Pp(t){let{heading:e,"aria-label":n}=t,r=he();return{itemProps:{role:"presentation"},headingProps:e?{id:r,role:"presentation"}:{},groupProps:{role:"group","aria-label":n,"aria-labelledby":e?r:void 0}}}const mn=2,kp=50,Tp=1e3,qi=Math.PI/12;function Mp(t){let{menuRef:e,submenuRef:n,isOpen:r,isDisabled:o}=t,i=a.useRef(void 0),l=a.useRef(void 0),s=a.useRef(0),c=a.useRef(void 0),u=a.useRef(void 0),d=a.useRef(void 0),f=a.useRef(2),[b,p]=a.useState(!1);Pn({ref:r?n:void 0,onResize:()=>{n.current&&(l.current=n.current.getBoundingClientRect(),d.current=void 0)}});let y=()=>{p(!1),f.current=mn,i.current=void 0},v=Ef(),w=Pe(x=>{b&&x.preventDefault()});a.useEffect(()=>{b&&e.current?e.current.style.pointerEvents="none":e.current.style.pointerEvents=""},[e,b]),J(()=>{let x=n.current,P=e.current;if(o||!x||!r||v!=="pointer"||!P){y();return}l.current=x.getBoundingClientRect();let T=R=>{if(R.pointerType==="touch"||R.pointerType==="pen")return;let K=Date.now();if(K-s.current<kp)return;clearTimeout(c.current),clearTimeout(u.current);let{clientX:M,clientY:N}=R;if(!i.current){i.current={x:M,y:N};return}if(!l.current)return;if(d.current||(d.current=M>l.current.right?"left":"right"),M<P.getBoundingClientRect().left||M>P.getBoundingClientRect().right||N<P.getBoundingClientRect().top||N>P.getBoundingClientRect().bottom){y();return}let O=i.current.x,k=i.current.y,A=d.current==="right"?l.current.left-O:O-l.current.right,V=Math.atan2(k-l.current.top,A)+qi,j=Math.atan2(k-l.current.bottom,A)-qi,m=Math.atan2(k-N,d.current==="left"?-(M-O):M-O),E=m<V&&m>j;f.current=E?Math.min(f.current+1,mn):Math.max(f.current-1,0),f.current>=mn?p(!0):p(!1),s.current=K,i.current={x:M,y:N},E&&(c.current=setTimeout(()=>{y(),u.current=setTimeout(()=>{let I=document.elementFromPoint(M,N);I&&H(P,I)&&I.dispatchEvent(new PointerEvent("pointerover",{bubbles:!0,cancelable:!0}))},100)},Tp))};return window.addEventListener("pointermove",T),process.env.NODE_ENV!=="test"&&window.addEventListener("pointerdown",w,!0),()=>{window.removeEventListener("pointermove",T),process.env.NODE_ENV!=="test"&&window.removeEventListener("pointerdown",w,!0),clearTimeout(c.current),clearTimeout(u.current),f.current=mn}},[o,r,e,v,p,n])}function Rp(t,e,n){let{parentMenuRef:r,submenuRef:o,type:i="menu",isDisabled:l,delay:s=200,shouldUseVirtualFocus:c}=t,u=he(),d=he(),{direction:f}=dt(),b=a.useRef(void 0),p=a.useCallback(()=>{b.current&&(clearTimeout(b.current),b.current=void 0)},[b]),g=a.useCallback(M=>{p(),e.open(M)},[e,p]),y=a.useCallback(()=>{p(),e.close()},[e,p]);J(()=>()=>{p()},[p]);let v=M=>{if($t(M.currentTarget))switch(M.key){case"ArrowLeft":f==="ltr"&&H(M.currentTarget,F(M))&&(M.preventDefault(),M.stopPropagation(),y(),!c&&n.current&&de(n.current));break;case"ArrowRight":f==="rtl"&&H(M.currentTarget,F(M))&&(M.preventDefault(),M.stopPropagation(),y(),!c&&n.current&&de(n.current));break;case"Escape":H(o.current,F(M))&&(M.stopPropagation(),y(),!c&&n.current&&de(n.current));break}},w={id:d,"aria-labelledby":u,submenuLevel:e.submenuLevel,...i==="menu"&&{onClose:e.closeAll,autoFocus:e.focusStrategy??void 0,onKeyDown:v}},x=M=>{switch(M.key){case"ArrowRight":l||(f==="ltr"?(M.preventDefault(),e.isOpen||g("first"),i==="menu"&&(o!=null&&o.current)&&ne()===(n==null?void 0:n.current)&&de(o.current)):e.isOpen?y():M.continuePropagation());break;case"ArrowLeft":l||(f==="rtl"?(M.preventDefault(),e.isOpen||g("first"),i==="menu"&&(o!=null&&o.current)&&ne()===(n==null?void 0:n.current)&&de(o.current)):e.isOpen?y():M.continuePropagation());break;default:M.continuePropagation();break}},P=M=>{!l&&(M.pointerType==="virtual"||M.pointerType==="keyboard")&&g("first")},T=M=>{!l&&(M.pointerType==="touch"||M.pointerType==="mouse")&&g()},R=M=>{l||(M&&!e.isOpen?b.current||(b.current=setTimeout(()=>{g()},s)):M||p())};It(r,"focusin",M=>{e.isOpen&&H(r.current,F(M))&&F(M)!==n.current&&y()});let K=M=>M!==n.current;return Mp({menuRef:r,submenuRef:o,isOpen:e.isOpen,isDisabled:l}),{submenuTriggerProps:{id:u,"aria-controls":e.isOpen?d:void 0,"aria-haspopup":l?void 0:i,"aria-expanded":e.isOpen?"true":"false",onPressStart:P,onPress:T,onHoverChange:R,onKeyDown:x,isOpen:e.isOpen},submenuProps:w,popoverProps:{isNonModal:!0,shouldCloseOnInteractOutside:K}}}function Co(t){let e=wo(t),[n,r]=a.useState(null),[o,i]=a.useState([]),l=()=>{i([]),e.close()};return{focusStrategy:n,...e,open(u=null){r(u),e.open()},toggle(u=null){r(u),e.toggle()},close(){l()},expandedKeysStack:o,openSubmenu:(u,d)=>{i(f=>d>f.length?f:[...f.slice(0,d),u])},closeSubmenu:(u,d)=>{i(f=>f[d]===u?f.slice(0,d):f)}}}function Dp(t,e){let{triggerKey:n}=t,{expandedKeysStack:r,openSubmenu:o,closeSubmenu:i,close:l}=e,[s]=a.useState(r==null?void 0:r.length),c=a.useMemo(()=>r[s]===n,[r,n,s]),[u,d]=a.useState(null),f=a.useCallback(g=>{d(g??null),o(n,s)},[o,s,n]),b=a.useCallback(()=>{d(null),i(n,s)},[i,s,n]),p=a.useCallback(g=>{d(g??null),c?b():f(g)},[b,f,c]);return a.useMemo(()=>({focusStrategy:u,isOpen:c,open:f,close:b,closeAll:l,submenuLevel:s,setOpen:()=>{},toggle:p}),[c,f,b,l,u,p,s])}function Np(t,e){return typeof e.getChildren=="function"?e.getChildren(t.key):t.childNodes}function Ip(t){return Lp(t)}function Lp(t,e){for(let n of t)return n}function Er(t,e,n){if(e.parentKey===n.parentKey)return e.index-n.index;let r=[...Yi(t,e),e],o=[...Yi(t,n),n],i=r.slice(0,o.length).findIndex((l,s)=>l!==o[s]);return i!==-1?(e=r[i],n=o[i],e.index-n.index):r.findIndex(l=>l===n)>=0?1:(o.findIndex(l=>l===e)>=0,-1)}function Yi(t,e){let n=[],r=e;for(;(r==null?void 0:r.parentKey)!=null;)r=t.getItem(r.parentKey),r&&n.unshift(r);return n}class Re extends Set{constructor(e,n,r){super(e),e instanceof Re?(this.anchorKey=n??e.anchorKey,this.currentKey=r??e.currentKey):(this.anchorKey=n??null,this.currentKey=r??null)}}class er{constructor(e,n,r){this.collection=e,this.state=n,this.allowsCellSelection=(r==null?void 0:r.allowsCellSelection)??!1,this._isSelectAll=null,this.layoutDelegate=(r==null?void 0:r.layoutDelegate)||null,this.fullCollection=(r==null?void 0:r.fullCollection)||null}get selectionMode(){return this.state.selectionMode}get disallowEmptySelection(){return this.state.disallowEmptySelection}get selectionBehavior(){return this.state.selectionBehavior}setSelectionBehavior(e){this.state.setSelectionBehavior(e)}get isFocused(){return this.state.isFocused}setFocused(e){this.state.setFocused(e)}get focusedKey(){return this.state.focusedKey}get childFocusStrategy(){return this.state.childFocusStrategy}setFocusedKey(e,n){(e==null||this.collection.getItem(e))&&this.state.setFocusedKey(e,n)}get selectedKeys(){return this.state.selectedKeys==="all"?new Set(this.getSelectAllKeys()):this.state.selectedKeys}get rawSelection(){return this.state.selectedKeys}isSelected(e){if(this.state.selectionMode==="none")return!1;let n=this.getKey(e);return n==null?!1:this.state.selectedKeys==="all"?this.canSelectItem(n):this.state.selectedKeys.has(n)}get isEmpty(){return this.state.selectedKeys!=="all"&&this.state.selectedKeys.size===0}get isSelectAll(){if(this.isEmpty)return!1;if(this.state.selectedKeys==="all")return!0;if(this._isSelectAll!=null)return this._isSelectAll;let e=this.getSelectAllKeys(),n=this.state.selectedKeys;return this._isSelectAll=e.every(r=>n.has(r)),this._isSelectAll}get firstSelectedKey(){let e=null;for(let n of this.state.selectedKeys){let r=this.collection.getItem(n);(!e||r&&Er(this.collection,r,e)<0)&&(e=r)}return(e==null?void 0:e.key)??null}get lastSelectedKey(){let e=null;for(let n of this.state.selectedKeys){let r=this.collection.getItem(n);(!e||r&&Er(this.collection,r,e)>0)&&(e=r)}return(e==null?void 0:e.key)??null}get disabledKeys(){return this.state.disabledKeys}get disabledBehavior(){return this.state.disabledBehavior}extendSelection(e){if(this.selectionMode==="none")return;if(this.selectionMode==="single"){this.replaceSelection(e);return}let n=this.getKey(e);if(n==null)return;let r;if(this.state.selectedKeys==="all")r=new Re([n],n,n);else{let o=this.state.selectedKeys,i=o.anchorKey??n;r=new Re(o,i,n);for(let l of this.getKeyRange(i,o.currentKey??n))r.delete(l);for(let l of this.getKeyRange(n,i))this.canSelectItem(l)&&r.add(l)}this.state.setSelectedKeys(r)}getKeyRange(e,n){let r=this.collection.getItem(e),o=this.collection.getItem(n);return r&&o?Er(this.collection,r,o)<=0?this.getKeyRangeInternal(e,n):this.getKeyRangeInternal(n,e):[]}getKeyRangeInternal(e,n){var i;if((i=this.layoutDelegate)!=null&&i.getKeyRange)return this.layoutDelegate.getKeyRange(e,n);let r=[],o=e;for(;o!=null;){let l=this.collection.getItem(o);if(l&&(l.type==="item"||l.type==="cell"&&this.allowsCellSelection)&&r.push(o),o===n)return r;o=this.collection.getKeyAfter(o)}return[]}getKey(e){let n=this.collection.getItem(e);if(!n||n.type==="cell"&&this.allowsCellSelection)return e;for(;n&&n.type!=="item"&&n.parentKey!=null;)n=this.collection.getItem(n.parentKey);return!n||n.type!=="item"?null:n.key}toggleSelection(e){if(this.selectionMode==="none")return;if(this.selectionMode==="single"&&!this.isSelected(e)){this.replaceSelection(e);return}let n=this.getKey(e);if(n==null)return;let r=new Re(this.state.selectedKeys==="all"?this.getSelectAllKeys():this.state.selectedKeys);r.has(n)?r.delete(n):this.canSelectItem(n)&&(r.add(n),r.anchorKey=n,r.currentKey=n),!(this.disallowEmptySelection&&r.size===0)&&this.state.setSelectedKeys(r)}replaceSelection(e){if(this.selectionMode==="none")return;let n=this.getKey(e);if(n==null)return;let r=this.canSelectItem(n)?new Re([n],n,n):new Re;this.state.setSelectedKeys(r)}setSelectedKeys(e){if(this.selectionMode==="none")return;let n=new Re;for(let r of e){let o=this.getKey(r);if(o!=null&&(n.add(o),this.selectionMode==="single"))break}this.state.setSelectedKeys(n)}getSelectAllKeys(){let e=this.fullCollection??this.collection,n=[],r=o=>{var i;for(;o!=null;){if(this.canSelectItemIn(o,e)){let l=e.getItem(o);(l==null?void 0:l.type)==="item"&&n.push(o),l!=null&&l.hasChildNodes&&(this.allowsCellSelection||l.type!=="item")&&r(((i=Ip(Np(l,e)))==null?void 0:i.key)??null)}o=e.getKeyAfter(o)}};return r(e.getFirstKey()),n}selectAll(){!this.isSelectAll&&this.selectionMode==="multiple"&&this.state.setSelectedKeys("all")}clearSelection(){!this.disallowEmptySelection&&(this.state.selectedKeys==="all"||this.state.selectedKeys.size>0)&&this.state.setSelectedKeys(new Re)}toggleSelectAll(){this.isSelectAll?this.clearSelection():this.selectAll()}select(e,n){this.selectionMode!=="none"&&(this.selectionMode==="single"?this.isSelected(e)&&!this.disallowEmptySelection?this.toggleSelection(e):this.replaceSelection(e):this.selectionBehavior==="toggle"||n&&(n.pointerType==="touch"||n.pointerType==="virtual")?this.toggleSelection(e):this.replaceSelection(e))}isSelectionEqual(e){if(e===this.state.selectedKeys)return!0;let n=this.selectedKeys;if(e.size!==n.size)return!1;for(let r of e)if(!n.has(r))return!1;for(let r of n)if(!e.has(r))return!1;return!0}canSelectItem(e){return this.canSelectItemIn(e,this.collection)}canSelectItemIn(e,n){var o;if(this.state.selectionMode==="none"||this.state.disabledKeys.has(e))return!1;let r=n.getItem(e);return!(!r||(o=r==null?void 0:r.props)!=null&&o.isDisabled||r.type==="cell"&&!this.allowsCellSelection)}isDisabled(e){var r,o;let n=this.collection.getItem(e);return this.state.disabledBehavior==="all"&&(this.state.disabledKeys.has(e)||!!((r=n==null?void 0:n.props)!=null&&r.isDisabled))&&((o=n==null?void 0:n.props)==null?void 0:o.disabledBehavior)!=="selection"}isLink(e){var n,r;return!!((r=(n=this.collection.getItem(e))==null?void 0:n.props)!=null&&r.href)}getItemProps(e){var n;return(n=this.collection.getItem(e))==null?void 0:n.props}withCollection(e){return new er(e,this.state,{allowsCellSelection:this.allowsCellSelection,layoutDelegate:this.layoutDelegate||void 0,fullCollection:this.fullCollection??this.collection})}}class Kp{constructor(e,{expandedKeys:n}={}){this.keyMap=new Map,this.firstKey=null,this.lastKey=null,this.iterable=e,n=n||new Set;let r=l=>{if(this.keyMap.set(l.key,l),l.childNodes&&(l.type==="section"||n.has(l.key)))for(let s of l.childNodes)r(s)};for(let l of e)r(l);let o=null,i=0;for(let[l,s]of this.keyMap)o?(o.nextKey=l,s.prevKey=o.key):(this.firstKey=l,s.prevKey=void 0),s.type==="item"&&(s.index=i++),o=s,o.nextKey=void 0;this.lastKey=(o==null?void 0:o.key)??null}*[Symbol.iterator](){yield*this.iterable}get size(){return this.keyMap.size}getKeys(){return this.keyMap.keys()}getKeyBefore(e){let n=this.keyMap.get(e);return n?n.prevKey??null:null}getKeyAfter(e){let n=this.keyMap.get(e);return n?n.nextKey??null:null}getFirstKey(){return this.firstKey}getLastKey(){return this.lastKey}getItem(e){return this.keyMap.get(e)??null}at(e){const n=[...this.getKeys()];return this.getItem(n[e])}}class Ap{build(e,n){return this.context=n,Xi(()=>this.iterateCollection(e))}*iterateCollection(e){let{children:n,items:r}=e;if(a.isValidElement(n)&&n.type===a.Fragment)yield*this.iterateCollection({children:n.props.children,items:r});else if(typeof n=="function"){if(!r)throw new Error("props.children was a function but props.items is missing");let o=0;for(let i of r)yield*this.getFullNode({value:i,index:o},{renderer:n}),o++}else{let o=[];a.Children.forEach(n,l=>{l&&o.push(l)});let i=0;for(let l of o){let s=this.getFullNode({element:l,index:i},{});for(let c of s)i++,yield c}}}getKey(e,n,r,o){if(e.key!=null)return e.key;if(n.type==="cell"&&n.key!=null)return`${o}${n.key}`;let i=n.value;if(i!=null){let l=i.key??i.id;if(l==null)throw new Error("No key found for item");return l}return o?`${o}.${n.index}`:`$.${n.index}`}getChildState(e,n){return{renderer:n.renderer||e.renderer}}*getFullNode(e,n,r,o){if(a.isValidElement(e.element)&&e.element.type===a.Fragment){let c=[];a.Children.forEach(e.element.props.children,d=>{c.push(d)});let u=e.index??0;for(const d of c)yield*this.getFullNode({element:d,index:u++},n,r,o);return}let i=e.element;if(!i&&e.value&&n&&n.renderer){let c=this.cache.get(e.value);if(c&&(!c.shouldInvalidate||!c.shouldInvalidate(this.context))){c.index=e.index,c.parentKey=o?o.key:null,yield c;return}i=n.renderer(e.value)}if(a.isValidElement(i)){let c=i.type;if(typeof c!="function"&&typeof c.getCollectionNode!="function"){let b=i.type;throw new Error(`Unknown element <${b}> in collection.`)}let u=c.getCollectionNode(i.props,this.context),d=e.index??0,f=u.next();for(;!f.done&&f.value;){let b=f.value;e.index=d;let p=b.key??null;p==null&&(p=b.element?null:this.getKey(i,e,n,r));let y=[...this.getFullNode({...b,key:p,index:d,wrapper:Op(e.wrapper,b.wrapper)},this.getChildState(n,b),r?`${r}${i.key}`:i.key,o)];for(let v of y){if(v.value=b.value??e.value??null,v.value&&this.cache.set(v.value,v),e.type&&v.type!==e.type)throw new Error(`Unsupported type <${Cr(v.type)}> in <${Cr((o==null?void 0:o.type)??"unknown parent type")}>. Only <${Cr(e.type)}> is supported.`);d++,yield v}f=u.next(y)}return}if(e.key==null||e.type==null)return;let l=this,s={type:e.type,props:e.props,key:e.key,parentKey:o?o.key:null,value:e.value??null,level:((o==null?void 0:o.level)??0)+((o==null?void 0:o.type)==="item"?1:0),index:e.index,rendered:e.rendered,textValue:e.textValue??"","aria-label":e["aria-label"],wrapper:e.wrapper,shouldInvalidate:e.shouldInvalidate,hasChildNodes:e.hasChildNodes||!1,childNodes:Xi(function*(){if(!e.hasChildNodes||!e.childNodes)return;let c=0;for(let u of e.childNodes()){u.key!=null&&(u.key=`${s.key}${u.key}`);let d=l.getFullNode({...u,index:c},l.getChildState(n,u),s.key,s);for(let f of d)c++,yield f}})};yield s}constructor(){this.cache=new WeakMap}}function Xi(t){let e=[],n=null;return{*[Symbol.iterator](){for(let r of e)yield r;n||(n=t());for(let r of n)e.push(r),yield r}}}function Op(t,e){if(t&&e)return n=>t(e(n));if(t)return t;if(e)return e}function Cr(t){return t[0].toUpperCase()+t.slice(1)}function Fp(t,e,n){let r=a.useMemo(()=>new Ap,[]),{children:o,items:i,collection:l}=t;return a.useMemo(()=>{if(l)return l;let c=r.build({children:o,items:i},n);return e(c)},[r,o,i,l,n,e])}function jp(t,e){if(t.size!==e.size)return!1;for(let n of t)if(!e.has(n))return!1;return!0}function ac(t){let{selectionMode:e="none",disallowEmptySelection:n=!1,allowDuplicateSelectionEvents:r,selectionBehavior:o="toggle",disabledBehavior:i="all"}=t,l=a.useRef(!1),[,s]=a.useState(!1),c=a.useRef(null),u=a.useRef(null),[,d]=a.useState(null),f=a.useMemo(()=>Zi(t.selectedKeys),[t.selectedKeys]),b=a.useMemo(()=>Zi(t.defaultSelectedKeys,new Re),[t.defaultSelectedKeys]),[p,g]=qn(f,b,t.onSelectionChange),y=a.useMemo(()=>t.disabledKeys?new Set(t.disabledKeys):new Set,[t.disabledKeys]),[v,w]=a.useState(o);o==="replace"&&v==="toggle"&&typeof p=="object"&&p.size===0&&w("replace");let x=a.useRef(o);return a.useEffect(()=>{o!==x.current&&(w(o),x.current=o)},[o]),{selectionMode:e,disallowEmptySelection:n,selectionBehavior:v,setSelectionBehavior:w,get isFocused(){return l.current},setFocused(P){l.current=P,s(P)},get focusedKey(){return c.current},get childFocusStrategy(){return u.current},setFocusedKey(P,T="first"){c.current=P,u.current=T,d(P)},selectedKeys:p,setSelectedKeys(P){(r||!jp(P,p))&&g(P)},disabledKeys:y,disabledBehavior:i}}function Zi(t,e){return t?t==="all"?"all":new Re(t):e}function _p(t){let{onExpandedChange:e}=t,[n,r]=qn(t.expandedKeys?new Set(t.expandedKeys):void 0,t.defaultExpandedKeys?new Set(t.defaultExpandedKeys):new Set,e),o=ac(t),i=a.useMemo(()=>t.disabledKeys?new Set(t.disabledKeys):new Set,[t.disabledKeys]),l=Fp(t,a.useCallback(c=>new Kp(c,{expandedKeys:n}),[n]),null);return a.useEffect(()=>{o.focusedKey!=null&&!l.getItem(o.focusedKey)&&o.setFocusedKey(null)},[l,o.focusedKey]),{collection:l,expandedKeys:n,disabledKeys:i,toggleKey:c=>{r(Bp(n,c))},setExpandedKeys:r,selectionManager:new er(l,o)}}function Bp(t,e){let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n}const So=a.createContext(null),tr=a.createContext(null),qt=a.createContext(null),Fn=a.createContext(null);function Vp(t){let e=Co(t),n=a.useRef(null),{menuTriggerProps:r,menuProps:o}=dp({...t,type:"menu"},e,n),i=a.useRef(null);return es()?null:a.createElement(ze,{values:[[So,{...o,ref:i}],[Qe,e],[qt,e],[Jn,{trigger:"MenuTrigger",triggerRef:n,scrollRef:i,placement:"bottom start","aria-labelledby":o["aria-labelledby"]}]]},a.createElement(aa,{...r,ref:n,isPressed:e.isOpen},t.children))}const cc=a.createContext(null),Oo=class Oo extends St{filter(e,n,r){let o=e.getItem(this.firstChildKey);if(o&&r(o.textValue,this)){let i=this.clone();return n.addDescendants(i,e),i}return null}};Oo.type="submenutrigger";let Jr=Oo;const zp=ya(Jr,(t,e,n)=>{let{CollectionBranch:r}=a.useContext(Qn),o=a.useContext(tr),i=a.useContext(qt),l=Dp({triggerKey:n.key},i),s=a.useRef(null),c=Je(e),{parentMenuRef:u,shouldUseVirtualFocus:d}=a.useContext(cc),{submenuTriggerProps:f,submenuProps:b,popoverProps:p}=Rp({parentMenuRef:u,submenuRef:s,delay:t.delay,shouldUseVirtualFocus:d},l,c);return a.createElement(ze,{values:[[wt,{...f,onAction:void 0,ref:c}],[So,{ref:s,...b}],[Qe,l],[Jn,{trigger:"SubmenuTrigger",triggerRef:c,placement:"end top","aria-labelledby":b["aria-labelledby"],...p}]]},a.createElement(r,{collection:o.collection,parent:n}),t.children[1])},t=>t.children[0]),Hp=a.forwardRef(function(e,n){return[e,n]=Me(e,n,So),a.createElement(Bh,{content:a.createElement(Gh,e)},r=>a.createElement(Up,{props:e,collection:r,menuRef:n}))});function Up({props:t,collection:e,menuRef:n}){[t,n]=Me(t,n,zi);let{filter:r,...o}=t,i=a.useMemo(()=>r?e.filter(r):e,[e,r]),l=_p({...t,collection:i,children:void 0}),s=a.useContext(qt),{isVirtualized:c,CollectionRoot:u}=a.useContext(Qn),{menuProps:d}=$p({...t,isVirtualized:c,onClose:t.onClose||(s==null?void 0:s.close)},l,n),f=Te({...t,children:void 0,defaultClassName:"react-aria-Menu",values:{isEmpty:l.collection.size===0}}),b=null;l.collection.size===0&&t.renderEmptyState&&(b=a.createElement("div",{role:"menuitem",style:{display:"contents"}},t.renderEmptyState()));let p=ae(t,{global:!0});return a.createElement(xs,null,a.createElement(pe.div,{...Y(p,f,d),ref:n,slot:t.slot||void 0,"data-empty":l.collection.size===0||void 0,onScroll:t.onScroll},a.createElement(ze,{values:[[tr,l],[Eo,{elementType:"div"}],[Yh,{name:"MenuSection",render:uc}],[cc,{parentMenuRef:n,shouldUseVirtualFocus:o==null?void 0:o.shouldUseVirtualFocus}],[wt,{shouldCloseOnSelect:t.shouldCloseOnSelect}],[zi,null],[tp,null],[Fn,l.selectionManager],[qt,s??Co({})]]},a.createElement(ip,null,a.createElement(u,{collection:l.collection,persistedKeys:Jh(l.selectionManager.focusedKey),scrollRef:n}))),b))}class Wp extends er{constructor(e,n){super(e.collection,n),this.parent=e}get focusedKey(){return this.parent.focusedKey}get isFocused(){return this.parent.isFocused}setFocusedKey(e,n){return this.parent.setFocusedKey(e,n)}setFocused(e){this.parent.setFocused(e)}get childFocusStrategy(){return this.parent.childFocusStrategy}}function uc(t,e,n,r="react-aria-MenuSection"){var v,w,x;let o=a.useContext(tr),{CollectionBranch:i}=a.useContext(Qn),[l,s]=Ql(),{headingProps:c,groupProps:u}=Pp({heading:s,"aria-label":n.props["aria-label"]??void 0}),d=Te({...t,id:void 0,children:void 0,defaultClassName:r,className:(v=n.props)==null?void 0:v.className,style:(w=n.props)==null?void 0:w.style,values:void 0}),f=a.useContext(Fn),b=ac(t),p=t.selectionMode!=null?new Wp(f,b):f,g=(x=Jt(wt))==null?void 0:x.shouldCloseOnSelect,y=ae(t,{global:!0});return delete y.id,a.createElement(pe.section,{...Y(y,d,u),ref:e},a.createElement(ze,{values:[[np,{...c,ref:l}],[Fn,p],[wt,{shouldCloseOnSelect:t.shouldCloseOnSelect??g}]]},a.createElement(i,{collection:o.collection,parent:n})))}const Gp=ya(qr,uc),wt=a.createContext(null),qp=ga(Gr,function(e,n,r){var P;[e,n]=Me(e,n,wt);let o=(P=Jt(wt))==null?void 0:P.id,i=a.useContext(tr),l=Je(n),s=a.useContext(Fn),{isVirtualized:c}=a.useContext(Qn),{menuItemProps:u,labelProps:d,descriptionProps:f,keyboardShortcutProps:b,...p}=Sp({...e,id:o,key:r.key,selectionManager:s,isVirtualized:c},i,l),{hoverProps:g,isHovered:y}=en({isDisabled:p.isDisabled}),v=Te({...e,id:void 0,children:r.rendered,defaultClassName:"react-aria-MenuItem",values:{...p,isHovered:y,isFocusVisible:p.isFocusVisible,selectionMode:s.selectionMode,selectionBehavior:s.selectionBehavior,hasSubmenu:!!e["aria-haspopup"],isOpen:e["aria-expanded"]==="true"}}),w=e.href?pe.a:pe.div,x=ae(e,{global:!0});return delete x.id,delete x.onClick,a.createElement(w,{...Y(x,v,u,g),ref:l,"data-disabled":p.isDisabled||void 0,"data-hovered":y||void 0,"data-focused":p.isFocused||void 0,"data-focus-visible":p.isFocusVisible||void 0,"data-pressed":p.isPressed||void 0,"data-selected":p.isSelected||void 0,"data-selection-mode":s.selectionMode==="none"?void 0:s.selectionMode,"data-has-submenu":!!e["aria-haspopup"]||void 0,"data-open":e["aria-expanded"]==="true"||void 0},a.createElement(ze,{values:[[wa,{slots:{[Tn]:d,label:d,description:f}}],[rp,b],[lp,{isSelected:p.isSelected}]]},v.children))});function Yp(t,e){let{role:n="dialog"}=t,r=vn();r=t["aria-label"]?void 0:r;let o=a.useRef(!1);a.useEffect(()=>{if(e.current&&!$t(e.current)){Ye(e.current);let l=setTimeout(()=>{(ne()===e.current||ne()===document.body)&&(o.current=!0,e.current&&(e.current.blur(),Ye(e.current)),o.current=!1)},500);return()=>{clearTimeout(l)}}},[e]),ua();let i=a.useRef(!1);return a.useEffect(()=>{if(process.env.NODE_ENV!=="production"&&!i.current&&e.current){let l=e.current,s=l.hasAttribute("aria-label"),c=l.hasAttribute("aria-labelledby");!s&&!c&&(console.warn("A dialog must have a title for accessibility. Either provide an aria-label or aria-labelledby prop, or render a heading element inside the dialog."),i.current=!0)}}),{dialogProps:{...ae(t,{labelable:!0}),role:n,tabIndex:-1,"aria-labelledby":t["aria-labelledby"]||r,onBlur:l=>{o.current&&l.stopPropagation()}},titleProps:{id:r}}}const dc=a.createContext(null),Qe=a.createContext(null);function Xp(t){let e=Co(t),n=a.useRef(null),{triggerProps:r,overlayProps:o}=ic({type:"dialog"},e,n);return r.id=he(),o["aria-labelledby"]=r.id,a.createElement(ze,{values:[[Qe,e],[qt,e],[dc,o],[Jn,{trigger:"DialogTrigger",triggerRef:n,"aria-labelledby":o["aria-labelledby"]}]]},a.createElement(aa,{...r,ref:n,isPressed:e.isOpen},t.children))}const Zp=a.forwardRef(function(e,n){let r=e["aria-labelledby"];[e,n]=Me(e,n,dc);let{dialogProps:o,titleProps:i}=Yp({...e,"aria-labelledby":r},n),l=a.useContext(Qe);!o["aria-label"]&&!o["aria-labelledby"]&&(e["aria-labelledby"]?o["aria-labelledby"]=e["aria-labelledby"]:process.env.NODE_ENV!=="production"&&console.warn('If a Dialog does not contain a <Heading slot="title">, it must have an aria-label or aria-labelledby attribute for accessibility.'));let s=Te({defaultClassName:"react-aria-Dialog",className:e.className,style:e.style,children:e.children,values:{close:(l==null?void 0:l.close)||(()=>{})}}),c=ae(e,{global:!0});return a.createElement(pe.section,{...Y(c,s,o),render:e.render,ref:n,slot:e.slot||void 0},a.createElement(ze,{values:[[ms,{slots:{[Tn]:{},title:{...i,level:2}}}],[bs,{slots:{[Tn]:{},close:{onPress:()=>l==null?void 0:l.close()}}}]]},s.children))});function Jp(t,e,n){let{overlayProps:r,underlayProps:o}=Es({...t,isOpen:e.isOpen,onClose:e.close},n);return Cs({isDisabled:!e.isOpen}),ua(),a.useEffect(()=>{if(e.isOpen&&n.current)return gs([n.current],{shouldUseInert:!0})},[e.isOpen,n]),{modalProps:Y(r),underlayProps:o}}const Qp=a.createContext(null),Po=a.createContext(null),eb=a.forwardRef(function(e,n){if(a.useContext(Po)){if(process.env.NODE_ENV!=="production"&&(e.onOpenChange||e.defaultOpen!==void 0||e.isOpen!==void 0)){const y=new Set(["isDismissable","isKeyboardDismissDisabled","isOpen","defaultOpen","onOpenChange","isEntering","isExiting","UNSTABLE_portalContainer","shouldCloseOnInteractOutside"]),v=Object.keys(e).filter(w=>y.has(w));console.warn(`This modal is already wrapped in a ModalOverlay, props [${v.join(", ")}] should be placed on the ModalOverlay instead.`)}return a.createElement(Ji,{...e,modalRef:n},e.children)}let{isDismissable:o,isKeyboardDismissDisabled:i,isOpen:l,defaultOpen:s,onOpenChange:c,children:u,isEntering:d,isExiting:f,UNSTABLE_portalContainer:b,shouldCloseOnInteractOutside:p,...g}=e;return a.createElement(fc,{isDismissable:o,isKeyboardDismissDisabled:i,isOpen:l,defaultOpen:s,onOpenChange:c,isEntering:d,isExiting:f,UNSTABLE_portalContainer:b,shouldCloseOnInteractOutside:p},a.createElement(Ji,{...g,modalRef:n},u))});function tb(t,e){[t,e]=Me(t,e,Qp);let n=a.useContext(Qe),r=wo(t),o=t.isOpen!=null||t.defaultOpen!=null||!n?r:n;o===n&&process.env.NODE_ENV!=="production"&&(t.onOpenChange||t.defaultOpen!==void 0||t.isOpen!==void 0)&&console.warn("This modals state is controlled by a trigger, place onOpenChange on the trigger instead.");let i=Je(e),l=a.useRef(null),s=Mr(i,o.isOpen),c=Mr(l,o.isOpen),u=s||c||t.isExiting||!1,d=Ze();return!o.isOpen&&!u||d?null:a.createElement(nb,{...t,state:o,isExiting:u,overlayRef:i,modalRef:l})}const fc=a.forwardRef(tb);function nb({UNSTABLE_portalContainer:t,...e}){let n=e.modalRef,{state:r}=e,{modalProps:o,underlayProps:i}=Jp(e,r,n),l=ao(e.overlayRef)||e.isEntering||!1,s=Te({...e,defaultClassName:"react-aria-ModalOverlay",values:{isEntering:l,isExiting:e.isExiting,state:r}}),c=Lu(),u,d;if(typeof document<"u"){let b=st(document.body)?document.body:document.scrollingElement||document.documentElement,p=b.getBoundingClientRect().width%1,g=b.getBoundingClientRect().height%1;u=b.scrollWidth-p,d=b.scrollHeight-g}let f={...s.style,"--visual-viewport-width":c.width+"px","--visual-viewport-height":c.height+"px","--page-width":u!==void 0?u+"px":void 0,"--page-height":d!==void 0?d+"px":void 0};return a.createElement(Wr,{isExiting:e.isExiting,portalContainer:t},a.createElement(pe.div,{...Y(ae(e,{global:!0}),i),...s,style:f,ref:e.overlayRef,"data-entering":l||void 0,"data-exiting":e.isExiting||void 0},a.createElement(ze,{values:[[Po,{modalProps:o,modalRef:n,isExiting:e.isExiting,isDismissable:e.isDismissable}],[Qe,r]]},s.children)))}function Ji(t){let{modalProps:e,modalRef:n,isExiting:r,isDismissable:o}=a.useContext(Po),i=a.useContext(Qe),l=a.useMemo(()=>ut(t.modalRef,n),[t.modalRef,n]),s=Je(l),c=ao(s),u=Te({...t,defaultClassName:"react-aria-Modal",values:{isEntering:c,isExiting:r,state:i}});return a.createElement(pe.div,{...Y(ae(t,{global:!0}),e),...u,ref:s,"data-entering":c||void 0,"data-exiting":r||void 0},o&&a.createElement(Ur,{onDismiss:i.close}),u.children)}const rb=a.forwardRef(({children:t,...e},n)=>{n=Je(n);let{pressProps:r}=Xe({...e,ref:n}),{focusableProps:o}=Qt(e,n),i=a.Children.only(t);a.useEffect(()=>{if(process.env.NODE_ENV==="production")return;let s=n.current;if(!s||!(s instanceof fe(s).Element)){console.error("<Pressable> child must forward its ref to a DOM element.");return}if(!e.isDisabled&&!fo(s)){console.warn("<Pressable> child must be focusable. Please ensure the tabIndex prop is passed through.");return}if(s.localName!=="button"&&s.localName!=="input"&&s.localName!=="select"&&s.localName!=="textarea"&&s.localName!=="a"&&s.localName!=="area"&&s.localName!=="summary"){let c=s.getAttribute("role");c?c!=="application"&&c!=="button"&&c!=="checkbox"&&c!=="combobox"&&c!=="gridcell"&&c!=="link"&&c!=="menuitem"&&c!=="menuitemcheckbox"&&c!=="menuitemradio"&&c!=="option"&&c!=="radio"&&c!=="searchbox"&&c!=="separator"&&c!=="slider"&&c!=="spinbutton"&&c!=="switch"&&c!=="tab"&&c!=="textbox"&&c!=="treeitem"&&console.warn(`<Pressable> child must have an interactive ARIA role. Got "${c}".`):console.warn("<Pressable> child must have an interactive ARIA role.")}},[n,e.isDisabled]);let l=parseInt(a.version,10)<19?i.ref:i.props.ref;return a.cloneElement(i,{...Y(r,o,i.props),ref:ut(l,n)})}),Qi=({children:t,className:e,slot:n,style:r,variant:o,...i})=>{const l=a.useMemo(()=>Wd({variant:o}),[o]);return h.jsx(xo,{"aria-label":"Close",className:Ee(e,l),"data-slot":"close-button",slot:n,style:r,...i,children:s=>typeof t=="function"?t(s):t??h.jsx(zf,{"data-slot":"close-button-icon"})})},ob=Object.assign(Qi,{Root:Qi}),ib=a.createContext(null),lb=a.createContext(null);function sb(t,e,n){let{validationBehavior:r,focus:o}=t;J(()=>{if(r==="native"&&(n!=null&&n.current)&&!n.current.disabled){let u=e.realtimeValidation.isInvalid?e.realtimeValidation.validationErrors.join(" ")||"Invalid value.":"";n.current.setCustomValidity(u),n.current.hasAttribute("title")||(n.current.title=""),e.realtimeValidation.isInvalid||e.updateValidation(cb(n.current))}});let i=a.useRef(!1),l=Pe(()=>{i.current||e.resetValidation()}),s=Pe(u=>{var f,b;e.displayValidation.isInvalid||e.commitValidation();let d=(f=n==null?void 0:n.current)==null?void 0:f.form;!u.defaultPrevented&&n&&d&&ub(d)===n.current&&(o?o():(b=n.current)==null||b.focus(),Or("keyboard")),u.preventDefault()}),c=Pe(()=>{e.commitValidation()});a.useEffect(()=>{let u=n==null?void 0:n.current;if(!u)return;let d=u.form,f=d==null?void 0:d.reset;return d&&(d.reset=()=>{i.current=!window.event||window.event.type==="message"&&F(window.event)instanceof MessagePort,f==null||f.call(d),i.current=!1}),u.addEventListener("invalid",s),u.addEventListener("change",c),d==null||d.addEventListener("reset",l),()=>{u.removeEventListener("invalid",s),u.removeEventListener("change",c),d==null||d.removeEventListener("reset",l),d&&(d.reset=f)}},[n,r])}function ab(t){let e=t.validity;return{badInput:e.badInput,customError:e.customError,patternMismatch:e.patternMismatch,rangeOverflow:e.rangeOverflow,rangeUnderflow:e.rangeUnderflow,stepMismatch:e.stepMismatch,tooLong:e.tooLong,tooShort:e.tooShort,typeMismatch:e.typeMismatch,valueMissing:e.valueMissing,valid:e.valid}}function cb(t){return{isInvalid:!t.validity.valid,validationDetails:ab(t),validationErrors:t.validationMessage?[t.validationMessage]:[]}}function ub(t){var e;for(let n=0;n<t.elements.length;n++){let r=t.elements[n];if(((e=r.validity)==null?void 0:e.valid)===!1)return r}return null}function db(t,e){let{elementType:n="a",onPress:r,onPressStart:o,onPressEnd:i,onClick:l,isDisabled:s,...c}=t,u={};n!=="a"&&(u={role:"link",tabIndex:s?void 0:0});let{focusableProps:d}=Qt(t,e),{pressProps:f,isPressed:b}=Xe({onPress:r,onPressStart:o,onPressEnd:i,onClick:l,isDisabled:s,ref:e}),p=ae(c,{labelable:!0}),g=Y(d,f),y=Xt(),v=Sl(t);return{isPressed:b,linkProps:Y(p,v,{...g,...u,"aria-disabled":s||void 0,"aria-current":t["aria-current"],onClick:w=>{var x;(x=f.onClick)==null||x.call(f,w),Pl(w,y,t.href,t.routerOptions)}})}}const fb=a.createContext(null),hb=a.forwardRef(function(e,n){[e,n]=Me(e,n,fb);let r=e.href&&!e.isDisabled?"a":"span",{linkProps:o,isPressed:i}=db({...e,elementType:r},n),l=pe[r],{hoverProps:s,isHovered:c}=en(e),{focusProps:u,isFocused:d,isFocusVisible:f}=vo(),b=Te({...e,defaultClassName:"react-aria-Link",values:{isCurrent:!!e["aria-current"],isDisabled:e.isDisabled||!1,isPressed:i,isHovered:c,isFocused:d,isFocusVisible:f}}),p=ae(e,{global:!0});return delete p.onClick,a.createElement(l,{ref:n,slot:e.slot||void 0,...Y(p,b,o,s,u),"data-focused":d||void 0,"data-hovered":c||void 0,"data-pressed":i||void 0,"data-focus-visible":f||void 0,"data-current":!!e["aria-current"]||void 0,"data-disabled":e.isDisabled||void 0},b.children)}),hc=a.createContext({}),el=({children:t,className:e,...n})=>{const r=a.useMemo(()=>qd(),[]);return h.jsx(hc,{value:{slots:r},children:h.jsx(hb,{...n,className:Ee(e,r==null?void 0:r.base()),children:o=>h.jsx(h.Fragment,{children:typeof t=="function"?t(o):t})})})},pb=({children:t,className:e,...n})=>{const{slots:r}=a.useContext(hc);return h.jsx(oe.span,{className:ie(r==null?void 0:r.icon,e),"data-default-icon":_f(!t),"data-slot":"link-icon",...n,children:t??h.jsx(Vf,{"data-slot":"link-default-icon"})})},ko=Object.assign(el,{Root:el,Icon:pb});function bb(t={}){let{isReadOnly:e}=t,[n,r]=qn(t.isSelected,t.defaultSelected||!1,t.onChange),[o]=a.useState(n);function i(s){e||r(s)}function l(){e||r(!n)}return{isSelected:n,defaultSelected:t.defaultSelected??o,setSelected:i,toggle:l}}const mb=a.createContext({}),gb="__button_group_child",tl=({children:t,className:e,fullWidth:n,isDisabled:r,isIconOnly:o,size:i,slot:l,style:s,variant:c,[gb]:u,...d})=>{const f=a.useContext(mb),b=u===!0,p=i??(b?f==null?void 0:f.size:void 0),g=c??(b?f==null?void 0:f.variant:void 0),y=r??(b?f==null?void 0:f.isDisabled:void 0),v=n??(b?f==null?void 0:f.fullWidth:void 0),w=qe({fullWidth:v,isIconOnly:o,size:p,variant:g});return h.jsx(xo,{className:Ee(e,w),"data-slot":"button",isDisabled:y,slot:l,style:s,...d,children:x=>typeof t=="function"?t(x):t})},yb=Object.assign(tl,{Root:tl}),Pt=a.createContext({}),nl=({children:t,className:e,variant:n="default",...r})=>{const o=a.useMemo(()=>zd({variant:n}),[n]),i=h.jsx(oe.div,{className:o.base({className:e}),"data-slot":"card",...r,children:t});return h.jsx(Pt,{value:{slots:o},children:n==="transparent"?i:h.jsx(Yn,{value:{variant:n},children:i})})},vb=({className:t,...e})=>{const{slots:n}=a.useContext(Pt);return h.jsx(oe.div,{className:ie(n==null?void 0:n.header,t),"data-slot":"card-header",...e})},xb=({children:t,className:e,...n})=>{const{slots:r}=a.useContext(Pt);return h.jsx(oe.h3,{className:ie(r==null?void 0:r.title,e),"data-slot":"card-title",...n,children:t})},$b=({children:t,className:e,...n})=>{const{slots:r}=a.useContext(Pt);return h.jsx(oe.p,{className:ie(r==null?void 0:r.description,e),"data-slot":"card-description",...n,children:t})},wb=({className:t,...e})=>{const{slots:n}=a.useContext(Pt);return h.jsx(oe.div,{className:ie(n==null?void 0:n.content,t),"data-slot":"card-content",...e})},Eb=({className:t,...e})=>{const{slots:n}=a.useContext(Pt);return h.jsx(oe.div,{className:ie(n==null?void 0:n.footer,t),"data-slot":"card-footer",...e})},Ot=Object.assign(nl,{Root:nl,Header:vb,Title:xb,Description:$b,Content:wb,Footer:Eb}),Cb=new WeakMap;function Sb(t=!0){let[e,n]=a.useState(t),r=a.useRef(!1),o=a.useCallback(i=>{r.current=!0,n(!!i)},[]);return J(()=>{r.current||n(!1)},[]),[o,e]}function rl(t=!0){let e=he(),[n,r]=Sb(t);return{id:r?e:void 0,ref:n}}const pc={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valueMissing:!1,valid:!0},bc={...pc,customError:!0,valid:!1},mt={isInvalid:!1,validationDetails:pc,validationErrors:[]},Pb=a.createContext({}),jn="__reactAriaFormValidationState";function mc(t){if(t[jn]){let{realtimeValidation:e,displayValidation:n,updateValidation:r,resetValidation:o,commitValidation:i}=t[jn];return{realtimeValidation:e,displayValidation:n,updateValidation:r,resetValidation:o,commitValidation:i}}return kb(t)}function kb(t){let{isInvalid:e,validationState:n,name:r,value:o,builtinValidation:i,validate:l,validationBehavior:s="aria"}=t;n&&(e||(e=n==="invalid"));let c=e!==void 0?{isInvalid:e,validationErrors:[],validationDetails:bc}:null,u=a.useMemo(()=>{if(!l||o==null)return null;let k=Tb(l,o);return ol(k)},[l,o]);i!=null&&i.validationDetails.valid&&(i=void 0);let d=a.useContext(Pb),f=a.useMemo(()=>r?Array.isArray(r)?r.flatMap(k=>Qr(d[k])):Qr(d[r]):[],[d,r]),[b,p]=a.useState(d),[g,y]=a.useState(!1);d!==b&&(p(d),y(!1));let v=a.useMemo(()=>ol(g?[]:f),[g,f]),w=a.useRef(mt),[x,P]=a.useState(mt),T=a.useRef(mt),R=()=>{if(!K)return;M(!1);let k=u||i||w.current;Sr(k,T.current)||(T.current=k,P(k))},[K,M]=a.useState(!1);return a.useEffect(R),{realtimeValidation:c||v||u||i||mt,displayValidation:s==="native"?c||v||x:c||v||u||i||x,updateValidation(k){s==="aria"&&!Sr(x,k)?P(k):w.current=k},resetValidation(){let k=mt;Sr(k,T.current)||(T.current=k,P(k)),s==="native"&&M(!1),y(!0)},commitValidation(){s==="native"&&M(!0),y(!0)}}}function Qr(t){return t?Array.isArray(t)?t:[t]:[]}function Tb(t,e){if(typeof t=="function"){let n=t(e);if(n&&typeof n!="boolean")return Qr(n)}return[]}function ol(t){return t.length?{isInvalid:!0,validationErrors:t,validationDetails:bc}:null}function Sr(t,e){return t===e?!0:!!t&&!!e&&t.isInvalid===e.isInvalid&&t.validationErrors.length===e.validationErrors.length&&t.validationErrors.every((n,r)=>n===e.validationErrors[r])&&Object.entries(t.validationDetails).every(([n,r])=>e.validationDetails[n]===r)}function Mb(t,e,n){let{isDisabled:r=!1,isReadOnly:o=!1,value:i,name:l,form:s,children:c,isRequired:u,validationBehavior:d="aria","aria-label":f,"aria-labelledby":b,"aria-describedby":p,onPressStart:g,onPressEnd:y,onPressChange:v,onPress:w,onPressUp:x,onClick:P}=t,T=mc({...t,value:e.isSelected}),{isInvalid:R,validationErrors:K,validationDetails:M}=T.displayValidation;sb(t,T,n);let N=L=>{L.stopPropagation(),e.setSelected(F(L).checked)},O=c!=null,k=f!=null||b!=null;!O&&!k&&process.env.NODE_ENV!=="production"&&console.warn("If you do not provide children, you must specify an aria-label for accessibility");let{pressProps:A,isPressed:V}=Xe({onPressStart:g,onPressEnd:y,onPressChange:v,onPress:w,onPressUp:x,onClick:P,isDisabled:r}),[j,m]=a.useState(!1),{pressProps:E}=Xe({onPressStart(L){if(L.pointerType==="keyboard"||L.pointerType==="virtual"){L.continuePropagation();return}g==null||g(L),v==null||v(!0),m(!0)},onPressEnd(L){if(L.pointerType==="keyboard"||L.pointerType==="virtual"){L.continuePropagation();return}y==null||y(L),v==null||v(!1),m(!1)},onPressUp(L){if(L.pointerType==="keyboard"||L.pointerType==="virtual"){L.continuePropagation();return}x==null||x(L)},onClick:P,onPress(L){var G;if(L.pointerType==="keyboard"||L.pointerType==="virtual"){L.continuePropagation();return}w==null||w(L),e.toggle(),(G=n.current)==null||G.focus();let{[jn]:U}=t,{commitValidation:W}=U||T;W()},isDisabled:r||o}),{focusableProps:I}=Qt(t,n),C=Y(A,I),D=ae(t,{labelable:!0});Fu(n,e.defaultSelected,e.setSelected);let $=rl(),S=rl();return{labelProps:Y(E,{onClick:L=>L.preventDefault()}),inputProps:Y(D,{checked:e.isSelected,"aria-required":u&&d==="aria"||void 0,required:u&&d==="native","aria-invalid":R||t.validationState==="invalid"||void 0,"aria-errormessage":t["aria-errormessage"],"aria-controls":t["aria-controls"],"aria-readonly":o||void 0,"aria-describedby":[$.id,S.id,p].filter(Boolean).join(" ")||void 0,onChange:N,disabled:r,...i==null?{}:{value:i},name:l,form:s,type:"checkbox",...C}),descriptionProps:$,errorMessageProps:S,isSelected:e.isSelected,isPressed:V||j,isDisabled:r,isReadOnly:o,isInvalid:R||t.validationState==="invalid",validationErrors:K,validationDetails:M}}function gc(t,e,n){let{labelProps:r,inputProps:o,descriptionProps:i,errorMessageProps:l,isSelected:s,isPressed:c,isDisabled:u,isReadOnly:d,isInvalid:f,validationErrors:b,validationDetails:p}=Mb(t,e,n),{isIndeterminate:g}=t;return a.useEffect(()=>{n.current&&(n.current.indeterminate=!!g)}),{labelProps:Y(r,a.useMemo(()=>({onMouseDown:y=>y.preventDefault()}),[])),inputProps:o,descriptionProps:i,errorMessageProps:l,isSelected:s,isPressed:c,isDisabled:u,isReadOnly:d,isInvalid:f,validationErrors:b,validationDetails:p}}const Rb=typeof document<"u"?a.useInsertionEffect??a.useLayoutEffect:()=>{};function Db(t,e,n){let[r,o]=a.useState(t||e),i=a.useRef(r),l=a.useRef(t!==void 0),s=t!==void 0;a.useEffect(()=>{let f=l.current;f!==s&&process.env.NODE_ENV!=="production"&&console.warn(`WARN: A component changed from ${f?"controlled":"uncontrolled"} to ${s?"controlled":"uncontrolled"}.`),l.current=s},[s]);let c=s?t:r;Rb(()=>{i.current=c});let[,u]=a.useReducer(()=>({}),{}),d=a.useCallback((f,...b)=>{let p=typeof f=="function"?f(i.current):f;Object.is(i.current,p)||(i.current=p,o(p),u(),n==null||n(p,...b))},[n]);return[c,d]}function Nb(t={}){let{isReadOnly:e}=t,[n,r]=Db(t.isSelected,t.defaultSelected||!1,t.onChange),[o]=a.useState(n);function i(s){e||r(s)}function l(){e||r(!n)}return{isSelected:n,defaultSelected:t.defaultSelected??o,setSelected:i,toggle:l}}function Ib(t,e,n){const r=Nb({isReadOnly:t.isReadOnly||e.isReadOnly,isSelected:e.isSelected(t.value),defaultSelected:e.defaultValue.includes(t.value),onChange(y){y?e.addValue(t.value):e.removeValue(t.value),t.onChange&&t.onChange(y)}});let{name:o,form:i,descriptionId:l,errorMessageId:s,validationBehavior:c}=Cb.get(e);c=t.validationBehavior??c;let{realtimeValidation:u}=mc({...t,value:r.isSelected,name:void 0,validationBehavior:"aria"}),d=a.useRef(mt),f=()=>{e.setInvalid(t.value,u.isInvalid?u:d.current)};a.useEffect(f);let b=e.realtimeValidation.isInvalid?e.realtimeValidation:u,p=c==="native"?e.displayValidation:b,g=gc({...t,isReadOnly:t.isReadOnly||e.isReadOnly,isDisabled:t.isDisabled||e.isDisabled,name:t.name||o,form:t.form||i,isRequired:t.isRequired??e.isRequired,validationBehavior:c,[jn]:{realtimeValidation:b,displayValidation:p,resetValidation:e.resetValidation,commitValidation:e.commitValidation,updateValidation(y){d.current=y,f()}}},r,n);return{...g,inputProps:{...g.inputProps,"aria-describedby":[g.inputProps["aria-describedby"],e.isInvalid?s:null,l].filter(Boolean).join(" ")||void 0}}}const Lb=a.createContext(null),yc=a.createContext(null),vc=a.createContext(null),Kb=a.forwardRef(function(e,n){let{inputRef:r=null,...o}=e;[e,n]=Me(o,n,Lb);let i=a.useContext(yc),[l,s]=Ab(e,r),{descriptionProps:c,errorMessageProps:u,isSelected:d,isDisabled:f,isReadOnly:b,isInvalid:p,validationDetails:g,validationErrors:y}=l,v=Te({...e,defaultClassName:"react-aria-CheckboxField",values:{isSelected:d,isIndeterminate:e.isIndeterminate||!1,isDisabled:f,isReadOnly:b,isInvalid:p,isRequired:e.isRequired||!1}}),w=ae(e,{global:!0});return delete w.id,delete w.onClick,a.createElement(pe.div,{...Y(w,v),ref:n,slot:e.slot||void 0,"data-selected":d||void 0,"data-indeterminate":e.isIndeterminate||void 0,"data-disabled":f||void 0,"data-readonly":b||void 0,"data-invalid":p||void 0,"data-required":e.isRequired||void 0},a.createElement(ze,{values:[[vc,{...l,inputRef:s,defaultClassName:"react-aria-CheckboxButton",isIndeterminate:e.isIndeterminate,isRequired:e.isRequired}],[wa,{slots:{description:c,errorMessage:u}}],[ib,i?null:{isInvalid:p,validationDetails:g,validationErrors:y}]]},v.children))});function Ab(t,e){let{validationBehavior:n}=Jt(lb)||{},r=t.validationBehavior??n??"native",o=a.useContext(yc),i=Je(a.useMemo(()=>ut(e,t.inputRef!==void 0?t.inputRef:null),[e,t.inputRef])),l={...ef(t),children:typeof t.children=="function"?!0:t.children,value:t.value,validationBehavior:r};return[o?Ib(l,o,i):gc(l,bb(t),i),i]}const Ob=a.forwardRef(function(e,n){let{labelProps:r,inputProps:o,isSelected:i,isDisabled:l,isReadOnly:s,isPressed:c,isInvalid:u,inputRef:d,defaultClassName:f,isIndeterminate:b,isRequired:p}=a.useContext(vc),{isFocused:g,isFocusVisible:y,focusProps:v}=vo(),w=l||s,{hoverProps:x,isHovered:P}=en({...e,isDisabled:w}),T=Te({...e,defaultClassName:f,values:{isSelected:i,isIndeterminate:b||!1,isPressed:c,isHovered:P,isFocused:g,isFocusVisible:y,isDisabled:l,isReadOnly:s,isInvalid:u,isRequired:p||!1}}),R=ae(e,{global:!0});return delete R.id,delete R.onClick,a.createElement(pe.label,{...Y(R,r,x,T),ref:n,slot:e.slot||void 0,"data-selected":i||void 0,"data-indeterminate":b||void 0,"data-pressed":c||void 0,"data-hovered":P||void 0,"data-focused":g||void 0,"data-focus-visible":y||void 0,"data-disabled":l||void 0,"data-readonly":s||void 0,"data-invalid":u||void 0,"data-required":p||void 0},a.createElement(sa,{elementType:"span"},a.createElement("input",{...Y(o,v),ref:d})),T.children)}),Fb=a.createContext({}),nr=a.createContext({}),eo=({children:t,className:e,variant:n,...r})=>{const o=a.useContext(Fb),i=n??o.variant,l=a.useMemo(()=>Hd({variant:i}),[i]);return h.jsx(Kb,{"data-slot":"checkbox",...r,className:Ee(e,l.base()),children:s=>h.jsx(nr,{value:{slots:l,state:s},children:typeof t=="function"?t(s):t})})};eo.displayName="HeroUI.Checkbox";const xc=({children:t,className:e,...n})=>{const{slots:r}=a.useContext(nr);return h.jsx(Ob,{"data-slot":"checkbox-content",...n,className:Ee(e,r==null?void 0:r.content()),children:t})};xc.displayName="HeroUI.Checkbox.Content";const $c=({children:t,className:e,...n})=>{const{slots:r}=a.useContext(nr);return h.jsx(oe.span,{className:ie(r==null?void 0:r.control,e),"data-slot":"checkbox-control",...n,children:t})};$c.displayName="HeroUI.Checkbox.Control";const wc=({children:t,className:e,...n})=>{const{slots:r,state:o}=a.useContext(nr),i=o==null?void 0:o.isSelected,l=o==null?void 0:o.isIndeterminate,s=typeof t=="function"?t(o??{}):t||(l?h.jsx("svg",{"aria-hidden":"true","data-slot":"checkbox-default-indicator--indeterminate",fill:"none",role:"presentation",stroke:"currentColor",strokeLinecap:"round",strokeWidth:3,viewBox:"0 0 24 24",children:h.jsx("line",{x1:"21",x2:"3",y1:"12",y2:"12"})}):h.jsx("svg",{"aria-hidden":"true","data-slot":"checkbox-default-indicator--checkmark",fill:"none",role:"presentation",stroke:"currentColor",strokeDasharray:22,strokeDashoffset:i?44:66,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,viewBox:"0 0 17 18",children:h.jsx("polyline",{points:"1 9 7 14 15 4"})}));return h.jsx(oe.span,{"aria-hidden":"true",className:ie(r==null?void 0:r.indicator,e),"data-slot":"checkbox-indicator",...n,children:s})};wc.displayName="HeroUI.Checkbox.Indicator";const gn=Object.assign(eo,{Root:eo,Content:xc,Control:$c,Indicator:wc}),Ec=a.createContext({}),il=({children:t,className:e,color:n,size:r,variant:o,...i})=>{const l=a.useMemo(()=>Ud({color:n,size:r,variant:o}),[n,r,o]),s=a.useMemo(()=>typeof t=="string"||typeof t=="number"?h.jsx(Cc,{children:t}):t,[t]);return h.jsx(Ec,{value:{slots:l},children:h.jsx(oe.span,{...i,className:ie(l.base,e),"data-slot":"chip",children:s})})},Cc=({children:t,className:e,...n})=>{const{slots:r}=a.useContext(Ec);return h.jsx(oe.span,{className:ie(r==null?void 0:r.label,e),"data-slot":"chip-label",...n,children:t})},_n=Object.assign(il,{Root:il,Label:Cc}),rr=a.createContext({}),to=({children:t,className:e,color:n,size:r,...o})=>{const i=a.useMemo(()=>Yd({color:n,size:r}),[n,r]);return h.jsx(yf,{"data-slot":"progress-bar",...o,className:Ee(e,i.base()),children:l=>h.jsx(rr,{value:{slots:i,state:l},children:typeof t=="function"?t(l):t})})};to.displayName="HeroUI.ProgressBar";const Sc=({children:t,className:e,...n})=>{const{slots:r,state:o}=a.useContext(rr);return h.jsx(oe.span,{className:ie(r==null?void 0:r.output,e),"data-slot":"progress-bar-output",...n,children:t??(o==null?void 0:o.valueText)})};Sc.displayName="HeroUI.ProgressBar.Output";const Pc=({children:t,className:e,...n})=>{const{slots:r}=a.useContext(rr);return h.jsx(oe.div,{className:ie(r==null?void 0:r.track,e),"data-slot":"progress-bar-track",...n,children:t})};Pc.displayName="HeroUI.ProgressBar.Track";const kc=({className:t,style:e,...n})=>{const{slots:r,state:o}=a.useContext(rr);return h.jsx(oe.div,{className:ie(r==null?void 0:r.fill,t),"data-slot":"progress-bar-fill",style:{...e,width:o!=null&&o.isIndeterminate?void 0:`${(o==null?void 0:o.percentage)??0}%`},...n})};kc.displayName="HeroUI.ProgressBar.Fill";const yn=Object.assign(to,{Root:to,Output:Sc,Track:Pc,Fill:kc}),ll=({className:t,orientation:e,variant:n,...r})=>{const o=Jt(Eo),i=e??(o==null?void 0:o.orientation)??"horizontal";return h.jsx(ap,{"data-orientation":i,"data-slot":"separator",orientation:i,className:Jd({orientation:i,variant:n,className:t}),...r})},jb=Object.assign(ll,{Root:ll}),tn=a.createContext({}),sl=({children:t,className:e,status:n,...r})=>{const o=a.useMemo(()=>Vd({status:n}),[n]);return h.jsx(tn,{value:{slots:o,status:n},children:h.jsx(Yn,{value:{variant:"default"},children:h.jsx(oe.div,{className:o==null?void 0:o.base({className:e}),"data-slot":"alert-root",...r,children:t})})})},_b=({children:t,className:e,...n})=>{const{slots:r,status:o}=a.useContext(tn),i=()=>{switch(o){case"accent":return h.jsx(yi,{"data-slot":"alert-default-icon"});case"success":return h.jsx(Wf,{"data-slot":"alert-default-icon"});case"warning":return h.jsx(Hf,{"data-slot":"alert-default-icon"});case"danger":return h.jsx(Uf,{"data-slot":"alert-default-icon"});default:return h.jsx(yi,{"data-slot":"alert-default-icon"})}};return h.jsx(oe.div,{className:ie(r==null?void 0:r.indicator,e),"data-slot":"alert-indicator",...n,children:t??i()})},Bb=({children:t,className:e,...n})=>{const{slots:r}=a.useContext(tn);return h.jsx(oe.div,{className:ie(r==null?void 0:r.content,e),"data-slot":"alert-content",...n,children:t})},Vb=({children:t,className:e,...n})=>{const{slots:r}=a.useContext(tn);return h.jsx(oe.p,{className:ie(r==null?void 0:r.title,e),"data-slot":"alert-title",...n,children:t})},zb=({children:t,className:e,...n})=>{const{slots:r}=a.useContext(tn);return h.jsx(oe.span,{className:ie(r==null?void 0:r.description,e),"data-slot":"alert-description",...n,children:t})},Rt=Object.assign(sl,{Root:sl,Indicator:_b,Content:Bb,Title:Vb,Description:zb}),To=a.createContext({}),Hb=({children:t,className:e,variant:n,...r})=>{const o=a.useMemo(()=>Xd({variant:n}),[n]);return h.jsx(qp,{className:Ee(e,o.item()),"data-slot":"menu-item",...r,children:i=>h.jsx(To,{value:{slots:o,state:i},children:typeof t=="function"?t(i):t})})},Ub=({children:t,className:e,type:n="checkmark",...r})=>{const{slots:o,state:i}=a.useContext(To),l=i==null?void 0:i.isSelected,s=typeof t=="function"?t(i??{}):t||(n==="dot"?h.jsx("svg",{"aria-hidden":"true","data-slot":"menu-item-indicator--dot",fill:"currentColor",fillRule:"evenodd",role:"presentation",viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg",children:h.jsx("path",{clipRule:"evenodd",d:"M8 15A7 7 0 1 0 8 1a7 7 0 0 0 0 14",fillRule:"evenodd"})}):h.jsx("svg",{"aria-hidden":"true","data-slot":"menu-item-indicator--checkmark",fill:"none",role:"presentation",stroke:"currentColor",strokeDasharray:22,strokeDashoffset:l?44:66,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,viewBox:"0 0 17 18",children:h.jsx("polyline",{points:"1 9 7 14 15 4"})}));return h.jsx(oe.span,{"aria-hidden":"true",className:ie(o==null?void 0:o.indicator,e),"data-slot":"menu-item-indicator","data-type":n,"data-visible":l||void 0,...r,children:s})},Wb=({children:t,className:e,...n})=>{const{slots:r,state:o}=a.useContext(To);if(!(o==null?void 0:o.hasSubmenu))return null;const s=t??h.jsx(Bf,{});return h.jsx(oe.span,{"aria-hidden":"true",className:ie(r==null?void 0:r.submenuIndicator,e),"data-slot":"submenu-indicator",...n,children:s})},Gb=({children:t,className:e,...n})=>{const r=a.useMemo(()=>Zd({class:typeof e=="string"?e:void 0}),[e]);return h.jsx(Gp,{className:r,...n,children:t})},or=a.createContext({}),al=({children:t,...e})=>{const n=a.useMemo(()=>Gd(),[]);return h.jsx(or,{value:{slots:n},children:h.jsx(Vp,{...e,children:t})})},qb=({children:t,className:e,...n})=>{const{slots:r}=a.useContext(or);return h.jsx(xo,{className:Ee(e,r==null?void 0:r.trigger()),"data-slot":"dropdown-trigger",...n,children:o=>h.jsx(h.Fragment,{children:typeof t=="function"?t(o):t})})},Yb=({children:t,className:e,placement:n,...r})=>{const{slots:o}=a.useContext(or);return h.jsx(Yn,{value:{variant:"default"},children:h.jsx(Nh,{...r,className:Ee(e,o==null?void 0:o.popover()),"data-slot":"dropdown-popover",placement:n,children:t})})};function Xb({className:t,...e}){const{slots:n}=a.useContext(or);return h.jsx(Hp,{className:Ee(t,n==null?void 0:n.menu()),"data-selection-mode":e.selectionMode,"data-slot":"dropdown-menu",...e})}const Zb=t=>h.jsx(Hb,{...t}),Jb=t=>h.jsx(Wb,{...t}),Qb=({children:t,...e})=>h.jsx(zp,{"data-slot":"dropdown-submenu-trigger",...e,children:t}),em=t=>h.jsx(Ub,{...t}),tm=t=>h.jsx(Gb,{...t}),Dt=Object.assign(al,{Root:al,Trigger:qb,Popover:Yb,Menu:Xb,Section:tm,Item:Zb,ItemIndicator:em,SubmenuIndicator:Jb,SubmenuTrigger:Qb}),we=a.createContext({}),cl=({children:t,state:e,...n})=>{const r=a.useMemo(()=>({slots:bo(),placement:void 0}),[]),o=a.useMemo(()=>e?{isOpen:e.isOpen,onOpenChange:e.setOpen}:{},[e]);return h.jsx(we,{value:r,children:h.jsx(Xp,{"data-slot":"modal-root",...Y(n,o),children:t})})},nm=({children:t,className:e,...n})=>{const{slots:r}=a.useContext(we);return h.jsx(rb,{children:h.jsx(oe.div,{className:ie(r==null?void 0:r.trigger,e),"data-slot":"modal-trigger",role:"button",...n,children:t})})},rm=({children:t,className:e,isDismissable:n=!0,onClick:r,variant:o,...i})=>{const{slots:l}=a.useContext(we),s=a.useMemo(()=>bo({variant:o}),[o]),c=a.useMemo(()=>({slots:{...l,...s}}),[l,s]);return h.jsx(fc,{className:Ee(e,s==null?void 0:s.backdrop()),"data-slot":"modal-backdrop",isDismissable:n,onClick:u=>{u.stopPropagation(),r==null||r(u)},...i,children:u=>h.jsxs(we,{value:c,children:[typeof t=="function"?t(u):t," "]})})},om=({children:t,className:e,placement:n="auto",scroll:r,size:o,...i})=>{const{slots:l}=a.useContext(we),s=a.useMemo(()=>bo({scroll:r,size:o}),[r,o]),c=a.useMemo(()=>({placement:n,slots:{...l,...s}}),[l,n,s]);return h.jsx(eb,{className:Ee(e,s==null?void 0:s.container()),"data-placement":n,"data-slot":"modal-container",...i,children:u=>h.jsx(we,{value:c,children:typeof t=="function"?t(u):t})})},im=({children:t,className:e,...n})=>{const{placement:r,slots:o}=a.useContext(we);return h.jsx(Yn,{value:{variant:"default"},children:h.jsx(Zp,{className:ie(o==null?void 0:o.dialog,e),"data-placement":r,"data-slot":"modal-dialog",...n,children:t})})},lm=({children:t,className:e,...n})=>{const{slots:r}=a.useContext(we);return h.jsx(oe.div,{className:ie(r==null?void 0:r.header,e),"data-slot":"modal-header",...n,children:t})},sm=({children:t,className:e,...n})=>{const{slots:r}=a.useContext(we);return h.jsx(oe.div,{className:ie(r==null?void 0:r.body,e),"data-slot":"modal-body",...n,children:t})},am=({children:t,className:e,...n})=>{const{slots:r}=a.useContext(we);return h.jsx(oe.div,{className:ie(r==null?void 0:r.footer,e),"data-slot":"modal-footer",...n,children:t})},cm=({children:t,className:e,...n})=>{const{slots:r}=a.useContext(we);return h.jsx(jf,{className:ie(r==null?void 0:r.heading,e),"data-slot":"modal-heading",slot:"title",...n,children:t})},um=({children:t,className:e,...n})=>{const{slots:r}=a.useContext(we);return h.jsx(oe.div,{className:ie(r==null?void 0:r.icon,e),"data-slot":"modal-icon",...n,children:t})},dm=({className:t,...e})=>{const{slots:n}=a.useContext(we);return h.jsx(ob,{className:Ee(t,n==null?void 0:n.closeTrigger()),"data-slot":"modal-close-trigger",slot:"close",...e})},pt=Object.assign(cl,{Root:cl,Trigger:nm,Backdrop:rm,Container:om,Dialog:im,Header:lm,Icon:um,Heading:cm,Body:sm,Footer:am,CloseTrigger:dm}),fm={easy:"GREEN",moderate:"ORANGE",difficult:"RED"},hm={easy:"Easy",moderate:"Moderate",difficult:"Difficult"};function pm(){return h.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",className:"size-[1em]",children:[h.jsx("path",{d:"M12 14a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z"}),h.jsx("path",{d:"m13.4 10.6 3.6-3.6"}),h.jsx("path",{d:"M3.3 16a9 9 0 1 1 17.4 0"})]})}function Tc({difficulty:t,label:e,showIcon:n=!0,size:r="md",className:o}){const i=je[fm[t]];return h.jsxs(_n,{variant:"soft",size:r,className:q(o),style:{backgroundColor:ot(i,.15),color:i},children:[n&&h.jsx(pm,{}),h.jsx(_n.Label,{children:e??hm[t]})]})}const ul=h.jsx("path",{d:"M10.29 3.86 1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0ZM12 9v4M12 17h.01"}),dl=h.jsxs(h.Fragment,{children:[h.jsx("circle",{cx:"12",cy:"12",r:"9"}),h.jsx("path",{d:"M12 16v-4M12 8h.01"})]}),bm=h.jsxs(h.Fragment,{children:[h.jsx("circle",{cx:"12",cy:"12",r:"9"}),h.jsx("path",{d:"m8.5 12 2.5 2.5 4.5-5"})]}),mm={note:dl,info:dl,tip:bm,caution:ul,danger:ul};function gm({type:t}){return h.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",className:"size-5",children:mm[t]})}function ym({type:t="caution",title:e,icon:n,children:r,className:o}){const i=e===void 0?Cn[t]:e,l=$l(t);return h.jsxs(Rt,{className:q("border",o),style:{backgroundColor:ot(l,.1),borderColor:l},children:[h.jsx(Rt.Indicator,{style:{color:l},children:n??h.jsx(gm,{type:t})}),h.jsxs(Rt.Content,{children:[i!=null&&h.jsx(Rt.Title,{children:i}),h.jsx(Rt.Description,{children:r})]})]})}const Mc="media-figure-point-marker absolute flex -translate-x-1/2 -translate-y-1/2 items-center justify-center rounded-full font-semibold shadow ring-2 ring-background",Bn="media-figure-shape-outline";function vm(t){return t.type==="circle"}function xm(t){return t.type==="rectangle"}function $m(t,e){const n=t.id??e,r=t.color??"GREY",o=je[r];if(vm(t))return h.jsx("div",{role:"img","aria-label":t.title,className:q("pointer-events-none absolute rounded-full",Bn),style:{left:`${t.x}%`,top:`${t.y}%`,width:`${t.radius*2}%`,aspectRatio:"1",transform:"translate(-50%, -50%)",borderColor:o,backgroundColor:ot(o,.1)}},n);if(xm(t)){const i=Math.min(t.x1,t.x2),l=Math.min(t.y1,t.y2),s=Math.abs(t.x2-t.x1),c=Math.abs(t.y2-t.y1);return h.jsx("div",{role:"img","aria-label":t.title,className:q("pointer-events-none absolute",Bn),style:{left:`${i}%`,top:`${l}%`,width:`${s}%`,height:`${c}%`,borderColor:o,backgroundColor:ot(o,.1)}},n)}return h.jsx("span",{role:"img","aria-label":t.title,style:{left:`${t.x}%`,top:`${t.y}%`,backgroundColor:o,color:Hn(o)},className:Mc,children:t.label},n)}function no({annotations:t}){return h.jsx(h.Fragment,{children:t.map($m)})}const Vn=4/3,Mo=16;function ct(t){return Math.round(t*3/4)}const Pr=(t,e,n)=>Math.min(Math.max(t,e),n);function nn(t,e,n){const r=Math.min(e,Math.floor(n*Vn)),o=Pr(Math.round(t.width),Math.min(Mo,r),r),i=ct(o);return{width:o,x:Pr(Math.round(t.x),0,e-o),y:Pr(Math.round(t.y),0,n-i)}}function Rc(t,e){const r=t/e<=Vn?t:Math.round(e*Vn),o=ct(r);return nn({x:(t-r)/2,y:(e-o)/2,width:r},t,e)}function wm(t,e,n){const{x:r,y:o,width:i}=t;if(i<=0||r<0||o<0)return!1;const l=ct(i);return r+i<=e&&o+l<=n}function Em(t,e,n,r,o){if(r<=0||o<=0||e<=0||n<=0||!wm(t,e,n))return null;const i=r/t.width;return{position:"absolute",width:i*e,height:i*n,left:-t.x*i,top:-t.y*i,maxWidth:"none"}}function Cm(t,e){t(),requestAnimationFrame(()=>{t(),requestAnimationFrame(t)});const n=[];for(let r=50;r<=e;r+=50)n.push(setTimeout(t,r));return()=>{for(const r of n)clearTimeout(r)}}function Sm(t={}){const{settleMs:e=0,observeParent:n=!1,remeasureWhenVisible:r=!1,layoutSettleKey:o}=t,i=a.useRef(null),[l,s]=a.useState(null),c=a.useCallback(()=>{const d=i.current;if(!d)return;const{width:f,height:b}=d.getBoundingClientRect();f<=0||b<=0||s(p=>(p==null?void 0:p.width)===f&&(p==null?void 0:p.height)===b?p:{width:f,height:b})},[]),u=a.useCallback(()=>{c(),requestAnimationFrame(()=>{c(),requestAnimationFrame(()=>{c(),setTimeout(c,0)})})},[c]);return a.useLayoutEffect(()=>{c();const d=i.current;if(!d)return;const f=new ResizeObserver(()=>c());f.observe(d),n&&d.parentElement&&f.observe(d.parentElement);const b=[];let p=d;for(let y=0;p&&y<6;y+=1)b.push(p),p=p.parentElement;const g=()=>u();for(const y of b)y.addEventListener("transitionend",g);return()=>{f.disconnect();for(const y of b)y.removeEventListener("transitionend",g)}},[c,u,n]),a.useEffect(()=>{if(!(e<=0))return Cm(c,e)},[o,c,e]),a.useEffect(()=>{if(!r)return;const d=i.current;if(!d)return;const f=new IntersectionObserver(b=>{for(const p of b)p.isIntersecting&&p.intersectionRatio>=.99&&u()},{threshold:[0,.25,.5,.75,.99,1]});return f.observe(d),()=>f.disconnect()},[o,u,r]),a.useEffect(()=>{o!==void 0&&u()},[o,u]),{ref:i,size:l,measure:c,measureAfterLayout:u}}function Pm(t){const e=t.split(/[?#]/)[0]??t,n=e.lastIndexOf("/"),r=e.lastIndexOf(".");return r<=n?null:e.slice(r+1).toLowerCase()||null}function km({src:t,modelFileName:e}){const n=a.useRef(null);return a.useEffect(()=>{const r=n.current;if(!r)return;let o=!1,i=null,l=null;return import("online-3d-viewer").then(s=>{if(o)return;const c=new s.EmbeddedViewer(r,{projectionMode:s.ProjectionMode.Orthographic,backgroundColor:new s.RGBAColor(219,234,254,255),defaultColor:new s.RGBColor(30,64,175),onModelLoaded:()=>{const d=c.GetViewer();d.SetNavigationMode(s.NavigationMode.FreeOrbit),d.SetUpVector(s.Direction.Z,!1);const f=d.GetBoundingSphere(()=>!0);d.FitSphereToWindow(f,!1)}});l=c,(t.startsWith("blob:")||Pm(t)===null&&!!e)&&e?c.LoadModelFromInputFiles([new s.InputFile(e,s.FileSource.Url,t)]):c.LoadModelFromUrlList([t]),typeof ResizeObserver<"u"&&(i=new ResizeObserver(()=>{c.Resize()}),i.observe(r))}),()=>{o=!0,i==null||i.disconnect(),l==null||l.Destroy()}},[t,e]),h.jsx("div",{ref:n,className:"absolute inset-0 [&_canvas]:size-full!","aria-label":"Interactive 3D model",role:"img"})}const Tm=400;function Ro({className:t,src:e,type:n="image",displayRegion:r,modelFileName:o,layoutSettleKey:i,remeasureWhenVisible:l=!1,children:s}){const c=!!r,{ref:u,size:d,measureAfterLayout:f}=Sm({settleMs:c?Tm:0,observeParent:c,remeasureWhenVisible:c&&l,layoutSettleKey:i}),[b,p]=a.useState(null),g=r&&b&&d&&Em(r,b.width,b.height,d.width,d.height),y=!!g,v=!!(r&&b&&!g),w="size-full object-cover object-center",x=T=>{const R=T.currentTarget;R.naturalWidth>0&&R.naturalHeight>0&&(p({width:R.naturalWidth,height:R.naturalHeight}),f())},P=T=>{const R=T.currentTarget;R.videoWidth>0&&R.videoHeight>0&&(p({width:R.videoWidth,height:R.videoHeight}),f())};return a.useEffect(()=>{p(null)},[e]),n==="model"?h.jsxs("div",{ref:u,className:q("@container relative overflow-hidden",t),children:[h.jsx(km,{src:e,modelFileName:o}),s]}):h.jsxs("div",{ref:u,className:q("@container relative overflow-hidden",t),children:[n==="video"?h.jsx("video",{src:e,controls:!0,className:y?"absolute max-w-none":w,style:{...y&&g?g:void 0,opacity:v?0:1},onLoadedMetadata:r?P:void 0}):h.jsx("img",{src:e,alt:"",className:y?"absolute max-w-none":w,style:{...y&&g?g:void 0,opacity:v?0:1},onLoad:r?x:void 0}),s]})}function Mm({className:t="absolute inset-0",...e}){return h.jsx(Ro,{className:t,...e})}const Rm=2,fl=3,zn=(t,e,n)=>Math.min(Math.max(t,e),n),Dc=t=>t.type==="circle",rn=t=>t.type==="rectangle",hl=t=>rn(t)?[t.x1,t.x2]:[t.x],pl=t=>rn(t)?[t.y1,t.y2]:[t.y];function Dm(t,e,n){const r=zn(e,-Math.min(...hl(t)),100-Math.max(...hl(t))),o=zn(n,-Math.min(...pl(t)),100-Math.max(...pl(t)));return rn(t)?{...t,x1:t.x1+r,y1:t.y1+o,x2:t.x2+r,y2:t.y2+o}:{...t,x:t.x+r,y:t.y+o}}function bl(t,e,n){return Math.hypot(e.x-t.x,(e.y-t.y)/n)}function Nc(t){return{...t,x1:Math.min(t.x1,t.x2),y1:Math.min(t.y1,t.y2),x2:Math.max(t.x1,t.x2),y2:Math.max(t.y1,t.y2)}}function Nm(t,e,n){return t==="circle"?{type:"circle",x:e.x,y:e.y,radius:0,color:n}:t==="rectangle"?{type:"rectangle",x1:e.x,y1:e.y,x2:e.x,y2:e.y,color:n}:{type:"point",x:e.x,y:e.y,color:n}}function Im(t){return t==="circle"?"create-circle":t==="rectangle"?"create-rectangle":"create-point"}function Lm(t,e,n){switch(t.mode){case"create-point":return{...t.base,x:e.x,y:e.y};case"move":return Dm(t.base,e.x-t.start.x,e.y-t.start.y);case"create-circle":return{...t.base,radius:bl(t.start,e,n)};case"resize-circle":{const r=t.base;return{...r,radius:bl({x:r.x,y:r.y},e,n)}}case"create-rectangle":return{...t.base,x2:e.x,y2:e.y};case"resize-rect":{const r=t.base,o=t.corner==="nw"||t.corner==="sw",i=t.corner==="nw"||t.corner==="ne";return{...r,x1:o?e.x:r.x1,x2:o?r.x2:e.x,y1:i?e.y:r.y1,y2:i?r.y2:e.y}}}}function ml(t){if(Dc(t))return{...t,radius:Math.max(t.radius,Rm)};if(rn(t)){const e=Nc(t);return{...e,x2:Math.max(e.x2,e.x1+fl),y2:Math.max(e.y2,e.y1+fl)}}return t}function gl({x:t,y:e,cursor:n,onPointerDown:r}){return h.jsx("span",{onPointerDown:r,className:"annotation-handle pointer-events-auto absolute size-3 -translate-x-1/2 -translate-y-1/2 rounded-sm border border-background bg-accent shadow",style:{left:`${t}%`,top:`${e}%`,cursor:n}})}function Km({annotations:t,editing:e}){const{tool:n,color:r,selectedId:o,onSelect:i,onAdd:l,onChange:s,onRemove:c}=e,u=a.useRef(null),d=a.useRef(!1),[f,b]=a.useState(null),[p,g]=a.useState(null),y=n==="select",v=k=>{const A=u.current.getBoundingClientRect();return{x:zn((k.clientX-A.left)/A.width*100,0,100),y:zn((k.clientY-A.top)/A.height*100,0,100)}},w=(k,A)=>{var V;(V=u.current)==null||V.setPointerCapture(k.pointerId),d.current=!1,b(A),g(ml(A.base))},x=k=>{if(y){i==null||i(null);return}const A=v(k);w(k,{mode:Im(n),id:null,start:A,base:Nm(n,A,r)})},P=k=>{if(!f)return;const A=u.current.getBoundingClientRect();d.current=!0,g(ml(Lm(f,v(k),A.width/A.height)))},T=k=>{var A;f&&p&&((A=u.current)==null||A.releasePointerCapture(k.pointerId),f.id===null?l==null||l(p):d.current&&(s==null||s(f.id,p))),b(null),g(null)},R=(k,A,V)=>{var j;k.stopPropagation(),(j=u.current)==null||j.focus(),i==null||i(A),w(k,{mode:"move",id:A,start:v(k),base:V})},K=(k,A,V)=>{k.stopPropagation(),w(k,{mode:"resize-circle",id:A,start:v(k),base:V})},M=(k,A,V,j)=>{k.stopPropagation(),w(k,{mode:"resize-rect",id:A,start:v(k),base:Nc(V),corner:j})},N=k=>{(k.key==="Delete"||k.key==="Backspace")&&o!=null&&(k.preventDefault(),c==null||c(o))},O=(k,A,V)=>{const j=V&&A===o,m=je[k.color??"GREY"],E=V?"pointer-events-auto cursor-move":"pointer-events-none",I=V?C=>R(C,A,k):void 0;if(Dc(k))return h.jsxs("div",{children:[h.jsx("div",{role:"img","aria-label":k.title,onPointerDown:I,className:q("absolute rounded-full",Bn,E,j&&"outline outline-2 outline-offset-2 outline-accent"),style:{left:`${k.x}%`,top:`${k.y}%`,width:`${k.radius*2}%`,aspectRatio:"1",transform:"translate(-50%, -50%)",borderColor:m,backgroundColor:ot(m,.1)}}),j&&h.jsx(gl,{x:k.x+k.radius,y:k.y,cursor:"ew-resize",onPointerDown:C=>K(C,A,k)})]},A);if(rn(k)){const C=Math.min(k.x1,k.x2),D=Math.min(k.y1,k.y2),$=Math.abs(k.x2-k.x1),S=Math.abs(k.y2-k.y1),L=[{corner:"nw",x:C,y:D,cursor:"nwse-resize"},{corner:"ne",x:C+$,y:D,cursor:"nesw-resize"},{corner:"sw",x:C,y:D+S,cursor:"nesw-resize"},{corner:"se",x:C+$,y:D+S,cursor:"nwse-resize"}];return h.jsxs("div",{children:[h.jsx("div",{role:"img","aria-label":k.title,onPointerDown:I,className:q("absolute",Bn,E,j&&"outline outline-2 outline-offset-2 outline-accent"),style:{left:`${C}%`,top:`${D}%`,width:`${$}%`,height:`${S}%`,borderColor:m,backgroundColor:ot(m,.1)}}),j&&L.map(({corner:U,x:W,y:G,cursor:ee})=>h.jsx(gl,{x:W,y:G,cursor:ee,onPointerDown:le=>M(le,A,k,U)},U))]},A)}return h.jsx("span",{role:"img","aria-label":k.title,onPointerDown:I,style:{left:`${k.x}%`,top:`${k.y}%`,backgroundColor:m,color:Hn(m)},className:q(Mc,E,j&&"outline outline-2 outline-offset-2 outline-accent"),children:k.label},A)};return h.jsxs("div",{ref:u,tabIndex:0,role:"application","aria-label":"Annotation editor",onPointerDown:x,onPointerMove:P,onPointerUp:T,onKeyDown:N,className:q("absolute inset-0 focus:outline-none",y?"cursor-default":"cursor-crosshair"),children:[t.map((k,A)=>{const V=k.id??String(A),j=(f==null?void 0:f.id)===V&&p?p:k;return O(j,V,y)}),(f==null?void 0:f.id)===null&&p&&O(p,"__draft__",!1)]})}function ir({src:t,type:e="image",modelFileName:n,annotations:r=[],displayRegion:o,zoomable:i=!0,annotationEditing:l,layoutSettleKey:s,className:c}){const u="@container relative aspect-[4/3] overflow-hidden rounded-lg border border-default bg-default-soft",d=h.jsxs(h.Fragment,{children:[h.jsx(Mm,{src:t,type:e,displayRegion:o,modelFileName:n,layoutSettleKey:s}),l?h.jsx(Km,{annotations:r,editing:l}):h.jsx(no,{annotations:r})]});return h.jsx("figure",{className:q("flex flex-col gap-2",c),children:i&&e==="image"&&!l?h.jsxs(pt,{children:[h.jsx(pt.Trigger,{"aria-label":"View image full size",className:q(u,"cursor-zoom-in"),children:d}),h.jsx(pt.Backdrop,{variant:"blur",children:h.jsx(pt.Container,{placement:"center",children:h.jsxs(pt.Dialog,{"aria-label":"Full size image",className:"w-auto max-w-[95vw] overflow-hidden bg-transparent p-0 shadow-none",children:[h.jsx(Ro,{className:"aspect-[4/3] max-h-[88vh] w-[min(95vw,calc(88vh*4/3))] rounded-lg border border-default bg-default-soft",src:t,type:"image",displayRegion:o,remeasureWhenVisible:!0,children:h.jsx(no,{annotations:r})}),h.jsx(pt.CloseTrigger,{})]})})})]}):h.jsx("div",{className:u,children:d})})}const Do=Symbol.for("@openpawlabs/diy-guides-ui/MediaFigure");ir[Do]=!0;function Am(){return h.jsx("svg",{viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",className:"size-2/3",children:h.jsx("path",{d:"M8 5v14l11-7z"})})}const Om={model:{hex:je.BLUE,content:h.jsx("span",{className:"text-lg font-bold",children:"3D"})},video:{hex:je.MAGENTA,content:h.jsx(Am,{})}};function Ic({src:t,type:e="image",annotations:n=[],displayRegion:r,className:o}){if(e==="image")return h.jsx(Ro,{className:q("aspect-[4/3]",o),src:t,type:"image",displayRegion:r,children:h.jsx(no,{annotations:n})});const{hex:i,content:l}=Om[e];return h.jsx("div",{"aria-hidden":"true",className:q("flex aspect-[4/3] items-center justify-center",o),style:{backgroundColor:i,color:Hn(i)},children:l})}const Fm=[{corner:"nw",cursor:"nwse-resize"},{corner:"ne",cursor:"nesw-resize"},{corner:"sw",cursor:"nesw-resize"},{corner:"se",cursor:"nwse-resize"}],jm=(t,e,n)=>Math.min(Math.max(t,e),n);function _m(t,e,n,r,o){return nn({x:t.x+e,y:t.y+n,width:t.width},r,o)}function Bm(t,e,n,r,o){const i=e==="nw"||e==="sw",l=e==="nw"||e==="ne",s=i?t.x+t.width:t.x,c=l?t.y+ct(t.width):t.y,u=i?s:r-s,d=l?c:o-c,f=Math.min(u,d*(4/3)),b=jm(Math.abs(n.x-s),Mo,f),p=ct(b);return nn({x:i?s-b:s,y:l?c-p:c,width:b},r,o)}function Vm({src:t,region:e,onChange:n,className:r}){const o=a.useRef(null),[i,l]=a.useState(null),[s,c]=a.useState(null),[u,d]=a.useState(null),f=x=>{const P=x.currentTarget;P.naturalWidth>0&&P.naturalHeight>0&&l({width:P.naturalWidth,height:P.naturalHeight})},b=u??(i?e?nn(e,i.width,i.height):Rc(i.width,i.height):null),p=x=>{const P=o.current.getBoundingClientRect();return{x:(x.clientX-P.left)/P.width*i.width,y:(x.clientY-P.top)/P.height*i.height}},g=(x,P)=>{var T;x.stopPropagation(),(T=o.current)==null||T.setPointerCapture(x.pointerId),c(P),d(P.base)},y=x=>{if(!s||!i)return;const P=p(x),T=s.mode==="move"?_m(s.base,P.x-s.start.x,P.y-s.start.y,i.width,i.height):Bm(s.base,s.corner,P,i.width,i.height);d(T)},v=x=>{var P;s&&u&&((P=o.current)==null||P.releasePointerCapture(x.pointerId),n(u)),c(null),d(null)},w=b&&i?{left:b.x/i.width*100,top:b.y/i.height*100,width:b.width/i.width*100,height:ct(b.width)/i.height*100}:null;return h.jsxs("div",{ref:o,role:"application","aria-label":"Crop editor",className:q("relative inline-block touch-none select-none overflow-hidden leading-none",r),style:i?{"--crop-aspect":i.width/i.height}:void 0,onPointerMove:y,onPointerUp:v,children:[h.jsx("img",{src:t,alt:"",draggable:!1,onLoad:f,className:"block h-auto w-full select-none"}),w&&h.jsx("div",{className:"crop-region absolute cursor-move border-2 border-background",style:{left:`${w.left}%`,top:`${w.top}%`,width:`${w.width}%`,height:`${w.height}%`,boxShadow:"0 0 0 9999px rgba(0, 0, 0, 0.5)"},onPointerDown:x=>g(x,{mode:"move",start:p(x),base:b}),children:Fm.map(({corner:x,cursor:P})=>h.jsx("span",{className:"crop-handle pointer-events-auto absolute size-3 -translate-x-1/2 -translate-y-1/2 rounded-sm border border-background bg-accent shadow",style:{left:x==="nw"||x==="sw"?"0%":"100%",top:x==="nw"||x==="ne"?"0%":"100%",cursor:P},onPointerDown:T=>g(T,{mode:"resize",corner:x,start:p(T),base:b})},x))})]})}function zm({name:t,thumbnail:e,href:n,quantity:r,price:o,children:i,className:l}){return h.jsxs("li",{className:q("flex items-center gap-3 py-3 first:pt-0 last:pb-0",l),children:[e&&h.jsx("img",{src:e,alt:"",className:"size-12 shrink-0 rounded-md border border-default object-cover"}),h.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[n?h.jsx(ko,{href:n,className:"font-medium",children:t}):h.jsx("span",{className:"font-medium",children:t}),i!=null&&h.jsx("span",{className:"text-sm text-default-500",children:i})]}),r!=null&&h.jsxs("span",{className:"shrink-0 text-sm text-default-500",children:["×",r]}),o!=null&&h.jsx("span",{className:"shrink-0 text-sm font-medium",children:o})]})}function Hm({title:t="What you need",children:e,className:n}){return h.jsxs(Ot,{className:q("w-full",n),children:[t!=null&&h.jsx(Ot.Header,{children:h.jsx(Ot.Title,{children:t})}),h.jsx(Ot.Content,{children:h.jsx("ul",{className:"flex flex-col divide-y divide-default",children:e})})]})}const Um=Object.assign(Hm,{Item:zm});function Lc(t){return null}function Wm(t){return a.isValidElement(t)&&t.type===Lc}function Kc(){return h.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2.5,strokeLinecap:"round",strokeLinejoin:"round",className:"mr-1 size-4 shrink-0",children:h.jsx("path",{d:"m6 9 6 6 6-6"})})}function yl(){return h.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",className:"size-4",children:h.jsx("path",{d:"M10 13a5 5 0 0 0 7.07 0l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71M14 11a5 5 0 0 0-7.07 0l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"})})}function Gm(){return h.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",className:"size-4",children:h.jsx("path",{d:"M12 19V5M5 12l7-7 7 7"})})}function qm(){return h.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2.5,strokeLinecap:"round",strokeLinejoin:"round",className:"size-3.5",children:h.jsx("path",{d:"M18 6 6 18M6 6l12 12"})})}function Ym(){return h.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",fill:"currentColor",className:"size-4",children:[h.jsx("circle",{cx:"9",cy:"6",r:"1.4"}),h.jsx("circle",{cx:"15",cy:"6",r:"1.4"}),h.jsx("circle",{cx:"9",cy:"12",r:"1.4"}),h.jsx("circle",{cx:"15",cy:"12",r:"1.4"}),h.jsx("circle",{cx:"9",cy:"18",r:"1.4"}),h.jsx("circle",{cx:"15",cy:"18",r:"1.4"})]})}function ro(t){const{href:e,download:n,external:r}=t.props;return{href:e,download:n,...r?{target:"_blank",rel:"noreferrer noopener"}:{}}}function Xm(t,e,n,r){return q(qe({variant:t,size:e,fullWidth:!0}),"!min-h-0 !justify-center !rounded-none",n&&"!rounded-b-3xl",r&&"border-b border-separator","hover:!bg-[var(--button-bg-hover)] data-[hovered=true]:!bg-[var(--button-bg-hover)]")}function oo(){return h.jsx("span",{"aria-hidden":"true",className:po({orientation:"horizontal"}).separator()})}function Zm({variant:t="primary",size:e="md",icon:n,menuLabel:r="More download options",editing:o,children:i,className:l}){const s=a.Children.toArray(i).filter(Wm);if(o)return h.jsx(Qm,{items:s,variant:t,size:e,icon:n,menuLabel:r,editing:o,className:l});if(s.length===0)return null;const[c,...u]=s;if(u.length===0){const d=qe({variant:"secondary",size:e});return h.jsxs(ko,{...ro(c),className:q(d,l),children:[n,c.props.children]})}return h.jsx(Jm,{items:s,variant:t,size:e,icon:n,menuLabel:r,className:l})}function Jm({items:t,variant:e,size:n,icon:r,menuLabel:o,className:i}){const l=a.useRef(null),[s,c]=a.useState(),[u]=t,d=qe({variant:e,size:n});return a.useLayoutEffect(()=>{const f=l.current;if(!f)return;const b=()=>c(f.offsetWidth);b();const p=new ResizeObserver(b);return p.observe(f),()=>p.disconnect()},[t,e,n]),h.jsxs("div",{ref:l,className:q(po({orientation:"horizontal"}).base(),i),children:[h.jsxs(ko,{...ro(u),className:d,children:[r,u.props.children]}),h.jsxs(Dt,{children:[h.jsxs(Dt.Trigger,{"aria-label":o,className:q(qe({variant:e,size:n,isIconOnly:!0}),"!inline-flex items-center justify-center"),children:[h.jsx(oo,{}),h.jsx(Kc,{})]}),h.jsx(Dt.Popover,{placement:"bottom",offset:0,triggerRef:l,className:"!max-w-none !p-0",style:s?{minWidth:s}:void 0,children:h.jsx(Dt.Menu,{className:"!gap-0 !p-0",children:t.map((f,b)=>h.jsxs(Dt.Item,{...ro(f),className:Xm("secondary",n,b===t.length-1,b<t.length-1),children:[b===0?r:null,f.props.children]},b))})})]})]})}function Qm({items:t,variant:e,size:n,icon:r,menuLabel:o,editing:i,className:l}){const[s,c]=a.useState(!1),[u,d]=a.useState(null),[f,b]=a.useState(null),{onAddItem:p,onRemoveItem:g,onReorderItem:y,onSelectItem:v}=i,w=t[0],x=t.slice(1),P=qe({variant:e,size:n}),T=y!=null,R=()=>{d(null),b(null)},K=M=>{u!=null&&u!==M&&(y==null||y(u,M)),R()};return h.jsxs("div",{className:q("relative inline-flex flex-col items-start",l),children:[h.jsxs("div",{className:po({orientation:"horizontal"}).base(),children:[h.jsxs("span",{className:q(P,"cursor-text"),children:[r,w?w.props.children:h.jsx("span",{className:"opacity-60",children:"Add a link"})]}),w&&v&&h.jsxs("button",{type:"button",onClick:()=>v(0),"aria-label":"Edit primary link",className:qe({variant:e,size:n,isIconOnly:!0}),children:[h.jsx(oo,{}),h.jsx(yl,{})]}),h.jsxs("button",{type:"button",onClick:()=>c(M=>!M),"aria-label":o,"aria-expanded":s,className:qe({variant:e,size:n,isIconOnly:!0}),children:[!(w&&v)&&h.jsx(oo,{}),h.jsx(Kc,{})]})]}),s&&h.jsxs(h.Fragment,{children:[h.jsx("div",{className:"fixed inset-0 z-40",onClick:()=>c(!1),"aria-hidden":"true"}),h.jsxs("div",{className:"absolute left-0 top-full z-50 mt-2 w-64 rounded-lg border border-default-200 bg-background p-2 shadow-lg",children:[x.length>0?h.jsx("ul",{className:"flex flex-col gap-0.5",children:x.map((M,N)=>{const O=N+1;return h.jsxs("li",{draggable:T||void 0,onDragStart:T?()=>d(O):void 0,onDragOver:T?k=>{k.preventDefault(),b(O)}:void 0,onDrop:T?k=>{k.preventDefault(),K(O)}:void 0,onDragEnd:T?R:void 0,className:q("flex items-center gap-1.5 rounded-md px-1.5 py-1 transition",T&&"cursor-grab",u===O&&"opacity-40",f===O&&u!==O&&"ring-2 ring-accent"),children:[T&&h.jsx("span",{className:"shrink-0 text-default-400",children:h.jsx(Ym,{})}),h.jsx("span",{className:"min-w-0 flex-1 text-sm",children:M.props.children}),y&&h.jsx("button",{type:"button",onClick:()=>y(O,0),"aria-label":"Make default download",className:"shrink-0 rounded p-0.5 text-default-500 transition hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent",children:h.jsx(Gm,{})}),v&&h.jsx("button",{type:"button",onClick:()=>v(O),"aria-label":"Edit link",className:"shrink-0 rounded p-0.5 text-default-500 transition hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent",children:h.jsx(yl,{})}),g&&h.jsx("button",{type:"button",onClick:()=>g(O),"aria-label":"Remove option",className:"shrink-0 rounded p-0.5 text-default-500 transition hover:text-danger focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent",children:h.jsx(qm,{})})]},O)})}):h.jsx("p",{className:"px-1.5 py-1 text-sm text-default-500",children:"No other options yet."}),p&&h.jsx("button",{type:"button",onClick:p,className:"mt-1 w-full rounded-md px-1.5 py-1 text-left text-sm font-medium text-accent transition hover:bg-default-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent",children:"+ Add option"})]})]})]})}const eg=Object.assign(Zm,{Item:Lc});function tg(t,e,n){const[r,o]=a.useState(e),i=t!==void 0,l=i?t:r,s=a.useCallback(c=>{i||o(c),n==null||n(c)},[i,n]);return[l,s]}const Ac=3,ng="#3ABF84",rg="#34B07A",og="#0B7A47",ig={caution:Cn.caution,reminder:"Reminder",note:Cn.note};function lg(){return h.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",className:"size-5 shrink-0 text-danger",children:h.jsx("path",{d:"M10.29 3.86 1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0ZM12 9v4M12 17h.01"})})}function sg(){return h.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",className:"size-5 shrink-0 text-default-500",children:[h.jsx("circle",{cx:"12",cy:"12",r:"9"}),h.jsx("path",{d:"M12 16v-4M12 8h.01"})]})}function ag(){return h.jsx("span",{"aria-hidden":"true",className:"mt-0.5 flex size-6 shrink-0 items-center justify-center rounded bg-default-100",children:h.jsx("svg",{viewBox:"0 0 24 24",fill:"currentColor",className:"size-3.5 text-default-500",children:h.jsx("path",{d:"M16 12V4h1V3H7v1h1v8l-2 2v1h5.2c-.2.6-.3 1.2-.3 1.8 0 2.2 1.8 4 4 4s4-1.8 4-4c0-.6-.1-1.2-.3-1.8H18v-1l-2-2z"})})})}function cg(){return h.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",className:"size-7",children:h.jsx("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4M17 8l-5-5-5 5M12 3v12"})})}function Oc(){return h.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2.5,strokeLinecap:"round",strokeLinejoin:"round",className:"size-3",children:h.jsx("path",{d:"M18 6 6 18M6 6l12 12"})})}function ug(){return h.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",className:"size-4",children:h.jsx("path",{d:"M12 20h9M16.5 3.5a2.121 2.121 0 0 1 3 3L7 19l-4 1 1-4Z"})})}function dg(){return h.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",className:"size-4",children:h.jsx("path",{d:"M6 2v14a2 2 0 0 0 2 2h14M2 6h14a2 2 0 0 1 2 2v14"})})}function fg(){return h.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",fill:"currentColor",className:"size-3.5",children:[h.jsx("circle",{cx:"9",cy:"6",r:"1.4"}),h.jsx("circle",{cx:"15",cy:"6",r:"1.4"}),h.jsx("circle",{cx:"9",cy:"12",r:"1.4"}),h.jsx("circle",{cx:"15",cy:"12",r:"1.4"}),h.jsx("circle",{cx:"9",cy:"18",r:"1.4"}),h.jsx("circle",{cx:"15",cy:"18",r:"1.4"})]})}function hg(t){return a.isValidElement(t)?t.type===ir?!0:typeof t.type=="function"&&t.type[Do]===!0:!1}function vl(t,e){return t.type===ir?h.jsx(Ic,{src:t.props.src,type:t.props.type,annotations:t.props.annotations,displayRegion:t.props.displayRegion,className:e}):a.cloneElement(t,{thumbnailPreview:!0,className:e})}function Fc(t){return a.isValidElement(t)&&t.type===Bc}function pg(t){return a.isValidElement(t)?a.Children.toArray(t.props.children).filter(Fc).length:0}function bg(t,e=!1){let n=null,r=null;for(const i of a.Children.toArray(t))a.isValidElement(i)&&(i.type===jc&&(n=i.props.children),i.type===_c&&(r=i));const o=a.Children.toArray(n).filter(hg);return pg(r),{figures:o.slice(0,Ac),bullets:r}}function jc(t){return null}function _c({children:t,className:e,editing:n}){const[r,o]=a.useState(null),[i,l]=a.useState(null);if(!n)return h.jsx("ul",{className:q("flex flex-col gap-2",e),children:t});const{onAddBullet:s,onRemoveBullet:c,onReorderBullet:u}=n,d=a.Children.toArray(t).filter(Fc),f=u!=null&&d.length>1,b=c!=null&&d.length>1,p=()=>{o(null),l(null)},g=y=>{r!=null&&r!==y&&(u==null||u(r,y)),p()};return h.jsxs("ul",{className:q("flex flex-col gap-2",e),children:[d.map((y,v)=>a.cloneElement(y,{key:y.key??v,__edit:{canReorder:f,isDragging:r===v,isOver:i===v&&r!==v,onRemove:b?()=>c==null?void 0:c(v):void 0,onDragStart:()=>o(v),onDragOver:()=>l(v),onDrop:()=>g(v),onDragEnd:p}})),s&&h.jsx("li",{className:"list-none",children:h.jsx("button",{type:"button",onClick:s,className:"rounded-md px-1 py-0.5 text-sm font-medium text-default-500 transition hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent",children:"+ New bullet"})})]})}function Bc(t){const{variant:e="dot",color:n="GREY",label:r,hideLabel:o=!1,onMarkerPress:i,markerAriaLabel:l,children:s,className:c}=t,u=t.__edit,[d,f]=a.useState(!1);let b=null,p;if(e==="dot")b=i?h.jsx("button",{type:"button",onClick:i,"aria-label":l??"Change bullet style",className:"mt-1.5 size-2 shrink-0 cursor-pointer rounded-full outline-none transition hover:ring-2 hover:ring-accent focus-visible:ring-2 focus-visible:ring-accent",style:{backgroundColor:je[n]}}):h.jsx("span",{"aria-hidden":"true",className:"mt-1.5 size-2 shrink-0 rounded-full",style:{backgroundColor:je[n]}}),p=h.jsx("span",{className:"flex-1",children:s});else if(e==="button")b=i?h.jsx("button",{type:"button",onClick:i,"aria-label":l??"Change bullet style",className:"size-2 shrink-0 cursor-pointer rounded-full bg-default-300 outline-none transition hover:ring-2 hover:ring-accent focus-visible:ring-2 focus-visible:ring-accent"}):null,p=h.jsx("div",{className:"min-w-0 flex-1",children:s});else{const P=r??ig[e],T=e==="caution"?h.jsx(lg,{}):e==="reminder"?h.jsx(ag,{}):h.jsx(sg,{});b=i?h.jsx("button",{type:"button",onClick:i,"aria-label":l??"Change bullet style",className:"shrink-0 cursor-pointer rounded outline-none transition hover:opacity-70 focus-visible:ring-2 focus-visible:ring-accent",children:T}):T,p=h.jsxs("span",{className:"flex-1",children:[!o&&h.jsxs(h.Fragment,{children:[h.jsxs("span",{className:"font-semibold",children:[P,":"]})," "]}),s]})}const g=q("flex gap-2.5",e==="button"&&"items-center",e==="caution"&&"text-danger",c);if(!u)return h.jsxs("li",{className:g,children:[b,p]});const{canReorder:y,isDragging:v,isOver:w,onRemove:x}=u;return h.jsxs("li",{className:q("group rounded-md",g,v&&"opacity-40",w&&"ring-2 ring-accent"),draggable:y&&d?!0:void 0,onDragStart:y?P=>{P.dataTransfer.effectAllowed="move",u.onDragStart()}:void 0,onDragOver:y?P=>{P.preventDefault(),P.dataTransfer.dropEffect="move",u.onDragOver()}:void 0,onDrop:y?P=>{P.preventDefault(),u.onDrop()}:void 0,onDragEnd:y?()=>{f(!1),u.onDragEnd()}:void 0,children:[y&&h.jsx("span",{"aria-hidden":"true",onPointerDown:()=>f(!0),onPointerUp:()=>f(!1),className:"mt-1 shrink-0 cursor-grab text-default-400 transition hover:text-default-500",children:h.jsx(fg,{})}),b,p,x&&h.jsx("button",{type:"button",onClick:x,"aria-label":"Remove bullet",className:"mt-1 shrink-0 rounded p-0.5 text-default-400 opacity-0 transition hover:text-danger focus-visible:opacity-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent group-hover:opacity-100",children:h.jsx(Oc,{})})]})}function mg(){return h.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:3,strokeLinecap:"round",strokeLinejoin:"round",className:"size-4",children:h.jsx("path",{d:"m5 12 5 5 9-11"})})}function gg({figures:t,bullets:e,mediaEditing:n}){const r=n!=null,[o,i]=a.useState(0),[l,s]=a.useState(null),[c,u]=a.useState(null),d=(n==null?void 0:n.activeIndex)??o,f=t[d]??t[0],p=((f==null?void 0:f.props.type)??"image")==="image",g=R=>{var K;i(R),(K=n==null?void 0:n.onSelectImage)==null||K.call(n,R)},y=r&&(n==null?void 0:n.onReorderImage)!=null&&t.length>1,v=()=>{s(null),u(null)},w=R=>{var K;l!=null&&l!==R&&((K=n==null?void 0:n.onReorderImage)==null||K.call(n,l,R)),v()},x=r&&((n==null?void 0:n.canAddImage)??!0)&&t.length>=1&&t.length<Ac,P=r?t.length>=1:t.length>1,T="aspect-[4/3] w-28 sm:w-26 lg:w-30";return h.jsxs("div",{className:"grid grid-cols-1 gap-6 sm:grid-cols-2",children:[h.jsx("div",{className:"min-w-0",children:f?r?h.jsxs("div",{className:"group relative",children:[a.cloneElement(f,{className:q("w-full",f.props.className),zoomable:!1}),h.jsxs("div",{className:"absolute inset-0 flex items-center justify-center gap-2 rounded-lg opacity-0 transition group-hover:bg-foreground/40 group-hover:opacity-100 focus-within:bg-foreground/40 focus-within:opacity-100",children:[p&&h.jsxs("button",{type:"button",onClick:()=>{var R;return(R=n==null?void 0:n.onEditAnnotations)==null?void 0:R.call(n,d)},className:"flex items-center gap-1.5 rounded-md bg-background/90 px-2.5 py-1.5 text-sm font-semibold text-foreground shadow transition hover:bg-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent",children:[h.jsx(ug,{}),"Edit annotations"]}),p&&(n==null?void 0:n.onEditCrop)&&h.jsxs("button",{type:"button",onClick:()=>{var R;return(R=n==null?void 0:n.onEditCrop)==null?void 0:R.call(n,d)},className:"flex items-center gap-1.5 rounded-md bg-background/90 px-2.5 py-1.5 text-sm font-semibold text-foreground shadow transition hover:bg-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent",children:[h.jsx(dg,{}),"Adjust crop"]})]})]}):a.cloneElement(f,{className:q("w-full",f.props.className)}):r&&h.jsxs("button",{type:"button",onClick:()=>{var R;return(R=n==null?void 0:n.onAddImage)==null?void 0:R.call(n)},className:"flex aspect-[4/3] w-full flex-col items-center justify-center gap-2 rounded-lg border-2 border-dashed border-default bg-default-soft text-default-500 transition hover:border-accent hover:text-accent focus-visible:border-accent focus-visible:text-accent focus-visible:outline-none",children:[h.jsx(cg,{}),h.jsx("span",{className:"text-sm font-medium",children:"Add image"})]})}),h.jsxs("div",{className:"flex min-w-0 flex-col gap-4",children:[(P||x)&&h.jsxs("div",{className:"flex flex-wrap gap-2",role:"group","aria-label":"Step images",children:[t.map((R,K)=>r?h.jsxs("div",{className:q("relative rounded-md transition-shadow",y&&"cursor-grab",l===K&&"opacity-40",c===K&&l!==K&&"ring-2 ring-accent ring-offset-2 ring-offset-background"),draggable:y||void 0,onDragStart:y?M=>{M.dataTransfer.effectAllowed="move",s(K)}:void 0,onDragOver:y?M=>{M.preventDefault(),M.dataTransfer.dropEffect="move",u(K)}:void 0,onDrop:y?M=>{M.preventDefault(),w(K)}:void 0,onDragEnd:y?v:void 0,children:[h.jsx("button",{type:"button",className:q("block overflow-hidden rounded-md border-2 transition-[box-shadow,opacity,border-color]",K===d?"border-accent shadow-md":"border-default opacity-80 hover:opacity-100"),onClick:()=>g(K),"aria-label":`Image ${K+1}`,"aria-pressed":K===d,children:vl(R,T)}),h.jsx("button",{type:"button",onClick:()=>{var M;return(M=n==null?void 0:n.onRemoveImage)==null?void 0:M.call(n,K)},"aria-label":`Remove image ${K+1}`,className:"absolute -right-1.5 -top-1.5 flex size-5 items-center justify-center rounded-full bg-foreground text-background shadow transition hover:bg-danger focus-visible:bg-danger focus-visible:outline-none",children:h.jsx(Oc,{})})]},R.key??R.props.src??K):h.jsx("button",{type:"button",className:q("overflow-hidden rounded-md border-2 transition-[box-shadow,opacity,border-color]",K===d?"border-accent shadow-md":"border-default opacity-80 hover:opacity-100"),onMouseEnter:()=>g(K),onFocus:()=>g(K),"aria-label":`Image ${K+1}`,"aria-pressed":K===d,children:vl(R,T)},R.key??R.props.src??K)),x&&h.jsx("button",{type:"button",onClick:()=>{var R;return(R=n==null?void 0:n.onAddImage)==null?void 0:R.call(n)},"aria-label":"Add image",className:q(T,"flex items-center justify-center rounded-md border-2 border-dashed border-default text-default-500 transition hover:border-accent hover:text-accent focus-visible:border-accent focus-visible:text-accent focus-visible:outline-none"),children:h.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",className:"size-6",children:h.jsx("path",{d:"M12 5v14M5 12h14"})})})]}),e]})]})}function yg({number:t,title:e,isCompleted:n,defaultCompleted:r=!1,onCompletedChange:o,completable:i=!0,mediaEditing:l,children:s,className:c}){const[u,d]=tg(n,r,o),f=a.useId(),{figures:b,bullets:p}=bg(s,l!=null);return h.jsxs("section",{"aria-labelledby":e!=null?f:void 0,"data-completed":u||void 0,className:q("flex flex-col gap-4 transition-opacity",u&&"opacity-60",c),children:[h.jsxs("header",{className:"flex flex-col gap-3 sm:flex-row sm:items-center",children:[h.jsxs("div",{className:"flex min-w-0 items-center gap-3 sm:flex-1",children:[t!=null&&h.jsx("span",{className:q("flex size-8 shrink-0 items-center justify-center rounded-md text-sm font-bold tabular-nums",u?"bg-success text-success-foreground":"bg-foreground text-background"),children:u?h.jsx(mg,{}):t}),e!=null&&h.jsx("h3",{id:f,className:"min-w-0 flex-1 text-lg font-semibold leading-tight",children:e})]}),i&&h.jsx(yb,{variant:u?"primary":"secondary",size:"lg",onPress:()=>d(!u),"aria-pressed":u,className:q("ml-auto shrink-0",u&&"guide-step-complete-button"),style:u?{"--guide-step-complete-bg":ng,"--guide-step-complete-bg-hover":rg,"--guide-step-complete-checkbox":og}:void 0,children:h.jsx(gn,{isSelected:u,isReadOnly:!0,"aria-hidden":!0,className:"pointer-events-none gap-2 text-inherit",children:h.jsxs(gn.Content,{className:"flex items-center gap-2 whitespace-nowrap",children:[h.jsx(gn.Control,{children:h.jsx(gn.Indicator,{})}),"Mark complete"]})})})]}),h.jsx(gg,{figures:b,bullets:p,mediaEditing:l})]})}const vg=Object.assign(yg,{Media:jc,Bullets:_c,Bullet:Bc});function xg(t){return a.isValidElement(t)}function $g({children:t,showProgress:e=!0,onProgressChange:n,className:r}){const o=a.Children.toArray(t).filter(xg),i=o.length,[l,s]=a.useState(()=>Object.fromEntries(o.map((u,d)=>[u.props.number??d+1,!!(u.props.defaultCompleted??u.props.isCompleted)]))),c=Object.values(l).filter(Boolean).length;return a.useEffect(()=>{n==null||n({completed:c,total:i})},[c,i,n]),h.jsxs("div",{className:q("flex flex-col gap-8",r),children:[e&&i>0&&h.jsx("div",{className:"sticky top-2 mx-2 z-10",children:h.jsx(Ot,{className:"w-full px-6 py-4",children:h.jsxs(yn,{value:c,maxValue:i,"aria-label":"Guide progress",className:"flex flex-col gap-1.5",children:[h.jsxs("div",{className:"flex items-center justify-between text-sm text-default-500",children:[h.jsx("span",{children:"Guide Progress"}),h.jsxs(yn.Output,{children:[c," / ",i," steps"]})]}),h.jsx(yn.Track,{className:"h-2 overflow-hidden rounded-full bg-default-soft",children:h.jsx(yn.Fill,{className:"h-full rounded-full bg-success transition-[width]"})})]})})}),h.jsx("ol",{className:"flex flex-col",children:o.map((u,d)=>{const f=u.props.number??d+1;return h.jsxs("li",{children:[a.cloneElement(u,{number:f,isCompleted:l[f]??!1,onCompletedChange:b=>{var p,g;s(y=>({...y,[f]:b})),(g=(p=u.props).onCompletedChange)==null||g.call(p,b)}}),d<o.length-1&&h.jsx(jb,{className:"my-8"})]},u.key??f)})})]})}function wg({title:t,heroImage:e,heroImageAlt:n,difficulty:r,timeEstimate:o,meta:i,className:l}){const s=r!=null||o!=null,c=e!=null;return h.jsxs("header",{className:q("flex flex-col gap-4 border-b border-default pb-6 md:[grid-area:header]",c&&"sm:flex-row sm:items-center sm:gap-6",l),children:[c&&h.jsx("div",{className:"aspect-[4/3] h-32 shrink-0 overflow-hidden rounded-lg border border-default bg-default-100",children:h.jsx("img",{src:e,alt:n??"",className:"size-full object-cover"})}),h.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-4",children:[h.jsxs("div",{className:"flex flex-col gap-1.5",children:[h.jsx("h1",{className:"text-3xl font-bold tracking-tight",children:t}),i!=null&&h.jsx("div",{className:"text-sm text-default-500",children:i})]}),s&&h.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[r!=null&&h.jsx(Tc,{difficulty:r}),o!=null&&h.jsx(_n,{variant:"soft",color:"default",children:h.jsx(_n.Label,{children:o})})]})]})]})}function Eg({children:t,className:e}){return h.jsx("div",{className:q("min-w-0 md:[grid-area:intro]",e),children:h.jsx("div",{className:"max-w-prose text-default-700",children:t})})}function Cg({children:t,className:e}){return h.jsx("aside",{className:q("min-w-0 md:[grid-area:sidebar]",e),children:h.jsx("div",{className:"flex flex-col gap-4",children:t})})}function Sg({children:t,className:e}){return h.jsx("main",{className:q("min-w-0 w-full md:[grid-area:main]",e),children:t})}const Pg=Object.assign(function({children:e,className:n}){return h.jsx("div",{className:q("mx-auto grid w-full max-w-6xl grid-cols-1 gap-x-8 gap-y-8 md:grid-cols-[minmax(0,1fr)_20rem] md:[grid-template-areas:'header_header'_'intro_sidebar'_'main_main']",n),children:e})},{Header:wg,Intro:Eg,Sidebar:Cg,Content:Sg});exports.COLORS=je;exports.Callout=ym;exports.DISPLAY_REGION_ASPECT=Vn;exports.DifficultyBadge=Tc;exports.GuideLayout=Pg;exports.GuideStep=vg;exports.GuideStepList=$g;exports.LinkButton=eg;exports.MIN_REGION_WIDTH=Mo;exports.MediaCropEditor=Vm;exports.MediaFigure=ir;exports.MediaFigureThumbnail=Ic;exports.ToolList=Um;exports.calloutTypeColor=xl;exports.calloutTypeHex=$l;exports.calloutTypeLabel=Cn;exports.centeredDisplayRegion=Rc;exports.clampDisplayRegion=nn;exports.displayRegionHeight=ct;exports.hexToRgba=ot;exports.markerTextColor=Hn;exports.mediaFigureType=Do;
|
|
29
29
|
//# sourceMappingURL=diy-guides-ui.cjs.map
|