ryugi-artifacts 1.101.1 → 1.102.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.
Files changed (111) hide show
  1. package/dist/cli.cjs +184 -211
  2. package/dist/server.cjs +284 -284
  3. package/dist/viewer/{ActionBar-DaoI4VYb.js → ActionBar-DFtKepA7.js} +1 -1
  4. package/dist/viewer/{ActionIcon-IwUreXk2.js → ActionIcon-BmG7lBfd.js} +1 -1
  5. package/dist/viewer/{AgentStatusPill-BXlclvhK.js → AgentStatusPill-Dr0IG63t.js} +1 -1
  6. package/dist/viewer/ArtboardLayout-Csu2pQ-T.js +14 -0
  7. package/dist/viewer/{ArtifactList-QlzeIux3.js → ArtifactList-DsM43F_P.js} +1 -1
  8. package/dist/viewer/{ArtifactModal-CHIAYGtG.js → ArtifactModal-DjgA_mk-.js} +1 -1
  9. package/dist/viewer/{Avatar-BDQUXxFX.js → Avatar-OGhW38pt.js} +1 -1
  10. package/dist/viewer/{BottomSheet-Bzcqth-G.js → BottomSheet-wczv_s4I.js} +1 -1
  11. package/dist/viewer/{Canvas-DTjkL4l-.js → Canvas-C9BgB5Vk.js} +1 -1
  12. package/dist/viewer/{CloudLegalNotice-CZlQtXSs.js → CloudLegalNotice-9Jrnaiz1.js} +1 -1
  13. package/dist/viewer/{CompositeItem-B02fdomI.js → CompositeItem-BLrDOuic.js} +1 -1
  14. package/dist/viewer/{DocumentExportMenu-CrwpoVbV.js → DocumentExportMenu-CxdmnnnP.js} +1 -1
  15. package/dist/viewer/DocumentLayout-Byaaj0lf.js +2 -0
  16. package/dist/viewer/{DocumentPage-B54nbgTd.js → DocumentPage-CrVLG3xw.js} +1 -1
  17. package/dist/viewer/{DraggablePanel-B9erey9g.js → DraggablePanel-D2U_w1Mh.js} +1 -1
  18. package/dist/viewer/{DropdownMenu-CLWAvl9N.js → DropdownMenu-D8PSw8rX.js} +1 -1
  19. package/dist/viewer/GroupVerdict-B4YWlFtx.js +1 -0
  20. package/dist/viewer/{HtmlLayout-NqgCK6jF.js → HtmlLayout-p52oMbkD.js} +1 -1
  21. package/dist/viewer/{Input-CXPWZdDR.js → Input-BPP1bIR7.js} +1 -1
  22. package/dist/viewer/{MenuTrigger-BaobSqW9.js → MenuTrigger-CJXtjCtF.js} +1 -1
  23. package/dist/viewer/{PhoneArtboardBar-BZgADzrh.js → PhoneArtboardBar-BLmC5n92.js} +1 -1
  24. package/dist/viewer/{PhoneSheet-dw-rFLgO.js → PhoneSheet-RzYP9raH.js} +1 -1
  25. package/dist/viewer/{Popover-B9lMVJ2l.js → Popover-CI2fBO-6.js} +1 -1
  26. package/dist/viewer/{PreviewArtifactLayout-fZ6ozS9s.js → PreviewArtifactLayout-BKcZov33.js} +1 -1
  27. package/dist/viewer/{PreviewLayout-BXCFAs-o.js → PreviewLayout-h2V6IEPR.js} +2 -2
  28. package/dist/viewer/{PublishMenu-Dgh6Wptu.js → PublishMenu-I7yHr3IR.js} +1 -1
  29. package/dist/viewer/{ReportLayout-yp8piQO5.js → ReportLayout-C1A2NXor.js} +1 -1
  30. package/dist/viewer/{RyugiMark-BiAqtaVe.js → RyugiMark-D6HsF-eP.js} +1 -1
  31. package/dist/viewer/{Segmented-CdzxVAKH.js → Segmented-DWi3WMbI.js} +1 -1
  32. package/dist/viewer/{Select-BB-VbbBI.js → Select-C3XqBQ1N.js} +1 -1
  33. package/dist/viewer/{SelectScrollUpArrow-hqYMuZNG.js → SelectScrollUpArrow-DccpygLx.js} +1 -1
  34. package/dist/viewer/{SideDrawer-DwLywseU.js → SideDrawer-DtqMHMZa.js} +1 -1
  35. package/dist/viewer/{SlidesLayout-re7d1okK.js → SlidesLayout-_aL_Wmn0.js} +3 -3
  36. package/dist/viewer/{SnapshotDocument-CXWqg1HB.js → SnapshotDocument-BmyM7kKr.js} +1 -1
  37. package/dist/viewer/{SplitFrame-vPdtsas0.js → SplitFrame-DY4Pomig.js} +1 -1
  38. package/dist/viewer/{StoryboardLayout-DR8AiB6H.js → StoryboardLayout-DWmYoJbh.js} +1 -1
  39. package/dist/viewer/{StoryboardRender-DPKTwVhG.js → StoryboardRender-Bz4HnHfj.js} +1 -1
  40. package/dist/viewer/{ThreadView-BTGHIoSR.js → ThreadView-uYestFjK.js} +1 -1
  41. package/dist/viewer/VerifyLayout-B9e4RHAZ.css +1 -0
  42. package/dist/viewer/VerifyLayout-D3L_Nyhx.js +1 -0
  43. package/dist/viewer/{VirtualizedEditor-uWe43zaI-DO07XbEt.js → VirtualizedEditor-uWe43zaI-BRjchUcR.js} +1 -1
  44. package/dist/viewer/{VirtualizedRenderer-C_d95FXi-DU8RsBFm.js → VirtualizedRenderer-C_d95FXi-BiKuicf_.js} +1 -1
  45. package/dist/viewer/{WarningsBadge-B7MNPLPr.js → WarningsBadge-t_H3hA4c.js} +1 -1
  46. package/dist/viewer/{WhiteboardEditor-cZ32fLqJ-DOs86M1L.js → WhiteboardEditor-cZ32fLqJ-DHGUDfT6.js} +1 -1
  47. package/dist/viewer/{WhiteboardLayout-CldY6e5F.js → WhiteboardLayout-BwzWcl_v.js} +1 -1
  48. package/dist/viewer/{WritingCursor-BABEG2fL.js → WritingCursor-BgZ_CXA8.js} +1 -1
  49. package/dist/viewer/{api-xzcZ90xG.js → api-DnU71xnS.js} +1 -1
  50. package/dist/viewer/{artifact-list-Bt_sL54c.js → artifact-list-DLC6w9uW.js} +1 -1
  51. package/dist/viewer/{auto-publish-Dd4zbfEe.js → auto-publish-I637YfTf.js} +1 -1
  52. package/dist/viewer/{channel-CQpx5qvc.js → channel-BzQy5yb9.js} +3 -3
  53. package/dist/viewer/{crop-encode-BDvTt5Vy.js → crop-encode-DKOXrrBx.js} +1 -1
  54. package/dist/viewer/{dist-D34no-tO.js → dist-B4EO2CPv.js} +1 -1
  55. package/dist/viewer/{dist-Cz9DVc36.js → dist-B8JYmYN_.js} +1 -1
  56. package/dist/viewer/{dist-BM8D4wxB.js → dist-BHAJ5J6a.js} +1 -1
  57. package/dist/viewer/{dist-UseR4iMS.js → dist-BI7tUIez.js} +1 -1
  58. package/dist/viewer/{dist-DI78t5YU.js → dist-BL7gVqxi.js} +1 -1
  59. package/dist/viewer/{dist-lDZvirGj.js → dist-BP8ay-gZ.js} +1 -1
  60. package/dist/viewer/{dist-9OwKoVGd.js → dist-Bo83M38T.js} +1 -1
  61. package/dist/viewer/{dist-DmrkYwaF.js → dist-CO1p9q1Z.js} +1 -1
  62. package/dist/viewer/{dist-Cm0cC0tb.js → dist-CVt5MFeC.js} +1 -1
  63. package/dist/viewer/{dist-BtM07i2r.js → dist-CaBa68Xm.js} +1 -1
  64. package/dist/viewer/{dist-B-tWmOys.js → dist-Cdwc8_lc.js} +1 -1
  65. package/dist/viewer/{dist-D1FWA-fT.js → dist-ChnAy31A.js} +1 -1
  66. package/dist/viewer/{dist-CgIAVrq7.js → dist-Ckvl87v1.js} +1 -1
  67. package/dist/viewer/{dist-Hc2Vv4zd.js → dist-DBpGO_S5.js} +1 -1
  68. package/dist/viewer/{dist-4LVlWNop.js → dist-DCj5-otB.js} +1 -1
  69. package/dist/viewer/{dist-mgDFt62N.js → dist-DJbqyYbr.js} +1 -1
  70. package/dist/viewer/{dist-B5LJqjvh.js → dist-DSiP1sno.js} +1 -1
  71. package/dist/viewer/{dist-CtGDB-wX.js → dist-DrVA7ut5.js} +1 -1
  72. package/dist/viewer/{dist-Diw_9UWJ.js → dist-DxrXYjGy.js} +1 -1
  73. package/dist/viewer/{dist-D06bdxH3.js → dist-EEnCrnE5.js} +1 -1
  74. package/dist/viewer/{dist-9Lzp4Rd-.js → dist-UhLZmzFt.js} +1 -1
  75. package/dist/viewer/{dist-DfsT_xnK.js → dist-j0019Ujc.js} +1 -1
  76. package/dist/viewer/{dist-C54nildb.js → dist-jEPSRJix.js} +2 -2
  77. package/dist/viewer/{dist-BydXyrl8.js → dist-r4fmjkHw.js} +1 -1
  78. package/dist/viewer/{editor-B_HYr2z-.js → editor-2avuG1le.js} +4 -4
  79. package/dist/viewer/{icons-ChAUtLMm.js → icons-DWimed9E.js} +1 -1
  80. package/dist/viewer/index.html +3 -3
  81. package/dist/viewer/index.js +2 -2
  82. package/dist/viewer/index5.css +151 -76
  83. package/dist/viewer/{labels-DjqPCIHI.js → labels-6JqNXprT.js} +1 -1
  84. package/dist/viewer/{local-split-host-KqxKoMai.js → local-split-host-kaL99YNI.js} +1 -1
  85. package/dist/viewer/{parseTrigger-BeMNY59u.js → parseTrigger-dhvXKZoS.js} +1 -1
  86. package/dist/viewer/preview.html +5 -5
  87. package/dist/viewer/preview.js +1 -1
  88. package/dist/viewer/{printDocument-QNAzhA0H.js → printDocument-Bob6oDU4.js} +1 -1
  89. package/dist/viewer/{read-resolutions-CzPEmd5y.js → read-resolutions-iX7kD7Xz.js} +1 -1
  90. package/dist/viewer/{ref-FQJywQow.js → ref-CG33owdM.js} +1 -1
  91. package/dist/viewer/{route-B2h882nY.js → route-CkVEiakc.js} +2 -2
  92. package/dist/viewer/{route-messages-DFDQaon_.js → route-messages-BblikCub.js} +1 -1
  93. package/dist/viewer/{settings-CTEFThwR.js → settings-i1xE8pA8.js} +1 -1
  94. package/dist/viewer/{snap-5OS-TEnf.js → snap-BoMEN-8e.js} +1 -1
  95. package/dist/viewer/{split-JiBjxt0D.js → split-C-_Iw2K0.js} +2 -2
  96. package/dist/viewer/{stable-Bi14wDjC.js → stable-DqmWGuUk.js} +1 -1
  97. package/dist/viewer/{tokens.stylex-CAceICLC.js → tokens.stylex-No4bA13s.js} +1 -1
  98. package/dist/viewer/{url-D0VxSNRj.js → url-64-774qp.js} +1 -1
  99. package/dist/viewer/{useArtifactFeed-r18INfvY.js → useArtifactFeed-CojHZEow.js} +1 -1
  100. package/dist/viewer/{useCloudStatus-ompNmqUd.js → useCloudStatus-BngR4Pm7.js} +1 -1
  101. package/dist/viewer/{useLayerZIndex-BpXL1Bnv.js → useLayerZIndex-t4BgGwYi.js} +1 -1
  102. package/dist/viewer/{useStoryboardData-BCgoJ5Tw.js → useStoryboardData-B1gfG0bU.js} +1 -1
  103. package/dist/viewer/{useTranslation-BP_FgCbX.js → useTranslation-ByuUeDLl.js} +1 -1
  104. package/dist/viewer/{view-DMJ8kjoJ.js → view-BnFGOXLi.js} +1 -1
  105. package/dist/viewer/{viewport-CFJHn_Y6-9ZHQwYm6.js → viewport-CFJHn_Y6-NgtbO-g_.js} +1 -1
  106. package/package.json +1 -1
  107. package/dist/viewer/ArtboardLayout-D-qICgKk.js +0 -14
  108. package/dist/viewer/DocumentLayout-C1VgmM8R.js +0 -2
  109. package/dist/viewer/GroupVerdict-BxyH2SWZ.js +0 -1
  110. package/dist/viewer/VerifyLayout-BH4hYui6.css +0 -1
  111. package/dist/viewer/VerifyLayout-D3RJc0AE.js +0 -1
