@radui/ui 0.0.43 → 0.0.45
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/Accordion.js +1 -1
- package/dist/components/AlertDialog.js +2 -2
- package/dist/components/Avatar.js +1 -1
- package/dist/components/AvatarGroup.js +1 -1
- package/dist/components/Button.js +1 -1
- package/dist/components/Callout.js +1 -1
- package/dist/components/Checkbox.js +1 -0
- package/dist/components/CheckboxCards.js +1 -0
- package/dist/components/CheckboxGroup.js +1 -0
- package/dist/components/Collapsible.js +1 -1
- package/dist/components/Dialog.js +5 -0
- package/dist/components/Disclosure.js +1 -1
- package/dist/components/HoverCard.js +1 -1
- package/dist/components/Link.js +1 -1
- package/dist/components/Progress.js +1 -1
- package/dist/components/Radio.js +1 -0
- package/dist/components/RadioCards.js +1 -1
- package/dist/components/RadioGroup.js +1 -1
- package/dist/components/ScrollArea.js +1 -1
- package/dist/components/Select.js +5 -0
- package/dist/components/Slider.js +1 -0
- package/dist/components/Switch.js +1 -1
- package/dist/components/TabNav.js +1 -1
- package/dist/components/Tabs.js +1 -1
- package/dist/components/Toggle.js +1 -1
- package/dist/components/ToggleGroup.js +1 -1
- package/dist/components/Tooltip.js +1 -1
- package/dist/components/Tree.js +1 -1
- package/dist/components/VisuallyHidden.js +1 -1
- package/dist/themes/default.css +1 -1
- package/package.json +12 -4
- package/dist/components/Modal.js +0 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
'use client';import e,{createContext as n,useState as t,useRef as r,useEffect as i,useCallback as o,useId as a,forwardRef as l,useContext as c}from"react";function u(e){var n,t,r="";if("string"==typeof e||"number"==typeof e)r+=e;else if("object"==typeof e)if(Array.isArray(e)){var i=e.length;for(n=0;n<i;n++)e[n]&&(t=u(e[n]))&&(r&&(r+=" "),r+=t)}else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function d(){for(var e,n,t=0,r="",i=arguments.length;t<i;t++)(e=arguments[t])&&(n=u(e))&&(r&&(r+=" "),r+=n);return r}var s=n({rootClass:"",activeItems:[],setActiveItems:function(){},accordionRef:void 0,transitionDuration:0,transitionTimingFunction:"ease-out",openMultiple:!1});function f(e,n,a){var l=t(n),c=l[0],u=l[1],d=void 0!==e,s=d?e:c,f=r(d),v=r(e);i((function(){"production"!==process.env.NODE_ENV&&(f.current!==d&&console.warn("Component changed from ".concat(f.current?"controlled":"uncontrolled"," to ").concat(d?"controlled":"uncontrolled",".")),f.current=d)}),[d]),i((function(){"production"!==process.env.NODE_ENV&&d&&!a&&e!==v.current&&console.warn("A component is changing a controlled value without an onChange handler. This will render a controlled component as uncontrolled."),v.current=e}),[e,d,a]);var m=o((function(e){var n="function"==typeof e?e(s):e;d||u(n),a&&a(n)}),[d,a,s]);return[s,m]}var v=function(){return v=Object.assign||function(e){for(var n,t=1,r=arguments.length;t<r;t++)for(var i in n=arguments[t])Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i]);return e},v.apply(this,arguments)};function m(e,n){var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&n.indexOf(r)<0&&(t[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)n.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(t[r[i]]=e[r[i]])}return t}function p(e,n,t){if(t||2===arguments.length)for(var r,i=0,o=n.length;i<o;i++)!r&&i in n||(r||(r=Array.prototype.slice.call(n,0,i)),r[i]=n[i]);return e.concat(r||Array.prototype.slice.call(n))}"function"==typeof SuppressedError&&SuppressedError;var b=["div","span","button","input","a","img","p","h2"].reduce((function(n,t){return n[t]=function(n){var t=e.forwardRef((function(t,r){var i=t.asChild,o=void 0!==i&&i,a=t.children,l=m(t,["asChild","children"]);if(o){var c=e.Children.toArray(a);if(1!==c.length||!e.isValidElement(c[0]))return console.warn("Primitive.".concat(n,": asChild prop requires exactly one valid child element.")),e.createElement(n,v(v({},l),{ref:r}),a);var u=c[0];return e.cloneElement(u,v(v(v({},l),u.props),r?{ref:function(e){"function"==typeof r?r(e):r&&(r.current=e);var n=u.ref;"function"==typeof n?n(e):n&&(n.current=e)}}:{}))}return e.createElement(n,v(v({},l),{ref:r}),a)}));return t.displayName="Primitive.".concat(n),t}(t),n}),{}),h=n({orientation:"horizontal",loop:!0,disableTabIndexing:!1}),g=n({focusedItemId:null,setFocusedItemId:function(){},focusItems:[],setFocusItems:function(){},addFocusItem:function(){},groupRef:null}),C=l((function(n,t){var r,o=n.children,l=n["aria-label"],u=n["aria-labelledby"],d=n.role,s=void 0===d?"button":d,f=m(n,["children","aria-label","aria-labelledby","role"]),p=a(),C=c(g),y=C.focusedItemId,I=C.setFocusedItemId,E=C.addFocusItem,w=C.focusItems,A=C.groupRef,T=c(h),F=T.orientation,D=T.loop,O=T.disableTabIndexing,N=e.Children.toArray(o)[0],x=!0===(null===(r=null==N?void 0:N.props)||void 0===r?void 0:r.disabled),P=y===p,R=O||!x&&P?0:-1;i((function(){w.includes(p)||E(p)}),[w,y,p,E]);var V=function(e){if(A&&A.current){I(e);var n=CSS.escape(e),t=A.current.querySelector("#".concat(n));t&&t.focus()}},S=function(e,n){for(var t,r=e,i=0;i<w.length;i++){if(r+=n,D)r<0&&(r=w.length-1),r>=w.length&&(r=0);else if(r<0||r>=w.length)return-1;var o=w[r],a=null===(t=null==A?void 0:A.current)||void 0===t?void 0:t.querySelector("#".concat(CSS.escape(o)));if(a)if(!("true"===a.getAttribute("data-child-disabled")))return r}return-1},k=function(){var e=w.indexOf(p),n=S(e,-1);-1!==n&&V(w[n])},j=function(){var e=w.indexOf(p),n=S(e,1);-1!==n&&V(w[n])};return e.createElement(b.button,v({asChild:!0,onFocus:function(e){e.preventDefault(),x&&e.target.blur(),x||I(p)},tabIndex:R,ref:t,id:p,onKeyDown:function(e){if(!x)switch(e.key){case"ArrowUp":e.preventDefault(),"vertical"===F&&k();break;case"ArrowLeft":e.preventDefault(),"horizontal"===F&&k();break;case"ArrowDown":e.preventDefault(),"vertical"===F&&j();break;case"ArrowRight":e.preventDefault(),"horizontal"===F&&j();break;case"Home":e.preventDefault(),function(){if(w.length>0){var e=S(-1,1);-1!==e&&V(w[e])}}();break;case"End":e.preventDefault(),function(){if(w.length>0){var e=S(w.length,-1);-1!==e&&V(w[e])}}()}},"data-child-disabled":x,role:s,"aria-selected":P,"aria-disabled":x,"aria-label":l,"aria-labelledby":u},f),o)}));C.displayName="RovingFocusItem";var y={Root:function(n){var t=n.children,r=n.orientation,i=void 0===r?"horizontal":r,o=n.loop,a=void 0===o||o,l=n["aria-label"],c=n["aria-labelledby"],u=n.disableTabIndexing,d=void 0!==u&&u,s=m(n,["children","orientation","loop","aria-label","aria-labelledby","disableTabIndexing"]),f={orientation:i,loop:a,disableTabIndexing:d};return e.createElement(h.Provider,{value:f},e.createElement(b.div,v({role:"listbox","aria-orientation":i,"aria-label":l,"aria-labelledby":c},s),t))},Group:function(n){var o=n.children,l=n["aria-label"],c=n["aria-labelledby"],u=m(n,["children","aria-label","aria-labelledby"]),d=r(null),s=t([]),f=s[0],h=s[1],C=t(null),y=C[0],I=C[1],E=a();i((function(){!y&&f.length>0&&I(f[0])}),[f,y]);var w={focusedItemId:y,setFocusedItemId:I,focusItems:f,setFocusItems:h,addFocusItem:function(e){h((function(n){return p(p([],n,!0),[e],!1)}))},groupRef:d};return e.createElement(g.Provider,{value:w},e.createElement(b.div,v({id:E,ref:d,role:"group","aria-label":l,"aria-labelledby":c},u),o))},Item:C},I=n({itemValue:0,setItemValue:function(){},disabled:!1}),E=n(void 0),w=function(){var e=c(E);if(!e)throw new Error("Collapsible compound components must be used within a CollapsiblePrimitive.Root component");return e},A=e.forwardRef((function(n,o){var a=n.children,l=n.className;n.asChild;var c=m(n,["children","className","asChild"]),u=w(),d=u.open,s=u.contentId,f=u.transitionDuration,p=u.transitionTimingFunction,h=r(null),g=o||h,C=t(d?void 0:0),y=C[0],I=C[1],E=t(d),A=E[0],T=E[1],F=r(),D=r();return i((function(){d&&T(!0)}),[d]),i((function(){if(F.current&&clearTimeout(F.current),D.current&&cancelAnimationFrame(D.current),h.current){if(0===f)return I(d?void 0:0),void(d||setTimeout((function(){return T(!1)}),0));if(d)I(0),D.current=requestAnimationFrame((function(){var e;null===(e=h.current)||void 0===e||e.offsetHeight,D.current=requestAnimationFrame((function(){if(h.current){var e=h.current.scrollHeight;I(e)}}))})),F.current=setTimeout((function(){I(void 0)}),f);else{var e=h.current.scrollHeight;I(e),D.current=requestAnimationFrame((function(){var e;null===(e=h.current)||void 0===e||e.offsetHeight,D.current=requestAnimationFrame((function(){I(0)}))})),F.current=setTimeout((function(){T(!1)}),f)}return function(){F.current&&clearTimeout(F.current),D.current&&cancelAnimationFrame(D.current)}}}),[d,f]),A||d?e.createElement(b.div,v({id:s,ref:g,"aria-hidden":!d,"data-state":d?"open":"closed",className:l,style:v({height:void 0!==y?"".concat(y,"px"):void 0,overflow:"hidden"},f>0?{transition:"height ".concat(f,"ms ").concat(p)}:{})},c),a):null}));A.displayName="CollapsiblePrimitiveContent";var T=e.forwardRef((function(n,t){var r=n.children,i=n.asChild,o=void 0!==i&&i,a=m(n,["children","asChild"]),l=w(),c=l.open,u=l.onOpenChange,d=l.disabled,s=l.contentId;return e.createElement(b.button,v({"aria-controls":s,"aria-expanded":c,"data-state":c?"open":"closed","data-disabled":d?"true":void 0,ref:t,onClick:function(e){var n;null===(n=a.onClick)||void 0===n||n.call(a,e),d||u(!c)},asChild:o},a),r)}));T.displayName="CollapsiblePrimitiveTrigger";var F=function(){return console.warn("Direct usage of CollapsiblePrimitive is not supported. Please use CollapsiblePrimitive.Root, CollapsiblePrimitive.Content, etc. instead."),null};F.Root=function(n){var t=n.children,r=n.defaultOpen,i=void 0!==r&&r,o=n.open,l=n.onOpenChange,c=n.disabled,u=void 0!==c&&c,d=n.transitionDuration,s=void 0===d?300:d,p=n.transitionTimingFunction,h=void 0===p?"linear":p,g=m(n,["children","defaultOpen","open","onOpenChange","disabled","transitionDuration","transitionTimingFunction"]),C=a(),y=f(o,i,l),I=y[0],w=y[1];return e.createElement(E.Provider,{value:{open:I,onOpenChange:function(e){u||w(e)},disabled:u,contentId:C,transitionDuration:s,transitionTimingFunction:h}},e.createElement(b.div,v({},g,{"data-state":I?"open":"closed","data-disabled":u?"":void 0}),t))},F.Content=A,F.Trigger=T;var D=function(){return console.warn("Direct usage of Accordion is not supported. Please use Accordion.Root, Accordion.Item, etc. instead."),null};D.Root=function(n){var t=n.children,i=n.orientation,o=void 0===i?"vertical":i,a=n.disableTabIndexing,l=void 0===a||a,c=n.asChild,u=n.transitionDuration,v=void 0===u?0:u,m=n.transitionTimingFunction,p=void 0===m?"linear":m,h=n.customRootClass,g=n.loop,C=void 0===g||g,I=n.openMultiple,E=void 0!==I&&I,w=n.value,A=n.defaultValue,T=void 0===A?[]:A,F=n.onValueChange,D=r(null),O=function(e,n){void 0===e&&(e="");var t=n.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();return e?"".concat(e,"-").concat(t):"".concat("rad-ui","-").concat(t)}(h,"Accordion"),N=f(void 0!==w?E?w:w.length>0?[w[0]]:[]:void 0,E?T:T.length>0?[T[0]]:[],F),x=N[0],P=N[1];return e.createElement(s.Provider,{value:{rootClass:O,activeItems:x,setActiveItems:P,accordionRef:D,transitionDuration:v,transitionTimingFunction:p,openMultiple:E}},e.createElement(y.Root,{orientation:o,loop:C,disableTabIndexing:l},e.createElement(y.Group,null,e.createElement(b.div,{className:d("".concat(O,"-root")),ref:D,asChild:c},t))))},D.Item=function(n){var o=n.children,l=n.value,u=n.className,f=void 0===u?"":u,p=n.disabled,h=void 0!==p&&p;n.asChild;var g=m(n,["children","value","className","disabled","asChild"]),C=r(null),y=t(null!=l?l:0),E=y[0],w=y[1],A=c(s),T=A.rootClass,D=A.activeItems,O=A.transitionDuration,N=A.transitionTimingFunction,x=t(D.includes(E)),P=x[0],R=x[1];i((function(){R(D.includes(E))}),[D,E]);var V=a();return i((function(){void 0!==l&&l!==E&&w(l)}),[l]),e.createElement(I.Provider,{value:{itemValue:E,setItemValue:w,disabled:h}},e.createElement(F.Root,{open:P,disabled:h,transitionDuration:O,transitionTimingFunction:N,asChild:!0},e.createElement(b.div,v({ref:C,className:d("".concat(T,"-item"),f)},g,{id:"accordion-data-item-".concat(V),role:"region","data-state":P?"open":"closed"}),o)))},D.Header=function(n){var t=n.children,r=n.className,i=void 0===r?"":r,o=c(s).rootClass;return e.createElement("div",{className:d("".concat(o,"-header"),i)},t)},D.Trigger=function(n){var t=n.children,i=n.index,o=n.className,a=void 0===o?"":o,l=r(null),u=c(s),f=u.setActiveItems,v=u.rootClass,m=u.activeItems,h=u.openMultiple,g=c(I),C=g.itemValue,E=g.disabled;return e.createElement(y.Item,null,e.createElement(F.Trigger,{disabled:E,asChild:!0},e.createElement(b.button,{className:d("".concat(v,"-trigger"),a),ref:l,"aria-disabled":E,onClick:function(e){var n=m||[];h?n.includes(C)?f(n.filter((function(e){return e!==C}))):f(p(p([],n,!0),[C],!1)):n.includes(C)?f([]):f([C])},"aria-expanded":m.includes(C),"aria-controls":"content-".concat(i)},t)))},D.Content=function(n){var t=n.children,r=n.index,i=n.className,o=void 0===i?"":i,a=c(s),l=a.activeItems,u=a.rootClass,f=c(I).itemValue,v=l.includes(f);return v?e.createElement(F.Content,{asChild:!0,className:d("".concat(u,"-content"),o),id:"content-".concat(r),role:"region","aria-labelledby":"section-".concat(r),"aria-hidden":!v},t):null};export{D as default};
|
|
1
|
+
'use client';import e,{createContext as n,useState as t,useRef as r,useEffect as i,useCallback as o,useId as a,forwardRef as l,useContext as c}from"react";function u(e){var n,t,r="";if("string"==typeof e||"number"==typeof e)r+=e;else if("object"==typeof e)if(Array.isArray(e)){var i=e.length;for(n=0;n<i;n++)e[n]&&(t=u(e[n]))&&(r&&(r+=" "),r+=t)}else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function d(){for(var e,n,t=0,r="",i=arguments.length;t<i;t++)(e=arguments[t])&&(n=u(e))&&(r&&(r+=" "),r+=n);return r}var s=n({rootClass:"",activeItems:[],setActiveItems:function(){},accordionRef:void 0,transitionDuration:0,transitionTimingFunction:"ease-out",openMultiple:!1});function f(e,n,a){var l=t(n),c=l[0],u=l[1],d=void 0!==e,s=d?e:c,f=r(d),v=r(e);i((function(){"production"!==process.env.NODE_ENV&&(f.current!==d&&console.warn("Component changed from ".concat(f.current?"controlled":"uncontrolled"," to ").concat(d?"controlled":"uncontrolled",".")),f.current=d)}),[d]),i((function(){"production"!==process.env.NODE_ENV&&d&&!a&&e!==v.current&&console.warn("A component is changing a controlled value without an onChange handler. This will render a controlled component as uncontrolled."),v.current=e}),[e,d,a]);var m=o((function(e){var n="function"==typeof e?e(s):e;d||u(n),a&&a(n)}),[d,a,s]);return[s,m]}var v=function(){return v=Object.assign||function(e){for(var n,t=1,r=arguments.length;t<r;t++)for(var i in n=arguments[t])Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i]);return e},v.apply(this,arguments)};function m(e,n){var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&n.indexOf(r)<0&&(t[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)n.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(t[r[i]]=e[r[i]])}return t}function p(e,n,t){if(t||2===arguments.length)for(var r,i=0,o=n.length;i<o;i++)!r&&i in n||(r||(r=Array.prototype.slice.call(n,0,i)),r[i]=n[i]);return e.concat(r||Array.prototype.slice.call(n))}"function"==typeof SuppressedError&&SuppressedError;var b=["div","span","button","input","a","img","p","h2","label"].reduce((function(n,t){return n[t]=function(n){var t=e.forwardRef((function(t,r){var i=t.asChild,o=void 0!==i&&i,a=t.children,l=m(t,["asChild","children"]);if(o){var c=e.Children.toArray(a);if(1!==c.length||!e.isValidElement(c[0]))return console.warn("Primitive.".concat(n,": asChild prop requires exactly one valid child element.")),e.createElement(n,v(v({},l),{ref:r}),a);var u=c[0];return e.cloneElement(u,v(v(v({},l),u.props),r?{ref:function(e){"function"==typeof r?r(e):r&&(r.current=e);var n=u.ref;"function"==typeof n?n(e):n&&(n.current=e)}}:{}))}return e.createElement(n,v(v({},l),{ref:r}),a)}));return t.displayName="Primitive.".concat(n),t}(t),n}),{}),h=n({orientation:"horizontal",loop:!0,dir:"ltr",disableTabIndexing:!1}),g=n({focusedItemId:null,setFocusedItemId:function(){},focusItems:[],setFocusItems:function(){},addFocusItem:function(){},groupRef:null}),C=l((function(n,t){var r,o=n.children,l=n["aria-label"],u=n["aria-labelledby"],d=n.role,s=void 0===d?"button":d,f=m(n,["children","aria-label","aria-labelledby","role"]),p=a(),C=c(g),y=C.focusedItemId,I=C.setFocusedItemId,E=C.addFocusItem,w=C.focusItems,A=C.groupRef,T=c(h),F=T.orientation,D=T.loop,O=T.disableTabIndexing,N=T.dir,x=e.Children.toArray(o)[0],P=!0===(null===(r=null==x?void 0:x.props)||void 0===r?void 0:r.disabled),R=y===p,V=O||!P&&R?0:-1;i((function(){w.includes(p)||E(p)}),[w,y,p,E]);var S=function(e){if(A&&A.current){I(e);var n=CSS.escape(e),t=A.current.querySelector("#".concat(n));t&&t.focus()}},k=function(e,n){for(var t,r=e,i=0;i<w.length;i++){if(r+=n,D)r<0&&(r=w.length-1),r>=w.length&&(r=0);else if(r<0||r>=w.length)return-1;var o=w[r],a=null===(t=null==A?void 0:A.current)||void 0===t?void 0:t.querySelector("#".concat(CSS.escape(o)));if(a)if(!("true"===a.getAttribute("data-child-disabled")))return r}return-1},j=function(){var e=w.indexOf(p),n=k(e,-1);-1!==n&&S(w[n])},q=function(){var e=w.indexOf(p),n=k(e,1);-1!==n&&S(w[n])};return e.createElement(b.button,v({asChild:!0,onFocus:function(e){e.preventDefault(),P&&e.target.blur(),P||I(p)},tabIndex:V,ref:t,id:p,onKeyDown:function(e){if(!P)switch(e.key){case"ArrowUp":e.preventDefault(),"vertical"!==F&&"both"!==F||j();break;case"ArrowLeft":e.preventDefault(),"horizontal"!==F&&"both"!==F||("rtl"===N?q():j());break;case"ArrowDown":e.preventDefault(),"vertical"!==F&&"both"!==F||q();break;case"ArrowRight":e.preventDefault(),"horizontal"!==F&&"both"!==F||("rtl"===N?j():q());break;case"Home":e.preventDefault(),function(){if(w.length>0){var e=k(-1,1);-1!==e&&S(w[e])}}();break;case"End":e.preventDefault(),function(){if(w.length>0){var e=k(w.length,-1);-1!==e&&S(w[e])}}()}},"data-child-disabled":P,role:s,"aria-selected":R,"aria-disabled":P,"aria-label":l,"aria-labelledby":u},f),o)}));C.displayName="RovingFocusItem";var y={Root:function(n){var t=n.children,r=n.orientation,i=void 0===r?"horizontal":r,o=n.loop,a=void 0===o||o,l=n["aria-label"],c=n["aria-labelledby"],u=n.disableTabIndexing,d=void 0!==u&&u,s=n.dir,f=void 0===s?"ltr":s,p=m(n,["children","orientation","loop","aria-label","aria-labelledby","disableTabIndexing","dir"]),g={orientation:i,loop:a,disableTabIndexing:d,dir:f};return e.createElement(h.Provider,{value:g},e.createElement(b.div,v({role:"listbox","aria-orientation":"both"===i?void 0:i,"aria-label":l,"aria-labelledby":c},p),t))},Group:function(n){var o=n.children,l=n["aria-label"],c=n["aria-labelledby"],u=m(n,["children","aria-label","aria-labelledby"]),d=r(null),s=t([]),f=s[0],h=s[1],C=t(null),y=C[0],I=C[1],E=a();i((function(){!y&&f.length>0&&I(f[0])}),[f,y]);var w={focusedItemId:y,setFocusedItemId:I,focusItems:f,setFocusItems:h,addFocusItem:function(e){h((function(n){return p(p([],n,!0),[e],!1)}))},groupRef:d};return e.createElement(g.Provider,{value:w},e.createElement(b.div,v({id:E,ref:d,role:"group","aria-label":l,"aria-labelledby":c},u),o))},Item:C},I=n({itemValue:0,setItemValue:function(){},disabled:!1}),E=n(void 0),w=function(){var e=c(E);if(!e)throw new Error("Collapsible compound components must be used within a CollapsiblePrimitive.Root component");return e},A=e.forwardRef((function(n,o){var a=n.children,l=n.className;n.asChild;var c=m(n,["children","className","asChild"]),u=w(),d=u.open,s=u.contentId,f=u.transitionDuration,p=u.transitionTimingFunction,h=r(null),g=o||h,C=t(d?void 0:0),y=C[0],I=C[1],E=t(d),A=E[0],T=E[1],F=r(),D=r();return i((function(){d&&T(!0)}),[d]),i((function(){if(F.current&&clearTimeout(F.current),D.current&&cancelAnimationFrame(D.current),h.current){if(0===f)return I(d?void 0:0),void(d||setTimeout((function(){return T(!1)}),0));if(d)I(0),D.current=requestAnimationFrame((function(){var e;null===(e=h.current)||void 0===e||e.offsetHeight,D.current=requestAnimationFrame((function(){if(h.current){var e=h.current.scrollHeight;I(e)}}))})),F.current=setTimeout((function(){I(void 0)}),f);else{var e=h.current.scrollHeight;I(e),D.current=requestAnimationFrame((function(){var e;null===(e=h.current)||void 0===e||e.offsetHeight,D.current=requestAnimationFrame((function(){I(0)}))})),F.current=setTimeout((function(){T(!1)}),f)}return function(){F.current&&clearTimeout(F.current),D.current&&cancelAnimationFrame(D.current)}}}),[d,f]),A||d?e.createElement(b.div,v({id:s,ref:g,"aria-hidden":!d,"data-state":d?"open":"closed",className:l,style:v({height:void 0!==y?"".concat(y,"px"):void 0,overflow:"hidden"},f>0?{transition:"height ".concat(f,"ms ").concat(p)}:{})},c),a):null}));A.displayName="CollapsiblePrimitiveContent";var T=e.forwardRef((function(n,t){var r=n.children,i=n.asChild,o=void 0!==i&&i,a=m(n,["children","asChild"]),l=w(),c=l.open,u=l.onOpenChange,d=l.disabled,s=l.contentId;return e.createElement(b.button,v({"aria-controls":s,"aria-expanded":c,"data-state":c?"open":"closed","data-disabled":d?"true":void 0,ref:t,onClick:function(e){var n;null===(n=a.onClick)||void 0===n||n.call(a,e),d||u(!c)},asChild:o},a),r)}));T.displayName="CollapsiblePrimitiveTrigger";var F=function(){return console.warn("Direct usage of CollapsiblePrimitive is not supported. Please use CollapsiblePrimitive.Root, CollapsiblePrimitive.Content, etc. instead."),null};F.Root=function(n){var t=n.children,r=n.defaultOpen,i=void 0!==r&&r,o=n.open,l=n.onOpenChange,c=n.disabled,u=void 0!==c&&c,d=n.transitionDuration,s=void 0===d?300:d,p=n.transitionTimingFunction,h=void 0===p?"linear":p,g=m(n,["children","defaultOpen","open","onOpenChange","disabled","transitionDuration","transitionTimingFunction"]),C=a(),y=f(o,i,l),I=y[0],w=y[1];return e.createElement(E.Provider,{value:{open:I,onOpenChange:function(e){u||w(e)},disabled:u,contentId:C,transitionDuration:s,transitionTimingFunction:h}},e.createElement(b.div,v({},g,{"data-state":I?"open":"closed","data-disabled":u?"":void 0}),t))},F.Content=A,F.Trigger=T;var D=function(){return console.warn("Direct usage of Accordion is not supported. Please use Accordion.Root, Accordion.Item, etc. instead. "),null};D.Root=function(n){var t=n.children,i=n.orientation,o=void 0===i?"vertical":i,a=n.disableTabIndexing,l=void 0===a||a,c=n.asChild,u=n.transitionDuration,v=void 0===u?0:u,m=n.transitionTimingFunction,p=void 0===m?"linear":m,h=n.customRootClass,g=n.loop,C=void 0===g||g,I=n.openMultiple,E=void 0!==I&&I,w=n.value,A=n.defaultValue,T=void 0===A?[]:A,F=n.onValueChange,D=r(null),O=function(e,n){void 0===e&&(e="");var t=n.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();return e?"".concat(e,"-").concat(t):"".concat("rad-ui","-").concat(t)}(h,"Accordion"),N=f(void 0!==w?E?w:w.length>0?[w[0]]:[]:void 0,E?T:T.length>0?[T[0]]:[],F),x=N[0],P=N[1];return e.createElement(s.Provider,{value:{rootClass:O,activeItems:x,setActiveItems:P,accordionRef:D,transitionDuration:v,transitionTimingFunction:p,openMultiple:E}},e.createElement(y.Root,{orientation:o,loop:C,disableTabIndexing:l},e.createElement(y.Group,null,e.createElement(b.div,{className:d("".concat(O,"-root")),ref:D,asChild:c},t))))},D.Item=function(n){var o=n.children,l=n.value,u=n.className,f=void 0===u?"":u,p=n.disabled,h=void 0!==p&&p;n.asChild;var g=m(n,["children","value","className","disabled","asChild"]),C=r(null),y=t(null!=l?l:0),E=y[0],w=y[1],A=c(s),T=A.rootClass,D=A.activeItems,O=A.transitionDuration,N=A.transitionTimingFunction,x=t(D.includes(E)),P=x[0],R=x[1];i((function(){R(D.includes(E))}),[D,E]);var V=a();return i((function(){void 0!==l&&l!==E&&w(l)}),[l]),e.createElement(I.Provider,{value:{itemValue:E,setItemValue:w,disabled:h}},e.createElement(F.Root,{open:P,disabled:h,transitionDuration:O,transitionTimingFunction:N,asChild:!0},e.createElement(b.div,v({ref:C,className:d("".concat(T,"-item"),f)},g,{id:"accordion-data-item-".concat(V),role:"region","data-state":P?"open":"closed"}),o)))},D.Header=function(n){var t=n.children,r=n.className,i=void 0===r?"":r,o=c(s).rootClass;return e.createElement("div",{className:d("".concat(o,"-header"),i)},t)},D.Trigger=function(n){var t=n.children,i=n.index,o=n.className,a=void 0===o?"":o,l=r(null),u=c(s),f=u.setActiveItems,v=u.rootClass,m=u.activeItems,h=u.openMultiple,g=c(I),C=g.itemValue,E=g.disabled;return e.createElement(y.Item,null,e.createElement(F.Trigger,{disabled:E,asChild:!0},e.createElement(b.button,{className:d("".concat(v,"-trigger"),a),ref:l,"aria-disabled":E,onClick:function(e){var n=m||[];h?n.includes(C)?f(n.filter((function(e){return e!==C}))):f(p(p([],n,!0),[C],!1)):n.includes(C)?f([]):f([C])},"aria-expanded":m.includes(C),"aria-controls":"content-".concat(i)},t)))},D.Content=function(n){var t=n.children,r=n.index,i=n.className,o=void 0===i?"":i,a=c(s),l=a.activeItems,u=a.rootClass,f=c(I).itemValue,v=l.includes(f);return v?e.createElement(F.Content,{asChild:!0,className:d("".concat(u,"-content"),o),id:"content-".concat(r),role:"region","aria-labelledby":"section-".concat(r),"aria-hidden":!v},t):null};export{D as default};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
'use client';import*as e from"react";import t,{createContext as n,useLayoutEffect as r,useEffect as o,useRef as i,useState as l,useContext as
|
|
1
|
+
'use client';import*as e from"react";import t,{createContext as n,useLayoutEffect as r,useEffect as o,useRef as i,useState as c,forwardRef as l,useContext as a}from"react";import{jsxs as u,jsx as s,Fragment as f}from"react/jsx-runtime";import*as d from"react-dom";var p=function(){return p=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},p.apply(this,arguments)};function m(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}"function"==typeof SuppressedError&&SuppressedError;var v=n({rootClass:""});function h(e){var t,n,r="";if("string"==typeof e||"number"==typeof e)r+=e;else if("object"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=h(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function g(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=h(e))&&(r&&(r+=" "),r+=t);return r}var y=n({isOpen:!1,handleOpenChange:function(){},handleOverlayClick:function(){},getItemProps:function(){},getReferenceProps:function(){},getFloatingProps:function(){},refs:{setReference:function(){},setFloating:function(){}},floatingStyles:{position:"absolute"}});function w(){return"undefined"!=typeof window}function b(e){return R(e)?(e.nodeName||"").toLowerCase():"#document"}function E(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function x(e){var t;return null==(t=(R(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function R(e){return!!w()&&(e instanceof Node||e instanceof E(e).Node)}function C(e){return!!w()&&(e instanceof Element||e instanceof E(e).Element)}function S(e){return!!w()&&(e instanceof HTMLElement||e instanceof E(e).HTMLElement)}function k(e){return!(!w()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof E(e).ShadowRoot)}function L(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=N(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function O(e){return["table","td","th"].includes(b(e))}function P(e){return[":popover-open",":modal"].some((t=>{try{return e.matches(t)}catch(e){return!1}}))}function T(e){const t=A(),n=C(e)?N(e):e;return["transform","translate","scale","rotate","perspective"].some((e=>!!n[e]&&"none"!==n[e]))||!!n.containerType&&"normal"!==n.containerType||!t&&!!n.backdropFilter&&"none"!==n.backdropFilter||!t&&!!n.filter&&"none"!==n.filter||["transform","translate","scale","rotate","perspective","filter"].some((e=>(n.willChange||"").includes(e)))||["paint","layout","strict","content"].some((e=>(n.contain||"").includes(e)))}function A(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function M(e){return["html","body","#document"].includes(b(e))}function N(e){return E(e).getComputedStyle(e)}function D(e){return C(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function I(e){if("html"===b(e))return e;const t=e.assignedSlot||e.parentNode||k(e)&&e.host||x(e);return k(t)?t.host:t}function F(e){const t=I(e);return M(t)?e.ownerDocument?e.ownerDocument.body:e.body:S(t)&&L(t)?t:F(t)}function W(e,t,n){var r;void 0===t&&(t=[]),void 0===n&&(n=!0);const o=F(e),i=o===(null==(r=e.ownerDocument)?void 0:r.body),c=E(o);if(i){const e=B(c);return t.concat(c,c.visualViewport||[],L(o)?o:[],e&&n?W(e):[])}return t.concat(o,W(o,[],n))}function B(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function j(e){let t=e.activeElement;for(;null!=(null==(n=t)||null==(n=n.shadowRoot)?void 0:n.activeElement);){var n;t=t.shadowRoot.activeElement}return t}function _(e,t){if(!e||!t)return!1;const n=null==t.getRootNode?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&k(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function H(){const e=navigator.userAgentData;return null!=e&&e.platform?e.platform:navigator.platform}function V(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map((e=>{let{brand:t,version:n}=e;return t+"/"+n})).join(" "):navigator.userAgent}function X(e){return!V().includes("jsdom/")&&(!Y()&&0===e.width&&0===e.height||Y()&&1===e.width&&1===e.height&&0===e.pressure&&0===e.detail&&"mouse"===e.pointerType||e.width<1&&e.height<1&&0===e.pressure&&0===e.detail&&"touch"===e.pointerType)}function q(){return/apple/i.test(navigator.vendor)}function Y(){const e=/android/i;return e.test(H())||e.test(V())}function K(e,t){const n=["mouse","pen"];return n.push("",void 0),n.includes(e)}function U(e){return(null==e?void 0:e.ownerDocument)||document}function $(e,t){if(null==t)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return null!=n.target&&t.contains(n.target)}function z(e){return"composedPath"in e?e.composedPath()[0]:e.target}function Z(e){return S(e)&&e.matches("input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])")}function G(e){e.preventDefault(),e.stopPropagation()}const Q=["top","right","bottom","left"],J=Math.min,ee=Math.max,te=Math.round,ne=e=>({x:e,y:e}),re={left:"right",right:"left",bottom:"top",top:"bottom"},oe={start:"end",end:"start"};function ie(e,t,n){return ee(e,J(t,n))}function ce(e,t){return"function"==typeof e?e(t):e}function le(e){return e.split("-")[0]}function ae(e){return e.split("-")[1]}function ue(e){return"x"===e?"y":"x"}function se(e){return"y"===e?"height":"width"}function fe(e){return["top","bottom"].includes(le(e))?"y":"x"}function de(e){return ue(fe(e))}function pe(e){return e.replace(/start|end/g,(e=>oe[e]))}function me(e){return e.replace(/left|right|bottom|top/g,(e=>re[e]))}function ve(e){return"number"!=typeof e?function(e){return{top:0,right:0,bottom:0,left:0,...e}}(e):{top:e,right:e,bottom:e,left:e}}function he(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}
|
|
2
2
|
/*!
|
|
3
3
|
* tabbable 6.2.0
|
|
4
4
|
* @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
|
|
5
|
-
*/var pe=["input:not([inert])","select:not([inert])","textarea:not([inert])","a[href]:not([inert])","button:not([inert])","[tabindex]:not(slot):not([inert])","audio[controls]:not([inert])","video[controls]:not([inert])",'[contenteditable]:not([contenteditable="false"]):not([inert])',"details>summary:first-of-type:not([inert])","details:not([inert])"].join(","),me="undefined"==typeof Element,ve=me?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,he=!me&&Element.prototype.getRootNode?function(e){var t;return null==e||null===(t=e.getRootNode)||void 0===t?void 0:t.call(e)}:function(e){return null==e?void 0:e.ownerDocument},ge=function e(t,n){var r;void 0===n&&(n=!0);var o=null==t||null===(r=t.getAttribute)||void 0===r?void 0:r.call(t,"inert");return""===o||"true"===o||n&&t&&e(t.parentNode)},ye=function e(t,n,r){for(var o=[],i=Array.from(t);i.length;){var l=i.shift();if(!ge(l,!1))if("SLOT"===l.tagName){var c=l.assignedElements(),u=e(c.length?c:l.children,!0,r);r.flatten?o.push.apply(o,u):o.push({scopeParent:l,candidates:u})}else{ve.call(l,pe)&&r.filter(l)&&(n||!t.includes(l))&&o.push(l);var s=l.shadowRoot||"function"==typeof r.getShadowRoot&&r.getShadowRoot(l),a=!ge(s,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(l));if(s&&a){var f=e(!0===s?l.children:s.children,!0,r);r.flatten?o.push.apply(o,f):o.push({scopeParent:l,candidates:f})}else i.unshift.apply(i,l.children)}}return o},we=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},be=function(e){if(!e)throw new Error("No node provided");return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||function(e){var t,n=null==e||null===(t=e.getAttribute)||void 0===t?void 0:t.call(e,"contenteditable");return""===n||"true"===n}(e))&&!we(e)?0:e.tabIndex},xe=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},Ee=function(e){return"INPUT"===e.tagName},Re=function(e){return function(e){return Ee(e)&&"radio"===e.type}(e)&&!function(e){if(!e.name)return!0;var t,n=e.form||he(e),r=function(e){return n.querySelectorAll('input[type="radio"][name="'+e+'"]')};if("undefined"!=typeof window&&void 0!==window.CSS&&"function"==typeof window.CSS.escape)t=r(window.CSS.escape(e.name));else try{t=r(e.name)}catch(e){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",e.message),!1}var o=function(e,t){for(var n=0;n<e.length;n++)if(e[n].checked&&e[n].form===t)return e[n]}(t,e.form);return!o||o===e}(e)},Ce=function(e){var t=e.getBoundingClientRect(),n=t.width,r=t.height;return 0===n&&0===r},Oe=function(e,t){var n=t.displayCheck,r=t.getShadowRoot;if("hidden"===getComputedStyle(e).visibility)return!0;var o=ve.call(e,"details>summary:first-of-type")?e.parentElement:e;if(ve.call(o,"details:not([open]) *"))return!0;if(n&&"full"!==n&&"legacy-full"!==n){if("non-zero-area"===n)return Ce(e)}else{if("function"==typeof r){for(var i=e;e;){var l=e.parentElement,c=he(e);if(l&&!l.shadowRoot&&!0===r(l))return Ce(e);e=e.assignedSlot?e.assignedSlot:l||c===e.ownerDocument?l:c.host}e=i}if(function(e){var t,n,r,o,i=e&&he(e),l=null===(t=i)||void 0===t?void 0:t.host,c=!1;if(i&&i!==e)for(c=!!(null!==(n=l)&&void 0!==n&&null!==(r=n.ownerDocument)&&void 0!==r&&r.contains(l)||null!=e&&null!==(o=e.ownerDocument)&&void 0!==o&&o.contains(e));!c&&l;){var u,s,a;c=!(null===(s=l=null===(u=i=he(l))||void 0===u?void 0:u.host)||void 0===s||null===(a=s.ownerDocument)||void 0===a||!a.contains(l))}return c}(e))return!e.getClientRects().length;if("legacy-full"!==n)return!0}return!1},Se=function(e,t){return!(t.disabled||ge(t)||function(e){return Ee(e)&&"hidden"===e.type}(t)||Oe(t,e)||function(e){return"DETAILS"===e.tagName&&Array.prototype.slice.apply(e.children).some((function(e){return"SUMMARY"===e.tagName}))}(t)||function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var t=e.parentElement;t;){if("FIELDSET"===t.tagName&&t.disabled){for(var n=0;n<t.children.length;n++){var r=t.children.item(n);if("LEGEND"===r.tagName)return!!ve.call(t,"fieldset[disabled] *")||!r.contains(e)}return!0}t=t.parentElement}return!1}(t))},Le=function(e,t){return!(Re(t)||be(t)<0||!Se(e,t))},Ae=function(e){var t=parseInt(e.getAttribute("tabindex"),10);return!!(isNaN(t)||t>=0)},ke=function e(t){var n=[],r=[];return t.forEach((function(t,o){var i=!!t.scopeParent,l=i?t.scopeParent:t,c=function(e,t){var n=be(e);return n<0&&t&&!we(e)?0:n}(l,i),u=i?e(t.candidates):l;0===c?i?n.push.apply(n,u):n.push(l):r.push({documentOrder:o,tabIndex:c,item:t,isScope:i,content:u})})),r.sort(xe).reduce((function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e}),[]).concat(n)},Pe=function(e,t){var n;return n=(t=t||{}).getShadowRoot?ye([e],t.includeContainer,{filter:Le.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:Ae}):function(e,t,n){if(ge(e))return[];var r=Array.prototype.slice.apply(e.querySelectorAll(pe));return t&&ve.call(e,pe)&&r.unshift(e),r.filter(n)}(e,t.includeContainer,Le.bind(null,t)),ke(n)};function Te(e,t,n){let{reference:r,floating:o}=e;const i=ce(t),l=ue(t),c=le(l),u=re(t),s="y"===i,a=r.x+r.width/2-o.width/2,f=r.y+r.height/2-o.height/2,d=r[c]/2-o[c]/2;let p;switch(u){case"top":p={x:a,y:r.y-o.height};break;case"bottom":p={x:a,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:f};break;case"left":p={x:r.x-o.width,y:f};break;default:p={x:r.x,y:r.y}}switch(oe(t)){case"start":p[l]-=d*(n&&s?-1:1);break;case"end":p[l]+=d*(n&&s?-1:1)}return p}async function Me(e,t){var n;void 0===t&&(t={});const{x:r,y:o,platform:i,rects:l,elements:c,strategy:u}=e,{boundary:s="clippingAncestors",rootBoundary:a="viewport",elementContext:f="floating",altBoundary:d=!1,padding:p=0}=ne(t,e),m=fe(p),v=c[d?"floating"===f?"reference":"floating":f],h=de(await i.getClippingRect({element:null==(n=await(null==i.isElement?void 0:i.isElement(v)))||n?v:v.contextElement||await(null==i.getDocumentElement?void 0:i.getDocumentElement(c.floating)),boundary:s,rootBoundary:a,strategy:u})),g="floating"===f?{x:r,y:o,width:l.floating.width,height:l.floating.height}:l.reference,y=await(null==i.getOffsetParent?void 0:i.getOffsetParent(c.floating)),w=await(null==i.isElement?void 0:i.isElement(y))&&await(null==i.getScale?void 0:i.getScale(y))||{x:1,y:1},b=de(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:g,offsetParent:y,strategy:u}):g);return{top:(h.top-b.top+m.top)/w.y,bottom:(b.bottom-h.bottom+m.bottom)/w.y,left:(h.left-b.left+m.left)/w.x,right:(b.right-h.right+m.right)/w.x}}function Ne(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function De(e){return $.some((t=>e[t]>=0))}function Fe(e){const t=k(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=x(e),i=o?e.offsetWidth:n,l=o?e.offsetHeight:r,c=G(n)!==i||G(r)!==l;return c&&(n=i,r=l),{width:n,height:r,$:c}}function Ie(e){return b(e)?e:e.contextElement}function We(e){const t=Ie(e);if(!x(t))return Q(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=Fe(t);let l=(i?G(n.width):n.width)/r,c=(i?G(n.height):n.height)/o;return l&&Number.isFinite(l)||(l=1),c&&Number.isFinite(c)||(c=1),{x:l,y:c}}const je=Q(0);function Be(e){const t=g(e);return L()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:je}function He(e,t,n,r){void 0===t&&(t=!1),void 0===n&&(n=!1);const o=e.getBoundingClientRect(),i=Ie(e);let l=Q(1);t&&(r?b(r)&&(l=We(r)):l=We(e));const c=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==g(e))&&t}(i,n,r)?Be(i):Q(0);let u=(o.left+c.x)/l.x,s=(o.top+c.y)/l.y,a=o.width/l.x,f=o.height/l.y;if(i){const e=g(i),t=r&&b(r)?g(r):r;let n=e,o=D(n);for(;o&&r&&t!==n;){const e=We(o),t=o.getBoundingClientRect(),r=k(o),i=t.left+(o.clientLeft+parseFloat(r.paddingLeft))*e.x,l=t.top+(o.clientTop+parseFloat(r.paddingTop))*e.y;u*=e.x,s*=e.y,a*=e.x,f*=e.y,u+=i,s+=l,n=g(o),o=D(n)}}return de({width:a,height:f,x:u,y:s})}function Ve(e,t){const n=P(e).scrollLeft;return t?t.left+n:He(y(e)).left+n}function _e(e,t,n){void 0===n&&(n=!1);const r=e.getBoundingClientRect();return{x:r.left+t.scrollLeft-(n?0:Ve(e,r)),y:r.top+t.scrollTop}}function qe(e,t,n){let r;if("viewport"===t)r=function(e,t){const n=g(e),r=y(e),o=n.visualViewport;let i=r.clientWidth,l=r.clientHeight,c=0,u=0;if(o){i=o.width,l=o.height;const e=L();(!e||e&&"fixed"===t)&&(c=o.offsetLeft,u=o.offsetTop)}return{width:i,height:l,x:c,y:u}}(e,n);else if("document"===t)r=function(e){const t=y(e),n=P(e),r=e.ownerDocument.body,o=Z(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=Z(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let l=-n.scrollLeft+Ve(e);const c=-n.scrollTop;return"rtl"===k(r).direction&&(l+=Z(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:l,y:c}}(y(e));else if(b(t))r=function(e,t){const n=He(e,!0,"fixed"===t),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=x(e)?We(e):Q(1);return{width:e.clientWidth*i.x,height:e.clientHeight*i.y,x:o*i.x,y:r*i.y}}(t,n);else{const n=Be(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return de(r)}function Ke(e,t){const n=T(e);return!(n===t||!b(n)||A(n))&&("fixed"===k(n).position||Ke(n,t))}function Xe(e,t,n){const r=x(t),o=y(t),i="fixed"===n,l=He(e,!0,i,t);let c={scrollLeft:0,scrollTop:0};const u=Q(0);if(r||!r&&!i)if(("body"!==h(t)||R(o))&&(c=P(t)),r){const e=He(t,!0,i,t);u.x=e.x+t.clientLeft,u.y=e.y+t.clientTop}else o&&(u.x=Ve(o));const s=!o||r||i?Q(0):_e(o,c);return{x:l.left+c.scrollLeft-u.x-s.x,y:l.top+c.scrollTop-u.y-s.y,width:l.width,height:l.height}}function Ue(e){return"static"===k(e).position}function Ye(e,t){if(!x(e)||"fixed"===k(e).position)return null;if(t)return t(e);let n=e.offsetParent;return y(e)===n&&(n=n.ownerDocument.body),n}function $e(e,t){const n=g(e);if(O(e))return n;if(!x(e)){let t=T(e);for(;t&&!A(t);){if(b(t)&&!Ue(t))return t;t=T(t)}return n}let r=Ye(e,t);for(;r&&C(r)&&Ue(r);)r=Ye(r,t);return r&&A(r)&&Ue(r)&&!S(r)?n:r||function(e){let t=T(e);for(;x(t)&&!A(t);){if(S(t))return t;if(O(t))return null;t=T(t)}return null}(e)||n}const ze={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i="fixed"===o,l=y(r),c=!!t&&O(t.floating);if(r===l||c&&i)return n;let u={scrollLeft:0,scrollTop:0},s=Q(1);const a=Q(0),f=x(r);if((f||!f&&!i)&&(("body"!==h(r)||R(l))&&(u=P(r)),x(r))){const e=He(r);s=We(r),a.x=e.x+r.clientLeft,a.y=e.y+r.clientTop}const d=!l||f||i?Q(0):_e(l,u,!0);return{width:n.width*s.x,height:n.height*s.y,x:n.x*s.x-u.scrollLeft*s.x+a.x+d.x,y:n.y*s.y-u.scrollTop*s.y+a.y+d.y}},getDocumentElement:y,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[..."clippingAncestors"===n?O(t)?[]:function(e,t){const n=t.get(e);if(n)return n;let r=N(e,[],!1).filter((e=>b(e)&&"body"!==h(e))),o=null;const i="fixed"===k(e).position;let l=i?T(e):e;for(;b(l)&&!A(l);){const t=k(l),n=S(l);n||"fixed"!==t.position||(o=null),(i?!n&&!o:!n&&"static"===t.position&&o&&["absolute","fixed"].includes(o.position)||R(l)&&!n&&Ke(e,l))?r=r.filter((e=>e!==l)):o=t,l=T(l)}return t.set(e,r),r}(t,this._c):[].concat(n),r],l=i[0],c=i.reduce(((e,n)=>{const r=qe(t,n,o);return e.top=Z(r.top,e.top),e.right=z(r.right,e.right),e.bottom=z(r.bottom,e.bottom),e.left=Z(r.left,e.left),e}),qe(t,l,o));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}},getOffsetParent:$e,getElementRects:async function(e){const t=this.getOffsetParent||$e,n=this.getDimensions,r=await n(e.floating);return{reference:Xe(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:n}=Fe(e);return{width:t,height:n}},getScale:We,isElement:b,isRTL:function(e){return"rtl"===k(e).direction}},Ze=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:l,middlewareData:c}=t,u=await async function(e,t){const{placement:n,platform:r,elements:o}=e,i=await(null==r.isRTL?void 0:r.isRTL(o.floating)),l=re(n),c=oe(n),u="y"===ce(n),s=["left","top"].includes(l)?-1:1,a=i&&u?-1:1,f=ne(t,e);let{mainAxis:d,crossAxis:p,alignmentAxis:m}="number"==typeof f?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return c&&"number"==typeof m&&(p="end"===c?-1*m:m),u?{x:p*a,y:d*s}:{x:d*s,y:p*a}}(t,e);return l===(null==(n=c.offset)?void 0:n.placement)&&null!=(r=c.arrow)&&r.alignmentOffset?{}:{x:o+u.x,y:i+u.y,data:{...u,placement:l}}}}},Ge=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:i=!0,crossAxis:l=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...u}=ne(e,t),s={x:n,y:r},a=await Me(t,u),f=ce(re(o)),d=ie(f);let p=s[d],m=s[f];if(i){const e="y"===d?"bottom":"right";p=te(p+a["y"===d?"top":"left"],p,p-a[e])}if(l){const e="y"===f?"bottom":"right";m=te(m+a["y"===f?"top":"left"],m,m-a[e])}const v=c.fn({...t,[d]:p,[f]:m});return{...v,data:{x:v.x-n,y:v.y-r,enabled:{[d]:i,[f]:l}}}}}},Qe=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:i,rects:l,initialPlacement:c,platform:u,elements:s}=t,{mainAxis:a=!0,crossAxis:f=!0,fallbackPlacements:d,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:v=!0,...h}=ne(e,t);if(null!=(n=i.arrow)&&n.alignmentOffset)return{};const g=re(o),y=ce(c),w=re(c)===c,b=await(null==u.isRTL?void 0:u.isRTL(s.floating)),x=d||(w||!v?[ae(c)]:function(e){const t=ae(e);return[se(e),t,se(t)]}(c)),E="none"!==m;!d&&E&&x.push(...function(e,t,n,r){const o=oe(e);let i=function(e,t,n){const r=["left","right"],o=["right","left"],i=["top","bottom"],l=["bottom","top"];switch(e){case"top":case"bottom":return n?t?o:r:t?r:o;case"left":case"right":return t?i:l;default:return[]}}(re(e),"start"===n,r);return o&&(i=i.map((e=>e+"-"+o)),t&&(i=i.concat(i.map(se)))),i}(c,v,m,b));const R=[c,...x],C=await Me(t,h),O=[];let S=(null==(r=i.flip)?void 0:r.overflows)||[];if(a&&O.push(C[g]),f){const e=function(e,t,n){void 0===n&&(n=!1);const r=oe(e),o=ue(e),i=le(o);let l="x"===o?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[i]>t.floating[i]&&(l=ae(l)),[l,ae(l)]}(o,l,b);O.push(C[e[0]],C[e[1]])}if(S=[...S,{placement:o,overflows:O}],!O.every((e=>e<=0))){var L,A;const e=((null==(L=i.flip)?void 0:L.index)||0)+1,t=R[e];if(t)return{data:{index:e,overflows:S},reset:{placement:t}};let n=null==(A=S.filter((e=>e.overflows[0]<=0)).sort(((e,t)=>e.overflows[1]-t.overflows[1]))[0])?void 0:A.placement;if(!n)switch(p){case"bestFit":{var k;const e=null==(k=S.filter((e=>{if(E){const t=ce(e.placement);return t===y||"y"===t}return!0})).map((e=>[e.placement,e.overflows.filter((e=>e>0)).reduce(((e,t)=>e+t),0)])).sort(((e,t)=>e[1]-t[1]))[0])?void 0:k[0];e&&(n=e);break}case"initialPlacement":n=c}if(o!==n)return{reset:{placement:n}}}return{}}}},Je=function(e){return void 0===e&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=ne(e,t);switch(r){case"referenceHidden":{const e=Ne(await Me(t,{...o,elementContext:"reference"}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:De(e)}}}case"escaped":{const e=Ne(await Me(t,{...o,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:De(e)}}}default:return{}}}}},et=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:l,elements:c,middlewareData:u}=t,{element:s,padding:a=0}=ne(e,t)||{};if(null==s)return{};const f=fe(a),d={x:n,y:r},p=ue(o),m=le(p),v=await l.getDimensions(s),h="y"===p,g=h?"top":"left",y=h?"bottom":"right",w=h?"clientHeight":"clientWidth",b=i.reference[m]+i.reference[p]-d[p]-i.floating[m],x=d[p]-i.reference[p],E=await(null==l.getOffsetParent?void 0:l.getOffsetParent(s));let R=E?E[w]:0;R&&await(null==l.isElement?void 0:l.isElement(E))||(R=c.floating[w]||i.floating[m]);const C=b/2-x/2,O=R/2-v[m]/2-1,S=z(f[g],O),L=z(f[y],O),A=S,k=R-v[m]-L,P=R/2-v[m]/2+C,T=te(A,P,k),M=!u.arrow&&null!=oe(o)&&P!==T&&i.reference[m]/2-(P<A?S:L)-v[m]/2<0,N=M?P<A?P-A:P-k:0;return{[p]:d[p]+N,data:{[p]:T,centerOffset:P-T-N,...M&&{alignmentOffset:N}},reset:M}}}),tt=(e,t,n)=>{const r=new Map,o={platform:ze,...n},i={...o.platform,_c:r};return(async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:l}=n,c=i.filter(Boolean),u=await(null==l.isRTL?void 0:l.isRTL(t));let s=await l.getElementRects({reference:e,floating:t,strategy:o}),{x:a,y:f}=Te(s,r,u),d=r,p={},m=0;for(let n=0;n<c.length;n++){const{name:i,fn:v}=c[n],{x:h,y:g,data:y,reset:w}=await v({x:a,y:f,initialPlacement:r,placement:d,strategy:o,middlewareData:p,rects:s,platform:l,elements:{reference:e,floating:t}});a=null!=h?h:a,f=null!=g?g:f,p={...p,[i]:{...p[i],...y}},w&&m<=50&&(m++,"object"==typeof w&&(w.placement&&(d=w.placement),w.rects&&(s=!0===w.rects?await l.getElementRects({reference:e,floating:t,strategy:o}):w.rects),({x:a,y:f}=Te(s,d,u))),n=-1)}return{x:a,y:f,placement:d,strategy:o,middlewareData:p}})(e,t,{...o,platform:i})};var nt="undefined"!=typeof document?r:o;function rt(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if("function"==typeof e&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;0!=r--;)if(!rt(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;0!=r--;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;0!=r--;){const n=o[r];if(("_owner"!==n||!e.$$typeof)&&!rt(e[n],t[n]))return!1}return!0}return e!=e&&t!=t}function ot(e){if("undefined"==typeof window)return 1;return(e.ownerDocument.defaultView||window).devicePixelRatio||1}function it(e,t){const n=ot(e);return Math.round(t*n)/n}function lt(t){const n=e.useRef(t);return nt((()=>{n.current=t})),n}const ct=e=>({name:"arrow",options:e,fn(t){const{element:n,padding:r}="function"==typeof e?e(t):e;return n&&(o=n,{}.hasOwnProperty.call(o,"current"))?null!=n.current?et({element:n.current,padding:r}).fn(t):{}:n?et({element:n,padding:r}).fn(t):{};var o}});function ut(t){return e.useMemo((()=>t.every((e=>null==e))?null:e=>{t.forEach((t=>{"function"==typeof t?t(e):null!=t&&(t.current=e)}))}),t)}const st={...e},at=st.useInsertionEffect||(e=>e());function ft(t){const n=e.useRef((()=>{if("production"!==process.env.NODE_ENV)throw new Error("Cannot call an event handler while rendering.")}));return at((()=>{n.current=t})),e.useCallback((function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return null==n.current?void 0:n.current(...t)}),[])}var dt="undefined"!=typeof document?r:o;let pt=!1,mt=0;const vt=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+mt++;const ht=st.useId||function(){const[t,n]=e.useState((()=>pt?vt():void 0));return dt((()=>{null==t&&n(vt())}),[]),e.useEffect((()=>{pt=!0}),[]),t};let gt;"production"!==process.env.NODE_ENV&&(gt=new Set);const yt=e.forwardRef((function(t,n){const{context:{placement:r,elements:{floating:o},middlewareData:{arrow:i,shift:l}},width:c=14,height:a=7,tipRadius:f=0,strokeWidth:d=0,staticOffset:p,stroke:m,d:v,style:{transform:h,...g}={},...y}=t;"production"!==process.env.NODE_ENV&&(n||function(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];const o="Floating UI: "+n.join(" ");var i;null!=(e=gt)&&e.has(o)||(null==(i=gt)||i.add(o),console.warn(o))}("The `ref` prop is required for `FloatingArrow`."));const w=ht(),[b,x]=e.useState(!1);if(dt((()=>{if(!o)return;"rtl"===k(o).direction&&x(!0)}),[o]),!o)return null;const[E,R]=r.split("-"),C="top"===E||"bottom"===E;let O=p;(C&&null!=l&&l.x||!C&&null!=l&&l.y)&&(O=null);const S=2*d,L=S/2,A=c/2*(f/-8+1),P=a/2*f/4,T=!!v,M=O&&"end"===R?"bottom":"top";let N=O&&"end"===R?"right":"left";O&&b&&(N="end"===R?"left":"right");const D=null!=(null==i?void 0:i.x)?O||i.x:"",F=null!=(null==i?void 0:i.y)?O||i.y:"",I=v||"M0,0 H"+c+" L"+(c-A)+","+(a-P)+" Q"+c/2+","+a+" "+A+","+(a-P)+" Z",W={top:T?"rotate(180deg)":"",left:T?"rotate(90deg)":"rotate(-90deg)",bottom:T?"":"rotate(180deg)",right:T?"rotate(-90deg)":"rotate(90deg)"}[E];return u("svg",{...y,"aria-hidden":!0,ref:n,width:T?c:c+S,height:c,viewBox:"0 0 "+c+" "+(a>c?a:c),style:{position:"absolute",pointerEvents:"none",[N]:D,[M]:F,[E]:C||T?"100%":"calc(100% - "+S/2+"px)",transform:[W,h].filter((e=>!!e)).join(" "),...g},children:[S>0&&s("path",{clipPath:"url(#"+w+")",fill:"none",stroke:m,strokeWidth:S+(v?0:1),d:I}),s("path",{stroke:S&&!v?y.fill:"none",d:I}),s("clipPath",{id:w,children:s("rect",{x:-L,y:L*(T?-1:1),width:c+S,height:c})})]})}));const wt=e.createContext(null),bt=e.createContext(null),xt=()=>{var t;return(null==(t=e.useContext(wt))?void 0:t.id)||null},Et=()=>e.useContext(bt);function Rt(e){return"data-floating-ui-"+e}function Ct(e){const t=i(e);return dt((()=>{t.current=e})),t}const Ot=Rt("safe-polygon");function St(e,t,n){return n&&!_(n)?0:"number"==typeof e?e:null==e?void 0:e[t]}let Lt=0;function At(e,t){void 0===t&&(t={});const{preventScroll:n=!1,cancelPrevious:r=!0,sync:o=!1}=t;r&&cancelAnimationFrame(Lt);const i=()=>null==e?void 0:e.focus({preventScroll:n});o?i():Lt=requestAnimationFrame(i)}function kt(e,t){var n;let r=[],o=null==(n=e.find((e=>e.id===t)))?void 0:n.parentId;for(;o;){const t=e.find((e=>e.id===o));o=null==t?void 0:t.parentId,t&&(r=r.concat(t))}return r}function Pt(e,t){let n=e.filter((e=>{var n;return e.parentId===t&&(null==(n=e.context)?void 0:n.open)})),r=n;for(;r.length;)r=e.filter((e=>{var t;return null==(t=r)?void 0:t.some((t=>{var n;return e.parentId===t.id&&(null==(n=e.context)?void 0:n.open)}))})),n=n.concat(r);return n}let Tt=new WeakMap,Mt=new WeakSet,Nt={},Dt=0;const Ft=e=>e&&(e.host||Ft(e.parentNode));function It(e,t,n,r){const o="data-floating-ui-inert",i=r?"inert":n?"aria-hidden":null,l=(c=t,e.map((e=>{if(c.contains(e))return e;const t=Ft(e);return c.contains(t)?t:null})).filter((e=>null!=e)));var c;const u=new Set,s=new Set(l),a=[];Nt[o]||(Nt[o]=new WeakMap);const f=Nt[o];return l.forEach((function e(t){if(!t||u.has(t))return;u.add(t),t.parentNode&&e(t.parentNode)})),function e(t){if(!t||s.has(t))return;[].forEach.call(t.children,(t=>{if("script"!==h(t))if(u.has(t))e(t);else{const e=i?t.getAttribute(i):null,n=null!==e&&"false"!==e,r=Tt.get(t)||0,l=i?r+1:r,c=(f.get(t)||0)+1;Tt.set(t,l),f.set(t,c),a.push(t),1===l&&n&&Mt.add(t),1===c&&t.setAttribute(o,""),!n&&i&&t.setAttribute(i,"true")}}))}(t),u.clear(),Dt++,()=>{a.forEach((e=>{const t=Tt.get(e)||0,n=i?t-1:t,r=(f.get(e)||0)-1;Tt.set(e,n),f.set(e,r),n||(!Mt.has(e)&&i&&e.removeAttribute(i),Mt.delete(e)),r||e.removeAttribute(o)})),Dt--,Dt||(Tt=new WeakMap,Tt=new WeakMap,Mt=new WeakSet,Nt={})}}function Wt(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=!1);const r=q(e[0]).body;return It(e.concat(Array.from(r.querySelectorAll("[aria-live]"))),r,t,n)}const jt=()=>({getShadowRoot:!0,displayCheck:"function"==typeof ResizeObserver&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function Bt(e,t){const n=Pe(e,jt());"prev"===t&&n.reverse();const r=n.indexOf(F(q(e)));return n.slice(r+1)[0]}function Ht(){return Bt(document.body,"next")}function Vt(){return Bt(document.body,"prev")}function _t(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!I(n,r)}function qt(e){Pe(e,jt()).forEach((e=>{e.dataset.tabindex=e.getAttribute("tabindex")||"",e.setAttribute("tabindex","-1")}))}function Kt(e){e.querySelectorAll("[data-tabindex]").forEach((e=>{const t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute("tabindex",t):e.removeAttribute("tabindex")}))}const Xt={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"fixed",whiteSpace:"nowrap",width:"1px",top:0,left:0};function Ut(e){"Tab"===e.key&&(e.target,clearTimeout(undefined))}const Yt=e.forwardRef((function(t,n){const[r,o]=e.useState();dt((()=>(H()&&o("button"),document.addEventListener("keydown",Ut),()=>{document.removeEventListener("keydown",Ut)})),[]);const i={ref:n,tabIndex:0,role:r,"aria-hidden":!r||void 0,[Rt("focus-guard")]:"",style:Xt};return s("span",{...t,...i})})),$t=e.createContext(null),zt=Rt("portal");const Zt=()=>e.useContext($t),Gt="data-floating-ui-focusable";function Qt(e){return e?e.hasAttribute(Gt)?e:e.querySelector("["+Gt+"]")||e:null}let Jt=[];function en(e){Jt=Jt.filter((e=>e.isConnected)),e&&"body"!==h(e)&&(Jt.push(e),Jt.length>20&&(Jt=Jt.slice(-20)))}function tn(){return Jt.slice().reverse().find((e=>e.isConnected))}function nn(e){const t=jt();return function(e,t){if(t=t||{},!e)throw new Error("No node provided");return!1!==ve.call(e,pe)&&Le(t,e)}(e,t)?e:Pe(e,t)[0]||e}const rn=e.forwardRef((function(e,t){return s("button",{...e,type:"button",ref:t,tabIndex:-1,style:Xt})}));let on=0;let ln=()=>{};const cn=e.forwardRef((function(e,t){const{lockScroll:n=!1,...r}=e;return dt((()=>{if(n)return on++,1===on&&(ln=function(){const e=/iP(hone|ad|od)|iOS/.test(W()),t=document.body.style,n=Math.round(document.documentElement.getBoundingClientRect().left)+document.documentElement.scrollLeft?"paddingLeft":"paddingRight",r=window.innerWidth-document.documentElement.clientWidth,o=t.left?parseFloat(t.left):window.scrollX,i=t.top?parseFloat(t.top):window.scrollY;if(t.overflow="hidden",r&&(t[n]=r+"px"),e){var l,c;const e=(null==(l=window.visualViewport)?void 0:l.offsetLeft)||0,n=(null==(c=window.visualViewport)?void 0:c.offsetTop)||0;Object.assign(t,{position:"fixed",top:-(i-Math.floor(n))+"px",left:-(o-Math.floor(e))+"px",right:"0"})}return()=>{Object.assign(t,{overflow:"",[n]:""}),e&&(Object.assign(t,{position:"",top:"",left:"",right:""}),window.scrollTo(o,i))}}()),()=>{on--,0===on&&ln()}}),[n]),s("div",{ref:t,...r,style:{position:"fixed",overflow:"auto",top:0,right:0,bottom:0,left:0,...r.style}})})),un={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},sn={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},an=e=>{var t,n;return{escapeKey:"boolean"==typeof e?e:null!=(t=null==e?void 0:e.escapeKey)&&t,outsidePress:"boolean"==typeof e?e:null==(n=null==e?void 0:e.outsidePress)||n}};function fn(t){const{open:n=!1,onOpenChange:r,elements:o}=t,i=ht(),l=e.useRef({}),[c]=e.useState((()=>function(){const e=new Map;return{emit(t,n){var r;null==(r=e.get(t))||r.forEach((e=>e(n)))},on(t,n){e.set(t,[...e.get(t)||[],n])},off(t,n){var r;e.set(t,(null==(r=e.get(t))?void 0:r.filter((e=>e!==n)))||[])}}}())),u=null!=xt();if("production"!==process.env.NODE_ENV){const e=o.reference;e&&!b(e)&&function(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];const o="Floating UI: "+n.join(" ");var i;null!=(e=gt)&&e.has(o)||(null==(i=gt)||i.add(o),console.error(o))}("Cannot pass a virtual element to the `elements.reference` option,","as it must be a real DOM element. Use `refs.setPositionReference()`","instead.")}const[s,a]=e.useState(o.reference),f=ft(((e,t,n)=>{l.current.openEvent=e?t:void 0,c.emit("openchange",{open:e,event:t,reason:n,nested:u}),null==r||r(e,t,n)})),d=e.useMemo((()=>({setPositionReference:a})),[]),p=e.useMemo((()=>({reference:s||o.reference||null,floating:o.floating||null,domReference:o.reference})),[s,o.reference,o.floating]);return e.useMemo((()=>({dataRef:l,open:n,onOpenChange:f,elements:p,events:c,floatingId:i,refs:d})),[n,f,p,c,i,d])}const dn="active",pn="selected";function mn(e,t,n){const r=new Map,o="item"===n;let i=e;if(o&&e){const{[dn]:t,[pn]:n,...r}=e;i=r}return{..."floating"===n&&{tabIndex:-1,[Gt]:""},...i,...t.map((t=>{const r=t?t[n]:null;return"function"==typeof r?e?r(e):null:r})).concat(e).reduce(((e,t)=>t?(Object.entries(t).forEach((t=>{let[n,i]=t;var l;o&&[dn,pn].includes(n)||(0===n.indexOf("on")?(r.has(n)||r.set(n,[]),"function"==typeof i&&(null==(l=r.get(n))||l.push(i),e[n]=function(){for(var e,t=arguments.length,o=new Array(t),i=0;i<t;i++)o[i]=arguments[i];return null==(e=r.get(n))?void 0:e.map((e=>e(...o))).find((e=>void 0!==e))})):e[n]=i)})),e):e),{})}}const vn=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);var hn={Portal:function(t){const{children:n,id:r,root:o,preserveTabOrder:i=!0}=t,l=function(t){void 0===t&&(t={});const{id:n,root:r}=t,o=ht(),i=Zt(),[l,c]=e.useState(null),u=e.useRef(null);return dt((()=>()=>{null==l||l.remove(),queueMicrotask((()=>{u.current=null}))}),[l]),dt((()=>{if(!o)return;if(u.current)return;const e=n?document.getElementById(n):null;if(!e)return;const t=document.createElement("div");t.id=o,t.setAttribute(zt,""),e.appendChild(t),u.current=t,c(t)}),[n,o]),dt((()=>{if(null===r)return;if(!o)return;if(u.current)return;let e=r||(null==i?void 0:i.portalNode);e&&!b(e)&&(e=e.current),e=e||document.body;let t=null;n&&(t=document.createElement("div"),t.id=n,e.appendChild(t));const l=document.createElement("div");l.id=o,l.setAttribute(zt,""),e=t||e,e.appendChild(l),u.current=l,c(l)}),[n,r,o,i]),l}({id:r,root:o}),[c,a]=e.useState(null),d=e.useRef(null),p=e.useRef(null),m=e.useRef(null),v=e.useRef(null),h=null==c?void 0:c.modal,g=null==c?void 0:c.open,y=!!c&&!c.modal&&c.open&&i&&!(!o&&!l);return e.useEffect((()=>{if(l&&i&&!h)return l.addEventListener("focusin",e,!0),l.addEventListener("focusout",e,!0),()=>{l.removeEventListener("focusin",e,!0),l.removeEventListener("focusout",e,!0)};function e(e){if(l&&_t(e)){("focusin"===e.type?Kt:qt)(l)}}}),[l,i,h]),e.useEffect((()=>{l&&(g||Kt(l))}),[g,l]),u($t.Provider,{value:e.useMemo((()=>({preserveTabOrder:i,beforeOutsideRef:d,afterOutsideRef:p,beforeInsideRef:m,afterInsideRef:v,portalNode:l,setFocusManagerState:a})),[i,l]),children:[y&&l&&s(Yt,{"data-type":"outside",ref:d,onFocus:e=>{if(_t(e,l)){var t;null==(t=m.current)||t.focus()}else{const e=Vt()||(null==c?void 0:c.domReference);null==e||e.focus()}}}),y&&l&&s("span",{"aria-owns":l.id,style:Xt}),l&&f.createPortal(n,l),y&&l&&s(Yt,{"data-type":"outside",ref:p,onFocus:e=>{if(_t(e,l)){var t;null==(t=v.current)||t.focus()}else{const t=Ht()||(null==c?void 0:c.domReference);null==t||t.focus(),(null==c?void 0:c.closeOnFocusOut)&&(null==c||c.onOpenChange(!1,e.nativeEvent,"focus-out"))}}})]})},Overlay:cn,FocusManager:function(t){const{context:n,children:r,disabled:o=!1,order:i=["content"],guards:l=!0,initialFocus:c=0,returnFocus:f=!0,restoreFocus:d=!1,modal:p=!0,visuallyHiddenDismiss:m=!1,closeOnFocusOut:v=!0,outsideElementsInert:h=!1}=t,{open:g,onOpenChange:y,events:w,dataRef:b,elements:{domReference:E,floating:R}}=n,C=ft((()=>{var e;return null==(e=b.current.floatingContext)?void 0:e.nodeId})),O="number"==typeof c&&c<0,S=!!(L=E)&&"combobox"===L.getAttribute("role")&&U(L)&&O;var L;const A="undefined"!=typeof HTMLElement&&"inert"in HTMLElement.prototype,k=!A||l,P=!k||A&&h,T=Ct(i),M=Ct(c),N=Ct(f),D=Et(),W=Zt(),j=e.useRef(null),H=e.useRef(null),_=e.useRef(!1),K=e.useRef(!1),$=e.useRef(-1),z=null!=W,Z=Qt(R),G=ft((function(e){return void 0===e&&(e=Z),e?Pe(e,jt()):[]})),Q=ft((e=>{const t=G(e);return T.current.map((e=>E&&"reference"===e?E:Z&&"floating"===e?Z:t)).filter(Boolean).flat()}));e.useEffect((()=>{if(o)return;if(!p)return;function e(e){if("Tab"===e.key){I(Z,F(q(Z)))&&0===G().length&&!S&&Y(e);const t=Q(),n=X(e);"reference"===T.current[0]&&n===E&&(Y(e),e.shiftKey?At(t[t.length-1]):At(t[1])),"floating"===T.current[1]&&n===Z&&e.shiftKey&&(Y(e),At(t[0]))}}const t=q(Z);return t.addEventListener("keydown",e),()=>{t.removeEventListener("keydown",e)}}),[o,E,Z,p,T,S,G,Q]),e.useEffect((()=>{if(!o&&R)return R.addEventListener("focusin",e),()=>{R.removeEventListener("focusin",e)};function e(e){const t=X(e),n=G().indexOf(t);-1!==n&&($.current=n)}}),[o,R,G]),e.useEffect((()=>{if(!o&&v)return R&&x(E)?(E.addEventListener("focusout",t),E.addEventListener("pointerdown",e),R.addEventListener("focusout",t),()=>{E.removeEventListener("focusout",t),E.removeEventListener("pointerdown",e),R.removeEventListener("focusout",t)}):void 0;function e(){K.current=!0,setTimeout((()=>{K.current=!1}))}function t(e){const t=e.relatedTarget;queueMicrotask((()=>{const n=C(),r=!(I(E,t)||I(R,t)||I(t,R)||I(null==W?void 0:W.portalNode,t)||null!=t&&t.hasAttribute(Rt("focus-guard"))||D&&(Pt(D.nodesRef.current,n).find((e=>{var n,r;return I(null==(n=e.context)?void 0:n.elements.floating,t)||I(null==(r=e.context)?void 0:r.elements.domReference,t)}))||kt(D.nodesRef.current,n).find((e=>{var n,r,o;return[null==(n=e.context)?void 0:n.elements.floating,Qt(null==(r=e.context)?void 0:r.elements.floating)].includes(t)||(null==(o=e.context)?void 0:o.elements.domReference)===t}))));if(d&&r&&F(q(Z))===q(Z).body){x(Z)&&Z.focus();const e=$.current,t=G(),n=t[e]||t[t.length-1]||Z;x(n)&&n.focus()}!S&&p||!t||!r||K.current||t===tn()||(_.current=!0,y(!1,e,"focus-out"))}))}}),[o,E,R,Z,p,D,W,y,v,d,G,S,C]);const J=e.useRef(null),ee=e.useRef(null),te=ut([J,null==W?void 0:W.beforeInsideRef]),ne=ut([ee,null==W?void 0:W.afterInsideRef]);function re(e){return!o&&m&&p?s(rn,{ref:"start"===e?j:H,onClick:e=>y(!1,e.nativeEvent),children:"string"==typeof m?m:"Dismiss"}):null}e.useEffect((()=>{var e;if(o)return;if(!R)return;const t=Array.from((null==W||null==(e=W.portalNode)?void 0:e.querySelectorAll("["+Rt("portal")+"]"))||[]),n=D&&!p?kt(null==D?void 0:D.nodesRef.current,C()).map((e=>{var t;return null==(t=e.context)?void 0:t.elements.floating})):[],r=[R,...t,...n,j.current,H.current,J.current,ee.current,null==W?void 0:W.beforeOutsideRef.current,null==W?void 0:W.afterOutsideRef.current,T.current.includes("reference")||S?E:null].filter((e=>null!=e)),i=p||S?Wt(r,!P,P):Wt(r);return()=>{i()}}),[o,E,R,p,T,W,S,k,P,D,C]),dt((()=>{if(o||!x(Z))return;const e=F(q(Z));queueMicrotask((()=>{const t=Q(Z),n=M.current,r=("number"==typeof n?t[n]:n.current)||Z,o=I(Z,e);O||o||!g||At(r,{preventScroll:r===Z})}))}),[o,g,Z,O,Q,M]),dt((()=>{if(o||!Z)return;let e=!1;const t=q(Z),n=F(t);let r=b.current.openEvent;function i(t){let{open:n,reason:o,event:i,nested:l}=t;n&&(r=i),"escape-key"===o&&E&&en(E),["hover","safe-polygon"].includes(o)&&"mouseleave"===i.type&&(_.current=!0),"outside-press"===o&&(l?(_.current=!1,e=!0):_.current=!(function(e){return!(0!==e.mozInputSource||!e.isTrusted)||(V()&&e.pointerType?"click"===e.type&&1===e.buttons:0===e.detail&&!e.pointerType)}(i)||B(i)))}en(n),w.on("openchange",i);const l=t.createElement("span");return l.setAttribute("tabindex","-1"),l.setAttribute("aria-hidden","true"),Object.assign(l.style,Xt),z&&E&&E.insertAdjacentElement("afterend",l),()=>{w.off("openchange",i);const n=F(t),o=I(R,n)||D&&Pt(D.nodesRef.current,C()).some((e=>{var t;return I(null==(t=e.context)?void 0:t.elements.floating,n)}));(o||r&&["click","mousedown"].includes(r.type))&&E&&en(E);const c="boolean"==typeof N.current?tn()||l:N.current.current||l;queueMicrotask((()=>{const r=nn(c);N.current&&!_.current&&x(r)&&(r===n||n===t.body||o)&&r.focus({preventScroll:e}),l.remove()}))}}),[o,R,Z,N,b,w,D,z,E,C]),e.useEffect((()=>{queueMicrotask((()=>{_.current=!1}))}),[o]),dt((()=>{if(!o&&W)return W.setFocusManagerState({modal:p,closeOnFocusOut:v,open:g,onOpenChange:y,domReference:E}),()=>{W.setFocusManagerState(null)}}),[o,W,p,g,y,v,E]),dt((()=>{if(o)return;if(!Z)return;if("function"!=typeof MutationObserver)return;if(O)return;const e=()=>{const e=Z.getAttribute("tabindex"),t=G(),n=F(q(R)),r=t.indexOf(n);-1!==r&&($.current=r),T.current.includes("floating")||n!==E&&0===t.length?"0"!==e&&Z.setAttribute("tabindex","0"):"-1"!==e&&Z.setAttribute("tabindex","-1")};e();const t=new MutationObserver(e);return t.observe(Z,{childList:!0,subtree:!0,attributes:!0}),()=>{t.disconnect()}}),[o,R,Z,E,T,G,O]);const oe=!o&&k&&(!p||!S)&&(z||p);return u(a,{children:[oe&&s(Yt,{"data-type":"inside",ref:te,onFocus:e=>{if(p){const e=Q();At("reference"===i[0]?e[0]:e[e.length-1])}else if(null!=W&&W.preserveTabOrder&&W.portalNode)if(_.current=!1,_t(e,W.portalNode)){const e=Ht()||E;null==e||e.focus()}else{var t;null==(t=W.beforeOutsideRef.current)||t.focus()}}}),!S&&re("start"),r,re("end"),oe&&s(Yt,{"data-type":"inside",ref:ne,onFocus:e=>{if(p)At(Q()[0]);else if(null!=W&&W.preserveTabOrder&&W.portalNode)if(v&&(_.current=!0),_t(e,W.portalNode)){const e=Vt()||E;null==e||e.focus()}else{var t;null==(t=W.afterOutsideRef.current)||t.focus()}}})]})},useFloating:function(t){void 0===t&&(t={});const{nodeId:n}=t,r=fn({...t,elements:{reference:null,floating:null,...t.elements}}),o=t.rootContext||r,i=o.elements,[l,c]=e.useState(null),[u,s]=e.useState(null),a=(null==i?void 0:i.domReference)||l,d=e.useRef(null),p=Et();dt((()=>{a&&(d.current=a)}),[a]);const m=function(t){void 0===t&&(t={});const{placement:n="bottom",strategy:r="absolute",middleware:o=[],platform:i,elements:{reference:l,floating:c}={},transform:u=!0,whileElementsMounted:s,open:a}=t,[d,p]=e.useState({x:0,y:0,strategy:r,placement:n,middlewareData:{},isPositioned:!1}),[m,v]=e.useState(o);rt(m,o)||v(o);const[h,g]=e.useState(null),[y,w]=e.useState(null),b=e.useCallback((e=>{e!==C.current&&(C.current=e,g(e))}),[]),x=e.useCallback((e=>{e!==O.current&&(O.current=e,w(e))}),[]),E=l||h,R=c||y,C=e.useRef(null),O=e.useRef(null),S=e.useRef(d),L=null!=s,A=lt(s),k=lt(i),P=lt(a),T=e.useCallback((()=>{if(!C.current||!O.current)return;const e={placement:n,strategy:r,middleware:m};k.current&&(e.platform=k.current),tt(C.current,O.current,e).then((e=>{const t={...e,isPositioned:!1!==P.current};M.current&&!rt(S.current,t)&&(S.current=t,f.flushSync((()=>{p(t)})))}))}),[m,n,r,k,P]);nt((()=>{!1===a&&S.current.isPositioned&&(S.current.isPositioned=!1,p((e=>({...e,isPositioned:!1}))))}),[a]);const M=e.useRef(!1);nt((()=>(M.current=!0,()=>{M.current=!1})),[]),nt((()=>{if(E&&(C.current=E),R&&(O.current=R),E&&R){if(A.current)return A.current(E,R,T);T()}}),[E,R,T,A,L]);const N=e.useMemo((()=>({reference:C,floating:O,setReference:b,setFloating:x})),[b,x]),D=e.useMemo((()=>({reference:E,floating:R})),[E,R]),F=e.useMemo((()=>{const e={position:r,left:0,top:0};if(!D.floating)return e;const t=it(D.floating,d.x),n=it(D.floating,d.y);return u?{...e,transform:"translate("+t+"px, "+n+"px)",...ot(D.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:t,top:n}}),[r,u,D.floating,d.x,d.y]);return e.useMemo((()=>({...d,update:T,refs:N,elements:D,floatingStyles:F})),[d,T,N,D,F])}({...t,elements:{...i,...u&&{reference:u}}}),v=e.useCallback((e=>{const t=b(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),contextElement:e}:e;s(t),m.refs.setReference(t)}),[m.refs]),h=e.useCallback((e=>{(b(e)||null===e)&&(d.current=e,c(e)),(b(m.refs.reference.current)||null===m.refs.reference.current||null!==e&&!b(e))&&m.refs.setReference(e)}),[m.refs]),g=e.useMemo((()=>({...m.refs,setReference:h,setPositionReference:v,domReference:d})),[m.refs,h,v]),y=e.useMemo((()=>({...m.elements,domReference:a})),[m.elements,a]),w=e.useMemo((()=>({...m,...o,refs:g,elements:y,nodeId:n})),[m,g,y,n,o]);return dt((()=>{o.dataRef.current.floatingContext=w;const e=null==p?void 0:p.nodesRef.current.find((e=>e.id===n));e&&(e.context=w)})),e.useMemo((()=>({...m,context:w,refs:g,elements:y})),[m,g,y,w])},Arrow:yt,arrow:(e,t)=>({...ct(e),options:[e,t]}),useRole:function(t,n){var r;void 0===n&&(n={});const{open:o,floatingId:i}=t,{enabled:l=!0,role:c="dialog"}=n,u=null!=(r=vn.get(c))?r:c,s=ht(),a=null!=xt(),f=e.useMemo((()=>"tooltip"===u||"label"===c?{["aria-"+("label"===c?"labelledby":"describedby")]:o?i:void 0}:{"aria-expanded":o?"true":"false","aria-haspopup":"alertdialog"===u?"dialog":u,"aria-controls":o?i:void 0,..."listbox"===u&&{role:"combobox"},..."menu"===u&&{id:s},..."menu"===u&&a&&{role:"menuitem"},..."select"===c&&{"aria-autocomplete":"none"},..."combobox"===c&&{"aria-autocomplete":"list"}}),[u,i,a,o,s,c]),d=e.useMemo((()=>{const e={id:i,...u&&{role:u}};return"tooltip"===u||"label"===c?e:{...e,..."menu"===u&&{"aria-labelledby":s}}}),[u,i,s,c]),p=e.useCallback((e=>{let{active:t,selected:n}=e;const r={role:"option",...t&&{id:i+"-option"}};switch(c){case"select":return{...r,"aria-selected":t&&n};case"combobox":return{...r,...t&&{"aria-selected":!0}}}return{}}),[i,c]);return e.useMemo((()=>l?{reference:f,floating:d,item:p}:{}),[l,f,d,p])},useFocus:function(t,n){void 0===n&&(n={});const{open:r,onOpenChange:o,events:i,dataRef:l,elements:c}=t,{enabled:u=!0,visibleOnly:s=!0}=n,a=e.useRef(!1),f=e.useRef(),d=e.useRef(!0);e.useEffect((()=>{if(!u)return;const e=g(c.domReference);function t(){!r&&x(c.domReference)&&c.domReference===F(q(c.domReference))&&(a.current=!0)}function n(){d.current=!0}return e.addEventListener("blur",t),e.addEventListener("keydown",n,!0),()=>{e.removeEventListener("blur",t),e.removeEventListener("keydown",n,!0)}}),[c.domReference,r,u]),e.useEffect((()=>{if(u)return i.on("openchange",e),()=>{i.off("openchange",e)};function e(e){let{reason:t}=e;"reference-press"!==t&&"escape-key"!==t||(a.current=!0)}}),[i,u]),e.useEffect((()=>()=>{clearTimeout(f.current)}),[]);const p=e.useMemo((()=>({onPointerDown(e){B(e.nativeEvent)||(d.current=!1)},onMouseLeave(){a.current=!1},onFocus(e){if(a.current)return;const t=X(e.nativeEvent);if(s&&b(t))try{if(H()&&W().toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints)throw Error();if(!t.matches(":focus-visible"))return}catch(e){if(!d.current&&!U(t))return}o(!0,e.nativeEvent,"focus")},onBlur(e){a.current=!1;const t=e.relatedTarget,n=e.nativeEvent,r=b(t)&&t.hasAttribute(Rt("focus-guard"))&&"outside"===t.getAttribute("data-type");f.current=window.setTimeout((()=>{var e;const i=F(c.domReference?c.domReference.ownerDocument:document);(t||i!==c.domReference)&&(I(null==(e=l.current.floatingContext)?void 0:e.refs.floating.current,i)||I(c.domReference,i)||r||o(!1,n,"focus"))}))}})),[l,c.domReference,o,s]);return e.useMemo((()=>u?{reference:p}:{}),[u,p])},useInteractions:function(t){void 0===t&&(t=[]);const n=t.map((e=>null==e?void 0:e.reference)),r=t.map((e=>null==e?void 0:e.floating)),o=t.map((e=>null==e?void 0:e.item)),i=e.useCallback((e=>mn(e,t,"reference")),n),l=e.useCallback((e=>mn(e,t,"floating")),r),c=e.useCallback((e=>mn(e,t,"item")),o);return e.useMemo((()=>({getReferenceProps:i,getFloatingProps:l,getItemProps:c})),[i,l,c])},useDismiss:function(t,n){void 0===n&&(n={});const{open:r,onOpenChange:o,elements:i,dataRef:l}=t,{enabled:c=!0,escapeKey:u=!0,outsidePress:s=!0,outsidePressEvent:a="pointerdown",referencePress:f=!1,referencePressEvent:d="pointerdown",ancestorScroll:p=!1,bubbles:m,capture:v}=n,h=Et(),g=ft("function"==typeof s?s:()=>!1),y="function"==typeof s?g:s,w=e.useRef(!1),E=e.useRef(!1),{escapeKey:R,outsidePress:C}=an(m),{escapeKey:O,outsidePress:S}=an(v),P=e.useRef(!1),M=ft((e=>{var t;if(!r||!c||!u||"Escape"!==e.key)return;if(P.current)return;const n=null==(t=l.current.floatingContext)?void 0:t.nodeId,i=h?Pt(h.nodesRef.current,n):[];if(!R&&(e.stopPropagation(),i.length>0)){let e=!0;if(i.forEach((t=>{var n;null==(n=t.context)||!n.open||t.context.dataRef.current.__escapeKeyBubbles||(e=!1)})),!e)return}o(!1,function(e){return"nativeEvent"in e}(e)?e.nativeEvent:e,"escape-key")})),D=ft((e=>{var t;const n=()=>{var t;M(e),null==(t=X(e))||t.removeEventListener("keydown",n)};null==(t=X(e))||t.addEventListener("keydown",n)})),F=ft((e=>{var t;const n=w.current;w.current=!1;const r=E.current;if(E.current=!1,"click"===a&&r)return;if(n)return;if("function"==typeof y&&!y(e))return;const c=X(e),u="["+Rt("inert")+"]",s=q(i.floating).querySelectorAll(u);let f=b(c)?c:null;for(;f&&!A(f);){const e=T(f);if(A(e)||!b(e))break;f=e}if(s.length&&b(c)&&!c.matches("html,body")&&!I(c,i.floating)&&Array.from(s).every((e=>!I(f,e))))return;if(x(c)&&B){const t=A(c),n=k(c),r=/auto|scroll/,o=t||r.test(n.overflowX),i=t||r.test(n.overflowY),l=o&&c.clientWidth>0&&c.scrollWidth>c.clientWidth,u=i&&c.clientHeight>0&&c.scrollHeight>c.clientHeight,s="rtl"===n.direction,a=u&&(s?e.offsetX<=c.offsetWidth-c.clientWidth:e.offsetX>c.clientWidth),f=l&&e.offsetY>c.clientHeight;if(a||f)return}const d=null==(t=l.current.floatingContext)?void 0:t.nodeId,p=h&&Pt(h.nodesRef.current,d).some((t=>{var n;return K(e,null==(n=t.context)?void 0:n.elements.floating)}));if(K(e,i.floating)||K(e,i.domReference)||p)return;const m=h?Pt(h.nodesRef.current,d):[];if(m.length>0){let e=!0;if(m.forEach((t=>{var n;null==(n=t.context)||!n.open||t.context.dataRef.current.__outsidePressBubbles||(e=!1)})),!e)return}o(!1,e,"outside-press")})),W=ft((e=>{var t;const n=()=>{var t;F(e),null==(t=X(e))||t.removeEventListener(a,n)};null==(t=X(e))||t.addEventListener(a,n)}));e.useEffect((()=>{if(!r||!c)return;l.current.__escapeKeyBubbles=R,l.current.__outsidePressBubbles=C;let e=-1;function t(e){o(!1,e,"ancestor-scroll")}function n(){window.clearTimeout(e),P.current=!0}function s(){e=window.setTimeout((()=>{P.current=!1}),L()?5:0)}const f=q(i.floating);u&&(f.addEventListener("keydown",O?D:M,O),f.addEventListener("compositionstart",n),f.addEventListener("compositionend",s)),y&&f.addEventListener(a,S?W:F,S);let d=[];return p&&(b(i.domReference)&&(d=N(i.domReference)),b(i.floating)&&(d=d.concat(N(i.floating))),!b(i.reference)&&i.reference&&i.reference.contextElement&&(d=d.concat(N(i.reference.contextElement)))),d=d.filter((e=>{var t;return e!==(null==(t=f.defaultView)?void 0:t.visualViewport)})),d.forEach((e=>{e.addEventListener("scroll",t,{passive:!0})})),()=>{u&&(f.removeEventListener("keydown",O?D:M,O),f.removeEventListener("compositionstart",n),f.removeEventListener("compositionend",s)),y&&f.removeEventListener(a,S?W:F,S),d.forEach((e=>{e.removeEventListener("scroll",t)})),window.clearTimeout(e)}}),[l,i,u,y,a,r,o,p,c,R,C,M,O,D,F,S,W]),e.useEffect((()=>{w.current=!1}),[y,a]);const j=e.useMemo((()=>({onKeyDown:M,...f&&{[un[d]]:e=>{o(!1,e.nativeEvent,"reference-press")},..."click"!==d&&{onClick(e){o(!1,e.nativeEvent,"reference-press")}}}})),[M,o,f,d]),B=e.useMemo((()=>({onKeyDown:M,onMouseDown(){E.current=!0},onMouseUp(){E.current=!0},[sn[a]]:()=>{w.current=!0}})),[M,a]);return e.useMemo((()=>c?{reference:j,floating:B}:{}),[c,j,B])},useHover:function(t,n){void 0===n&&(n={});const{open:r,onOpenChange:o,dataRef:i,events:l,elements:c}=t,{enabled:u=!0,delay:s=0,handleClose:a=null,mouseOnly:f=!1,restMs:d=0,move:p=!0}=n,m=Et(),v=xt(),h=Ct(a),g=Ct(s),y=Ct(r),w=e.useRef(),x=e.useRef(-1),E=e.useRef(),R=e.useRef(-1),C=e.useRef(!0),O=e.useRef(!1),S=e.useRef((()=>{})),L=e.useRef(!1),A=e.useCallback((()=>{var e;const t=null==(e=i.current.openEvent)?void 0:e.type;return(null==t?void 0:t.includes("mouse"))&&"mousedown"!==t}),[i]);e.useEffect((()=>{if(u)return l.on("openchange",e),()=>{l.off("openchange",e)};function e(e){let{open:t}=e;t||(clearTimeout(x.current),clearTimeout(R.current),C.current=!0,L.current=!1)}}),[u,l]),e.useEffect((()=>{if(!u)return;if(!h.current)return;if(!r)return;function e(e){A()&&o(!1,e,"hover")}const t=q(c.floating).documentElement;return t.addEventListener("mouseleave",e),()=>{t.removeEventListener("mouseleave",e)}}),[c.floating,r,o,u,h,A]);const k=e.useCallback((function(e,t,n){void 0===t&&(t=!0),void 0===n&&(n="hover");const r=St(g.current,"close",w.current);r&&!E.current?(clearTimeout(x.current),x.current=window.setTimeout((()=>o(!1,e,n)),r)):t&&(clearTimeout(x.current),o(!1,e,n))}),[g,o]),P=ft((()=>{S.current(),E.current=void 0})),T=ft((()=>{if(O.current){const e=q(c.floating).body;e.style.pointerEvents="",e.removeAttribute(Ot),O.current=!1}})),M=ft((()=>!!i.current.openEvent&&["click","mousedown"].includes(i.current.openEvent.type)));e.useEffect((()=>{if(u&&b(c.domReference)){var e;const o=c.domReference;return r&&o.addEventListener("mouseleave",l),null==(e=c.floating)||e.addEventListener("mouseleave",l),p&&o.addEventListener("mousemove",t,{once:!0}),o.addEventListener("mouseenter",t),o.addEventListener("mouseleave",n),()=>{var e;r&&o.removeEventListener("mouseleave",l),null==(e=c.floating)||e.removeEventListener("mouseleave",l),p&&o.removeEventListener("mousemove",t),o.removeEventListener("mouseenter",t),o.removeEventListener("mouseleave",n)}}function t(e){if(clearTimeout(x.current),C.current=!1,f&&!_(w.current)||d>0&&!St(g.current,"open"))return;const t=St(g.current,"open",w.current);t?x.current=window.setTimeout((()=>{y.current||o(!0,e,"hover")}),t):r||o(!0,e,"hover")}function n(e){if(M())return;S.current();const t=q(c.floating);if(clearTimeout(R.current),L.current=!1,h.current&&i.current.floatingContext){r||clearTimeout(x.current),E.current=h.current({...i.current.floatingContext,tree:m,x:e.clientX,y:e.clientY,onClose(){T(),P(),M()||k(e,!0,"safe-polygon")}});const n=E.current;return t.addEventListener("mousemove",n),void(S.current=()=>{t.removeEventListener("mousemove",n)})}("touch"!==w.current||!I(c.floating,e.relatedTarget))&&k(e)}function l(e){M()||i.current.floatingContext&&(null==h.current||h.current({...i.current.floatingContext,tree:m,x:e.clientX,y:e.clientY,onClose(){T(),P(),M()||k(e)}})(e))}}),[c,u,t,f,d,p,k,P,T,o,r,y,m,g,h,i,M]),dt((()=>{var e;if(u&&r&&null!=(e=h.current)&&e.__options.blockPointerEvents&&A()){O.current=!0;const e=c.floating;if(b(c.domReference)&&e){var t;const n=q(c.floating).body;n.setAttribute(Ot,"");const r=c.domReference,o=null==m||null==(t=m.nodesRef.current.find((e=>e.id===v)))||null==(t=t.context)?void 0:t.elements.floating;return o&&(o.style.pointerEvents=""),n.style.pointerEvents="none",r.style.pointerEvents="auto",e.style.pointerEvents="auto",()=>{n.style.pointerEvents="",r.style.pointerEvents="",e.style.pointerEvents=""}}}}),[u,r,v,c,m,h,A]),dt((()=>{r||(w.current=void 0,L.current=!1,P(),T())}),[r,P,T]),e.useEffect((()=>()=>{P(),clearTimeout(x.current),clearTimeout(R.current),T()}),[u,c.domReference,P,T]);const N=e.useMemo((()=>{function e(e){w.current=e.pointerType}return{onPointerDown:e,onPointerEnter:e,onMouseMove(e){const{nativeEvent:t}=e;function n(){C.current||y.current||o(!0,t,"hover")}f&&!_(w.current)||r||0===d||L.current&&e.movementX**2+e.movementY**2<2||(clearTimeout(R.current),"touch"===w.current?n():(L.current=!0,R.current=window.setTimeout(n,d)))}}}),[f,o,r,y,d]),D=e.useMemo((()=>({onMouseEnter(){clearTimeout(x.current)},onMouseLeave(e){M()||k(e.nativeEvent,!1)}})),[k,M]);return e.useMemo((()=>u?{reference:N,floating:D}:{}),[u,N,D])},flip:(e,t)=>({...Qe(e),options:[e,t]}),shift:(e,t)=>({...Ge(e),options:[e,t]}),hide:(e,t)=>({...Je(e),options:[e,t]}),offset:(e,t)=>({...Ze(e),options:[e,t]}),useMergeRefs:ut},gn="AlertDialog",yn=function(e){var n=e.children,r=e.className,o=void 0===r?"":r,i=e.customRootClass,c=void 0===i?"":i,u=e.open,s=e.onOpenChange,a=void 0===s?function(){}:s,f=e.onClickOutside,p=void 0===f?function(){}:f,v=function(e,t){void 0===e&&(e="");var n=t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();return e?"".concat(e,"-").concat(n):"".concat("rad-ui","-").concat(n)}(c,gn),h=l(u),g=h[0],y=h[1],w=function(e){y(e),a(e)},b=hn.useFloating({open:g,onOpenChange:w}),x=b.context,E=b.refs,R=b.floatingStyles,C=hn.useDismiss(x),O=hn.useRole(x,{role:"dialog"}),S=hn.useInteractions([C,O]),L={isOpen:g,handleOpenChange:w,floaterContext:x,rootClass:v,handleOverlayClick:function(){p()},getReferenceProps:S.getReferenceProps,getFloatingProps:S.getFloatingProps,getItemProps:S.getItemProps,refs:E,floatingStyles:R};return t.createElement(d.Provider,{value:L},t.createElement("div",{className:m(v,o)},n))};yn.displayName=gn;var wn=function(){return wn=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},wn.apply(this,arguments)};function bn(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}"function"==typeof SuppressedError&&SuppressedError;var xn=["div","span","button","input","a","img","p","h2"].reduce((function(e,n){return e[n]=function(e){var n=t.forwardRef((function(n,r){var o=n.asChild,i=void 0!==o&&o,l=n.children,c=bn(n,["asChild","children"]);if(i){var u=t.Children.toArray(l);if(1!==u.length||!t.isValidElement(u[0]))return console.warn("Primitive.".concat(e,": asChild prop requires exactly one valid child element.")),t.createElement(e,wn(wn({},c),{ref:r}),l);var s=u[0];return t.cloneElement(s,wn(wn(wn({},c),s.props),r?{ref:function(e){"function"==typeof r?r(e):r&&(r.current=e);var t=s.ref;"function"==typeof t?t(e):t&&(t.current=e)}}:{}))}return t.createElement(e,wn(wn({},c),{ref:r}),l)}));return n.displayName="Primitive.".concat(e),n}(n),e}),{}),En=function(e){var n=e.role,r=void 0===n?"button":n,o=e.label,i=void 0===o?"":o,l=e.description,c=void 0===l?"":l,u=e.disabled,s=void 0!==u&&u,a=e.children,f=bn(e,["role","label","description","disabled","children"]);return i&&(f["aria-label"]=i),c&&(f["aria-description"]=c),s&&(f["aria-disabled"]="true",c||(f["aria-description"]="Disabled Button")),t.createElement(xn.button,wn({role:r,disabled:s},f),a)},Rn=function(){return console.warn("Direct usage of AlertDialog is not supported. Please use AlertDialog.Root, AlertDialog.Content, etc. instead."),null};Rn.Root=yn,Rn.Trigger=function(e){var n=e.children,r=e.asChild,o=e.className,i=void 0===o?"":o,l=bn(e,["children","asChild","className"]),u=c(d),s=u.rootClass,a=u.handleOpenChange,f=u.getReferenceProps,p=u.refs;return t.createElement(En,wn({ref:p.setReference,asChild:r,onClick:function(){return a(!0)},className:m("".concat(s,"-trigger"),i)},f(),l),n)},Rn.Overlay=function(e){var n=e.className,r=void 0===n?"":n,o=c(d),i=o.isOpen,l=o.rootClass,u=o.handleOverlayClick;return t.createElement(t.Fragment,null,i&&t.createElement(hn.Overlay,{className:m("".concat(l,"-overlay"),r),onClick:u}))},Rn.Portal=function(e){var n=e.children;c(d).rootClass;var r=document.querySelector("#rad-ui-theme-container")||document.body;return t.createElement(hn.Portal,{root:r},n)},Rn.Content=function(e){var n=e.children,r=e.className,o=void 0===r?"":r,i=c(d),l=i.isOpen,u=i.rootClass,s=i.getFloatingProps,a=i.floaterContext,f=i.refs;return t.createElement(t.Fragment,null,l&&t.createElement(hn.FocusManager,{context:a,returnFocus:!0},t.createElement("div",wn({ref:f.setFloating,className:m("".concat(u,"-content"),o)},s()),n)))},Rn.Title=function(e){var n=e.children,r=e.className,o=void 0===r?"":r,i=c(d).rootClass;return t.createElement(xn.h2,{className:"".concat(i,"-title ").concat(o)},n)},Rn.Description=function(e){var n=e.children,r=e.className,o=void 0===r?"":r,i=c(d).rootClass;return t.createElement(xn.p,{className:"".concat(i,"-description ").concat(o)},n)},Rn.Cancel=function(e){var n=e.children,r=e.asChild,o=e.className,i=void 0===o?"":o,l=bn(e,["children","asChild","className"]),u=c(d),s=u.rootClass,a=u.handleOpenChange,f=u.getItemProps;return t.createElement(En,wn({asChild:r,onClick:function(){return a(!1)},className:m("".concat(s,"-cancel"),i)},f(),l),n)},Rn.Action=function(e){var n=e.children,r=e.asChild,o=e.className,i=void 0===o?"":o,l=bn(e,["children","asChild","className"]),u=c(d),s=u.rootClass,a=u.handleOpenChange,f=u.getItemProps;return t.createElement(En,wn({asChild:r,onClick:function(){return a(!1)},className:m("".concat(s,"-action"),i)},f(),l),n)};export{Rn as default};
|
|
5
|
+
*/var ge=["input:not([inert])","select:not([inert])","textarea:not([inert])","a[href]:not([inert])","button:not([inert])","[tabindex]:not(slot):not([inert])","audio[controls]:not([inert])","video[controls]:not([inert])",'[contenteditable]:not([contenteditable="false"]):not([inert])',"details>summary:first-of-type:not([inert])","details:not([inert])"].join(","),ye="undefined"==typeof Element,we=ye?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,be=!ye&&Element.prototype.getRootNode?function(e){var t;return null==e||null===(t=e.getRootNode)||void 0===t?void 0:t.call(e)}:function(e){return null==e?void 0:e.ownerDocument},Ee=function e(t,n){var r;void 0===n&&(n=!0);var o=null==t||null===(r=t.getAttribute)||void 0===r?void 0:r.call(t,"inert");return""===o||"true"===o||n&&t&&e(t.parentNode)},xe=function e(t,n,r){for(var o=[],i=Array.from(t);i.length;){var c=i.shift();if(!Ee(c,!1))if("SLOT"===c.tagName){var l=c.assignedElements(),a=e(l.length?l:c.children,!0,r);r.flatten?o.push.apply(o,a):o.push({scopeParent:c,candidates:a})}else{we.call(c,ge)&&r.filter(c)&&(n||!t.includes(c))&&o.push(c);var u=c.shadowRoot||"function"==typeof r.getShadowRoot&&r.getShadowRoot(c),s=!Ee(u,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(c));if(u&&s){var f=e(!0===u?c.children:u.children,!0,r);r.flatten?o.push.apply(o,f):o.push({scopeParent:c,candidates:f})}else i.unshift.apply(i,c.children)}}return o},Re=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},Ce=function(e){if(!e)throw new Error("No node provided");return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||function(e){var t,n=null==e||null===(t=e.getAttribute)||void 0===t?void 0:t.call(e,"contenteditable");return""===n||"true"===n}(e))&&!Re(e)?0:e.tabIndex},Se=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},ke=function(e){return"INPUT"===e.tagName},Le=function(e){return function(e){return ke(e)&&"radio"===e.type}(e)&&!function(e){if(!e.name)return!0;var t,n=e.form||be(e),r=function(e){return n.querySelectorAll('input[type="radio"][name="'+e+'"]')};if("undefined"!=typeof window&&void 0!==window.CSS&&"function"==typeof window.CSS.escape)t=r(window.CSS.escape(e.name));else try{t=r(e.name)}catch(e){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",e.message),!1}var o=function(e,t){for(var n=0;n<e.length;n++)if(e[n].checked&&e[n].form===t)return e[n]}(t,e.form);return!o||o===e}(e)},Oe=function(e){var t=e.getBoundingClientRect(),n=t.width,r=t.height;return 0===n&&0===r},Pe=function(e,t){var n=t.displayCheck,r=t.getShadowRoot;if("hidden"===getComputedStyle(e).visibility)return!0;var o=we.call(e,"details>summary:first-of-type")?e.parentElement:e;if(we.call(o,"details:not([open]) *"))return!0;if(n&&"full"!==n&&"legacy-full"!==n){if("non-zero-area"===n)return Oe(e)}else{if("function"==typeof r){for(var i=e;e;){var c=e.parentElement,l=be(e);if(c&&!c.shadowRoot&&!0===r(c))return Oe(e);e=e.assignedSlot?e.assignedSlot:c||l===e.ownerDocument?c:l.host}e=i}if(function(e){var t,n,r,o,i=e&&be(e),c=null===(t=i)||void 0===t?void 0:t.host,l=!1;if(i&&i!==e)for(l=!!(null!==(n=c)&&void 0!==n&&null!==(r=n.ownerDocument)&&void 0!==r&&r.contains(c)||null!=e&&null!==(o=e.ownerDocument)&&void 0!==o&&o.contains(e));!l&&c;){var a,u,s;l=!(null===(u=c=null===(a=i=be(c))||void 0===a?void 0:a.host)||void 0===u||null===(s=u.ownerDocument)||void 0===s||!s.contains(c))}return l}(e))return!e.getClientRects().length;if("legacy-full"!==n)return!0}return!1},Te=function(e,t){return!(t.disabled||Ee(t)||function(e){return ke(e)&&"hidden"===e.type}(t)||Pe(t,e)||function(e){return"DETAILS"===e.tagName&&Array.prototype.slice.apply(e.children).some((function(e){return"SUMMARY"===e.tagName}))}(t)||function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var t=e.parentElement;t;){if("FIELDSET"===t.tagName&&t.disabled){for(var n=0;n<t.children.length;n++){var r=t.children.item(n);if("LEGEND"===r.tagName)return!!we.call(t,"fieldset[disabled] *")||!r.contains(e)}return!0}t=t.parentElement}return!1}(t))},Ae=function(e,t){return!(Le(t)||Ce(t)<0||!Te(e,t))},Me=function(e){var t=parseInt(e.getAttribute("tabindex"),10);return!!(isNaN(t)||t>=0)},Ne=function e(t){var n=[],r=[];return t.forEach((function(t,o){var i=!!t.scopeParent,c=i?t.scopeParent:t,l=function(e,t){var n=Ce(e);return n<0&&t&&!Re(e)?0:n}(c,i),a=i?e(t.candidates):c;0===l?i?n.push.apply(n,a):n.push(c):r.push({documentOrder:o,tabIndex:l,item:t,isScope:i,content:a})})),r.sort(Se).reduce((function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e}),[]).concat(n)},De=function(e,t){var n;return n=(t=t||{}).getShadowRoot?xe([e],t.includeContainer,{filter:Ae.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:Me}):function(e,t,n){if(Ee(e))return[];var r=Array.prototype.slice.apply(e.querySelectorAll(ge));return t&&we.call(e,ge)&&r.unshift(e),r.filter(n)}(e,t.includeContainer,Ae.bind(null,t)),Ne(n)};function Ie(e,t,n){let{reference:r,floating:o}=e;const i=fe(t),c=de(t),l=se(c),a=le(t),u="y"===i,s=r.x+r.width/2-o.width/2,f=r.y+r.height/2-o.height/2,d=r[l]/2-o[l]/2;let p;switch(a){case"top":p={x:s,y:r.y-o.height};break;case"bottom":p={x:s,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:f};break;case"left":p={x:r.x-o.width,y:f};break;default:p={x:r.x,y:r.y}}switch(ae(t)){case"start":p[c]-=d*(n&&u?-1:1);break;case"end":p[c]+=d*(n&&u?-1:1)}return p}async function Fe(e,t){var n;void 0===t&&(t={});const{x:r,y:o,platform:i,rects:c,elements:l,strategy:a}=e,{boundary:u="clippingAncestors",rootBoundary:s="viewport",elementContext:f="floating",altBoundary:d=!1,padding:p=0}=ce(t,e),m=ve(p),v=l[d?"floating"===f?"reference":"floating":f],h=he(await i.getClippingRect({element:null==(n=await(null==i.isElement?void 0:i.isElement(v)))||n?v:v.contextElement||await(null==i.getDocumentElement?void 0:i.getDocumentElement(l.floating)),boundary:u,rootBoundary:s,strategy:a})),g="floating"===f?{x:r,y:o,width:c.floating.width,height:c.floating.height}:c.reference,y=await(null==i.getOffsetParent?void 0:i.getOffsetParent(l.floating)),w=await(null==i.isElement?void 0:i.isElement(y))&&await(null==i.getScale?void 0:i.getScale(y))||{x:1,y:1},b=he(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:g,offsetParent:y,strategy:a}):g);return{top:(h.top-b.top+m.top)/w.y,bottom:(b.bottom-h.bottom+m.bottom)/w.y,left:(h.left-b.left+m.left)/w.x,right:(b.right-h.right+m.right)/w.x}}function We(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Be(e){return Q.some((t=>e[t]>=0))}function je(e){const t=N(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=S(e),i=o?e.offsetWidth:n,c=o?e.offsetHeight:r,l=te(n)!==i||te(r)!==c;return l&&(n=i,r=c),{width:n,height:r,$:l}}function _e(e){return C(e)?e:e.contextElement}function He(e){const t=_e(e);if(!S(t))return ne(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=je(t);let c=(i?te(n.width):n.width)/r,l=(i?te(n.height):n.height)/o;return c&&Number.isFinite(c)||(c=1),l&&Number.isFinite(l)||(l=1),{x:c,y:l}}const Ve=ne(0);function Xe(e){const t=E(e);return A()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:Ve}function qe(e,t,n,r){void 0===t&&(t=!1),void 0===n&&(n=!1);const o=e.getBoundingClientRect(),i=_e(e);let c=ne(1);t&&(r?C(r)&&(c=He(r)):c=He(e));const l=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==E(e))&&t}(i,n,r)?Xe(i):ne(0);let a=(o.left+l.x)/c.x,u=(o.top+l.y)/c.y,s=o.width/c.x,f=o.height/c.y;if(i){const e=E(i),t=r&&C(r)?E(r):r;let n=e,o=B(n);for(;o&&r&&t!==n;){const e=He(o),t=o.getBoundingClientRect(),r=N(o),i=t.left+(o.clientLeft+parseFloat(r.paddingLeft))*e.x,c=t.top+(o.clientTop+parseFloat(r.paddingTop))*e.y;a*=e.x,u*=e.y,s*=e.x,f*=e.y,a+=i,u+=c,n=E(o),o=B(n)}}return he({width:s,height:f,x:a,y:u})}function Ye(e,t){const n=D(e).scrollLeft;return t?t.left+n:qe(x(e)).left+n}function Ke(e,t,n){void 0===n&&(n=!1);const r=e.getBoundingClientRect();return{x:r.left+t.scrollLeft-(n?0:Ye(e,r)),y:r.top+t.scrollTop}}function Ue(e,t,n){let r;if("viewport"===t)r=function(e,t){const n=E(e),r=x(e),o=n.visualViewport;let i=r.clientWidth,c=r.clientHeight,l=0,a=0;if(o){i=o.width,c=o.height;const e=A();(!e||e&&"fixed"===t)&&(l=o.offsetLeft,a=o.offsetTop)}return{width:i,height:c,x:l,y:a}}(e,n);else if("document"===t)r=function(e){const t=x(e),n=D(e),r=e.ownerDocument.body,o=ee(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=ee(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let c=-n.scrollLeft+Ye(e);const l=-n.scrollTop;return"rtl"===N(r).direction&&(c+=ee(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:c,y:l}}(x(e));else if(C(t))r=function(e,t){const n=qe(e,!0,"fixed"===t),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=S(e)?He(e):ne(1);return{width:e.clientWidth*i.x,height:e.clientHeight*i.y,x:o*i.x,y:r*i.y}}(t,n);else{const n=Xe(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return he(r)}function $e(e,t){const n=I(e);return!(n===t||!C(n)||M(n))&&("fixed"===N(n).position||$e(n,t))}function ze(e,t,n){const r=S(t),o=x(t),i="fixed"===n,c=qe(e,!0,i,t);let l={scrollLeft:0,scrollTop:0};const a=ne(0);if(r||!r&&!i)if(("body"!==b(t)||L(o))&&(l=D(t)),r){const e=qe(t,!0,i,t);a.x=e.x+t.clientLeft,a.y=e.y+t.clientTop}else o&&(a.x=Ye(o));const u=!o||r||i?ne(0):Ke(o,l);return{x:c.left+l.scrollLeft-a.x-u.x,y:c.top+l.scrollTop-a.y-u.y,width:c.width,height:c.height}}function Ze(e){return"static"===N(e).position}function Ge(e,t){if(!S(e)||"fixed"===N(e).position)return null;if(t)return t(e);let n=e.offsetParent;return x(e)===n&&(n=n.ownerDocument.body),n}function Qe(e,t){const n=E(e);if(P(e))return n;if(!S(e)){let t=I(e);for(;t&&!M(t);){if(C(t)&&!Ze(t))return t;t=I(t)}return n}let r=Ge(e,t);for(;r&&O(r)&&Ze(r);)r=Ge(r,t);return r&&M(r)&&Ze(r)&&!T(r)?n:r||function(e){let t=I(e);for(;S(t)&&!M(t);){if(T(t))return t;if(P(t))return null;t=I(t)}return null}(e)||n}const Je={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i="fixed"===o,c=x(r),l=!!t&&P(t.floating);if(r===c||l&&i)return n;let a={scrollLeft:0,scrollTop:0},u=ne(1);const s=ne(0),f=S(r);if((f||!f&&!i)&&(("body"!==b(r)||L(c))&&(a=D(r)),S(r))){const e=qe(r);u=He(r),s.x=e.x+r.clientLeft,s.y=e.y+r.clientTop}const d=!c||f||i?ne(0):Ke(c,a,!0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-a.scrollLeft*u.x+s.x+d.x,y:n.y*u.y-a.scrollTop*u.y+s.y+d.y}},getDocumentElement:x,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[..."clippingAncestors"===n?P(t)?[]:function(e,t){const n=t.get(e);if(n)return n;let r=W(e,[],!1).filter((e=>C(e)&&"body"!==b(e))),o=null;const i="fixed"===N(e).position;let c=i?I(e):e;for(;C(c)&&!M(c);){const t=N(c),n=T(c);n||"fixed"!==t.position||(o=null),(i?!n&&!o:!n&&"static"===t.position&&o&&["absolute","fixed"].includes(o.position)||L(c)&&!n&&$e(e,c))?r=r.filter((e=>e!==c)):o=t,c=I(c)}return t.set(e,r),r}(t,this._c):[].concat(n),r],c=i[0],l=i.reduce(((e,n)=>{const r=Ue(t,n,o);return e.top=ee(r.top,e.top),e.right=J(r.right,e.right),e.bottom=J(r.bottom,e.bottom),e.left=ee(r.left,e.left),e}),Ue(t,c,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}},getOffsetParent:Qe,getElementRects:async function(e){const t=this.getOffsetParent||Qe,n=this.getDimensions,r=await n(e.floating);return{reference:ze(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:n}=je(e);return{width:t,height:n}},getScale:He,isElement:C,isRTL:function(e){return"rtl"===N(e).direction}},et=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:c,middlewareData:l}=t,a=await async function(e,t){const{placement:n,platform:r,elements:o}=e,i=await(null==r.isRTL?void 0:r.isRTL(o.floating)),c=le(n),l=ae(n),a="y"===fe(n),u=["left","top"].includes(c)?-1:1,s=i&&a?-1:1,f=ce(t,e);let{mainAxis:d,crossAxis:p,alignmentAxis:m}="number"==typeof f?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return l&&"number"==typeof m&&(p="end"===l?-1*m:m),a?{x:p*s,y:d*u}:{x:d*u,y:p*s}}(t,e);return c===(null==(n=l.offset)?void 0:n.placement)&&null!=(r=l.arrow)&&r.alignmentOffset?{}:{x:o+a.x,y:i+a.y,data:{...a,placement:c}}}}},tt=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:i=!0,crossAxis:c=!1,limiter:l={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...a}=ce(e,t),u={x:n,y:r},s=await Fe(t,a),f=fe(le(o)),d=ue(f);let p=u[d],m=u[f];if(i){const e="y"===d?"bottom":"right";p=ie(p+s["y"===d?"top":"left"],p,p-s[e])}if(c){const e="y"===f?"bottom":"right";m=ie(m+s["y"===f?"top":"left"],m,m-s[e])}const v=l.fn({...t,[d]:p,[f]:m});return{...v,data:{x:v.x-n,y:v.y-r,enabled:{[d]:i,[f]:c}}}}}},nt=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:i,rects:c,initialPlacement:l,platform:a,elements:u}=t,{mainAxis:s=!0,crossAxis:f=!0,fallbackPlacements:d,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:v=!0,...h}=ce(e,t);if(null!=(n=i.arrow)&&n.alignmentOffset)return{};const g=le(o),y=fe(l),w=le(l)===l,b=await(null==a.isRTL?void 0:a.isRTL(u.floating)),E=d||(w||!v?[me(l)]:function(e){const t=me(e);return[pe(e),t,pe(t)]}(l)),x="none"!==m;!d&&x&&E.push(...function(e,t,n,r){const o=ae(e);let i=function(e,t,n){const r=["left","right"],o=["right","left"],i=["top","bottom"],c=["bottom","top"];switch(e){case"top":case"bottom":return n?t?o:r:t?r:o;case"left":case"right":return t?i:c;default:return[]}}(le(e),"start"===n,r);return o&&(i=i.map((e=>e+"-"+o)),t&&(i=i.concat(i.map(pe)))),i}(l,v,m,b));const R=[l,...E],C=await Fe(t,h),S=[];let k=(null==(r=i.flip)?void 0:r.overflows)||[];if(s&&S.push(C[g]),f){const e=function(e,t,n){void 0===n&&(n=!1);const r=ae(e),o=de(e),i=se(o);let c="x"===o?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[i]>t.floating[i]&&(c=me(c)),[c,me(c)]}(o,c,b);S.push(C[e[0]],C[e[1]])}if(k=[...k,{placement:o,overflows:S}],!S.every((e=>e<=0))){var L,O;const e=((null==(L=i.flip)?void 0:L.index)||0)+1,t=R[e];if(t)return{data:{index:e,overflows:k},reset:{placement:t}};let n=null==(O=k.filter((e=>e.overflows[0]<=0)).sort(((e,t)=>e.overflows[1]-t.overflows[1]))[0])?void 0:O.placement;if(!n)switch(p){case"bestFit":{var P;const e=null==(P=k.filter((e=>{if(x){const t=fe(e.placement);return t===y||"y"===t}return!0})).map((e=>[e.placement,e.overflows.filter((e=>e>0)).reduce(((e,t)=>e+t),0)])).sort(((e,t)=>e[1]-t[1]))[0])?void 0:P[0];e&&(n=e);break}case"initialPlacement":n=l}if(o!==n)return{reset:{placement:n}}}return{}}}},rt=function(e){return void 0===e&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=ce(e,t);switch(r){case"referenceHidden":{const e=We(await Fe(t,{...o,elementContext:"reference"}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:Be(e)}}}case"escaped":{const e=We(await Fe(t,{...o,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:Be(e)}}}default:return{}}}}},ot=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:c,elements:l,middlewareData:a}=t,{element:u,padding:s=0}=ce(e,t)||{};if(null==u)return{};const f=ve(s),d={x:n,y:r},p=de(o),m=se(p),v=await c.getDimensions(u),h="y"===p,g=h?"top":"left",y=h?"bottom":"right",w=h?"clientHeight":"clientWidth",b=i.reference[m]+i.reference[p]-d[p]-i.floating[m],E=d[p]-i.reference[p],x=await(null==c.getOffsetParent?void 0:c.getOffsetParent(u));let R=x?x[w]:0;R&&await(null==c.isElement?void 0:c.isElement(x))||(R=l.floating[w]||i.floating[m]);const C=b/2-E/2,S=R/2-v[m]/2-1,k=J(f[g],S),L=J(f[y],S),O=k,P=R-v[m]-L,T=R/2-v[m]/2+C,A=ie(O,T,P),M=!a.arrow&&null!=ae(o)&&T!==A&&i.reference[m]/2-(T<O?k:L)-v[m]/2<0,N=M?T<O?T-O:T-P:0;return{[p]:d[p]+N,data:{[p]:A,centerOffset:T-A-N,...M&&{alignmentOffset:N}},reset:M}}}),it=(e,t,n)=>{const r=new Map,o={platform:Je,...n},i={...o.platform,_c:r};return(async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:c}=n,l=i.filter(Boolean),a=await(null==c.isRTL?void 0:c.isRTL(t));let u=await c.getElementRects({reference:e,floating:t,strategy:o}),{x:s,y:f}=Ie(u,r,a),d=r,p={},m=0;for(let n=0;n<l.length;n++){const{name:i,fn:v}=l[n],{x:h,y:g,data:y,reset:w}=await v({x:s,y:f,initialPlacement:r,placement:d,strategy:o,middlewareData:p,rects:u,platform:c,elements:{reference:e,floating:t}});s=null!=h?h:s,f=null!=g?g:f,p={...p,[i]:{...p[i],...y}},w&&m<=50&&(m++,"object"==typeof w&&(w.placement&&(d=w.placement),w.rects&&(u=!0===w.rects?await c.getElementRects({reference:e,floating:t,strategy:o}):w.rects),({x:s,y:f}=Ie(u,d,a))),n=-1)}return{x:s,y:f,placement:d,strategy:o,middlewareData:p}})(e,t,{...o,platform:i})};var ct="undefined"!=typeof document?r:o;function lt(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if("function"==typeof e&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;0!=r--;)if(!lt(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;0!=r--;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;0!=r--;){const n=o[r];if(("_owner"!==n||!e.$$typeof)&&!lt(e[n],t[n]))return!1}return!0}return e!=e&&t!=t}function at(e){if("undefined"==typeof window)return 1;return(e.ownerDocument.defaultView||window).devicePixelRatio||1}function ut(e,t){const n=at(e);return Math.round(t*n)/n}function st(t){const n=e.useRef(t);return ct((()=>{n.current=t})),n}const ft=e=>({name:"arrow",options:e,fn(t){const{element:n,padding:r}="function"==typeof e?e(t):e;return n&&(o=n,{}.hasOwnProperty.call(o,"current"))?null!=n.current?ot({element:n.current,padding:r}).fn(t):{}:n?ot({element:n,padding:r}).fn(t):{};var o}});function dt(t){return e.useMemo((()=>t.every((e=>null==e))?null:e=>{t.forEach((t=>{"function"==typeof t?t(e):null!=t&&(t.current=e)}))}),t)}const pt={...e},mt=pt.useInsertionEffect||(e=>e());function vt(t){const n=e.useRef((()=>{if("production"!==process.env.NODE_ENV)throw new Error("Cannot call an event handler while rendering.")}));return mt((()=>{n.current=t})),e.useCallback((function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return null==n.current?void 0:n.current(...t)}),[])}var ht="undefined"!=typeof document?r:o;let gt=!1,yt=0;const wt=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+yt++;const bt=pt.useId||function(){const[t,n]=e.useState((()=>gt?wt():void 0));return ht((()=>{null==t&&n(wt())}),[]),e.useEffect((()=>{gt=!0}),[]),t};let Et;"production"!==process.env.NODE_ENV&&(Et=new Set);const xt=e.forwardRef((function(t,n){const{context:{placement:r,elements:{floating:o},middlewareData:{arrow:i,shift:c}},width:l=14,height:a=7,tipRadius:f=0,strokeWidth:d=0,staticOffset:p,stroke:m,d:v,style:{transform:h,...g}={},...y}=t;"production"!==process.env.NODE_ENV&&(n||function(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];const o="Floating UI: "+n.join(" ");var i;null!=(e=Et)&&e.has(o)||(null==(i=Et)||i.add(o),console.warn(o))}("The `ref` prop is required for `FloatingArrow`."));const w=bt(),[b,E]=e.useState(!1);if(ht((()=>{if(!o)return;"rtl"===N(o).direction&&E(!0)}),[o]),!o)return null;const[x,R]=r.split("-"),C="top"===x||"bottom"===x;let S=p;(C&&null!=c&&c.x||!C&&null!=c&&c.y)&&(S=null);const k=2*d,L=k/2,O=l/2*(f/-8+1),P=a/2*f/4,T=!!v,A=S&&"end"===R?"bottom":"top";let M=S&&"end"===R?"right":"left";S&&b&&(M="end"===R?"left":"right");const D=null!=(null==i?void 0:i.x)?S||i.x:"",I=null!=(null==i?void 0:i.y)?S||i.y:"",F=v||"M0,0 H"+l+" L"+(l-O)+","+(a-P)+" Q"+l/2+","+a+" "+O+","+(a-P)+" Z",W={top:T?"rotate(180deg)":"",left:T?"rotate(90deg)":"rotate(-90deg)",bottom:T?"":"rotate(180deg)",right:T?"rotate(-90deg)":"rotate(90deg)"}[x];return u("svg",{...y,"aria-hidden":!0,ref:n,width:T?l:l+k,height:l,viewBox:"0 0 "+l+" "+(a>l?a:l),style:{position:"absolute",pointerEvents:"none",[M]:D,[A]:I,[x]:C||T?"100%":"calc(100% - "+k/2+"px)",transform:[W,h].filter((e=>!!e)).join(" "),...g},children:[k>0&&s("path",{clipPath:"url(#"+w+")",fill:"none",stroke:m,strokeWidth:k+(v?0:1),d:F}),s("path",{stroke:k&&!v?y.fill:"none",d:F}),s("clipPath",{id:w,children:s("rect",{x:-L,y:L*(T?-1:1),width:l+k,height:l})})]})}));const Rt=e.createContext(null),Ct=e.createContext(null),St=()=>{var t;return(null==(t=e.useContext(Rt))?void 0:t.id)||null},kt=()=>e.useContext(Ct);function Lt(e){return"data-floating-ui-"+e}function Ot(e){const t=i(e);return ht((()=>{t.current=e})),t}const Pt=Lt("safe-polygon");function Tt(e,t,n){return n&&!K(n)?0:"number"==typeof e?e:null==e?void 0:e[t]}let At=0;function Mt(e,t){void 0===t&&(t={});const{preventScroll:n=!1,cancelPrevious:r=!0,sync:o=!1}=t;r&&cancelAnimationFrame(At);const i=()=>null==e?void 0:e.focus({preventScroll:n});o?i():At=requestAnimationFrame(i)}function Nt(e,t){var n;let r=[],o=null==(n=e.find((e=>e.id===t)))?void 0:n.parentId;for(;o;){const t=e.find((e=>e.id===o));o=null==t?void 0:t.parentId,t&&(r=r.concat(t))}return r}function Dt(e,t){let n=e.filter((e=>{var n;return e.parentId===t&&(null==(n=e.context)?void 0:n.open)})),r=n;for(;r.length;)r=e.filter((e=>{var t;return null==(t=r)?void 0:t.some((t=>{var n;return e.parentId===t.id&&(null==(n=e.context)?void 0:n.open)}))})),n=n.concat(r);return n}let It=new WeakMap,Ft=new WeakSet,Wt={},Bt=0;const jt=e=>e&&(e.host||jt(e.parentNode));function _t(e,t,n,r){const o="data-floating-ui-inert",i=r?"inert":n?"aria-hidden":null,c=(l=t,e.map((e=>{if(l.contains(e))return e;const t=jt(e);return l.contains(t)?t:null})).filter((e=>null!=e)));var l;const a=new Set,u=new Set(c),s=[];Wt[o]||(Wt[o]=new WeakMap);const f=Wt[o];return c.forEach((function e(t){if(!t||a.has(t))return;a.add(t),t.parentNode&&e(t.parentNode)})),function e(t){if(!t||u.has(t))return;[].forEach.call(t.children,(t=>{if("script"!==b(t))if(a.has(t))e(t);else{const e=i?t.getAttribute(i):null,n=null!==e&&"false"!==e,r=It.get(t)||0,c=i?r+1:r,l=(f.get(t)||0)+1;It.set(t,c),f.set(t,l),s.push(t),1===c&&n&&Ft.add(t),1===l&&t.setAttribute(o,""),!n&&i&&t.setAttribute(i,"true")}}))}(t),a.clear(),Bt++,()=>{s.forEach((e=>{const t=It.get(e)||0,n=i?t-1:t,r=(f.get(e)||0)-1;It.set(e,n),f.set(e,r),n||(!Ft.has(e)&&i&&e.removeAttribute(i),Ft.delete(e)),r||e.removeAttribute(o)})),Bt--,Bt||(It=new WeakMap,It=new WeakMap,Ft=new WeakSet,Wt={})}}function Ht(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=!1);const r=U(e[0]).body;return _t(e.concat(Array.from(r.querySelectorAll("[aria-live]"))),r,t,n)}const Vt=()=>({getShadowRoot:!0,displayCheck:"function"==typeof ResizeObserver&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function Xt(e,t){const n=De(e,Vt());"prev"===t&&n.reverse();const r=n.indexOf(j(U(e)));return n.slice(r+1)[0]}function qt(){return Xt(document.body,"next")}function Yt(){return Xt(document.body,"prev")}function Kt(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!_(n,r)}function Ut(e){De(e,Vt()).forEach((e=>{e.dataset.tabindex=e.getAttribute("tabindex")||"",e.setAttribute("tabindex","-1")}))}function $t(e){e.querySelectorAll("[data-tabindex]").forEach((e=>{const t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute("tabindex",t):e.removeAttribute("tabindex")}))}const zt={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"fixed",whiteSpace:"nowrap",width:"1px",top:0,left:0};function Zt(e){"Tab"===e.key&&(e.target,clearTimeout(undefined))}const Gt=e.forwardRef((function(t,n){const[r,o]=e.useState();ht((()=>(q()&&o("button"),document.addEventListener("keydown",Zt),()=>{document.removeEventListener("keydown",Zt)})),[]);const i={ref:n,tabIndex:0,role:r,"aria-hidden":!r||void 0,[Lt("focus-guard")]:"",style:zt};return s("span",{...t,...i})})),Qt=e.createContext(null),Jt=Lt("portal");const en=()=>e.useContext(Qt),tn="data-floating-ui-focusable";function nn(e){return e?e.hasAttribute(tn)?e:e.querySelector("["+tn+"]")||e:null}let rn=[];function on(e){rn=rn.filter((e=>e.isConnected)),e&&"body"!==b(e)&&(rn.push(e),rn.length>20&&(rn=rn.slice(-20)))}function cn(){return rn.slice().reverse().find((e=>e.isConnected))}function ln(e){const t=Vt();return function(e,t){if(t=t||{},!e)throw new Error("No node provided");return!1!==we.call(e,ge)&&Ae(t,e)}(e,t)?e:De(e,t)[0]||e}const an=e.forwardRef((function(e,t){return s("button",{...e,type:"button",ref:t,tabIndex:-1,style:zt})}));let un=0;let sn=()=>{};const fn=e.forwardRef((function(e,t){const{lockScroll:n=!1,...r}=e;return ht((()=>{if(n)return un++,1===un&&(sn=function(){const e=/iP(hone|ad|od)|iOS/.test(H()),t=document.body.style,n=Math.round(document.documentElement.getBoundingClientRect().left)+document.documentElement.scrollLeft?"paddingLeft":"paddingRight",r=window.innerWidth-document.documentElement.clientWidth,o=t.left?parseFloat(t.left):window.scrollX,i=t.top?parseFloat(t.top):window.scrollY;if(t.overflow="hidden",r&&(t[n]=r+"px"),e){var c,l;const e=(null==(c=window.visualViewport)?void 0:c.offsetLeft)||0,n=(null==(l=window.visualViewport)?void 0:l.offsetTop)||0;Object.assign(t,{position:"fixed",top:-(i-Math.floor(n))+"px",left:-(o-Math.floor(e))+"px",right:"0"})}return()=>{Object.assign(t,{overflow:"",[n]:""}),e&&(Object.assign(t,{position:"",top:"",left:"",right:""}),window.scrollTo(o,i))}}()),()=>{un--,0===un&&sn()}}),[n]),s("div",{ref:t,...r,style:{position:"fixed",overflow:"auto",top:0,right:0,bottom:0,left:0,...r.style}})})),dn={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},pn={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},mn=e=>{var t,n;return{escapeKey:"boolean"==typeof e?e:null!=(t=null==e?void 0:e.escapeKey)&&t,outsidePress:"boolean"==typeof e?e:null==(n=null==e?void 0:e.outsidePress)||n}};function vn(t){const{open:n=!1,onOpenChange:r,elements:o}=t,i=bt(),c=e.useRef({}),[l]=e.useState((()=>function(){const e=new Map;return{emit(t,n){var r;null==(r=e.get(t))||r.forEach((e=>e(n)))},on(t,n){e.set(t,[...e.get(t)||[],n])},off(t,n){var r;e.set(t,(null==(r=e.get(t))?void 0:r.filter((e=>e!==n)))||[])}}}())),a=null!=St();if("production"!==process.env.NODE_ENV){const e=o.reference;e&&!C(e)&&function(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];const o="Floating UI: "+n.join(" ");var i;null!=(e=Et)&&e.has(o)||(null==(i=Et)||i.add(o),console.error(o))}("Cannot pass a virtual element to the `elements.reference` option,","as it must be a real DOM element. Use `refs.setPositionReference()`","instead.")}const[u,s]=e.useState(o.reference),f=vt(((e,t,n)=>{c.current.openEvent=e?t:void 0,l.emit("openchange",{open:e,event:t,reason:n,nested:a}),null==r||r(e,t,n)})),d=e.useMemo((()=>({setPositionReference:s})),[]),p=e.useMemo((()=>({reference:u||o.reference||null,floating:o.floating||null,domReference:o.reference})),[u,o.reference,o.floating]);return e.useMemo((()=>({dataRef:c,open:n,onOpenChange:f,elements:p,events:l,floatingId:i,refs:d})),[n,f,p,l,i,d])}const hn="active",gn="selected";function yn(e,t,n){const r=new Map,o="item"===n;let i=e;if(o&&e){const{[hn]:t,[gn]:n,...r}=e;i=r}return{..."floating"===n&&{tabIndex:-1,[tn]:""},...i,...t.map((t=>{const r=t?t[n]:null;return"function"==typeof r?e?r(e):null:r})).concat(e).reduce(((e,t)=>t?(Object.entries(t).forEach((t=>{let[n,i]=t;var c;o&&[hn,gn].includes(n)||(0===n.indexOf("on")?(r.has(n)||r.set(n,[]),"function"==typeof i&&(null==(c=r.get(n))||c.push(i),e[n]=function(){for(var e,t=arguments.length,o=new Array(t),i=0;i<t;i++)o[i]=arguments[i];return null==(e=r.get(n))?void 0:e.map((e=>e(...o))).find((e=>void 0!==e))})):e[n]=i)})),e):e),{})}}const wn=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);var bn={Portal:function(t){const{children:n,id:r,root:o,preserveTabOrder:i=!0}=t,c=function(t){void 0===t&&(t={});const{id:n,root:r}=t,o=bt(),i=en(),[c,l]=e.useState(null),a=e.useRef(null);return ht((()=>()=>{null==c||c.remove(),queueMicrotask((()=>{a.current=null}))}),[c]),ht((()=>{if(!o)return;if(a.current)return;const e=n?document.getElementById(n):null;if(!e)return;const t=document.createElement("div");t.id=o,t.setAttribute(Jt,""),e.appendChild(t),a.current=t,l(t)}),[n,o]),ht((()=>{if(null===r)return;if(!o)return;if(a.current)return;let e=r||(null==i?void 0:i.portalNode);e&&!C(e)&&(e=e.current),e=e||document.body;let t=null;n&&(t=document.createElement("div"),t.id=n,e.appendChild(t));const c=document.createElement("div");c.id=o,c.setAttribute(Jt,""),e=t||e,e.appendChild(c),a.current=c,l(c)}),[n,r,o,i]),c}({id:r,root:o}),[l,a]=e.useState(null),f=e.useRef(null),p=e.useRef(null),m=e.useRef(null),v=e.useRef(null),h=null==l?void 0:l.modal,g=null==l?void 0:l.open,y=!!l&&!l.modal&&l.open&&i&&!(!o&&!c);return e.useEffect((()=>{if(c&&i&&!h)return c.addEventListener("focusin",e,!0),c.addEventListener("focusout",e,!0),()=>{c.removeEventListener("focusin",e,!0),c.removeEventListener("focusout",e,!0)};function e(e){if(c&&Kt(e)){("focusin"===e.type?$t:Ut)(c)}}}),[c,i,h]),e.useEffect((()=>{c&&(g||$t(c))}),[g,c]),u(Qt.Provider,{value:e.useMemo((()=>({preserveTabOrder:i,beforeOutsideRef:f,afterOutsideRef:p,beforeInsideRef:m,afterInsideRef:v,portalNode:c,setFocusManagerState:a})),[i,c]),children:[y&&c&&s(Gt,{"data-type":"outside",ref:f,onFocus:e=>{if(Kt(e,c)){var t;null==(t=m.current)||t.focus()}else{const e=Yt()||(null==l?void 0:l.domReference);null==e||e.focus()}}}),y&&c&&s("span",{"aria-owns":c.id,style:zt}),c&&d.createPortal(n,c),y&&c&&s(Gt,{"data-type":"outside",ref:p,onFocus:e=>{if(Kt(e,c)){var t;null==(t=v.current)||t.focus()}else{const t=qt()||(null==l?void 0:l.domReference);null==t||t.focus(),(null==l?void 0:l.closeOnFocusOut)&&(null==l||l.onOpenChange(!1,e.nativeEvent,"focus-out"))}}})]})},Overlay:fn,FocusManager:function(t){const{context:n,children:r,disabled:o=!1,order:i=["content"],guards:c=!0,initialFocus:l=0,returnFocus:a=!0,restoreFocus:d=!1,modal:p=!0,visuallyHiddenDismiss:m=!1,closeOnFocusOut:v=!0,outsideElementsInert:h=!1}=t,{open:g,onOpenChange:y,events:w,dataRef:b,elements:{domReference:E,floating:x}}=n,R=vt((()=>{var e;return null==(e=b.current.floatingContext)?void 0:e.nodeId})),C="number"==typeof l&&l<0,k=!!(L=E)&&"combobox"===L.getAttribute("role")&&Z(L)&&C;var L;const O="undefined"!=typeof HTMLElement&&"inert"in HTMLElement.prototype,P=!O||c,T=!P||O&&h,A=Ot(i),M=Ot(l),N=Ot(a),D=kt(),I=en(),F=e.useRef(null),W=e.useRef(null),B=e.useRef(!1),H=e.useRef(!1),V=e.useRef(-1),q=null!=I,K=nn(x),$=vt((function(e){return void 0===e&&(e=K),e?De(e,Vt()):[]})),Q=vt((e=>{const t=$(e);return A.current.map((e=>E&&"reference"===e?E:K&&"floating"===e?K:t)).filter(Boolean).flat()}));e.useEffect((()=>{if(o)return;if(!p)return;function e(e){if("Tab"===e.key){_(K,j(U(K)))&&0===$().length&&!k&&G(e);const t=Q(),n=z(e);"reference"===A.current[0]&&n===E&&(G(e),e.shiftKey?Mt(t[t.length-1]):Mt(t[1])),"floating"===A.current[1]&&n===K&&e.shiftKey&&(G(e),Mt(t[0]))}}const t=U(K);return t.addEventListener("keydown",e),()=>{t.removeEventListener("keydown",e)}}),[o,E,K,p,A,k,$,Q]),e.useEffect((()=>{if(!o&&x)return x.addEventListener("focusin",e),()=>{x.removeEventListener("focusin",e)};function e(e){const t=z(e),n=$().indexOf(t);-1!==n&&(V.current=n)}}),[o,x,$]),e.useEffect((()=>{if(!o&&v)return x&&S(E)?(E.addEventListener("focusout",t),E.addEventListener("pointerdown",e),x.addEventListener("focusout",t),()=>{E.removeEventListener("focusout",t),E.removeEventListener("pointerdown",e),x.removeEventListener("focusout",t)}):void 0;function e(){H.current=!0,setTimeout((()=>{H.current=!1}))}function t(e){const t=e.relatedTarget;queueMicrotask((()=>{const n=R(),r=!(_(E,t)||_(x,t)||_(t,x)||_(null==I?void 0:I.portalNode,t)||null!=t&&t.hasAttribute(Lt("focus-guard"))||D&&(Dt(D.nodesRef.current,n).find((e=>{var n,r;return _(null==(n=e.context)?void 0:n.elements.floating,t)||_(null==(r=e.context)?void 0:r.elements.domReference,t)}))||Nt(D.nodesRef.current,n).find((e=>{var n,r,o;return[null==(n=e.context)?void 0:n.elements.floating,nn(null==(r=e.context)?void 0:r.elements.floating)].includes(t)||(null==(o=e.context)?void 0:o.elements.domReference)===t}))));if(d&&r&&j(U(K))===U(K).body){S(K)&&K.focus();const e=V.current,t=$(),n=t[e]||t[t.length-1]||K;S(n)&&n.focus()}!k&&p||!t||!r||H.current||t===cn()||(B.current=!0,y(!1,e,"focus-out"))}))}}),[o,E,x,K,p,D,I,y,v,d,$,k,R]);const J=e.useRef(null),ee=e.useRef(null),te=dt([J,null==I?void 0:I.beforeInsideRef]),ne=dt([ee,null==I?void 0:I.afterInsideRef]);function re(e){return!o&&m&&p?s(an,{ref:"start"===e?F:W,onClick:e=>y(!1,e.nativeEvent),children:"string"==typeof m?m:"Dismiss"}):null}e.useEffect((()=>{var e;if(o)return;if(!x)return;const t=Array.from((null==I||null==(e=I.portalNode)?void 0:e.querySelectorAll("["+Lt("portal")+"]"))||[]),n=D&&!p?Nt(null==D?void 0:D.nodesRef.current,R()).map((e=>{var t;return null==(t=e.context)?void 0:t.elements.floating})):[],r=[x,...t,...n,F.current,W.current,J.current,ee.current,null==I?void 0:I.beforeOutsideRef.current,null==I?void 0:I.afterOutsideRef.current,A.current.includes("reference")||k?E:null].filter((e=>null!=e)),i=p||k?Ht(r,!T,T):Ht(r);return()=>{i()}}),[o,E,x,p,A,I,k,P,T,D,R]),ht((()=>{if(o||!S(K))return;const e=j(U(K));queueMicrotask((()=>{const t=Q(K),n=M.current,r=("number"==typeof n?t[n]:n.current)||K,o=_(K,e);C||o||!g||Mt(r,{preventScroll:r===K})}))}),[o,g,K,C,Q,M]),ht((()=>{if(o||!K)return;let e=!1;const t=U(K),n=j(t);let r=b.current.openEvent;function i(t){let{open:n,reason:o,event:i,nested:c}=t;n&&(r=i),"escape-key"===o&&E&&on(E),["hover","safe-polygon"].includes(o)&&"mouseleave"===i.type&&(B.current=!0),"outside-press"===o&&(c?(B.current=!1,e=!0):B.current=!(function(e){return!(0!==e.mozInputSource||!e.isTrusted)||(Y()&&e.pointerType?"click"===e.type&&1===e.buttons:0===e.detail&&!e.pointerType)}(i)||X(i)))}on(n),w.on("openchange",i);const c=t.createElement("span");return c.setAttribute("tabindex","-1"),c.setAttribute("aria-hidden","true"),Object.assign(c.style,zt),q&&E&&E.insertAdjacentElement("afterend",c),()=>{w.off("openchange",i);const n=j(t),o=_(x,n)||D&&Dt(D.nodesRef.current,R()).some((e=>{var t;return _(null==(t=e.context)?void 0:t.elements.floating,n)}));(o||r&&["click","mousedown"].includes(r.type))&&E&&on(E);const l="boolean"==typeof N.current?cn()||c:N.current.current||c;queueMicrotask((()=>{const r=ln(l);N.current&&!B.current&&S(r)&&(r===n||n===t.body||o)&&r.focus({preventScroll:e}),c.remove()}))}}),[o,x,K,N,b,w,D,q,E,R]),e.useEffect((()=>{queueMicrotask((()=>{B.current=!1}))}),[o]),ht((()=>{if(!o&&I)return I.setFocusManagerState({modal:p,closeOnFocusOut:v,open:g,onOpenChange:y,domReference:E}),()=>{I.setFocusManagerState(null)}}),[o,I,p,g,y,v,E]),ht((()=>{if(o)return;if(!K)return;if("function"!=typeof MutationObserver)return;if(C)return;const e=()=>{const e=K.getAttribute("tabindex"),t=$(),n=j(U(x)),r=t.indexOf(n);-1!==r&&(V.current=r),A.current.includes("floating")||n!==E&&0===t.length?"0"!==e&&K.setAttribute("tabindex","0"):"-1"!==e&&K.setAttribute("tabindex","-1")};e();const t=new MutationObserver(e);return t.observe(K,{childList:!0,subtree:!0,attributes:!0}),()=>{t.disconnect()}}),[o,x,K,E,A,$,C]);const oe=!o&&P&&(!p||!k)&&(q||p);return u(f,{children:[oe&&s(Gt,{"data-type":"inside",ref:te,onFocus:e=>{if(p){const e=Q();Mt("reference"===i[0]?e[0]:e[e.length-1])}else if(null!=I&&I.preserveTabOrder&&I.portalNode)if(B.current=!1,Kt(e,I.portalNode)){const e=qt()||E;null==e||e.focus()}else{var t;null==(t=I.beforeOutsideRef.current)||t.focus()}}}),!k&&re("start"),r,re("end"),oe&&s(Gt,{"data-type":"inside",ref:ne,onFocus:e=>{if(p)Mt(Q()[0]);else if(null!=I&&I.preserveTabOrder&&I.portalNode)if(v&&(B.current=!0),Kt(e,I.portalNode)){const e=Yt()||E;null==e||e.focus()}else{var t;null==(t=I.afterOutsideRef.current)||t.focus()}}})]})},useFloating:function(t){void 0===t&&(t={});const{nodeId:n}=t,r=vn({...t,elements:{reference:null,floating:null,...t.elements}}),o=t.rootContext||r,i=o.elements,[c,l]=e.useState(null),[a,u]=e.useState(null),s=(null==i?void 0:i.domReference)||c,f=e.useRef(null),p=kt();ht((()=>{s&&(f.current=s)}),[s]);const m=function(t){void 0===t&&(t={});const{placement:n="bottom",strategy:r="absolute",middleware:o=[],platform:i,elements:{reference:c,floating:l}={},transform:a=!0,whileElementsMounted:u,open:s}=t,[f,p]=e.useState({x:0,y:0,strategy:r,placement:n,middlewareData:{},isPositioned:!1}),[m,v]=e.useState(o);lt(m,o)||v(o);const[h,g]=e.useState(null),[y,w]=e.useState(null),b=e.useCallback((e=>{e!==C.current&&(C.current=e,g(e))}),[]),E=e.useCallback((e=>{e!==S.current&&(S.current=e,w(e))}),[]),x=c||h,R=l||y,C=e.useRef(null),S=e.useRef(null),k=e.useRef(f),L=null!=u,O=st(u),P=st(i),T=st(s),A=e.useCallback((()=>{if(!C.current||!S.current)return;const e={placement:n,strategy:r,middleware:m};P.current&&(e.platform=P.current),it(C.current,S.current,e).then((e=>{const t={...e,isPositioned:!1!==T.current};M.current&&!lt(k.current,t)&&(k.current=t,d.flushSync((()=>{p(t)})))}))}),[m,n,r,P,T]);ct((()=>{!1===s&&k.current.isPositioned&&(k.current.isPositioned=!1,p((e=>({...e,isPositioned:!1}))))}),[s]);const M=e.useRef(!1);ct((()=>(M.current=!0,()=>{M.current=!1})),[]),ct((()=>{if(x&&(C.current=x),R&&(S.current=R),x&&R){if(O.current)return O.current(x,R,A);A()}}),[x,R,A,O,L]);const N=e.useMemo((()=>({reference:C,floating:S,setReference:b,setFloating:E})),[b,E]),D=e.useMemo((()=>({reference:x,floating:R})),[x,R]),I=e.useMemo((()=>{const e={position:r,left:0,top:0};if(!D.floating)return e;const t=ut(D.floating,f.x),n=ut(D.floating,f.y);return a?{...e,transform:"translate("+t+"px, "+n+"px)",...at(D.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:t,top:n}}),[r,a,D.floating,f.x,f.y]);return e.useMemo((()=>({...f,update:A,refs:N,elements:D,floatingStyles:I})),[f,A,N,D,I])}({...t,elements:{...i,...a&&{reference:a}}}),v=e.useCallback((e=>{const t=C(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),contextElement:e}:e;u(t),m.refs.setReference(t)}),[m.refs]),h=e.useCallback((e=>{(C(e)||null===e)&&(f.current=e,l(e)),(C(m.refs.reference.current)||null===m.refs.reference.current||null!==e&&!C(e))&&m.refs.setReference(e)}),[m.refs]),g=e.useMemo((()=>({...m.refs,setReference:h,setPositionReference:v,domReference:f})),[m.refs,h,v]),y=e.useMemo((()=>({...m.elements,domReference:s})),[m.elements,s]),w=e.useMemo((()=>({...m,...o,refs:g,elements:y,nodeId:n})),[m,g,y,n,o]);return ht((()=>{o.dataRef.current.floatingContext=w;const e=null==p?void 0:p.nodesRef.current.find((e=>e.id===n));e&&(e.context=w)})),e.useMemo((()=>({...m,context:w,refs:g,elements:y})),[m,g,y,w])},Arrow:xt,arrow:(e,t)=>({...ft(e),options:[e,t]}),useRole:function(t,n){var r;void 0===n&&(n={});const{open:o,floatingId:i}=t,{enabled:c=!0,role:l="dialog"}=n,a=null!=(r=wn.get(l))?r:l,u=bt(),s=null!=St(),f=e.useMemo((()=>"tooltip"===a||"label"===l?{["aria-"+("label"===l?"labelledby":"describedby")]:o?i:void 0}:{"aria-expanded":o?"true":"false","aria-haspopup":"alertdialog"===a?"dialog":a,"aria-controls":o?i:void 0,..."listbox"===a&&{role:"combobox"},..."menu"===a&&{id:u},..."menu"===a&&s&&{role:"menuitem"},..."select"===l&&{"aria-autocomplete":"none"},..."combobox"===l&&{"aria-autocomplete":"list"}}),[a,i,s,o,u,l]),d=e.useMemo((()=>{const e={id:i,...a&&{role:a}};return"tooltip"===a||"label"===l?e:{...e,..."menu"===a&&{"aria-labelledby":u}}}),[a,i,u,l]),p=e.useCallback((e=>{let{active:t,selected:n}=e;const r={role:"option",...t&&{id:i+"-option"}};switch(l){case"select":return{...r,"aria-selected":t&&n};case"combobox":return{...r,...t&&{"aria-selected":!0}}}return{}}),[i,l]);return e.useMemo((()=>c?{reference:f,floating:d,item:p}:{}),[c,f,d,p])},useFocus:function(t,n){void 0===n&&(n={});const{open:r,onOpenChange:o,events:i,dataRef:c,elements:l}=t,{enabled:a=!0,visibleOnly:u=!0}=n,s=e.useRef(!1),f=e.useRef(),d=e.useRef(!0);e.useEffect((()=>{if(!a)return;const e=E(l.domReference);function t(){!r&&S(l.domReference)&&l.domReference===j(U(l.domReference))&&(s.current=!0)}function n(){d.current=!0}return e.addEventListener("blur",t),e.addEventListener("keydown",n,!0),()=>{e.removeEventListener("blur",t),e.removeEventListener("keydown",n,!0)}}),[l.domReference,r,a]),e.useEffect((()=>{if(a)return i.on("openchange",e),()=>{i.off("openchange",e)};function e(e){let{reason:t}=e;"reference-press"!==t&&"escape-key"!==t||(s.current=!0)}}),[i,a]),e.useEffect((()=>()=>{clearTimeout(f.current)}),[]);const p=e.useMemo((()=>({onPointerDown(e){X(e.nativeEvent)||(d.current=!1)},onMouseLeave(){s.current=!1},onFocus(e){if(s.current)return;const t=z(e.nativeEvent);if(u&&C(t))try{if(q()&&H().toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints)throw Error();if(!t.matches(":focus-visible"))return}catch(e){if(!d.current&&!Z(t))return}o(!0,e.nativeEvent,"focus")},onBlur(e){s.current=!1;const t=e.relatedTarget,n=e.nativeEvent,r=C(t)&&t.hasAttribute(Lt("focus-guard"))&&"outside"===t.getAttribute("data-type");f.current=window.setTimeout((()=>{var e;const i=j(l.domReference?l.domReference.ownerDocument:document);(t||i!==l.domReference)&&(_(null==(e=c.current.floatingContext)?void 0:e.refs.floating.current,i)||_(l.domReference,i)||r||o(!1,n,"focus"))}))}})),[c,l.domReference,o,u]);return e.useMemo((()=>a?{reference:p}:{}),[a,p])},useInteractions:function(t){void 0===t&&(t=[]);const n=t.map((e=>null==e?void 0:e.reference)),r=t.map((e=>null==e?void 0:e.floating)),o=t.map((e=>null==e?void 0:e.item)),i=e.useCallback((e=>yn(e,t,"reference")),n),c=e.useCallback((e=>yn(e,t,"floating")),r),l=e.useCallback((e=>yn(e,t,"item")),o);return e.useMemo((()=>({getReferenceProps:i,getFloatingProps:c,getItemProps:l})),[i,c,l])},useDismiss:function(t,n){void 0===n&&(n={});const{open:r,onOpenChange:o,elements:i,dataRef:c}=t,{enabled:l=!0,escapeKey:a=!0,outsidePress:u=!0,outsidePressEvent:s="pointerdown",referencePress:f=!1,referencePressEvent:d="pointerdown",ancestorScroll:p=!1,bubbles:m,capture:v}=n,h=kt(),g=vt("function"==typeof u?u:()=>!1),y="function"==typeof u?g:u,w=e.useRef(!1),b=e.useRef(!1),{escapeKey:E,outsidePress:x}=mn(m),{escapeKey:R,outsidePress:k}=mn(v),L=e.useRef(!1),O=vt((e=>{var t;if(!r||!l||!a||"Escape"!==e.key)return;if(L.current)return;const n=null==(t=c.current.floatingContext)?void 0:t.nodeId,i=h?Dt(h.nodesRef.current,n):[];if(!E&&(e.stopPropagation(),i.length>0)){let e=!0;if(i.forEach((t=>{var n;null==(n=t.context)||!n.open||t.context.dataRef.current.__escapeKeyBubbles||(e=!1)})),!e)return}o(!1,function(e){return"nativeEvent"in e}(e)?e.nativeEvent:e,"escape-key")})),P=vt((e=>{var t;const n=()=>{var t;O(e),null==(t=z(e))||t.removeEventListener("keydown",n)};null==(t=z(e))||t.addEventListener("keydown",n)})),T=vt((e=>{var t;const n=w.current;w.current=!1;const r=b.current;if(b.current=!1,"click"===s&&r)return;if(n)return;if("function"==typeof y&&!y(e))return;const l=z(e),a="["+Lt("inert")+"]",u=U(i.floating).querySelectorAll(a);let f=C(l)?l:null;for(;f&&!M(f);){const e=I(f);if(M(e)||!C(e))break;f=e}if(u.length&&C(l)&&!l.matches("html,body")&&!_(l,i.floating)&&Array.from(u).every((e=>!_(f,e))))return;if(S(l)&&B){const t=M(l),n=N(l),r=/auto|scroll/,o=t||r.test(n.overflowX),i=t||r.test(n.overflowY),c=o&&l.clientWidth>0&&l.scrollWidth>l.clientWidth,a=i&&l.clientHeight>0&&l.scrollHeight>l.clientHeight,u="rtl"===n.direction,s=a&&(u?e.offsetX<=l.offsetWidth-l.clientWidth:e.offsetX>l.clientWidth),f=c&&e.offsetY>l.clientHeight;if(s||f)return}const d=null==(t=c.current.floatingContext)?void 0:t.nodeId,p=h&&Dt(h.nodesRef.current,d).some((t=>{var n;return $(e,null==(n=t.context)?void 0:n.elements.floating)}));if($(e,i.floating)||$(e,i.domReference)||p)return;const m=h?Dt(h.nodesRef.current,d):[];if(m.length>0){let e=!0;if(m.forEach((t=>{var n;null==(n=t.context)||!n.open||t.context.dataRef.current.__outsidePressBubbles||(e=!1)})),!e)return}o(!1,e,"outside-press")})),D=vt((e=>{var t;const n=()=>{var t;T(e),null==(t=z(e))||t.removeEventListener(s,n)};null==(t=z(e))||t.addEventListener(s,n)}));e.useEffect((()=>{if(!r||!l)return;c.current.__escapeKeyBubbles=E,c.current.__outsidePressBubbles=x;let e=-1;function t(e){o(!1,e,"ancestor-scroll")}function n(){window.clearTimeout(e),L.current=!0}function u(){e=window.setTimeout((()=>{L.current=!1}),A()?5:0)}const f=U(i.floating);a&&(f.addEventListener("keydown",R?P:O,R),f.addEventListener("compositionstart",n),f.addEventListener("compositionend",u)),y&&f.addEventListener(s,k?D:T,k);let d=[];return p&&(C(i.domReference)&&(d=W(i.domReference)),C(i.floating)&&(d=d.concat(W(i.floating))),!C(i.reference)&&i.reference&&i.reference.contextElement&&(d=d.concat(W(i.reference.contextElement)))),d=d.filter((e=>{var t;return e!==(null==(t=f.defaultView)?void 0:t.visualViewport)})),d.forEach((e=>{e.addEventListener("scroll",t,{passive:!0})})),()=>{a&&(f.removeEventListener("keydown",R?P:O,R),f.removeEventListener("compositionstart",n),f.removeEventListener("compositionend",u)),y&&f.removeEventListener(s,k?D:T,k),d.forEach((e=>{e.removeEventListener("scroll",t)})),window.clearTimeout(e)}}),[c,i,a,y,s,r,o,p,l,E,x,O,R,P,T,k,D]),e.useEffect((()=>{w.current=!1}),[y,s]);const F=e.useMemo((()=>({onKeyDown:O,...f&&{[dn[d]]:e=>{o(!1,e.nativeEvent,"reference-press")},..."click"!==d&&{onClick(e){o(!1,e.nativeEvent,"reference-press")}}}})),[O,o,f,d]),B=e.useMemo((()=>({onKeyDown:O,onMouseDown(){b.current=!0},onMouseUp(){b.current=!0},[pn[s]]:()=>{w.current=!0}})),[O,s]);return e.useMemo((()=>l?{reference:F,floating:B}:{}),[l,F,B])},useHover:function(t,n){void 0===n&&(n={});const{open:r,onOpenChange:o,dataRef:i,events:c,elements:l}=t,{enabled:a=!0,delay:u=0,handleClose:s=null,mouseOnly:f=!1,restMs:d=0,move:p=!0}=n,m=kt(),v=St(),h=Ot(s),g=Ot(u),y=Ot(r),w=e.useRef(),b=e.useRef(-1),E=e.useRef(),x=e.useRef(-1),R=e.useRef(!0),S=e.useRef(!1),k=e.useRef((()=>{})),L=e.useRef(!1),O=e.useCallback((()=>{var e;const t=null==(e=i.current.openEvent)?void 0:e.type;return(null==t?void 0:t.includes("mouse"))&&"mousedown"!==t}),[i]);e.useEffect((()=>{if(a)return c.on("openchange",e),()=>{c.off("openchange",e)};function e(e){let{open:t}=e;t||(clearTimeout(b.current),clearTimeout(x.current),R.current=!0,L.current=!1)}}),[a,c]),e.useEffect((()=>{if(!a)return;if(!h.current)return;if(!r)return;function e(e){O()&&o(!1,e,"hover")}const t=U(l.floating).documentElement;return t.addEventListener("mouseleave",e),()=>{t.removeEventListener("mouseleave",e)}}),[l.floating,r,o,a,h,O]);const P=e.useCallback((function(e,t,n){void 0===t&&(t=!0),void 0===n&&(n="hover");const r=Tt(g.current,"close",w.current);r&&!E.current?(clearTimeout(b.current),b.current=window.setTimeout((()=>o(!1,e,n)),r)):t&&(clearTimeout(b.current),o(!1,e,n))}),[g,o]),T=vt((()=>{k.current(),E.current=void 0})),A=vt((()=>{if(S.current){const e=U(l.floating).body;e.style.pointerEvents="",e.removeAttribute(Pt),S.current=!1}})),M=vt((()=>!!i.current.openEvent&&["click","mousedown"].includes(i.current.openEvent.type)));e.useEffect((()=>{if(a&&C(l.domReference)){var e;const o=l.domReference;return r&&o.addEventListener("mouseleave",c),null==(e=l.floating)||e.addEventListener("mouseleave",c),p&&o.addEventListener("mousemove",t,{once:!0}),o.addEventListener("mouseenter",t),o.addEventListener("mouseleave",n),()=>{var e;r&&o.removeEventListener("mouseleave",c),null==(e=l.floating)||e.removeEventListener("mouseleave",c),p&&o.removeEventListener("mousemove",t),o.removeEventListener("mouseenter",t),o.removeEventListener("mouseleave",n)}}function t(e){if(clearTimeout(b.current),R.current=!1,f&&!K(w.current)||d>0&&!Tt(g.current,"open"))return;const t=Tt(g.current,"open",w.current);t?b.current=window.setTimeout((()=>{y.current||o(!0,e,"hover")}),t):r||o(!0,e,"hover")}function n(e){if(M())return;k.current();const t=U(l.floating);if(clearTimeout(x.current),L.current=!1,h.current&&i.current.floatingContext){r||clearTimeout(b.current),E.current=h.current({...i.current.floatingContext,tree:m,x:e.clientX,y:e.clientY,onClose(){A(),T(),M()||P(e,!0,"safe-polygon")}});const n=E.current;return t.addEventListener("mousemove",n),void(k.current=()=>{t.removeEventListener("mousemove",n)})}("touch"!==w.current||!_(l.floating,e.relatedTarget))&&P(e)}function c(e){M()||i.current.floatingContext&&(null==h.current||h.current({...i.current.floatingContext,tree:m,x:e.clientX,y:e.clientY,onClose(){A(),T(),M()||P(e)}})(e))}}),[l,a,t,f,d,p,P,T,A,o,r,y,m,g,h,i,M]),ht((()=>{var e;if(a&&r&&null!=(e=h.current)&&e.__options.blockPointerEvents&&O()){S.current=!0;const e=l.floating;if(C(l.domReference)&&e){var t;const n=U(l.floating).body;n.setAttribute(Pt,"");const r=l.domReference,o=null==m||null==(t=m.nodesRef.current.find((e=>e.id===v)))||null==(t=t.context)?void 0:t.elements.floating;return o&&(o.style.pointerEvents=""),n.style.pointerEvents="none",r.style.pointerEvents="auto",e.style.pointerEvents="auto",()=>{n.style.pointerEvents="",r.style.pointerEvents="",e.style.pointerEvents=""}}}}),[a,r,v,l,m,h,O]),ht((()=>{r||(w.current=void 0,L.current=!1,T(),A())}),[r,T,A]),e.useEffect((()=>()=>{T(),clearTimeout(b.current),clearTimeout(x.current),A()}),[a,l.domReference,T,A]);const N=e.useMemo((()=>{function e(e){w.current=e.pointerType}return{onPointerDown:e,onPointerEnter:e,onMouseMove(e){const{nativeEvent:t}=e;function n(){R.current||y.current||o(!0,t,"hover")}f&&!K(w.current)||r||0===d||L.current&&e.movementX**2+e.movementY**2<2||(clearTimeout(x.current),"touch"===w.current?n():(L.current=!0,x.current=window.setTimeout(n,d)))}}}),[f,o,r,y,d]),D=e.useMemo((()=>({onMouseEnter(){clearTimeout(b.current)},onMouseLeave(e){M()||P(e.nativeEvent,!1)}})),[P,M]);return e.useMemo((()=>a?{reference:N,floating:D}:{}),[a,N,D])},flip:(e,t)=>({...nt(e),options:[e,t]}),shift:(e,t)=>({...tt(e),options:[e,t]}),hide:(e,t)=>({...rt(e),options:[e,t]}),offset:(e,t)=>({...et(e),options:[e,t]}),useMergeRefs:dt},En=function(e){var n=e.children,r=e.open,o=void 0!==r&&r,i=e.onOpenChange,l=void 0===i?function(){}:i,a=e.onClickOutside,u=void 0===a?function(){}:a,s=e.className,f=m(e,["children","open","onOpenChange","onClickOutside","className"]),d=c(o),v=d[0],h=d[1],g=function(e){h(e),l(e)},w=bn.useFloating({open:v,onOpenChange:g}),b=w.context,E=w.refs,x=w.floatingStyles,R=bn.useDismiss(b),C=bn.useRole(b,{role:"dialog"}),S=bn.useInteractions([R,C]),k={isOpen:v,handleOpenChange:g,floaterContext:b,handleOverlayClick:function(){u()},getReferenceProps:S.getReferenceProps,getFloatingProps:S.getFloatingProps,getItemProps:S.getItemProps,refs:E,floatingStyles:x};return t.createElement(y.Provider,{value:k},t.createElement("div",p({},f,{className:s}),n))};En.displayName="DialogPrimitive";var xn=["div","span","button","input","a","img","p","h2","label"].reduce((function(e,n){return e[n]=function(e){var n=t.forwardRef((function(n,r){var o=n.asChild,i=void 0!==o&&o,c=n.children,l=m(n,["asChild","children"]);if(i){var a=t.Children.toArray(c);if(1!==a.length||!t.isValidElement(a[0]))return console.warn("Primitive.".concat(e,": asChild prop requires exactly one valid child element.")),t.createElement(e,p(p({},l),{ref:r}),c);var u=a[0];return t.cloneElement(u,p(p(p({},l),u.props),r?{ref:function(e){"function"==typeof r?r(e):r&&(r.current=e);var t=u.ref;"function"==typeof t?t(e):t&&(t.current=e)}}:{}))}return t.createElement(e,p(p({},l),{ref:r}),c)}));return n.displayName="Primitive.".concat(e),n}(n),e}),{}),Rn=l((function(e,n){var r=e.role,o=void 0===r?"button":r,i=e.label,c=void 0===i?"":i,l=e.description,a=void 0===l?"":l,u=e.disabled,s=void 0!==u&&u,f=e.children,d=m(e,["role","label","description","disabled","children"]);return c&&(d["aria-label"]=c),a&&(d["aria-description"]=a),s&&(d["aria-disabled"]="true",a||(d["aria-description"]="Disabled Button")),t.createElement(xn.button,p({ref:n,role:o,disabled:s},d),f)}));Rn.displayName="ButtonPrimitive";var Cn="right-scroll-bar-position",Sn="width-before-scroll-bar";function kn(e,t){return"function"==typeof e?e(t):e&&(e.current=t),e}var Ln="undefined"!=typeof window?e.useLayoutEffect:e.useEffect,On=new WeakMap;function Pn(e,t){var n,r,o,i=(n=null,r=function(t){return e.forEach((function(e){return kn(e,t)}))},(o=c((function(){return{value:n,callback:r,facade:{get current(){return o.value},set current(e){var t=o.value;t!==e&&(o.value=e,o.callback(e,t))}}}}))[0]).callback=r,o.facade);return Ln((function(){var t=On.get(i);if(t){var n=new Set(t),r=new Set(e),o=i.current;n.forEach((function(e){r.has(e)||kn(e,null)})),r.forEach((function(e){n.has(e)||kn(e,o)}))}On.set(i,e)}),[e]),i}function Tn(e){return e}var An=function(t){var n=t.sideCar,r=m(t,["sideCar"]);if(!n)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var o=n.read();if(!o)throw new Error("Sidecar medium not found");return e.createElement(o,p({},r))};An.isSideCarExport=!0;var Mn=function(e){void 0===e&&(e={});var t=function(e,t){void 0===t&&(t=Tn);var n=[],r=!1;return{read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var o=t(e,r);return n.push(o),function(){n=n.filter((function(e){return e!==o}))}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var o=n;n=[],o.forEach(e),t=n}var i=function(){var n=t;t=[],n.forEach(e)},c=function(){return Promise.resolve().then(i)};c(),n={push:function(e){t.push(e),c()},filter:function(e){return t=t.filter(e),n}}}}}(null);return t.options=p({async:!0,ssr:!1},e),t}(),Nn=function(){},Dn=e.forwardRef((function(t,n){var r=e.useRef(null),o=e.useState({onScrollCapture:Nn,onWheelCapture:Nn,onTouchMoveCapture:Nn}),i=o[0],c=o[1],l=t.forwardProps,a=t.children,u=t.className,s=t.removeScrollBar,f=t.enabled,d=t.shards,v=t.sideCar,h=t.noRelative,g=t.noIsolation,y=t.inert,w=t.allowPinchZoom,b=t.as,E=void 0===b?"div":b,x=t.gapMode,R=m(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),C=v,S=Pn([r,n]),k=p(p({},R),i);return e.createElement(e.Fragment,null,f&&e.createElement(C,{sideCar:Mn,removeScrollBar:s,shards:d,noRelative:h,noIsolation:g,inert:y,setCallbacks:c,allowPinchZoom:!!w,lockRef:r,gapMode:x}),l?e.cloneElement(e.Children.only(a),p(p({},k),{ref:S})):e.createElement(E,p({},k,{className:u,ref:S}),a))}));Dn.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},Dn.classNames={fullWidth:Sn,zeroRight:Cn};function In(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=function(){if("undefined"!=typeof __webpack_nonce__)return __webpack_nonce__}();return t&&e.setAttribute("nonce",t),e}var Fn=function(){var e=0,t=null;return{add:function(n){var r,o;0==e&&(t=In())&&(o=n,(r=t).styleSheet?r.styleSheet.cssText=o:r.appendChild(document.createTextNode(o)),function(e){(document.head||document.getElementsByTagName("head")[0]).appendChild(e)}(t)),e++},remove:function(){! --e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Wn=function(){var t,n=(t=Fn(),function(n,r){e.useEffect((function(){return t.add(n),function(){t.remove()}}),[n&&r])});return function(e){var t=e.styles,r=e.dynamic;return n(t,r),null}},Bn={left:0,top:0,right:0,gap:0},jn=function(e){return parseInt(e||"",10)||0},_n=function(e){if(void 0===e&&(e="margin"),"undefined"==typeof window)return Bn;var t=function(e){var t=window.getComputedStyle(document.body),n=t["padding"===e?"paddingLeft":"marginLeft"],r=t["padding"===e?"paddingTop":"marginTop"],o=t["padding"===e?"paddingRight":"marginRight"];return[jn(n),jn(r),jn(o)]}(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},Hn=Wn(),Vn="data-scroll-locked",Xn=function(e,t,n,r){var o=e.left,i=e.top,c=e.right,l=e.gap;return void 0===n&&(n="margin"),"\n .".concat("with-scroll-bars-hidden"," {\n overflow: hidden ").concat(r,";\n padding-right: ").concat(l,"px ").concat(r,";\n }\n body[").concat(Vn,"] {\n overflow: hidden ").concat(r,";\n overscroll-behavior: contain;\n ").concat([t&&"position: relative ".concat(r,";"),"margin"===n&&"\n padding-left: ".concat(o,"px;\n padding-top: ").concat(i,"px;\n padding-right: ").concat(c,"px;\n margin-left:0;\n margin-top:0;\n margin-right: ").concat(l,"px ").concat(r,";\n "),"padding"===n&&"padding-right: ".concat(l,"px ").concat(r,";")].filter(Boolean).join(""),"\n }\n \n .").concat(Cn," {\n right: ").concat(l,"px ").concat(r,";\n }\n \n .").concat(Sn," {\n margin-right: ").concat(l,"px ").concat(r,";\n }\n \n .").concat(Cn," .").concat(Cn," {\n right: 0 ").concat(r,";\n }\n \n .").concat(Sn," .").concat(Sn," {\n margin-right: 0 ").concat(r,";\n }\n \n body[").concat(Vn,"] {\n ").concat("--removed-body-scroll-bar-size",": ").concat(l,"px;\n }\n")},qn=function(){var e=parseInt(document.body.getAttribute(Vn)||"0",10);return isFinite(e)?e:0},Yn=function(t){var n=t.noRelative,r=t.noImportant,o=t.gapMode,i=void 0===o?"margin":o;e.useEffect((function(){return document.body.setAttribute(Vn,(qn()+1).toString()),function(){var e=qn()-1;e<=0?document.body.removeAttribute(Vn):document.body.setAttribute(Vn,e.toString())}}),[]);var c=e.useMemo((function(){return _n(i)}),[i]);return e.createElement(Hn,{styles:Xn(c,!n,i,r?"":"!important")})},Kn=!1;if("undefined"!=typeof window)try{var Un=Object.defineProperty({},"passive",{get:function(){return Kn=!0,!0}});window.addEventListener("test",Un,Un),window.removeEventListener("test",Un,Un)}catch(e){Kn=!1}var $n=!!Kn&&{passive:!1},zn=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return"hidden"!==n[t]&&!(n.overflowY===n.overflowX&&!function(e){return"TEXTAREA"===e.tagName}(e)&&"visible"===n[t])},Zn=function(e,t){var n=t.ownerDocument,r=t;do{if("undefined"!=typeof ShadowRoot&&r instanceof ShadowRoot&&(r=r.host),Gn(e,r)){var o=Qn(e,r);if(o[1]>o[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Gn=function(e,t){return"v"===e?function(e){return zn(e,"overflowY")}(t):function(e){return zn(e,"overflowX")}(t)},Qn=function(e,t){return"v"===e?[(n=t).scrollTop,n.scrollHeight,n.clientHeight]:function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]}(t);var n},Jn=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},er=function(e){return[e.deltaX,e.deltaY]},tr=function(e){return e&&"current"in e?e.current:e},nr=function(e){return"\n .block-interactivity-".concat(e," {pointer-events: none;}\n .allow-interactivity-").concat(e," {pointer-events: all;}\n")},rr=0,or=[];function ir(e){for(var t=null;null!==e;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var cr,lr=(cr=function(t){var n=e.useRef([]),r=e.useRef([0,0]),o=e.useRef(),i=e.useState(rr++)[0],c=e.useState(Wn)[0],l=e.useRef(t);e.useEffect((function(){l.current=t}),[t]),e.useEffect((function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(i));var e=function(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))}([t.lockRef.current],(t.shards||[]).map(tr),!0).filter(Boolean);return e.forEach((function(e){return e.classList.add("allow-interactivity-".concat(i))})),function(){document.body.classList.remove("block-interactivity-".concat(i)),e.forEach((function(e){return e.classList.remove("allow-interactivity-".concat(i))}))}}}),[t.inert,t.lockRef.current,t.shards]);var a=e.useCallback((function(e,t){if("touches"in e&&2===e.touches.length||"wheel"===e.type&&e.ctrlKey)return!l.current.allowPinchZoom;var n,i=Jn(e),c=r.current,a="deltaX"in e?e.deltaX:c[0]-i[0],u="deltaY"in e?e.deltaY:c[1]-i[1],s=e.target,f=Math.abs(a)>Math.abs(u)?"h":"v";if("touches"in e&&"h"===f&&"range"===s.type)return!1;var d=Zn(f,s);if(!d)return!0;if(d?n=f:(n="v"===f?"h":"v",d=Zn(f,s)),!d)return!1;if(!o.current&&"changedTouches"in e&&(a||u)&&(o.current=n),!n)return!0;var p=o.current||n;return function(e,t,n,r){var o=function(e,t){return"h"===e&&"rtl"===t?-1:1}(e,window.getComputedStyle(t).direction),i=o*r,c=n.target,l=t.contains(c),a=!1,u=i>0,s=0,f=0;do{var d=Qn(e,c),p=d[0],m=d[1]-d[2]-o*p;(p||m)&&Gn(e,c)&&(s+=m,f+=p),c=c.parentNode.host||c.parentNode}while(!l&&c!==document.body||l&&(t.contains(c)||t===c));return(u&&Math.abs(s)<1||!u&&Math.abs(f)<1)&&(a=!0),a}(p,t,e,"h"===p?a:u)}),[]),u=e.useCallback((function(e){var t=e;if(or.length&&or[or.length-1]===c){var r="deltaY"in t?er(t):Jn(t),o=n.current.filter((function(e){return e.name===t.type&&(e.target===t.target||t.target===e.shadowParent)&&(n=e.delta,o=r,n[0]===o[0]&&n[1]===o[1]);var n,o}))[0];if(o&&o.should)t.cancelable&&t.preventDefault();else if(!o){var i=(l.current.shards||[]).map(tr).filter(Boolean).filter((function(e){return e.contains(t.target)}));(i.length>0?a(t,i[0]):!l.current.noIsolation)&&t.cancelable&&t.preventDefault()}}}),[]),s=e.useCallback((function(e,t,r,o){var i={name:e,delta:t,target:r,should:o,shadowParent:ir(r)};n.current.push(i),setTimeout((function(){n.current=n.current.filter((function(e){return e!==i}))}),1)}),[]),f=e.useCallback((function(e){r.current=Jn(e),o.current=void 0}),[]),d=e.useCallback((function(e){s(e.type,er(e),e.target,a(e,t.lockRef.current))}),[]),p=e.useCallback((function(e){s(e.type,Jn(e),e.target,a(e,t.lockRef.current))}),[]);e.useEffect((function(){return or.push(c),t.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:p}),document.addEventListener("wheel",u,$n),document.addEventListener("touchmove",u,$n),document.addEventListener("touchstart",f,$n),function(){or=or.filter((function(e){return e!==c})),document.removeEventListener("wheel",u,$n),document.removeEventListener("touchmove",u,$n),document.removeEventListener("touchstart",f,$n)}}),[]);var m=t.removeScrollBar,v=t.inert;return e.createElement(e.Fragment,null,v?e.createElement(c,{styles:nr(i)}):null,m?e.createElement(Yn,{noRelative:t.noRelative,gapMode:t.gapMode}):null)},Mn.useMedium(cr),An),ar=e.forwardRef((function(t,n){return e.createElement(Dn,p({},t,{ref:n,sideCar:lr}))}));ar.classNames=Dn.classNames;var ur=En,sr=function(e){var n=e.children,r=e.asChild,o=m(e,["children","asChild"]),i=a(y),c=i.handleOpenChange,l=i.getItemProps;return t.createElement(Rn,p({asChild:r,onClick:function(){return c(!1)}},l(),o),n)},fr=function(e){var n=e.children,r=e.asChild,o=m(e,["children","asChild"]),i=a(y),c=i.handleOpenChange,l=i.getItemProps;return t.createElement(Rn,p({asChild:r,onClick:function(){return c(!1)}},l(),o),n)},dr=function(e){var n=e.children,r=m(e,["children"]),o=a(y),i=o.isOpen,c=o.getFloatingProps,l=o.floaterContext,u=o.refs;return t.createElement(t.Fragment,null,i&&t.createElement(bn.FocusManager,{context:l,returnFocus:!0},t.createElement("div",p({ref:u.setFloating},c(),r),n)))},pr=function(e){var n=e.children,r=e.asChild,o=e.className,i=void 0===o?"":o,c=m(e,["children","asChild","className"]),l=a(y),u=l.handleOpenChange,s=l.getReferenceProps,f=l.refs;return t.createElement(Rn,p({ref:(null==f?void 0:f.setReference)||null,asChild:r,className:i,onClick:function(){return u(!0)}},s(),c),n)},mr=function(e){var n=m(e,[]),r=a(y),o=r.isOpen,i=r.handleOverlayClick;return t.createElement(t.Fragment,null,o&&t.createElement(ar,null,t.createElement(bn.Overlay,p({onClick:i},n))))},vr=function(e){var n=e.children,r=i(null),l=c(!1),a=l[0],u=l[1];return o((function(){var e=document.querySelector("#rad-ui-theme-container"),t=document.body,n=e||t;r.current=n,u(!0)}),[]),a?t.createElement(bn.Portal,{root:r.current},n):null},hr="AlertDialog",gr=function(e){var n=e.children,r=e.className,o=void 0===r?"":r,i=e.customRootClass,c=void 0===i?"":i,l=m(e,["children","className","customRootClass"]),a=function(e,t){void 0===e&&(e="");var n=t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();return e?"".concat(e,"-").concat(n):"".concat("rad-ui","-").concat(n)}(c,hr),u={rootClass:a};return t.createElement(ur,p({className:g(a,o)},l),t.createElement(v.Provider,{value:u},t.createElement("div",{className:g(a,o)},n)))};gr.displayName=hr;var yr=function(){return console.warn("Direct usage of AlertDialog is not supported. Please use AlertDialog.Root, AlertDialog.Content, etc. instead."),null};yr.Root=gr,yr.Trigger=function(e){var n=e.children,r=e.asChild,o=e.className,i=void 0===o?"":o,c=m(e,["children","asChild","className"]),l=a(v).rootClass;return t.createElement(pr,p({className:g("".concat(l,"-trigger"),i),asChild:r},c),n)},yr.Overlay=function(e){var n=e.className,r=void 0===n?"":n,o=a(v).rootClass;return t.createElement(t.Fragment,null,t.createElement(mr,{className:g("".concat(o,"-overlay"),r)}))},yr.Portal=function(e){var n=e.children;return t.createElement(vr,null,n)},yr.Content=function(e){var n=e.children,r=e.className,o=void 0===r?"":r,i=a(v).rootClass;return t.createElement(t.Fragment,null,t.createElement(dr,{className:g("".concat(i,"-content"),o)},n))},yr.Title=function(e){var n=e.children,r=e.className,o=void 0===r?"":r,i=a(v).rootClass;return t.createElement(xn.h2,{className:"".concat(i,"-title ").concat(o)},n)},yr.Description=function(e){var n=e.children,r=e.className,o=void 0===r?"":r,i=a(v).rootClass;return t.createElement(xn.p,{className:"".concat(i,"-description ").concat(o)},n)},yr.Cancel=function(e){var n=e.children;e.asChild;var r=e.className,o=void 0===r?"":r,i=m(e,["children","asChild","className"]),c=a(v).rootClass;return t.createElement(fr,p({className:"".concat(c,"-cancel ").concat(o)},i),n)},yr.Action=function(e){var n=e.children;e.asChild;var r=e.className,o=void 0===r?"":r,i=m(e,["children","asChild","className"]),c=a(v).rootClass;return t.createElement(sr,p({className:"".concat(c,"-action ").concat(o)},i),n)};export{yr as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use client';import r,{createContext as e,useState as
|
|
1
|
+
'use client';import r,{createContext as e,useState as a,useCallback as t,useContext as n,useEffect as o}from"react";var c=function(){return c=Object.assign||function(r){for(var e,a=1,t=arguments.length;a<t;a++)for(var n in e=arguments[a])Object.prototype.hasOwnProperty.call(e,n)&&(r[n]=e[n]);return r},c.apply(this,arguments)};function i(r,e){var a={};for(var t in r)Object.prototype.hasOwnProperty.call(r,t)&&e.indexOf(t)<0&&(a[t]=r[t]);if(null!=r&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(t=Object.getOwnPropertySymbols(r);n<t.length;n++)e.indexOf(t[n])<0&&Object.prototype.propertyIsEnumerable.call(r,t[n])&&(a[t[n]]=r[t[n]])}return a}"function"==typeof SuppressedError&&SuppressedError;var l=e({}),s=["div","span","button","input","a","img","p","h2","label"].reduce((function(e,a){return e[a]=function(e){var a=r.forwardRef((function(a,t){var n=a.asChild,o=void 0!==n&&n,l=a.children,s=i(a,["asChild","children"]);if(o){var u=r.Children.toArray(l);if(1!==u.length||!r.isValidElement(u[0]))return console.warn("Primitive.".concat(e,": asChild prop requires exactly one valid child element.")),r.createElement(e,c(c({},s),{ref:t}),l);var f=u[0];return r.cloneElement(f,c(c(c({},s),f.props),t?{ref:function(r){"function"==typeof t?t(r):t&&(t.current=r);var e=f.ref;"function"==typeof e?e(r):e&&(e.current=r)}}:{}))}return r.createElement(e,c(c({},s),{ref:t}),l)}));return a.displayName="Primitive.".concat(e),a}(a),e}),{}),u=function(e){var t=e.children,n=e.asChild,o=void 0!==n&&n,u=i(e,["children","asChild"]),f=a(!1),d=f[0],v=f[1],m=a(!1),p=m[0],h=m[1],y={isImageLoaded:d,hasError:p,setHasError:h,handleLoadImage:function(){v(!0),h(!1)},handleErrorImage:function(){v(!1),h(!0)}};return r.createElement(l.Provider,{value:y},r.createElement(s.span,c({asChild:o},u),t))};function f(r){var e,a,t="";if("string"==typeof r||"number"==typeof r)t+=r;else if("object"==typeof r)if(Array.isArray(r)){var n=r.length;for(e=0;e<n;e++)r[e]&&(a=f(r[e]))&&(t&&(t+=" "),t+=a)}else for(a in r)r[a]&&(t&&(t+=" "),t+=a);return t}function d(){for(var r,e,a=0,t="",n=arguments.length;a<n;a++)(r=arguments[a])&&(e=f(r))&&(t&&(t+=" "),t+=e);return t}var v=e({size:"",variant:"",color:"",rootClass:""}),m=function(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];return t((function(){return Object.assign.apply(Object,function(r,e,a){if(a||2===arguments.length)for(var t,n=0,o=e.length;n<o;n++)!t&&n in e||(t||(t=Array.prototype.slice.call(e,0,n)),t[n]=e[n]);return r.concat(t||Array.prototype.slice.call(e))}([{}],r.filter((function(r){return null!==r})),!1))}),[r])},p=function(e){var a=e.src,t=void 0===a?"":a,u=e.alt,f=void 0===u?"":u,d=i(e,["src","alt"]),v=n(l),m=v.handleErrorImage,p=v.handleLoadImage,h=v.hasError;return h?null:(o((function(){t||m()}),[t,m,h]),r.createElement(s.img,c({src:t,alt:f,onError:m,onLoad:p},d)))},h=function(e){var a=e.children,t=e.asChild,o=void 0!==t&&t,u=e.className,f=void 0===u?"":u,d=i(e,["children","asChild","className"]),v=n(l);return v.hasError,v.isImageLoaded?null:r.createElement(s.span,c({asChild:o,className:f},d),a)},y=function(){return console.warn("Direct usage of Avatar is not supported. Please use Avatar.Root, Avatar.Image, Avatar.Fallback instead."),null};y.displayName="Avatar",y.Root=function(e){var a,n,o=e.children,l=e.customRootClass,s=void 0===l?"":l,f=e.className,p=void 0===f?"":f,h=e.size,y=void 0===h?"":h,g=e.variant,E=void 0===g?"":g,b=e.color,C=void 0===b?"":b,O=i(e,["children","customRootClass","className","size","variant","color"]),A=function(r,e){void 0===r&&(r="");var a=e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();return r?"".concat(r,"-").concat(a):"".concat("rad-ui","-").concat(a)}(s,"Avatar"),N=t((function(){return n?Object.fromEntries(Object.entries(n).filter((function(r){r[0];var e=r[1];return void 0!==e&&""!==e})).map((function(r){var e=r[0],t=r[1];return["data-".concat(a,"-").concat(e),t]}))):{}}),[a="avatar",n={variant:E,size:y}]),j=function(r){return t((function(){return r?{"data-rad-ui-accent-color":r}:{}}),[r])}(C),I=m(N(),j());return r.createElement(v.Provider,{value:{size:y,variant:E,color:C,rootClass:A}},r.createElement(u,c({className:d(A,p)},I(),O),o))},y.Image=function(e){var a=e.src,t=void 0===a?"":a,o=e.alt,l=void 0===o?"":o,s=i(e,["src","alt"]),u=n(v).rootClass;return r.createElement(p,c({className:d("".concat(u,"-image")),src:t,alt:l},s))},y.Fallback=function(e){var a=e.children,t=e.className,o=void 0===t?"":t,l=i(e,["children","className"]),s=n(v).rootClass;return r.createElement(h,c({className:d("".concat(s,"-fallback"),o)},l),a)};export{y as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use client';import r,{createContext as e,useCallback as t,useState as n,useContext as a,useEffect as o}from"react";var i=function(){return i=Object.assign||function(r){for(var e,t=1,n=arguments.length;t<n;t++)for(var a in e=arguments[t])Object.prototype.hasOwnProperty.call(e,a)&&(r[a]=e[a]);return r},i.apply(this,arguments)};function c(r,e){var t={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&e.indexOf(n)<0&&(t[n]=r[n]);if(null!=r&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(n=Object.getOwnPropertySymbols(r);a<n.length;a++)e.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(r,n[a])&&(t[n[a]]=r[n[a]])}return t}function l(r){var e,t,n="";if("string"==typeof r||"number"==typeof r)n+=r;else if("object"==typeof r)if(Array.isArray(r)){var a=r.length;for(e=0;e<a;e++)r[e]&&(t=l(r[e]))&&(n&&(n+=" "),n+=t)}else for(t in r)r[t]&&(n&&(n+=" "),n+=t);return n}function s(){for(var r,e,t=0,n="",a=arguments.length;t<a;t++)(r=arguments[t])&&(e=l(r))&&(n&&(n+=" "),n+=e);return n}"function"==typeof SuppressedError&&SuppressedError;var u=e({rootClass:"",size:"",variant:""}),f=function(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];return t((function(){return Object.assign.apply(Object,function(r,e,t){if(t||2===arguments.length)for(var n,a=0,o=e.length;a<o;a++)!n&&a in e||(n||(n=Array.prototype.slice.call(e,0,a)),n[a]=e[a]);return r.concat(n||Array.prototype.slice.call(e))}([{}],r.filter((function(r){return null!==r})),!1))}),[r])},d=e({}),v=["div","span","button","input","a","img","p","h2"].reduce((function(e,t){return e[t]=function(e){var t=r.forwardRef((function(t,n){var a=t.asChild,o=void 0!==a&&a,l=t.children,s=c(t,["asChild","children"]);if(o){var u=r.Children.toArray(l);if(1!==u.length||!r.isValidElement(u[0]))return console.warn("Primitive.".concat(e,": asChild prop requires exactly one valid child element.")),r.createElement(e,i(i({},s),{ref:n}),l);var f=u[0];return r.cloneElement(f,i(i(i({},s),f.props),n?{ref:function(r){"function"==typeof n?n(r):n&&(n.current=r);var e=f.ref;"function"==typeof e?e(r):e&&(e.current=r)}}:{}))}return r.createElement(e,i(i({},s),{ref:n}),l)}));return t.displayName="Primitive.".concat(e),t}(t),e}),{}),p=function(e){var t=e.children,a=e.asChild,o=void 0!==a&&a,l=c(e,["children","asChild"]),s=n(!1),u=s[0],f=s[1],p=n(!1),m=p[0],h=p[1],y={isImageLoaded:u,hasError:m,setHasError:h,handleLoadImage:function(){f(!0),h(!1)},handleErrorImage:function(){f(!1),h(!0)}};return r.createElement(d.Provider,{value:y},r.createElement(v.span,i({asChild:o},l),t))},m=function(e){var t=e.src,n=void 0===t?"":t,l=e.alt,s=void 0===l?"":l,u=c(e,["src","alt"]),f=a(d),p=f.handleErrorImage,m=f.handleLoadImage,h=f.hasError;return h?null:(o((function(){n||p()}),[n,p,h]),r.createElement(v.img,i({src:n,alt:s,onError:p,onLoad:m},u)))},h=function(e){var t=e.children,n=e.asChild,o=void 0!==n&&n,l=e.className,s=void 0===l?"":l,u=c(e,["children","asChild","className"]),f=a(d);return f.hasError,f.isImageLoaded?null:r.createElement(v.span,i({asChild:o,className:s},u),t)},y=function(){return console.warn("Direct usage of AvatarGroup is not supported. Please use AvatarGroup.Root, AvatarGroup.Item, AvatarGroup.Avatar, AvatarGroup.Fallback instead."),null};y.Root=function(e){var n,a,o=e.customRootClass,l=void 0===o?"":o,d=e.size,v=void 0===d?"":d,p=e.variant,m=void 0===p?"":p,h=e.children,y=e.className,E=void 0===y?"":y,g=c(e,["customRootClass","size","variant","children","className"]),b=function(r,e){void 0===r&&(r="");var t=e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();return r?"".concat(r,"-").concat(t):"".concat("rad-ui","-").concat(t)}(l,"AvatarGroup"),C=t((function(){return a?Object.fromEntries(Object.entries(a).filter((function(r){r[0];var e=r[1];return void 0!==e&&""!==e})).map((function(r){var e=r[0],t=r[1];return["data-".concat(n,"-").concat(e),t]}))):{}}),[n="avatar",a={variant:m,size:v}]),O=f(C());return r.createElement(u.Provider,{value:{size:v,variant:m,rootClass:b}},r.createElement("div",i({className:s(b,E)},O(),g),h))},y.Item=function(e){var n=e.color,o=void 0===n?"":n,c=e.children,l=a(u).rootClass,s=function(r){return t((function(){return r?{"data-rad-ui-accent-color":r}:{}}),[r])}(o),d=f(s());return r.createElement(p,i({className:"".concat(l,"-item")},d()),c)},y.Avatar=function(e){var t=e.src,n=e.alt;return r.createElement(m,{src:t,alt:n})},y.Fallback=function(e){var t=e.children,n=a(u).rootClass;return r.createElement(h,{className:"".concat(n,"-fallback")},t)};export{y as default};
|
|
1
|
+
'use client';import r,{createContext as e,useCallback as t,useState as n,useContext as a,useEffect as o}from"react";var i=function(){return i=Object.assign||function(r){for(var e,t=1,n=arguments.length;t<n;t++)for(var a in e=arguments[t])Object.prototype.hasOwnProperty.call(e,a)&&(r[a]=e[a]);return r},i.apply(this,arguments)};function c(r,e){var t={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&e.indexOf(n)<0&&(t[n]=r[n]);if(null!=r&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(n=Object.getOwnPropertySymbols(r);a<n.length;a++)e.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(r,n[a])&&(t[n[a]]=r[n[a]])}return t}function l(r){var e,t,n="";if("string"==typeof r||"number"==typeof r)n+=r;else if("object"==typeof r)if(Array.isArray(r)){var a=r.length;for(e=0;e<a;e++)r[e]&&(t=l(r[e]))&&(n&&(n+=" "),n+=t)}else for(t in r)r[t]&&(n&&(n+=" "),n+=t);return n}function s(){for(var r,e,t=0,n="",a=arguments.length;t<a;t++)(r=arguments[t])&&(e=l(r))&&(n&&(n+=" "),n+=e);return n}"function"==typeof SuppressedError&&SuppressedError;var u=e({rootClass:"",size:"",variant:""}),f=function(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];return t((function(){return Object.assign.apply(Object,function(r,e,t){if(t||2===arguments.length)for(var n,a=0,o=e.length;a<o;a++)!n&&a in e||(n||(n=Array.prototype.slice.call(e,0,a)),n[a]=e[a]);return r.concat(n||Array.prototype.slice.call(e))}([{}],r.filter((function(r){return null!==r})),!1))}),[r])},d=e({}),v=["div","span","button","input","a","img","p","h2","label"].reduce((function(e,t){return e[t]=function(e){var t=r.forwardRef((function(t,n){var a=t.asChild,o=void 0!==a&&a,l=t.children,s=c(t,["asChild","children"]);if(o){var u=r.Children.toArray(l);if(1!==u.length||!r.isValidElement(u[0]))return console.warn("Primitive.".concat(e,": asChild prop requires exactly one valid child element.")),r.createElement(e,i(i({},s),{ref:n}),l);var f=u[0];return r.cloneElement(f,i(i(i({},s),f.props),n?{ref:function(r){"function"==typeof n?n(r):n&&(n.current=r);var e=f.ref;"function"==typeof e?e(r):e&&(e.current=r)}}:{}))}return r.createElement(e,i(i({},s),{ref:n}),l)}));return t.displayName="Primitive.".concat(e),t}(t),e}),{}),p=function(e){var t=e.children,a=e.asChild,o=void 0!==a&&a,l=c(e,["children","asChild"]),s=n(!1),u=s[0],f=s[1],p=n(!1),m=p[0],h=p[1],y={isImageLoaded:u,hasError:m,setHasError:h,handleLoadImage:function(){f(!0),h(!1)},handleErrorImage:function(){f(!1),h(!0)}};return r.createElement(d.Provider,{value:y},r.createElement(v.span,i({asChild:o},l),t))},m=function(e){var t=e.src,n=void 0===t?"":t,l=e.alt,s=void 0===l?"":l,u=c(e,["src","alt"]),f=a(d),p=f.handleErrorImage,m=f.handleLoadImage,h=f.hasError;return h?null:(o((function(){n||p()}),[n,p,h]),r.createElement(v.img,i({src:n,alt:s,onError:p,onLoad:m},u)))},h=function(e){var t=e.children,n=e.asChild,o=void 0!==n&&n,l=e.className,s=void 0===l?"":l,u=c(e,["children","asChild","className"]),f=a(d);return f.hasError,f.isImageLoaded?null:r.createElement(v.span,i({asChild:o,className:s},u),t)},y=function(){return console.warn("Direct usage of AvatarGroup is not supported. Please use AvatarGroup.Root, AvatarGroup.Item, AvatarGroup.Avatar, AvatarGroup.Fallback instead."),null};y.Root=function(e){var n,a,o=e.customRootClass,l=void 0===o?"":o,d=e.size,v=void 0===d?"":d,p=e.variant,m=void 0===p?"":p,h=e.children,y=e.className,E=void 0===y?"":y,g=c(e,["customRootClass","size","variant","children","className"]),b=function(r,e){void 0===r&&(r="");var t=e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();return r?"".concat(r,"-").concat(t):"".concat("rad-ui","-").concat(t)}(l,"AvatarGroup"),C=t((function(){return a?Object.fromEntries(Object.entries(a).filter((function(r){r[0];var e=r[1];return void 0!==e&&""!==e})).map((function(r){var e=r[0],t=r[1];return["data-".concat(n,"-").concat(e),t]}))):{}}),[n="avatar",a={variant:m,size:v}]),O=f(C());return r.createElement(u.Provider,{value:{size:v,variant:m,rootClass:b}},r.createElement("div",i({className:s(b,E)},O(),g),h))},y.Item=function(e){var n=e.color,o=void 0===n?"":n,c=e.children,l=a(u).rootClass,s=function(r){return t((function(){return r?{"data-rad-ui-accent-color":r}:{}}),[r])}(o),d=f(s());return r.createElement(p,i({className:"".concat(l,"-item")},d()),c)},y.Avatar=function(e){var t=e.src,n=e.alt;return r.createElement(m,{src:t,alt:n})},y.Fallback=function(e){var t=e.children,n=a(u).rootClass;return r.createElement(h,{className:"".concat(n,"-fallback")},t)};export{y as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use client';import r,{useCallback as
|
|
1
|
+
'use client';import r,{forwardRef as e,useCallback as t}from"react";var n=function(){return n=Object.assign||function(r){for(var e,t=1,n=arguments.length;t<n;t++)for(var o in e=arguments[t])Object.prototype.hasOwnProperty.call(e,o)&&(r[o]=e[o]);return r},n.apply(this,arguments)};function o(r,e){var t={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&e.indexOf(n)<0&&(t[n]=r[n]);if(null!=r&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(r);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(r,n[o])&&(t[n[o]]=r[n[o]])}return t}"function"==typeof SuppressedError&&SuppressedError;function i(r){var e,t,n="";if("string"==typeof r||"number"==typeof r)n+=r;else if("object"==typeof r)if(Array.isArray(r)){var o=r.length;for(e=0;e<o;e++)r[e]&&(t=i(r[e]))&&(n&&(n+=" "),n+=t)}else for(t in r)r[t]&&(n&&(n+=" "),n+=t);return n}function a(){for(var r,e,t=0,n="",o=arguments.length;t<o;t++)(r=arguments[t])&&(e=i(r))&&(n&&(n+=" "),n+=e);return n}var c=["div","span","button","input","a","img","p","h2","label"].reduce((function(e,t){return e[t]=function(e){var t=r.forwardRef((function(t,i){var a=t.asChild,c=void 0!==a&&a,l=t.children,u=o(t,["asChild","children"]);if(c){var f=r.Children.toArray(l);if(1!==f.length||!r.isValidElement(f[0]))return console.warn("Primitive.".concat(e,": asChild prop requires exactly one valid child element.")),r.createElement(e,n(n({},u),{ref:i}),l);var s=f[0];return r.cloneElement(s,n(n(n({},u),s.props),i?{ref:function(r){"function"==typeof i?i(r):i&&(i.current=r);var e=s.ref;"function"==typeof e?e(r):e&&(e.current=r)}}:{}))}return r.createElement(e,n(n({},u),{ref:i}),l)}));return t.displayName="Primitive.".concat(e),t}(t),e}),{}),l=e((function(e,t){var i=e.role,a=void 0===i?"button":i,l=e.label,u=void 0===l?"":l,f=e.description,s=void 0===f?"":f,d=e.disabled,p=void 0!==d&&d,v=e.children,y=o(e,["role","label","description","disabled","children"]);return u&&(y["aria-label"]=u),s&&(y["aria-description"]=s),p&&(y["aria-disabled"]="true",s||(y["aria-description"]="Disabled Button")),r.createElement(c.button,n({ref:t,role:a,disabled:p},y),v)}));l.displayName="ButtonPrimitive";var u=function(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];return t((function(){return Object.assign.apply(Object,function(r,e,t){if(t||2===arguments.length)for(var n,o=0,i=e.length;o<i;o++)!n&&o in e||(n||(n=Array.prototype.slice.call(e,0,o)),n[o]=e[o]);return r.concat(n||Array.prototype.slice.call(e))}([{}],r.filter((function(r){return null!==r})),!1))}),[r])},f="Button",s=function(e){var i,c,s=e.children,d=e.type,p=void 0===d?"button":d,v=e.customRootClass,y=void 0===v?"":v,b=e.className,m=void 0===b?"":b,h=e.variant,O=void 0===h?"":h,g=e.size,j=void 0===g?"":g,E=e.color,w=void 0===E?"":E,C=o(e,["children","type","customRootClass","className","variant","size","color"]),P=function(r,e){void 0===r&&(r="");var t=e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();return r?"".concat(r,"-").concat(t):"".concat("rad-ui","-").concat(t)}(y,f),A=t((function(){return c?Object.fromEntries(Object.entries(c).filter((function(r){r[0];var e=r[1];return void 0!==e&&""!==e})).map((function(r){var e=r[0],t=r[1];return["data-".concat(i,"-").concat(e),t]}))):{}}),[i="button",c={variant:O,size:j}]),N=function(r){return t((function(){return r?{"data-rad-ui-accent-color":r}:{}}),[r])}(w),x=u(A(),N());return r.createElement(l,n({type:p,className:a(P,m)},x(),C),s)};s.displayName=f;export{s as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use client';import r,{createContext as e,useCallback as t,useContext as n}from"react";var o=function(){return o=Object.assign||function(r){for(var e,t=1,n=arguments.length;t<n;t++)for(var o in e=arguments[t])Object.prototype.hasOwnProperty.call(e,o)&&(r[o]=e[o]);return r},o.apply(this,arguments)};function a(r,e){var t={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&e.indexOf(n)<0&&(t[n]=r[n]);if(null!=r&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(r);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(r,n[o])&&(t[n[o]]=r[n[o]])}return t}"function"==typeof SuppressedError&&SuppressedError;function c(r){var e,t,n="";if("string"==typeof r||"number"==typeof r)n+=r;else if("object"==typeof r)if(Array.isArray(r)){var o=r.length;for(e=0;e<o;e++)r[e]&&(t=c(r[e]))&&(n&&(n+=" "),n+=t)}else for(t in r)r[t]&&(n&&(n+=" "),n+=t);return n}function i(){for(var r,e,t=0,n="",o=arguments.length;t<o;t++)(r=arguments[t])&&(e=c(r))&&(n&&(n+=" "),n+=e);return n}var l=e({rootClass:""}),s=["div","span","button","input","a","img","p","h2"].reduce((function(e,t){return e[t]=function(e){var t=r.forwardRef((function(t,n){var c=t.asChild,i=void 0!==c&&c,l=t.children,s=a(t,["asChild","children"]);if(i){var u=r.Children.toArray(l);if(1!==u.length||!r.isValidElement(u[0]))return console.warn("Primitive.".concat(e,": asChild prop requires exactly one valid child element.")),r.createElement(e,o(o({},s),{ref:n}),l);var f=u[0];return r.cloneElement(f,o(o(o({},s),f.props),n?{ref:function(r){"function"==typeof n?n(r):n&&(n.current=r);var e=f.ref;"function"==typeof e?e(r):e&&(e.current=r)}}:{}))}return r.createElement(e,o(o({},s),{ref:n}),l)}));return t.displayName="Primitive.".concat(e),t}(t),e}),{}),u=function(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];return t((function(){return Object.assign.apply(Object,function(r,e,t){if(t||2===arguments.length)for(var n,o=0,a=e.length;o<a;o++)!n&&o in e||(n||(n=Array.prototype.slice.call(e,0,o)),n[o]=e[o]);return r.concat(n||Array.prototype.slice.call(e))}([{}],r.filter((function(r){return null!==r})),!1))}),[r])},f="Callout",p=function(e){var n,c,p=e.children,d=e.asChild,v=void 0!==d&&d,m=e.className,y=void 0===m?"":m,h=e.color,C=void 0===h?"":h,b=e.variant,g=void 0===b?"":b,O=e.size,E=void 0===O?"":O,j=e.customRootClass,N=void 0===j?"":j,w=a(e,["children","asChild","className","color","variant","size","customRootClass"]),P=function(r,e){void 0===r&&(r="");var t=e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();return r?"".concat(r,"-").concat(t):"".concat("rad-ui","-").concat(t)}(N,f),x=t((function(){return c?Object.fromEntries(Object.entries(c).filter((function(r){r[0];var e=r[1];return void 0!==e&&""!==e})).map((function(r){var e=r[0],t=r[1];return["data-".concat(n,"-").concat(e),t]}))):{}}),[n=f,c={variant:g,size:E}]),A=function(r){return t((function(){return r?{"data-rad-ui-accent-color":r}:{}}),[r])}(C),R=u(x(),A());return r.createElement(l.Provider,{value:{rootClass:P}},r.createElement(s.div,o({asChild:v,className:i(P,y)},R(),w),p))};p.displayName=f;var d=function(){return console.warn("Direct usage of Callout is not supported. Please use Callout.Root, Callout.Icon, etc. instead."),null};d.Root=p,d.Icon=function(e){var t=e.children,c=e.className,u=void 0===c?"":c,f=a(e,["children","className"]),p=n(l).rootClass;return r.createElement(s.span,o({className:i("".concat(p,"-icon"),u)},f),t)},d.Text=function(e){var t=e.children,c=e.className,u=a(e,["children","className"]),f=n(l).rootClass;return r.createElement(s.p,o({className:i("".concat(f,"-text"),c)},u),t)};export{d as default};
|
|
1
|
+
'use client';import r,{createContext as e,useCallback as t,useContext as n}from"react";var o=function(){return o=Object.assign||function(r){for(var e,t=1,n=arguments.length;t<n;t++)for(var o in e=arguments[t])Object.prototype.hasOwnProperty.call(e,o)&&(r[o]=e[o]);return r},o.apply(this,arguments)};function a(r,e){var t={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&e.indexOf(n)<0&&(t[n]=r[n]);if(null!=r&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(r);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(r,n[o])&&(t[n[o]]=r[n[o]])}return t}"function"==typeof SuppressedError&&SuppressedError;function c(r){var e,t,n="";if("string"==typeof r||"number"==typeof r)n+=r;else if("object"==typeof r)if(Array.isArray(r)){var o=r.length;for(e=0;e<o;e++)r[e]&&(t=c(r[e]))&&(n&&(n+=" "),n+=t)}else for(t in r)r[t]&&(n&&(n+=" "),n+=t);return n}function i(){for(var r,e,t=0,n="",o=arguments.length;t<o;t++)(r=arguments[t])&&(e=c(r))&&(n&&(n+=" "),n+=e);return n}var l=e({rootClass:""}),s=["div","span","button","input","a","img","p","h2","label"].reduce((function(e,t){return e[t]=function(e){var t=r.forwardRef((function(t,n){var c=t.asChild,i=void 0!==c&&c,l=t.children,s=a(t,["asChild","children"]);if(i){var u=r.Children.toArray(l);if(1!==u.length||!r.isValidElement(u[0]))return console.warn("Primitive.".concat(e,": asChild prop requires exactly one valid child element.")),r.createElement(e,o(o({},s),{ref:n}),l);var f=u[0];return r.cloneElement(f,o(o(o({},s),f.props),n?{ref:function(r){"function"==typeof n?n(r):n&&(n.current=r);var e=f.ref;"function"==typeof e?e(r):e&&(e.current=r)}}:{}))}return r.createElement(e,o(o({},s),{ref:n}),l)}));return t.displayName="Primitive.".concat(e),t}(t),e}),{}),u=function(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];return t((function(){return Object.assign.apply(Object,function(r,e,t){if(t||2===arguments.length)for(var n,o=0,a=e.length;o<a;o++)!n&&o in e||(n||(n=Array.prototype.slice.call(e,0,o)),n[o]=e[o]);return r.concat(n||Array.prototype.slice.call(e))}([{}],r.filter((function(r){return null!==r})),!1))}),[r])},f="Callout",p=function(e){var n,c,p=e.children,d=e.asChild,v=void 0!==d&&d,m=e.className,y=void 0===m?"":m,h=e.color,C=void 0===h?"":h,b=e.variant,g=void 0===b?"":b,O=e.size,E=void 0===O?"":O,j=e.customRootClass,N=void 0===j?"":j,w=a(e,["children","asChild","className","color","variant","size","customRootClass"]),P=function(r,e){void 0===r&&(r="");var t=e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();return r?"".concat(r,"-").concat(t):"".concat("rad-ui","-").concat(t)}(N,f),x=t((function(){return c?Object.fromEntries(Object.entries(c).filter((function(r){r[0];var e=r[1];return void 0!==e&&""!==e})).map((function(r){var e=r[0],t=r[1];return["data-".concat(n,"-").concat(e),t]}))):{}}),[n=f,c={variant:g,size:E}]),A=function(r){return t((function(){return r?{"data-rad-ui-accent-color":r}:{}}),[r])}(C),R=u(x(),A());return r.createElement(l.Provider,{value:{rootClass:P}},r.createElement(s.div,o({asChild:v,className:i(P,y)},R(),w),p))};p.displayName=f;var d=function(){return console.warn("Direct usage of Callout is not supported. Please use Callout.Root, Callout.Icon, etc. instead."),null};d.Root=p,d.Icon=function(e){var t=e.children,c=e.className,u=void 0===c?"":c,f=a(e,["children","className"]),p=n(l).rootClass;return r.createElement(s.span,o({className:i("".concat(p,"-icon"),u)},f),t)},d.Text=function(e){var t=e.children,c=e.className,u=a(e,["children","className"]),f=n(l).rootClass;return r.createElement(s.p,o({className:i("".concat(f,"-text"),c)},u),t)};export{d as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use client';import e,{useState as r,useRef as n,useEffect as t,useCallback as o,useContext as c}from"react";var a=function(){return a=Object.assign||function(e){for(var r,n=1,t=arguments.length;n<t;n++)for(var o in r=arguments[n])Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o]);return e},a.apply(this,arguments)};function i(e,r){var n={};for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&r.indexOf(t)<0&&(n[t]=e[t]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(t=Object.getOwnPropertySymbols(e);o<t.length;o++)r.indexOf(t[o])<0&&Object.prototype.propertyIsEnumerable.call(e,t[o])&&(n[t[o]]=e[t[o]])}return n}"function"==typeof SuppressedError&&SuppressedError;var l=e.createContext({isChecked:!1,setIsChecked:function(){},id:"",required:!1,disabled:!1}),s=["div","span","button","input","a","img","p","h2","label"].reduce((function(r,n){return r[n]=function(r){var n=e.forwardRef((function(n,t){var o=n.asChild,c=void 0!==o&&o,l=n.children,s=i(n,["asChild","children"]);if(c){var u=e.Children.toArray(l);if(1!==u.length||!e.isValidElement(u[0]))return console.warn("Primitive.".concat(r,": asChild prop requires exactly one valid child element.")),e.createElement(r,a(a({},s),{ref:t}),l);var d=u[0];return e.cloneElement(d,a(a(a({},s),d.props),t?{ref:function(e){"function"==typeof t?t(e):t&&(t.current=e);var r=d.ref;"function"==typeof r?r(e):r&&(r.current=e)}}:{}))}return e.createElement(r,a(a({},s),{ref:t}),l)}));return n.displayName="Primitive.".concat(r),n}(n),r}),{}),u=function(r){var n=r.children,t=r.className,o=void 0===t?"":t,c=i(r,["children","className"]),u=e.useContext(l),d=u.isChecked,f=u.setIsChecked,h=u.id,v=u.required,p=u.disabled;return e.createElement(s.button,a({onClick:function(){return f(!d)},role:"checkbox",id:h,"aria-checked":d,"aria-required":v,"data-checked":d,disabled:p,"data-disabled":p},c,{className:o}),n)};var d=function(c){var s=c.children,d=c.className,f=void 0===d?"":d,h=c.checked,v=c.defaultChecked,p=void 0!==v&&v,m=c.onCheckedChange,C=c.disabled,b=c.required,y=c.name,g=c.value,k=c.id,E=i(c,["children","className","checked","defaultChecked","onCheckedChange","disabled","required","name","value","id"]),N=function(e,c,a){var i=r(c),l=i[0],s=i[1],u=void 0!==e,d=u?e:l,f=n(u),h=n(e);t((function(){"production"!==process.env.NODE_ENV&&(f.current!==u&&console.warn("Component changed from ".concat(f.current?"controlled":"uncontrolled"," to ").concat(u?"controlled":"uncontrolled",".")),f.current=u)}),[u]),t((function(){"production"!==process.env.NODE_ENV&&u&&!a&&e!==h.current&&console.warn("A component is changing a controlled value without an onChange handler. This will render a controlled component as uncontrolled."),h.current=e}),[e,u,a]);var v=o((function(e){var r="function"==typeof e?e(d):e;u||s(r),a&&a(r)}),[u,a,d]);return[d,v]}(h,p,m),w=N[0],O={isChecked:w,setIsChecked:N[1],id:k,required:b,disabled:C};return e.createElement(l.Provider,{value:O},e.createElement(u,a({className:f},E),s),e.createElement("input",a({type:"checkbox",style:{position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"},name:y,value:g,checked:w,disabled:C,required:b},E)))},f=e.createContext({rootClass:""});function h(e){var r,n,t="";if("string"==typeof e||"number"==typeof e)t+=e;else if("object"==typeof e)if(Array.isArray(e)){var o=e.length;for(r=0;r<o;r++)e[r]&&(n=h(e[r]))&&(t&&(t+=" "),t+=n)}else for(n in e)e[n]&&(t&&(t+=" "),t+=n);return t}function v(){for(var e,r,n=0,t="",o=arguments.length;n<o;n++)(e=arguments[n])&&(r=h(e))&&(t&&(t+=" "),t+=r);return t}var p=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return o((function(){return Object.assign.apply(Object,function(e,r,n){if(n||2===arguments.length)for(var t,o=0,c=r.length;o<c;o++)!t&&o in r||(t||(t=Array.prototype.slice.call(r,0,o)),t[o]=r[o]);return e.concat(t||Array.prototype.slice.call(r))}([{}],e.filter((function(e){return null!==e})),!1))}),[e])},m=function(r){var n=r.children,t=r.className,o=void 0===t?"":t,c=i(r,["children","className"]);return e.useContext(l).isChecked?e.createElement("span",a({className:o},c),n):null},C=function(){return console.warn("Direct usage of Checkbox is not supported. Please use Checkbox.Root, Checkbox.Indicator instead."),null};C.Root=function(r){var n,t,c=r.children,l=r.className,s=void 0===l?"":l,u=r.customRootClass,h=r.color,m=void 0===h?"":h,C=r.variant,b=r.size,y=i(r,["children","className","customRootClass","color","variant","size"]),g=function(e,r){void 0===e&&(e="");var n=r.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();return e?"".concat(e,"-").concat(n):"".concat("rad-ui","-").concat(n)}(u,"Checkbox"),k=o((function(){return t?Object.fromEntries(Object.entries(t).filter((function(e){e[0];var r=e[1];return void 0!==r&&""!==r})).map((function(e){var r=e[0],t=e[1];return["data-".concat(n,"-").concat(r),t]}))):{}}),[n="checkbox",t={variant:C,size:b}]),E=function(e){return o((function(){return e?{"data-rad-ui-accent-color":e}:{}}),[e])}(m),N=p(k(),E());return e.createElement(f.Provider,{value:{rootClass:g}},e.createElement(d,a({className:v(g,s)},y,N()),c))},C.Indicator=function(r){var n=r.children,t=r.className,o=void 0===t?"":t,l=i(r,["children","className"]),s=c(f).rootClass;return e.createElement(m,a({},l),e.createElement("svg",{width:"15",height:"15",viewBox:"0 0 15 15",className:v("".concat(s,"-indicator"),o),fill:"none",xmlns:"http://www.w3.org/2000/svg"},e.createElement("path",{d:"M11.4669 3.72684C11.7558 3.91574 11.8369 4.30308 11.648 4.59198L7.39799 11.092C7.29783 11.2452 7.13556 11.3467 6.95402 11.3699C6.77247 11.3931 6.58989 11.3355 6.45446 11.2124L3.70446 8.71241C3.44905 8.48022 3.43023 8.08494 3.66242 7.82953C3.89461 7.57412 4.28989 7.55529 4.5453 7.78749L6.75292 9.79441L10.6018 3.90792C10.7907 3.61902 11.178 3.53795 11.4669 3.72684Z",fill:"currentColor","fill-rule":"evenodd","clip-rule":"evenodd"})),n)};export{C as default};
|