@povio/ui 3.4.0-rc.32 → 3.4.0-rc.34

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 (119) hide show
  1. package/dist/{BottomSheet-Bf5YauUF.js → BottomSheet-CVIgVXNP.js} +2 -2
  2. package/dist/{Breadcrumbs-D8ngBc93.js → Breadcrumbs-BypydWR6.js} +2 -2
  3. package/dist/{Calendar-D2IPtih0.js → Calendar-CJscjq0V.js} +4 -4
  4. package/dist/{DatePicker-C5inJMib.js → DatePicker-DIad7xyY.js} +4 -4
  5. package/dist/{DatePickerInput-CtkeReVQ.js → DatePickerInput-g8VFnlw8.js} +1 -1
  6. package/dist/{DateRangePicker-BcYoPnDA.js → DateRangePicker-0vELBNcS.js} +3 -3
  7. package/dist/{DateTimePicker-CocJ2QGc.js → DateTimePicker-ChVdA0tD.js} +4 -4
  8. package/dist/{Dialog-CYPAuk4r.js → Dialog-B5J6LRRw.js} +2 -71
  9. package/dist/{Form-U_gaYtIz.d.ts → Form-C91OtvWn.d.ts} +1 -1
  10. package/dist/{InputItem-msRZqamc.js → InputItem-DRjyA0oH.js} +5 -5
  11. package/dist/{Inputs-D0nApWoP.d.ts → Inputs-CalpKD9s.d.ts} +1 -1
  12. package/dist/{Inputs-COn_OHA2.js → Inputs-Cmt2mxFU.js} +1 -1
  13. package/dist/{ListBox-CJbpH_Kh.js → ListBox-CIgWt1tg.js} +1 -1
  14. package/dist/{Menu-CXlFN-mb.js → Menu-BxbxSqMx.js} +2 -2
  15. package/dist/{MenuDesktop-CuQBZODp.js → MenuDesktop-Dv25P83N.js} +1 -1
  16. package/dist/{Modal-BbiLj4ai.js → Modal-CEJ2QkF0.js} +1 -1
  17. package/dist/{Modal-Cerq7LEf.js → Modal-r0ucQNPK.js} +2 -2
  18. package/dist/{Select-CO2ppqqL.js → Select-B7vfRfll.js} +1 -1
  19. package/dist/{TextEditor-CDv7Tf57.js → TextEditor-DScsU-U2.js} +3 -3
  20. package/dist/{TimePicker-BmTVdF1E.js → TimePicker-DC_MYdqe.js} +2 -2
  21. package/dist/components/action-modal.js +1 -1
  22. package/dist/components/autocomplete.js +1 -1
  23. package/dist/components/bottom-sheet.js +2 -2
  24. package/dist/components/breadcrumb/react-aria.js +1 -11
  25. package/dist/components/breadcrumbs/react-aria.js +1 -11
  26. package/dist/components/breadcrumbs.js +1 -1
  27. package/dist/components/cell/react-aria.js +1 -11
  28. package/dist/components/collection/react-aria.js +1 -11
  29. package/dist/components/color-swatch-picker/react-aria.js +1 -11
  30. package/dist/components/color-swatch-picker-item/react-aria.js +1 -11
  31. package/dist/components/column/react-aria.js +1 -11
  32. package/dist/components/column-resizer/react-aria.js +1 -11
  33. package/dist/components/combo-box/react-aria.js +1 -11
  34. package/dist/components/date-picker.js +1 -1
  35. package/dist/components/date-range-picker.js +1 -1
  36. package/dist/components/date-time-picker.js +1 -1
  37. package/dist/components/drawer.js +2 -2
  38. package/dist/components/grid-list/react-aria.js +1 -11
  39. package/dist/components/grid-list-header/react-aria.js +1 -11
  40. package/dist/components/grid-list-item/react-aria.js +1 -11
  41. package/dist/components/grid-list-load-more-item/react-aria.js +1 -11
  42. package/dist/components/grid-list-section/react-aria.js +1 -11
  43. package/dist/components/header/react-aria.js +1 -11
  44. package/dist/components/list-box/react-aria.js +1 -11
  45. package/dist/components/list-box-item/react-aria.js +1 -11
  46. package/dist/components/list-box-load-more-item/react-aria.js +1 -11
  47. package/dist/components/list-box-section/react-aria.js +1 -11
  48. package/dist/components/menu/react-aria.js +1 -11
  49. package/dist/components/menu-item/react-aria.js +1 -11
  50. package/dist/components/menu-section/react-aria.js +1 -11
  51. package/dist/components/menu.js +2 -2
  52. package/dist/components/modal.js +1 -1
  53. package/dist/components/query-autocomplete.d.ts +1 -1
  54. package/dist/components/query-autocomplete.js +3 -3
  55. package/dist/components/query-select.js +1 -1
  56. package/dist/components/resizable-table-container/react-aria.js +1 -11
  57. package/dist/components/responsive-popover.js +1 -1
  58. package/dist/components/row/react-aria.js +1 -11
  59. package/dist/components/section/react-aria.js +1 -11
  60. package/dist/components/select/react-aria.js +1 -11
  61. package/dist/components/select.js +1 -1
  62. package/dist/components/separator/react-aria.js +1 -11
  63. package/dist/components/split-button.js +1 -1
  64. package/dist/components/submenu-trigger/react-aria.js +1 -11
  65. package/dist/components/tab/react-aria.js +1 -11
  66. package/dist/components/tab-list/react-aria.js +1 -11
  67. package/dist/components/tab-panels/react-aria.js +1 -11
  68. package/dist/components/table/react-aria.js +1 -11
  69. package/dist/components/table-body/react-aria.js +1 -11
  70. package/dist/components/table-header/react-aria.js +1 -11
  71. package/dist/components/table-load-more-item/react-aria.js +1 -11
  72. package/dist/components/tabs/react-aria.js +1 -11
  73. package/dist/components/tag/react-aria.js +1 -11
  74. package/dist/components/tag-group/react-aria.js +1 -11
  75. package/dist/components/tag-list/react-aria.js +1 -11
  76. package/dist/components/time-picker.js +1 -1
  77. package/dist/components/tree/react-aria.js +1 -11
  78. package/dist/components/tree-item/react-aria.js +1 -11
  79. package/dist/components/tree-item-content/react-aria.js +1 -11
  80. package/dist/components/tree-load-more-item/react-aria.js +1 -11
  81. package/dist/{datePickerValue.utils-u6REHox2.js → datePickerValue.utils-n2HQDle8.js} +1 -1
  82. package/dist/{dynamicInputs-ByTvSdJe.d.ts → dynamicInputs-BasxVhHP.d.ts} +2 -2
  83. package/dist/index.d.ts +2 -2
  84. package/dist/index.js +10 -10
  85. package/dist/{logger-BPhG2izn.js → logger-DpUn65wp.js} +23 -1
  86. package/dist/{query-autocomplete-CHtcx_ND.d.ts → query-autocomplete-E-PMmf1d.d.ts} +1 -1
  87. package/dist/{queryAutocomplete.types-DaTDttX5.d.ts → queryAutocomplete.types-BOH9QnRq.d.ts} +1 -0
  88. package/dist/rhf/date-picker.js +1 -1
  89. package/dist/rhf/date-range-picker.js +1 -1
  90. package/dist/rhf/date-time-picker.js +1 -1
  91. package/dist/rhf/inputs.d.ts +1 -1
  92. package/dist/rhf/query-autocomplete.d.ts +1 -1
  93. package/dist/rhf/select.js +1 -1
  94. package/dist/rhf/text-editor.js +1 -1
  95. package/dist/rhf/time-picker.js +1 -1
  96. package/dist/rhf.d.ts +2 -2
  97. package/dist/rhf.js +10 -10
  98. package/dist/{staticDateTimeSegments-qJUUAL8d.js → staticDateTimeSegments-B5Uuat4L.js} +2 -2
  99. package/dist/{staticSelect.utils-CRyAMXOL.js → staticSelect.utils-BqH-4vxg.js} +3 -3
  100. package/dist/tanstack/date-picker.js +1 -1
  101. package/dist/tanstack/date-range-picker.js +1 -1
  102. package/dist/tanstack/date-time-picker.js +1 -1
  103. package/dist/tanstack/form.d.ts +1 -1
  104. package/dist/tanstack/form.js +1 -1
  105. package/dist/tanstack/inputs.d.ts +2 -2
  106. package/dist/tanstack/inputs.js +1 -1
  107. package/dist/tanstack/select.js +1 -1
  108. package/dist/tanstack/table.js +1 -1
  109. package/dist/tanstack/text-editor.js +1 -1
  110. package/dist/tanstack/time-picker.js +1 -1
  111. package/dist/tanstack.d.ts +3 -3
  112. package/dist/tanstack.js +17 -17
  113. package/dist/text-editor.js +1 -1
  114. package/dist/{useFilter-Cz_G94ya.js → useFilter-BsjdRENO.js} +1 -1
  115. package/dist/{useFormAutosave-Cj75UzUP.js → useFormAutosave-C_SlCky9.js} +1 -1
  116. package/dist/{useTableColumnConfig-CXjUy_VP.js → useTableColumnConfig-BTsMxT8X.js} +2 -2
  117. package/dist/utils/logger.js +1 -1
  118. package/package.json +1 -1
  119. package/dist/rolldown-runtime-DUp30N8C.js +0 -28