@@ -1 +1 @@
1
- import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{t}from"./react-DlmbjZJV.js";import{$t as n,Cn as r,Dr as i,Er as a,Mn as o,On as s,Or as c,Qt as l,Tn as u,Xn as d,Xt as f,Yn as p,Zn as m,Zt as h,_n as g,_r as _,an as v,fr as y,gn as b,hn as x,mn as S,nn as C,pn as w,pr as T,qt as E,rr as D,ur as O}from"./url-D0VxSNRj.js";import{t as k}from"./jsx-runtime-LKYXHABd.js";import{$ as A,A as ee,B as j,E as M,J as N,K as P,Q as F,U as I,Z as L,d as R,et as z,it as B,l as V,nt as H,rt as U,tt as W,v as te,z as ne}from"./mergeRefs-BoWyGCK7.js";import{$n as re,At as ie,Bn as ae,C as oe,Cn as se,Dn as ce,E as le,Gt as ue,I as de,It as fe,Jn as pe,K as me,Kt as he,Nt as ge,Pt as _e,R as ve,Rn as ye,S as be,Tn as G,U as K,Ut as q,Z as xe,Zn as J,an as Se,b as Ce,bn as we,cn as Te,g as Ee,i as De,l as Oe,mn as ke,wn as Ae,y as je,z as Me}from"./useLayerZIndex-BpXL1Bnv.js";import{Tt as Ne}from"./MotionConfigContext-B3czw3wn.js";import{m as Pe}from"./Popover-B9lMVJ2l.js";import{r as Fe}from"./parseTrigger-BeMNY59u.js";import{t as Ie}from"./isElementDisabled-DWHaZxJe.js";var Le={name:`copy`,size:24,node:[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]};Le.node;var Re=Ne(Le);function ze(e){let{open:t=!1,onOpenChange:n,elements:r={}}=e,i=I(),a=K()!=null,o=B(()=>new je({open:t,transitionStatus:void 0,onOpenChange:n,referenceElement:r.reference??null,floatingElement:r.floating??null,triggerElements:new be,floatingId:i,syncOnly:!1,nested:a})).current;return A(()=>{let e={open:t,floatingId:i};r.reference!==void 0&&(e.referenceElement=r.reference,e.domReferenceElement=ae(r.reference)?r.reference:null),r.floating!==void 0&&(e.floatingElement=r.floating),o.update(e)},[t,i,r.reference,r.floating,o]),o.context.onOpenChange=n,o.context.nested=a,o}var Y=e(t(),1);function Be(e){if(e==null)return``;if(typeof e==`string`)return e;try{return JSON.stringify(e)}catch{return String(e)}}var X=k();function Ve(e){return typeof e==`object`&&!!e&&Array.isArray(e.items)}function Z(e){return Ve(e?.[0])}function He(e){return Z(e)?e.flatMap(e=>e.items):e}function Ue(e){if(!Array.isArray(e))return e!=null&&`null`in e;let t=e;if(Z(t)){for(let e of t)for(let t of e.items)if(t&&t.value==null&&t.label!=null)return!0;return!1}for(let e of t)if(e&&e.value==null&&e.label!=null)return!0;return!1}function We(e,t){if(t&&e!=null)return t(e)??``;if(e&&typeof e==`object`){if(`label`in e&&e.label!=null)return String(e.label);if(`value`in e)return String(e.value)}return Be(e)}function Ge(e,t){return t&&e!=null?t(e)??``:e&&typeof e==`object`&&`value`in e&&`label`in e?Be(e.value):Be(e)}function Ke(e,t,n){function r(){return We(e,n)}if(n&&e!=null)return n(e);if(e&&typeof e==`object`&&`label`in e&&e.label!=null)return e.label;if(t&&!Array.isArray(t))return(Object.hasOwn(t,e)?t[e]:void 0)??r();if(Array.isArray(t)){let n=He(t);if(typeof e!=`object`||!e){let t=n.find(t=>t.value===e);return t&&t.label!=null?t.label:r()}if(`value`in e){let t=n.find(t=>t&&t.value===e.value);if(t&&t.label!=null)return t.label}}return r()}function qe(e,t,n){return e.reduce((e,r,i)=>(i>0&&e.push(`, `),e.push((0,X.jsx)(Y.Fragment,{children:Ke(r,t,n)},i)),e),[])}function Je(e,t,n=Object.is){let{length:r}=e;if(r!==t.length)return!1;for(let i=0;i<r;i+=1)if(!n(e[i],t[i]))return!1;return!0}function Ye(e){return e==null?void 0:`${e}-label`}function Xe(e,t){return e??t}function Ze(e){let t=Y.useRef(!0);t.current&&(t.current=!1,e())}var Qe=Y.createContext(void 0),$e=Y.createContext(void 0);function Q(){let e=Y.useContext(Qe);if(e===void 0)throw Error(F(60));return e}function et(){let e=Y.useContext($e);if(e===void 0)throw Error(F(61));return e}var tt=(e,t)=>Object.is(e,t);function $(e,t,n){return e==null||t==null?Object.is(e,t):n(e,t)}function nt(e,t,n){return Array.isArray(e)&&Array.isArray(t)?!Je(e,t,(e,t)=>$(e,t,n)):e!==t}function rt(e,t,n){return e?e.some(e=>e!==void 0&&$(t,e,n)):!1}function it(e,t,n){return e?e.findIndex(e=>e!==void 0&&$(e,t,n)):-1}function at(e,t){if(t!==tt)return n=>rt(e,n,t);let n=new Set(e);return n.delete(void 0),t=>n.has(t)&&(t!==0||e.some(e=>Object.is(t,e)))}function ot(e,t,n,r){let i=r&&Array.isArray(t)?e.findIndex(at(t,n)):it(e,t,n);return i===-1?null:i}function st(e,t,n,r,i,a){return rt(r,t,i)?a!=null&&e>a&&rt(r,n[a],i)?a:e:e===a?ot(n,r,i,!0):a}function ct(e,t,n){return e.filter(e=>!$(t,e,n))}var lt={id:e=>e.id,labelId:e=>e.labelId,modal:e=>e.modal,multiple:e=>e.multiple,disabled:e=>e.disabled,readOnly:e=>e.readOnly,required:e=>e.required,highlightItemOnHover:e=>e.highlightItemOnHover,items:e=>e.items,itemToStringLabel:e=>e.itemToStringLabel,isItemEqualToValue:e=>e.isItemEqualToValue,value:e=>e.value,hasSelectedValue:e=>{let{value:t,multiple:n,itemToStringValue:r}=e;return t==null?!1:n&&Array.isArray(t)?t.length>0:Ge(t,r)!==``},hasNullItemLabel:(e,t)=>t?Ue(e.items):!1,open:e=>e.open,mounted:e=>e.mounted,forceMount:e=>e.forceMount,transitionStatus:e=>e.transitionStatus,openMethod:e=>e.openMethod,activeIndex:e=>e.activeIndex,selectedIndex:e=>e.selectedIndex,isActive:(e,t)=>e.activeIndex===t,isSelected:(e,t)=>{let n=e.isItemEqualToValue,r=e.value;return e.multiple?Array.isArray(r)&&r.some(e=>$(t,e,n)):$(t,r,n)},isSelectedByFocus:(e,t)=>e.selectedIndex===t,popupProps:e=>e.popupProps,triggerProps:e=>e.triggerProps,itemRoot:e=>e.itemRoot,triggerElement:e=>e.triggerElement,positionerElement:e=>e.positionerElement,listElement:e=>e.listElement,popupSide:e=>e.popupSide,scrollUpArrowVisible:e=>e.scrollUpArrowVisible,scrollDownArrowVisible:e=>e.scrollDownArrowVisible,hasScrollArrows:e=>e.hasScrollArrows};function ut(e){let{id:t,value:n,defaultValue:i=null,onValueChange:a,open:o,defaultOpen:s=!1,onOpenChange:d,name:f,form:p,autoComplete:m,disabled:g=!1,readOnly:v=!1,required:b=!1,modal:x=!0,actionsRef:D,inputRef:O,onOpenChangeComplete:k,items:M,multiple:P=!1,itemToStringLabel:F,itemToStringValue:I,isItemEqualToValue:R=tt,highlightItemOnHover:V=!0,children:ne}=e,{clearErrors:re}=h(),{setDirty:ie,setTouched:ae,setFocused:ce,validityData:ue,setFilled:fe,name:pe,disabled:me,validation:he,validationMode:ye}=C(),be=E({id:t}),G=me||g,K=pe??f,[q,xe]=c({controlled:n,default:P?i??z:i,name:`Select`,state:`value`}),[J,Se]=c({controlled:o,default:s,name:`Select`,state:`open`}),we=Y.useRef([]),Te=Y.useRef([]),Ee=Y.useRef(null),De=Y.useRef(null),Oe=Y.useRef(0),ke=Y.useRef(null),Ae=Y.useRef([]),je=Y.useRef(!1),Me=Y.useRef(null),Ne=Y.useRef(null),Fe=Y.useRef({allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1,dragY:0}),Le=Y.useRef(!1),Re=Y.useRef(q),{openMethod:Be,triggerProps:Ve}=r(J),Z=B(()=>new Ce({id:be,labelId:void 0,modal:x,multiple:P,disabled:G,readOnly:v,required:b,highlightItemOnHover:V,itemToStringLabel:F,itemToStringValue:I,isItemEqualToValue:R,value:q,open:J,mounted:J,transitionStatus:void 0,items:M,forceMount:!1,openMethod:null,activeIndex:null,selectedIndex:null,popupProps:W,triggerProps:W,itemRoot:{props:W,multiple:P,disabled:G,readOnly:v,isItemEqualToValue:R},triggerElement:null,positionerElement:null,listElement:null,popupSide:null,scrollUpArrowVisible:!1,scrollDownArrowVisible:!1,hasScrollArrows:!1},{setValue:H,setOpen:H,handleScrollArrowVisibility:H,onOpenChangeComplete:H,listRef:we,popupRef:Ee,scrollHandlerRef:De,scrollArrowsMountedCountRef:Oe,valueRef:ke,valuesRef:Ae,labelsRef:Te,typingRef:je,selectionRef:Fe,firstItemTextRef:Me,selectedItemTextRef:Ne,alignItemWithTriggerActiveRef:Le,initialValueRef:Re},lt)).current,[He,Ue]=Y.useState(!1),{mounted:Ke,transitionStatus:qe,forceUnmount:Je}=de({open:J,ref:Ee,preventUnmountOnClose:He,setPreventUnmountOnClose:Ue,onUnmount(){Z.update({activeIndex:null,openMethod:null,scrollUpArrowVisible:!1,scrollDownArrowVisible:!1}),k?.(!1)}}),Ye=Z.useState(`activeIndex`),Xe=Z.useState(`selectedIndex`),Q=Z.useState(`triggerElement`),et=Z.useState(`positionerElement`),$=Pe(Be),rt=Be??$,it=Y.useMemo(()=>P?``:Ge(q,I),[P,q,I]),at=Y.useMemo(()=>P&&Array.isArray(q)?q.map(e=>Ge(e,I)):Ge(q,I),[P,q,I]),st=se(Q),ct=U(()=>at);l(st,be,q,ct,!G,f);let ut=P?Array.isArray(q)&&q.length>0:q!=null&&it!==``;A(()=>{fe(ut)},[ut,fe]),A(function(){let e=ot(Ae.current,q,R,P);e===null&&(Ne.current=null),J||Z.set(`selectedIndex`,e)},[P,J,q,R,Z]),u(q,()=>{re(K),ie(nt(q,ue.initialValue,R)),he.change(q)});let dt=U((e,t)=>{let n=t,r=le(n);d?.(e,n),t.isCanceled||(e||Ue(r()),Se(e),e||t.reason!==`focus-out`&&t.reason!==`outside-press`||(ae(!0),ce(!1),ye===`onBlur`&&he.commit(q)))});Y.useImperativeHandle(D,()=>({unmount:Je,close:()=>{Z.state.open&&dt(!1,j(te))}}),[Je,dt,Z]);let ft=U((e,t)=>{a?.(e,t),t.isCanceled||xe(e)}),pt=U(e=>{let t=w(e.scrollHeight,e.clientHeight),n=S(e.scrollTop,t),r=n>0,i=n<t;Z.set(`scrollUpArrowVisible`,r),Z.set(`scrollDownArrowVisible`,i)}),mt=ze({open:J,onOpenChange:dt,elements:{reference:Q,floating:et}}),ht=_(mt,{enabled:!G,event:`mousedown`}),gt=ve(mt),_t=T(mt,{enabled:!G,listRef:we,activeIndex:Ye,selectedIndex:Xe,disabledIndices:z,onNavigate(e){(e!==null||J)&&Z.set(`activeIndex`,e)},focusItemOnHover:V}),vt=y(mt,{enabled:!G&&(J||!v&&!P),listRef:Te,activeIndex:Ye,selectedIndex:Xe,disabledIndices:e=>Ie(we.current[e]),onMatch(e){J?Z.set(`activeIndex`,e):ft(Ae.current[e],j(ee))},onTyping(e){je.current=e}}),yt=Y.useMemo(()=>N(vt.reference,_t.reference,gt.reference,ht.reference,Ve),[ht.reference,vt.reference,_t.reference,gt.reference,Ve]),bt=Y.useMemo(()=>N(oe,vt.floating,_t.floating,gt.floating),[vt.floating,_t.floating,gt.floating]),xt=_t.item??W,St=Y.useMemo(()=>({props:xt,multiple:P,disabled:G,readOnly:v,isItemEqualToValue:R}),[xt,P,G,v,R]);Z.useContextCallback(`setValue`,ft),Z.useContextCallback(`setOpen`,dt),Z.useContextCallback(`handleScrollArrowVisibility`,pt),Z.useContextCallback(`onOpenChangeComplete`,k),Ze(()=>{Z.update({popupProps:bt,triggerProps:yt,itemRoot:St})}),Z.useSyncedValues({id:be,modal:x,multiple:P,disabled:G,readOnly:v,required:b,highlightItemOnHover:V,value:q,open:J,mounted:Ke,transitionStatus:qe,popupProps:bt,triggerProps:yt,itemRoot:St,items:M,itemToStringLabel:F,itemToStringValue:I,isItemEqualToValue:R,openMethod:rt});let Ct=L(O,he.inputRef),wt=P?void 0:K,Tt=Y.useMemo(()=>!P||!Array.isArray(q)||!K?null:q.map(e=>{let t=Ge(e,I);return(0,X.jsx)(`input`,{type:`hidden`,form:p,name:K,value:t,disabled:G},t)}),[P,q,p,K,I,G]);return(0,X.jsxs)(Qe.Provider,{value:Z,children:[(0,X.jsx)($e.Provider,{value:mt,children:ne}),(0,X.jsx)(`input`,{...he.getValidationProps(G,{onFocus(){Z.state.triggerElement?.focus({focusVisible:!0})},onChange(e){if(e.nativeEvent.defaultPrevented||G||v)return;let t=e.currentTarget.value,n=j(ee,e.nativeEvent);function r(){if(P)return;let e=t.toLowerCase(),r=Ae.current.findIndex(t=>Ge(t,I).toLowerCase()===e||We(t,F).toLowerCase()===e);r===-1&&(r=Ae.current.findIndex((t,n)=>{let r=Te.current[n];return r!=null&&r.toLowerCase()===e}));let i=Ae.current[r];i!=null&&ft(i,n)}Z.set(`forceMount`,!0),queueMicrotask(r)}}),id:be&&wt==null?`${be}-hidden-input`:void 0,form:p,name:wt,autoComplete:m,value:it,disabled:G,required:b&&!(P&&ut),readOnly:v,ref:Ct,style:K?_e:ge,tabIndex:-1,"aria-hidden":!0,suppressHydrationWarning:!0}),Tt]})}var dt=`data-popup-side`,ft=400,pt={...ue,...v,popupSide:e=>e?{[dt]:e}:null,value:()=>null},mt=Y.forwardRef(function(e,t){let{render:r,className:i,id:a,disabled:o=!1,nativeButton:s=!0,style:c,...l}=e,{setTouched:u,validationMode:d,validation:p,state:m,disabled:h}=C(),{labelId:g}=f(),_=Q(),v=_.useState(`readOnly`),y=_.useState(`required`),b=_.useState(`disabled`),x=h||b||o,S=_.useState(`open`),w=_.useState(`mounted`),T=_.useState(`value`),D=_.useState(`triggerProps`),O=_.useState(`positionerElement`),k=_.useState(`listElement`),A=_.useState(`popupSide`),M=_.useState(`id`),F=_.useState(`labelId`),I=_.useState(`hasSelectedValue`),L=w&&O?A:null,z=a??M,B=Xe(g,F);E({id:a});let H=se(O),U=Y.useRef(null),W=n(x,U),{getButtonProps:te,buttonRef:ne}=G({disabled:x,native:s}),re=_.useStateSetter(`triggerElement`),ie=V(),ae=V(),oe=V();Y.useEffect(()=>{if(S)return oe.start(ft,()=>{_.context.selectionRef.current.allowUnselectedMouseUp=!0,_.context.selectionRef.current.allowSelectedMouseUp=!0}),()=>{oe.clear()};_.context.selectionRef.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1,dragY:0},ae.clear()},[S,_,ae,oe]);let le=N(D,{id:z,role:`combobox`,"aria-expanded":S,"aria-haspopup":`listbox`,"aria-controls":S?k?.id??fe(O)?.id:void 0,"aria-labelledby":B,"aria-readonly":v||void 0,"aria-required":y||void 0,tabIndex:x?-1:0,onFocus(e){W(!0),S&&_.context.alignItemWithTriggerActiveRef.current&&_.context.setOpen(!1,j(ee,e.nativeEvent)),ie.start(0,()=>{_.set(`forceMount`,!0)})},onBlur(e){Se(O,e.relatedTarget)||(u(!0),W(!1),d===`onBlur`&&p.commit(T))},onMouseDown(e){if(S)return;let t=ce(e.currentTarget);function n(e){if(!U.current)return;let t=e.target;Se(U.current,t)||Se(H.current,t)||Fe(e,U.current)||_.context.setOpen(!1,j(R,e))}ae.start(0,()=>{t.addEventListener(`mouseup`,n,{once:!0})})}},l,te),ue=p.getValidationProps(x,le);ue.role=`combobox`;let de={...m,open:S,disabled:x,value:T,readOnly:v,popupSide:L,placeholder:!I};return P(`button`,e,{ref:[t,U,ne,re],state:de,stateAttributesMapping:pt,props:ue})}),ht={value:()=>null},gt=Y.forwardRef(function(e,t){let{className:n,render:r,children:i,placeholder:a,style:o,...s}=e,c=Q(),l=c.useState(`value`),u=c.useState(`items`),d=c.useState(`itemToStringLabel`),f=c.useState(`hasSelectedValue`),p=!f&&a!=null&&i==null,m=c.useState(`hasNullItemLabel`,p),h={value:l,placeholder:!f},g=null;return g=typeof i==`function`?i(l):i??(p&&!m?a:Array.isArray(l)?qe(l,u,d):Ke(l,u,d)),P(`span`,e,{state:h,ref:[t,c.context.valueRef],props:[{children:g},s],stateAttributesMapping:ht})}),_t=Y.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,o={open:Q().useState(`open`)};return P(`span`,e,{state:o,ref:t,props:[{"aria-hidden":!0,children:`▼`},a],stateAttributesMapping:he})}),vt=Y.forwardRef(function(e,t){let n=Q(),r=n.useState(`mounted`),i=n.useState(`forceMount`);return r||i?(0,X.jsx)(me,{ref:t,...e}):null}),yt=Y.createContext(void 0);function bt(){let e=Y.useContext(yt);if(!e)throw Error(F(59));return e}function xt(e,t){e&&Object.assign(e.style,t)}var St={position:`relative`,maxHeight:`100%`,overflowX:`hidden`,overflowY:`auto`},Ct={position:`fixed`},wt=Y.forwardRef(function(e,t){let{anchor:n,className:r,render:a,positionMethod:o,side:c,align:l,sideOffset:u,alignOffset:d,collisionBoundary:f=`clipping-ancestors`,collisionPadding:h,arrowPadding:g,sticky:_,disableAnchorTracking:v,alignItemWithTrigger:y=!0,collisionAvoidance:b=xe,style:x,...S}=e,C=Q(),w=et(),T=C.useState(`open`),E=C.useState(`mounted`),D=C.useState(`modal`),O=C.useState(`value`),k=C.useState(`openMethod`),M=C.useState(`positionerElement`),N=C.useState(`triggerElement`),P=C.useState(`isItemEqualToValue`),F=C.useState(`transitionStatus`),I=Y.useRef(null),L=Y.useRef(null),[R,z]=Y.useState(y),B=E&&R&&k!==`touch`;!E&&R!==y&&z(y),Y.useImperativeHandle(C.context.alignItemWithTriggerActiveRef,()=>B),s((B||D)&&T,k===`touch`,M,N);let V=m({anchor:n,floatingRootContext:w,positionMethod:o,mounted:E,side:c,sideOffset:u,align:l,alignOffset:d,arrowPadding:g,collisionBoundary:f,collisionPadding:h,sticky:_,disableAnchorTracking:v??B,collisionAvoidance:b,keepMounted:!0}),H=B?`none`:V.side,W=B?Ct:V.positionerStyles,te={open:T,side:H,align:V.align,anchorHidden:V.anchorHidden};A(()=>{C.set(`popupSide`,V.side)},[C,V.side]);let ne=C.useStateSetter(`positionerElement`),re=p(e,te,{styles:W,transitionStatus:F,props:S,refs:[t,ne],hidden:!E,inert:!T}),ie=Y.useRef(0),ae=U(e=>{if(C.context.valuesRef.current.length===0)return;let t=ie.current;ie.current=e.size;let n=j(ee);if(t!==0&&!C.state.multiple&&O!==null&&it(C.context.valuesRef.current,O,P)===-1){let e=C.context.initialValueRef.current,t=e!=null&&it(C.context.valuesRef.current,e,P)!==-1?e:null;C.context.setValue(t,n),t===null&&(C.set(`selectedIndex`,null),C.context.selectedItemTextRef.current=null)}if(t!==0&&C.state.multiple&&Array.isArray(O)){let e=O.filter(e=>it(C.context.valuesRef.current,e,P)!==-1);e.length!==O.length&&(C.context.setValue(e,n),e.length===0&&(C.set(`selectedIndex`,null),C.context.selectedItemTextRef.current=null))}if(T&&B){C.update({scrollUpArrowVisible:!1,scrollDownArrowVisible:!1});let e={height:``};xt(M,e),xt(C.context.popupRef.current,e)}}),oe=Y.useMemo(()=>({...V,side:H,alignItemWithTriggerActive:B,setControlledAlignItemWithTrigger:z,scrollUpArrowRef:I,scrollDownArrowRef:L}),[V,H,B,z]);return(0,X.jsx)(i,{elementsRef:C.context.listRef,labelsRef:C.context.labelsRef,onMapChange:ae,children:(0,X.jsxs)(yt.Provider,{value:oe,children:[E&&D&&(0,X.jsx)(De,{inert:Ee(!T),cutout:N}),re]})})}),Tt=`--transform-origin`,Et={...q,...pe},Dt=Y.forwardRef(function(e,t){let{render:n,className:r,style:i,finalFocus:a,...s}=e,c=Q(),l=c.useState(`multiple`),u=c.useState(`readOnly`),f=c.useState(`highlightItemOnHover`),p=et(),{side:m,align:h,alignItemWithTriggerActive:_,isPositioned:v,setControlledAlignItemWithTrigger:y}=bt(),S=o(!0)!=null,C=D(),{nonce:w,disableStyleElements:T}=b(),E=c.useState(`id`),O=c.useState(`open`),k=c.useState(`openMethod`),ee=c.useState(`mounted`),M=c.useState(`popupProps`),N=c.useState(`transitionStatus`),F=c.useState(`triggerElement`),I=c.useState(`positionerElement`),L=c.useState(`listElement`),R=Y.useRef(!1),z=Y.useRef(!1),B=Y.useRef({}),V=re(),H=U(e=>{if(!I||!c.context.popupRef.current||!z.current)return;let t=I.style.top===`0px`,n=I.style.bottom===`0px`;if(R.current||!_||!t&&!n){c.context.handleScrollArrowVisibility(e);return}let r=At(I),i=jt(I.getBoundingClientRect().height,`y`,r),a=ce(I),o=ye(I),s=o.getComputedStyle(I),l=parseFloat(s.marginTop),u=parseFloat(s.marginBottom),d=Ot(o.getComputedStyle(c.context.popupRef.current)),f=Math.min(a.documentElement.clientHeight-l-u,d),p=e.scrollTop,m=kt(e),h=null,g=e=>{I.style.height=`${e}px`},v=t?m-p:p,y=Math.min(i+v,f);if(v<=1){let n=x(v,0,f-i);n>0&&g(i+n),e.scrollTop=t?m:0,f-(i+n)<=1&&(R.current=!0),c.context.handleScrollArrowVisibility(e);return}f-y>1?h=t?1/0:0:n&&p<m&&(h=p-(v-(i+v-f)));let b=Math.ceil(y);if(b!==0&&g(b),h!=null){let t=x(h,0,kt(e));Math.abs(e.scrollTop-t)>1&&(e.scrollTop=t)}b>=f-1&&(R.current=!0),c.context.handleScrollArrowVisibility(e)});Y.useImperativeHandle(c.context.scrollHandlerRef,()=>H,[H]),we({open:O,ref:c.context.popupRef,onComplete(){O&&c.context.onOpenChangeComplete(!0)}});let W={open:O,transitionStatus:N,side:m,align:h};A(()=>{I&&c.context.popupRef.current&&!Object.keys(B.current).length&&(B.current={top:I.style.top||`0`,left:I.style.left||`0`,right:I.style.right,height:I.style.height,bottom:I.style.bottom,minHeight:I.style.minHeight,maxHeight:I.style.maxHeight,marginTop:I.style.marginTop,marginBottom:I.style.marginBottom})},[c,I]),A(()=>{O||_||(z.current=!1,R.current=!1,xt(I,B.current))},[O,_,I]),A(()=>{let e=c.context.popupRef.current;if(!O||!F||!I||!e||_&&!v||c.state.transitionStatus===`ending`)return;if(z.current=!0,e.style.removeProperty(Tt),!_){V.request(()=>c.context.handleScrollArrowVisibility(L||e));return}let t=Pt(e);try{let t=c.context.selectedItemTextRef.current;t?.isConnected||(t=!c.select(`hasSelectedValue`)&&c.context.firstItemTextRef.current?.isConnected?c.context.firstItemTextRef.current:null);let n=c.context.valueRef.current,r=ye(I),i=r.getComputedStyle(I),a=r.getComputedStyle(e),o=ce(F),s=At(F),l=Mt(F.getBoundingClientRect(),s),u=Mt(I.getBoundingClientRect(),s),d=l.height,p=L||e,m=p.scrollHeight,h=parseFloat(a.borderBottomWidth),g=parseFloat(i.marginTop)||10,_=parseFloat(i.marginBottom)||10,v=parseFloat(i.minHeight)||100,b=Ot(a),S=o.documentElement.clientHeight-g-_,w=o.documentElement.clientWidth,T=S-l.bottom+d,E,D=C===`rtl`?l.right-u.width:l.left,O=0;if(t&&n){let e=Mt(n.getBoundingClientRect(),s);E=Mt(t.getBoundingClientRect(),s),D=u.left+(C===`rtl`?e.right-E.right:e.left-E.left);let r=e.top-l.top+e.height/2;O=E.top-u.top+E.height/2-r}let k=T+O+_+h,A=Math.min(S,k),ee=S-g-_,j=k-A,M=w-5;I.style.left=`${x(D,5,M-u.width)}px`,I.style.height=`${A}px`,I.style.maxHeight=`none`,I.style.marginTop=`${g}px`,I.style.marginBottom=`${_}px`,e.style.height=`100%`;let N=kt(p),P=j>=N-1;P&&(A=Math.min(S,u.height)-(j-N));let z=l.top<20||l.bottom>S-20||Math.ceil(A)+1<Math.min(m,v),V=(r.visualViewport?.scale??1)!==1&&ke;if(z||V){xt(I,B.current),y(!1);return}let H=Math.max(v,A);if(P){let e=Math.max(0,S-k);I.style.top=u.height>=ee?`0`:`${e}px`,I.style.height=`${A}px`,p.scrollTop=kt(p)}else I.style.bottom=`0`,p.scrollTop=j;if(E){let t=u.top,n=u.height,r=E.top+E.height/2,i=x(n>0?(r-t)/n*100:50,0,100);e.style.setProperty(Tt,`50% ${i}%`)}(H===S||A>=b)&&(R.current=!0),c.context.handleScrollArrowVisibility(p),f&&c.state.selectedIndex===null&&c.state.activeIndex===null&&c.context.listRef.current[0]!=null&&c.set(`activeIndex`,0)}finally{t()}},[c,O,I,F,_,y,V,L,f,C,v]),Y.useEffect(()=>{if(!_||!I||!O)return;let e=ye(I);function t(e){c.context.setOpen(!1,j(ne,e))}return Ae(e,`resize`,t)},[c,_,I,O]);let te={...L?{role:`presentation`}:{role:`listbox`,"aria-multiselectable":l||void 0,"aria-readonly":u||void 0,id:`${E}-list`},onKeyDown(e){S&&Oe.has(e.key)&&e.stopPropagation()},onScroll(e){L||H(e.currentTarget)},..._&&{style:L?{height:`100%`}:St},className:!L&&_?g.className:void 0},ie=P(`div`,e,{ref:[t,c.context.popupRef],state:W,stateAttributesMapping:Et,props:[M,te,d(N),s]});return(0,X.jsxs)(Y.Fragment,{children:[!T&&g.getElement(w),(0,X.jsx)(Me,{context:p,modal:!1,disabled:!ee,openInteractionType:k,returnFocus:a,restoreFocus:!0,children:ie})]})});function Ot(e){let t=e.maxHeight;return t.endsWith(`px`)&&parseFloat(t)||1/0}function kt(e){return w(e.scrollHeight,e.clientHeight)}function At(e){return O.getScale(e)}function jt(e,t,n){return e/n[t]}function Mt(e,t){return ie({x:jt(e.x,`x`,t),y:jt(e.y,`y`,t),width:jt(e.width,`x`,t),height:jt(e.height,`y`,t)})}var Nt=[[`transform`,`none`],[`scale`,`1`],[`translate`,`0 0`]];function Pt(e){let{style:t}=e,n={};for(let[e,r]of Nt)n[e]=t.getPropertyValue(e),t.setProperty(e,r,`important`);return()=>{for(let[e]of Nt){let r=n[e];r?t.setProperty(e,r):t.removeProperty(e)}}}var Ft=Y.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,o=Q(),s=o.useState(`multiple`),c=o.useState(`readOnly`),{alignItemWithTriggerActive:l}=bt(),u=o.useState(`hasScrollArrows`),d=o.useState(`openMethod`),f={id:`${o.useState(`id`)}-list`,role:`listbox`,"aria-multiselectable":s||void 0,"aria-readonly":c||void 0,onScroll(e){o.context.scrollHandlerRef.current?.(e.currentTarget)},...l&&{style:St},className:u&&d!==`touch`?g.className:void 0},p=o.useStateSetter(`listElement`);return P(`div`,e,{ref:[t,p],props:[f,a]})}),It=Y.createContext(void 0);function Lt(){let e=Y.useContext(It);if(!e)throw Error(F(57));return e}var Rt=Y.memo(Y.forwardRef(function(e,t){let{render:n,className:r,style:i,value:o=null,label:s,disabled:c=!1,nativeButton:l=!1,...u}=e,d=Y.useRef(null),f=a({guess:!0,label:s,textRef:d}),p=Q(),{props:m,multiple:h,disabled:g,readOnly:_,isItemEqualToValue:v}=p.useState(`itemRoot`),y=g||c,b=p.useState(`isActive`,f.index),x=p.useState(`open`),S=p.useState(`isSelected`,o),C=p.useState(`isSelectedByFocus`,f.index),w=f.index,T=Y.useRef(null);A(()=>{let e=p.context.valuesRef.current;return e[w]=o,()=>{delete e[w]}},[w,o,p]),A(()=>{let e=p.state.value,t=p.state.selectedIndex,n=t,r;h&&Array.isArray(e)?(n=st(w,o,p.context.valuesRef.current,e,v,t),r=n===w,w===t&&!r&&(p.context.selectedItemTextRef.current=null)):(r=e!==void 0&&$(o,e,v),r&&(n=w)),p.set(`selectedIndex`,n),r&&d.current&&(p.context.selectedItemTextRef.current=d.current)},[w,h,v,p,o]);let E=Y.useRef(`mouse`),D=Y.useRef(!1),{getButtonProps:O,buttonRef:k}=G({disabled:y,focusableWhenDisabled:!0,native:l,composite:!0}),ee={disabled:y,selected:S,highlighted:b};function N(e){if(g||_)return;let t=p.state.value;if(h){let n=Array.isArray(t)?t:[],r=S?ct(n,o,v):[...n,o];p.context.setValue(r,j(M,e))}else p.context.setValue(o,j(M,e)),p.context.setOpen(!1,j(M,e))}function F(){p.context.selectionRef.current.dragY=0}let I={role:`option`,"aria-selected":S,tabIndex:x&&b?0:-1,onKeyDown(e){p.set(`activeIndex`,w),e.key===` `&&p.context.typingRef.current&&e.preventDefault()},onClick(e){let t=E.current!==`touch`,n=e.nativeEvent.pointerType,r=t&&Te(e.nativeEvent)&&(n!==void 0||b),i=t&&!r&&!D.current;D.current=!1,y||i||N(e.nativeEvent)},onPointerEnter(e){E.current=e.pointerType},onPointerMove(e){if(e.pointerType===`mouse`&&e.buttons===1){let t=p.context.selectionRef.current;t.dragY+=e.movementY,t.dragY**2>=64&&(t.allowUnselectedMouseUp=!0)}},onPointerDown(e){E.current=e.pointerType,D.current=!0,F()},onMouseUp(){if(F(),y||E.current===`touch`||D.current)return;let e=!p.context.selectionRef.current.allowSelectedMouseUp&&S,t=!p.context.selectionRef.current.allowUnselectedMouseUp&&!S;e||t||(D.current=!0,T.current?.click(),D.current=!1)}},L=P(`div`,e,{ref:[k,t,f.ref,T],state:ee,props:[m,I,u,O]}),R=Y.useMemo(()=>({selected:S,index:w,textRef:d,selectedByFocus:C}),[S,w,d,C]);return(0,X.jsx)(It.Provider,{value:R,children:L})})),zt=Y.memo(Y.forwardRef(function(e,t){let{render:n,className:r,style:i,keepMounted:a,selected:o,...s}=e,c=Y.useRef(null),{transitionStatus:l,setMounted:u}=J(o),d=P(`span`,e,{ref:[t,c],state:{selected:o,transitionStatus:l},props:[{"aria-hidden":!0,children:`✔️`},s],stateAttributesMapping:pe});return we({batch:!0,enabled:!o,open:o,ref:c,onComplete(){o||u(!1)}}),d})),Bt=Y.forwardRef(function(e,t){let{selected:n}=Lt();return e.keepMounted||n?(0,X.jsx)(zt,{...e,selected:n,ref:t}):null}),Vt=Y.memo(Y.forwardRef(function(e,t){let{index:n,textRef:r,selectedByFocus:i}=Lt(),a=Q(),{render:o,className:s,style:c,...l}=e,u=Y.useCallback(e=>{e&&(n===0&&(a.context.firstItemTextRef.current=e),i&&(a.context.selectedItemTextRef.current=e))},[a,n,i]);return P(`div`,e,{ref:[u,t,r],props:l})})),Ht=Y.forwardRef(function(e,t){let{render:n,className:r,style:i,direction:a,keepMounted:o,...s}=e,c=a===`up`,l=Q(),{side:u,scrollDownArrowRef:d,scrollUpArrowRef:f}=bt(),p=c?`scrollUpArrowVisible`:`scrollDownArrowVisible`,m=l.useState(p),h=l.useState(`openMethod`),g=m&&h!==`touch`,_=V(),v=c?f:d,{mounted:y,transitionStatus:b,setMounted:x}=J(g);A(()=>(l.context.scrollArrowsMountedCountRef.current+=1,l.set(`hasScrollArrows`,!0),()=>{l.context.scrollArrowsMountedCountRef.current=Math.max(0,l.context.scrollArrowsMountedCountRef.current-1),l.context.scrollArrowsMountedCountRef.current===0&&l.set(`hasScrollArrows`,!1)}),[l]),we({open:g,ref:v,onComplete(){g||x(!1)}});let C=P(`div`,e,{ref:[t,v],state:{direction:a,visible:g,side:u,transitionStatus:b},props:[{"aria-hidden":!0,children:c?`▲`:`▼`,style:{position:`absolute`},onMouseMove(e){if(e.movementX===0&&e.movementY===0||_.isStarted())return;l.set(`activeIndex`,null);function t(){let e=l.state.listElement??l.context.popupRef.current;if(!e)return;l.set(`activeIndex`,null),l.context.handleScrollArrowVisibility(e);let n=w(e.scrollHeight,e.clientHeight),r=S(e.scrollTop,n),i=r===(c?0:n),a=l.context.listRef.current;if(r!==e.scrollTop&&(e.scrollTop=r),i)_.clear();else{if(a.length>0){let t=v.current?.offsetHeight||0;e.scrollTop=Ut(a,c,r,e.clientHeight,t,n)}_.start(40,t)}}_.start(40,t)},onMouseLeave(){_.clear()}},s],stateAttributesMapping:pe});return y||o?C:null});function Ut(e,t,n,r,i,a){if(t){let t=0,r=n+i-1;for(let n=0;n<e.length;n+=1){let i=e[n];if(i&&i.offsetTop>=r){t=n;break}}let o=Math.max(0,t-1),s=e[o];return o<t&&s?S(s.offsetTop-i,a):0}let o=e.length-1,s=n+r-i+1;for(let t=0;t<e.length;t+=1){let n=e[t];if(n&&n.offsetTop+n.offsetHeight>s){o=Math.max(0,t-1);break}}let c=Math.min(e.length-1,o+1),l=e[c];return c>o&&l?S(l.offsetTop+l.offsetHeight-r+i,a):a}var Wt=Y.forwardRef(function(e,t){return(0,X.jsx)(Ht,{...e,ref:t,direction:`down`})}),Gt=Y.forwardRef(function(e,t){return(0,X.jsx)(Ht,{...e,ref:t,direction:`up`})});export{Z as A,Q as C,Je as D,Xe as E,Ge as M,ze as N,He as O,Re as P,rt as S,Ye as T,it as _,Rt as a,ct as b,wt as c,_t as d,gt as f,tt as g,$ as h,Bt as i,We as j,Ue as k,bt as l,ut as m,Wt as n,Ft as o,mt as p,Vt as r,Dt as s,Gt as t,vt as u,ot as v,Ze as w,st as x,nt as y};
1
+ import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{t}from"./react-DlmbjZJV.js";import{$t as n,Cn as r,Dr as i,Er as a,Mn as o,On as s,Or as c,Qt as l,Tn as u,Xn as d,Xt as f,Yn as p,Zn as m,Zt as h,_n as g,_r as _,an as v,fr as y,gn as b,hn as x,mn as S,nn as C,pn as w,pr as T,qt as E,rr as D,ur as O}from"./url-64-774qp.js";import{t as k}from"./jsx-runtime-LKYXHABd.js";import{$ as A,A as ee,B as j,E as M,J as N,K as P,Q as F,U as I,Z as L,d as R,et as z,it as B,l as V,nt as H,rt as U,tt as W,v as te,z as ne}from"./mergeRefs-BoWyGCK7.js";import{$n as re,At as ie,Bn as ae,C as oe,Cn as se,Dn as ce,E as le,Gt as ue,I as de,It as fe,Jn as pe,K as me,Kt as he,Nt as ge,Pt as _e,R as ve,Rn as ye,S as be,Tn as G,U as K,Ut as q,Z as xe,Zn as J,an as Se,b as Ce,bn as we,cn as Te,g as Ee,i as De,l as Oe,mn as ke,wn as Ae,y as je,z as Me}from"./useLayerZIndex-t4BgGwYi.js";import{Tt as Ne}from"./MotionConfigContext-B3czw3wn.js";import{m as Pe}from"./Popover-CI2fBO-6.js";import{r as Fe}from"./parseTrigger-dhvXKZoS.js";import{t as Ie}from"./isElementDisabled-DWHaZxJe.js";var Le={name:`copy`,size:24,node:[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]};Le.node;var Re=Ne(Le);function ze(e){let{open:t=!1,onOpenChange:n,elements:r={}}=e,i=I(),a=K()!=null,o=B(()=>new je({open:t,transitionStatus:void 0,onOpenChange:n,referenceElement:r.reference??null,floatingElement:r.floating??null,triggerElements:new be,floatingId:i,syncOnly:!1,nested:a})).current;return A(()=>{let e={open:t,floatingId:i};r.reference!==void 0&&(e.referenceElement=r.reference,e.domReferenceElement=ae(r.reference)?r.reference:null),r.floating!==void 0&&(e.floatingElement=r.floating),o.update(e)},[t,i,r.reference,r.floating,o]),o.context.onOpenChange=n,o.context.nested=a,o}var Y=e(t(),1);function Be(e){if(e==null)return``;if(typeof e==`string`)return e;try{return JSON.stringify(e)}catch{return String(e)}}var X=k();function Ve(e){return typeof e==`object`&&!!e&&Array.isArray(e.items)}function Z(e){return Ve(e?.[0])}function He(e){return Z(e)?e.flatMap(e=>e.items):e}function Ue(e){if(!Array.isArray(e))return e!=null&&`null`in e;let t=e;if(Z(t)){for(let e of t)for(let t of e.items)if(t&&t.value==null&&t.label!=null)return!0;return!1}for(let e of t)if(e&&e.value==null&&e.label!=null)return!0;return!1}function We(e,t){if(t&&e!=null)return t(e)??``;if(e&&typeof e==`object`){if(`label`in e&&e.label!=null)return String(e.label);if(`value`in e)return String(e.value)}return Be(e)}function Ge(e,t){return t&&e!=null?t(e)??``:e&&typeof e==`object`&&`value`in e&&`label`in e?Be(e.value):Be(e)}function Ke(e,t,n){function r(){return We(e,n)}if(n&&e!=null)return n(e);if(e&&typeof e==`object`&&`label`in e&&e.label!=null)return e.label;if(t&&!Array.isArray(t))return(Object.hasOwn(t,e)?t[e]:void 0)??r();if(Array.isArray(t)){let n=He(t);if(typeof e!=`object`||!e){let t=n.find(t=>t.value===e);return t&&t.label!=null?t.label:r()}if(`value`in e){let t=n.find(t=>t&&t.value===e.value);if(t&&t.label!=null)return t.label}}return r()}function qe(e,t,n){return e.reduce((e,r,i)=>(i>0&&e.push(`, `),e.push((0,X.jsx)(Y.Fragment,{children:Ke(r,t,n)},i)),e),[])}function Je(e,t,n=Object.is){let{length:r}=e;if(r!==t.length)return!1;for(let i=0;i<r;i+=1)if(!n(e[i],t[i]))return!1;return!0}function Ye(e){return e==null?void 0:`${e}-label`}function Xe(e,t){return e??t}function Ze(e){let t=Y.useRef(!0);t.current&&(t.current=!1,e())}var Qe=Y.createContext(void 0),$e=Y.createContext(void 0);function Q(){let e=Y.useContext(Qe);if(e===void 0)throw Error(F(60));return e}function et(){let e=Y.useContext($e);if(e===void 0)throw Error(F(61));return e}var tt=(e,t)=>Object.is(e,t);function $(e,t,n){return e==null||t==null?Object.is(e,t):n(e,t)}function nt(e,t,n){return Array.isArray(e)&&Array.isArray(t)?!Je(e,t,(e,t)=>$(e,t,n)):e!==t}function rt(e,t,n){return e?e.some(e=>e!==void 0&&$(t,e,n)):!1}function it(e,t,n){return e?e.findIndex(e=>e!==void 0&&$(e,t,n)):-1}function at(e,t){if(t!==tt)return n=>rt(e,n,t);let n=new Set(e);return n.delete(void 0),t=>n.has(t)&&(t!==0||e.some(e=>Object.is(t,e)))}function ot(e,t,n,r){let i=r&&Array.isArray(t)?e.findIndex(at(t,n)):it(e,t,n);return i===-1?null:i}function st(e,t,n,r,i,a){return rt(r,t,i)?a!=null&&e>a&&rt(r,n[a],i)?a:e:e===a?ot(n,r,i,!0):a}function ct(e,t,n){return e.filter(e=>!$(t,e,n))}var lt={id:e=>e.id,labelId:e=>e.labelId,modal:e=>e.modal,multiple:e=>e.multiple,disabled:e=>e.disabled,readOnly:e=>e.readOnly,required:e=>e.required,highlightItemOnHover:e=>e.highlightItemOnHover,items:e=>e.items,itemToStringLabel:e=>e.itemToStringLabel,isItemEqualToValue:e=>e.isItemEqualToValue,value:e=>e.value,hasSelectedValue:e=>{let{value:t,multiple:n,itemToStringValue:r}=e;return t==null?!1:n&&Array.isArray(t)?t.length>0:Ge(t,r)!==``},hasNullItemLabel:(e,t)=>t?Ue(e.items):!1,open:e=>e.open,mounted:e=>e.mounted,forceMount:e=>e.forceMount,transitionStatus:e=>e.transitionStatus,openMethod:e=>e.openMethod,activeIndex:e=>e.activeIndex,selectedIndex:e=>e.selectedIndex,isActive:(e,t)=>e.activeIndex===t,isSelected:(e,t)=>{let n=e.isItemEqualToValue,r=e.value;return e.multiple?Array.isArray(r)&&r.some(e=>$(t,e,n)):$(t,r,n)},isSelectedByFocus:(e,t)=>e.selectedIndex===t,popupProps:e=>e.popupProps,triggerProps:e=>e.triggerProps,itemRoot:e=>e.itemRoot,triggerElement:e=>e.triggerElement,positionerElement:e=>e.positionerElement,listElement:e=>e.listElement,popupSide:e=>e.popupSide,scrollUpArrowVisible:e=>e.scrollUpArrowVisible,scrollDownArrowVisible:e=>e.scrollDownArrowVisible,hasScrollArrows:e=>e.hasScrollArrows};function ut(e){let{id:t,value:n,defaultValue:i=null,onValueChange:a,open:o,defaultOpen:s=!1,onOpenChange:d,name:f,form:p,autoComplete:m,disabled:g=!1,readOnly:v=!1,required:b=!1,modal:x=!0,actionsRef:D,inputRef:O,onOpenChangeComplete:k,items:M,multiple:P=!1,itemToStringLabel:F,itemToStringValue:I,isItemEqualToValue:R=tt,highlightItemOnHover:V=!0,children:ne}=e,{clearErrors:re}=h(),{setDirty:ie,setTouched:ae,setFocused:ce,validityData:ue,setFilled:fe,name:pe,disabled:me,validation:he,validationMode:ye}=C(),be=E({id:t}),G=me||g,K=pe??f,[q,xe]=c({controlled:n,default:P?i??z:i,name:`Select`,state:`value`}),[J,Se]=c({controlled:o,default:s,name:`Select`,state:`open`}),we=Y.useRef([]),Te=Y.useRef([]),Ee=Y.useRef(null),De=Y.useRef(null),Oe=Y.useRef(0),ke=Y.useRef(null),Ae=Y.useRef([]),je=Y.useRef(!1),Me=Y.useRef(null),Ne=Y.useRef(null),Fe=Y.useRef({allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1,dragY:0}),Le=Y.useRef(!1),Re=Y.useRef(q),{openMethod:Be,triggerProps:Ve}=r(J),Z=B(()=>new Ce({id:be,labelId:void 0,modal:x,multiple:P,disabled:G,readOnly:v,required:b,highlightItemOnHover:V,itemToStringLabel:F,itemToStringValue:I,isItemEqualToValue:R,value:q,open:J,mounted:J,transitionStatus:void 0,items:M,forceMount:!1,openMethod:null,activeIndex:null,selectedIndex:null,popupProps:W,triggerProps:W,itemRoot:{props:W,multiple:P,disabled:G,readOnly:v,isItemEqualToValue:R},triggerElement:null,positionerElement:null,listElement:null,popupSide:null,scrollUpArrowVisible:!1,scrollDownArrowVisible:!1,hasScrollArrows:!1},{setValue:H,setOpen:H,handleScrollArrowVisibility:H,onOpenChangeComplete:H,listRef:we,popupRef:Ee,scrollHandlerRef:De,scrollArrowsMountedCountRef:Oe,valueRef:ke,valuesRef:Ae,labelsRef:Te,typingRef:je,selectionRef:Fe,firstItemTextRef:Me,selectedItemTextRef:Ne,alignItemWithTriggerActiveRef:Le,initialValueRef:Re},lt)).current,[He,Ue]=Y.useState(!1),{mounted:Ke,transitionStatus:qe,forceUnmount:Je}=de({open:J,ref:Ee,preventUnmountOnClose:He,setPreventUnmountOnClose:Ue,onUnmount(){Z.update({activeIndex:null,openMethod:null,scrollUpArrowVisible:!1,scrollDownArrowVisible:!1}),k?.(!1)}}),Ye=Z.useState(`activeIndex`),Xe=Z.useState(`selectedIndex`),Q=Z.useState(`triggerElement`),et=Z.useState(`positionerElement`),$=Pe(Be),rt=Be??$,it=Y.useMemo(()=>P?``:Ge(q,I),[P,q,I]),at=Y.useMemo(()=>P&&Array.isArray(q)?q.map(e=>Ge(e,I)):Ge(q,I),[P,q,I]),st=se(Q),ct=U(()=>at);l(st,be,q,ct,!G,f);let ut=P?Array.isArray(q)&&q.length>0:q!=null&&it!==``;A(()=>{fe(ut)},[ut,fe]),A(function(){let e=ot(Ae.current,q,R,P);e===null&&(Ne.current=null),J||Z.set(`selectedIndex`,e)},[P,J,q,R,Z]),u(q,()=>{re(K),ie(nt(q,ue.initialValue,R)),he.change(q)});let dt=U((e,t)=>{let n=t,r=le(n);d?.(e,n),t.isCanceled||(e||Ue(r()),Se(e),e||t.reason!==`focus-out`&&t.reason!==`outside-press`||(ae(!0),ce(!1),ye===`onBlur`&&he.commit(q)))});Y.useImperativeHandle(D,()=>({unmount:Je,close:()=>{Z.state.open&&dt(!1,j(te))}}),[Je,dt,Z]);let ft=U((e,t)=>{a?.(e,t),t.isCanceled||xe(e)}),pt=U(e=>{let t=w(e.scrollHeight,e.clientHeight),n=S(e.scrollTop,t),r=n>0,i=n<t;Z.set(`scrollUpArrowVisible`,r),Z.set(`scrollDownArrowVisible`,i)}),mt=ze({open:J,onOpenChange:dt,elements:{reference:Q,floating:et}}),ht=_(mt,{enabled:!G,event:`mousedown`}),gt=ve(mt),_t=T(mt,{enabled:!G,listRef:we,activeIndex:Ye,selectedIndex:Xe,disabledIndices:z,onNavigate(e){(e!==null||J)&&Z.set(`activeIndex`,e)},focusItemOnHover:V}),vt=y(mt,{enabled:!G&&(J||!v&&!P),listRef:Te,activeIndex:Ye,selectedIndex:Xe,disabledIndices:e=>Ie(we.current[e]),onMatch(e){J?Z.set(`activeIndex`,e):ft(Ae.current[e],j(ee))},onTyping(e){je.current=e}}),yt=Y.useMemo(()=>N(vt.reference,_t.reference,gt.reference,ht.reference,Ve),[ht.reference,vt.reference,_t.reference,gt.reference,Ve]),bt=Y.useMemo(()=>N(oe,vt.floating,_t.floating,gt.floating),[vt.floating,_t.floating,gt.floating]),xt=_t.item??W,St=Y.useMemo(()=>({props:xt,multiple:P,disabled:G,readOnly:v,isItemEqualToValue:R}),[xt,P,G,v,R]);Z.useContextCallback(`setValue`,ft),Z.useContextCallback(`setOpen`,dt),Z.useContextCallback(`handleScrollArrowVisibility`,pt),Z.useContextCallback(`onOpenChangeComplete`,k),Ze(()=>{Z.update({popupProps:bt,triggerProps:yt,itemRoot:St})}),Z.useSyncedValues({id:be,modal:x,multiple:P,disabled:G,readOnly:v,required:b,highlightItemOnHover:V,value:q,open:J,mounted:Ke,transitionStatus:qe,popupProps:bt,triggerProps:yt,itemRoot:St,items:M,itemToStringLabel:F,itemToStringValue:I,isItemEqualToValue:R,openMethod:rt});let Ct=L(O,he.inputRef),wt=P?void 0:K,Tt=Y.useMemo(()=>!P||!Array.isArray(q)||!K?null:q.map(e=>{let t=Ge(e,I);return(0,X.jsx)(`input`,{type:`hidden`,form:p,name:K,value:t,disabled:G},t)}),[P,q,p,K,I,G]);return(0,X.jsxs)(Qe.Provider,{value:Z,children:[(0,X.jsx)($e.Provider,{value:mt,children:ne}),(0,X.jsx)(`input`,{...he.getValidationProps(G,{onFocus(){Z.state.triggerElement?.focus({focusVisible:!0})},onChange(e){if(e.nativeEvent.defaultPrevented||G||v)return;let t=e.currentTarget.value,n=j(ee,e.nativeEvent);function r(){if(P)return;let e=t.toLowerCase(),r=Ae.current.findIndex(t=>Ge(t,I).toLowerCase()===e||We(t,F).toLowerCase()===e);r===-1&&(r=Ae.current.findIndex((t,n)=>{let r=Te.current[n];return r!=null&&r.toLowerCase()===e}));let i=Ae.current[r];i!=null&&ft(i,n)}Z.set(`forceMount`,!0),queueMicrotask(r)}}),id:be&&wt==null?`${be}-hidden-input`:void 0,form:p,name:wt,autoComplete:m,value:it,disabled:G,required:b&&!(P&&ut),readOnly:v,ref:Ct,style:K?_e:ge,tabIndex:-1,"aria-hidden":!0,suppressHydrationWarning:!0}),Tt]})}var dt=`data-popup-side`,ft=400,pt={...ue,...v,popupSide:e=>e?{[dt]:e}:null,value:()=>null},mt=Y.forwardRef(function(e,t){let{render:r,className:i,id:a,disabled:o=!1,nativeButton:s=!0,style:c,...l}=e,{setTouched:u,validationMode:d,validation:p,state:m,disabled:h}=C(),{labelId:g}=f(),_=Q(),v=_.useState(`readOnly`),y=_.useState(`required`),b=_.useState(`disabled`),x=h||b||o,S=_.useState(`open`),w=_.useState(`mounted`),T=_.useState(`value`),D=_.useState(`triggerProps`),O=_.useState(`positionerElement`),k=_.useState(`listElement`),A=_.useState(`popupSide`),M=_.useState(`id`),F=_.useState(`labelId`),I=_.useState(`hasSelectedValue`),L=w&&O?A:null,z=a??M,B=Xe(g,F);E({id:a});let H=se(O),U=Y.useRef(null),W=n(x,U),{getButtonProps:te,buttonRef:ne}=G({disabled:x,native:s}),re=_.useStateSetter(`triggerElement`),ie=V(),ae=V(),oe=V();Y.useEffect(()=>{if(S)return oe.start(ft,()=>{_.context.selectionRef.current.allowUnselectedMouseUp=!0,_.context.selectionRef.current.allowSelectedMouseUp=!0}),()=>{oe.clear()};_.context.selectionRef.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1,dragY:0},ae.clear()},[S,_,ae,oe]);let le=N(D,{id:z,role:`combobox`,"aria-expanded":S,"aria-haspopup":`listbox`,"aria-controls":S?k?.id??fe(O)?.id:void 0,"aria-labelledby":B,"aria-readonly":v||void 0,"aria-required":y||void 0,tabIndex:x?-1:0,onFocus(e){W(!0),S&&_.context.alignItemWithTriggerActiveRef.current&&_.context.setOpen(!1,j(ee,e.nativeEvent)),ie.start(0,()=>{_.set(`forceMount`,!0)})},onBlur(e){Se(O,e.relatedTarget)||(u(!0),W(!1),d===`onBlur`&&p.commit(T))},onMouseDown(e){if(S)return;let t=ce(e.currentTarget);function n(e){if(!U.current)return;let t=e.target;Se(U.current,t)||Se(H.current,t)||Fe(e,U.current)||_.context.setOpen(!1,j(R,e))}ae.start(0,()=>{t.addEventListener(`mouseup`,n,{once:!0})})}},l,te),ue=p.getValidationProps(x,le);ue.role=`combobox`;let de={...m,open:S,disabled:x,value:T,readOnly:v,popupSide:L,placeholder:!I};return P(`button`,e,{ref:[t,U,ne,re],state:de,stateAttributesMapping:pt,props:ue})}),ht={value:()=>null},gt=Y.forwardRef(function(e,t){let{className:n,render:r,children:i,placeholder:a,style:o,...s}=e,c=Q(),l=c.useState(`value`),u=c.useState(`items`),d=c.useState(`itemToStringLabel`),f=c.useState(`hasSelectedValue`),p=!f&&a!=null&&i==null,m=c.useState(`hasNullItemLabel`,p),h={value:l,placeholder:!f},g=null;return g=typeof i==`function`?i(l):i??(p&&!m?a:Array.isArray(l)?qe(l,u,d):Ke(l,u,d)),P(`span`,e,{state:h,ref:[t,c.context.valueRef],props:[{children:g},s],stateAttributesMapping:ht})}),_t=Y.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,o={open:Q().useState(`open`)};return P(`span`,e,{state:o,ref:t,props:[{"aria-hidden":!0,children:`▼`},a],stateAttributesMapping:he})}),vt=Y.forwardRef(function(e,t){let n=Q(),r=n.useState(`mounted`),i=n.useState(`forceMount`);return r||i?(0,X.jsx)(me,{ref:t,...e}):null}),yt=Y.createContext(void 0);function bt(){let e=Y.useContext(yt);if(!e)throw Error(F(59));return e}function xt(e,t){e&&Object.assign(e.style,t)}var St={position:`relative`,maxHeight:`100%`,overflowX:`hidden`,overflowY:`auto`},Ct={position:`fixed`},wt=Y.forwardRef(function(e,t){let{anchor:n,className:r,render:a,positionMethod:o,side:c,align:l,sideOffset:u,alignOffset:d,collisionBoundary:f=`clipping-ancestors`,collisionPadding:h,arrowPadding:g,sticky:_,disableAnchorTracking:v,alignItemWithTrigger:y=!0,collisionAvoidance:b=xe,style:x,...S}=e,C=Q(),w=et(),T=C.useState(`open`),E=C.useState(`mounted`),D=C.useState(`modal`),O=C.useState(`value`),k=C.useState(`openMethod`),M=C.useState(`positionerElement`),N=C.useState(`triggerElement`),P=C.useState(`isItemEqualToValue`),F=C.useState(`transitionStatus`),I=Y.useRef(null),L=Y.useRef(null),[R,z]=Y.useState(y),B=E&&R&&k!==`touch`;!E&&R!==y&&z(y),Y.useImperativeHandle(C.context.alignItemWithTriggerActiveRef,()=>B),s((B||D)&&T,k===`touch`,M,N);let V=m({anchor:n,floatingRootContext:w,positionMethod:o,mounted:E,side:c,sideOffset:u,align:l,alignOffset:d,arrowPadding:g,collisionBoundary:f,collisionPadding:h,sticky:_,disableAnchorTracking:v??B,collisionAvoidance:b,keepMounted:!0}),H=B?`none`:V.side,W=B?Ct:V.positionerStyles,te={open:T,side:H,align:V.align,anchorHidden:V.anchorHidden};A(()=>{C.set(`popupSide`,V.side)},[C,V.side]);let ne=C.useStateSetter(`positionerElement`),re=p(e,te,{styles:W,transitionStatus:F,props:S,refs:[t,ne],hidden:!E,inert:!T}),ie=Y.useRef(0),ae=U(e=>{if(C.context.valuesRef.current.length===0)return;let t=ie.current;ie.current=e.size;let n=j(ee);if(t!==0&&!C.state.multiple&&O!==null&&it(C.context.valuesRef.current,O,P)===-1){let e=C.context.initialValueRef.current,t=e!=null&&it(C.context.valuesRef.current,e,P)!==-1?e:null;C.context.setValue(t,n),t===null&&(C.set(`selectedIndex`,null),C.context.selectedItemTextRef.current=null)}if(t!==0&&C.state.multiple&&Array.isArray(O)){let e=O.filter(e=>it(C.context.valuesRef.current,e,P)!==-1);e.length!==O.length&&(C.context.setValue(e,n),e.length===0&&(C.set(`selectedIndex`,null),C.context.selectedItemTextRef.current=null))}if(T&&B){C.update({scrollUpArrowVisible:!1,scrollDownArrowVisible:!1});let e={height:``};xt(M,e),xt(C.context.popupRef.current,e)}}),oe=Y.useMemo(()=>({...V,side:H,alignItemWithTriggerActive:B,setControlledAlignItemWithTrigger:z,scrollUpArrowRef:I,scrollDownArrowRef:L}),[V,H,B,z]);return(0,X.jsx)(i,{elementsRef:C.context.listRef,labelsRef:C.context.labelsRef,onMapChange:ae,children:(0,X.jsxs)(yt.Provider,{value:oe,children:[E&&D&&(0,X.jsx)(De,{inert:Ee(!T),cutout:N}),re]})})}),Tt=`--transform-origin`,Et={...q,...pe},Dt=Y.forwardRef(function(e,t){let{render:n,className:r,style:i,finalFocus:a,...s}=e,c=Q(),l=c.useState(`multiple`),u=c.useState(`readOnly`),f=c.useState(`highlightItemOnHover`),p=et(),{side:m,align:h,alignItemWithTriggerActive:_,isPositioned:v,setControlledAlignItemWithTrigger:y}=bt(),S=o(!0)!=null,C=D(),{nonce:w,disableStyleElements:T}=b(),E=c.useState(`id`),O=c.useState(`open`),k=c.useState(`openMethod`),ee=c.useState(`mounted`),M=c.useState(`popupProps`),N=c.useState(`transitionStatus`),F=c.useState(`triggerElement`),I=c.useState(`positionerElement`),L=c.useState(`listElement`),R=Y.useRef(!1),z=Y.useRef(!1),B=Y.useRef({}),V=re(),H=U(e=>{if(!I||!c.context.popupRef.current||!z.current)return;let t=I.style.top===`0px`,n=I.style.bottom===`0px`;if(R.current||!_||!t&&!n){c.context.handleScrollArrowVisibility(e);return}let r=At(I),i=jt(I.getBoundingClientRect().height,`y`,r),a=ce(I),o=ye(I),s=o.getComputedStyle(I),l=parseFloat(s.marginTop),u=parseFloat(s.marginBottom),d=Ot(o.getComputedStyle(c.context.popupRef.current)),f=Math.min(a.documentElement.clientHeight-l-u,d),p=e.scrollTop,m=kt(e),h=null,g=e=>{I.style.height=`${e}px`},v=t?m-p:p,y=Math.min(i+v,f);if(v<=1){let n=x(v,0,f-i);n>0&&g(i+n),e.scrollTop=t?m:0,f-(i+n)<=1&&(R.current=!0),c.context.handleScrollArrowVisibility(e);return}f-y>1?h=t?1/0:0:n&&p<m&&(h=p-(v-(i+v-f)));let b=Math.ceil(y);if(b!==0&&g(b),h!=null){let t=x(h,0,kt(e));Math.abs(e.scrollTop-t)>1&&(e.scrollTop=t)}b>=f-1&&(R.current=!0),c.context.handleScrollArrowVisibility(e)});Y.useImperativeHandle(c.context.scrollHandlerRef,()=>H,[H]),we({open:O,ref:c.context.popupRef,onComplete(){O&&c.context.onOpenChangeComplete(!0)}});let W={open:O,transitionStatus:N,side:m,align:h};A(()=>{I&&c.context.popupRef.current&&!Object.keys(B.current).length&&(B.current={top:I.style.top||`0`,left:I.style.left||`0`,right:I.style.right,height:I.style.height,bottom:I.style.bottom,minHeight:I.style.minHeight,maxHeight:I.style.maxHeight,marginTop:I.style.marginTop,marginBottom:I.style.marginBottom})},[c,I]),A(()=>{O||_||(z.current=!1,R.current=!1,xt(I,B.current))},[O,_,I]),A(()=>{let e=c.context.popupRef.current;if(!O||!F||!I||!e||_&&!v||c.state.transitionStatus===`ending`)return;if(z.current=!0,e.style.removeProperty(Tt),!_){V.request(()=>c.context.handleScrollArrowVisibility(L||e));return}let t=Pt(e);try{let t=c.context.selectedItemTextRef.current;t?.isConnected||(t=!c.select(`hasSelectedValue`)&&c.context.firstItemTextRef.current?.isConnected?c.context.firstItemTextRef.current:null);let n=c.context.valueRef.current,r=ye(I),i=r.getComputedStyle(I),a=r.getComputedStyle(e),o=ce(F),s=At(F),l=Mt(F.getBoundingClientRect(),s),u=Mt(I.getBoundingClientRect(),s),d=l.height,p=L||e,m=p.scrollHeight,h=parseFloat(a.borderBottomWidth),g=parseFloat(i.marginTop)||10,_=parseFloat(i.marginBottom)||10,v=parseFloat(i.minHeight)||100,b=Ot(a),S=o.documentElement.clientHeight-g-_,w=o.documentElement.clientWidth,T=S-l.bottom+d,E,D=C===`rtl`?l.right-u.width:l.left,O=0;if(t&&n){let e=Mt(n.getBoundingClientRect(),s);E=Mt(t.getBoundingClientRect(),s),D=u.left+(C===`rtl`?e.right-E.right:e.left-E.left);let r=e.top-l.top+e.height/2;O=E.top-u.top+E.height/2-r}let k=T+O+_+h,A=Math.min(S,k),ee=S-g-_,j=k-A,M=w-5;I.style.left=`${x(D,5,M-u.width)}px`,I.style.height=`${A}px`,I.style.maxHeight=`none`,I.style.marginTop=`${g}px`,I.style.marginBottom=`${_}px`,e.style.height=`100%`;let N=kt(p),P=j>=N-1;P&&(A=Math.min(S,u.height)-(j-N));let z=l.top<20||l.bottom>S-20||Math.ceil(A)+1<Math.min(m,v),V=(r.visualViewport?.scale??1)!==1&&ke;if(z||V){xt(I,B.current),y(!1);return}let H=Math.max(v,A);if(P){let e=Math.max(0,S-k);I.style.top=u.height>=ee?`0`:`${e}px`,I.style.height=`${A}px`,p.scrollTop=kt(p)}else I.style.bottom=`0`,p.scrollTop=j;if(E){let t=u.top,n=u.height,r=E.top+E.height/2,i=x(n>0?(r-t)/n*100:50,0,100);e.style.setProperty(Tt,`50% ${i}%`)}(H===S||A>=b)&&(R.current=!0),c.context.handleScrollArrowVisibility(p),f&&c.state.selectedIndex===null&&c.state.activeIndex===null&&c.context.listRef.current[0]!=null&&c.set(`activeIndex`,0)}finally{t()}},[c,O,I,F,_,y,V,L,f,C,v]),Y.useEffect(()=>{if(!_||!I||!O)return;let e=ye(I);function t(e){c.context.setOpen(!1,j(ne,e))}return Ae(e,`resize`,t)},[c,_,I,O]);let te={...L?{role:`presentation`}:{role:`listbox`,"aria-multiselectable":l||void 0,"aria-readonly":u||void 0,id:`${E}-list`},onKeyDown(e){S&&Oe.has(e.key)&&e.stopPropagation()},onScroll(e){L||H(e.currentTarget)},..._&&{style:L?{height:`100%`}:St},className:!L&&_?g.className:void 0},ie=P(`div`,e,{ref:[t,c.context.popupRef],state:W,stateAttributesMapping:Et,props:[M,te,d(N),s]});return(0,X.jsxs)(Y.Fragment,{children:[!T&&g.getElement(w),(0,X.jsx)(Me,{context:p,modal:!1,disabled:!ee,openInteractionType:k,returnFocus:a,restoreFocus:!0,children:ie})]})});function Ot(e){let t=e.maxHeight;return t.endsWith(`px`)&&parseFloat(t)||1/0}function kt(e){return w(e.scrollHeight,e.clientHeight)}function At(e){return O.getScale(e)}function jt(e,t,n){return e/n[t]}function Mt(e,t){return ie({x:jt(e.x,`x`,t),y:jt(e.y,`y`,t),width:jt(e.width,`x`,t),height:jt(e.height,`y`,t)})}var Nt=[[`transform`,`none`],[`scale`,`1`],[`translate`,`0 0`]];function Pt(e){let{style:t}=e,n={};for(let[e,r]of Nt)n[e]=t.getPropertyValue(e),t.setProperty(e,r,`important`);return()=>{for(let[e]of Nt){let r=n[e];r?t.setProperty(e,r):t.removeProperty(e)}}}var Ft=Y.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,o=Q(),s=o.useState(`multiple`),c=o.useState(`readOnly`),{alignItemWithTriggerActive:l}=bt(),u=o.useState(`hasScrollArrows`),d=o.useState(`openMethod`),f={id:`${o.useState(`id`)}-list`,role:`listbox`,"aria-multiselectable":s||void 0,"aria-readonly":c||void 0,onScroll(e){o.context.scrollHandlerRef.current?.(e.currentTarget)},...l&&{style:St},className:u&&d!==`touch`?g.className:void 0},p=o.useStateSetter(`listElement`);return P(`div`,e,{ref:[t,p],props:[f,a]})}),It=Y.createContext(void 0);function Lt(){let e=Y.useContext(It);if(!e)throw Error(F(57));return e}var Rt=Y.memo(Y.forwardRef(function(e,t){let{render:n,className:r,style:i,value:o=null,label:s,disabled:c=!1,nativeButton:l=!1,...u}=e,d=Y.useRef(null),f=a({guess:!0,label:s,textRef:d}),p=Q(),{props:m,multiple:h,disabled:g,readOnly:_,isItemEqualToValue:v}=p.useState(`itemRoot`),y=g||c,b=p.useState(`isActive`,f.index),x=p.useState(`open`),S=p.useState(`isSelected`,o),C=p.useState(`isSelectedByFocus`,f.index),w=f.index,T=Y.useRef(null);A(()=>{let e=p.context.valuesRef.current;return e[w]=o,()=>{delete e[w]}},[w,o,p]),A(()=>{let e=p.state.value,t=p.state.selectedIndex,n=t,r;h&&Array.isArray(e)?(n=st(w,o,p.context.valuesRef.current,e,v,t),r=n===w,w===t&&!r&&(p.context.selectedItemTextRef.current=null)):(r=e!==void 0&&$(o,e,v),r&&(n=w)),p.set(`selectedIndex`,n),r&&d.current&&(p.context.selectedItemTextRef.current=d.current)},[w,h,v,p,o]);let E=Y.useRef(`mouse`),D=Y.useRef(!1),{getButtonProps:O,buttonRef:k}=G({disabled:y,focusableWhenDisabled:!0,native:l,composite:!0}),ee={disabled:y,selected:S,highlighted:b};function N(e){if(g||_)return;let t=p.state.value;if(h){let n=Array.isArray(t)?t:[],r=S?ct(n,o,v):[...n,o];p.context.setValue(r,j(M,e))}else p.context.setValue(o,j(M,e)),p.context.setOpen(!1,j(M,e))}function F(){p.context.selectionRef.current.dragY=0}let I={role:`option`,"aria-selected":S,tabIndex:x&&b?0:-1,onKeyDown(e){p.set(`activeIndex`,w),e.key===` `&&p.context.typingRef.current&&e.preventDefault()},onClick(e){let t=E.current!==`touch`,n=e.nativeEvent.pointerType,r=t&&Te(e.nativeEvent)&&(n!==void 0||b),i=t&&!r&&!D.current;D.current=!1,y||i||N(e.nativeEvent)},onPointerEnter(e){E.current=e.pointerType},onPointerMove(e){if(e.pointerType===`mouse`&&e.buttons===1){let t=p.context.selectionRef.current;t.dragY+=e.movementY,t.dragY**2>=64&&(t.allowUnselectedMouseUp=!0)}},onPointerDown(e){E.current=e.pointerType,D.current=!0,F()},onMouseUp(){if(F(),y||E.current===`touch`||D.current)return;let e=!p.context.selectionRef.current.allowSelectedMouseUp&&S,t=!p.context.selectionRef.current.allowUnselectedMouseUp&&!S;e||t||(D.current=!0,T.current?.click(),D.current=!1)}},L=P(`div`,e,{ref:[k,t,f.ref,T],state:ee,props:[m,I,u,O]}),R=Y.useMemo(()=>({selected:S,index:w,textRef:d,selectedByFocus:C}),[S,w,d,C]);return(0,X.jsx)(It.Provider,{value:R,children:L})})),zt=Y.memo(Y.forwardRef(function(e,t){let{render:n,className:r,style:i,keepMounted:a,selected:o,...s}=e,c=Y.useRef(null),{transitionStatus:l,setMounted:u}=J(o),d=P(`span`,e,{ref:[t,c],state:{selected:o,transitionStatus:l},props:[{"aria-hidden":!0,children:`✔️`},s],stateAttributesMapping:pe});return we({batch:!0,enabled:!o,open:o,ref:c,onComplete(){o||u(!1)}}),d})),Bt=Y.forwardRef(function(e,t){let{selected:n}=Lt();return e.keepMounted||n?(0,X.jsx)(zt,{...e,selected:n,ref:t}):null}),Vt=Y.memo(Y.forwardRef(function(e,t){let{index:n,textRef:r,selectedByFocus:i}=Lt(),a=Q(),{render:o,className:s,style:c,...l}=e,u=Y.useCallback(e=>{e&&(n===0&&(a.context.firstItemTextRef.current=e),i&&(a.context.selectedItemTextRef.current=e))},[a,n,i]);return P(`div`,e,{ref:[u,t,r],props:l})})),Ht=Y.forwardRef(function(e,t){let{render:n,className:r,style:i,direction:a,keepMounted:o,...s}=e,c=a===`up`,l=Q(),{side:u,scrollDownArrowRef:d,scrollUpArrowRef:f}=bt(),p=c?`scrollUpArrowVisible`:`scrollDownArrowVisible`,m=l.useState(p),h=l.useState(`openMethod`),g=m&&h!==`touch`,_=V(),v=c?f:d,{mounted:y,transitionStatus:b,setMounted:x}=J(g);A(()=>(l.context.scrollArrowsMountedCountRef.current+=1,l.set(`hasScrollArrows`,!0),()=>{l.context.scrollArrowsMountedCountRef.current=Math.max(0,l.context.scrollArrowsMountedCountRef.current-1),l.context.scrollArrowsMountedCountRef.current===0&&l.set(`hasScrollArrows`,!1)}),[l]),we({open:g,ref:v,onComplete(){g||x(!1)}});let C=P(`div`,e,{ref:[t,v],state:{direction:a,visible:g,side:u,transitionStatus:b},props:[{"aria-hidden":!0,children:c?`▲`:`▼`,style:{position:`absolute`},onMouseMove(e){if(e.movementX===0&&e.movementY===0||_.isStarted())return;l.set(`activeIndex`,null);function t(){let e=l.state.listElement??l.context.popupRef.current;if(!e)return;l.set(`activeIndex`,null),l.context.handleScrollArrowVisibility(e);let n=w(e.scrollHeight,e.clientHeight),r=S(e.scrollTop,n),i=r===(c?0:n),a=l.context.listRef.current;if(r!==e.scrollTop&&(e.scrollTop=r),i)_.clear();else{if(a.length>0){let t=v.current?.offsetHeight||0;e.scrollTop=Ut(a,c,r,e.clientHeight,t,n)}_.start(40,t)}}_.start(40,t)},onMouseLeave(){_.clear()}},s],stateAttributesMapping:pe});return y||o?C:null});function Ut(e,t,n,r,i,a){if(t){let t=0,r=n+i-1;for(let n=0;n<e.length;n+=1){let i=e[n];if(i&&i.offsetTop>=r){t=n;break}}let o=Math.max(0,t-1),s=e[o];return o<t&&s?S(s.offsetTop-i,a):0}let o=e.length-1,s=n+r-i+1;for(let t=0;t<e.length;t+=1){let n=e[t];if(n&&n.offsetTop+n.offsetHeight>s){o=Math.max(0,t-1);break}}let c=Math.min(e.length-1,o+1),l=e[c];return c>o&&l?S(l.offsetTop+l.offsetHeight-r+i,a):a}var Wt=Y.forwardRef(function(e,t){return(0,X.jsx)(Ht,{...e,ref:t,direction:`down`})}),Gt=Y.forwardRef(function(e,t){return(0,X.jsx)(Ht,{...e,ref:t,direction:`up`})});export{Z as A,Q as C,Je as D,Xe as E,Ge as M,ze as N,He as O,Re as P,rt as S,Ye as T,it as _,Rt as a,ct as b,wt as c,_t as d,gt as f,tt as g,$ as h,Bt as i,We as j,Ue as k,bt as l,ut as m,Wt as n,Ft as o,mt as p,Vt as r,Dt as s,Gt as t,vt as u,ot as v,Ze as w,st as x,nt as y};
@@ -1 +1 @@
1
- import{r as e}from"./rolldown-runtime-XKyaHtl9.js";/* empty css */import{t}from"./DraggablePanel-B9erey9g.js";import{t as n}from"./react-DlmbjZJV.js";import{n as r}from"./useMedia-CFebB4XU.js";import{t as i}from"./jsx-runtime-LKYXHABd.js";var a=e(n(),1),o=i(),s=180,c=(0,a.createContext)(!1),l=()=>(0,a.useContext)(c),u=(e,t,n,r)=>{let i=Number(globalThis.localStorage?.getItem(e));return Number.isFinite(i)&&i>=t&&i<=n?i:r};function d({children:e,dataAttr:n,defaultWidth:i=380,maxWidth:l=640,minWidth:d=320,onResizing:f,storageKey:p}){let m=r(`(max-width: 720px)`),h=e!=null&&e!==!1,g=(0,a.useRef)(null);h&&(g.current=e);let[_,v]=(0,a.useState)(!1),y=(0,a.useRef)(h);if((0,a.useEffect)(()=>{let e=y.current&&!h;if(y.current=h,!e||!m)return;v(!0);let t=setTimeout(()=>{v(!1),g.current=null},s);return()=>clearTimeout(t)},[h,m]),m)return h?e:_?(0,o.jsx)(c,{value:!0,children:g.current}):null;let b=n?{[n]:``}:{};return(0,o.jsx)(t,{showBorder:!0,showHandleWideArea:!0,defaultSize:{width:u(p,d,l,i)},expand:h,expandable:!1,maxWidth:l,minWidth:d,mode:`fixed`,placement:`right`,onSizeDragging:()=>f(!0),onSizeChange:(e,t)=>{f(!1),typeof t.width==`number`&&globalThis.localStorage?.setItem(p,String(Math.round(t.width)))},children:(0,o.jsx)(`div`,{"data-open":h,...b,inert:!h,style:{display:`contents`},children:h?e:g.current})})}export{l as n,d as t};
1
+ import{r as e}from"./rolldown-runtime-XKyaHtl9.js";/* empty css */import{t}from"./DraggablePanel-D2U_w1Mh.js";import{t as n}from"./react-DlmbjZJV.js";import{n as r}from"./useMedia-CFebB4XU.js";import{t as i}from"./jsx-runtime-LKYXHABd.js";var a=e(n(),1),o=i(),s=180,c=(0,a.createContext)(!1),l=()=>(0,a.useContext)(c),u=(e,t,n,r)=>{let i=Number(globalThis.localStorage?.getItem(e));return Number.isFinite(i)&&i>=t&&i<=n?i:r};function d({children:e,dataAttr:n,defaultWidth:i=380,maxWidth:l=640,minWidth:d=320,onResizing:f,storageKey:p}){let m=r(`(max-width: 720px)`),h=e!=null&&e!==!1,g=(0,a.useRef)(null);h&&(g.current=e);let[_,v]=(0,a.useState)(!1),y=(0,a.useRef)(h);if((0,a.useEffect)(()=>{let e=y.current&&!h;if(y.current=h,!e||!m)return;v(!0);let t=setTimeout(()=>{v(!1),g.current=null},s);return()=>clearTimeout(t)},[h,m]),m)return h?e:_?(0,o.jsx)(c,{value:!0,children:g.current}):null;let b=n?{[n]:``}:{};return(0,o.jsx)(t,{showBorder:!0,showHandleWideArea:!0,defaultSize:{width:u(p,d,l,i)},expand:h,expandable:!1,maxWidth:l,minWidth:d,mode:`fixed`,placement:`right`,onSizeDragging:()=>f(!0),onSizeChange:(e,t)=>{f(!1),typeof t.width==`number`&&globalThis.localStorage?.setItem(p,String(Math.round(t.width)))},children:(0,o.jsx)(`div`,{"data-open":h,...b,inert:!h,style:{display:`contents`},children:h?e:g.current})})}export{l as n,d as t};