@@ -1,11 +1 @@
1
- import e,{cloneElement as t,createContext as n,forwardRef as r,isValidElement as i,useCallback as a,useContext as o,useEffect as s,useMemo as c,useRef as l,useState as u}from"react";import{filterDOMProps as d,inertValue as f,mergeProps as p,mergeRefs as m,useLayoutEffect as h,useLoadMoreSentinel as g,useObjectRef as _}from"@react-aria/utils";import{FocusableContext as v}from"@react-aria/interactions";import{createPortal as y}from"react-dom";import{FocusScope as ee,ListKeyboardDelegate as te,mergeProps as b,useCollator as ne,useFocusRing as re,useGridList as ie,useLocale as ae,useVisuallyHidden as x}from"react-aria";import{UNSTABLE_useFilteredListState as oe,useListState as se}from"react-stately";var S=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),C=(e=>typeof require<`u`?require:typeof Proxy<`u`?new Proxy(e,{get:(e,t)=>(typeof require<`u`?require:e)[t]}):e)(function(e){if(typeof require<`u`)return require.apply(this,arguments);throw Error('Calling `require` for "'+e+"\" in an environment that doesn't expose the `require` function. See https://rolldown.rs/in-depth/bundling-cjs#require-external-modules for more details.")});n(null),n(null),n(null),n(null),n(null),n({});const ce=n(null);n(null);const w=Symbol(`default`);function le({values:t,children:n}){for(let[r,i]of t)n=e.createElement(r.Provider,{value:i},n);return n}function T(e){let{className:t,style:n,children:r,defaultClassName:i,defaultChildren:a,defaultStyle:o,values:s,render:l}=e;return c(()=>{let e,c,u;return e=typeof t==`function`?t({...s,defaultClassName:i}):t,c=typeof n==`function`?n({...s,defaultStyle:o||{}}):n,u=typeof r==`function`?r({...s,defaultChildren:a}):r??a,{className:e??i,style:c||o?{...o,...c}:void 0,children:u??a,"data-rac":``,render:l?e=>l(e,s):void 0}},[t,n,r,i,a,o,s,l])}function E(e,t){let n=o(e);if(t===null)return null;if(n&&typeof n==`object`&&`slots`in n&&n.slots){let e=t||w;if(!n.slots[e]){let e=new Intl.ListFormat().format(Object.keys(n.slots).map(e=>`"${e}"`)),r=t?`Invalid slot "${t}".`:`A slot prop is required.`;throw Error(`${r} Valid slot names are ${e}.`)}return n.slots[e]}return n}function D(e,t,n){let{ref:r,...i}=E(n,e.slot)||{},a=_(c(()=>m(t,r),[t,r])),o=p(i,e);return`style`in i&&i.style&&`style`in e&&e.style&&(o.style=typeof i.style==`function`||typeof e.style==`function`?t=>{let n=typeof i.style==`function`?i.style(t):i.style,r={...t.defaultStyle,...n},a=typeof e.style==`function`?e.style({...t,defaultStyle:r}):e.style;return{...r,...a}}:{...i.style,...e.style}),[o,a]}function O(t,n,r){let{render:i,...a}=n,o=l(null),s=c(()=>m(r,o),[r,o]);h(()=>{},[t,i]);let u={...a,ref:s};return i?i(u,void 0):e.createElement(t,u)}const k={},A=new Proxy({},{get(e,t){if(typeof t!=`string`)return;let n=k[t];return n||(n=r(O.bind(null,t)),k[t]=n),n}});String(Math.round(Math.random()*1e10));const j=e.createContext(!1);typeof window<`u`&&window.document&&window.document.createElement,e.useId;function M(){return!1}function N(){return!0}function P(e){return()=>{}}function F(){return typeof e.useSyncExternalStore==`function`?e.useSyncExternalStore(P,M,N):o(j)}var I=class{get childNodes(){throw Error(`childNodes is not supported`)}clone(){let e=new this.constructor(this.key);return e.value=this.value,e.level=this.level,e.hasChildNodes=this.hasChildNodes,e.rendered=this.rendered,e.textValue=this.textValue,e[`aria-label`]=this[`aria-label`],e.index=this.index,e.parentKey=this.parentKey,e.prevKey=this.prevKey,e.nextKey=this.nextKey,e.firstChildKey=this.firstChildKey,e.lastChildKey=this.lastChildKey,e.props=this.props,e.render=this.render,e.colSpan=this.colSpan,e.colIndex=this.colIndex,e}filter(e,t,n){let r=this.clone();return t.addDescendants(r,e),r}constructor(e){this.value=null,this.level=0,this.hasChildNodes=!1,this.rendered=null,this.textValue=``,this[`aria-label`]=void 0,this.index=0,this.parentKey=null,this.prevKey=null,this.nextKey=null,this.firstChildKey=null,this.lastChildKey=null,this.props={},this.colSpan=null,this.colIndex=null,this.type=this.constructor.type,this.key=e}},L=class extends I{filter(e,t,n){let[r,i]=U(e,t,this.firstChildKey,n),a=this.clone();return a.firstChildKey=r,a.lastChildKey=i,a}},R=class extends I{};R.type=`header`;var z=class extends I{};z.type=`loader`;var B=class extends L{filter(e,t,n){if(n(this.textValue,this)){let n=this.clone();return t.addDescendants(n,e),n}return null}};B.type=`item`;var V=class extends L{filter(e,t,n){let r=super.filter(e,t,n);if(r&&r.lastChildKey!==null){let t=e.getItem(r.lastChildKey);if(t&&t.type!==`header`)return r}return null}};V.type=`section`;var H=class{get size(){return this.itemCount}getKeys(){return this.keyMap.keys()}*[Symbol.iterator](){let e=this.firstKey==null?void 0:this.keyMap.get(this.firstKey);for(;e;)yield e,e=e.nextKey==null?void 0:this.keyMap.get(e.nextKey)}getChildren(e){let t=this.keyMap;return{*[Symbol.iterator](){let n=t.get(e),r=n?.firstChildKey==null?null:t.get(n.firstChildKey);for(;r;)yield r,r=r.nextKey==null?void 0:t.get(r.nextKey)}}}getKeyBefore(e){let t=this.keyMap.get(e);if(!t)return null;if(t.prevKey!=null){for(t=this.keyMap.get(t.prevKey);t&&t.type!==`item`&&t.lastChildKey!=null;)t=this.keyMap.get(t.lastChildKey);return t?.key??null}return t.parentKey}getKeyAfter(e){let t=this.keyMap.get(e);if(!t)return null;if(t.type!==`item`&&t.firstChildKey!=null)return t.firstChildKey;for(;t;){if(t.nextKey!=null)return t.nextKey;if(t.parentKey!=null)t=this.keyMap.get(t.parentKey);else return null}return null}getFirstKey(){return this.firstKey}getLastKey(){let e=this.lastKey==null?null:this.keyMap.get(this.lastKey);for(;e?.lastChildKey!=null;)e=this.keyMap.get(e.lastChildKey);return e?.key??null}getItem(e){return this.keyMap.get(e)??null}at(){throw Error(`Not implemented`)}clone(){let e=this.constructor,t=new e;return t.keyMap=new Map(this.keyMap),t.firstKey=this.firstKey,t.lastKey=this.lastKey,t.itemCount=this.itemCount,t}addNode(e){if(this.frozen)throw Error(`Cannot add a node to a frozen collection`);e.type===`item`&&this.keyMap.get(e.key)==null&&this.itemCount++,this.keyMap.set(e.key,e)}addDescendants(e,t){this.addNode(e);let n=t.getChildren(e.key);for(let e of n)this.addDescendants(e,t)}removeNode(e){if(this.frozen)throw Error(`Cannot remove a node to a frozen collection`);let t=this.keyMap.get(e);t!=null&&t.type===`item`&&this.itemCount--,this.keyMap.delete(e)}commit(e,t,n=!1){if(this.frozen)throw Error(`Cannot commit a frozen collection`);this.firstKey=e,this.lastKey=t,this.frozen=!n}filter(e){let t=new this.constructor,[n,r]=U(this,t,this.firstKey,e);return t?.commit(n,r),t}constructor(){this.keyMap=new Map,this.firstKey=null,this.lastKey=null,this.frozen=!1,this.itemCount=0}};function U(e,t,n,r){if(n==null)return[null,null];let i=null,a=null,o=e.getItem(n);for(;o!=null;){let n=o.filter(e,t,r);n!=null&&(n.nextKey=null,a&&(n.prevKey=a.key,a.nextKey=n.key),i??=n,t.addNode(n),a=n),o=o.nextKey?e.getItem(o.nextKey):null}if(a&&a.type===`separator`){let e=a.prevKey;t.removeNode(a.key),e?(a=t.getItem(e),a.nextKey=null):a=null}return[i?.key??null,a?.key??null]}var W=class{*[Symbol.iterator](){let e=this.firstChild;for(;e;)yield e,e=e.nextSibling}get firstChild(){return this._firstChild}set firstChild(e){this._firstChild=e,this.ownerDocument.markDirty(this)}get lastChild(){return this._lastChild}set lastChild(e){this._lastChild=e,this.ownerDocument.markDirty(this)}get previousSibling(){return this._previousSibling}set previousSibling(e){this._previousSibling=e,this.ownerDocument.markDirty(this)}get nextSibling(){return this._nextSibling}set nextSibling(e){this._nextSibling=e,this.ownerDocument.markDirty(this)}get parentNode(){return this._parentNode}set parentNode(e){this._parentNode=e,this.ownerDocument.markDirty(this)}get isConnected(){return this.parentNode?.isConnected||!1}invalidateChildIndices(e){(this._minInvalidChildIndex==null||!this._minInvalidChildIndex.isConnected||e.index<this._minInvalidChildIndex.index)&&(this._minInvalidChildIndex=e,this.ownerDocument.markDirty(this))}updateChildIndices(){let e=this._minInvalidChildIndex;for(;e;)e.index=e.previousSibling?e.previousSibling.index+1:0,e=e.nextSibling;this._minInvalidChildIndex=null}appendChild(e){e.parentNode&&e.parentNode.removeChild(e),this.firstChild??=e,this.lastChild?(this.lastChild.nextSibling=e,e.index=this.lastChild.index+1,e.previousSibling=this.lastChild):(e.previousSibling=null,e.index=0),e.parentNode=this,e.nextSibling=null,this.lastChild=e,this.ownerDocument.markDirty(this),this.isConnected&&this.ownerDocument.queueUpdate()}insertBefore(e,t){if(t==null)return this.appendChild(e);e.parentNode&&e.parentNode.removeChild(e),e.nextSibling=t,e.previousSibling=t.previousSibling,e.index=t.index-1,this.firstChild===t?this.firstChild=e:t.previousSibling&&(t.previousSibling.nextSibling=e),t.previousSibling=e,e.parentNode=t.parentNode,this.invalidateChildIndices(e),this.isConnected&&this.ownerDocument.queueUpdate()}removeChild(e){e.parentNode===this&&(this._minInvalidChildIndex===e&&(this._minInvalidChildIndex=null),e.nextSibling&&(this.invalidateChildIndices(e.nextSibling),e.nextSibling.previousSibling=e.previousSibling),e.previousSibling&&(e.previousSibling.nextSibling=e.nextSibling),this.firstChild===e&&(this.firstChild=e.nextSibling),this.lastChild===e&&(this.lastChild=e.previousSibling),e.parentNode=null,e.nextSibling=null,e.previousSibling=null,e.index=0,this.ownerDocument.markDirty(e),this.isConnected&&this.ownerDocument.queueUpdate())}addEventListener(){}removeEventListener(){}get previousVisibleSibling(){let e=this.previousSibling;for(;e&&e.isHidden;)e=e.previousSibling;return e}get nextVisibleSibling(){let e=this.nextSibling;for(;e&&e.isHidden;)e=e.nextSibling;return e}get firstVisibleChild(){let e=this.firstChild;for(;e&&e.isHidden;)e=e.nextSibling;return e}get lastVisibleChild(){let e=this.lastChild;for(;e&&e.isHidden;)e=e.previousSibling;return e}constructor(e){this._firstChild=null,this._lastChild=null,this._previousSibling=null,this._nextSibling=null,this._parentNode=null,this._minInvalidChildIndex=null,this.ownerDocument=e}},G=class e extends W{get index(){return this._index}set index(e){this._index=e,this.ownerDocument.markDirty(this)}get level(){return this.parentNode instanceof e?this.parentNode.level+ +(this.node?.type===`item`):0}getMutableNode(){return this.node==null?null:(this.isMutated||=(this.node=this.node.clone(),!0),this.ownerDocument.markDirty(this),this.node)}updateNode(){let t=this.nextVisibleSibling,n=this.getMutableNode();if(n!=null&&(n.index=this.index,n.level=this.level,n.parentKey=this.parentNode instanceof e?this.parentNode.node?.key??null:null,n.prevKey=this.previousVisibleSibling?.node?.key??null,n.nextKey=t?.node?.key??null,n.hasChildNodes=!!this.firstChild,n.firstChildKey=this.firstVisibleChild?.node?.key??null,n.lastChildKey=this.lastVisibleChild?.node?.key??null,(n.colSpan!=null||n.colIndex!=null)&&t)){let e=(n.colIndex??n.index)+(n.colSpan??1);if(t.node!=null&&e!==t.node.colIndex){let n=t.getMutableNode();n.colIndex=e}}}setProps(e,t,n,r,i){let a,{value:o,textValue:s,id:c,...l}=e;if(this.node==null?(a=new n(c??`react-aria-${++this.ownerDocument.nodeId}`),this.node=a):a=this.getMutableNode(),l.ref=t,a.props=l,a.rendered=r,a.render=i,a.value=o,e[`aria-label`]&&(a[`aria-label`]=e[`aria-label`]),a.textValue=s||(typeof l.children==`string`?l.children:``)||e[`aria-label`]||``,c!=null&&c!==a.key)throw Error(`Cannot change the id of an item`);l.colSpan!=null&&(a.colSpan=l.colSpan),this.isConnected&&this.ownerDocument.queueUpdate()}get style(){let e=this;return{get display(){return e.isHidden?`none`:``},set display(t){let n=t===`none`;if(e.isHidden!==n){(e.parentNode?.firstVisibleChild===e||e.parentNode?.lastVisibleChild===e)&&e.ownerDocument.markDirty(e.parentNode);let t=e.previousVisibleSibling,r=e.nextVisibleSibling;t&&e.ownerDocument.markDirty(t),r&&e.ownerDocument.markDirty(r),e.isHidden=n,e.ownerDocument.markDirty(e)}}}}hasAttribute(){}setAttribute(){}setAttributeNS(){}removeAttribute(){}constructor(e,t){super(t),this.nodeType=8,this.isMutated=!0,this._index=0,this.isHidden=!1,this.node=null}},K=class extends W{get isConnected(){return!0}createElement(e){return new G(e,this)}getMutableCollection(){return this.nextCollection||=this.collection.clone(),this.nextCollection}markDirty(e){this.dirtyNodes.add(e)}addNode(e){if(e.isHidden||e.node==null)return;let t=this.getMutableCollection();if(!t.getItem(e.node.key))for(let t of e)this.addNode(t);t.addNode(e.node)}removeNode(e){for(let t of e)this.removeNode(t);e.node&&this.getMutableCollection().removeNode(e.node.key)}getCollection(){return this.inSubscription?this.collection.clone():(this.queuedRender=!1,this.updateCollection(),this.collection)}updateCollection(){for(let e of this.dirtyNodes)e instanceof G&&(!e.isConnected||e.isHidden)?this.removeNode(e):e.updateChildIndices();for(let e of this.dirtyNodes)e instanceof G?(e.isConnected&&!e.isHidden&&(e.updateNode(),this.addNode(e)),e.node&&this.dirtyNodes.delete(e),e.isMutated=!1):this.dirtyNodes.delete(e);this.nextCollection&&(this.nextCollection.commit(this.firstVisibleChild?.node?.key??null,this.lastVisibleChild?.node?.key??null,this.isSSR),this.isSSR||(this.collection=this.nextCollection,this.nextCollection=null))}queueUpdate(){if(!(this.dirtyNodes.size===0||this.queuedRender)){this.queuedRender=!0,this.inSubscription=!0;for(let e of this.subscriptions)e();this.inSubscription=!1}}subscribe(e){return this.subscriptions.add(e),()=>this.subscriptions.delete(e)}resetAfterSSR(){this.isSSR&&(this.isSSR=!1,this.firstChild=null,this.lastChild=null,this.nodeId=0)}constructor(e){super(null),this.nodeType=11,this.ownerDocument=this,this.dirtyNodes=new Set,this.isSSR=!1,this.nodeId=0,this.nodesByProps=new WeakMap,this.nextCollection=null,this.subscriptions=new Set,this.queuedRender=!1,this.inSubscription=!1,this.collection=e,this.nextCollection=e}};function q(e){let{children:n,items:r,idScope:i,addIdAndValue:a,dependencies:o=[]}=e,s=c(()=>new WeakMap,o);return c(()=>{if(r&&typeof n==`function`){let e=[];for(let o of r){let r=s.get(o);if(!r){r=n(o);let e=r.props.id??o.key??o.id;if(e==null)throw Error(`Could not determine key for item`);i!=null&&(e=i+`:`+e),r=t(r,a?{key:e,id:e,value:o}:{key:e}),s.set(o,r)}e.push(r)}return e}if(typeof n!=`function`)return n},[n,r,s,i,a])}if(typeof HTMLTemplateElement<`u`){let e=Object.getOwnPropertyDescriptor(Node.prototype,`firstChild`).get;Object.defineProperty(HTMLTemplateElement.prototype,"firstChild",{configurable:!0,enumerable:!0,get:function(){return this.dataset.reactAriaHidden?this.content.firstChild:e.call(this)}})}const J=n(!1);function ue(t){if(o(J))return e.createElement(e.Fragment,null,t.children);let n=e.createElement(J.Provider,{value:!0},t.children);return e.createElement(`template`,{"data-react-aria-hidden":!0},n)}
2
- /**
3
- * @license React
4
- * use-sync-external-store-shim.production.js
5
- *
6
- * Copyright (c) Meta Platforms, Inc. and affiliates.
7
- *
8
- * This source code is licensed under the MIT license found in the
9
- * LICENSE file in the root directory of this source tree.
10
- */
11
- var de=S((e=>{var t=C(`react`);function n(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var r=typeof Object.is==`function`?Object.is:n,i=t.useState,a=t.useEffect,o=t.useLayoutEffect,s=t.useDebugValue;function c(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),c=r[0].inst,u=r[1];return o(function(){c.value=n,c.getSnapshot=t,l(c)&&u({inst:c})},[e,n,t]),a(function(){return l(c)&&u({inst:c}),e(function(){l(c)&&u({inst:c})})},[e]),s(n),n}function l(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch{return!0}}function u(e,t){return t()}var d=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?u:c;e.useSyncExternalStore=t.useSyncExternalStore===void 0?d:t.useSyncExternalStore})),fe=S(((e,t)=>{t.exports=de()}))();const Y=n(!1),X=n(null);function pe(t){if(o(X))return t.content;let{collection:n,document:r}=_e(t.createCollection);return e.createElement(e.Fragment,null,e.createElement(ue,null,e.createElement(X.Provider,{value:r},t.content)),e.createElement(me,{render:t.children,collection:n}))}function me({collection:e,render:t}){return t(e)}function he(e,t,n){let r=F(),i=l(r);i.current=r;let o=a(()=>i.current?n():t(),[t,n]);return(0,fe.useSyncExternalStore)(e,o)}const ge=typeof e.useSyncExternalStore==`function`?e.useSyncExternalStore:he;function _e(e){let[t]=u(()=>new K(e?.()||new H)),n=a(e=>t.subscribe(e),[t]),r=a(()=>{let e=t.getCollection();return t.isSSR&&t.resetAfterSSR(),e},[t]),i=a(()=>(t.isSSR=!0,t.getCollection()),[t]);return{collection:ge(n,r,i),document:t}}const Z=n(null);function ve(e){var t;return t=class extends I{},t.type=e,t}function ye(t,n,r,i,s,c){typeof t==`string`&&(t=ve(t));let l=a(e=>{e?.setProps(n,r,t,i,c)},[n,r,i,c,t]),u=o(Z);if(u){let a=u.ownerDocument.nodesByProps.get(n);return a||(a=u.ownerDocument.createElement(t.type),a.setProps(n,r,t,i,c),u.appendChild(a),u.ownerDocument.updateCollection(),u.ownerDocument.nodesByProps.set(n,a)),s?e.createElement(Z.Provider,{value:a},s):null}return e.createElement(t.type,{ref:l},s)}function be(t,n){let i=({node:e})=>n(e.props,e.props.ref,e),a=r((r,a)=>{let s=o(v);if(!o(Y)){if(n.length>=3)throw Error(n.name+` cannot be rendered outside a collection.`);return n(r,a)}return ye(t,r,a,`children`in r?r.children:null,null,t=>e.createElement(v.Provider,{value:s},e.createElement(i,{node:t})))});return a.displayName=n.name,a}function xe(e){return q({...e,addIdAndValue:!0})}const Se=n(null);function Ce(t){let n=o(Se),r=(n?.dependencies||[]).concat(t.dependencies),i=t.idScope??n?.idScope,a=xe({...t,idScope:i,dependencies:r});return o(X)&&(a=e.createElement(we,null,a)),n=c(()=>({dependencies:r,idScope:i}),[i,...r]),e.createElement(Se.Provider,{value:n},a)}function we({children:t}){let n=o(X),r=c(()=>e.createElement(X.Provider,{value:null},e.createElement(Y.Provider,{value:!0},t)),[t]);return F()?e.createElement(Z.Provider,{value:n},r):y(r,n)}const Te={CollectionRoot({collection:e,renderDropIndicator:t}){return Ee(e,null,t)},CollectionBranch({collection:e,parent:t,renderDropIndicator:n}){return Ee(e,t,n)}};function Ee(t,n,r){return q({items:n?t.getChildren(n.key):t,dependencies:[r],children(n){let i=n.render(n);return!r||n.type!==`item`?i:e.createElement(e.Fragment,null,r({type:`item`,key:n.key,dropPosition:`before`}),i,De(t,n,r))}})}function De(e,n,r){let a=n.key,o=e.getKeyAfter(a),s=o==null?null:e.getItem(o);for(;s!=null&&s.type!==`item`;)o=e.getKeyAfter(s.key),s=o==null?null:e.getItem(o);let c=n.nextKey==null?null:e.getItem(n.nextKey);for(;c!=null&&c.type!==`item`;)c=c.nextKey==null?null:e.getItem(c.nextKey);let l=[];if(c==null){let a=n;for(;a?.type===`item`&&(!s||a.parentKey!==s.parentKey&&s.level<a.level);){let n=r({type:`item`,key:a.key,dropPosition:`after`});i(n)&&l.push(t(n,{key:`${a.key}-after`})),a=a.parentKey==null?null:e.getItem(a.parentKey)}}return l}const Oe=n(Te),Q=n({}),ke=n(null),Ae=r(function(t,n){let{render:r}=o(ke);return e.createElement(e.Fragment,null,r(t,n))});function je(t,n){let r=t?.renderDropIndicator,i=t?.isVirtualDragging?.call(t),o=a(t=>{if(i||n?.isDropTarget(t))return r?r(t):e.createElement(Ae,{target:t})},[n?.target,i,r]);return t?.useDropIndicator?o:void 0}function Me(e,t,n){let r=e.focusedKey,i=null;if(t!=null&&t.isVirtualDragging?.call(t)&&n?.target?.type===`item`&&(i=n.target.key,n.target.dropPosition===`after`)){let e=n.collection.getKeyAfter(i),t=null;if(e!=null){let r=n.collection.getItem(i)?.level??0;for(;e;){let i=n.collection.getItem(e);if(!i)break;if(i.type!==`item`){e=n.collection.getKeyAfter(e);continue}if((i.level??0)<=r)break;t=e,e=n.collection.getKeyAfter(e)}}i=e??t??i}return c(()=>new Set([r,i].filter(e=>e!=null)),[r,i])}const Ne=n(null);function Pe(t){let n=l({});return e.createElement(Ne.Provider,{value:n},t.children)}const $=n(null);be(z,function(t,n,r){let i=o($),{isLoading:a,onLoadMore:s,scrollOffset:u,...p}=t,m=l(null),h=c(()=>({onLoadMore:s,collection:i?.collection,sentinelRef:m,scrollOffset:u}),[s,u,i?.collection]);g(h,m);let _=T({...p,id:void 0,children:r.rendered,defaultClassName:`react-aria-ListBoxLoadingIndicator`,values:void 0});return e.createElement(e.Fragment,null,e.createElement(`div`,{style:{position:`relative`,width:0,height:0},inert:f(!0)},e.createElement(`div`,{"data-testid":`loadMoreSentinel`,ref:m,style:{position:`absolute`,height:1,width:1}})),a&&_.children&&e.createElement(A.div,{...b(d(t,{global:!0}),{tabIndex:-1}),..._,role:`option`,ref:n},_.children))});const Fe=n(null),Ie=r(function(t,n){return[t,n]=D(t,n,Fe),e.createElement(pe,{content:e.createElement(Ce,t)},r=>e.createElement(Le,{props:t,collection:r,gridListRef:n}))});function Le({props:t,collection:n,gridListRef:r}){[t,r]=D(t,r,ce);let{shouldUseVirtualFocus:i,filter:a,disallowTypeAhead:u,...f}=t,{dragAndDropHooks:p,keyboardNavigationBehavior:m=`arrow`,layout:h=`stack`}=t,{CollectionRoot:g,isVirtualized:_,layoutDelegate:v,dropTargetDelegate:y}=o(Oe),x=se({...f,collection:n,children:void 0,layoutDelegate:v}),S=oe(x,a),C=ne({usage:`search`,sensitivity:`base`}),{disabledBehavior:w,disabledKeys:E}=S.selectionManager,{direction:O}=ae(),k=c(()=>new te({collection:S.collection,collator:C,ref:r,disabledKeys:E,disabledBehavior:w,layoutDelegate:v,layout:h,direction:O}),[S.collection,r,h,E,w,v,C,O]),{gridProps:j}=ie({...f,keyboardDelegate:k,keyboardNavigationBehavior:h===`grid`?`tab`:m,isVirtualized:_,shouldSelectOnPressUp:t.shouldSelectOnPressUp,disallowTypeAhead:u},S,r),M=S.selectionManager,N=!!p?.useDraggableCollectionState,P=!!p?.useDroppableCollectionState;l(N),l(P),s(()=>{},[N,P]);let F,I,L,R=!1,z=null,B=l(null);if(N&&p){F=p.useDraggableCollectionState({collection:S.collection,selectionManager:M,preview:p.renderDragPreview?B:void 0}),p.useDraggableCollection({},F,r);let t=p.DragPreview;z=p.renderDragPreview?e.createElement(t,{ref:B},p.renderDragPreview):null}if(P&&p){I=p.useDroppableCollectionState({collection:S.collection,selectionManager:M});let e=new te({collection:S.collection,disabledKeys:M.disabledKeys,disabledBehavior:M.disabledBehavior,ref:r}),t=p.dropTargetDelegate||y||new p.ListDropTargetDelegate(n,r,{layout:h,direction:O});L=p.useDroppableCollection({keyboardDelegate:e,dropTargetDelegate:t},I,r),R=I.isDropTarget({type:`root`})}let{focusProps:V,isFocused:H,isFocusVisible:U}=re(),W=S.collection.size===0,G={isDropTarget:R,isEmpty:W,isFocused:H,isFocusVisible:U,layout:h,state:S},K=T({...t,children:void 0,defaultClassName:`react-aria-GridList`,values:G}),q=null;if(W&&t.renderEmptyState){let n=t.renderEmptyState(G);q=e.createElement(`div`,{role:`row`,"aria-rowindex":1,style:{display:`contents`}},e.createElement(`div`,{role:`gridcell`,style:{display:`contents`}},n))}let J=d(t,{global:!0});return e.createElement(ee,null,e.createElement(A.div,{...b(J,K,j,V,L?.collectionProps,null),ref:r,slot:t.slot||void 0,onScroll:t.onScroll,"data-drop-target":R||void 0,"data-empty":W||void 0,"data-focused":H||void 0,"data-focus-visible":U||void 0,"data-layout":h},e.createElement(le,{values:[[$,S],[Q,{dragAndDropHooks:p,dragState:F,dropState:I}],[ke,{render:Re}]]},P&&e.createElement(Ve,null),e.createElement(Pe,null,e.createElement(g,{collection:S.collection,scrollRef:r,persistedKeys:Me(M,p,I),renderDropIndicator:je(p,I)}))),q,z))}function Re(t,n){n=_(n);let{dragAndDropHooks:r,dropState:i}=o(Q),a=l(null),{dropIndicatorProps:s,isHidden:c,isDropTarget:u}=r.useDropIndicator(t,i,a);return c?null:e.createElement(Be,{...t,dropIndicatorProps:s,isDropTarget:u,buttonRef:a,ref:n})}function ze(t,n){let{dropIndicatorProps:r,isDropTarget:i,buttonRef:a,...o}=t,{visuallyHiddenProps:s}=x(),c=T({...o,defaultClassName:`react-aria-DropIndicator`,values:{isDropTarget:i}});return e.createElement(A.div,{...c,role:`row`,ref:n,"data-drop-target":i||void 0},e.createElement(`div`,{role:`gridcell`},e.createElement(`div`,{...s,role:`button`,...r,ref:a}),c.children))}const Be=r(ze);function Ve(){let{dragAndDropHooks:t,dropState:n}=o(Q),r=l(null),{dropIndicatorProps:i}=t.useDropIndicator({target:{type:`root`}},n,r),a=n.isDropTarget({type:`root`}),{visuallyHiddenProps:s}=x();return!a&&i[`aria-hidden`]?null:e.createElement(`div`,{role:`row`,"aria-hidden":i[`aria-hidden`],style:{position:`absolute`}},e.createElement(`div`,{role:`gridcell`},e.createElement(`div`,{role:`button`,...s,...i,ref:r})))}be(z,function(t,n,r){let i=o($),{isVirtualized:a}=o(Oe),{isLoading:s,onLoadMore:u,scrollOffset:p,...m}=t,h=l(null),_=c(()=>({onLoadMore:u,collection:i?.collection,sentinelRef:h,scrollOffset:p}),[u,p,i?.collection]);g(_,h);let v=T({...m,id:void 0,children:r.rendered,defaultClassName:`react-aria-GridListLoadingIndicator`,values:void 0});return e.createElement(e.Fragment,null,e.createElement(`div`,{style:{position:`relative`,width:0,height:0},inert:f(!0)},e.createElement(`div`,{"data-testid":`loadMoreSentinel`,ref:h,style:{position:`absolute`,height:1,width:1}})),s&&v.children&&e.createElement(A.div,{...v,...d(t,{global:!0}),role:`row`,ref:n},e.createElement(`div`,{"aria-colindex":a?1:void 0,role:`gridcell`},v.children)))});export{Ie as GridList};
1
+ import e,{cloneElement as t,createContext as n,forwardRef as r,isValidElement as i,useCallback as a,useContext as o,useEffect as s,useMemo as c,useRef as l,useState as u,useSyncExternalStore as d}from"react";import{filterDOMProps as f,inertValue as p,mergeProps as m,mergeRefs as h,useLayoutEffect as g,useLoadMoreSentinel as _,useObjectRef as v}from"@react-aria/utils";import{FocusableContext as y}from"@react-aria/interactions";import{createPortal as ee}from"react-dom";import{FocusScope as te,ListKeyboardDelegate as b,mergeProps as x,useCollator as ne,useFocusRing as re,useGridList as ie,useLocale as ae,useVisuallyHidden as S}from"react-aria";import{UNSTABLE_useFilteredListState as oe,useListState as se}from"react-stately";n(null),n(null),n(null),n(null),n(null),n({});const ce=n(null);n(null);const C=Symbol(`default`);function le({values:t,children:n}){for(let[r,i]of t)n=e.createElement(r.Provider,{value:i},n);return n}function w(e){let{className:t,style:n,children:r,defaultClassName:i,defaultChildren:a,defaultStyle:o,values:s,render:l}=e;return c(()=>{let e,c,u;return e=typeof t==`function`?t({...s,defaultClassName:i}):t,c=typeof n==`function`?n({...s,defaultStyle:o||{}}):n,u=typeof r==`function`?r({...s,defaultChildren:a}):r??a,{className:e??i,style:c||o?{...o,...c}:void 0,children:u??a,"data-rac":``,render:l?e=>l(e,s):void 0}},[t,n,r,i,a,o,s,l])}function T(e,t){let n=o(e);if(t===null)return null;if(n&&typeof n==`object`&&`slots`in n&&n.slots){let e=t||C;if(!n.slots[e]){let e=new Intl.ListFormat().format(Object.keys(n.slots).map(e=>`"${e}"`)),r=t?`Invalid slot "${t}".`:`A slot prop is required.`;throw Error(`${r} Valid slot names are ${e}.`)}return n.slots[e]}return n}function E(e,t,n){let{ref:r,...i}=T(n,e.slot)||{},a=v(c(()=>h(t,r),[t,r])),o=m(i,e);return`style`in i&&i.style&&`style`in e&&e.style&&(o.style=typeof i.style==`function`||typeof e.style==`function`?t=>{let n=typeof i.style==`function`?i.style(t):i.style,r={...t.defaultStyle,...n},a=typeof e.style==`function`?e.style({...t,defaultStyle:r}):e.style;return{...r,...a}}:{...i.style,...e.style}),[o,a]}function D(t,n,r){let{render:i,...a}=n,o=l(null),s=c(()=>h(r,o),[r,o]);g(()=>{},[t,i]);let u={...a,ref:s};return i?i(u,void 0):e.createElement(t,u)}const O={},k=new Proxy({},{get(e,t){if(typeof t!=`string`)return;let n=O[t];return n||(n=r(D.bind(null,t)),O[t]=n),n}});String(Math.round(Math.random()*1e10));const A=e.createContext(!1);typeof window<`u`&&window.document&&window.document.createElement,e.useId;function j(){return!1}function M(){return!0}function N(e){return()=>{}}function P(){return typeof e.useSyncExternalStore==`function`?e.useSyncExternalStore(N,j,M):o(A)}var F=class{get childNodes(){throw Error(`childNodes is not supported`)}clone(){let e=new this.constructor(this.key);return e.value=this.value,e.level=this.level,e.hasChildNodes=this.hasChildNodes,e.rendered=this.rendered,e.textValue=this.textValue,e[`aria-label`]=this[`aria-label`],e.index=this.index,e.parentKey=this.parentKey,e.prevKey=this.prevKey,e.nextKey=this.nextKey,e.firstChildKey=this.firstChildKey,e.lastChildKey=this.lastChildKey,e.props=this.props,e.render=this.render,e.colSpan=this.colSpan,e.colIndex=this.colIndex,e}filter(e,t,n){let r=this.clone();return t.addDescendants(r,e),r}constructor(e){this.value=null,this.level=0,this.hasChildNodes=!1,this.rendered=null,this.textValue=``,this[`aria-label`]=void 0,this.index=0,this.parentKey=null,this.prevKey=null,this.nextKey=null,this.firstChildKey=null,this.lastChildKey=null,this.props={},this.colSpan=null,this.colIndex=null,this.type=this.constructor.type,this.key=e}},I=class extends F{filter(e,t,n){let[r,i]=H(e,t,this.firstChildKey,n),a=this.clone();return a.firstChildKey=r,a.lastChildKey=i,a}},L=class extends F{};L.type=`header`;var R=class extends F{};R.type=`loader`;var z=class extends I{filter(e,t,n){if(n(this.textValue,this)){let n=this.clone();return t.addDescendants(n,e),n}return null}};z.type=`item`;var B=class extends I{filter(e,t,n){let r=super.filter(e,t,n);if(r&&r.lastChildKey!==null){let t=e.getItem(r.lastChildKey);if(t&&t.type!==`header`)return r}return null}};B.type=`section`;var V=class{get size(){return this.itemCount}getKeys(){return this.keyMap.keys()}*[Symbol.iterator](){let e=this.firstKey==null?void 0:this.keyMap.get(this.firstKey);for(;e;)yield e,e=e.nextKey==null?void 0:this.keyMap.get(e.nextKey)}getChildren(e){let t=this.keyMap;return{*[Symbol.iterator](){let n=t.get(e),r=n?.firstChildKey==null?null:t.get(n.firstChildKey);for(;r;)yield r,r=r.nextKey==null?void 0:t.get(r.nextKey)}}}getKeyBefore(e){let t=this.keyMap.get(e);if(!t)return null;if(t.prevKey!=null){for(t=this.keyMap.get(t.prevKey);t&&t.type!==`item`&&t.lastChildKey!=null;)t=this.keyMap.get(t.lastChildKey);return t?.key??null}return t.parentKey}getKeyAfter(e){let t=this.keyMap.get(e);if(!t)return null;if(t.type!==`item`&&t.firstChildKey!=null)return t.firstChildKey;for(;t;){if(t.nextKey!=null)return t.nextKey;if(t.parentKey!=null)t=this.keyMap.get(t.parentKey);else return null}return null}getFirstKey(){return this.firstKey}getLastKey(){let e=this.lastKey==null?null:this.keyMap.get(this.lastKey);for(;e?.lastChildKey!=null;)e=this.keyMap.get(e.lastChildKey);return e?.key??null}getItem(e){return this.keyMap.get(e)??null}at(){throw Error(`Not implemented`)}clone(){let e=this.constructor,t=new e;return t.keyMap=new Map(this.keyMap),t.firstKey=this.firstKey,t.lastKey=this.lastKey,t.itemCount=this.itemCount,t}addNode(e){if(this.frozen)throw Error(`Cannot add a node to a frozen collection`);e.type===`item`&&this.keyMap.get(e.key)==null&&this.itemCount++,this.keyMap.set(e.key,e)}addDescendants(e,t){this.addNode(e);let n=t.getChildren(e.key);for(let e of n)this.addDescendants(e,t)}removeNode(e){if(this.frozen)throw Error(`Cannot remove a node to a frozen collection`);let t=this.keyMap.get(e);t!=null&&t.type===`item`&&this.itemCount--,this.keyMap.delete(e)}commit(e,t,n=!1){if(this.frozen)throw Error(`Cannot commit a frozen collection`);this.firstKey=e,this.lastKey=t,this.frozen=!n}filter(e){let t=new this.constructor,[n,r]=H(this,t,this.firstKey,e);return t?.commit(n,r),t}constructor(){this.keyMap=new Map,this.firstKey=null,this.lastKey=null,this.frozen=!1,this.itemCount=0}};function H(e,t,n,r){if(n==null)return[null,null];let i=null,a=null,o=e.getItem(n);for(;o!=null;){let n=o.filter(e,t,r);n!=null&&(n.nextKey=null,a&&(n.prevKey=a.key,a.nextKey=n.key),i??=n,t.addNode(n),a=n),o=o.nextKey?e.getItem(o.nextKey):null}if(a&&a.type===`separator`){let e=a.prevKey;t.removeNode(a.key),e?(a=t.getItem(e),a.nextKey=null):a=null}return[i?.key??null,a?.key??null]}var U=class{*[Symbol.iterator](){let e=this.firstChild;for(;e;)yield e,e=e.nextSibling}get firstChild(){return this._firstChild}set firstChild(e){this._firstChild=e,this.ownerDocument.markDirty(this)}get lastChild(){return this._lastChild}set lastChild(e){this._lastChild=e,this.ownerDocument.markDirty(this)}get previousSibling(){return this._previousSibling}set previousSibling(e){this._previousSibling=e,this.ownerDocument.markDirty(this)}get nextSibling(){return this._nextSibling}set nextSibling(e){this._nextSibling=e,this.ownerDocument.markDirty(this)}get parentNode(){return this._parentNode}set parentNode(e){this._parentNode=e,this.ownerDocument.markDirty(this)}get isConnected(){return this.parentNode?.isConnected||!1}invalidateChildIndices(e){(this._minInvalidChildIndex==null||!this._minInvalidChildIndex.isConnected||e.index<this._minInvalidChildIndex.index)&&(this._minInvalidChildIndex=e,this.ownerDocument.markDirty(this))}updateChildIndices(){let e=this._minInvalidChildIndex;for(;e;)e.index=e.previousSibling?e.previousSibling.index+1:0,e=e.nextSibling;this._minInvalidChildIndex=null}appendChild(e){e.parentNode&&e.parentNode.removeChild(e),this.firstChild??=e,this.lastChild?(this.lastChild.nextSibling=e,e.index=this.lastChild.index+1,e.previousSibling=this.lastChild):(e.previousSibling=null,e.index=0),e.parentNode=this,e.nextSibling=null,this.lastChild=e,this.ownerDocument.markDirty(this),this.isConnected&&this.ownerDocument.queueUpdate()}insertBefore(e,t){if(t==null)return this.appendChild(e);e.parentNode&&e.parentNode.removeChild(e),e.nextSibling=t,e.previousSibling=t.previousSibling,e.index=t.index-1,this.firstChild===t?this.firstChild=e:t.previousSibling&&(t.previousSibling.nextSibling=e),t.previousSibling=e,e.parentNode=t.parentNode,this.invalidateChildIndices(e),this.isConnected&&this.ownerDocument.queueUpdate()}removeChild(e){e.parentNode===this&&(this._minInvalidChildIndex===e&&(this._minInvalidChildIndex=null),e.nextSibling&&(this.invalidateChildIndices(e.nextSibling),e.nextSibling.previousSibling=e.previousSibling),e.previousSibling&&(e.previousSibling.nextSibling=e.nextSibling),this.firstChild===e&&(this.firstChild=e.nextSibling),this.lastChild===e&&(this.lastChild=e.previousSibling),e.parentNode=null,e.nextSibling=null,e.previousSibling=null,e.index=0,this.ownerDocument.markDirty(e),this.isConnected&&this.ownerDocument.queueUpdate())}addEventListener(){}removeEventListener(){}get previousVisibleSibling(){let e=this.previousSibling;for(;e&&e.isHidden;)e=e.previousSibling;return e}get nextVisibleSibling(){let e=this.nextSibling;for(;e&&e.isHidden;)e=e.nextSibling;return e}get firstVisibleChild(){let e=this.firstChild;for(;e&&e.isHidden;)e=e.nextSibling;return e}get lastVisibleChild(){let e=this.lastChild;for(;e&&e.isHidden;)e=e.previousSibling;return e}constructor(e){this._firstChild=null,this._lastChild=null,this._previousSibling=null,this._nextSibling=null,this._parentNode=null,this._minInvalidChildIndex=null,this.ownerDocument=e}},W=class e extends U{get index(){return this._index}set index(e){this._index=e,this.ownerDocument.markDirty(this)}get level(){return this.parentNode instanceof e?this.parentNode.level+ +(this.node?.type===`item`):0}getMutableNode(){return this.node==null?null:(this.isMutated||=(this.node=this.node.clone(),!0),this.ownerDocument.markDirty(this),this.node)}updateNode(){let t=this.nextVisibleSibling,n=this.getMutableNode();if(n!=null&&(n.index=this.index,n.level=this.level,n.parentKey=this.parentNode instanceof e?this.parentNode.node?.key??null:null,n.prevKey=this.previousVisibleSibling?.node?.key??null,n.nextKey=t?.node?.key??null,n.hasChildNodes=!!this.firstChild,n.firstChildKey=this.firstVisibleChild?.node?.key??null,n.lastChildKey=this.lastVisibleChild?.node?.key??null,(n.colSpan!=null||n.colIndex!=null)&&t)){let e=(n.colIndex??n.index)+(n.colSpan??1);if(t.node!=null&&e!==t.node.colIndex){let n=t.getMutableNode();n.colIndex=e}}}setProps(e,t,n,r,i){let a,{value:o,textValue:s,id:c,...l}=e;if(this.node==null?(a=new n(c??`react-aria-${++this.ownerDocument.nodeId}`),this.node=a):a=this.getMutableNode(),l.ref=t,a.props=l,a.rendered=r,a.render=i,a.value=o,e[`aria-label`]&&(a[`aria-label`]=e[`aria-label`]),a.textValue=s||(typeof l.children==`string`?l.children:``)||e[`aria-label`]||``,c!=null&&c!==a.key)throw Error(`Cannot change the id of an item`);l.colSpan!=null&&(a.colSpan=l.colSpan),this.isConnected&&this.ownerDocument.queueUpdate()}get style(){let e=this;return{get display(){return e.isHidden?`none`:``},set display(t){let n=t===`none`;if(e.isHidden!==n){(e.parentNode?.firstVisibleChild===e||e.parentNode?.lastVisibleChild===e)&&e.ownerDocument.markDirty(e.parentNode);let t=e.previousVisibleSibling,r=e.nextVisibleSibling;t&&e.ownerDocument.markDirty(t),r&&e.ownerDocument.markDirty(r),e.isHidden=n,e.ownerDocument.markDirty(e)}}}}hasAttribute(){}setAttribute(){}setAttributeNS(){}removeAttribute(){}constructor(e,t){super(t),this.nodeType=8,this.isMutated=!0,this._index=0,this.isHidden=!1,this.node=null}},G=class extends U{get isConnected(){return!0}createElement(e){return new W(e,this)}getMutableCollection(){return this.nextCollection||=this.collection.clone(),this.nextCollection}markDirty(e){this.dirtyNodes.add(e)}addNode(e){if(e.isHidden||e.node==null)return;let t=this.getMutableCollection();if(!t.getItem(e.node.key))for(let t of e)this.addNode(t);t.addNode(e.node)}removeNode(e){for(let t of e)this.removeNode(t);e.node&&this.getMutableCollection().removeNode(e.node.key)}getCollection(){return this.inSubscription?this.collection.clone():(this.queuedRender=!1,this.updateCollection(),this.collection)}updateCollection(){for(let e of this.dirtyNodes)e instanceof W&&(!e.isConnected||e.isHidden)?this.removeNode(e):e.updateChildIndices();for(let e of this.dirtyNodes)e instanceof W?(e.isConnected&&!e.isHidden&&(e.updateNode(),this.addNode(e)),e.node&&this.dirtyNodes.delete(e),e.isMutated=!1):this.dirtyNodes.delete(e);this.nextCollection&&(this.nextCollection.commit(this.firstVisibleChild?.node?.key??null,this.lastVisibleChild?.node?.key??null,this.isSSR),this.isSSR||(this.collection=this.nextCollection,this.nextCollection=null))}queueUpdate(){if(!(this.dirtyNodes.size===0||this.queuedRender)){this.queuedRender=!0,this.inSubscription=!0;for(let e of this.subscriptions)e();this.inSubscription=!1}}subscribe(e){return this.subscriptions.add(e),()=>this.subscriptions.delete(e)}resetAfterSSR(){this.isSSR&&(this.isSSR=!1,this.firstChild=null,this.lastChild=null,this.nodeId=0)}constructor(e){super(null),this.nodeType=11,this.ownerDocument=this,this.dirtyNodes=new Set,this.isSSR=!1,this.nodeId=0,this.nodesByProps=new WeakMap,this.nextCollection=null,this.subscriptions=new Set,this.queuedRender=!1,this.inSubscription=!1,this.collection=e,this.nextCollection=e}};function K(e){let{children:n,items:r,idScope:i,addIdAndValue:a,dependencies:o=[]}=e,s=c(()=>new WeakMap,o);return c(()=>{if(r&&typeof n==`function`){let e=[];for(let o of r){let r=s.get(o);if(!r){r=n(o);let e=r.props.id??o.key??o.id;if(e==null)throw Error(`Could not determine key for item`);i!=null&&(e=i+`:`+e),r=t(r,a?{key:e,id:e,value:o}:{key:e}),s.set(o,r)}e.push(r)}return e}if(typeof n!=`function`)return n},[n,r,s,i,a])}if(typeof HTMLTemplateElement<`u`){let e=Object.getOwnPropertyDescriptor(Node.prototype,`firstChild`).get;Object.defineProperty(HTMLTemplateElement.prototype,"firstChild",{configurable:!0,enumerable:!0,get:function(){return this.dataset.reactAriaHidden?this.content.firstChild:e.call(this)}})}const q=n(!1);function J(t){if(o(q))return e.createElement(e.Fragment,null,t.children);let n=e.createElement(q.Provider,{value:!0},t.children);return e.createElement(`template`,{"data-react-aria-hidden":!0},n)}const Y=n(!1),X=n(null);function ue(t){if(o(X))return t.content;let{collection:n,document:r}=me(t.createCollection);return e.createElement(e.Fragment,null,e.createElement(J,null,e.createElement(X.Provider,{value:r},t.content)),e.createElement(de,{render:t.children,collection:n}))}function de({collection:e,render:t}){return t(e)}function fe(e,t,n){let r=P(),i=l(r);i.current=r;let o=a(()=>i.current?n():t(),[t,n]);return d(e,o)}const pe=typeof e.useSyncExternalStore==`function`?e.useSyncExternalStore:fe;function me(e){let[t]=u(()=>new G(e?.()||new V)),n=a(e=>t.subscribe(e),[t]),r=a(()=>{let e=t.getCollection();return t.isSSR&&t.resetAfterSSR(),e},[t]),i=a(()=>(t.isSSR=!0,t.getCollection()),[t]);return{collection:pe(n,r,i),document:t}}const Z=n(null);function he(e){var t;return t=class extends F{},t.type=e,t}function ge(t,n,r,i,s,c){typeof t==`string`&&(t=he(t));let l=a(e=>{e?.setProps(n,r,t,i,c)},[n,r,i,c,t]),u=o(Z);if(u){let a=u.ownerDocument.nodesByProps.get(n);return a||(a=u.ownerDocument.createElement(t.type),a.setProps(n,r,t,i,c),u.appendChild(a),u.ownerDocument.updateCollection(),u.ownerDocument.nodesByProps.set(n,a)),s?e.createElement(Z.Provider,{value:a},s):null}return e.createElement(t.type,{ref:l},s)}function _e(t,n){let i=({node:e})=>n(e.props,e.props.ref,e),a=r((r,a)=>{let s=o(y);if(!o(Y)){if(n.length>=3)throw Error(n.name+` cannot be rendered outside a collection.`);return n(r,a)}return ge(t,r,a,`children`in r?r.children:null,null,t=>e.createElement(y.Provider,{value:s},e.createElement(i,{node:t})))});return a.displayName=n.name,a}function ve(e){return K({...e,addIdAndValue:!0})}const ye=n(null);function be(t){let n=o(ye),r=(n?.dependencies||[]).concat(t.dependencies),i=t.idScope??n?.idScope,a=ve({...t,idScope:i,dependencies:r});return o(X)&&(a=e.createElement(xe,null,a)),n=c(()=>({dependencies:r,idScope:i}),[i,...r]),e.createElement(ye.Provider,{value:n},a)}function xe({children:t}){let n=o(X),r=c(()=>e.createElement(X.Provider,{value:null},e.createElement(Y.Provider,{value:!0},t)),[t]);return P()?e.createElement(Z.Provider,{value:n},r):ee(r,n)}const Se={CollectionRoot({collection:e,renderDropIndicator:t}){return Ce(e,null,t)},CollectionBranch({collection:e,parent:t,renderDropIndicator:n}){return Ce(e,t,n)}};function Ce(t,n,r){return K({items:n?t.getChildren(n.key):t,dependencies:[r],children(n){let i=n.render(n);return!r||n.type!==`item`?i:e.createElement(e.Fragment,null,r({type:`item`,key:n.key,dropPosition:`before`}),i,we(t,n,r))}})}function we(e,n,r){let a=n.key,o=e.getKeyAfter(a),s=o==null?null:e.getItem(o);for(;s!=null&&s.type!==`item`;)o=e.getKeyAfter(s.key),s=o==null?null:e.getItem(o);let c=n.nextKey==null?null:e.getItem(n.nextKey);for(;c!=null&&c.type!==`item`;)c=c.nextKey==null?null:e.getItem(c.nextKey);let l=[];if(c==null){let a=n;for(;a?.type===`item`&&(!s||a.parentKey!==s.parentKey&&s.level<a.level);){let n=r({type:`item`,key:a.key,dropPosition:`after`});i(n)&&l.push(t(n,{key:`${a.key}-after`})),a=a.parentKey==null?null:e.getItem(a.parentKey)}}return l}const Te=n(Se),Q=n({}),Ee=n(null),De=r(function(t,n){let{render:r}=o(Ee);return e.createElement(e.Fragment,null,r(t,n))});function Oe(t,n){let r=t?.renderDropIndicator,i=t?.isVirtualDragging?.call(t),o=a(t=>{if(i||n?.isDropTarget(t))return r?r(t):e.createElement(De,{target:t})},[n?.target,i,r]);return t?.useDropIndicator?o:void 0}function ke(e,t,n){let r=e.focusedKey,i=null;if(t!=null&&t.isVirtualDragging?.call(t)&&n?.target?.type===`item`&&(i=n.target.key,n.target.dropPosition===`after`)){let e=n.collection.getKeyAfter(i),t=null;if(e!=null){let r=n.collection.getItem(i)?.level??0;for(;e;){let i=n.collection.getItem(e);if(!i)break;if(i.type!==`item`){e=n.collection.getKeyAfter(e);continue}if((i.level??0)<=r)break;t=e,e=n.collection.getKeyAfter(e)}}i=e??t??i}return c(()=>new Set([r,i].filter(e=>e!=null)),[r,i])}const Ae=n(null);function je(t){let n=l({});return e.createElement(Ae.Provider,{value:n},t.children)}const $=n(null);_e(R,function(t,n,r){let i=o($),{isLoading:a,onLoadMore:s,scrollOffset:u,...d}=t,m=l(null),h=c(()=>({onLoadMore:s,collection:i?.collection,sentinelRef:m,scrollOffset:u}),[s,u,i?.collection]);_(h,m);let g=w({...d,id:void 0,children:r.rendered,defaultClassName:`react-aria-ListBoxLoadingIndicator`,values:void 0});return e.createElement(e.Fragment,null,e.createElement(`div`,{style:{position:`relative`,width:0,height:0},inert:p(!0)},e.createElement(`div`,{"data-testid":`loadMoreSentinel`,ref:m,style:{position:`absolute`,height:1,width:1}})),a&&g.children&&e.createElement(k.div,{...x(f(t,{global:!0}),{tabIndex:-1}),...g,role:`option`,ref:n},g.children))});const Me=n(null),Ne=r(function(t,n){return[t,n]=E(t,n,Me),e.createElement(ue,{content:e.createElement(be,t)},r=>e.createElement(Pe,{props:t,collection:r,gridListRef:n}))});function Pe({props:t,collection:n,gridListRef:r}){[t,r]=E(t,r,ce);let{shouldUseVirtualFocus:i,filter:a,disallowTypeAhead:u,...d}=t,{dragAndDropHooks:p,keyboardNavigationBehavior:m=`arrow`,layout:h=`stack`}=t,{CollectionRoot:g,isVirtualized:_,layoutDelegate:v,dropTargetDelegate:y}=o(Te),ee=se({...d,collection:n,children:void 0,layoutDelegate:v}),S=oe(ee,a),C=ne({usage:`search`,sensitivity:`base`}),{disabledBehavior:T,disabledKeys:D}=S.selectionManager,{direction:O}=ae(),A=c(()=>new b({collection:S.collection,collator:C,ref:r,disabledKeys:D,disabledBehavior:T,layoutDelegate:v,layout:h,direction:O}),[S.collection,r,h,D,T,v,C,O]),{gridProps:j}=ie({...d,keyboardDelegate:A,keyboardNavigationBehavior:h===`grid`?`tab`:m,isVirtualized:_,shouldSelectOnPressUp:t.shouldSelectOnPressUp,disallowTypeAhead:u},S,r),M=S.selectionManager,N=!!p?.useDraggableCollectionState,P=!!p?.useDroppableCollectionState;l(N),l(P),s(()=>{},[N,P]);let F,I,L,R=!1,z=null,B=l(null);if(N&&p){F=p.useDraggableCollectionState({collection:S.collection,selectionManager:M,preview:p.renderDragPreview?B:void 0}),p.useDraggableCollection({},F,r);let t=p.DragPreview;z=p.renderDragPreview?e.createElement(t,{ref:B},p.renderDragPreview):null}if(P&&p){I=p.useDroppableCollectionState({collection:S.collection,selectionManager:M});let e=new b({collection:S.collection,disabledKeys:M.disabledKeys,disabledBehavior:M.disabledBehavior,ref:r}),t=p.dropTargetDelegate||y||new p.ListDropTargetDelegate(n,r,{layout:h,direction:O});L=p.useDroppableCollection({keyboardDelegate:e,dropTargetDelegate:t},I,r),R=I.isDropTarget({type:`root`})}let{focusProps:V,isFocused:H,isFocusVisible:U}=re(),W=S.collection.size===0,G={isDropTarget:R,isEmpty:W,isFocused:H,isFocusVisible:U,layout:h,state:S},K=w({...t,children:void 0,defaultClassName:`react-aria-GridList`,values:G}),q=null;if(W&&t.renderEmptyState){let n=t.renderEmptyState(G);q=e.createElement(`div`,{role:`row`,"aria-rowindex":1,style:{display:`contents`}},e.createElement(`div`,{role:`gridcell`,style:{display:`contents`}},n))}let J=f(t,{global:!0});return e.createElement(te,null,e.createElement(k.div,{...x(J,K,j,V,L?.collectionProps,null),ref:r,slot:t.slot||void 0,onScroll:t.onScroll,"data-drop-target":R||void 0,"data-empty":W||void 0,"data-focused":H||void 0,"data-focus-visible":U||void 0,"data-layout":h},e.createElement(le,{values:[[$,S],[Q,{dragAndDropHooks:p,dragState:F,dropState:I}],[Ee,{render:Fe}]]},P&&e.createElement(Re,null),e.createElement(je,null,e.createElement(g,{collection:S.collection,scrollRef:r,persistedKeys:ke(M,p,I),renderDropIndicator:Oe(p,I)}))),q,z))}function Fe(t,n){n=v(n);let{dragAndDropHooks:r,dropState:i}=o(Q),a=l(null),{dropIndicatorProps:s,isHidden:c,isDropTarget:u}=r.useDropIndicator(t,i,a);return c?null:e.createElement(Le,{...t,dropIndicatorProps:s,isDropTarget:u,buttonRef:a,ref:n})}function Ie(t,n){let{dropIndicatorProps:r,isDropTarget:i,buttonRef:a,...o}=t,{visuallyHiddenProps:s}=S(),c=w({...o,defaultClassName:`react-aria-DropIndicator`,values:{isDropTarget:i}});return e.createElement(k.div,{...c,role:`row`,ref:n,"data-drop-target":i||void 0},e.createElement(`div`,{role:`gridcell`},e.createElement(`div`,{...s,role:`button`,...r,ref:a}),c.children))}const Le=r(Ie);function Re(){let{dragAndDropHooks:t,dropState:n}=o(Q),r=l(null),{dropIndicatorProps:i}=t.useDropIndicator({target:{type:`root`}},n,r),a=n.isDropTarget({type:`root`}),{visuallyHiddenProps:s}=S();return!a&&i[`aria-hidden`]?null:e.createElement(`div`,{role:`row`,"aria-hidden":i[`aria-hidden`],style:{position:`absolute`}},e.createElement(`div`,{role:`gridcell`},e.createElement(`div`,{role:`button`,...s,...i,ref:r})))}_e(R,function(t,n,r){let i=o($),{isVirtualized:a}=o(Te),{isLoading:s,onLoadMore:u,scrollOffset:d,...m}=t,h=l(null),g=c(()=>({onLoadMore:u,collection:i?.collection,sentinelRef:h,scrollOffset:d}),[u,d,i?.collection]);_(g,h);let v=w({...m,id:void 0,children:r.rendered,defaultClassName:`react-aria-GridListLoadingIndicator`,values:void 0});return e.createElement(e.Fragment,null,e.createElement(`div`,{style:{position:`relative`,width:0,height:0},inert:p(!0)},e.createElement(`div`,{"data-testid":`loadMoreSentinel`,ref:h,style:{position:`absolute`,height:1,width:1}})),s&&v.children&&e.createElement(k.div,{...v,...f(t,{global:!0}),role:`row`,ref:n},e.createElement(`div`,{"aria-colindex":a?1:void 0,role:`gridcell`},v.children)))});export{Ne as GridList};
@@ -1,11 +1 @@
1
- import e,{cloneElement as t,createContext as n,forwardRef as r,isValidElement as i,useCallback as a,useContext as o,useMemo as s,useRef as c}from"react";import{filterDOMProps as l,inertValue as u,mergeProps as d,mergeRefs as f,useLayoutEffect as p,useLoadMoreSentinel as m,useObjectRef as h}from"@react-aria/utils";import{FocusableContext as g}from"@react-aria/interactions";import"react-dom";import{mergeProps as _}from"react-aria";import"react-stately";var v=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),y=(e=>typeof require<`u`?require:typeof Proxy<`u`?new Proxy(e,{get:(e,t)=>(typeof require<`u`?require:e)[t]}):e)(function(e){if(typeof require<`u`)return require.apply(this,arguments);throw Error('Calling `require` for "'+e+"\" in an environment that doesn't expose the `require` function. See https://rolldown.rs/in-depth/bundling-cjs#require-external-modules for more details.")});const b=Symbol(`default`);function x(e){let{className:t,style:n,children:r,defaultClassName:i,defaultChildren:a,defaultStyle:o,values:c,render:l}=e;return s(()=>{let e,s,u;return e=typeof t==`function`?t({...c,defaultClassName:i}):t,s=typeof n==`function`?n({...c,defaultStyle:o||{}}):n,u=typeof r==`function`?r({...c,defaultChildren:a}):r??a,{className:e??i,style:s||o?{...o,...s}:void 0,children:u??a,"data-rac":``,render:l?e=>l(e,c):void 0}},[t,n,r,i,a,o,c,l])}function S(e,t){let n=o(e);if(t===null)return null;if(n&&typeof n==`object`&&`slots`in n&&n.slots){let e=t||b;if(!n.slots[e]){let e=new Intl.ListFormat().format(Object.keys(n.slots).map(e=>`"${e}"`)),r=t?`Invalid slot "${t}".`:`A slot prop is required.`;throw Error(`${r} Valid slot names are ${e}.`)}return n.slots[e]}return n}function C(e,t,n){let{ref:r,...i}=S(n,e.slot)||{},a=h(s(()=>f(t,r),[t,r])),o=d(i,e);return`style`in i&&i.style&&`style`in e&&e.style&&(o.style=typeof i.style==`function`||typeof e.style==`function`?t=>{let n=typeof i.style==`function`?i.style(t):i.style,r={...t.defaultStyle,...n},a=typeof e.style==`function`?e.style({...t,defaultStyle:r}):e.style;return{...r,...a}}:{...i.style,...e.style}),[o,a]}function w(t,n,r){let{render:i,...a}=n,o=c(null),l=s(()=>f(r,o),[r,o]);p(()=>{},[t,i]);let u={...a,ref:l};return i?i(u,void 0):e.createElement(t,u)}const T={},E=new Proxy({},{get(e,t){if(typeof t!=`string`)return;let n=T[t];return n||(n=r(w.bind(null,t)),T[t]=n),n}});String(Math.round(Math.random()*1e10)),typeof window<`u`&&window.document&&window.document.createElement,e.useId;var D=class{get childNodes(){throw Error(`childNodes is not supported`)}clone(){let e=new this.constructor(this.key);return e.value=this.value,e.level=this.level,e.hasChildNodes=this.hasChildNodes,e.rendered=this.rendered,e.textValue=this.textValue,e[`aria-label`]=this[`aria-label`],e.index=this.index,e.parentKey=this.parentKey,e.prevKey=this.prevKey,e.nextKey=this.nextKey,e.firstChildKey=this.firstChildKey,e.lastChildKey=this.lastChildKey,e.props=this.props,e.render=this.render,e.colSpan=this.colSpan,e.colIndex=this.colIndex,e}filter(e,t,n){let r=this.clone();return t.addDescendants(r,e),r}constructor(e){this.value=null,this.level=0,this.hasChildNodes=!1,this.rendered=null,this.textValue=``,this[`aria-label`]=void 0,this.index=0,this.parentKey=null,this.prevKey=null,this.nextKey=null,this.firstChildKey=null,this.lastChildKey=null,this.props={},this.colSpan=null,this.colIndex=null,this.type=this.constructor.type,this.key=e}},O=class extends D{filter(e,t,n){let[r,i]=N(e,t,this.firstChildKey,n),a=this.clone();return a.firstChildKey=r,a.lastChildKey=i,a}},k=class extends D{};k.type=`header`;var A=class extends D{};A.type=`loader`;var j=class extends O{filter(e,t,n){if(n(this.textValue,this)){let n=this.clone();return t.addDescendants(n,e),n}return null}};j.type=`item`;var M=class extends O{filter(e,t,n){let r=super.filter(e,t,n);if(r&&r.lastChildKey!==null){let t=e.getItem(r.lastChildKey);if(t&&t.type!==`header`)return r}return null}};M.type=`section`;function N(e,t,n,r){if(n==null)return[null,null];let i=null,a=null,o=e.getItem(n);for(;o!=null;){let n=o.filter(e,t,r);n!=null&&(n.nextKey=null,a&&(n.prevKey=a.key,a.nextKey=n.key),i??=n,t.addNode(n),a=n),o=o.nextKey?e.getItem(o.nextKey):null}if(a&&a.type===`separator`){let e=a.prevKey;t.removeNode(a.key),e?(a=t.getItem(e),a.nextKey=null):a=null}return[i?.key??null,a?.key??null]}function P(e){let{children:n,items:r,idScope:i,addIdAndValue:a,dependencies:o=[]}=e,c=s(()=>new WeakMap,o);return s(()=>{if(r&&typeof n==`function`){let e=[];for(let o of r){let r=c.get(o);if(!r){r=n(o);let e=r.props.id??o.key??o.id;if(e==null)throw Error(`Could not determine key for item`);i!=null&&(e=i+`:`+e),r=t(r,a?{key:e,id:e,value:o}:{key:e}),c.set(o,r)}e.push(r)}return e}if(typeof n!=`function`)return n},[n,r,c,i,a])}
2
- /**
3
- * @license React
4
- * use-sync-external-store-shim.production.js
5
- *
6
- * Copyright (c) Meta Platforms, Inc. and affiliates.
7
- *
8
- * This source code is licensed under the MIT license found in the
9
- * LICENSE file in the root directory of this source tree.
10
- */
11
- var F=v((e=>{var t=y(`react`);function n(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var r=typeof Object.is==`function`?Object.is:n,i=t.useState,a=t.useEffect,o=t.useLayoutEffect,s=t.useDebugValue;function c(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),c=r[0].inst,u=r[1];return o(function(){c.value=n,c.getSnapshot=t,l(c)&&u({inst:c})},[e,n,t]),a(function(){return l(c)&&u({inst:c}),e(function(){l(c)&&u({inst:c})})},[e]),s(n),n}function l(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch{return!0}}function u(e,t){return t()}var d=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?u:c;e.useSyncExternalStore=t.useSyncExternalStore===void 0?d:t.useSyncExternalStore}));v(((e,t)=>{t.exports=F()}))();const I=n(!1);typeof e.useSyncExternalStore==`function`&&e.useSyncExternalStore;const L=n(null);function R(e){var t;return t=class extends D{},t.type=e,t}function z(t,n,r,i,s,c){typeof t==`string`&&(t=R(t));let l=a(e=>{e?.setProps(n,r,t,i,c)},[n,r,i,c,t]),u=o(L);if(u){let a=u.ownerDocument.nodesByProps.get(n);return a||(a=u.ownerDocument.createElement(t.type),a.setProps(n,r,t,i,c),u.appendChild(a),u.ownerDocument.updateCollection(),u.ownerDocument.nodesByProps.set(n,a)),s?e.createElement(L.Provider,{value:a},s):null}return e.createElement(t.type,{ref:l},s)}function B(t,n){let i=({node:e})=>n(e.props,e.props.ref,e),a=r((r,a)=>{let s=o(g);if(!o(I)){if(n.length>=3)throw Error(n.name+` cannot be rendered outside a collection.`);return n(r,a)}return z(t,r,a,`children`in r?r.children:null,null,t=>e.createElement(g.Provider,{value:s},e.createElement(i,{node:t})))});return a.displayName=n.name,a}const V={CollectionRoot({collection:e,renderDropIndicator:t}){return H(e,null,t)},CollectionBranch({collection:e,parent:t,renderDropIndicator:n}){return H(e,t,n)}};function H(t,n,r){return P({items:n?t.getChildren(n.key):t,dependencies:[r],children(n){let i=n.render(n);return!r||n.type!==`item`?i:e.createElement(e.Fragment,null,r({type:`item`,key:n.key,dropPosition:`before`}),i,U(t,n,r))}})}function U(e,n,r){let a=n.key,o=e.getKeyAfter(a),s=o==null?null:e.getItem(o);for(;s!=null&&s.type!==`item`;)o=e.getKeyAfter(s.key),s=o==null?null:e.getItem(o);let c=n.nextKey==null?null:e.getItem(n.nextKey);for(;c!=null&&c.type!==`item`;)c=c.nextKey==null?null:e.getItem(c.nextKey);let l=[];if(c==null){let a=n;for(;a?.type===`item`&&(!s||a.parentKey!==s.parentKey&&s.level<a.level);){let n=r({type:`item`,key:a.key,dropPosition:`after`});i(n)&&l.push(t(n,{key:`${a.key}-after`})),a=a.parentKey==null?null:e.getItem(a.parentKey)}}return l}const W=n(V),G=n(null);B(A,function(t,n,r){let i=o(G),{isLoading:a,onLoadMore:d,scrollOffset:f,...p}=t,h=c(null),g=s(()=>({onLoadMore:d,collection:i?.collection,sentinelRef:h,scrollOffset:f}),[d,f,i?.collection]);m(g,h);let v=x({...p,id:void 0,children:r.rendered,defaultClassName:`react-aria-ListBoxLoadingIndicator`,values:void 0});return e.createElement(e.Fragment,null,e.createElement(`div`,{style:{position:`relative`,width:0,height:0},inert:u(!0)},e.createElement(`div`,{"data-testid":`loadMoreSentinel`,ref:h,style:{position:`absolute`,height:1,width:1}})),a&&v.children&&e.createElement(E.div,{..._(l(t,{global:!0}),{tabIndex:-1}),...v,role:`option`,ref:n},v.children))}),B(A,function(t,n,r){let i=o(G),{isVirtualized:a}=o(W),{isLoading:d,onLoadMore:f,scrollOffset:p,...h}=t,g=c(null),_=s(()=>({onLoadMore:f,collection:i?.collection,sentinelRef:g,scrollOffset:p}),[f,p,i?.collection]);m(_,g);let v=x({...h,id:void 0,children:r.rendered,defaultClassName:`react-aria-GridListLoadingIndicator`,values:void 0});return e.createElement(e.Fragment,null,e.createElement(`div`,{style:{position:`relative`,width:0,height:0},inert:u(!0)},e.createElement(`div`,{"data-testid":`loadMoreSentinel`,ref:g,style:{position:`absolute`,height:1,width:1}})),d&&v.children&&e.createElement(E.div,{...v,...l(t,{global:!0}),role:`row`,ref:n},e.createElement(`div`,{"aria-colindex":a?1:void 0,role:`gridcell`},v.children)))});const K=n({}),q=n(null),J=B(k,function(t,n){[t,n]=C(t,n,K);let r=o(q);return e.createElement(E.div,{render:t.render,className:`react-aria-GridListHeader`,ref:n,...t},e.createElement(`div`,{...r,style:{display:`contents`}},t.children))});export{J as GridListHeader};
1
+ import e,{cloneElement as t,createContext as n,forwardRef as r,isValidElement as i,useCallback as a,useContext as o,useMemo as s,useRef as c}from"react";import{filterDOMProps as l,inertValue as u,mergeProps as d,mergeRefs as f,useLayoutEffect as p,useLoadMoreSentinel as m,useObjectRef as h}from"@react-aria/utils";import{FocusableContext as g}from"@react-aria/interactions";import"react-dom";import{mergeProps as _}from"react-aria";import"react-stately";const v=Symbol(`default`);function y(e){let{className:t,style:n,children:r,defaultClassName:i,defaultChildren:a,defaultStyle:o,values:c,render:l}=e;return s(()=>{let e,s,u;return e=typeof t==`function`?t({...c,defaultClassName:i}):t,s=typeof n==`function`?n({...c,defaultStyle:o||{}}):n,u=typeof r==`function`?r({...c,defaultChildren:a}):r??a,{className:e??i,style:s||o?{...o,...s}:void 0,children:u??a,"data-rac":``,render:l?e=>l(e,c):void 0}},[t,n,r,i,a,o,c,l])}function b(e,t){let n=o(e);if(t===null)return null;if(n&&typeof n==`object`&&`slots`in n&&n.slots){let e=t||v;if(!n.slots[e]){let e=new Intl.ListFormat().format(Object.keys(n.slots).map(e=>`"${e}"`)),r=t?`Invalid slot "${t}".`:`A slot prop is required.`;throw Error(`${r} Valid slot names are ${e}.`)}return n.slots[e]}return n}function x(e,t,n){let{ref:r,...i}=b(n,e.slot)||{},a=h(s(()=>f(t,r),[t,r])),o=d(i,e);return`style`in i&&i.style&&`style`in e&&e.style&&(o.style=typeof i.style==`function`||typeof e.style==`function`?t=>{let n=typeof i.style==`function`?i.style(t):i.style,r={...t.defaultStyle,...n},a=typeof e.style==`function`?e.style({...t,defaultStyle:r}):e.style;return{...r,...a}}:{...i.style,...e.style}),[o,a]}function S(t,n,r){let{render:i,...a}=n,o=c(null),l=s(()=>f(r,o),[r,o]);p(()=>{},[t,i]);let u={...a,ref:l};return i?i(u,void 0):e.createElement(t,u)}const C={},w=new Proxy({},{get(e,t){if(typeof t!=`string`)return;let n=C[t];return n||(n=r(S.bind(null,t)),C[t]=n),n}});String(Math.round(Math.random()*1e10)),typeof window<`u`&&window.document&&window.document.createElement,e.useId;var T=class{get childNodes(){throw Error(`childNodes is not supported`)}clone(){let e=new this.constructor(this.key);return e.value=this.value,e.level=this.level,e.hasChildNodes=this.hasChildNodes,e.rendered=this.rendered,e.textValue=this.textValue,e[`aria-label`]=this[`aria-label`],e.index=this.index,e.parentKey=this.parentKey,e.prevKey=this.prevKey,e.nextKey=this.nextKey,e.firstChildKey=this.firstChildKey,e.lastChildKey=this.lastChildKey,e.props=this.props,e.render=this.render,e.colSpan=this.colSpan,e.colIndex=this.colIndex,e}filter(e,t,n){let r=this.clone();return t.addDescendants(r,e),r}constructor(e){this.value=null,this.level=0,this.hasChildNodes=!1,this.rendered=null,this.textValue=``,this[`aria-label`]=void 0,this.index=0,this.parentKey=null,this.prevKey=null,this.nextKey=null,this.firstChildKey=null,this.lastChildKey=null,this.props={},this.colSpan=null,this.colIndex=null,this.type=this.constructor.type,this.key=e}},E=class extends T{filter(e,t,n){let[r,i]=j(e,t,this.firstChildKey,n),a=this.clone();return a.firstChildKey=r,a.lastChildKey=i,a}},D=class extends T{};D.type=`header`;var O=class extends T{};O.type=`loader`;var k=class extends E{filter(e,t,n){if(n(this.textValue,this)){let n=this.clone();return t.addDescendants(n,e),n}return null}};k.type=`item`;var A=class extends E{filter(e,t,n){let r=super.filter(e,t,n);if(r&&r.lastChildKey!==null){let t=e.getItem(r.lastChildKey);if(t&&t.type!==`header`)return r}return null}};A.type=`section`;function j(e,t,n,r){if(n==null)return[null,null];let i=null,a=null,o=e.getItem(n);for(;o!=null;){let n=o.filter(e,t,r);n!=null&&(n.nextKey=null,a&&(n.prevKey=a.key,a.nextKey=n.key),i??=n,t.addNode(n),a=n),o=o.nextKey?e.getItem(o.nextKey):null}if(a&&a.type===`separator`){let e=a.prevKey;t.removeNode(a.key),e?(a=t.getItem(e),a.nextKey=null):a=null}return[i?.key??null,a?.key??null]}function M(e){let{children:n,items:r,idScope:i,addIdAndValue:a,dependencies:o=[]}=e,c=s(()=>new WeakMap,o);return s(()=>{if(r&&typeof n==`function`){let e=[];for(let o of r){let r=c.get(o);if(!r){r=n(o);let e=r.props.id??o.key??o.id;if(e==null)throw Error(`Could not determine key for item`);i!=null&&(e=i+`:`+e),r=t(r,a?{key:e,id:e,value:o}:{key:e}),c.set(o,r)}e.push(r)}return e}if(typeof n!=`function`)return n},[n,r,c,i,a])}const N=n(!1);typeof e.useSyncExternalStore==`function`&&e.useSyncExternalStore;const P=n(null);function F(e){var t;return t=class extends T{},t.type=e,t}function I(t,n,r,i,s,c){typeof t==`string`&&(t=F(t));let l=a(e=>{e?.setProps(n,r,t,i,c)},[n,r,i,c,t]),u=o(P);if(u){let a=u.ownerDocument.nodesByProps.get(n);return a||(a=u.ownerDocument.createElement(t.type),a.setProps(n,r,t,i,c),u.appendChild(a),u.ownerDocument.updateCollection(),u.ownerDocument.nodesByProps.set(n,a)),s?e.createElement(P.Provider,{value:a},s):null}return e.createElement(t.type,{ref:l},s)}function L(t,n){let i=({node:e})=>n(e.props,e.props.ref,e),a=r((r,a)=>{let s=o(g);if(!o(N)){if(n.length>=3)throw Error(n.name+` cannot be rendered outside a collection.`);return n(r,a)}return I(t,r,a,`children`in r?r.children:null,null,t=>e.createElement(g.Provider,{value:s},e.createElement(i,{node:t})))});return a.displayName=n.name,a}const R={CollectionRoot({collection:e,renderDropIndicator:t}){return z(e,null,t)},CollectionBranch({collection:e,parent:t,renderDropIndicator:n}){return z(e,t,n)}};function z(t,n,r){return M({items:n?t.getChildren(n.key):t,dependencies:[r],children(n){let i=n.render(n);return!r||n.type!==`item`?i:e.createElement(e.Fragment,null,r({type:`item`,key:n.key,dropPosition:`before`}),i,B(t,n,r))}})}function B(e,n,r){let a=n.key,o=e.getKeyAfter(a),s=o==null?null:e.getItem(o);for(;s!=null&&s.type!==`item`;)o=e.getKeyAfter(s.key),s=o==null?null:e.getItem(o);let c=n.nextKey==null?null:e.getItem(n.nextKey);for(;c!=null&&c.type!==`item`;)c=c.nextKey==null?null:e.getItem(c.nextKey);let l=[];if(c==null){let a=n;for(;a?.type===`item`&&(!s||a.parentKey!==s.parentKey&&s.level<a.level);){let n=r({type:`item`,key:a.key,dropPosition:`after`});i(n)&&l.push(t(n,{key:`${a.key}-after`})),a=a.parentKey==null?null:e.getItem(a.parentKey)}}return l}const V=n(R),H=n(null);L(O,function(t,n,r){let i=o(H),{isLoading:a,onLoadMore:d,scrollOffset:f,...p}=t,h=c(null),g=s(()=>({onLoadMore:d,collection:i?.collection,sentinelRef:h,scrollOffset:f}),[d,f,i?.collection]);m(g,h);let v=y({...p,id:void 0,children:r.rendered,defaultClassName:`react-aria-ListBoxLoadingIndicator`,values:void 0});return e.createElement(e.Fragment,null,e.createElement(`div`,{style:{position:`relative`,width:0,height:0},inert:u(!0)},e.createElement(`div`,{"data-testid":`loadMoreSentinel`,ref:h,style:{position:`absolute`,height:1,width:1}})),a&&v.children&&e.createElement(w.div,{..._(l(t,{global:!0}),{tabIndex:-1}),...v,role:`option`,ref:n},v.children))}),L(O,function(t,n,r){let i=o(H),{isVirtualized:a}=o(V),{isLoading:d,onLoadMore:f,scrollOffset:p,...h}=t,g=c(null),_=s(()=>({onLoadMore:f,collection:i?.collection,sentinelRef:g,scrollOffset:p}),[f,p,i?.collection]);m(_,g);let v=y({...h,id:void 0,children:r.rendered,defaultClassName:`react-aria-GridListLoadingIndicator`,values:void 0});return e.createElement(e.Fragment,null,e.createElement(`div`,{style:{position:`relative`,width:0,height:0},inert:u(!0)},e.createElement(`div`,{"data-testid":`loadMoreSentinel`,ref:g,style:{position:`absolute`,height:1,width:1}})),d&&v.children&&e.createElement(w.div,{...v,...l(t,{global:!0}),role:`row`,ref:n},e.createElement(`div`,{"aria-colindex":a?1:void 0,role:`gridcell`},v.children)))});const U=n({}),W=n(null),G=L(D,function(t,n){[t,n]=x(t,n,U);let r=o(W);return e.createElement(w.div,{render:t.render,className:`react-aria-GridListHeader`,ref:n,...t},e.createElement(`div`,{...r,style:{display:`contents`}},t.children))});export{G as GridListHeader};
@@ -1,11 +1 @@
1
- import e,{cloneElement as t,createContext as n,forwardRef as r,isValidElement as i,useCallback as a,useContext as o,useEffect as s,useMemo as c,useRef as l}from"react";import{filterDOMProps as u,inertValue as d,mergeRefs as f,useLayoutEffect as p,useLoadMoreSentinel as m,useObjectRef as h}from"@react-aria/utils";import{FocusableContext as g}from"@react-aria/interactions";import"react-dom";import{mergeProps as _,useFocusRing as v,useGridListItem as y,useGridListSelectionCheckbox as b,useHover as x,useVisuallyHidden as S}from"react-aria";import"react-stately";var C=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),w=(e=>typeof require<`u`?require:typeof Proxy<`u`?new Proxy(e,{get:(e,t)=>(typeof require<`u`?require:e)[t]}):e)(function(e){if(typeof require<`u`)return require.apply(this,arguments);throw Error('Calling `require` for "'+e+"\" in an environment that doesn't expose the `require` function. See https://rolldown.rs/in-depth/bundling-cjs#require-external-modules for more details.")});const T=n(null);n(null),n(null),n(null),n(null),n({});const ee=n(null),E=n(null),D=Symbol(`default`);function O({values:t,children:n}){for(let[r,i]of t)n=e.createElement(r.Provider,{value:i},n);return n}function k(e){let{className:t,style:n,children:r,defaultClassName:i,defaultChildren:a,defaultStyle:o,values:s,render:l}=e;return c(()=>{let e,c,u;return e=typeof t==`function`?t({...s,defaultClassName:i}):t,c=typeof n==`function`?n({...s,defaultStyle:o||{}}):n,u=typeof r==`function`?r({...s,defaultChildren:a}):r??a,{className:e??i,style:c||o?{...o,...c}:void 0,children:u??a,"data-rac":``,render:l?e=>l(e,s):void 0}},[t,n,r,i,a,o,s,l])}function A(t,n,r){let{render:i,...a}=n,o=l(null),s=c(()=>f(r,o),[r,o]);p(()=>{},[t,i]);let u={...a,ref:s};return i?i(u,void 0):e.createElement(t,u)}const j={},M=new Proxy({},{get(e,t){if(typeof t!=`string`)return;let n=j[t];return n||(n=r(A.bind(null,t)),j[t]=n),n}});String(Math.round(Math.random()*1e10)),typeof window<`u`&&window.document&&window.document.createElement,e.useId;var N=class{get childNodes(){throw Error(`childNodes is not supported`)}clone(){let e=new this.constructor(this.key);return e.value=this.value,e.level=this.level,e.hasChildNodes=this.hasChildNodes,e.rendered=this.rendered,e.textValue=this.textValue,e[`aria-label`]=this[`aria-label`],e.index=this.index,e.parentKey=this.parentKey,e.prevKey=this.prevKey,e.nextKey=this.nextKey,e.firstChildKey=this.firstChildKey,e.lastChildKey=this.lastChildKey,e.props=this.props,e.render=this.render,e.colSpan=this.colSpan,e.colIndex=this.colIndex,e}filter(e,t,n){let r=this.clone();return t.addDescendants(r,e),r}constructor(e){this.value=null,this.level=0,this.hasChildNodes=!1,this.rendered=null,this.textValue=``,this[`aria-label`]=void 0,this.index=0,this.parentKey=null,this.prevKey=null,this.nextKey=null,this.firstChildKey=null,this.lastChildKey=null,this.props={},this.colSpan=null,this.colIndex=null,this.type=this.constructor.type,this.key=e}},P=class extends N{filter(e,t,n){let[r,i]=z(e,t,this.firstChildKey,n),a=this.clone();return a.firstChildKey=r,a.lastChildKey=i,a}},F=class extends N{};F.type=`header`;var I=class extends N{};I.type=`loader`;var L=class extends P{filter(e,t,n){if(n(this.textValue,this)){let n=this.clone();return t.addDescendants(n,e),n}return null}};L.type=`item`;var R=class extends P{filter(e,t,n){let r=super.filter(e,t,n);if(r&&r.lastChildKey!==null){let t=e.getItem(r.lastChildKey);if(t&&t.type!==`header`)return r}return null}};R.type=`section`;function z(e,t,n,r){if(n==null)return[null,null];let i=null,a=null,o=e.getItem(n);for(;o!=null;){let n=o.filter(e,t,r);n!=null&&(n.nextKey=null,a&&(n.prevKey=a.key,a.nextKey=n.key),i??=n,t.addNode(n),a=n),o=o.nextKey?e.getItem(o.nextKey):null}if(a&&a.type===`separator`){let e=a.prevKey;t.removeNode(a.key),e?(a=t.getItem(e),a.nextKey=null):a=null}return[i?.key??null,a?.key??null]}function B(e){let{children:n,items:r,idScope:i,addIdAndValue:a,dependencies:o=[]}=e,s=c(()=>new WeakMap,o);return c(()=>{if(r&&typeof n==`function`){let e=[];for(let o of r){let r=s.get(o);if(!r){r=n(o);let e=r.props.id??o.key??o.id;if(e==null)throw Error(`Could not determine key for item`);i!=null&&(e=i+`:`+e),r=t(r,a?{key:e,id:e,value:o}:{key:e}),s.set(o,r)}e.push(r)}return e}if(typeof n!=`function`)return n},[n,r,s,i,a])}
2
- /**
3
- * @license React
4
- * use-sync-external-store-shim.production.js
5
- *
6
- * Copyright (c) Meta Platforms, Inc. and affiliates.
7
- *
8
- * This source code is licensed under the MIT license found in the
9
- * LICENSE file in the root directory of this source tree.
10
- */
11
- var V=C((e=>{var t=w(`react`);function n(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var r=typeof Object.is==`function`?Object.is:n,i=t.useState,a=t.useEffect,o=t.useLayoutEffect,s=t.useDebugValue;function c(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),c=r[0].inst,u=r[1];return o(function(){c.value=n,c.getSnapshot=t,l(c)&&u({inst:c})},[e,n,t]),a(function(){return l(c)&&u({inst:c}),e(function(){l(c)&&u({inst:c})})},[e]),s(n),n}function l(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch{return!0}}function u(e,t){return t()}var d=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?u:c;e.useSyncExternalStore=t.useSyncExternalStore===void 0?d:t.useSyncExternalStore}));C(((e,t)=>{t.exports=V()}))();const H=n(!1);typeof e.useSyncExternalStore==`function`&&e.useSyncExternalStore;const U=n(null);function W(e){var t;return t=class extends N{},t.type=e,t}function G(t,n,r,i,s,c){typeof t==`string`&&(t=W(t));let l=a(e=>{e?.setProps(n,r,t,i,c)},[n,r,i,c,t]),u=o(U);if(u){let a=u.ownerDocument.nodesByProps.get(n);return a||(a=u.ownerDocument.createElement(t.type),a.setProps(n,r,t,i,c),u.appendChild(a),u.ownerDocument.updateCollection(),u.ownerDocument.nodesByProps.set(n,a)),s?e.createElement(U.Provider,{value:a},s):null}return e.createElement(t.type,{ref:l},s)}function K(t,n){let i=({node:e})=>n(e.props,e.props.ref,e),a=r((r,a)=>{let s=o(g);if(!o(H)){if(n.length>=3)throw Error(n.name+` cannot be rendered outside a collection.`);return n(r,a)}return G(t,r,a,`children`in r?r.children:null,null,t=>e.createElement(g.Provider,{value:s},e.createElement(i,{node:t})))});return a.displayName=n.name,a}const q={CollectionRoot({collection:e,renderDropIndicator:t}){return J(e,null,t)},CollectionBranch({collection:e,parent:t,renderDropIndicator:n}){return J(e,t,n)}};function J(t,n,r){return B({items:n?t.getChildren(n.key):t,dependencies:[r],children(n){let i=n.render(n);return!r||n.type!==`item`?i:e.createElement(e.Fragment,null,r({type:`item`,key:n.key,dropPosition:`before`}),i,Y(t,n,r))}})}function Y(e,n,r){let a=n.key,o=e.getKeyAfter(a),s=o==null?null:e.getItem(o);for(;s!=null&&s.type!==`item`;)o=e.getKeyAfter(s.key),s=o==null?null:e.getItem(o);let c=n.nextKey==null?null:e.getItem(n.nextKey);for(;c!=null&&c.type!==`item`;)c=c.nextKey==null?null:e.getItem(c.nextKey);let l=[];if(c==null){let a=n;for(;a?.type===`item`&&(!s||a.parentKey!==s.parentKey&&s.level<a.level);){let n=r({type:`item`,key:a.key,dropPosition:`after`});i(n)&&l.push(t(n,{key:`${a.key}-after`})),a=a.parentKey==null?null:e.getItem(a.parentKey)}}return l}const X=n(q),Z=n({}),Q=n({}),te=n({}),ne=n({isSelected:!1}),$=n(null);K(I,function(t,n,r){let i=o($),{isLoading:a,onLoadMore:s,scrollOffset:f,...p}=t,h=l(null),g=c(()=>({onLoadMore:s,collection:i?.collection,sentinelRef:h,scrollOffset:f}),[s,f,i?.collection]);m(g,h);let v=k({...p,id:void 0,children:r.rendered,defaultClassName:`react-aria-ListBoxLoadingIndicator`,values:void 0});return e.createElement(e.Fragment,null,e.createElement(`div`,{style:{position:`relative`,width:0,height:0},inert:d(!0)},e.createElement(`div`,{"data-testid":`loadMoreSentinel`,ref:h,style:{position:`absolute`,height:1,width:1}})),a&&v.children&&e.createElement(M.div,{..._(u(t,{global:!0}),{tabIndex:-1}),...v,role:`option`,ref:n},v.children))});const re=K(L,function(t,n,r){let i=o($),{dragAndDropHooks:a,dragState:c,dropState:d}=o(te),f=h(n),{isVirtualized:p}=o(X),{rowProps:m,gridCellProps:g,descriptionProps:C,...w}=y({node:r,shouldSelectOnPressUp:!!c,isVirtualized:p},i,f),{hoverProps:A,isHovered:j}=x({isDisabled:!w.allowsSelection&&!w.hasAction,onHoverStart:r.props.onHoverStart,onHoverChange:r.props.onHoverChange,onHoverEnd:r.props.onHoverEnd}),{isFocusVisible:N,focusProps:P}=v(),{checkboxProps:F}=b({key:r.key},i),I=i.selectionManager.disabledBehavior===`all`&&w.isDisabled?{isDisabled:!0}:{},L=null;c&&a&&(L=a.useDraggableItem({key:r.key,hasDragButton:!0},c));let R=null,z=l(null),{visuallyHiddenProps:B}=S();d&&a&&(R=a.useDropIndicator({target:{type:`item`,key:r.key,dropPosition:`on`}},d,z));let V=c&&c.isDragging(r.key),H=k({...t,id:void 0,children:r.rendered,defaultClassName:`react-aria-GridListItem`,values:{...w,isHovered:j,isFocusVisible:N,selectionMode:i.selectionManager.selectionMode,selectionBehavior:i.selectionManager.selectionBehavior,allowsDragging:!!c,isDragging:V,isDropTarget:R?.isDropTarget}}),U=l(null);s(()=>{c&&!U.current&&console.warn(`Draggable items in a GridList must contain a <Button slot="drag"> element so that keyboard and screen reader users can drag them.`)},[]),s(()=>{r.textValue},[r.textValue]);let W=u(t,{global:!0});return delete W.id,delete W.onClick,e.createElement(e.Fragment,null,R&&!R.isHidden&&e.createElement(`div`,{role:`row`,style:{position:`absolute`}},e.createElement(`div`,{role:`gridcell`},e.createElement(`div`,{role:`button`,...B,...R?.dropIndicatorProps,ref:z}))),e.createElement(M.div,{..._(W,H,m,P,A,L?.dragProps),ref:f,"data-selected":w.isSelected||void 0,"data-disabled":w.isDisabled||void 0,"data-hovered":j||void 0,"data-focused":w.isFocused||void 0,"data-focus-visible":N||void 0,"data-pressed":w.isPressed||void 0,"data-allows-dragging":!!c||void 0,"data-dragging":V||void 0,"data-drop-target":R?.isDropTarget||void 0,"data-selection-mode":i.selectionManager.selectionMode===`none`?void 0:i.selectionManager.selectionMode},e.createElement(`div`,{...g,style:{display:`contents`}},e.createElement(O,{values:[[T,{slots:{[D]:{},selection:F}}],[Z,{slots:{[D]:I,drag:{...L?.dragButtonProps,ref:U,style:{pointerEvents:`none`}}}}],[Q,{slots:{[D]:{},description:C}}],[X,q],[$,null],[ee,null],[E,null],[ne,{isSelected:w.isSelected}]]},H.children))))});K(I,function(t,n,r){let i=o($),{isVirtualized:a}=o(X),{isLoading:s,onLoadMore:f,scrollOffset:p,...h}=t,g=l(null),_=c(()=>({onLoadMore:f,collection:i?.collection,sentinelRef:g,scrollOffset:p}),[f,p,i?.collection]);m(_,g);let v=k({...h,id:void 0,children:r.rendered,defaultClassName:`react-aria-GridListLoadingIndicator`,values:void 0});return e.createElement(e.Fragment,null,e.createElement(`div`,{style:{position:`relative`,width:0,height:0},inert:d(!0)},e.createElement(`div`,{"data-testid":`loadMoreSentinel`,ref:g,style:{position:`absolute`,height:1,width:1}})),s&&v.children&&e.createElement(M.div,{...v,...u(t,{global:!0}),role:`row`,ref:n},e.createElement(`div`,{"aria-colindex":a?1:void 0,role:`gridcell`},v.children)))});export{re as GridListItem};
1
+ import e,{cloneElement as t,createContext as n,forwardRef as r,isValidElement as i,useCallback as a,useContext as o,useEffect as s,useMemo as c,useRef as l}from"react";import{filterDOMProps as u,inertValue as d,mergeRefs as f,useLayoutEffect as p,useLoadMoreSentinel as m,useObjectRef as h}from"@react-aria/utils";import{FocusableContext as g}from"@react-aria/interactions";import"react-dom";import{mergeProps as _,useFocusRing as v,useGridListItem as y,useGridListSelectionCheckbox as b,useHover as x,useVisuallyHidden as S}from"react-aria";import"react-stately";const C=n(null);n(null),n(null),n(null),n(null),n({});const w=n(null),T=n(null),E=Symbol(`default`);function D({values:t,children:n}){for(let[r,i]of t)n=e.createElement(r.Provider,{value:i},n);return n}function O(e){let{className:t,style:n,children:r,defaultClassName:i,defaultChildren:a,defaultStyle:o,values:s,render:l}=e;return c(()=>{let e,c,u;return e=typeof t==`function`?t({...s,defaultClassName:i}):t,c=typeof n==`function`?n({...s,defaultStyle:o||{}}):n,u=typeof r==`function`?r({...s,defaultChildren:a}):r??a,{className:e??i,style:c||o?{...o,...c}:void 0,children:u??a,"data-rac":``,render:l?e=>l(e,s):void 0}},[t,n,r,i,a,o,s,l])}function k(t,n,r){let{render:i,...a}=n,o=l(null),s=c(()=>f(r,o),[r,o]);p(()=>{},[t,i]);let u={...a,ref:s};return i?i(u,void 0):e.createElement(t,u)}const A={},j=new Proxy({},{get(e,t){if(typeof t!=`string`)return;let n=A[t];return n||(n=r(k.bind(null,t)),A[t]=n),n}});String(Math.round(Math.random()*1e10)),typeof window<`u`&&window.document&&window.document.createElement,e.useId;var M=class{get childNodes(){throw Error(`childNodes is not supported`)}clone(){let e=new this.constructor(this.key);return e.value=this.value,e.level=this.level,e.hasChildNodes=this.hasChildNodes,e.rendered=this.rendered,e.textValue=this.textValue,e[`aria-label`]=this[`aria-label`],e.index=this.index,e.parentKey=this.parentKey,e.prevKey=this.prevKey,e.nextKey=this.nextKey,e.firstChildKey=this.firstChildKey,e.lastChildKey=this.lastChildKey,e.props=this.props,e.render=this.render,e.colSpan=this.colSpan,e.colIndex=this.colIndex,e}filter(e,t,n){let r=this.clone();return t.addDescendants(r,e),r}constructor(e){this.value=null,this.level=0,this.hasChildNodes=!1,this.rendered=null,this.textValue=``,this[`aria-label`]=void 0,this.index=0,this.parentKey=null,this.prevKey=null,this.nextKey=null,this.firstChildKey=null,this.lastChildKey=null,this.props={},this.colSpan=null,this.colIndex=null,this.type=this.constructor.type,this.key=e}},N=class extends M{filter(e,t,n){let[r,i]=R(e,t,this.firstChildKey,n),a=this.clone();return a.firstChildKey=r,a.lastChildKey=i,a}},P=class extends M{};P.type=`header`;var F=class extends M{};F.type=`loader`;var I=class extends N{filter(e,t,n){if(n(this.textValue,this)){let n=this.clone();return t.addDescendants(n,e),n}return null}};I.type=`item`;var L=class extends N{filter(e,t,n){let r=super.filter(e,t,n);if(r&&r.lastChildKey!==null){let t=e.getItem(r.lastChildKey);if(t&&t.type!==`header`)return r}return null}};L.type=`section`;function R(e,t,n,r){if(n==null)return[null,null];let i=null,a=null,o=e.getItem(n);for(;o!=null;){let n=o.filter(e,t,r);n!=null&&(n.nextKey=null,a&&(n.prevKey=a.key,a.nextKey=n.key),i??=n,t.addNode(n),a=n),o=o.nextKey?e.getItem(o.nextKey):null}if(a&&a.type===`separator`){let e=a.prevKey;t.removeNode(a.key),e?(a=t.getItem(e),a.nextKey=null):a=null}return[i?.key??null,a?.key??null]}function z(e){let{children:n,items:r,idScope:i,addIdAndValue:a,dependencies:o=[]}=e,s=c(()=>new WeakMap,o);return c(()=>{if(r&&typeof n==`function`){let e=[];for(let o of r){let r=s.get(o);if(!r){r=n(o);let e=r.props.id??o.key??o.id;if(e==null)throw Error(`Could not determine key for item`);i!=null&&(e=i+`:`+e),r=t(r,a?{key:e,id:e,value:o}:{key:e}),s.set(o,r)}e.push(r)}return e}if(typeof n!=`function`)return n},[n,r,s,i,a])}const B=n(!1);typeof e.useSyncExternalStore==`function`&&e.useSyncExternalStore;const V=n(null);function H(e){var t;return t=class extends M{},t.type=e,t}function U(t,n,r,i,s,c){typeof t==`string`&&(t=H(t));let l=a(e=>{e?.setProps(n,r,t,i,c)},[n,r,i,c,t]),u=o(V);if(u){let a=u.ownerDocument.nodesByProps.get(n);return a||(a=u.ownerDocument.createElement(t.type),a.setProps(n,r,t,i,c),u.appendChild(a),u.ownerDocument.updateCollection(),u.ownerDocument.nodesByProps.set(n,a)),s?e.createElement(V.Provider,{value:a},s):null}return e.createElement(t.type,{ref:l},s)}function W(t,n){let i=({node:e})=>n(e.props,e.props.ref,e),a=r((r,a)=>{let s=o(g);if(!o(B)){if(n.length>=3)throw Error(n.name+` cannot be rendered outside a collection.`);return n(r,a)}return U(t,r,a,`children`in r?r.children:null,null,t=>e.createElement(g.Provider,{value:s},e.createElement(i,{node:t})))});return a.displayName=n.name,a}const G={CollectionRoot({collection:e,renderDropIndicator:t}){return K(e,null,t)},CollectionBranch({collection:e,parent:t,renderDropIndicator:n}){return K(e,t,n)}};function K(t,n,r){return z({items:n?t.getChildren(n.key):t,dependencies:[r],children(n){let i=n.render(n);return!r||n.type!==`item`?i:e.createElement(e.Fragment,null,r({type:`item`,key:n.key,dropPosition:`before`}),i,q(t,n,r))}})}function q(e,n,r){let a=n.key,o=e.getKeyAfter(a),s=o==null?null:e.getItem(o);for(;s!=null&&s.type!==`item`;)o=e.getKeyAfter(s.key),s=o==null?null:e.getItem(o);let c=n.nextKey==null?null:e.getItem(n.nextKey);for(;c!=null&&c.type!==`item`;)c=c.nextKey==null?null:e.getItem(c.nextKey);let l=[];if(c==null){let a=n;for(;a?.type===`item`&&(!s||a.parentKey!==s.parentKey&&s.level<a.level);){let n=r({type:`item`,key:a.key,dropPosition:`after`});i(n)&&l.push(t(n,{key:`${a.key}-after`})),a=a.parentKey==null?null:e.getItem(a.parentKey)}}return l}const J=n(G),Y=n({}),X=n({}),Z=n({}),Q=n({isSelected:!1}),$=n(null);W(F,function(t,n,r){let i=o($),{isLoading:a,onLoadMore:s,scrollOffset:f,...p}=t,h=l(null),g=c(()=>({onLoadMore:s,collection:i?.collection,sentinelRef:h,scrollOffset:f}),[s,f,i?.collection]);m(g,h);let v=O({...p,id:void 0,children:r.rendered,defaultClassName:`react-aria-ListBoxLoadingIndicator`,values:void 0});return e.createElement(e.Fragment,null,e.createElement(`div`,{style:{position:`relative`,width:0,height:0},inert:d(!0)},e.createElement(`div`,{"data-testid":`loadMoreSentinel`,ref:h,style:{position:`absolute`,height:1,width:1}})),a&&v.children&&e.createElement(j.div,{..._(u(t,{global:!0}),{tabIndex:-1}),...v,role:`option`,ref:n},v.children))});const ee=W(I,function(t,n,r){let i=o($),{dragAndDropHooks:a,dragState:c,dropState:d}=o(Z),f=h(n),{isVirtualized:p}=o(J),{rowProps:m,gridCellProps:g,descriptionProps:k,...A}=y({node:r,shouldSelectOnPressUp:!!c,isVirtualized:p},i,f),{hoverProps:M,isHovered:N}=x({isDisabled:!A.allowsSelection&&!A.hasAction,onHoverStart:r.props.onHoverStart,onHoverChange:r.props.onHoverChange,onHoverEnd:r.props.onHoverEnd}),{isFocusVisible:P,focusProps:F}=v(),{checkboxProps:I}=b({key:r.key},i),L=i.selectionManager.disabledBehavior===`all`&&A.isDisabled?{isDisabled:!0}:{},R=null;c&&a&&(R=a.useDraggableItem({key:r.key,hasDragButton:!0},c));let z=null,B=l(null),{visuallyHiddenProps:V}=S();d&&a&&(z=a.useDropIndicator({target:{type:`item`,key:r.key,dropPosition:`on`}},d,B));let H=c&&c.isDragging(r.key),U=O({...t,id:void 0,children:r.rendered,defaultClassName:`react-aria-GridListItem`,values:{...A,isHovered:N,isFocusVisible:P,selectionMode:i.selectionManager.selectionMode,selectionBehavior:i.selectionManager.selectionBehavior,allowsDragging:!!c,isDragging:H,isDropTarget:z?.isDropTarget}}),W=l(null);s(()=>{c&&!W.current&&console.warn(`Draggable items in a GridList must contain a <Button slot="drag"> element so that keyboard and screen reader users can drag them.`)},[]),s(()=>{r.textValue},[r.textValue]);let K=u(t,{global:!0});return delete K.id,delete K.onClick,e.createElement(e.Fragment,null,z&&!z.isHidden&&e.createElement(`div`,{role:`row`,style:{position:`absolute`}},e.createElement(`div`,{role:`gridcell`},e.createElement(`div`,{role:`button`,...V,...z?.dropIndicatorProps,ref:B}))),e.createElement(j.div,{..._(K,U,m,F,M,R?.dragProps),ref:f,"data-selected":A.isSelected||void 0,"data-disabled":A.isDisabled||void 0,"data-hovered":N||void 0,"data-focused":A.isFocused||void 0,"data-focus-visible":P||void 0,"data-pressed":A.isPressed||void 0,"data-allows-dragging":!!c||void 0,"data-dragging":H||void 0,"data-drop-target":z?.isDropTarget||void 0,"data-selection-mode":i.selectionManager.selectionMode===`none`?void 0:i.selectionManager.selectionMode},e.createElement(`div`,{...g,style:{display:`contents`}},e.createElement(D,{values:[[C,{slots:{[E]:{},selection:I}}],[Y,{slots:{[E]:L,drag:{...R?.dragButtonProps,ref:W,style:{pointerEvents:`none`}}}}],[X,{slots:{[E]:{},description:k}}],[J,G],[$,null],[w,null],[T,null],[Q,{isSelected:A.isSelected}]]},U.children))))});W(F,function(t,n,r){let i=o($),{isVirtualized:a}=o(J),{isLoading:s,onLoadMore:f,scrollOffset:p,...h}=t,g=l(null),_=c(()=>({onLoadMore:f,collection:i?.collection,sentinelRef:g,scrollOffset:p}),[f,p,i?.collection]);m(_,g);let v=O({...h,id:void 0,children:r.rendered,defaultClassName:`react-aria-GridListLoadingIndicator`,values:void 0});return e.createElement(e.Fragment,null,e.createElement(`div`,{style:{position:`relative`,width:0,height:0},inert:d(!0)},e.createElement(`div`,{"data-testid":`loadMoreSentinel`,ref:g,style:{position:`absolute`,height:1,width:1}})),s&&v.children&&e.createElement(j.div,{...v,...u(t,{global:!0}),role:`row`,ref:n},e.createElement(`div`,{"aria-colindex":a?1:void 0,role:`gridcell`},v.children)))});export{ee as GridListItem};
@@ -1,11 +1 @@
1
- import e,{cloneElement as t,createContext as n,forwardRef as r,isValidElement as i,useCallback as a,useContext as o,useMemo as s,useRef as c}from"react";import{filterDOMProps as l,inertValue as u,mergeRefs as d,useLayoutEffect as f,useLoadMoreSentinel as p}from"@react-aria/utils";import{FocusableContext as m}from"@react-aria/interactions";import"react-dom";import{mergeProps as h}from"react-aria";import"react-stately";var g=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),_=(e=>typeof require<`u`?require:typeof Proxy<`u`?new Proxy(e,{get:(e,t)=>(typeof require<`u`?require:e)[t]}):e)(function(e){if(typeof require<`u`)return require.apply(this,arguments);throw Error('Calling `require` for "'+e+"\" in an environment that doesn't expose the `require` function. See https://rolldown.rs/in-depth/bundling-cjs#require-external-modules for more details.")});function v(e){let{className:t,style:n,children:r,defaultClassName:i,defaultChildren:a,defaultStyle:o,values:c,render:l}=e;return s(()=>{let e,s,u;return e=typeof t==`function`?t({...c,defaultClassName:i}):t,s=typeof n==`function`?n({...c,defaultStyle:o||{}}):n,u=typeof r==`function`?r({...c,defaultChildren:a}):r??a,{className:e??i,style:s||o?{...o,...s}:void 0,children:u??a,"data-rac":``,render:l?e=>l(e,c):void 0}},[t,n,r,i,a,o,c,l])}function y(t,n,r){let{render:i,...a}=n,o=c(null),l=s(()=>d(r,o),[r,o]);f(()=>{},[t,i]);let u={...a,ref:l};return i?i(u,void 0):e.createElement(t,u)}const b={},x=new Proxy({},{get(e,t){if(typeof t!=`string`)return;let n=b[t];return n||(n=r(y.bind(null,t)),b[t]=n),n}});String(Math.round(Math.random()*1e10)),typeof window<`u`&&window.document&&window.document.createElement,e.useId;var S=class{get childNodes(){throw Error(`childNodes is not supported`)}clone(){let e=new this.constructor(this.key);return e.value=this.value,e.level=this.level,e.hasChildNodes=this.hasChildNodes,e.rendered=this.rendered,e.textValue=this.textValue,e[`aria-label`]=this[`aria-label`],e.index=this.index,e.parentKey=this.parentKey,e.prevKey=this.prevKey,e.nextKey=this.nextKey,e.firstChildKey=this.firstChildKey,e.lastChildKey=this.lastChildKey,e.props=this.props,e.render=this.render,e.colSpan=this.colSpan,e.colIndex=this.colIndex,e}filter(e,t,n){let r=this.clone();return t.addDescendants(r,e),r}constructor(e){this.value=null,this.level=0,this.hasChildNodes=!1,this.rendered=null,this.textValue=``,this[`aria-label`]=void 0,this.index=0,this.parentKey=null,this.prevKey=null,this.nextKey=null,this.firstChildKey=null,this.lastChildKey=null,this.props={},this.colSpan=null,this.colIndex=null,this.type=this.constructor.type,this.key=e}},C=class extends S{filter(e,t,n){let[r,i]=O(e,t,this.firstChildKey,n),a=this.clone();return a.firstChildKey=r,a.lastChildKey=i,a}},w=class extends S{};w.type=`header`;var T=class extends S{};T.type=`loader`;var E=class extends C{filter(e,t,n){if(n(this.textValue,this)){let n=this.clone();return t.addDescendants(n,e),n}return null}};E.type=`item`;var D=class extends C{filter(e,t,n){let r=super.filter(e,t,n);if(r&&r.lastChildKey!==null){let t=e.getItem(r.lastChildKey);if(t&&t.type!==`header`)return r}return null}};D.type=`section`;function O(e,t,n,r){if(n==null)return[null,null];let i=null,a=null,o=e.getItem(n);for(;o!=null;){let n=o.filter(e,t,r);n!=null&&(n.nextKey=null,a&&(n.prevKey=a.key,a.nextKey=n.key),i??=n,t.addNode(n),a=n),o=o.nextKey?e.getItem(o.nextKey):null}if(a&&a.type===`separator`){let e=a.prevKey;t.removeNode(a.key),e?(a=t.getItem(e),a.nextKey=null):a=null}return[i?.key??null,a?.key??null]}function k(e){let{children:n,items:r,idScope:i,addIdAndValue:a,dependencies:o=[]}=e,c=s(()=>new WeakMap,o);return s(()=>{if(r&&typeof n==`function`){let e=[];for(let o of r){let r=c.get(o);if(!r){r=n(o);let e=r.props.id??o.key??o.id;if(e==null)throw Error(`Could not determine key for item`);i!=null&&(e=i+`:`+e),r=t(r,a?{key:e,id:e,value:o}:{key:e}),c.set(o,r)}e.push(r)}return e}if(typeof n!=`function`)return n},[n,r,c,i,a])}
2
- /**
3
- * @license React
4
- * use-sync-external-store-shim.production.js
5
- *
6
- * Copyright (c) Meta Platforms, Inc. and affiliates.
7
- *
8
- * This source code is licensed under the MIT license found in the
9
- * LICENSE file in the root directory of this source tree.
10
- */
11
- var A=g((e=>{var t=_(`react`);function n(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var r=typeof Object.is==`function`?Object.is:n,i=t.useState,a=t.useEffect,o=t.useLayoutEffect,s=t.useDebugValue;function c(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),c=r[0].inst,u=r[1];return o(function(){c.value=n,c.getSnapshot=t,l(c)&&u({inst:c})},[e,n,t]),a(function(){return l(c)&&u({inst:c}),e(function(){l(c)&&u({inst:c})})},[e]),s(n),n}function l(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch{return!0}}function u(e,t){return t()}var d=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?u:c;e.useSyncExternalStore=t.useSyncExternalStore===void 0?d:t.useSyncExternalStore}));g(((e,t)=>{t.exports=A()}))();const j=n(!1);typeof e.useSyncExternalStore==`function`&&e.useSyncExternalStore;const M=n(null);function N(e){var t;return t=class extends S{},t.type=e,t}function P(t,n,r,i,s,c){typeof t==`string`&&(t=N(t));let l=a(e=>{e?.setProps(n,r,t,i,c)},[n,r,i,c,t]),u=o(M);if(u){let a=u.ownerDocument.nodesByProps.get(n);return a||(a=u.ownerDocument.createElement(t.type),a.setProps(n,r,t,i,c),u.appendChild(a),u.ownerDocument.updateCollection(),u.ownerDocument.nodesByProps.set(n,a)),s?e.createElement(M.Provider,{value:a},s):null}return e.createElement(t.type,{ref:l},s)}function F(t,n){let i=({node:e})=>n(e.props,e.props.ref,e),a=r((r,a)=>{let s=o(m);if(!o(j)){if(n.length>=3)throw Error(n.name+` cannot be rendered outside a collection.`);return n(r,a)}return P(t,r,a,`children`in r?r.children:null,null,t=>e.createElement(m.Provider,{value:s},e.createElement(i,{node:t})))});return a.displayName=n.name,a}const I={CollectionRoot({collection:e,renderDropIndicator:t}){return L(e,null,t)},CollectionBranch({collection:e,parent:t,renderDropIndicator:n}){return L(e,t,n)}};function L(t,n,r){return k({items:n?t.getChildren(n.key):t,dependencies:[r],children(n){let i=n.render(n);return!r||n.type!==`item`?i:e.createElement(e.Fragment,null,r({type:`item`,key:n.key,dropPosition:`before`}),i,R(t,n,r))}})}function R(e,n,r){let a=n.key,o=e.getKeyAfter(a),s=o==null?null:e.getItem(o);for(;s!=null&&s.type!==`item`;)o=e.getKeyAfter(s.key),s=o==null?null:e.getItem(o);let c=n.nextKey==null?null:e.getItem(n.nextKey);for(;c!=null&&c.type!==`item`;)c=c.nextKey==null?null:e.getItem(c.nextKey);let l=[];if(c==null){let a=n;for(;a?.type===`item`&&(!s||a.parentKey!==s.parentKey&&s.level<a.level);){let n=r({type:`item`,key:a.key,dropPosition:`after`});i(n)&&l.push(t(n,{key:`${a.key}-after`})),a=a.parentKey==null?null:e.getItem(a.parentKey)}}return l}const z=n(I),B=n(null);F(T,function(t,n,r){let i=o(B),{isLoading:a,onLoadMore:d,scrollOffset:f,...m}=t,g=c(null),_=s(()=>({onLoadMore:d,collection:i?.collection,sentinelRef:g,scrollOffset:f}),[d,f,i?.collection]);p(_,g);let y=v({...m,id:void 0,children:r.rendered,defaultClassName:`react-aria-ListBoxLoadingIndicator`,values:void 0});return e.createElement(e.Fragment,null,e.createElement(`div`,{style:{position:`relative`,width:0,height:0},inert:u(!0)},e.createElement(`div`,{"data-testid":`loadMoreSentinel`,ref:g,style:{position:`absolute`,height:1,width:1}})),a&&y.children&&e.createElement(x.div,{...h(l(t,{global:!0}),{tabIndex:-1}),...y,role:`option`,ref:n},y.children))});const V=F(T,function(t,n,r){let i=o(B),{isVirtualized:a}=o(z),{isLoading:d,onLoadMore:f,scrollOffset:m,...h}=t,g=c(null),_=s(()=>({onLoadMore:f,collection:i?.collection,sentinelRef:g,scrollOffset:m}),[f,m,i?.collection]);p(_,g);let y=v({...h,id:void 0,children:r.rendered,defaultClassName:`react-aria-GridListLoadingIndicator`,values:void 0});return e.createElement(e.Fragment,null,e.createElement(`div`,{style:{position:`relative`,width:0,height:0},inert:u(!0)},e.createElement(`div`,{"data-testid":`loadMoreSentinel`,ref:g,style:{position:`absolute`,height:1,width:1}})),d&&y.children&&e.createElement(x.div,{...y,...l(t,{global:!0}),role:`row`,ref:n},e.createElement(`div`,{"aria-colindex":a?1:void 0,role:`gridcell`},y.children)))});export{V as GridListLoadMoreItem};
1
+ import e,{cloneElement as t,createContext as n,forwardRef as r,isValidElement as i,useCallback as a,useContext as o,useMemo as s,useRef as c}from"react";import{filterDOMProps as l,inertValue as u,mergeRefs as d,useLayoutEffect as f,useLoadMoreSentinel as p}from"@react-aria/utils";import{FocusableContext as m}from"@react-aria/interactions";import"react-dom";import{mergeProps as h}from"react-aria";import"react-stately";function g(e){let{className:t,style:n,children:r,defaultClassName:i,defaultChildren:a,defaultStyle:o,values:c,render:l}=e;return s(()=>{let e,s,u;return e=typeof t==`function`?t({...c,defaultClassName:i}):t,s=typeof n==`function`?n({...c,defaultStyle:o||{}}):n,u=typeof r==`function`?r({...c,defaultChildren:a}):r??a,{className:e??i,style:s||o?{...o,...s}:void 0,children:u??a,"data-rac":``,render:l?e=>l(e,c):void 0}},[t,n,r,i,a,o,c,l])}function _(t,n,r){let{render:i,...a}=n,o=c(null),l=s(()=>d(r,o),[r,o]);f(()=>{},[t,i]);let u={...a,ref:l};return i?i(u,void 0):e.createElement(t,u)}const v={},y=new Proxy({},{get(e,t){if(typeof t!=`string`)return;let n=v[t];return n||(n=r(_.bind(null,t)),v[t]=n),n}});String(Math.round(Math.random()*1e10)),typeof window<`u`&&window.document&&window.document.createElement,e.useId;var b=class{get childNodes(){throw Error(`childNodes is not supported`)}clone(){let e=new this.constructor(this.key);return e.value=this.value,e.level=this.level,e.hasChildNodes=this.hasChildNodes,e.rendered=this.rendered,e.textValue=this.textValue,e[`aria-label`]=this[`aria-label`],e.index=this.index,e.parentKey=this.parentKey,e.prevKey=this.prevKey,e.nextKey=this.nextKey,e.firstChildKey=this.firstChildKey,e.lastChildKey=this.lastChildKey,e.props=this.props,e.render=this.render,e.colSpan=this.colSpan,e.colIndex=this.colIndex,e}filter(e,t,n){let r=this.clone();return t.addDescendants(r,e),r}constructor(e){this.value=null,this.level=0,this.hasChildNodes=!1,this.rendered=null,this.textValue=``,this[`aria-label`]=void 0,this.index=0,this.parentKey=null,this.prevKey=null,this.nextKey=null,this.firstChildKey=null,this.lastChildKey=null,this.props={},this.colSpan=null,this.colIndex=null,this.type=this.constructor.type,this.key=e}},x=class extends b{filter(e,t,n){let[r,i]=E(e,t,this.firstChildKey,n),a=this.clone();return a.firstChildKey=r,a.lastChildKey=i,a}},S=class extends b{};S.type=`header`;var C=class extends b{};C.type=`loader`;var w=class extends x{filter(e,t,n){if(n(this.textValue,this)){let n=this.clone();return t.addDescendants(n,e),n}return null}};w.type=`item`;var T=class extends x{filter(e,t,n){let r=super.filter(e,t,n);if(r&&r.lastChildKey!==null){let t=e.getItem(r.lastChildKey);if(t&&t.type!==`header`)return r}return null}};T.type=`section`;function E(e,t,n,r){if(n==null)return[null,null];let i=null,a=null,o=e.getItem(n);for(;o!=null;){let n=o.filter(e,t,r);n!=null&&(n.nextKey=null,a&&(n.prevKey=a.key,a.nextKey=n.key),i??=n,t.addNode(n),a=n),o=o.nextKey?e.getItem(o.nextKey):null}if(a&&a.type===`separator`){let e=a.prevKey;t.removeNode(a.key),e?(a=t.getItem(e),a.nextKey=null):a=null}return[i?.key??null,a?.key??null]}function D(e){let{children:n,items:r,idScope:i,addIdAndValue:a,dependencies:o=[]}=e,c=s(()=>new WeakMap,o);return s(()=>{if(r&&typeof n==`function`){let e=[];for(let o of r){let r=c.get(o);if(!r){r=n(o);let e=r.props.id??o.key??o.id;if(e==null)throw Error(`Could not determine key for item`);i!=null&&(e=i+`:`+e),r=t(r,a?{key:e,id:e,value:o}:{key:e}),c.set(o,r)}e.push(r)}return e}if(typeof n!=`function`)return n},[n,r,c,i,a])}const O=n(!1);typeof e.useSyncExternalStore==`function`&&e.useSyncExternalStore;const k=n(null);function A(e){var t;return t=class extends b{},t.type=e,t}function j(t,n,r,i,s,c){typeof t==`string`&&(t=A(t));let l=a(e=>{e?.setProps(n,r,t,i,c)},[n,r,i,c,t]),u=o(k);if(u){let a=u.ownerDocument.nodesByProps.get(n);return a||(a=u.ownerDocument.createElement(t.type),a.setProps(n,r,t,i,c),u.appendChild(a),u.ownerDocument.updateCollection(),u.ownerDocument.nodesByProps.set(n,a)),s?e.createElement(k.Provider,{value:a},s):null}return e.createElement(t.type,{ref:l},s)}function M(t,n){let i=({node:e})=>n(e.props,e.props.ref,e),a=r((r,a)=>{let s=o(m);if(!o(O)){if(n.length>=3)throw Error(n.name+` cannot be rendered outside a collection.`);return n(r,a)}return j(t,r,a,`children`in r?r.children:null,null,t=>e.createElement(m.Provider,{value:s},e.createElement(i,{node:t})))});return a.displayName=n.name,a}const N={CollectionRoot({collection:e,renderDropIndicator:t}){return P(e,null,t)},CollectionBranch({collection:e,parent:t,renderDropIndicator:n}){return P(e,t,n)}};function P(t,n,r){return D({items:n?t.getChildren(n.key):t,dependencies:[r],children(n){let i=n.render(n);return!r||n.type!==`item`?i:e.createElement(e.Fragment,null,r({type:`item`,key:n.key,dropPosition:`before`}),i,F(t,n,r))}})}function F(e,n,r){let a=n.key,o=e.getKeyAfter(a),s=o==null?null:e.getItem(o);for(;s!=null&&s.type!==`item`;)o=e.getKeyAfter(s.key),s=o==null?null:e.getItem(o);let c=n.nextKey==null?null:e.getItem(n.nextKey);for(;c!=null&&c.type!==`item`;)c=c.nextKey==null?null:e.getItem(c.nextKey);let l=[];if(c==null){let a=n;for(;a?.type===`item`&&(!s||a.parentKey!==s.parentKey&&s.level<a.level);){let n=r({type:`item`,key:a.key,dropPosition:`after`});i(n)&&l.push(t(n,{key:`${a.key}-after`})),a=a.parentKey==null?null:e.getItem(a.parentKey)}}return l}const I=n(N),L=n(null);M(C,function(t,n,r){let i=o(L),{isLoading:a,onLoadMore:d,scrollOffset:f,...m}=t,_=c(null),v=s(()=>({onLoadMore:d,collection:i?.collection,sentinelRef:_,scrollOffset:f}),[d,f,i?.collection]);p(v,_);let b=g({...m,id:void 0,children:r.rendered,defaultClassName:`react-aria-ListBoxLoadingIndicator`,values:void 0});return e.createElement(e.Fragment,null,e.createElement(`div`,{style:{position:`relative`,width:0,height:0},inert:u(!0)},e.createElement(`div`,{"data-testid":`loadMoreSentinel`,ref:_,style:{position:`absolute`,height:1,width:1}})),a&&b.children&&e.createElement(y.div,{...h(l(t,{global:!0}),{tabIndex:-1}),...b,role:`option`,ref:n},b.children))});const R=M(C,function(t,n,r){let i=o(L),{isVirtualized:a}=o(I),{isLoading:d,onLoadMore:f,scrollOffset:m,...h}=t,_=c(null),v=s(()=>({onLoadMore:f,collection:i?.collection,sentinelRef:_,scrollOffset:m}),[f,m,i?.collection]);p(v,_);let b=g({...h,id:void 0,children:r.rendered,defaultClassName:`react-aria-GridListLoadingIndicator`,values:void 0});return e.createElement(e.Fragment,null,e.createElement(`div`,{style:{position:`relative`,width:0,height:0},inert:u(!0)},e.createElement(`div`,{"data-testid":`loadMoreSentinel`,ref:_,style:{position:`absolute`,height:1,width:1}})),d&&b.children&&e.createElement(y.div,{...b,...l(t,{global:!0}),role:`row`,ref:n},e.createElement(`div`,{"aria-colindex":a?1:void 0,role:`gridcell`},b.children)))});export{R as GridListLoadMoreItem};
@@ -1,11 +1 @@
1
- import e,{cloneElement as t,createContext as n,forwardRef as r,isValidElement as i,useCallback as a,useContext as o,useMemo as s,useRef as c}from"react";import{filterDOMProps as l,inertValue as u,mergeRefs as d,useLayoutEffect as f,useLoadMoreSentinel as p,useObjectRef as m}from"@react-aria/utils";import{FocusableContext as h}from"@react-aria/interactions";import"react-dom";import{mergeProps as g,useGridListSection as _}from"react-aria";import"react-stately";var v=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),y=(e=>typeof require<`u`?require:typeof Proxy<`u`?new Proxy(e,{get:(e,t)=>(typeof require<`u`?require:e)[t]}):e)(function(e){if(typeof require<`u`)return require.apply(this,arguments);throw Error('Calling `require` for "'+e+"\" in an environment that doesn't expose the `require` function. See https://rolldown.rs/in-depth/bundling-cjs#require-external-modules for more details.")});function b({values:t,children:n}){for(let[r,i]of t)n=e.createElement(r.Provider,{value:i},n);return n}function x(e){let{className:t,style:n,children:r,defaultClassName:i,defaultChildren:a,defaultStyle:o,values:c,render:l}=e;return s(()=>{let e,s,u;return e=typeof t==`function`?t({...c,defaultClassName:i}):t,s=typeof n==`function`?n({...c,defaultStyle:o||{}}):n,u=typeof r==`function`?r({...c,defaultChildren:a}):r??a,{className:e??i,style:s||o?{...o,...s}:void 0,children:u??a,"data-rac":``,render:l?e=>l(e,c):void 0}},[t,n,r,i,a,o,c,l])}function S(t,n,r){let{render:i,...a}=n,o=c(null),l=s(()=>d(r,o),[r,o]);f(()=>{},[t,i]);let u={...a,ref:l};return i?i(u,void 0):e.createElement(t,u)}const C={},w=new Proxy({},{get(e,t){if(typeof t!=`string`)return;let n=C[t];return n||(n=r(S.bind(null,t)),C[t]=n),n}});String(Math.round(Math.random()*1e10)),typeof window<`u`&&window.document&&window.document.createElement,e.useId;var T=class{get childNodes(){throw Error(`childNodes is not supported`)}clone(){let e=new this.constructor(this.key);return e.value=this.value,e.level=this.level,e.hasChildNodes=this.hasChildNodes,e.rendered=this.rendered,e.textValue=this.textValue,e[`aria-label`]=this[`aria-label`],e.index=this.index,e.parentKey=this.parentKey,e.prevKey=this.prevKey,e.nextKey=this.nextKey,e.firstChildKey=this.firstChildKey,e.lastChildKey=this.lastChildKey,e.props=this.props,e.render=this.render,e.colSpan=this.colSpan,e.colIndex=this.colIndex,e}filter(e,t,n){let r=this.clone();return t.addDescendants(r,e),r}constructor(e){this.value=null,this.level=0,this.hasChildNodes=!1,this.rendered=null,this.textValue=``,this[`aria-label`]=void 0,this.index=0,this.parentKey=null,this.prevKey=null,this.nextKey=null,this.firstChildKey=null,this.lastChildKey=null,this.props={},this.colSpan=null,this.colIndex=null,this.type=this.constructor.type,this.key=e}},E=class extends T{filter(e,t,n){let[r,i]=j(e,t,this.firstChildKey,n),a=this.clone();return a.firstChildKey=r,a.lastChildKey=i,a}},D=class extends T{};D.type=`header`;var O=class extends T{};O.type=`loader`;var k=class extends E{filter(e,t,n){if(n(this.textValue,this)){let n=this.clone();return t.addDescendants(n,e),n}return null}};k.type=`item`;var A=class extends E{filter(e,t,n){let r=super.filter(e,t,n);if(r&&r.lastChildKey!==null){let t=e.getItem(r.lastChildKey);if(t&&t.type!==`header`)return r}return null}};A.type=`section`;function j(e,t,n,r){if(n==null)return[null,null];let i=null,a=null,o=e.getItem(n);for(;o!=null;){let n=o.filter(e,t,r);n!=null&&(n.nextKey=null,a&&(n.prevKey=a.key,a.nextKey=n.key),i??=n,t.addNode(n),a=n),o=o.nextKey?e.getItem(o.nextKey):null}if(a&&a.type===`separator`){let e=a.prevKey;t.removeNode(a.key),e?(a=t.getItem(e),a.nextKey=null):a=null}return[i?.key??null,a?.key??null]}function M(e){let{children:n,items:r,idScope:i,addIdAndValue:a,dependencies:o=[]}=e,c=s(()=>new WeakMap,o);return s(()=>{if(r&&typeof n==`function`){let e=[];for(let o of r){let r=c.get(o);if(!r){r=n(o);let e=r.props.id??o.key??o.id;if(e==null)throw Error(`Could not determine key for item`);i!=null&&(e=i+`:`+e),r=t(r,a?{key:e,id:e,value:o}:{key:e}),c.set(o,r)}e.push(r)}return e}if(typeof n!=`function`)return n},[n,r,c,i,a])}
2
- /**
3
- * @license React
4
- * use-sync-external-store-shim.production.js
5
- *
6
- * Copyright (c) Meta Platforms, Inc. and affiliates.
7
- *
8
- * This source code is licensed under the MIT license found in the
9
- * LICENSE file in the root directory of this source tree.
10
- */
11
- var N=v((e=>{var t=y(`react`);function n(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var r=typeof Object.is==`function`?Object.is:n,i=t.useState,a=t.useEffect,o=t.useLayoutEffect,s=t.useDebugValue;function c(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),c=r[0].inst,u=r[1];return o(function(){c.value=n,c.getSnapshot=t,l(c)&&u({inst:c})},[e,n,t]),a(function(){return l(c)&&u({inst:c}),e(function(){l(c)&&u({inst:c})})},[e]),s(n),n}function l(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch{return!0}}function u(e,t){return t()}var d=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?u:c;e.useSyncExternalStore=t.useSyncExternalStore===void 0?d:t.useSyncExternalStore}));v(((e,t)=>{t.exports=N()}))();const P=n(!1);typeof e.useSyncExternalStore==`function`&&e.useSyncExternalStore;const F=n(null);function I(e){var t;return t=class extends T{},t.type=e,t}function L(t,n,r,i,s,c){typeof t==`string`&&(t=I(t));let l=a(e=>{e?.setProps(n,r,t,i,c)},[n,r,i,c,t]),u=o(F);if(u){let a=u.ownerDocument.nodesByProps.get(n);return a||(a=u.ownerDocument.createElement(t.type),a.setProps(n,r,t,i,c),u.appendChild(a),u.ownerDocument.updateCollection(),u.ownerDocument.nodesByProps.set(n,a)),s?e.createElement(F.Provider,{value:a},s):null}return e.createElement(t.type,{ref:l},s)}function R(t,n){let i=({node:e})=>n(e.props,e.props.ref,e),a=r((r,a)=>{let s=o(h);if(!o(P)){if(n.length>=3)throw Error(n.name+` cannot be rendered outside a collection.`);return n(r,a)}return L(t,r,a,`children`in r?r.children:null,null,t=>e.createElement(h.Provider,{value:s},e.createElement(i,{node:t})))});return a.displayName=n.name,a}function z(t,n,i=B){let a=({node:e})=>n(e.props,e.props.ref,e),o=r((n,r)=>L(t,n,r,null,i(n),t=>e.createElement(a,{node:t}))??e.createElement(e.Fragment,null));return o.displayName=n.name,o}function B(e){return M({...e,addIdAndValue:!0})}const V={CollectionRoot({collection:e,renderDropIndicator:t}){return H(e,null,t)},CollectionBranch({collection:e,parent:t,renderDropIndicator:n}){return H(e,t,n)}};function H(t,n,r){return M({items:n?t.getChildren(n.key):t,dependencies:[r],children(n){let i=n.render(n);return!r||n.type!==`item`?i:e.createElement(e.Fragment,null,r({type:`item`,key:n.key,dropPosition:`before`}),i,U(t,n,r))}})}function U(e,n,r){let a=n.key,o=e.getKeyAfter(a),s=o==null?null:e.getItem(o);for(;s!=null&&s.type!==`item`;)o=e.getKeyAfter(s.key),s=o==null?null:e.getItem(o);let c=n.nextKey==null?null:e.getItem(n.nextKey);for(;c!=null&&c.type!==`item`;)c=c.nextKey==null?null:e.getItem(c.nextKey);let l=[];if(c==null){let a=n;for(;a?.type===`item`&&(!s||a.parentKey!==s.parentKey&&s.level<a.level);){let n=r({type:`item`,key:a.key,dropPosition:`after`});i(n)&&l.push(t(n,{key:`${a.key}-after`})),a=a.parentKey==null?null:e.getItem(a.parentKey)}}return l}const W=n(V),G=n(null);R(O,function(t,n,r){let i=o(G),{isLoading:a,onLoadMore:d,scrollOffset:f,...m}=t,h=c(null),_=s(()=>({onLoadMore:d,collection:i?.collection,sentinelRef:h,scrollOffset:f}),[d,f,i?.collection]);p(_,h);let v=x({...m,id:void 0,children:r.rendered,defaultClassName:`react-aria-ListBoxLoadingIndicator`,values:void 0});return e.createElement(e.Fragment,null,e.createElement(`div`,{style:{position:`relative`,width:0,height:0},inert:u(!0)},e.createElement(`div`,{"data-testid":`loadMoreSentinel`,ref:h,style:{position:`absolute`,height:1,width:1}})),a&&v.children&&e.createElement(w.div,{...g(l(t,{global:!0}),{tabIndex:-1}),...v,role:`option`,ref:n},v.children))}),R(O,function(t,n,r){let i=o(G),{isVirtualized:a}=o(W),{isLoading:d,onLoadMore:f,scrollOffset:m,...h}=t,g=c(null),_=s(()=>({onLoadMore:f,collection:i?.collection,sentinelRef:g,scrollOffset:m}),[f,m,i?.collection]);p(_,g);let v=x({...h,id:void 0,children:r.rendered,defaultClassName:`react-aria-GridListLoadingIndicator`,values:void 0});return e.createElement(e.Fragment,null,e.createElement(`div`,{style:{position:`relative`,width:0,height:0},inert:u(!0)},e.createElement(`div`,{"data-testid":`loadMoreSentinel`,ref:g,style:{position:`absolute`,height:1,width:1}})),d&&v.children&&e.createElement(w.div,{...v,...l(t,{global:!0}),role:`row`,ref:n},e.createElement(`div`,{"aria-colindex":a?1:void 0,role:`gridcell`},v.children)))});const K=z(A,(t,n,r)=>{let i=o(G),{CollectionBranch:a}=o(W),s=c(null);n=m(n);let{rowHeaderProps:u,rowProps:d,rowGroupProps:f}=_({"aria-label":t[`aria-label`]??void 0},i,n),p=x({...t,id:void 0,children:void 0,defaultClassName:`react-aria-GridListSection`,values:void 0}),h=l(t,{global:!0});return delete h.id,e.createElement(w.div,{...g(h,p,f),ref:n},e.createElement(b,{values:[[q,{...d,ref:s}],[J,{...u}]]},e.createElement(a,{collection:i.collection,parent:r})))}),q=n({}),J=n(null);export{K as GridListSection};
1
+ import e,{cloneElement as t,createContext as n,forwardRef as r,isValidElement as i,useCallback as a,useContext as o,useMemo as s,useRef as c}from"react";import{filterDOMProps as l,inertValue as u,mergeRefs as d,useLayoutEffect as f,useLoadMoreSentinel as p,useObjectRef as m}from"@react-aria/utils";import{FocusableContext as h}from"@react-aria/interactions";import"react-dom";import{mergeProps as g,useGridListSection as _}from"react-aria";import"react-stately";function v({values:t,children:n}){for(let[r,i]of t)n=e.createElement(r.Provider,{value:i},n);return n}function y(e){let{className:t,style:n,children:r,defaultClassName:i,defaultChildren:a,defaultStyle:o,values:c,render:l}=e;return s(()=>{let e,s,u;return e=typeof t==`function`?t({...c,defaultClassName:i}):t,s=typeof n==`function`?n({...c,defaultStyle:o||{}}):n,u=typeof r==`function`?r({...c,defaultChildren:a}):r??a,{className:e??i,style:s||o?{...o,...s}:void 0,children:u??a,"data-rac":``,render:l?e=>l(e,c):void 0}},[t,n,r,i,a,o,c,l])}function b(t,n,r){let{render:i,...a}=n,o=c(null),l=s(()=>d(r,o),[r,o]);f(()=>{},[t,i]);let u={...a,ref:l};return i?i(u,void 0):e.createElement(t,u)}const x={},S=new Proxy({},{get(e,t){if(typeof t!=`string`)return;let n=x[t];return n||(n=r(b.bind(null,t)),x[t]=n),n}});String(Math.round(Math.random()*1e10)),typeof window<`u`&&window.document&&window.document.createElement,e.useId;var C=class{get childNodes(){throw Error(`childNodes is not supported`)}clone(){let e=new this.constructor(this.key);return e.value=this.value,e.level=this.level,e.hasChildNodes=this.hasChildNodes,e.rendered=this.rendered,e.textValue=this.textValue,e[`aria-label`]=this[`aria-label`],e.index=this.index,e.parentKey=this.parentKey,e.prevKey=this.prevKey,e.nextKey=this.nextKey,e.firstChildKey=this.firstChildKey,e.lastChildKey=this.lastChildKey,e.props=this.props,e.render=this.render,e.colSpan=this.colSpan,e.colIndex=this.colIndex,e}filter(e,t,n){let r=this.clone();return t.addDescendants(r,e),r}constructor(e){this.value=null,this.level=0,this.hasChildNodes=!1,this.rendered=null,this.textValue=``,this[`aria-label`]=void 0,this.index=0,this.parentKey=null,this.prevKey=null,this.nextKey=null,this.firstChildKey=null,this.lastChildKey=null,this.props={},this.colSpan=null,this.colIndex=null,this.type=this.constructor.type,this.key=e}},w=class extends C{filter(e,t,n){let[r,i]=k(e,t,this.firstChildKey,n),a=this.clone();return a.firstChildKey=r,a.lastChildKey=i,a}},T=class extends C{};T.type=`header`;var E=class extends C{};E.type=`loader`;var D=class extends w{filter(e,t,n){if(n(this.textValue,this)){let n=this.clone();return t.addDescendants(n,e),n}return null}};D.type=`item`;var O=class extends w{filter(e,t,n){let r=super.filter(e,t,n);if(r&&r.lastChildKey!==null){let t=e.getItem(r.lastChildKey);if(t&&t.type!==`header`)return r}return null}};O.type=`section`;function k(e,t,n,r){if(n==null)return[null,null];let i=null,a=null,o=e.getItem(n);for(;o!=null;){let n=o.filter(e,t,r);n!=null&&(n.nextKey=null,a&&(n.prevKey=a.key,a.nextKey=n.key),i??=n,t.addNode(n),a=n),o=o.nextKey?e.getItem(o.nextKey):null}if(a&&a.type===`separator`){let e=a.prevKey;t.removeNode(a.key),e?(a=t.getItem(e),a.nextKey=null):a=null}return[i?.key??null,a?.key??null]}function A(e){let{children:n,items:r,idScope:i,addIdAndValue:a,dependencies:o=[]}=e,c=s(()=>new WeakMap,o);return s(()=>{if(r&&typeof n==`function`){let e=[];for(let o of r){let r=c.get(o);if(!r){r=n(o);let e=r.props.id??o.key??o.id;if(e==null)throw Error(`Could not determine key for item`);i!=null&&(e=i+`:`+e),r=t(r,a?{key:e,id:e,value:o}:{key:e}),c.set(o,r)}e.push(r)}return e}if(typeof n!=`function`)return n},[n,r,c,i,a])}const j=n(!1);typeof e.useSyncExternalStore==`function`&&e.useSyncExternalStore;const M=n(null);function N(e){var t;return t=class extends C{},t.type=e,t}function P(t,n,r,i,s,c){typeof t==`string`&&(t=N(t));let l=a(e=>{e?.setProps(n,r,t,i,c)},[n,r,i,c,t]),u=o(M);if(u){let a=u.ownerDocument.nodesByProps.get(n);return a||(a=u.ownerDocument.createElement(t.type),a.setProps(n,r,t,i,c),u.appendChild(a),u.ownerDocument.updateCollection(),u.ownerDocument.nodesByProps.set(n,a)),s?e.createElement(M.Provider,{value:a},s):null}return e.createElement(t.type,{ref:l},s)}function F(t,n){let i=({node:e})=>n(e.props,e.props.ref,e),a=r((r,a)=>{let s=o(h);if(!o(j)){if(n.length>=3)throw Error(n.name+` cannot be rendered outside a collection.`);return n(r,a)}return P(t,r,a,`children`in r?r.children:null,null,t=>e.createElement(h.Provider,{value:s},e.createElement(i,{node:t})))});return a.displayName=n.name,a}function I(t,n,i=L){let a=({node:e})=>n(e.props,e.props.ref,e),o=r((n,r)=>P(t,n,r,null,i(n),t=>e.createElement(a,{node:t}))??e.createElement(e.Fragment,null));return o.displayName=n.name,o}function L(e){return A({...e,addIdAndValue:!0})}const R={CollectionRoot({collection:e,renderDropIndicator:t}){return z(e,null,t)},CollectionBranch({collection:e,parent:t,renderDropIndicator:n}){return z(e,t,n)}};function z(t,n,r){return A({items:n?t.getChildren(n.key):t,dependencies:[r],children(n){let i=n.render(n);return!r||n.type!==`item`?i:e.createElement(e.Fragment,null,r({type:`item`,key:n.key,dropPosition:`before`}),i,B(t,n,r))}})}function B(e,n,r){let a=n.key,o=e.getKeyAfter(a),s=o==null?null:e.getItem(o);for(;s!=null&&s.type!==`item`;)o=e.getKeyAfter(s.key),s=o==null?null:e.getItem(o);let c=n.nextKey==null?null:e.getItem(n.nextKey);for(;c!=null&&c.type!==`item`;)c=c.nextKey==null?null:e.getItem(c.nextKey);let l=[];if(c==null){let a=n;for(;a?.type===`item`&&(!s||a.parentKey!==s.parentKey&&s.level<a.level);){let n=r({type:`item`,key:a.key,dropPosition:`after`});i(n)&&l.push(t(n,{key:`${a.key}-after`})),a=a.parentKey==null?null:e.getItem(a.parentKey)}}return l}const V=n(R),H=n(null);F(E,function(t,n,r){let i=o(H),{isLoading:a,onLoadMore:d,scrollOffset:f,...m}=t,h=c(null),_=s(()=>({onLoadMore:d,collection:i?.collection,sentinelRef:h,scrollOffset:f}),[d,f,i?.collection]);p(_,h);let v=y({...m,id:void 0,children:r.rendered,defaultClassName:`react-aria-ListBoxLoadingIndicator`,values:void 0});return e.createElement(e.Fragment,null,e.createElement(`div`,{style:{position:`relative`,width:0,height:0},inert:u(!0)},e.createElement(`div`,{"data-testid":`loadMoreSentinel`,ref:h,style:{position:`absolute`,height:1,width:1}})),a&&v.children&&e.createElement(S.div,{...g(l(t,{global:!0}),{tabIndex:-1}),...v,role:`option`,ref:n},v.children))}),F(E,function(t,n,r){let i=o(H),{isVirtualized:a}=o(V),{isLoading:d,onLoadMore:f,scrollOffset:m,...h}=t,g=c(null),_=s(()=>({onLoadMore:f,collection:i?.collection,sentinelRef:g,scrollOffset:m}),[f,m,i?.collection]);p(_,g);let v=y({...h,id:void 0,children:r.rendered,defaultClassName:`react-aria-GridListLoadingIndicator`,values:void 0});return e.createElement(e.Fragment,null,e.createElement(`div`,{style:{position:`relative`,width:0,height:0},inert:u(!0)},e.createElement(`div`,{"data-testid":`loadMoreSentinel`,ref:g,style:{position:`absolute`,height:1,width:1}})),d&&v.children&&e.createElement(S.div,{...v,...l(t,{global:!0}),role:`row`,ref:n},e.createElement(`div`,{"aria-colindex":a?1:void 0,role:`gridcell`},v.children)))});const U=I(O,(t,n,r)=>{let i=o(H),{CollectionBranch:a}=o(V),s=c(null);n=m(n);let{rowHeaderProps:u,rowProps:d,rowGroupProps:f}=_({"aria-label":t[`aria-label`]??void 0},i,n),p=y({...t,id:void 0,children:void 0,defaultClassName:`react-aria-GridListSection`,values:void 0}),h=l(t,{global:!0});return delete h.id,e.createElement(S.div,{...g(h,p,f),ref:n},e.createElement(v,{values:[[W,{...d,ref:s}],[G,{...u}]]},e.createElement(a,{collection:i.collection,parent:r})))}),W=n({}),G=n(null);export{U as GridListSection};
@@ -1,11 +1 @@
1
- import e,{createContext as t,forwardRef as n,useCallback as r,useContext as i,useMemo as a,useRef as o}from"react";import{mergeProps as s,mergeRefs as c,useLayoutEffect as l,useObjectRef as u}from"@react-aria/utils";import{FocusableContext as d}from"@react-aria/interactions";import"react-dom";var f=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),p=(e=>typeof require<`u`?require:typeof Proxy<`u`?new Proxy(e,{get:(e,t)=>(typeof require<`u`?require:e)[t]}):e)(function(e){if(typeof require<`u`)return require.apply(this,arguments);throw Error('Calling `require` for "'+e+"\" in an environment that doesn't expose the `require` function. See https://rolldown.rs/in-depth/bundling-cjs#require-external-modules for more details.")});const m=Symbol(`default`);function h(e,t){let n=i(e);if(t===null)return null;if(n&&typeof n==`object`&&`slots`in n&&n.slots){let e=t||m;if(!n.slots[e]){let e=new Intl.ListFormat().format(Object.keys(n.slots).map(e=>`"${e}"`)),r=t?`Invalid slot "${t}".`:`A slot prop is required.`;throw Error(`${r} Valid slot names are ${e}.`)}return n.slots[e]}return n}function g(e,t,n){let{ref:r,...i}=h(n,e.slot)||{},o=u(a(()=>c(t,r),[t,r])),l=s(i,e);return`style`in i&&i.style&&`style`in e&&e.style&&(l.style=typeof i.style==`function`||typeof e.style==`function`?t=>{let n=typeof i.style==`function`?i.style(t):i.style,r={...t.defaultStyle,...n},a=typeof e.style==`function`?e.style({...t,defaultStyle:r}):e.style;return{...r,...a}}:{...i.style,...e.style}),[l,o]}function _(t,n,r){let{render:i,...s}=n,u=o(null),d=a(()=>c(r,u),[r,u]);l(()=>{},[t,i]);let f={...s,ref:d};return i?i(f,void 0):e.createElement(t,f)}const v={},y=new Proxy({},{get(e,t){if(typeof t!=`string`)return;let r=v[t];return r||(r=n(_.bind(null,t)),v[t]=r),r}});String(Math.round(Math.random()*1e10)),typeof window<`u`&&window.document&&window.document.createElement,e.useId;var b=class{get childNodes(){throw Error(`childNodes is not supported`)}clone(){let e=new this.constructor(this.key);return e.value=this.value,e.level=this.level,e.hasChildNodes=this.hasChildNodes,e.rendered=this.rendered,e.textValue=this.textValue,e[`aria-label`]=this[`aria-label`],e.index=this.index,e.parentKey=this.parentKey,e.prevKey=this.prevKey,e.nextKey=this.nextKey,e.firstChildKey=this.firstChildKey,e.lastChildKey=this.lastChildKey,e.props=this.props,e.render=this.render,e.colSpan=this.colSpan,e.colIndex=this.colIndex,e}filter(e,t,n){let r=this.clone();return t.addDescendants(r,e),r}constructor(e){this.value=null,this.level=0,this.hasChildNodes=!1,this.rendered=null,this.textValue=``,this[`aria-label`]=void 0,this.index=0,this.parentKey=null,this.prevKey=null,this.nextKey=null,this.firstChildKey=null,this.lastChildKey=null,this.props={},this.colSpan=null,this.colIndex=null,this.type=this.constructor.type,this.key=e}},x=class extends b{filter(e,t,n){let[r,i]=E(e,t,this.firstChildKey,n),a=this.clone();return a.firstChildKey=r,a.lastChildKey=i,a}},S=class extends b{};S.type=`header`;var C=class extends b{};C.type=`loader`;var w=class extends x{filter(e,t,n){if(n(this.textValue,this)){let n=this.clone();return t.addDescendants(n,e),n}return null}};w.type=`item`;var T=class extends x{filter(e,t,n){let r=super.filter(e,t,n);if(r&&r.lastChildKey!==null){let t=e.getItem(r.lastChildKey);if(t&&t.type!==`header`)return r}return null}};T.type=`section`;function E(e,t,n,r){if(n==null)return[null,null];let i=null,a=null,o=e.getItem(n);for(;o!=null;){let n=o.filter(e,t,r);n!=null&&(n.nextKey=null,a&&(n.prevKey=a.key,a.nextKey=n.key),i??=n,t.addNode(n),a=n),o=o.nextKey?e.getItem(o.nextKey):null}if(a&&a.type===`separator`){let e=a.prevKey;t.removeNode(a.key),e?(a=t.getItem(e),a.nextKey=null):a=null}return[i?.key??null,a?.key??null]}
2
- /**
3
- * @license React
4
- * use-sync-external-store-shim.production.js
5
- *
6
- * Copyright (c) Meta Platforms, Inc. and affiliates.
7
- *
8
- * This source code is licensed under the MIT license found in the
9
- * LICENSE file in the root directory of this source tree.
10
- */
11
- var D=f((e=>{var t=p(`react`);function n(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var r=typeof Object.is==`function`?Object.is:n,i=t.useState,a=t.useEffect,o=t.useLayoutEffect,s=t.useDebugValue;function c(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),c=r[0].inst,u=r[1];return o(function(){c.value=n,c.getSnapshot=t,l(c)&&u({inst:c})},[e,n,t]),a(function(){return l(c)&&u({inst:c}),e(function(){l(c)&&u({inst:c})})},[e]),s(n),n}function l(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch{return!0}}function u(e,t){return t()}var d=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?u:c;e.useSyncExternalStore=t.useSyncExternalStore===void 0?d:t.useSyncExternalStore}));f(((e,t)=>{t.exports=D()}))();const O=t(!1);typeof e.useSyncExternalStore==`function`&&e.useSyncExternalStore;const k=t(null);function A(e){var t;return t=class extends b{},t.type=e,t}function j(t,n,a,o,s,c){typeof t==`string`&&(t=A(t));let l=r(e=>{e?.setProps(n,a,t,o,c)},[n,a,o,c,t]),u=i(k);if(u){let r=u.ownerDocument.nodesByProps.get(n);return r||(r=u.ownerDocument.createElement(t.type),r.setProps(n,a,t,o,c),u.appendChild(r),u.ownerDocument.updateCollection(),u.ownerDocument.nodesByProps.set(n,r)),s?e.createElement(k.Provider,{value:r},s):null}return e.createElement(t.type,{ref:l},s)}function M(t,r){let a=({node:e})=>r(e.props,e.props.ref,e),o=n((n,o)=>{let s=i(d);if(!i(O)){if(r.length>=3)throw Error(r.name+` cannot be rendered outside a collection.`);return r(n,o)}return j(t,n,o,`children`in n?n.children:null,null,t=>e.createElement(d.Provider,{value:s},e.createElement(a,{node:t})))});return o.displayName=r.name,o}const N=t({}),P=M(S,function(t,n){return[t,n]=g(t,n,N),e.createElement(y.header,{className:`react-aria-Header`,...t,ref:n},t.children)});export{P as Header};
1
+ import e,{createContext as t,forwardRef as n,useCallback as r,useContext as i,useMemo as a,useRef as o}from"react";import{mergeProps as s,mergeRefs as c,useLayoutEffect as l,useObjectRef as u}from"@react-aria/utils";import{FocusableContext as d}from"@react-aria/interactions";import"react-dom";const f=Symbol(`default`);function p(e,t){let n=i(e);if(t===null)return null;if(n&&typeof n==`object`&&`slots`in n&&n.slots){let e=t||f;if(!n.slots[e]){let e=new Intl.ListFormat().format(Object.keys(n.slots).map(e=>`"${e}"`)),r=t?`Invalid slot "${t}".`:`A slot prop is required.`;throw Error(`${r} Valid slot names are ${e}.`)}return n.slots[e]}return n}function m(e,t,n){let{ref:r,...i}=p(n,e.slot)||{},o=u(a(()=>c(t,r),[t,r])),l=s(i,e);return`style`in i&&i.style&&`style`in e&&e.style&&(l.style=typeof i.style==`function`||typeof e.style==`function`?t=>{let n=typeof i.style==`function`?i.style(t):i.style,r={...t.defaultStyle,...n},a=typeof e.style==`function`?e.style({...t,defaultStyle:r}):e.style;return{...r,...a}}:{...i.style,...e.style}),[l,o]}function h(t,n,r){let{render:i,...s}=n,u=o(null),d=a(()=>c(r,u),[r,u]);l(()=>{},[t,i]);let f={...s,ref:d};return i?i(f,void 0):e.createElement(t,f)}const g={},_=new Proxy({},{get(e,t){if(typeof t!=`string`)return;let r=g[t];return r||(r=n(h.bind(null,t)),g[t]=r),r}});String(Math.round(Math.random()*1e10)),typeof window<`u`&&window.document&&window.document.createElement,e.useId;var v=class{get childNodes(){throw Error(`childNodes is not supported`)}clone(){let e=new this.constructor(this.key);return e.value=this.value,e.level=this.level,e.hasChildNodes=this.hasChildNodes,e.rendered=this.rendered,e.textValue=this.textValue,e[`aria-label`]=this[`aria-label`],e.index=this.index,e.parentKey=this.parentKey,e.prevKey=this.prevKey,e.nextKey=this.nextKey,e.firstChildKey=this.firstChildKey,e.lastChildKey=this.lastChildKey,e.props=this.props,e.render=this.render,e.colSpan=this.colSpan,e.colIndex=this.colIndex,e}filter(e,t,n){let r=this.clone();return t.addDescendants(r,e),r}constructor(e){this.value=null,this.level=0,this.hasChildNodes=!1,this.rendered=null,this.textValue=``,this[`aria-label`]=void 0,this.index=0,this.parentKey=null,this.prevKey=null,this.nextKey=null,this.firstChildKey=null,this.lastChildKey=null,this.props={},this.colSpan=null,this.colIndex=null,this.type=this.constructor.type,this.key=e}},y=class extends v{filter(e,t,n){let[r,i]=w(e,t,this.firstChildKey,n),a=this.clone();return a.firstChildKey=r,a.lastChildKey=i,a}},b=class extends v{};b.type=`header`;var x=class extends v{};x.type=`loader`;var S=class extends y{filter(e,t,n){if(n(this.textValue,this)){let n=this.clone();return t.addDescendants(n,e),n}return null}};S.type=`item`;var C=class extends y{filter(e,t,n){let r=super.filter(e,t,n);if(r&&r.lastChildKey!==null){let t=e.getItem(r.lastChildKey);if(t&&t.type!==`header`)return r}return null}};C.type=`section`;function w(e,t,n,r){if(n==null)return[null,null];let i=null,a=null,o=e.getItem(n);for(;o!=null;){let n=o.filter(e,t,r);n!=null&&(n.nextKey=null,a&&(n.prevKey=a.key,a.nextKey=n.key),i??=n,t.addNode(n),a=n),o=o.nextKey?e.getItem(o.nextKey):null}if(a&&a.type===`separator`){let e=a.prevKey;t.removeNode(a.key),e?(a=t.getItem(e),a.nextKey=null):a=null}return[i?.key??null,a?.key??null]}const T=t(!1);typeof e.useSyncExternalStore==`function`&&e.useSyncExternalStore;const E=t(null);function D(e){var t;return t=class extends v{},t.type=e,t}function O(t,n,a,o,s,c){typeof t==`string`&&(t=D(t));let l=r(e=>{e?.setProps(n,a,t,o,c)},[n,a,o,c,t]),u=i(E);if(u){let r=u.ownerDocument.nodesByProps.get(n);return r||(r=u.ownerDocument.createElement(t.type),r.setProps(n,a,t,o,c),u.appendChild(r),u.ownerDocument.updateCollection(),u.ownerDocument.nodesByProps.set(n,r)),s?e.createElement(E.Provider,{value:r},s):null}return e.createElement(t.type,{ref:l},s)}function k(t,r){let a=({node:e})=>r(e.props,e.props.ref,e),o=n((n,o)=>{let s=i(d);if(!i(T)){if(r.length>=3)throw Error(r.name+` cannot be rendered outside a collection.`);return r(n,o)}return O(t,n,o,`children`in n?n.children:null,null,t=>e.createElement(d.Provider,{value:s},e.createElement(a,{node:t})))});return o.displayName=r.name,o}const A=t({}),j=k(b,function(t,n){return[t,n]=m(t,n,A),e.createElement(_.header,{className:`react-aria-Header`,...t,ref:n},t.children)});export{j as Header};
@@ -1,11 +1 @@
1
- import e,{cloneElement as t,createContext as n,forwardRef as r,isValidElement as i,useCallback as a,useContext as o,useEffect as s,useMemo as c,useRef as l,useState as u}from"react";import{filterDOMProps as d,inertValue as f,mergeProps as p,mergeRefs as m,useLayoutEffect as h,useLoadMoreSentinel as g,useObjectRef as _}from"@react-aria/utils";import{FocusableContext as v}from"@react-aria/interactions";import{createPortal as y}from"react-dom";import{FocusScope as ee,ListKeyboardDelegate as te,mergeProps as b,useCollator as ne,useFocusRing as re,useListBox as ie,useListBoxSection as x,useLocale as ae}from"react-aria";import{UNSTABLE_useFilteredListState as oe,useListState as S}from"react-stately";var C=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),w=(e=>typeof require<`u`?require:typeof Proxy<`u`?new Proxy(e,{get:(e,t)=>(typeof require<`u`?require:e)[t]}):e)(function(e){if(typeof require<`u`)return require.apply(this,arguments);throw Error('Calling `require` for "'+e+"\" in an environment that doesn't expose the `require` function. See https://rolldown.rs/in-depth/bundling-cjs#require-external-modules for more details.")});n(null),n(null),n(null),n(null),n(null),n({});const se=n(null);n(null);const ce=Symbol(`default`);function le({values:t,children:n}){for(let[r,i]of t)n=e.createElement(r.Provider,{value:i},n);return n}function T(e){let{className:t,style:n,children:r,defaultClassName:i,defaultChildren:a,defaultStyle:o,values:s,render:l}=e;return c(()=>{let e,c,u;return e=typeof t==`function`?t({...s,defaultClassName:i}):t,c=typeof n==`function`?n({...s,defaultStyle:o||{}}):n,u=typeof r==`function`?r({...s,defaultChildren:a}):r??a,{className:e??i,style:c||o?{...o,...c}:void 0,children:u??a,"data-rac":``,render:l?e=>l(e,s):void 0}},[t,n,r,i,a,o,s,l])}function E(e,t){let n=o(e);if(t===null)return null;if(n&&typeof n==`object`&&`slots`in n&&n.slots){let e=t||ce;if(!n.slots[e]){let e=new Intl.ListFormat().format(Object.keys(n.slots).map(e=>`"${e}"`)),r=t?`Invalid slot "${t}".`:`A slot prop is required.`;throw Error(`${r} Valid slot names are ${e}.`)}return n.slots[e]}return n}function D(e,t,n){let{ref:r,...i}=E(n,e.slot)||{},a=_(c(()=>m(t,r),[t,r])),o=p(i,e);return`style`in i&&i.style&&`style`in e&&e.style&&(o.style=typeof i.style==`function`||typeof e.style==`function`?t=>{let n=typeof i.style==`function`?i.style(t):i.style,r={...t.defaultStyle,...n},a=typeof e.style==`function`?e.style({...t,defaultStyle:r}):e.style;return{...r,...a}}:{...i.style,...e.style}),[o,a]}function O(e=!0){let[t,n]=u(e),r=l(!1),i=a(e=>{r.current=!0,n(!!e)},[]);return h(()=>{r.current||n(!1)},[]),[i,t]}function k(t,n,r){let{render:i,...a}=n,o=l(null),s=c(()=>m(r,o),[r,o]);h(()=>{},[t,i]);let u={...a,ref:s};return i?i(u,void 0):e.createElement(t,u)}const A={},j=new Proxy({},{get(e,t){if(typeof t!=`string`)return;let n=A[t];return n||(n=r(k.bind(null,t)),A[t]=n),n}});String(Math.round(Math.random()*1e10));const M=e.createContext(!1);typeof window<`u`&&window.document&&window.document.createElement,e.useId;function N(){return!1}function P(){return!0}function F(e){return()=>{}}function I(){return typeof e.useSyncExternalStore==`function`?e.useSyncExternalStore(F,N,P):o(M)}var L=class{get childNodes(){throw Error(`childNodes is not supported`)}clone(){let e=new this.constructor(this.key);return e.value=this.value,e.level=this.level,e.hasChildNodes=this.hasChildNodes,e.rendered=this.rendered,e.textValue=this.textValue,e[`aria-label`]=this[`aria-label`],e.index=this.index,e.parentKey=this.parentKey,e.prevKey=this.prevKey,e.nextKey=this.nextKey,e.firstChildKey=this.firstChildKey,e.lastChildKey=this.lastChildKey,e.props=this.props,e.render=this.render,e.colSpan=this.colSpan,e.colIndex=this.colIndex,e}filter(e,t,n){let r=this.clone();return t.addDescendants(r,e),r}constructor(e){this.value=null,this.level=0,this.hasChildNodes=!1,this.rendered=null,this.textValue=``,this[`aria-label`]=void 0,this.index=0,this.parentKey=null,this.prevKey=null,this.nextKey=null,this.firstChildKey=null,this.lastChildKey=null,this.props={},this.colSpan=null,this.colIndex=null,this.type=this.constructor.type,this.key=e}},R=class extends L{filter(e,t,n){let[r,i]=W(e,t,this.firstChildKey,n),a=this.clone();return a.firstChildKey=r,a.lastChildKey=i,a}},z=class extends L{};z.type=`header`;var B=class extends L{};B.type=`loader`;var V=class extends R{filter(e,t,n){if(n(this.textValue,this)){let n=this.clone();return t.addDescendants(n,e),n}return null}};V.type=`item`;var H=class extends R{filter(e,t,n){let r=super.filter(e,t,n);if(r&&r.lastChildKey!==null){let t=e.getItem(r.lastChildKey);if(t&&t.type!==`header`)return r}return null}};H.type=`section`;var U=class{get size(){return this.itemCount}getKeys(){return this.keyMap.keys()}*[Symbol.iterator](){let e=this.firstKey==null?void 0:this.keyMap.get(this.firstKey);for(;e;)yield e,e=e.nextKey==null?void 0:this.keyMap.get(e.nextKey)}getChildren(e){let t=this.keyMap;return{*[Symbol.iterator](){let n=t.get(e),r=n?.firstChildKey==null?null:t.get(n.firstChildKey);for(;r;)yield r,r=r.nextKey==null?void 0:t.get(r.nextKey)}}}getKeyBefore(e){let t=this.keyMap.get(e);if(!t)return null;if(t.prevKey!=null){for(t=this.keyMap.get(t.prevKey);t&&t.type!==`item`&&t.lastChildKey!=null;)t=this.keyMap.get(t.lastChildKey);return t?.key??null}return t.parentKey}getKeyAfter(e){let t=this.keyMap.get(e);if(!t)return null;if(t.type!==`item`&&t.firstChildKey!=null)return t.firstChildKey;for(;t;){if(t.nextKey!=null)return t.nextKey;if(t.parentKey!=null)t=this.keyMap.get(t.parentKey);else return null}return null}getFirstKey(){return this.firstKey}getLastKey(){let e=this.lastKey==null?null:this.keyMap.get(this.lastKey);for(;e?.lastChildKey!=null;)e=this.keyMap.get(e.lastChildKey);return e?.key??null}getItem(e){return this.keyMap.get(e)??null}at(){throw Error(`Not implemented`)}clone(){let e=this.constructor,t=new e;return t.keyMap=new Map(this.keyMap),t.firstKey=this.firstKey,t.lastKey=this.lastKey,t.itemCount=this.itemCount,t}addNode(e){if(this.frozen)throw Error(`Cannot add a node to a frozen collection`);e.type===`item`&&this.keyMap.get(e.key)==null&&this.itemCount++,this.keyMap.set(e.key,e)}addDescendants(e,t){this.addNode(e);let n=t.getChildren(e.key);for(let e of n)this.addDescendants(e,t)}removeNode(e){if(this.frozen)throw Error(`Cannot remove a node to a frozen collection`);let t=this.keyMap.get(e);t!=null&&t.type===`item`&&this.itemCount--,this.keyMap.delete(e)}commit(e,t,n=!1){if(this.frozen)throw Error(`Cannot commit a frozen collection`);this.firstKey=e,this.lastKey=t,this.frozen=!n}filter(e){let t=new this.constructor,[n,r]=W(this,t,this.firstKey,e);return t?.commit(n,r),t}constructor(){this.keyMap=new Map,this.firstKey=null,this.lastKey=null,this.frozen=!1,this.itemCount=0}};function W(e,t,n,r){if(n==null)return[null,null];let i=null,a=null,o=e.getItem(n);for(;o!=null;){let n=o.filter(e,t,r);n!=null&&(n.nextKey=null,a&&(n.prevKey=a.key,a.nextKey=n.key),i??=n,t.addNode(n),a=n),o=o.nextKey?e.getItem(o.nextKey):null}if(a&&a.type===`separator`){let e=a.prevKey;t.removeNode(a.key),e?(a=t.getItem(e),a.nextKey=null):a=null}return[i?.key??null,a?.key??null]}var G=class{*[Symbol.iterator](){let e=this.firstChild;for(;e;)yield e,e=e.nextSibling}get firstChild(){return this._firstChild}set firstChild(e){this._firstChild=e,this.ownerDocument.markDirty(this)}get lastChild(){return this._lastChild}set lastChild(e){this._lastChild=e,this.ownerDocument.markDirty(this)}get previousSibling(){return this._previousSibling}set previousSibling(e){this._previousSibling=e,this.ownerDocument.markDirty(this)}get nextSibling(){return this._nextSibling}set nextSibling(e){this._nextSibling=e,this.ownerDocument.markDirty(this)}get parentNode(){return this._parentNode}set parentNode(e){this._parentNode=e,this.ownerDocument.markDirty(this)}get isConnected(){return this.parentNode?.isConnected||!1}invalidateChildIndices(e){(this._minInvalidChildIndex==null||!this._minInvalidChildIndex.isConnected||e.index<this._minInvalidChildIndex.index)&&(this._minInvalidChildIndex=e,this.ownerDocument.markDirty(this))}updateChildIndices(){let e=this._minInvalidChildIndex;for(;e;)e.index=e.previousSibling?e.previousSibling.index+1:0,e=e.nextSibling;this._minInvalidChildIndex=null}appendChild(e){e.parentNode&&e.parentNode.removeChild(e),this.firstChild??=e,this.lastChild?(this.lastChild.nextSibling=e,e.index=this.lastChild.index+1,e.previousSibling=this.lastChild):(e.previousSibling=null,e.index=0),e.parentNode=this,e.nextSibling=null,this.lastChild=e,this.ownerDocument.markDirty(this),this.isConnected&&this.ownerDocument.queueUpdate()}insertBefore(e,t){if(t==null)return this.appendChild(e);e.parentNode&&e.parentNode.removeChild(e),e.nextSibling=t,e.previousSibling=t.previousSibling,e.index=t.index-1,this.firstChild===t?this.firstChild=e:t.previousSibling&&(t.previousSibling.nextSibling=e),t.previousSibling=e,e.parentNode=t.parentNode,this.invalidateChildIndices(e),this.isConnected&&this.ownerDocument.queueUpdate()}removeChild(e){e.parentNode===this&&(this._minInvalidChildIndex===e&&(this._minInvalidChildIndex=null),e.nextSibling&&(this.invalidateChildIndices(e.nextSibling),e.nextSibling.previousSibling=e.previousSibling),e.previousSibling&&(e.previousSibling.nextSibling=e.nextSibling),this.firstChild===e&&(this.firstChild=e.nextSibling),this.lastChild===e&&(this.lastChild=e.previousSibling),e.parentNode=null,e.nextSibling=null,e.previousSibling=null,e.index=0,this.ownerDocument.markDirty(e),this.isConnected&&this.ownerDocument.queueUpdate())}addEventListener(){}removeEventListener(){}get previousVisibleSibling(){let e=this.previousSibling;for(;e&&e.isHidden;)e=e.previousSibling;return e}get nextVisibleSibling(){let e=this.nextSibling;for(;e&&e.isHidden;)e=e.nextSibling;return e}get firstVisibleChild(){let e=this.firstChild;for(;e&&e.isHidden;)e=e.nextSibling;return e}get lastVisibleChild(){let e=this.lastChild;for(;e&&e.isHidden;)e=e.previousSibling;return e}constructor(e){this._firstChild=null,this._lastChild=null,this._previousSibling=null,this._nextSibling=null,this._parentNode=null,this._minInvalidChildIndex=null,this.ownerDocument=e}},K=class e extends G{get index(){return this._index}set index(e){this._index=e,this.ownerDocument.markDirty(this)}get level(){return this.parentNode instanceof e?this.parentNode.level+ +(this.node?.type===`item`):0}getMutableNode(){return this.node==null?null:(this.isMutated||=(this.node=this.node.clone(),!0),this.ownerDocument.markDirty(this),this.node)}updateNode(){let t=this.nextVisibleSibling,n=this.getMutableNode();if(n!=null&&(n.index=this.index,n.level=this.level,n.parentKey=this.parentNode instanceof e?this.parentNode.node?.key??null:null,n.prevKey=this.previousVisibleSibling?.node?.key??null,n.nextKey=t?.node?.key??null,n.hasChildNodes=!!this.firstChild,n.firstChildKey=this.firstVisibleChild?.node?.key??null,n.lastChildKey=this.lastVisibleChild?.node?.key??null,(n.colSpan!=null||n.colIndex!=null)&&t)){let e=(n.colIndex??n.index)+(n.colSpan??1);if(t.node!=null&&e!==t.node.colIndex){let n=t.getMutableNode();n.colIndex=e}}}setProps(e,t,n,r,i){let a,{value:o,textValue:s,id:c,...l}=e;if(this.node==null?(a=new n(c??`react-aria-${++this.ownerDocument.nodeId}`),this.node=a):a=this.getMutableNode(),l.ref=t,a.props=l,a.rendered=r,a.render=i,a.value=o,e[`aria-label`]&&(a[`aria-label`]=e[`aria-label`]),a.textValue=s||(typeof l.children==`string`?l.children:``)||e[`aria-label`]||``,c!=null&&c!==a.key)throw Error(`Cannot change the id of an item`);l.colSpan!=null&&(a.colSpan=l.colSpan),this.isConnected&&this.ownerDocument.queueUpdate()}get style(){let e=this;return{get display(){return e.isHidden?`none`:``},set display(t){let n=t===`none`;if(e.isHidden!==n){(e.parentNode?.firstVisibleChild===e||e.parentNode?.lastVisibleChild===e)&&e.ownerDocument.markDirty(e.parentNode);let t=e.previousVisibleSibling,r=e.nextVisibleSibling;t&&e.ownerDocument.markDirty(t),r&&e.ownerDocument.markDirty(r),e.isHidden=n,e.ownerDocument.markDirty(e)}}}}hasAttribute(){}setAttribute(){}setAttributeNS(){}removeAttribute(){}constructor(e,t){super(t),this.nodeType=8,this.isMutated=!0,this._index=0,this.isHidden=!1,this.node=null}},ue=class extends G{get isConnected(){return!0}createElement(e){return new K(e,this)}getMutableCollection(){return this.nextCollection||=this.collection.clone(),this.nextCollection}markDirty(e){this.dirtyNodes.add(e)}addNode(e){if(e.isHidden||e.node==null)return;let t=this.getMutableCollection();if(!t.getItem(e.node.key))for(let t of e)this.addNode(t);t.addNode(e.node)}removeNode(e){for(let t of e)this.removeNode(t);e.node&&this.getMutableCollection().removeNode(e.node.key)}getCollection(){return this.inSubscription?this.collection.clone():(this.queuedRender=!1,this.updateCollection(),this.collection)}updateCollection(){for(let e of this.dirtyNodes)e instanceof K&&(!e.isConnected||e.isHidden)?this.removeNode(e):e.updateChildIndices();for(let e of this.dirtyNodes)e instanceof K?(e.isConnected&&!e.isHidden&&(e.updateNode(),this.addNode(e)),e.node&&this.dirtyNodes.delete(e),e.isMutated=!1):this.dirtyNodes.delete(e);this.nextCollection&&(this.nextCollection.commit(this.firstVisibleChild?.node?.key??null,this.lastVisibleChild?.node?.key??null,this.isSSR),this.isSSR||(this.collection=this.nextCollection,this.nextCollection=null))}queueUpdate(){if(!(this.dirtyNodes.size===0||this.queuedRender)){this.queuedRender=!0,this.inSubscription=!0;for(let e of this.subscriptions)e();this.inSubscription=!1}}subscribe(e){return this.subscriptions.add(e),()=>this.subscriptions.delete(e)}resetAfterSSR(){this.isSSR&&(this.isSSR=!1,this.firstChild=null,this.lastChild=null,this.nodeId=0)}constructor(e){super(null),this.nodeType=11,this.ownerDocument=this,this.dirtyNodes=new Set,this.isSSR=!1,this.nodeId=0,this.nodesByProps=new WeakMap,this.nextCollection=null,this.subscriptions=new Set,this.queuedRender=!1,this.inSubscription=!1,this.collection=e,this.nextCollection=e}};function q(e){let{children:n,items:r,idScope:i,addIdAndValue:a,dependencies:o=[]}=e,s=c(()=>new WeakMap,o);return c(()=>{if(r&&typeof n==`function`){let e=[];for(let o of r){let r=s.get(o);if(!r){r=n(o);let e=r.props.id??o.key??o.id;if(e==null)throw Error(`Could not determine key for item`);i!=null&&(e=i+`:`+e),r=t(r,a?{key:e,id:e,value:o}:{key:e}),s.set(o,r)}e.push(r)}return e}if(typeof n!=`function`)return n},[n,r,s,i,a])}if(typeof HTMLTemplateElement<`u`){let e=Object.getOwnPropertyDescriptor(Node.prototype,`firstChild`).get;Object.defineProperty(HTMLTemplateElement.prototype,"firstChild",{configurable:!0,enumerable:!0,get:function(){return this.dataset.reactAriaHidden?this.content.firstChild:e.call(this)}})}const J=n(!1);function de(t){if(o(J))return e.createElement(e.Fragment,null,t.children);let n=e.createElement(J.Provider,{value:!0},t.children);return e.createElement(`template`,{"data-react-aria-hidden":!0},n)}
2
- /**
3
- * @license React
4
- * use-sync-external-store-shim.production.js
5
- *
6
- * Copyright (c) Meta Platforms, Inc. and affiliates.
7
- *
8
- * This source code is licensed under the MIT license found in the
9
- * LICENSE file in the root directory of this source tree.
10
- */
11
- var fe=C((e=>{var t=w(`react`);function n(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var r=typeof Object.is==`function`?Object.is:n,i=t.useState,a=t.useEffect,o=t.useLayoutEffect,s=t.useDebugValue;function c(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),c=r[0].inst,u=r[1];return o(function(){c.value=n,c.getSnapshot=t,l(c)&&u({inst:c})},[e,n,t]),a(function(){return l(c)&&u({inst:c}),e(function(){l(c)&&u({inst:c})})},[e]),s(n),n}function l(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch{return!0}}function u(e,t){return t()}var d=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?u:c;e.useSyncExternalStore=t.useSyncExternalStore===void 0?d:t.useSyncExternalStore})),pe=C(((e,t)=>{t.exports=fe()}))();const me=n(!1),Y=n(null);function he(t){if(o(Y))return t.content;let{collection:n,document:r}=ye(t.createCollection);return e.createElement(e.Fragment,null,e.createElement(de,null,e.createElement(Y.Provider,{value:r},t.content)),e.createElement(ge,{render:t.children,collection:n}))}function ge({collection:e,render:t}){return t(e)}function _e(e,t,n){let r=I(),i=l(r);i.current=r;let o=a(()=>i.current?n():t(),[t,n]);return(0,pe.useSyncExternalStore)(e,o)}const ve=typeof e.useSyncExternalStore==`function`?e.useSyncExternalStore:_e;function ye(e){let[t]=u(()=>new ue(e?.()||new U)),n=a(e=>t.subscribe(e),[t]),r=a(()=>{let e=t.getCollection();return t.isSSR&&t.resetAfterSSR(),e},[t]),i=a(()=>(t.isSSR=!0,t.getCollection()),[t]);return{collection:ve(n,r,i),document:t}}const X=n(null);function be(e){var t;return t=class extends L{},t.type=e,t}function xe(t,n,r,i,s,c){typeof t==`string`&&(t=be(t));let l=a(e=>{e?.setProps(n,r,t,i,c)},[n,r,i,c,t]),u=o(X);if(u){let a=u.ownerDocument.nodesByProps.get(n);return a||(a=u.ownerDocument.createElement(t.type),a.setProps(n,r,t,i,c),u.appendChild(a),u.ownerDocument.updateCollection(),u.ownerDocument.nodesByProps.set(n,a)),s?e.createElement(X.Provider,{value:a},s):null}return e.createElement(t.type,{ref:l},s)}function Se(t,n){let i=({node:e})=>n(e.props,e.props.ref,e),a=r((r,a)=>{let s=o(v);if(!o(me)){if(n.length>=3)throw Error(n.name+` cannot be rendered outside a collection.`);return n(r,a)}return xe(t,r,a,`children`in r?r.children:null,null,t=>e.createElement(v.Provider,{value:s},e.createElement(i,{node:t})))});return a.displayName=n.name,a}function Ce(e){return q({...e,addIdAndValue:!0})}const we=n(null);function Te(t){let n=o(we),r=(n?.dependencies||[]).concat(t.dependencies),i=t.idScope??n?.idScope,a=Ce({...t,idScope:i,dependencies:r});return o(Y)&&(a=e.createElement(Ee,null,a)),n=c(()=>({dependencies:r,idScope:i}),[i,...r]),e.createElement(we.Provider,{value:n},a)}function Ee({children:t}){let n=o(Y),r=c(()=>e.createElement(Y.Provider,{value:null},e.createElement(me.Provider,{value:!0},t)),[t]);return I()?e.createElement(X.Provider,{value:n},r):y(r,n)}const De=n(null),Oe={CollectionRoot({collection:e,renderDropIndicator:t}){return ke(e,null,t)},CollectionBranch({collection:e,parent:t,renderDropIndicator:n}){return ke(e,t,n)}};function ke(t,n,r){return q({items:n?t.getChildren(n.key):t,dependencies:[r],children(n){let i=n.render(n);return!r||n.type!==`item`?i:e.createElement(e.Fragment,null,r({type:`item`,key:n.key,dropPosition:`before`}),i,Ae(t,n,r))}})}function Ae(e,n,r){let a=n.key,o=e.getKeyAfter(a),s=o==null?null:e.getItem(o);for(;s!=null&&s.type!==`item`;)o=e.getKeyAfter(s.key),s=o==null?null:e.getItem(o);let c=n.nextKey==null?null:e.getItem(n.nextKey);for(;c!=null&&c.type!==`item`;)c=c.nextKey==null?null:e.getItem(c.nextKey);let l=[];if(c==null){let a=n;for(;a?.type===`item`&&(!s||a.parentKey!==s.parentKey&&s.level<a.level);){let n=r({type:`item`,key:a.key,dropPosition:`after`});i(n)&&l.push(t(n,{key:`${a.key}-after`})),a=a.parentKey==null?null:e.getItem(a.parentKey)}}return l}const Z=n(Oe),Q=n({}),je=n(null),Me=r(function(t,n){let{render:r}=o(je);return e.createElement(e.Fragment,null,r(t,n))});function Ne(t,n){let r=t?.renderDropIndicator,i=t?.isVirtualDragging?.call(t),o=a(t=>{if(i||n?.isDropTarget(t))return r?r(t):e.createElement(Me,{target:t})},[n?.target,i,r]);return t?.useDropIndicator?o:void 0}function Pe(e,t,n){let r=e.focusedKey,i=null;if(t!=null&&t.isVirtualDragging?.call(t)&&n?.target?.type===`item`&&(i=n.target.key,n.target.dropPosition===`after`)){let e=n.collection.getKeyAfter(i),t=null;if(e!=null){let r=n.collection.getItem(i)?.level??0;for(;e;){let i=n.collection.getItem(e);if(!i)break;if(i.type!==`item`){e=n.collection.getKeyAfter(e);continue}if((i.level??0)<=r)break;t=e,e=n.collection.getKeyAfter(e)}}i=e??t??i}return c(()=>new Set([r,i].filter(e=>e!=null)),[r,i])}const Fe=n({}),Ie=n(null);function Le(t){let n=l({});return e.createElement(Ie.Provider,{value:n},t.children)}const Re=n({});var ze=class extends L{filter(e,t){let n=t.getItem(this.prevKey);if(n&&n.type!==`separator`){let n=this.clone();return t.addDescendants(n,e),n}return null}};ze.type=`separator`;const Be=n(null),$=n(null),Ve=r(function(t,n){[t,n]=D(t,n,Be);let r=o($);return r?e.createElement(Ue,{state:r,props:t,listBoxRef:n}):e.createElement(he,{content:e.createElement(Te,t)},r=>e.createElement(He,{props:t,listBoxRef:n,collection:r}))});function He({props:t,listBoxRef:n,collection:r}){t={...t,collection:r,children:null,items:null};let{layoutDelegate:i}=o(Z),a=S({...t,layoutDelegate:i});return e.createElement(Ue,{state:a,props:t,listBoxRef:n})}function Ue({state:t,props:n,listBoxRef:r}){[n,r]=D(n,r,se);let{dragAndDropHooks:i,layout:a=`stack`,orientation:u=`vertical`,filter:f}=n,p=oe(t,f),{collection:m,selectionManager:h}=p,g=!!i?.useDraggableCollectionState,_=!!i?.useDroppableCollectionState,{direction:v}=ae(),{disabledBehavior:y,disabledKeys:x}=h,S=ne({usage:`search`,sensitivity:`base`}),{isVirtualized:C,layoutDelegate:w,dropTargetDelegate:ce,CollectionRoot:E}=o(Z),O=c(()=>n.keyboardDelegate||new te({collection:m,collator:S,ref:r,disabledKeys:x,disabledBehavior:y,layout:a,orientation:u,direction:v,layoutDelegate:w}),[m,S,r,y,x,u,v,n.keyboardDelegate,a,w]),{listBoxProps:k}=ie({...n,shouldSelectOnPressUp:g||n.shouldSelectOnPressUp,keyboardDelegate:O,isVirtualized:C},p,r);l(g),l(_),s(()=>{},[g,_]);let A,M,N,P=!1,F=null,I=l(null);if(g&&i){A=i.useDraggableCollectionState({collection:m,selectionManager:h,preview:i.renderDragPreview?I:void 0}),i.useDraggableCollection({},A,r);let t=i.DragPreview;F=i.renderDragPreview?e.createElement(t,{ref:I},i.renderDragPreview):null}if(_&&i){M=i.useDroppableCollectionState({collection:m,selectionManager:h});let e=i.dropTargetDelegate||ce||new i.ListDropTargetDelegate(m,r,{orientation:u,layout:a,direction:v});N=i.useDroppableCollection({keyboardDelegate:O,dropTargetDelegate:e},M,r),P=M.isDropTarget({type:`root`})}let{focusProps:L,isFocused:R,isFocusVisible:z}=re(),B=p.collection.size===0,V={isDropTarget:P,isEmpty:B,isFocused:R,isFocusVisible:z,layout:n.layout||`stack`,state:p},H=T({...n,children:void 0,defaultClassName:`react-aria-ListBox`,values:V}),U=null;B&&n.renderEmptyState&&(U=e.createElement(`div`,{role:`option`,style:{display:`contents`}},n.renderEmptyState(V)));let W=d(n,{global:!0});return e.createElement(ee,null,e.createElement(j.div,{...b(W,H,k,L,N?.collectionProps),ref:r,slot:n.slot||void 0,onScroll:n.onScroll,"data-drop-target":P||void 0,"data-empty":B||void 0,"data-focused":R||void 0,"data-focus-visible":z||void 0,"data-layout":n.layout||`stack`,"data-orientation":n.orientation||`vertical`},e.createElement(le,{values:[[Be,n],[$,p],[Q,{dragAndDropHooks:i,dragState:A,dropState:M}],[Re,{elementType:`div`}],[je,{render:Ge}],[De,{name:`ListBoxSection`,render:We}]]},e.createElement(Le,null,e.createElement(E,{collection:m,scrollRef:r,persistedKeys:Pe(h,i,M),renderDropIndicator:Ne(i,M)}))),U,F))}function We(t,n,r,i=`react-aria-ListBoxSection`){let a=o($),{dragAndDropHooks:s,dropState:c}=o(Q),{CollectionBranch:l}=o(Z),[u,f]=O(),{headingProps:p,groupProps:m}=x({heading:f,"aria-label":t[`aria-label`]??void 0}),h=T({...t,id:void 0,children:void 0,defaultClassName:i,values:void 0}),g=d(t,{global:!0});return delete g.id,e.createElement(j.section,{...b(g,h,m),ref:n},e.createElement(Fe.Provider,{value:{...p,ref:u}},e.createElement(l,{collection:a.collection,parent:r,renderDropIndicator:Ne(s,c)})))}function Ge(t,n){n=_(n);let{dragAndDropHooks:r,dropState:i}=o(Q),{dropIndicatorProps:a,isHidden:s,isDropTarget:c}=r.useDropIndicator(t,i,n);return s?null:e.createElement(qe,{...t,dropIndicatorProps:a,isDropTarget:c,ref:n})}function Ke(t,n){let{dropIndicatorProps:r,isDropTarget:i,...a}=t,o=T({...a,defaultClassName:`react-aria-DropIndicator`,values:{isDropTarget:i}});return e.createElement(j.div,{...r,...o,role:`option`,ref:n,"data-drop-target":i||void 0})}const qe=r(Ke);Se(B,function(t,n,r){let i=o($),{isLoading:a,onLoadMore:s,scrollOffset:u,...p}=t,m=l(null),h=c(()=>({onLoadMore:s,collection:i?.collection,sentinelRef:m,scrollOffset:u}),[s,u,i?.collection]);g(h,m);let _=T({...p,id:void 0,children:r.rendered,defaultClassName:`react-aria-ListBoxLoadingIndicator`,values:void 0});return e.createElement(e.Fragment,null,e.createElement(`div`,{style:{position:`relative`,width:0,height:0},inert:f(!0)},e.createElement(`div`,{"data-testid":`loadMoreSentinel`,ref:m,style:{position:`absolute`,height:1,width:1}})),a&&_.children&&e.createElement(j.div,{...b(d(t,{global:!0}),{tabIndex:-1}),..._,role:`option`,ref:n},_.children))});export{Ve as ListBox};
1
+ import e,{cloneElement as t,createContext as n,forwardRef as r,isValidElement as i,useCallback as a,useContext as o,useEffect as s,useMemo as c,useRef as l,useState as u,useSyncExternalStore as d}from"react";import{filterDOMProps as f,inertValue as p,mergeProps as m,mergeRefs as h,useLayoutEffect as g,useLoadMoreSentinel as _,useObjectRef as v}from"@react-aria/utils";import{FocusableContext as y}from"@react-aria/interactions";import{createPortal as b}from"react-dom";import{FocusScope as ee,ListKeyboardDelegate as te,mergeProps as x,useCollator as ne,useFocusRing as re,useListBox as ie,useListBoxSection as S,useLocale as ae}from"react-aria";import{UNSTABLE_useFilteredListState as oe,useListState as se}from"react-stately";n(null),n(null),n(null),n(null),n(null),n({});const ce=n(null);n(null);const C=Symbol(`default`);function le({values:t,children:n}){for(let[r,i]of t)n=e.createElement(r.Provider,{value:i},n);return n}function w(e){let{className:t,style:n,children:r,defaultClassName:i,defaultChildren:a,defaultStyle:o,values:s,render:l}=e;return c(()=>{let e,c,u;return e=typeof t==`function`?t({...s,defaultClassName:i}):t,c=typeof n==`function`?n({...s,defaultStyle:o||{}}):n,u=typeof r==`function`?r({...s,defaultChildren:a}):r??a,{className:e??i,style:c||o?{...o,...c}:void 0,children:u??a,"data-rac":``,render:l?e=>l(e,s):void 0}},[t,n,r,i,a,o,s,l])}function T(e,t){let n=o(e);if(t===null)return null;if(n&&typeof n==`object`&&`slots`in n&&n.slots){let e=t||C;if(!n.slots[e]){let e=new Intl.ListFormat().format(Object.keys(n.slots).map(e=>`"${e}"`)),r=t?`Invalid slot "${t}".`:`A slot prop is required.`;throw Error(`${r} Valid slot names are ${e}.`)}return n.slots[e]}return n}function E(e,t,n){let{ref:r,...i}=T(n,e.slot)||{},a=v(c(()=>h(t,r),[t,r])),o=m(i,e);return`style`in i&&i.style&&`style`in e&&e.style&&(o.style=typeof i.style==`function`||typeof e.style==`function`?t=>{let n=typeof i.style==`function`?i.style(t):i.style,r={...t.defaultStyle,...n},a=typeof e.style==`function`?e.style({...t,defaultStyle:r}):e.style;return{...r,...a}}:{...i.style,...e.style}),[o,a]}function D(e=!0){let[t,n]=u(e),r=l(!1),i=a(e=>{r.current=!0,n(!!e)},[]);return g(()=>{r.current||n(!1)},[]),[i,t]}function O(t,n,r){let{render:i,...a}=n,o=l(null),s=c(()=>h(r,o),[r,o]);g(()=>{},[t,i]);let u={...a,ref:s};return i?i(u,void 0):e.createElement(t,u)}const k={},A=new Proxy({},{get(e,t){if(typeof t!=`string`)return;let n=k[t];return n||(n=r(O.bind(null,t)),k[t]=n),n}});String(Math.round(Math.random()*1e10));const j=e.createContext(!1);typeof window<`u`&&window.document&&window.document.createElement,e.useId;function M(){return!1}function N(){return!0}function P(e){return()=>{}}function F(){return typeof e.useSyncExternalStore==`function`?e.useSyncExternalStore(P,M,N):o(j)}var I=class{get childNodes(){throw Error(`childNodes is not supported`)}clone(){let e=new this.constructor(this.key);return e.value=this.value,e.level=this.level,e.hasChildNodes=this.hasChildNodes,e.rendered=this.rendered,e.textValue=this.textValue,e[`aria-label`]=this[`aria-label`],e.index=this.index,e.parentKey=this.parentKey,e.prevKey=this.prevKey,e.nextKey=this.nextKey,e.firstChildKey=this.firstChildKey,e.lastChildKey=this.lastChildKey,e.props=this.props,e.render=this.render,e.colSpan=this.colSpan,e.colIndex=this.colIndex,e}filter(e,t,n){let r=this.clone();return t.addDescendants(r,e),r}constructor(e){this.value=null,this.level=0,this.hasChildNodes=!1,this.rendered=null,this.textValue=``,this[`aria-label`]=void 0,this.index=0,this.parentKey=null,this.prevKey=null,this.nextKey=null,this.firstChildKey=null,this.lastChildKey=null,this.props={},this.colSpan=null,this.colIndex=null,this.type=this.constructor.type,this.key=e}},L=class extends I{filter(e,t,n){let[r,i]=U(e,t,this.firstChildKey,n),a=this.clone();return a.firstChildKey=r,a.lastChildKey=i,a}},R=class extends I{};R.type=`header`;var z=class extends I{};z.type=`loader`;var B=class extends L{filter(e,t,n){if(n(this.textValue,this)){let n=this.clone();return t.addDescendants(n,e),n}return null}};B.type=`item`;var V=class extends L{filter(e,t,n){let r=super.filter(e,t,n);if(r&&r.lastChildKey!==null){let t=e.getItem(r.lastChildKey);if(t&&t.type!==`header`)return r}return null}};V.type=`section`;var H=class{get size(){return this.itemCount}getKeys(){return this.keyMap.keys()}*[Symbol.iterator](){let e=this.firstKey==null?void 0:this.keyMap.get(this.firstKey);for(;e;)yield e,e=e.nextKey==null?void 0:this.keyMap.get(e.nextKey)}getChildren(e){let t=this.keyMap;return{*[Symbol.iterator](){let n=t.get(e),r=n?.firstChildKey==null?null:t.get(n.firstChildKey);for(;r;)yield r,r=r.nextKey==null?void 0:t.get(r.nextKey)}}}getKeyBefore(e){let t=this.keyMap.get(e);if(!t)return null;if(t.prevKey!=null){for(t=this.keyMap.get(t.prevKey);t&&t.type!==`item`&&t.lastChildKey!=null;)t=this.keyMap.get(t.lastChildKey);return t?.key??null}return t.parentKey}getKeyAfter(e){let t=this.keyMap.get(e);if(!t)return null;if(t.type!==`item`&&t.firstChildKey!=null)return t.firstChildKey;for(;t;){if(t.nextKey!=null)return t.nextKey;if(t.parentKey!=null)t=this.keyMap.get(t.parentKey);else return null}return null}getFirstKey(){return this.firstKey}getLastKey(){let e=this.lastKey==null?null:this.keyMap.get(this.lastKey);for(;e?.lastChildKey!=null;)e=this.keyMap.get(e.lastChildKey);return e?.key??null}getItem(e){return this.keyMap.get(e)??null}at(){throw Error(`Not implemented`)}clone(){let e=this.constructor,t=new e;return t.keyMap=new Map(this.keyMap),t.firstKey=this.firstKey,t.lastKey=this.lastKey,t.itemCount=this.itemCount,t}addNode(e){if(this.frozen)throw Error(`Cannot add a node to a frozen collection`);e.type===`item`&&this.keyMap.get(e.key)==null&&this.itemCount++,this.keyMap.set(e.key,e)}addDescendants(e,t){this.addNode(e);let n=t.getChildren(e.key);for(let e of n)this.addDescendants(e,t)}removeNode(e){if(this.frozen)throw Error(`Cannot remove a node to a frozen collection`);let t=this.keyMap.get(e);t!=null&&t.type===`item`&&this.itemCount--,this.keyMap.delete(e)}commit(e,t,n=!1){if(this.frozen)throw Error(`Cannot commit a frozen collection`);this.firstKey=e,this.lastKey=t,this.frozen=!n}filter(e){let t=new this.constructor,[n,r]=U(this,t,this.firstKey,e);return t?.commit(n,r),t}constructor(){this.keyMap=new Map,this.firstKey=null,this.lastKey=null,this.frozen=!1,this.itemCount=0}};function U(e,t,n,r){if(n==null)return[null,null];let i=null,a=null,o=e.getItem(n);for(;o!=null;){let n=o.filter(e,t,r);n!=null&&(n.nextKey=null,a&&(n.prevKey=a.key,a.nextKey=n.key),i??=n,t.addNode(n),a=n),o=o.nextKey?e.getItem(o.nextKey):null}if(a&&a.type===`separator`){let e=a.prevKey;t.removeNode(a.key),e?(a=t.getItem(e),a.nextKey=null):a=null}return[i?.key??null,a?.key??null]}var W=class{*[Symbol.iterator](){let e=this.firstChild;for(;e;)yield e,e=e.nextSibling}get firstChild(){return this._firstChild}set firstChild(e){this._firstChild=e,this.ownerDocument.markDirty(this)}get lastChild(){return this._lastChild}set lastChild(e){this._lastChild=e,this.ownerDocument.markDirty(this)}get previousSibling(){return this._previousSibling}set previousSibling(e){this._previousSibling=e,this.ownerDocument.markDirty(this)}get nextSibling(){return this._nextSibling}set nextSibling(e){this._nextSibling=e,this.ownerDocument.markDirty(this)}get parentNode(){return this._parentNode}set parentNode(e){this._parentNode=e,this.ownerDocument.markDirty(this)}get isConnected(){return this.parentNode?.isConnected||!1}invalidateChildIndices(e){(this._minInvalidChildIndex==null||!this._minInvalidChildIndex.isConnected||e.index<this._minInvalidChildIndex.index)&&(this._minInvalidChildIndex=e,this.ownerDocument.markDirty(this))}updateChildIndices(){let e=this._minInvalidChildIndex;for(;e;)e.index=e.previousSibling?e.previousSibling.index+1:0,e=e.nextSibling;this._minInvalidChildIndex=null}appendChild(e){e.parentNode&&e.parentNode.removeChild(e),this.firstChild??=e,this.lastChild?(this.lastChild.nextSibling=e,e.index=this.lastChild.index+1,e.previousSibling=this.lastChild):(e.previousSibling=null,e.index=0),e.parentNode=this,e.nextSibling=null,this.lastChild=e,this.ownerDocument.markDirty(this),this.isConnected&&this.ownerDocument.queueUpdate()}insertBefore(e,t){if(t==null)return this.appendChild(e);e.parentNode&&e.parentNode.removeChild(e),e.nextSibling=t,e.previousSibling=t.previousSibling,e.index=t.index-1,this.firstChild===t?this.firstChild=e:t.previousSibling&&(t.previousSibling.nextSibling=e),t.previousSibling=e,e.parentNode=t.parentNode,this.invalidateChildIndices(e),this.isConnected&&this.ownerDocument.queueUpdate()}removeChild(e){e.parentNode===this&&(this._minInvalidChildIndex===e&&(this._minInvalidChildIndex=null),e.nextSibling&&(this.invalidateChildIndices(e.nextSibling),e.nextSibling.previousSibling=e.previousSibling),e.previousSibling&&(e.previousSibling.nextSibling=e.nextSibling),this.firstChild===e&&(this.firstChild=e.nextSibling),this.lastChild===e&&(this.lastChild=e.previousSibling),e.parentNode=null,e.nextSibling=null,e.previousSibling=null,e.index=0,this.ownerDocument.markDirty(e),this.isConnected&&this.ownerDocument.queueUpdate())}addEventListener(){}removeEventListener(){}get previousVisibleSibling(){let e=this.previousSibling;for(;e&&e.isHidden;)e=e.previousSibling;return e}get nextVisibleSibling(){let e=this.nextSibling;for(;e&&e.isHidden;)e=e.nextSibling;return e}get firstVisibleChild(){let e=this.firstChild;for(;e&&e.isHidden;)e=e.nextSibling;return e}get lastVisibleChild(){let e=this.lastChild;for(;e&&e.isHidden;)e=e.previousSibling;return e}constructor(e){this._firstChild=null,this._lastChild=null,this._previousSibling=null,this._nextSibling=null,this._parentNode=null,this._minInvalidChildIndex=null,this.ownerDocument=e}},G=class e extends W{get index(){return this._index}set index(e){this._index=e,this.ownerDocument.markDirty(this)}get level(){return this.parentNode instanceof e?this.parentNode.level+ +(this.node?.type===`item`):0}getMutableNode(){return this.node==null?null:(this.isMutated||=(this.node=this.node.clone(),!0),this.ownerDocument.markDirty(this),this.node)}updateNode(){let t=this.nextVisibleSibling,n=this.getMutableNode();if(n!=null&&(n.index=this.index,n.level=this.level,n.parentKey=this.parentNode instanceof e?this.parentNode.node?.key??null:null,n.prevKey=this.previousVisibleSibling?.node?.key??null,n.nextKey=t?.node?.key??null,n.hasChildNodes=!!this.firstChild,n.firstChildKey=this.firstVisibleChild?.node?.key??null,n.lastChildKey=this.lastVisibleChild?.node?.key??null,(n.colSpan!=null||n.colIndex!=null)&&t)){let e=(n.colIndex??n.index)+(n.colSpan??1);if(t.node!=null&&e!==t.node.colIndex){let n=t.getMutableNode();n.colIndex=e}}}setProps(e,t,n,r,i){let a,{value:o,textValue:s,id:c,...l}=e;if(this.node==null?(a=new n(c??`react-aria-${++this.ownerDocument.nodeId}`),this.node=a):a=this.getMutableNode(),l.ref=t,a.props=l,a.rendered=r,a.render=i,a.value=o,e[`aria-label`]&&(a[`aria-label`]=e[`aria-label`]),a.textValue=s||(typeof l.children==`string`?l.children:``)||e[`aria-label`]||``,c!=null&&c!==a.key)throw Error(`Cannot change the id of an item`);l.colSpan!=null&&(a.colSpan=l.colSpan),this.isConnected&&this.ownerDocument.queueUpdate()}get style(){let e=this;return{get display(){return e.isHidden?`none`:``},set display(t){let n=t===`none`;if(e.isHidden!==n){(e.parentNode?.firstVisibleChild===e||e.parentNode?.lastVisibleChild===e)&&e.ownerDocument.markDirty(e.parentNode);let t=e.previousVisibleSibling,r=e.nextVisibleSibling;t&&e.ownerDocument.markDirty(t),r&&e.ownerDocument.markDirty(r),e.isHidden=n,e.ownerDocument.markDirty(e)}}}}hasAttribute(){}setAttribute(){}setAttributeNS(){}removeAttribute(){}constructor(e,t){super(t),this.nodeType=8,this.isMutated=!0,this._index=0,this.isHidden=!1,this.node=null}},ue=class extends W{get isConnected(){return!0}createElement(e){return new G(e,this)}getMutableCollection(){return this.nextCollection||=this.collection.clone(),this.nextCollection}markDirty(e){this.dirtyNodes.add(e)}addNode(e){if(e.isHidden||e.node==null)return;let t=this.getMutableCollection();if(!t.getItem(e.node.key))for(let t of e)this.addNode(t);t.addNode(e.node)}removeNode(e){for(let t of e)this.removeNode(t);e.node&&this.getMutableCollection().removeNode(e.node.key)}getCollection(){return this.inSubscription?this.collection.clone():(this.queuedRender=!1,this.updateCollection(),this.collection)}updateCollection(){for(let e of this.dirtyNodes)e instanceof G&&(!e.isConnected||e.isHidden)?this.removeNode(e):e.updateChildIndices();for(let e of this.dirtyNodes)e instanceof G?(e.isConnected&&!e.isHidden&&(e.updateNode(),this.addNode(e)),e.node&&this.dirtyNodes.delete(e),e.isMutated=!1):this.dirtyNodes.delete(e);this.nextCollection&&(this.nextCollection.commit(this.firstVisibleChild?.node?.key??null,this.lastVisibleChild?.node?.key??null,this.isSSR),this.isSSR||(this.collection=this.nextCollection,this.nextCollection=null))}queueUpdate(){if(!(this.dirtyNodes.size===0||this.queuedRender)){this.queuedRender=!0,this.inSubscription=!0;for(let e of this.subscriptions)e();this.inSubscription=!1}}subscribe(e){return this.subscriptions.add(e),()=>this.subscriptions.delete(e)}resetAfterSSR(){this.isSSR&&(this.isSSR=!1,this.firstChild=null,this.lastChild=null,this.nodeId=0)}constructor(e){super(null),this.nodeType=11,this.ownerDocument=this,this.dirtyNodes=new Set,this.isSSR=!1,this.nodeId=0,this.nodesByProps=new WeakMap,this.nextCollection=null,this.subscriptions=new Set,this.queuedRender=!1,this.inSubscription=!1,this.collection=e,this.nextCollection=e}};function K(e){let{children:n,items:r,idScope:i,addIdAndValue:a,dependencies:o=[]}=e,s=c(()=>new WeakMap,o);return c(()=>{if(r&&typeof n==`function`){let e=[];for(let o of r){let r=s.get(o);if(!r){r=n(o);let e=r.props.id??o.key??o.id;if(e==null)throw Error(`Could not determine key for item`);i!=null&&(e=i+`:`+e),r=t(r,a?{key:e,id:e,value:o}:{key:e}),s.set(o,r)}e.push(r)}return e}if(typeof n!=`function`)return n},[n,r,s,i,a])}if(typeof HTMLTemplateElement<`u`){let e=Object.getOwnPropertyDescriptor(Node.prototype,`firstChild`).get;Object.defineProperty(HTMLTemplateElement.prototype,"firstChild",{configurable:!0,enumerable:!0,get:function(){return this.dataset.reactAriaHidden?this.content.firstChild:e.call(this)}})}const q=n(!1);function de(t){if(o(q))return e.createElement(e.Fragment,null,t.children);let n=e.createElement(q.Provider,{value:!0},t.children);return e.createElement(`template`,{"data-react-aria-hidden":!0},n)}const fe=n(!1),J=n(null);function pe(t){if(o(J))return t.content;let{collection:n,document:r}=_e(t.createCollection);return e.createElement(e.Fragment,null,e.createElement(de,null,e.createElement(J.Provider,{value:r},t.content)),e.createElement(me,{render:t.children,collection:n}))}function me({collection:e,render:t}){return t(e)}function he(e,t,n){let r=F(),i=l(r);i.current=r;let o=a(()=>i.current?n():t(),[t,n]);return d(e,o)}const ge=typeof e.useSyncExternalStore==`function`?e.useSyncExternalStore:he;function _e(e){let[t]=u(()=>new ue(e?.()||new H)),n=a(e=>t.subscribe(e),[t]),r=a(()=>{let e=t.getCollection();return t.isSSR&&t.resetAfterSSR(),e},[t]),i=a(()=>(t.isSSR=!0,t.getCollection()),[t]);return{collection:ge(n,r,i),document:t}}const Y=n(null);function ve(e){var t;return t=class extends I{},t.type=e,t}function ye(t,n,r,i,s,c){typeof t==`string`&&(t=ve(t));let l=a(e=>{e?.setProps(n,r,t,i,c)},[n,r,i,c,t]),u=o(Y);if(u){let a=u.ownerDocument.nodesByProps.get(n);return a||(a=u.ownerDocument.createElement(t.type),a.setProps(n,r,t,i,c),u.appendChild(a),u.ownerDocument.updateCollection(),u.ownerDocument.nodesByProps.set(n,a)),s?e.createElement(Y.Provider,{value:a},s):null}return e.createElement(t.type,{ref:l},s)}function be(t,n){let i=({node:e})=>n(e.props,e.props.ref,e),a=r((r,a)=>{let s=o(y);if(!o(fe)){if(n.length>=3)throw Error(n.name+` cannot be rendered outside a collection.`);return n(r,a)}return ye(t,r,a,`children`in r?r.children:null,null,t=>e.createElement(y.Provider,{value:s},e.createElement(i,{node:t})))});return a.displayName=n.name,a}function xe(e){return K({...e,addIdAndValue:!0})}const Se=n(null);function Ce(t){let n=o(Se),r=(n?.dependencies||[]).concat(t.dependencies),i=t.idScope??n?.idScope,a=xe({...t,idScope:i,dependencies:r});return o(J)&&(a=e.createElement(we,null,a)),n=c(()=>({dependencies:r,idScope:i}),[i,...r]),e.createElement(Se.Provider,{value:n},a)}function we({children:t}){let n=o(J),r=c(()=>e.createElement(J.Provider,{value:null},e.createElement(fe.Provider,{value:!0},t)),[t]);return F()?e.createElement(Y.Provider,{value:n},r):b(r,n)}const Te=n(null),Ee={CollectionRoot({collection:e,renderDropIndicator:t}){return De(e,null,t)},CollectionBranch({collection:e,parent:t,renderDropIndicator:n}){return De(e,t,n)}};function De(t,n,r){return K({items:n?t.getChildren(n.key):t,dependencies:[r],children(n){let i=n.render(n);return!r||n.type!==`item`?i:e.createElement(e.Fragment,null,r({type:`item`,key:n.key,dropPosition:`before`}),i,Oe(t,n,r))}})}function Oe(e,n,r){let a=n.key,o=e.getKeyAfter(a),s=o==null?null:e.getItem(o);for(;s!=null&&s.type!==`item`;)o=e.getKeyAfter(s.key),s=o==null?null:e.getItem(o);let c=n.nextKey==null?null:e.getItem(n.nextKey);for(;c!=null&&c.type!==`item`;)c=c.nextKey==null?null:e.getItem(c.nextKey);let l=[];if(c==null){let a=n;for(;a?.type===`item`&&(!s||a.parentKey!==s.parentKey&&s.level<a.level);){let n=r({type:`item`,key:a.key,dropPosition:`after`});i(n)&&l.push(t(n,{key:`${a.key}-after`})),a=a.parentKey==null?null:e.getItem(a.parentKey)}}return l}const X=n(Ee),Z=n({}),ke=n(null),Ae=r(function(t,n){let{render:r}=o(ke);return e.createElement(e.Fragment,null,r(t,n))});function je(t,n){let r=t?.renderDropIndicator,i=t?.isVirtualDragging?.call(t),o=a(t=>{if(i||n?.isDropTarget(t))return r?r(t):e.createElement(Ae,{target:t})},[n?.target,i,r]);return t?.useDropIndicator?o:void 0}function Me(e,t,n){let r=e.focusedKey,i=null;if(t!=null&&t.isVirtualDragging?.call(t)&&n?.target?.type===`item`&&(i=n.target.key,n.target.dropPosition===`after`)){let e=n.collection.getKeyAfter(i),t=null;if(e!=null){let r=n.collection.getItem(i)?.level??0;for(;e;){let i=n.collection.getItem(e);if(!i)break;if(i.type!==`item`){e=n.collection.getKeyAfter(e);continue}if((i.level??0)<=r)break;t=e,e=n.collection.getKeyAfter(e)}}i=e??t??i}return c(()=>new Set([r,i].filter(e=>e!=null)),[r,i])}const Ne=n({}),Pe=n(null);function Fe(t){let n=l({});return e.createElement(Pe.Provider,{value:n},t.children)}const Ie=n({});var Le=class extends I{filter(e,t){let n=t.getItem(this.prevKey);if(n&&n.type!==`separator`){let n=this.clone();return t.addDescendants(n,e),n}return null}};Le.type=`separator`;const Re=n(null),Q=n(null),ze=r(function(t,n){[t,n]=E(t,n,Re);let r=o(Q);return r?e.createElement($,{state:r,props:t,listBoxRef:n}):e.createElement(pe,{content:e.createElement(Ce,t)},r=>e.createElement(Be,{props:t,listBoxRef:n,collection:r}))});function Be({props:t,listBoxRef:n,collection:r}){t={...t,collection:r,children:null,items:null};let{layoutDelegate:i}=o(X),a=se({...t,layoutDelegate:i});return e.createElement($,{state:a,props:t,listBoxRef:n})}function $({state:t,props:n,listBoxRef:r}){[n,r]=E(n,r,ce);let{dragAndDropHooks:i,layout:a=`stack`,orientation:u=`vertical`,filter:d}=n,p=oe(t,d),{collection:m,selectionManager:h}=p,g=!!i?.useDraggableCollectionState,_=!!i?.useDroppableCollectionState,{direction:v}=ae(),{disabledBehavior:y,disabledKeys:b}=h,S=ne({usage:`search`,sensitivity:`base`}),{isVirtualized:se,layoutDelegate:C,dropTargetDelegate:T,CollectionRoot:D}=o(X),O=c(()=>n.keyboardDelegate||new te({collection:m,collator:S,ref:r,disabledKeys:b,disabledBehavior:y,layout:a,orientation:u,direction:v,layoutDelegate:C}),[m,S,r,y,b,u,v,n.keyboardDelegate,a,C]),{listBoxProps:k}=ie({...n,shouldSelectOnPressUp:g||n.shouldSelectOnPressUp,keyboardDelegate:O,isVirtualized:se},p,r);l(g),l(_),s(()=>{},[g,_]);let j,M,N,P=!1,F=null,I=l(null);if(g&&i){j=i.useDraggableCollectionState({collection:m,selectionManager:h,preview:i.renderDragPreview?I:void 0}),i.useDraggableCollection({},j,r);let t=i.DragPreview;F=i.renderDragPreview?e.createElement(t,{ref:I},i.renderDragPreview):null}if(_&&i){M=i.useDroppableCollectionState({collection:m,selectionManager:h});let e=i.dropTargetDelegate||T||new i.ListDropTargetDelegate(m,r,{orientation:u,layout:a,direction:v});N=i.useDroppableCollection({keyboardDelegate:O,dropTargetDelegate:e},M,r),P=M.isDropTarget({type:`root`})}let{focusProps:L,isFocused:R,isFocusVisible:z}=re(),B=p.collection.size===0,V={isDropTarget:P,isEmpty:B,isFocused:R,isFocusVisible:z,layout:n.layout||`stack`,state:p},H=w({...n,children:void 0,defaultClassName:`react-aria-ListBox`,values:V}),U=null;B&&n.renderEmptyState&&(U=e.createElement(`div`,{role:`option`,style:{display:`contents`}},n.renderEmptyState(V)));let W=f(n,{global:!0});return e.createElement(ee,null,e.createElement(A.div,{...x(W,H,k,L,N?.collectionProps),ref:r,slot:n.slot||void 0,onScroll:n.onScroll,"data-drop-target":P||void 0,"data-empty":B||void 0,"data-focused":R||void 0,"data-focus-visible":z||void 0,"data-layout":n.layout||`stack`,"data-orientation":n.orientation||`vertical`},e.createElement(le,{values:[[Re,n],[Q,p],[Z,{dragAndDropHooks:i,dragState:j,dropState:M}],[Ie,{elementType:`div`}],[ke,{render:He}],[Te,{name:`ListBoxSection`,render:Ve}]]},e.createElement(Fe,null,e.createElement(D,{collection:m,scrollRef:r,persistedKeys:Me(h,i,M),renderDropIndicator:je(i,M)}))),U,F))}function Ve(t,n,r,i=`react-aria-ListBoxSection`){let a=o(Q),{dragAndDropHooks:s,dropState:c}=o(Z),{CollectionBranch:l}=o(X),[u,d]=D(),{headingProps:p,groupProps:m}=S({heading:d,"aria-label":t[`aria-label`]??void 0}),h=w({...t,id:void 0,children:void 0,defaultClassName:i,values:void 0}),g=f(t,{global:!0});return delete g.id,e.createElement(A.section,{...x(g,h,m),ref:n},e.createElement(Ne.Provider,{value:{...p,ref:u}},e.createElement(l,{collection:a.collection,parent:r,renderDropIndicator:je(s,c)})))}function He(t,n){n=v(n);let{dragAndDropHooks:r,dropState:i}=o(Z),{dropIndicatorProps:a,isHidden:s,isDropTarget:c}=r.useDropIndicator(t,i,n);return s?null:e.createElement(We,{...t,dropIndicatorProps:a,isDropTarget:c,ref:n})}function Ue(t,n){let{dropIndicatorProps:r,isDropTarget:i,...a}=t,o=w({...a,defaultClassName:`react-aria-DropIndicator`,values:{isDropTarget:i}});return e.createElement(A.div,{...r,...o,role:`option`,ref:n,"data-drop-target":i||void 0})}const We=r(Ue);be(z,function(t,n,r){let i=o(Q),{isLoading:a,onLoadMore:s,scrollOffset:u,...d}=t,m=l(null),h=c(()=>({onLoadMore:s,collection:i?.collection,sentinelRef:m,scrollOffset:u}),[s,u,i?.collection]);_(h,m);let g=w({...d,id:void 0,children:r.rendered,defaultClassName:`react-aria-ListBoxLoadingIndicator`,values:void 0});return e.createElement(e.Fragment,null,e.createElement(`div`,{style:{position:`relative`,width:0,height:0},inert:p(!0)},e.createElement(`div`,{"data-testid":`loadMoreSentinel`,ref:m,style:{position:`absolute`,height:1,width:1}})),a&&g.children&&e.createElement(A.div,{...x(f(t,{global:!0}),{tabIndex:-1}),...g,role:`option`,ref:n},g.children))});export{ze as ListBox};
@@ -1,11 +1 @@
1
- import e,{createContext as t,forwardRef as n,useCallback as r,useContext as i,useEffect as a,useMemo as o,useRef as s}from"react";import{filterDOMProps as c,inertValue as l,mergeRefs as u,useLayoutEffect as d,useLoadMoreSentinel as f,useObjectRef as p}from"@react-aria/utils";import{FocusableContext as m}from"@react-aria/interactions";import"react-dom";import{mergeProps as h,useFocus as g,useHover as _,useOption as v}from"react-aria";import"react-stately";var y=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),b=(e=>typeof require<`u`?require:typeof Proxy<`u`?new Proxy(e,{get:(e,t)=>(typeof require<`u`?require:e)[t]}):e)(function(e){if(typeof require<`u`)return require.apply(this,arguments);throw Error('Calling `require` for "'+e+"\" in an environment that doesn't expose the `require` function. See https://rolldown.rs/in-depth/bundling-cjs#require-external-modules for more details.")});const x=Symbol(`default`);function S({values:t,children:n}){for(let[r,i]of t)n=e.createElement(r.Provider,{value:i},n);return n}function C(e){let{className:t,style:n,children:r,defaultClassName:i,defaultChildren:a,defaultStyle:s,values:c,render:l}=e;return o(()=>{let e,o,u;return e=typeof t==`function`?t({...c,defaultClassName:i}):t,o=typeof n==`function`?n({...c,defaultStyle:s||{}}):n,u=typeof r==`function`?r({...c,defaultChildren:a}):r??a,{className:e??i,style:o||s?{...s,...o}:void 0,children:u??a,"data-rac":``,render:l?e=>l(e,c):void 0}},[t,n,r,i,a,s,c,l])}function w(t,n,r){let{render:i,...a}=n,c=s(null),l=o(()=>u(r,c),[r,c]);d(()=>{},[t,i]);let f={...a,ref:l};return i?i(f,void 0):e.createElement(t,f)}const T={},E=new Proxy({},{get(e,t){if(typeof t!=`string`)return;let r=T[t];return r||(r=n(w.bind(null,t)),T[t]=r),r}});String(Math.round(Math.random()*1e10)),typeof window<`u`&&window.document&&window.document.createElement,e.useId;var D=class{get childNodes(){throw Error(`childNodes is not supported`)}clone(){let e=new this.constructor(this.key);return e.value=this.value,e.level=this.level,e.hasChildNodes=this.hasChildNodes,e.rendered=this.rendered,e.textValue=this.textValue,e[`aria-label`]=this[`aria-label`],e.index=this.index,e.parentKey=this.parentKey,e.prevKey=this.prevKey,e.nextKey=this.nextKey,e.firstChildKey=this.firstChildKey,e.lastChildKey=this.lastChildKey,e.props=this.props,e.render=this.render,e.colSpan=this.colSpan,e.colIndex=this.colIndex,e}filter(e,t,n){let r=this.clone();return t.addDescendants(r,e),r}constructor(e){this.value=null,this.level=0,this.hasChildNodes=!1,this.rendered=null,this.textValue=``,this[`aria-label`]=void 0,this.index=0,this.parentKey=null,this.prevKey=null,this.nextKey=null,this.firstChildKey=null,this.lastChildKey=null,this.props={},this.colSpan=null,this.colIndex=null,this.type=this.constructor.type,this.key=e}},O=class extends D{filter(e,t,n){let[r,i]=N(e,t,this.firstChildKey,n),a=this.clone();return a.firstChildKey=r,a.lastChildKey=i,a}},k=class extends D{};k.type=`header`;var A=class extends D{};A.type=`loader`;var j=class extends O{filter(e,t,n){if(n(this.textValue,this)){let n=this.clone();return t.addDescendants(n,e),n}return null}};j.type=`item`;var M=class extends O{filter(e,t,n){let r=super.filter(e,t,n);if(r&&r.lastChildKey!==null){let t=e.getItem(r.lastChildKey);if(t&&t.type!==`header`)return r}return null}};M.type=`section`;function N(e,t,n,r){if(n==null)return[null,null];let i=null,a=null,o=e.getItem(n);for(;o!=null;){let n=o.filter(e,t,r);n!=null&&(n.nextKey=null,a&&(n.prevKey=a.key,a.nextKey=n.key),i??=n,t.addNode(n),a=n),o=o.nextKey?e.getItem(o.nextKey):null}if(a&&a.type===`separator`){let e=a.prevKey;t.removeNode(a.key),e?(a=t.getItem(e),a.nextKey=null):a=null}return[i?.key??null,a?.key??null]}
2
- /**
3
- * @license React
4
- * use-sync-external-store-shim.production.js
5
- *
6
- * Copyright (c) Meta Platforms, Inc. and affiliates.
7
- *
8
- * This source code is licensed under the MIT license found in the
9
- * LICENSE file in the root directory of this source tree.
10
- */
11
- var P=y((e=>{var t=b(`react`);function n(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var r=typeof Object.is==`function`?Object.is:n,i=t.useState,a=t.useEffect,o=t.useLayoutEffect,s=t.useDebugValue;function c(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),c=r[0].inst,u=r[1];return o(function(){c.value=n,c.getSnapshot=t,l(c)&&u({inst:c})},[e,n,t]),a(function(){return l(c)&&u({inst:c}),e(function(){l(c)&&u({inst:c})})},[e]),s(n),n}function l(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch{return!0}}function u(e,t){return t()}var d=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?u:c;e.useSyncExternalStore=t.useSyncExternalStore===void 0?d:t.useSyncExternalStore}));y(((e,t)=>{t.exports=P()}))();const F=t(!1);typeof e.useSyncExternalStore==`function`&&e.useSyncExternalStore;const I=t(null);function L(e){var t;return t=class extends D{},t.type=e,t}function R(t,n,a,o,s,c){typeof t==`string`&&(t=L(t));let l=r(e=>{e?.setProps(n,a,t,o,c)},[n,a,o,c,t]),u=i(I);if(u){let r=u.ownerDocument.nodesByProps.get(n);return r||(r=u.ownerDocument.createElement(t.type),r.setProps(n,a,t,o,c),u.appendChild(r),u.ownerDocument.updateCollection(),u.ownerDocument.nodesByProps.set(n,r)),s?e.createElement(I.Provider,{value:r},s):null}return e.createElement(t.type,{ref:l},s)}function z(t,r){let a=({node:e})=>r(e.props,e.props.ref,e),o=n((n,o)=>{let s=i(m);if(!i(F)){if(r.length>=3)throw Error(r.name+` cannot be rendered outside a collection.`);return r(n,o)}return R(t,n,o,`children`in n?n.children:null,null,t=>e.createElement(m.Provider,{value:s},e.createElement(a,{node:t})))});return o.displayName=r.name,o}const B=t({}),V=t({}),H=t({isSelected:!1}),U=t(null),W=z(j,function(t,n,r){let o=p(n),s=i(U),{dragAndDropHooks:l,dragState:u,dropState:d}=i(V),{optionProps:f,labelProps:m,descriptionProps:y,...b}=v({key:r.key,"aria-label":t?.[`aria-label`]},s,o),{hoverProps:w,isHovered:T}=_({isDisabled:!b.allowsSelection&&!b.hasAction,onHoverStart:r.props.onHoverStart,onHoverChange:r.props.onHoverChange,onHoverEnd:r.props.onHoverEnd}),{focusProps:D}=g(t),O=null;u&&l&&(O=l.useDraggableItem({key:r.key,hasAction:b.hasAction},u));let k=null;d&&l&&(k=l.useDroppableItem({target:{type:`item`,key:r.key,dropPosition:`on`}},d,o));let A=u&&u.isDragging(r.key),j=C({...t,id:void 0,children:t.children,defaultClassName:`react-aria-ListBoxItem`,values:{...b,isHovered:T,selectionMode:s.selectionManager.selectionMode,selectionBehavior:s.selectionManager.selectionBehavior,allowsDragging:!!u,isDragging:A,isDropTarget:k?.isDropTarget}});a(()=>{r.textValue},[r.textValue]);let M=t.href?E.a:E.div,N=c(t,{global:!0});return delete N.id,delete N.onClick,t.href&&f.tabIndex==null&&(f.tabIndex=-1),e.createElement(M,{...h(N,j,f,w,D,O?.dragProps,k?.dropProps),ref:o,"data-allows-dragging":!!u||void 0,"data-selected":b.isSelected||void 0,"data-disabled":b.isDisabled||void 0,"data-hovered":T||void 0,"data-focused":b.isFocused||void 0,"data-focus-visible":b.isFocusVisible||void 0,"data-pressed":b.isPressed||void 0,"data-dragging":A||void 0,"data-drop-target":k?.isDropTarget||void 0,"data-selection-mode":s.selectionManager.selectionMode===`none`?void 0:s.selectionManager.selectionMode},e.createElement(S,{values:[[B,{slots:{[x]:m,label:m,description:y}}],[H,{isSelected:b.isSelected}]]},j.children))});z(A,function(t,n,r){let a=i(U),{isLoading:u,onLoadMore:d,scrollOffset:p,...m}=t,g=s(null),_=o(()=>({onLoadMore:d,collection:a?.collection,sentinelRef:g,scrollOffset:p}),[d,p,a?.collection]);f(_,g);let v=C({...m,id:void 0,children:r.rendered,defaultClassName:`react-aria-ListBoxLoadingIndicator`,values:void 0});return e.createElement(e.Fragment,null,e.createElement(`div`,{style:{position:`relative`,width:0,height:0},inert:l(!0)},e.createElement(`div`,{"data-testid":`loadMoreSentinel`,ref:g,style:{position:`absolute`,height:1,width:1}})),u&&v.children&&e.createElement(E.div,{...h(c(t,{global:!0}),{tabIndex:-1}),...v,role:`option`,ref:n},v.children))});export{W as ListBoxItem};
1
+ import e,{createContext as t,forwardRef as n,useCallback as r,useContext as i,useEffect as a,useMemo as o,useRef as s}from"react";import{filterDOMProps as c,inertValue as l,mergeRefs as u,useLayoutEffect as d,useLoadMoreSentinel as f,useObjectRef as p}from"@react-aria/utils";import{FocusableContext as m}from"@react-aria/interactions";import"react-dom";import{mergeProps as h,useFocus as g,useHover as _,useOption as v}from"react-aria";import"react-stately";const y=Symbol(`default`);function b({values:t,children:n}){for(let[r,i]of t)n=e.createElement(r.Provider,{value:i},n);return n}function x(e){let{className:t,style:n,children:r,defaultClassName:i,defaultChildren:a,defaultStyle:s,values:c,render:l}=e;return o(()=>{let e,o,u;return e=typeof t==`function`?t({...c,defaultClassName:i}):t,o=typeof n==`function`?n({...c,defaultStyle:s||{}}):n,u=typeof r==`function`?r({...c,defaultChildren:a}):r??a,{className:e??i,style:o||s?{...s,...o}:void 0,children:u??a,"data-rac":``,render:l?e=>l(e,c):void 0}},[t,n,r,i,a,s,c,l])}function S(t,n,r){let{render:i,...a}=n,c=s(null),l=o(()=>u(r,c),[r,c]);d(()=>{},[t,i]);let f={...a,ref:l};return i?i(f,void 0):e.createElement(t,f)}const C={},w=new Proxy({},{get(e,t){if(typeof t!=`string`)return;let r=C[t];return r||(r=n(S.bind(null,t)),C[t]=r),r}});String(Math.round(Math.random()*1e10)),typeof window<`u`&&window.document&&window.document.createElement,e.useId;var T=class{get childNodes(){throw Error(`childNodes is not supported`)}clone(){let e=new this.constructor(this.key);return e.value=this.value,e.level=this.level,e.hasChildNodes=this.hasChildNodes,e.rendered=this.rendered,e.textValue=this.textValue,e[`aria-label`]=this[`aria-label`],e.index=this.index,e.parentKey=this.parentKey,e.prevKey=this.prevKey,e.nextKey=this.nextKey,e.firstChildKey=this.firstChildKey,e.lastChildKey=this.lastChildKey,e.props=this.props,e.render=this.render,e.colSpan=this.colSpan,e.colIndex=this.colIndex,e}filter(e,t,n){let r=this.clone();return t.addDescendants(r,e),r}constructor(e){this.value=null,this.level=0,this.hasChildNodes=!1,this.rendered=null,this.textValue=``,this[`aria-label`]=void 0,this.index=0,this.parentKey=null,this.prevKey=null,this.nextKey=null,this.firstChildKey=null,this.lastChildKey=null,this.props={},this.colSpan=null,this.colIndex=null,this.type=this.constructor.type,this.key=e}},E=class extends T{filter(e,t,n){let[r,i]=j(e,t,this.firstChildKey,n),a=this.clone();return a.firstChildKey=r,a.lastChildKey=i,a}},D=class extends T{};D.type=`header`;var O=class extends T{};O.type=`loader`;var k=class extends E{filter(e,t,n){if(n(this.textValue,this)){let n=this.clone();return t.addDescendants(n,e),n}return null}};k.type=`item`;var A=class extends E{filter(e,t,n){let r=super.filter(e,t,n);if(r&&r.lastChildKey!==null){let t=e.getItem(r.lastChildKey);if(t&&t.type!==`header`)return r}return null}};A.type=`section`;function j(e,t,n,r){if(n==null)return[null,null];let i=null,a=null,o=e.getItem(n);for(;o!=null;){let n=o.filter(e,t,r);n!=null&&(n.nextKey=null,a&&(n.prevKey=a.key,a.nextKey=n.key),i??=n,t.addNode(n),a=n),o=o.nextKey?e.getItem(o.nextKey):null}if(a&&a.type===`separator`){let e=a.prevKey;t.removeNode(a.key),e?(a=t.getItem(e),a.nextKey=null):a=null}return[i?.key??null,a?.key??null]}const M=t(!1);typeof e.useSyncExternalStore==`function`&&e.useSyncExternalStore;const N=t(null);function P(e){var t;return t=class extends T{},t.type=e,t}function F(t,n,a,o,s,c){typeof t==`string`&&(t=P(t));let l=r(e=>{e?.setProps(n,a,t,o,c)},[n,a,o,c,t]),u=i(N);if(u){let r=u.ownerDocument.nodesByProps.get(n);return r||(r=u.ownerDocument.createElement(t.type),r.setProps(n,a,t,o,c),u.appendChild(r),u.ownerDocument.updateCollection(),u.ownerDocument.nodesByProps.set(n,r)),s?e.createElement(N.Provider,{value:r},s):null}return e.createElement(t.type,{ref:l},s)}function I(t,r){let a=({node:e})=>r(e.props,e.props.ref,e),o=n((n,o)=>{let s=i(m);if(!i(M)){if(r.length>=3)throw Error(r.name+` cannot be rendered outside a collection.`);return r(n,o)}return F(t,n,o,`children`in n?n.children:null,null,t=>e.createElement(m.Provider,{value:s},e.createElement(a,{node:t})))});return o.displayName=r.name,o}const L=t({}),R=t({}),z=t({isSelected:!1}),B=t(null),V=I(k,function(t,n,r){let o=p(n),s=i(B),{dragAndDropHooks:l,dragState:u,dropState:d}=i(R),{optionProps:f,labelProps:m,descriptionProps:S,...C}=v({key:r.key,"aria-label":t?.[`aria-label`]},s,o),{hoverProps:T,isHovered:E}=_({isDisabled:!C.allowsSelection&&!C.hasAction,onHoverStart:r.props.onHoverStart,onHoverChange:r.props.onHoverChange,onHoverEnd:r.props.onHoverEnd}),{focusProps:D}=g(t),O=null;u&&l&&(O=l.useDraggableItem({key:r.key,hasAction:C.hasAction},u));let k=null;d&&l&&(k=l.useDroppableItem({target:{type:`item`,key:r.key,dropPosition:`on`}},d,o));let A=u&&u.isDragging(r.key),j=x({...t,id:void 0,children:t.children,defaultClassName:`react-aria-ListBoxItem`,values:{...C,isHovered:E,selectionMode:s.selectionManager.selectionMode,selectionBehavior:s.selectionManager.selectionBehavior,allowsDragging:!!u,isDragging:A,isDropTarget:k?.isDropTarget}});a(()=>{r.textValue},[r.textValue]);let M=t.href?w.a:w.div,N=c(t,{global:!0});return delete N.id,delete N.onClick,t.href&&f.tabIndex==null&&(f.tabIndex=-1),e.createElement(M,{...h(N,j,f,T,D,O?.dragProps,k?.dropProps),ref:o,"data-allows-dragging":!!u||void 0,"data-selected":C.isSelected||void 0,"data-disabled":C.isDisabled||void 0,"data-hovered":E||void 0,"data-focused":C.isFocused||void 0,"data-focus-visible":C.isFocusVisible||void 0,"data-pressed":C.isPressed||void 0,"data-dragging":A||void 0,"data-drop-target":k?.isDropTarget||void 0,"data-selection-mode":s.selectionManager.selectionMode===`none`?void 0:s.selectionManager.selectionMode},e.createElement(b,{values:[[L,{slots:{[y]:m,label:m,description:S}}],[z,{isSelected:C.isSelected}]]},j.children))});I(O,function(t,n,r){let a=i(B),{isLoading:u,onLoadMore:d,scrollOffset:p,...m}=t,g=s(null),_=o(()=>({onLoadMore:d,collection:a?.collection,sentinelRef:g,scrollOffset:p}),[d,p,a?.collection]);f(_,g);let v=x({...m,id:void 0,children:r.rendered,defaultClassName:`react-aria-ListBoxLoadingIndicator`,values:void 0});return e.createElement(e.Fragment,null,e.createElement(`div`,{style:{position:`relative`,width:0,height:0},inert:l(!0)},e.createElement(`div`,{"data-testid":`loadMoreSentinel`,ref:g,style:{position:`absolute`,height:1,width:1}})),u&&v.children&&e.createElement(w.div,{...h(c(t,{global:!0}),{tabIndex:-1}),...v,role:`option`,ref:n},v.children))});export{V as ListBoxItem};
@@ -1,11 +1 @@
1
- import e,{createContext as t,forwardRef as n,useCallback as r,useContext as i,useMemo as a,useRef as o}from"react";import{filterDOMProps as s,inertValue as c,mergeRefs as l,useLayoutEffect as u,useLoadMoreSentinel as d}from"@react-aria/utils";import{FocusableContext as f}from"@react-aria/interactions";import"react-dom";import{mergeProps as p}from"react-aria";import"react-stately";var m=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),h=(e=>typeof require<`u`?require:typeof Proxy<`u`?new Proxy(e,{get:(e,t)=>(typeof require<`u`?require:e)[t]}):e)(function(e){if(typeof require<`u`)return require.apply(this,arguments);throw Error('Calling `require` for "'+e+"\" in an environment that doesn't expose the `require` function. See https://rolldown.rs/in-depth/bundling-cjs#require-external-modules for more details.")});function g(e){let{className:t,style:n,children:r,defaultClassName:i,defaultChildren:o,defaultStyle:s,values:c,render:l}=e;return a(()=>{let e,a,u;return e=typeof t==`function`?t({...c,defaultClassName:i}):t,a=typeof n==`function`?n({...c,defaultStyle:s||{}}):n,u=typeof r==`function`?r({...c,defaultChildren:o}):r??o,{className:e??i,style:a||s?{...s,...a}:void 0,children:u??o,"data-rac":``,render:l?e=>l(e,c):void 0}},[t,n,r,i,o,s,c,l])}function _(t,n,r){let{render:i,...s}=n,c=o(null),d=a(()=>l(r,c),[r,c]);u(()=>{},[t,i]);let f={...s,ref:d};return i?i(f,void 0):e.createElement(t,f)}const v={},y=new Proxy({},{get(e,t){if(typeof t!=`string`)return;let r=v[t];return r||(r=n(_.bind(null,t)),v[t]=r),r}});String(Math.round(Math.random()*1e10)),typeof window<`u`&&window.document&&window.document.createElement,e.useId;var b=class{get childNodes(){throw Error(`childNodes is not supported`)}clone(){let e=new this.constructor(this.key);return e.value=this.value,e.level=this.level,e.hasChildNodes=this.hasChildNodes,e.rendered=this.rendered,e.textValue=this.textValue,e[`aria-label`]=this[`aria-label`],e.index=this.index,e.parentKey=this.parentKey,e.prevKey=this.prevKey,e.nextKey=this.nextKey,e.firstChildKey=this.firstChildKey,e.lastChildKey=this.lastChildKey,e.props=this.props,e.render=this.render,e.colSpan=this.colSpan,e.colIndex=this.colIndex,e}filter(e,t,n){let r=this.clone();return t.addDescendants(r,e),r}constructor(e){this.value=null,this.level=0,this.hasChildNodes=!1,this.rendered=null,this.textValue=``,this[`aria-label`]=void 0,this.index=0,this.parentKey=null,this.prevKey=null,this.nextKey=null,this.firstChildKey=null,this.lastChildKey=null,this.props={},this.colSpan=null,this.colIndex=null,this.type=this.constructor.type,this.key=e}},x=class extends b{filter(e,t,n){let[r,i]=E(e,t,this.firstChildKey,n),a=this.clone();return a.firstChildKey=r,a.lastChildKey=i,a}},S=class extends b{};S.type=`header`;var C=class extends b{};C.type=`loader`;var w=class extends x{filter(e,t,n){if(n(this.textValue,this)){let n=this.clone();return t.addDescendants(n,e),n}return null}};w.type=`item`;var T=class extends x{filter(e,t,n){let r=super.filter(e,t,n);if(r&&r.lastChildKey!==null){let t=e.getItem(r.lastChildKey);if(t&&t.type!==`header`)return r}return null}};T.type=`section`;function E(e,t,n,r){if(n==null)return[null,null];let i=null,a=null,o=e.getItem(n);for(;o!=null;){let n=o.filter(e,t,r);n!=null&&(n.nextKey=null,a&&(n.prevKey=a.key,a.nextKey=n.key),i??=n,t.addNode(n),a=n),o=o.nextKey?e.getItem(o.nextKey):null}if(a&&a.type===`separator`){let e=a.prevKey;t.removeNode(a.key),e?(a=t.getItem(e),a.nextKey=null):a=null}return[i?.key??null,a?.key??null]}
2
- /**
3
- * @license React
4
- * use-sync-external-store-shim.production.js
5
- *
6
- * Copyright (c) Meta Platforms, Inc. and affiliates.
7
- *
8
- * This source code is licensed under the MIT license found in the
9
- * LICENSE file in the root directory of this source tree.
10
- */
11
- var D=m((e=>{var t=h(`react`);function n(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var r=typeof Object.is==`function`?Object.is:n,i=t.useState,a=t.useEffect,o=t.useLayoutEffect,s=t.useDebugValue;function c(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),c=r[0].inst,u=r[1];return o(function(){c.value=n,c.getSnapshot=t,l(c)&&u({inst:c})},[e,n,t]),a(function(){return l(c)&&u({inst:c}),e(function(){l(c)&&u({inst:c})})},[e]),s(n),n}function l(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch{return!0}}function u(e,t){return t()}var d=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?u:c;e.useSyncExternalStore=t.useSyncExternalStore===void 0?d:t.useSyncExternalStore}));m(((e,t)=>{t.exports=D()}))();const O=t(!1);typeof e.useSyncExternalStore==`function`&&e.useSyncExternalStore;const k=t(null);function A(e){var t;return t=class extends b{},t.type=e,t}function j(t,n,a,o,s,c){typeof t==`string`&&(t=A(t));let l=r(e=>{e?.setProps(n,a,t,o,c)},[n,a,o,c,t]),u=i(k);if(u){let r=u.ownerDocument.nodesByProps.get(n);return r||(r=u.ownerDocument.createElement(t.type),r.setProps(n,a,t,o,c),u.appendChild(r),u.ownerDocument.updateCollection(),u.ownerDocument.nodesByProps.set(n,r)),s?e.createElement(k.Provider,{value:r},s):null}return e.createElement(t.type,{ref:l},s)}function M(t,r){let a=({node:e})=>r(e.props,e.props.ref,e),o=n((n,o)=>{let s=i(f);if(!i(O)){if(r.length>=3)throw Error(r.name+` cannot be rendered outside a collection.`);return r(n,o)}return j(t,n,o,`children`in n?n.children:null,null,t=>e.createElement(f.Provider,{value:s},e.createElement(a,{node:t})))});return o.displayName=r.name,o}const N=t(null),P=M(C,function(t,n,r){let l=i(N),{isLoading:u,onLoadMore:f,scrollOffset:m,...h}=t,_=o(null),v=a(()=>({onLoadMore:f,collection:l?.collection,sentinelRef:_,scrollOffset:m}),[f,m,l?.collection]);d(v,_);let b=g({...h,id:void 0,children:r.rendered,defaultClassName:`react-aria-ListBoxLoadingIndicator`,values:void 0});return e.createElement(e.Fragment,null,e.createElement(`div`,{style:{position:`relative`,width:0,height:0},inert:c(!0)},e.createElement(`div`,{"data-testid":`loadMoreSentinel`,ref:_,style:{position:`absolute`,height:1,width:1}})),u&&b.children&&e.createElement(y.div,{...p(s(t,{global:!0}),{tabIndex:-1}),...b,role:`option`,ref:n},b.children))});export{P as ListBoxLoadMoreItem};
1
+ import e,{createContext as t,forwardRef as n,useCallback as r,useContext as i,useMemo as a,useRef as o}from"react";import{filterDOMProps as s,inertValue as c,mergeRefs as l,useLayoutEffect as u,useLoadMoreSentinel as d}from"@react-aria/utils";import{FocusableContext as f}from"@react-aria/interactions";import"react-dom";import{mergeProps as p}from"react-aria";import"react-stately";function m(e){let{className:t,style:n,children:r,defaultClassName:i,defaultChildren:o,defaultStyle:s,values:c,render:l}=e;return a(()=>{let e,a,u;return e=typeof t==`function`?t({...c,defaultClassName:i}):t,a=typeof n==`function`?n({...c,defaultStyle:s||{}}):n,u=typeof r==`function`?r({...c,defaultChildren:o}):r??o,{className:e??i,style:a||s?{...s,...a}:void 0,children:u??o,"data-rac":``,render:l?e=>l(e,c):void 0}},[t,n,r,i,o,s,c,l])}function h(t,n,r){let{render:i,...s}=n,c=o(null),d=a(()=>l(r,c),[r,c]);u(()=>{},[t,i]);let f={...s,ref:d};return i?i(f,void 0):e.createElement(t,f)}const g={},_=new Proxy({},{get(e,t){if(typeof t!=`string`)return;let r=g[t];return r||(r=n(h.bind(null,t)),g[t]=r),r}});String(Math.round(Math.random()*1e10)),typeof window<`u`&&window.document&&window.document.createElement,e.useId;var v=class{get childNodes(){throw Error(`childNodes is not supported`)}clone(){let e=new this.constructor(this.key);return e.value=this.value,e.level=this.level,e.hasChildNodes=this.hasChildNodes,e.rendered=this.rendered,e.textValue=this.textValue,e[`aria-label`]=this[`aria-label`],e.index=this.index,e.parentKey=this.parentKey,e.prevKey=this.prevKey,e.nextKey=this.nextKey,e.firstChildKey=this.firstChildKey,e.lastChildKey=this.lastChildKey,e.props=this.props,e.render=this.render,e.colSpan=this.colSpan,e.colIndex=this.colIndex,e}filter(e,t,n){let r=this.clone();return t.addDescendants(r,e),r}constructor(e){this.value=null,this.level=0,this.hasChildNodes=!1,this.rendered=null,this.textValue=``,this[`aria-label`]=void 0,this.index=0,this.parentKey=null,this.prevKey=null,this.nextKey=null,this.firstChildKey=null,this.lastChildKey=null,this.props={},this.colSpan=null,this.colIndex=null,this.type=this.constructor.type,this.key=e}},y=class extends v{filter(e,t,n){let[r,i]=w(e,t,this.firstChildKey,n),a=this.clone();return a.firstChildKey=r,a.lastChildKey=i,a}},b=class extends v{};b.type=`header`;var x=class extends v{};x.type=`loader`;var S=class extends y{filter(e,t,n){if(n(this.textValue,this)){let n=this.clone();return t.addDescendants(n,e),n}return null}};S.type=`item`;var C=class extends y{filter(e,t,n){let r=super.filter(e,t,n);if(r&&r.lastChildKey!==null){let t=e.getItem(r.lastChildKey);if(t&&t.type!==`header`)return r}return null}};C.type=`section`;function w(e,t,n,r){if(n==null)return[null,null];let i=null,a=null,o=e.getItem(n);for(;o!=null;){let n=o.filter(e,t,r);n!=null&&(n.nextKey=null,a&&(n.prevKey=a.key,a.nextKey=n.key),i??=n,t.addNode(n),a=n),o=o.nextKey?e.getItem(o.nextKey):null}if(a&&a.type===`separator`){let e=a.prevKey;t.removeNode(a.key),e?(a=t.getItem(e),a.nextKey=null):a=null}return[i?.key??null,a?.key??null]}const T=t(!1);typeof e.useSyncExternalStore==`function`&&e.useSyncExternalStore;const E=t(null);function D(e){var t;return t=class extends v{},t.type=e,t}function O(t,n,a,o,s,c){typeof t==`string`&&(t=D(t));let l=r(e=>{e?.setProps(n,a,t,o,c)},[n,a,o,c,t]),u=i(E);if(u){let r=u.ownerDocument.nodesByProps.get(n);return r||(r=u.ownerDocument.createElement(t.type),r.setProps(n,a,t,o,c),u.appendChild(r),u.ownerDocument.updateCollection(),u.ownerDocument.nodesByProps.set(n,r)),s?e.createElement(E.Provider,{value:r},s):null}return e.createElement(t.type,{ref:l},s)}function k(t,r){let a=({node:e})=>r(e.props,e.props.ref,e),o=n((n,o)=>{let s=i(f);if(!i(T)){if(r.length>=3)throw Error(r.name+` cannot be rendered outside a collection.`);return r(n,o)}return O(t,n,o,`children`in n?n.children:null,null,t=>e.createElement(f.Provider,{value:s},e.createElement(a,{node:t})))});return o.displayName=r.name,o}const A=t(null),j=k(x,function(t,n,r){let l=i(A),{isLoading:u,onLoadMore:f,scrollOffset:h,...g}=t,v=o(null),y=a(()=>({onLoadMore:f,collection:l?.collection,sentinelRef:v,scrollOffset:h}),[f,h,l?.collection]);d(y,v);let b=m({...g,id:void 0,children:r.rendered,defaultClassName:`react-aria-ListBoxLoadingIndicator`,values:void 0});return e.createElement(e.Fragment,null,e.createElement(`div`,{style:{position:`relative`,width:0,height:0},inert:c(!0)},e.createElement(`div`,{"data-testid":`loadMoreSentinel`,ref:v,style:{position:`absolute`,height:1,width:1}})),u&&b.children&&e.createElement(_.div,{...p(s(t,{global:!0}),{tabIndex:-1}),...b,role:`option`,ref:n},b.children))});export{j as ListBoxLoadMoreItem};