@radui/ui 0.0.38 → 0.0.40
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/AspectRatio.js +1 -1
- package/dist/components/Avatar.js +1 -1
- package/dist/components/AvatarGroup.js +1 -1
- package/dist/components/Badge.js +1 -1
- package/dist/components/BlockQuote.js +1 -1
- package/dist/components/Button.js +1 -1
- package/dist/components/Callout.js +1 -1
- package/dist/components/Card.js +1 -1
- package/dist/components/Code.js +1 -1
- package/dist/components/Collapsible.js +1 -1
- package/dist/components/DataList.js +1 -1
- package/dist/components/Disclosure.js +1 -1
- package/dist/components/Em.js +1 -1
- package/dist/components/Heading.js +1 -1
- package/dist/components/HoverCard.js +1 -1
- package/dist/components/Kbd.js +1 -1
- package/dist/components/Link.js +1 -1
- package/dist/components/Progress.js +1 -1
- package/dist/components/Quote.js +1 -1
- package/dist/components/RadioCards.js +1 -1
- package/dist/components/RadioGroup.js +1 -1
- package/dist/components/Separator.js +1 -1
- package/dist/components/Skeleton.js +1 -1
- package/dist/components/Strong.js +1 -1
- package/dist/components/Switch.js +1 -1
- package/dist/components/TabNav.js +1 -0
- package/dist/components/Table.js +1 -1
- package/dist/components/Tabs.js +1 -1
- package/dist/components/Text.js +1 -1
- package/dist/components/TextArea.js +1 -1
- package/dist/components/Theme.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 +2 -2
|
@@ -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"].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=m(n,["children","aria-label","aria-labelledby"]),s=a(),f=c(g),p=f.focusedItemId,C=f.setFocusedItemId,y=f.addFocusItem,I=f.focusItems,E=f.groupRef,w=c(h),A=w.orientation,T=w.loop,F=w.disableTabIndexing,D=e.Children.toArray(o)[0],O=!0===(null===(r=null==D?void 0:D.props)||void 0===r?void 0:r.disabled),N=p===s,x=F||!O&&N?0:-1;i((function(){I.includes(s)||y(s)}),[I,p,s,y]);var P=function(e){if(E&&E.current){C(e);var n=CSS.escape(e),t=E.current.querySelector("#".concat(n));t&&t.focus()}},R=function(e,n){for(var t,r=e,i=0;i<I.length;i++){if(r+=n,T)r<0&&(r=I.length-1),r>=I.length&&(r=0);else if(r<0||r>=I.length)return-1;var o=I[r],a=null===(t=null==E?void 0:E.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},V=function(){var e=I.indexOf(s),n=R(e,-1);-1!==n&&P(I[n])},S=function(){var e=I.indexOf(s),n=R(e,1);-1!==n&&P(I[n])};return e.createElement(b.button,v({asChild:!0,onFocus:function(e){e.preventDefault(),O||C(s)},tabIndex:x,ref:t,id:s,onKeyDown:function(e){if(!O)switch(e.key){case"ArrowUp":e.preventDefault(),"vertical"===A&&V();break;case"ArrowLeft":e.preventDefault(),"horizontal"===A&&V();break;case"ArrowDown":e.preventDefault(),"vertical"===A&&S();break;case"ArrowRight":e.preventDefault(),"horizontal"===A&&S();break;case"Home":e.preventDefault(),function(){if(I.length>0){var e=R(-1,1);-1!==e&&P(I[e])}}();break;case"End":e.preventDefault(),function(){if(I.length>0){var e=R(I.length,-1);-1!==e&&P(I[e])}}()}},"data-child-disabled":O,role:"option","aria-selected":N,"aria-disabled":O,"aria-label":l,"aria-labelledby":u},d),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){if(void 0===e&&(e=""),e)return e;var t=n.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();return"".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"].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,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 l,useContext as c}from"react";import{jsxs as u,jsx as s,Fragment as a}from"react/jsx-runtime";import*as f from"react-dom";var d=n({isOpen:!1,handleOpenChange:function(){},rootClass:"",handleOverlayClick:function(){}});function p(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=p(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function m(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=p(e))&&(r&&(r+=" "),r+=t);return r}function v(){return"undefined"!=typeof window}function h(e){return w(e)?(e.nodeName||"").toLowerCase():"#document"}function g(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function y(e){var t;return null==(t=(w(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function w(e){return!!v()&&(e instanceof Node||e instanceof g(e).Node)}function b(e){return!!v()&&(e instanceof Element||e instanceof g(e).Element)}function x(e){return!!v()&&(e instanceof HTMLElement||e instanceof g(e).HTMLElement)}function E(e){return!(!v()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof g(e).ShadowRoot)}function R(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=k(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function C(e){return["table","td","th"].includes(h(e))}function O(e){return[":popover-open",":modal"].some((t=>{try{return e.matches(t)}catch(e){return!1}}))}function S(e){const t=L(),n=b(e)?k(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 L(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function A(e){return["html","body","#document"].includes(h(e))}function k(e){return g(e).getComputedStyle(e)}function P(e){return b(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function T(e){if("html"===h(e))return e;const t=e.assignedSlot||e.parentNode||E(e)&&e.host||y(e);return E(t)?t.host:t}function M(e){const t=T(e);return A(t)?e.ownerDocument?e.ownerDocument.body:e.body:x(t)&&R(t)?t:M(t)}function D(e,t,n){var r;void 0===t&&(t=[]),void 0===n&&(n=!0);const o=M(e),i=o===(null==(r=e.ownerDocument)?void 0:r.body),l=g(o);if(i){const e=N(l);return t.concat(l,l.visualViewport||[],R(o)?o:[],e&&n?D(e):[])}return t.concat(o,D(o,[],n))}function N(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function F(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 I(e,t){if(!e||!t)return!1;const n=null==t.getRootNode?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&E(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function W(){const e=navigator.userAgentData;return null!=e&&e.platform?e.platform:navigator.platform}function j(){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 B(e){return!j().includes("jsdom/")&&(!V()&&0===e.width&&0===e.height||V()&&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 H(){return/apple/i.test(navigator.vendor)}function V(){const e=/android/i;return e.test(W())||e.test(j())}function _(e,t){const n=["mouse","pen"];return n.push("",void 0),n.includes(e)}function q(e){return(null==e?void 0:e.ownerDocument)||document}function K(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 X(e){return"composedPath"in e?e.composedPath()[0]:e.target}function U(e){return x(e)&&e.matches("input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])")}function Y(e){e.preventDefault(),e.stopPropagation()}const $=["top","right","bottom","left"],z=Math.min,Z=Math.max,G=Math.round,Q=e=>({x:e,y:e}),J={left:"right",right:"left",bottom:"top",top:"bottom"},ee={start:"end",end:"start"};function te(e,t,n){return Z(e,z(t,n))}function ne(e,t){return"function"==typeof e?e(t):e}function re(e){return e.split("-")[0]}function oe(e){return e.split("-")[1]}function ie(e){return"x"===e?"y":"x"}function le(e){return"y"===e?"height":"width"}function ce(e){return["top","bottom"].includes(re(e))?"y":"x"}function ue(e){return ie(ce(e))}function se(e){return e.replace(/start|end/g,(e=>ee[e]))}function ae(e){return e.replace(/left|right|bottom|top/g,(e=>J[e]))}function fe(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 de(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 u=l.assignedElements(),c=e(u.length?u:l.children,!0,r);r.flatten?o.push.apply(o,c):o.push({scopeParent:l,candidates:c})}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,u=he(e);if(l&&!l.shadowRoot&&!0===r(l))return Ce(e);e=e.assignedSlot?e.assignedSlot:l||u===e.ownerDocument?l:u.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,u=!1;if(i&&i!==e)for(u=!!(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));!u&&l;){var c,s,a;u=!(null===(s=l=null===(c=i=he(l))||void 0===c?void 0:c.host)||void 0===s||null===(a=s.ownerDocument)||void 0===a||!a.contains(l))}return u}(e))return!e.getClientRects().length;if("legacy-full"!==n)return!0}return!1},Le=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))},Se=function(e,t){return!(Re(t)||be(t)<0||!Le(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,u=function(e,t){var n=be(e);return n<0&&t&&!we(e)?0:n}(l,i),c=i?e(t.candidates):l;0===u?i?n.push.apply(n,c):n.push(l):r.push({documentOrder:o,tabIndex:u,item:t,isScope:i,content:c})})),r.sort(xe).reduce((function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e}),[]).concat(n)},Te=function(e,t){var n;return n=(t=t||{}).getShadowRoot?ye([e],t.includeContainer,{filter:Se.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,Se.bind(null,t)),ke(n)};function Pe(e,t,n){let{reference:r,floating:o}=e;const i=ue(t),l=ce(t),u=le(l),c=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[u]/2-o[u]/2;let p;switch(c){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:u,strategy:c}=e,{boundary:s="clippingAncestors",rootBoundary:a="viewport",elementContext:f="floating",altBoundary:d=!1,padding:p=0}=ne(t,e),m=fe(p),v=u[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(u.floating)),boundary:s,rootBoundary:a,strategy:c})),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(u.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:u,rect:g,offsetParent:y,strategy:c}):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 Ie(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,u=G(n)!==i||G(r)!==l;return u&&(n=i,r=l),{width:n,height:r,$:u}}function Fe(e){return b(e)?e:e.contextElement}function We(e){const t=Fe(e);if(!x(t))return Q(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=Ie(t);let l=(i?G(n.width):n.width)/r,u=(i?G(n.height):n.height)/o;return l&&Number.isFinite(l)||(l=1),u&&Number.isFinite(u)||(u=1),{x:l,y:u}}const je=Q(0);function Be(e){const t=g(e);return S()&&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=Fe(e);let l=Q(1);t&&(r?b(r)&&(l=We(r)):l=We(e));const u=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==g(e))&&t}(i,n,r)?Be(i):Q(0);let c=(o.left+u.x)/l.x,s=(o.top+u.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;c*=e.x,s*=e.y,a*=e.x,f*=e.y,c+=i,s+=l,n=g(o),o=D(n)}}return de({width:a,height:f,x:c,y:s})}function Ve(e,t){const n=T(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,u=0,c=0;if(o){i=o.width,l=o.height;const e=S();(!e||e&&"fixed"===t)&&(u=o.offsetLeft,c=o.offsetTop)}return{width:i,height:l,x:u,y:c}}(e,n);else if("document"===t)r=function(e){const t=y(e),n=T(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 u=-n.scrollTop;return"rtl"===k(r).direction&&(l+=Z(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:l,y:u}}(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=P(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 u={scrollLeft:0,scrollTop:0};const c=Q(0);if(r||!r&&!i)if(("body"!==h(t)||R(o))&&(u=T(t)),r){const e=He(t,!0,i,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}else o&&(c.x=Ve(o));const s=!o||r||i?Q(0):_e(o,u);return{x:l.left+u.scrollLeft-c.x-s.x,y:l.top+u.scrollTop-c.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=P(e);for(;t&&!A(t);){if(b(t)&&!Ue(t))return t;t=P(t)}return n}let r=Ye(e,t);for(;r&&C(r)&&Ue(r);)r=Ye(r,t);return r&&A(r)&&Ue(r)&&!L(r)?n:r||function(e){let t=P(e);for(;x(t)&&!A(t);){if(L(t))return t;if(O(t))return null;t=P(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),u=!!t&&O(t.floating);if(r===l||u&&i)return n;let c={scrollLeft:0,scrollTop:0},s=Q(1);const a=Q(0),f=x(r);if((f||!f&&!i)&&(("body"!==h(r)||R(l))&&(c=T(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,c,!0);return{width:n.width*s.x,height:n.height*s.y,x:n.x*s.x-c.scrollLeft*s.x+a.x+d.x,y:n.y*s.y-c.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?P(e):e;for(;b(l)&&!A(l);){const t=k(l),n=L(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=P(l)}return t.set(e,r),r}(t,this._c):[].concat(n),r],l=i[0],u=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:u.right-u.left,height:u.bottom-u.top,x:u.left,y:u.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}=Ie(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:u}=t,c=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),u=oe(n),c="y"===ue(n),s=["left","top"].includes(l)?-1:1,a=i&&c?-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 u&&"number"==typeof m&&(p="end"===u?-1*m:m),c?{x:p*a,y:d*s}:{x:d*s,y:p*a}}(t,e);return l===(null==(n=u.offset)?void 0:n.placement)&&null!=(r=u.arrow)&&r.alignmentOffset?{}:{x:o+c.x,y:i+c.y,data:{...c,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:u={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...c}=ne(e,t),s={x:n,y:r},a=await Me(t,c),f=ue(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=u.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:u,platform:c,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=ue(u),w=re(u)===u,b=await(null==c.isRTL?void 0:c.isRTL(s.floating)),x=d||(w||!v?[ae(u)]:function(e){const t=ae(e);return[se(e),t,se(t)]}(u)),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}(u,v,m,b));const R=[u,...x],C=await Me(t,h),O=[];let L=(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=ce(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(L=[...L,{placement:o,overflows:O}],!O.every((e=>e<=0))){var S,A;const e=((null==(S=i.flip)?void 0:S.index)||0)+1,t=R[e];if(t)return{data:{index:e,overflows:L},reset:{placement:t}};let n=null==(A=L.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=L.filter((e=>{if(E){const t=ue(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=u}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:u,middlewareData:c}=t,{element:s,padding:a=0}=ne(e,t)||{};if(null==s)return{};const f=fe(a),d={x:n,y:r},p=ce(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=u.floating[w]||i.floating[m]);const C=b/2-x/2,O=R/2-v[m]/2-1,L=z(f[g],O),S=z(f[y],O),A=L,k=R-v[m]-S,T=R/2-v[m]/2+C,P=te(A,T,k),M=!c.arrow&&null!=oe(o)&&T!==P&&i.reference[m]/2-(T<A?L:S)-v[m]/2<0,N=M?T<A?T-A:T-k:0;return{[p]:d[p]+N,data:{[p]:P,centerOffset:T-P-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,u=i.filter(Boolean),c=await(null==l.isRTL?void 0:l.isRTL(t));let s=await l.getElementRects({reference:e,floating:t,strategy:o}),{x:a,y:f}=Pe(s,r,c),d=r,p={},m=0;for(let n=0;n<u.length;n++){const{name:i,fn:v}=u[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}=Pe(s,d,c))),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 ut=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 ct(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:u=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 L=2*d,S=L/2,A=u/2*(f/-8+1),T=a/2*f/4,P=!!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:"",I=null!=(null==i?void 0:i.y)?O||i.y:"",F=v||"M0,0 H"+u+" L"+(u-A)+","+(a-T)+" Q"+u/2+","+a+" "+A+","+(a-T)+" Z",W={top:P?"rotate(180deg)":"",left:P?"rotate(90deg)":"rotate(-90deg)",bottom:P?"":"rotate(180deg)",right:P?"rotate(-90deg)":"rotate(90deg)"}[E];return c("svg",{...y,"aria-hidden":!0,ref:n,width:P?u:u+L,height:u,viewBox:"0 0 "+u+" "+(a>u?a:u),style:{position:"absolute",pointerEvents:"none",[N]:D,[M]:I,[E]:C||P?"100%":"calc(100% - "+L/2+"px)",transform:[W,h].filter((e=>!!e)).join(" "),...g},children:[L>0&&s("path",{clipPath:"url(#"+w+")",fill:"none",stroke:m,strokeWidth:L+(v?0:1),d:F}),s("path",{stroke:L&&!v?y.fill:"none",d:F}),s("clipPath",{id:w,children:s("rect",{x:-S,y:S*(P?-1:1),width:u+L,height:u})})]})}));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 Lt(e,t,n){return n&&!_(n)?0:"number"==typeof e?e:null==e?void 0:e[t]}let St=0;function At(e,t){void 0===t&&(t={});const{preventScroll:n=!1,cancelPrevious:r=!0,sync:o=!1}=t;r&&cancelAnimationFrame(St);const i=()=>null==e?void 0:e.focus({preventScroll:n});o?i():St=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 Tt(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 Pt=new WeakMap,Mt=new WeakSet,Nt={},Dt=0;const It=e=>e&&(e.host||It(e.parentNode));function Ft(e,t,n,r){const o="data-floating-ui-inert",i=r?"inert":n?"aria-hidden":null,l=(u=t,e.map((e=>{if(u.contains(e))return e;const t=It(e);return u.contains(t)?t:null})).filter((e=>null!=e)));var u;const c=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||c.has(t))return;c.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(c.has(t))e(t);else{const e=i?t.getAttribute(i):null,n=null!==e&&"false"!==e,r=Pt.get(t)||0,l=i?r+1:r,u=(f.get(t)||0)+1;Pt.set(t,l),f.set(t,u),a.push(t),1===l&&n&&Mt.add(t),1===u&&t.setAttribute(o,""),!n&&i&&t.setAttribute(i,"true")}}))}(t),c.clear(),Dt++,()=>{a.forEach((e=>{const t=Pt.get(e)||0,n=i?t-1:t,r=(f.get(e)||0)-1;Pt.set(e,n),f.set(e,r),n||(!Mt.has(e)&&i&&e.removeAttribute(i),Mt.delete(e)),r||e.removeAttribute(o)})),Dt--,Dt||(Pt=new WeakMap,Pt=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 Ft(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=Te(e,jt());"prev"===t&&n.reverse();const r=n.indexOf(I(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||!F(n,r)}function qt(e){Te(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)&&Se(t,e)}(e,t)?e:Te(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 un=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,u;const e=(null==(l=window.visualViewport)?void 0:l.offsetLeft)||0,n=(null==(u=window.visualViewport)?void 0:u.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}})})),cn={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({}),[u]=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)))||[])}}}())),c=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,u.emit("openchange",{open:e,event:t,reason:n,nested:c}),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:u,floatingId:i,refs:d})),[n,f,p,u,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,u]=e.useState(null),c=e.useRef(null);return dt((()=>()=>{null==l||l.remove(),queueMicrotask((()=>{c.current=null}))}),[l]),dt((()=>{if(!o)return;if(c.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),c.current=t,u(t)}),[n,o]),dt((()=>{if(null===r)return;if(!o)return;if(c.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),c.current=l,u(l)}),[n,r,o,i]),l}({id:r,root:o}),[u,a]=e.useState(null),d=e.useRef(null),p=e.useRef(null),m=e.useRef(null),v=e.useRef(null),h=null==u?void 0:u.modal,g=null==u?void 0:u.open,y=!!u&&!u.modal&&u.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]),c($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==u?void 0:u.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==u?void 0:u.domReference);null==t||t.focus(),(null==u?void 0:u.closeOnFocusOut)&&(null==u||u.onOpenChange(!1,e.nativeEvent,"focus-out"))}}})]})},Overlay:un,FocusManager:function(t){const{context:n,children:r,disabled:o=!1,order:i=["content"],guards:l=!0,initialFocus:u=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 u&&u<0,L=!!(S=E)&&"combobox"===S.getAttribute("role")&&U(S)&&O;var S;const A="undefined"!=typeof HTMLElement&&"inert"in HTMLElement.prototype,k=!A||l,T=!k||A&&h,P=Ct(i),M=Ct(u),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?Te(e,jt()):[]})),Q=ft((e=>{const t=G(e);return P.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){F(Z,I(q(Z)))&&0===G().length&&!L&&Y(e);const t=Q(),n=X(e);"reference"===P.current[0]&&n===E&&(Y(e),e.shiftKey?At(t[t.length-1]):At(t[1])),"floating"===P.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,P,L,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=!(F(E,t)||F(R,t)||F(t,R)||F(null==W?void 0:W.portalNode,t)||null!=t&&t.hasAttribute(Rt("focus-guard"))||D&&(Tt(D.nodesRef.current,n).find((e=>{var n,r;return F(null==(n=e.context)?void 0:n.elements.floating,t)||F(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&&I(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()}!L&&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,L,C]);const J=e.useRef(null),ee=e.useRef(null),te=ct([J,null==W?void 0:W.beforeInsideRef]),ne=ct([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,P.current.includes("reference")||L?E:null].filter((e=>null!=e)),i=p||L?Wt(r,!T,T):Wt(r);return()=>{i()}}),[o,E,R,p,P,W,L,k,T,D,C]),dt((()=>{if(o||!x(Z))return;const e=I(q(Z));queueMicrotask((()=>{const t=Q(Z),n=M.current,r=("number"==typeof n?t[n]:n.current)||Z,o=F(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=I(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=I(t),o=F(R,n)||D&&Tt(D.nodesRef.current,C()).some((e=>{var t;return F(null==(t=e.context)?void 0:t.elements.floating,n)}));(o||r&&["click","mousedown"].includes(r.type))&&E&&en(E);const u="boolean"==typeof N.current?tn()||l:N.current.current||l;queueMicrotask((()=>{const r=nn(u);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=I(q(R)),r=t.indexOf(n);-1!==r&&($.current=r),P.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,P,G,O]);const oe=!o&&k&&(!p||!L)&&(z||p);return c(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()}}}),!L&&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,u]=e.useState(null),[c,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:u}={},transform:c=!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=u||y,C=e.useRef(null),O=e.useRef(null),L=e.useRef(d),S=null!=s,A=lt(s),k=lt(i),T=lt(a),P=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!==T.current};M.current&&!rt(L.current,t)&&(L.current=t,f.flushSync((()=>{p(t)})))}))}),[m,n,r,k,T]);nt((()=>{!1===a&&L.current.isPositioned&&(L.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,P);P()}}),[E,R,P,A,S]);const N=e.useMemo((()=>({reference:C,floating:O,setReference:b,setFloating:x})),[b,x]),D=e.useMemo((()=>({reference:E,floating:R})),[E,R]),I=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 c?{...e,transform:"translate("+t+"px, "+n+"px)",...ot(D.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:t,top:n}}),[r,c,D.floating,d.x,d.y]);return e.useMemo((()=>({...d,update:P,refs:N,elements:D,floatingStyles:I})),[d,P,N,D,I])}({...t,elements:{...i,...c&&{reference:c}}}),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,u(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)=>({...ut(e),options:[e,t]}),useRole:function(t,n){var r;void 0===n&&(n={});const{open:o,floatingId:i}=t,{enabled:l=!0,role:u="dialog"}=n,c=null!=(r=vn.get(u))?r:u,s=ht(),a=null!=xt(),f=e.useMemo((()=>"tooltip"===c||"label"===u?{["aria-"+("label"===u?"labelledby":"describedby")]:o?i:void 0}:{"aria-expanded":o?"true":"false","aria-haspopup":"alertdialog"===c?"dialog":c,"aria-controls":o?i:void 0,..."listbox"===c&&{role:"combobox"},..."menu"===c&&{id:s},..."menu"===c&&a&&{role:"menuitem"},..."select"===u&&{"aria-autocomplete":"none"},..."combobox"===u&&{"aria-autocomplete":"list"}}),[c,i,a,o,s,u]),d=e.useMemo((()=>{const e={id:i,...c&&{role:c}};return"tooltip"===c||"label"===u?e:{...e,..."menu"===c&&{"aria-labelledby":s}}}),[c,i,s,u]),p=e.useCallback((e=>{let{active:t,selected:n}=e;const r={role:"option",...t&&{id:i+"-option"}};switch(u){case"select":return{...r,"aria-selected":t&&n};case"combobox":return{...r,...t&&{"aria-selected":!0}}}return{}}),[i,u]);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:u}=t,{enabled:c=!0,visibleOnly:s=!0}=n,a=e.useRef(!1),f=e.useRef(),d=e.useRef(!0);e.useEffect((()=>{if(!c)return;const e=g(u.domReference);function t(){!r&&x(u.domReference)&&u.domReference===I(q(u.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)}}),[u.domReference,r,c]),e.useEffect((()=>{if(c)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,c]),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=I(u.domReference?u.domReference.ownerDocument:document);(t||i!==u.domReference)&&(F(null==(e=l.current.floatingContext)?void 0:e.refs.floating.current,i)||F(u.domReference,i)||r||o(!1,n,"focus"))}))}})),[l,u.domReference,o,s]);return e.useMemo((()=>c?{reference:p}:{}),[c,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),u=e.useCallback((e=>mn(e,t,"item")),o);return e.useMemo((()=>({getReferenceProps:i,getFloatingProps:l,getItemProps:u})),[i,l,u])},useDismiss:function(t,n){void 0===n&&(n={});const{open:r,onOpenChange:o,elements:i,dataRef:l}=t,{enabled:u=!0,escapeKey:c=!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:L}=an(v),T=e.useRef(!1),M=ft((e=>{var t;if(!r||!u||!c||"Escape"!==e.key)return;if(T.current)return;const n=null==(t=l.current.floatingContext)?void 0:t.nodeId,i=h?Tt(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)})),I=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 u=X(e),c="["+Rt("inert")+"]",s=q(i.floating).querySelectorAll(c);let f=b(u)?u:null;for(;f&&!A(f);){const e=P(f);if(A(e)||!b(e))break;f=e}if(s.length&&b(u)&&!u.matches("html,body")&&!F(u,i.floating)&&Array.from(s).every((e=>!F(f,e))))return;if(x(u)&&B){const t=A(u),n=k(u),r=/auto|scroll/,o=t||r.test(n.overflowX),i=t||r.test(n.overflowY),l=o&&u.clientWidth>0&&u.scrollWidth>u.clientWidth,c=i&&u.clientHeight>0&&u.scrollHeight>u.clientHeight,s="rtl"===n.direction,a=c&&(s?e.offsetX<=u.offsetWidth-u.clientWidth:e.offsetX>u.clientWidth),f=l&&e.offsetY>u.clientHeight;if(a||f)return}const d=null==(t=l.current.floatingContext)?void 0:t.nodeId,p=h&&Tt(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?Tt(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;I(e),null==(t=X(e))||t.removeEventListener(a,n)};null==(t=X(e))||t.addEventListener(a,n)}));e.useEffect((()=>{if(!r||!u)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),T.current=!0}function s(){e=window.setTimeout((()=>{T.current=!1}),S()?5:0)}const f=q(i.floating);c&&(f.addEventListener("keydown",O?D:M,O),f.addEventListener("compositionstart",n),f.addEventListener("compositionend",s)),y&&f.addEventListener(a,L?W:I,L);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})})),()=>{c&&(f.removeEventListener("keydown",O?D:M,O),f.removeEventListener("compositionstart",n),f.removeEventListener("compositionend",s)),y&&f.removeEventListener(a,L?W:I,L),d.forEach((e=>{e.removeEventListener("scroll",t)})),window.clearTimeout(e)}}),[l,i,c,y,a,r,o,p,u,R,C,M,O,D,I,L,W]),e.useEffect((()=>{w.current=!1}),[y,a]);const j=e.useMemo((()=>({onKeyDown:M,...f&&{[cn[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((()=>u?{reference:j,floating:B}:{}),[u,j,B])},useHover:function(t,n){void 0===n&&(n={});const{open:r,onOpenChange:o,dataRef:i,events:l,elements:u}=t,{enabled:c=!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),L=e.useRef((()=>{})),S=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(c)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,S.current=!1)}}),[c,l]),e.useEffect((()=>{if(!c)return;if(!h.current)return;if(!r)return;function e(e){A()&&o(!1,e,"hover")}const t=q(u.floating).documentElement;return t.addEventListener("mouseleave",e),()=>{t.removeEventListener("mouseleave",e)}}),[u.floating,r,o,c,h,A]);const k=e.useCallback((function(e,t,n){void 0===t&&(t=!0),void 0===n&&(n="hover");const r=Lt(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]),T=ft((()=>{L.current(),E.current=void 0})),P=ft((()=>{if(O.current){const e=q(u.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(c&&b(u.domReference)){var e;const o=u.domReference;return r&&o.addEventListener("mouseleave",l),null==(e=u.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=u.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&&!Lt(g.current,"open"))return;const t=Lt(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;L.current();const t=q(u.floating);if(clearTimeout(R.current),S.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(){P(),T(),M()||k(e,!0,"safe-polygon")}});const n=E.current;return t.addEventListener("mousemove",n),void(L.current=()=>{t.removeEventListener("mousemove",n)})}("touch"!==w.current||!F(u.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(){P(),T(),M()||k(e)}})(e))}}),[u,c,t,f,d,p,k,T,P,o,r,y,m,g,h,i,M]),dt((()=>{var e;if(c&&r&&null!=(e=h.current)&&e.__options.blockPointerEvents&&A()){O.current=!0;const e=u.floating;if(b(u.domReference)&&e){var t;const n=q(u.floating).body;n.setAttribute(Ot,"");const r=u.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=""}}}}),[c,r,v,u,m,h,A]),dt((()=>{r||(w.current=void 0,S.current=!1,T(),P())}),[r,T,P]),e.useEffect((()=>()=>{T(),clearTimeout(x.current),clearTimeout(R.current),P()}),[c,u.domReference,T,P]);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||S.current&&e.movementX**2+e.movementY**2<2||(clearTimeout(R.current),"touch"===w.current?n():(S.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((()=>c?{reference:N,floating:D}:{}),[c,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:ct},gn="AlertDialog",yn=function(e){var n=e.children,r=e.customRootClass,o=void 0===r?"":r,i=e.open,u=e.onOpenChange,c=e.onClickOutside,s=void 0===c?function(){}:c,a=hn.useFloating().context,f=function(e,t){if(void 0===e&&(e=""),e)return e;var n=t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();return"".concat("rad-ui","-").concat(n)}(o,gn),p=l(i),v=p[0],h=p[1],g={isOpen:v,handleOpenChange:function(e){h(e),u(e)},floaterContext:a,rootClass:f,handleOverlayClick:function(){s()}};return t.createElement(d.Provider,{value:g},t.createElement("div",{className:m(f)},n))};yn.displayName=gn;var wn=function(e){var n=e.children,r=u(d),o=r.isOpen,i=r.rootClass;return t.createElement(t.Fragment,null,o&&t.createElement("div",{className:m("".concat(i,"-content"))},n))},bn=function(){return bn=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},bn.apply(this,arguments)};function xn(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 En=["div","span","button","input","a"].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,u=xn(n,["asChild","children"]);if(i){var c=t.Children.toArray(l);if(1!==c.length||!t.isValidElement(c[0]))return console.warn("Primitive.".concat(e,": asChild prop requires exactly one valid child element.")),t.createElement(e,bn(bn({},u),{ref:r}),l);var s=c[0];return t.cloneElement(s,bn(bn(bn({},u),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,bn(bn({},u),{ref:r}),l)}));return n.displayName="Primitive.".concat(e),n}(n),e}),{}),Rn=function(e){var n=e.role,r=void 0===n?"button":n,o=e.label,i=void 0===o?"":o,l=e.description,u=void 0===l?"":l,c=e.disabled,s=void 0!==c&&c,a=e.children,f=xn(e,["role","label","description","disabled","children"]);return i&&(f["aria-label"]=i),u&&(f["aria-description"]=u),s&&(f["aria-disabled"]="true",u||(f["aria-description"]="Disabled Button")),t.createElement(En.button,bn({role:r,disabled:s},f),a)},Cn=function(e){var n=e.children,r=xn(e,["children"]),o=u(d),i=o.rootClass,l=o.handleOpenChange;return t.createElement(Rn,bn({onClick:function(){return l(!0)}},r,{className:m("".concat(i,"-trigger"))}),n)},On=function(e){var n=e.children,r=u(d).rootClass,o=document.getElementsByClassName(r)[0];return t.createElement(hn.Portal,{root:o||document.body},n)},Ln=function(){var e=u(d),n=e.isOpen,r=e.rootClass,o=e.handleOverlayClick;return t.createElement(t.Fragment,null,n&&t.createElement(hn.Overlay,{className:m("".concat(r,"-overlay")),onClick:o}))},Sn=function(e){var n=e.children,r=u(d),o=r.rootClass,i=r.handleOpenChange;return t.createElement(Rn,{onClick:function(){return i(!1)},className:m("".concat(o,"-cancel"))},n)},An=function(e){var n=e.children,r=u(d),o=r.rootClass,i=r.handleOpenChange;return t.createElement(Rn,{onClick:function(){return i(!1)},className:m("".concat(o,"-action"))},n)},kn=function(e){var n=e.children,r=e.open,o=void 0!==r&&r,i=e.onOpenChange,u=void 0===i?function(){}:i,c=e.content,s=l(o),a=s[0],f=s[1];return t.createElement(yn,{open:a,onOpenChange:function(e){f(e),u(e)}},t.createElement(Cn,null,n),t.createElement(On,null,t.createElement(Ln,null),t.createElement(wn,null,c,t.createElement(Sn,null,"Cancel"),t.createElement(An,null,"Continue"))))};kn.Root=yn,kn.Content=wn,kn.Trigger=Cn,kn.Portal=On,kn.Overlay=Ln,kn.Cancel=Sn,kn.Action=An;export{kn as default};
|
|
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 De(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Ne(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=N(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=N(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=D(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=De(await Me(t,{...o,elementContext:"reference"}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:Ne(e)}}}case"escaped":{const e=De(await Me(t,{...o,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:Ne(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,D=M?P<A?P-A:P-k:0;return{[p]:d[p]+D,data:{[p]:T,centerOffset:P-T-D,...M&&{alignmentOffset:D}},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 D=O&&"end"===R?"right":"left";O&&b&&(D="end"===R?"left":"right");const N=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",[D]:N,[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,Dt={},Nt=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=[];Dt[o]||(Dt[o]=new WeakMap);const f=Dt[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(),Nt++,()=>{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)})),Nt--,Nt||(Tt=new WeakMap,Tt=new WeakMap,Mt=new WeakSet,Dt={})}}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),D=Ct(f),N=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"))||N&&(Pt(N.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(N.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,N,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=N&&!p?kt(null==N?void 0:N.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,N,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)||N&&Pt(N.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 D.current?tn()||l:D.current.current||l;queueMicrotask((()=>{const r=nn(c);D.current&&!_.current&&x(r)&&(r===n||n===t.body||o)&&r.focus({preventScroll:e}),l.remove()}))}}),[o,R,Z,D,b,w,N,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 D=e.useMemo((()=>({reference:C,floating:O,setReference:b,setFloating:x})),[b,x]),N=e.useMemo((()=>({reference:E,floating:R})),[E,R]),F=e.useMemo((()=>{const e={position:r,left:0,top:0};if(!N.floating)return e;const t=it(N.floating,d.x),n=it(N.floating,d.y);return u?{...e,transform:"translate("+t+"px, "+n+"px)",...ot(N.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:t,top:n}}),[r,u,N.floating,d.x,d.y]);return e.useMemo((()=>({...d,update:T,refs:D,elements:N,floatingStyles:F})),[d,T,D,N,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")})),N=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?N: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=D(i.domReference)),b(i.floating)&&(d=d.concat(D(i.floating))),!b(i.reference)&&i.reference&&i.reference.contextElement&&(d=d.concat(D(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?N: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,N,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 D=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]),N=e.useMemo((()=>({onMouseEnter(){clearTimeout(x.current)},onMouseLeave(e){M()||k(e.nativeEvent,!1)}})),[k,M]);return e.useMemo((()=>u?{reference:D,floating:N}:{}),[u,D,N])},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.customRootClass,o=void 0===r?"":r,i=e.open,c=e.onOpenChange,u=e.onClickOutside,s=void 0===u?function(){}:u,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)}(o,gn),f=l(i),p=f[0],v=f[1],h=function(e){v(e),c(e)},g=hn.useFloating({open:p,onOpenChange:h}),y=g.context,w=g.refs,b=g.floatingStyles,x=hn.useDismiss(y),E=hn.useRole(y,{role:"dialog"}),R=hn.useInteractions([x,E]),C={isOpen:p,handleOpenChange:h,floaterContext:y,rootClass:a,handleOverlayClick:function(){s()},getReferenceProps:R.getReferenceProps,getFloatingProps:R.getFloatingProps,getItemProps:R.getItemProps,refs:w,floatingStyles:b};return t.createElement(d.Provider,{value:C},t.createElement("div",{className:m(a)},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.Content=function(e){var n=e.children,r=c(d),o=r.isOpen,i=r.rootClass,l=r.getFloatingProps,u=r.floaterContext,s=r.refs;return t.createElement(t.Fragment,null,o&&t.createElement(hn.FocusManager,{context:u,returnFocus:!0},t.createElement("div",wn({ref:s.setFloating,className:m("".concat(i,"-content"))},l()),n)))},Rn.Trigger=function(e){var n=e.children,r=e.asChild;bn(e,["children","asChild"]);var o=c(d),i=o.rootClass,l=o.handleOpenChange,u=o.getReferenceProps,s=o.refs;return t.createElement(En,wn({ref:s.setReference,asChild:r,onClick:function(){return l(!0)},className:m("".concat(i,"-trigger"))},u()),n)},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.Overlay=function(){var e=c(d),n=e.isOpen,r=e.rootClass,o=e.handleOverlayClick;return t.createElement(t.Fragment,null,n&&t.createElement(hn.Overlay,{className:m("".concat(r,"-overlay")),onClick:o}))},Rn.Cancel=function(e){var n=e.children,r=e.asChild,o=c(d),i=o.rootClass,l=o.handleOpenChange,u=o.getItemProps;return t.createElement(En,wn({asChild:r,onClick:function(){return l(!1)},className:m("".concat(i,"-cancel"))},u()),n)},Rn.Action=function(e){var n=e.children,r=e.asChild,o=c(d),i=o.rootClass,l=o.handleOpenChange,u=o.getItemProps;return t.createElement(En,wn({asChild:r,onClick:function(){return l(!1)},className:m("".concat(i,"-action"))},u()),n)},Rn.Title=function(e){var n=e.children,r=c(d).rootClass;return t.createElement(xn.h2,{className:"".concat(r,"-title")},n)},Rn.Description=function(e){var n=e.children,r=c(d).rootClass;return t.createElement(xn.p,{className:"".concat(r,"-description")},n)};export{Rn as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use client';import r from"react";var
|
|
1
|
+
'use client';import r from"react";var t=function(){return t=Object.assign||function(r){for(var t,e=1,o=arguments.length;e<o;e++)for(var a in t=arguments[e])Object.prototype.hasOwnProperty.call(t,a)&&(r[a]=t[a]);return r},t.apply(this,arguments)};"function"==typeof SuppressedError&&SuppressedError;function e(r){var t,o,a="";if("string"==typeof r||"number"==typeof r)a+=r;else if("object"==typeof r)if(Array.isArray(r)){var n=r.length;for(t=0;t<n;t++)r[t]&&(o=e(r[t]))&&(a&&(a+=" "),a+=o)}else for(o in r)r[o]&&(a&&(a+=" "),a+=o);return a}function o(){for(var r,t,o=0,a="",n=arguments.length;o<n;o++)(r=arguments[o])&&(t=e(r))&&(a&&(a+=" "),a+=t);return a}var a="AspectRatio",n=function(e){var n=e.children,c=e.customRootClass,i=e.className,s=e.ratio,l=void 0===s?"1":s,f=function(r,t){var e={};for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&t.indexOf(o)<0&&(e[o]=r[o]);if(null!=r&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(o=Object.getOwnPropertySymbols(r);a<o.length;a++)t.indexOf(o[a])<0&&Object.prototype.propertyIsEnumerable.call(r,o[a])&&(e[o[a]]=r[o[a]])}return e}(e,["children","customRootClass","className","ratio"]);isNaN(Number(l))&&!l.match(/^(\d+)\/(\d+)$/)&&(l="1"),Number(l)<=0&&(l="1");var p=function(r,t){void 0===r&&(r="");var e=t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();return r?"".concat(r,"-").concat(e):"".concat("rad-ui","-").concat(e)}(c,a);return r.createElement("div",t({style:{aspectRatio:l},className:o(p,i)},f),n," ")};n.displayName=a;export{n as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use client';import r,{createContext as e,useState as
|
|
1
|
+
'use client';import r,{createContext as e,useState as t,useCallback as a,useContext as n,useEffect as o}from"react";var c=function(){return c=Object.assign||function(r){for(var e,t=1,a=arguments.length;t<a;t++)for(var n in e=arguments[t])Object.prototype.hasOwnProperty.call(e,n)&&(r[n]=e[n]);return r},c.apply(this,arguments)};function i(r,e){var t={};for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&e.indexOf(a)<0&&(t[a]=r[a]);if(null!=r&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(a=Object.getOwnPropertySymbols(r);n<a.length;n++)e.indexOf(a[n])<0&&Object.prototype.propertyIsEnumerable.call(r,a[n])&&(t[a[n]]=r[a[n]])}return t}"function"==typeof SuppressedError&&SuppressedError;var l=e({}),s=["div","span","button","input","a","img","p","h2"].reduce((function(e,t){return e[t]=function(e){var t=r.forwardRef((function(t,a){var n=t.asChild,o=void 0!==n&&n,l=t.children,s=i(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,c(c({},s),{ref:a}),l);var f=u[0];return r.cloneElement(f,c(c(c({},s),f.props),a?{ref:function(r){"function"==typeof a?a(r):a&&(a.current=r);var e=f.ref;"function"==typeof e?e(r):e&&(e.current=r)}}:{}))}return r.createElement(e,c(c({},s),{ref:a}),l)}));return t.displayName="Primitive.".concat(e),t}(t),e}),{}),u=function(e){var a=e.children,n=e.asChild,o=void 0!==n&&n,u=i(e,["children","asChild"]),f=t(!1),d=f[0],v=f[1],m=t(!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),a))};function f(r){var e,t,a="";if("string"==typeof r||"number"==typeof r)a+=r;else if("object"==typeof r)if(Array.isArray(r)){var n=r.length;for(e=0;e<n;e++)r[e]&&(t=f(r[e]))&&(a&&(a+=" "),a+=t)}else for(t in r)r[t]&&(a&&(a+=" "),a+=t);return a}function d(){for(var r,e,t=0,a="",n=arguments.length;t<n;t++)(r=arguments[t])&&(e=f(r))&&(a&&(a+=" "),a+=e);return a}var v=e({size:"",variant:"",color:"",rootClass:""}),m=function(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];return a((function(){return Object.assign.apply(Object,function(r,e,t){if(t||2===arguments.length)for(var a,n=0,o=e.length;n<o;n++)!a&&n in e||(a||(a=Array.prototype.slice.call(e,0,n)),a[n]=e[n]);return r.concat(a||Array.prototype.slice.call(e))}([{}],r.filter((function(r){return null!==r})),!1))}),[r])},p=function(e){var t=e.src,a=void 0===t?"":t,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(){a||m()}),[a,m,h]),r.createElement(s.img,c({src:a,alt:f,onError:m,onLoad:p},d)))},h=function(e){var t=e.children,a=e.asChild,o=void 0!==a&&a,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),t)},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 t,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 t=e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();return r?"".concat(r,"-").concat(t):"".concat("rad-ui","-").concat(t)}(s,"Avatar"),N=a((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],a=r[1];return["data-".concat(t,"-").concat(e),a]}))):{}}),[t="avatar",n={variant:E,size:y}]),j=function(r){return a((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 t=e.src,a=void 0===t?"":t,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:a,alt:l},s))},y.Fallback=function(e){var t=e.children,a=e.className,o=void 0===a?"":a,l=i(e,["children","className"]),s=n(v).rootClass;return r.createElement(h,c({className:d("".concat(s,"-fallback"),o)},l),t)};export{y as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use client';import r,{createContext as e,useState as
|
|
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};
|
package/dist/components/Badge.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use client';import r from"react";var e=function(){return e=Object.assign||function(r){for(var e
|
|
1
|
+
'use client';import r,{useCallback as t}from"react";var e=function(){return e=Object.assign||function(r){for(var t,e=1,n=arguments.length;e<n;e++)for(var o in t=arguments[e])Object.prototype.hasOwnProperty.call(t,o)&&(r[o]=t[o]);return r},e.apply(this,arguments)};"function"==typeof SuppressedError&&SuppressedError;function n(r){var t,e,o="";if("string"==typeof r||"number"==typeof r)o+=r;else if("object"==typeof r)if(Array.isArray(r)){var a=r.length;for(t=0;t<a;t++)r[t]&&(e=n(r[t]))&&(o&&(o+=" "),o+=e)}else for(e in r)r[e]&&(o&&(o+=" "),o+=e);return o}function o(){for(var r,t,e=0,o="",a=arguments.length;e<a;e++)(r=arguments[e])&&(t=n(r))&&(o&&(o+=" "),o+=t);return o}var a=function(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];return t((function(){return Object.assign.apply(Object,function(r,t,e){if(e||2===arguments.length)for(var n,o=0,a=t.length;o<a;o++)!n&&o in t||(n||(n=Array.prototype.slice.call(t,0,o)),n[o]=t[o]);return r.concat(n||Array.prototype.slice.call(t))}([{}],r.filter((function(r){return null!==r})),!1))}),[r])},c=function(n){var c,i,l=n.children,u=n.customRootClass,f=void 0===u?"":u,s=n.className,p=void 0===s?"":s,v=n.color,y=void 0===v?"":v,d=n.variant,b=void 0===d?"":d,O=n.size,g=void 0===O?"":O,m=function(r,t){var e={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&t.indexOf(n)<0&&(e[n]=r[n]);if(null!=r&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(r);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(r,n[o])&&(e[n[o]]=r[n[o]])}return e}(n,["children","customRootClass","className","color","variant","size"]),h=function(r,t){void 0===r&&(r="");var e=t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();return r?"".concat(r,"-").concat(e):"".concat("rad-ui","-").concat(e)}(f,"Badge"),j=t((function(){return i?Object.fromEntries(Object.entries(i).filter((function(r){r[0];var t=r[1];return void 0!==t&&""!==t})).map((function(r){var t=r[0],e=r[1];return["data-".concat(c,"-").concat(t),e]}))):{}}),[c="badge",i={variant:b,size:g}]),w=function(r){return t((function(){return r?{"data-rad-ui-accent-color":r}:{}}),[r])}(y),A=a(j(),w());return r.createElement("div",e({className:o(h,p)},A(),m),l)};export{c as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use client';import r from"react";var
|
|
1
|
+
'use client';import r from"react";var t=function(){return t=Object.assign||function(r){for(var t,o=1,e=arguments.length;o<e;o++)for(var a in t=arguments[o])Object.prototype.hasOwnProperty.call(t,a)&&(r[a]=t[a]);return r},t.apply(this,arguments)};function o(r){var t,e,a="";if("string"==typeof r||"number"==typeof r)a+=r;else if("object"==typeof r)if(Array.isArray(r)){var n=r.length;for(t=0;t<n;t++)r[t]&&(e=o(r[t]))&&(a&&(a+=" "),a+=e)}else for(e in r)r[e]&&(a&&(a+=" "),a+=e);return a}function e(){for(var r,t,e=0,a="",n=arguments.length;e<n;e++)(r=arguments[e])&&(t=o(r))&&(a&&(a+=" "),a+=t);return a}"function"==typeof SuppressedError&&SuppressedError;var a="BlockQuote",n=function(o){var n=o.children,c=o.customRootClass,i=void 0===c?"":c,l=o.className,s=void 0===l?"":l,u=o.color,f=void 0===u?"":u,p=o.variant,v=void 0===p?"":p,d=o.size,y=void 0===d?"":d,b=function(r,t){var o={};for(var e in r)Object.prototype.hasOwnProperty.call(r,e)&&t.indexOf(e)<0&&(o[e]=r[e]);if(null!=r&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(e=Object.getOwnPropertySymbols(r);a<e.length;a++)t.indexOf(e[a])<0&&Object.prototype.propertyIsEnumerable.call(r,e[a])&&(o[e[a]]=r[e[a]])}return o}(o,["children","customRootClass","className","color","variant","size"]),m=function(r,t){void 0===r&&(r="");var o=t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();return r?"".concat(r,"-").concat(o):"".concat("rad-ui","-").concat(o)}(i,a),O={};return v&&(O["data-block-quote-variant"]=v),y&&(O["data-block-quote-size"]=y),f&&(O["data-rad-ui-accent-color"]=f),r.createElement("blockquote",t({className:e(m,s)},b,O)," ",n)};n.displayName=a;export{n as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use client';import r,{useCallback as e}from"react";var t=function(){return t=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},t.apply(this,arguments)};function n(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 o(r){var e,t,n="";if("string"==typeof r||"number"==typeof r)n+=r;else if("object"==typeof r)if(Array.isArray(r)){var i=r.length;for(e=0;e<i;e++)r[e]&&(t=o(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="",i=arguments.length;t<i;t++)(r=arguments[t])&&(e=o(r))&&(n&&(n+=" "),n+=e);return n}var a=["div","span","button","input","a"].reduce((function(e,o){return e[o]=function(e){var o=r.forwardRef((function(o,i){var a=o.asChild,c=void 0!==a&&a,l=o.children,u=n(o,["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,t(t({},u),{ref:i}),l);var s=f[0];return r.cloneElement(s,t(t(t({},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,t(t({},u),{ref:i}),l)}));return o.displayName="Primitive.".concat(e),o}(o),e}),{}),c=function(e){var o=e.role,i=void 0===o?"button":o,c=e.label,l=void 0===c?"":c,u=e.description,f=void 0===u?"":u,s=e.disabled,d=void 0!==s&&s,p=e.children,v=n(e,["role","label","description","disabled","children"]);return l&&(v["aria-label"]=l),f&&(v["aria-description"]=f),d&&(v["aria-disabled"]="true",f||(v["aria-description"]="Disabled Button")),r.createElement(a.button,t({role:i,disabled:d},v),p)},l=function(){for(var r=[],t=0;t<arguments.length;t++)r[t]=arguments[t];return e((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])},u="Button",f=function(o){var a,f,s=o.children,d=o.type,p=void 0===d?"button":d,v=o.customRootClass,y=void 0===v?"":v,b=o.className,m=void 0===b?"":b,h=o.variant,O=void 0===h?"":h,g=o.size,j=void 0===g?"":g,E=o.color,w=void 0===E?"":E,C=n(o,["children","type","customRootClass","className","variant","size","color"]),A=function(r,e){
|
|
1
|
+
'use client';import r,{useCallback as e}from"react";var t=function(){return t=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},t.apply(this,arguments)};function n(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 o(r){var e,t,n="";if("string"==typeof r||"number"==typeof r)n+=r;else if("object"==typeof r)if(Array.isArray(r)){var i=r.length;for(e=0;e<i;e++)r[e]&&(t=o(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="",i=arguments.length;t<i;t++)(r=arguments[t])&&(e=o(r))&&(n&&(n+=" "),n+=e);return n}var a=["div","span","button","input","a","img","p","h2"].reduce((function(e,o){return e[o]=function(e){var o=r.forwardRef((function(o,i){var a=o.asChild,c=void 0!==a&&a,l=o.children,u=n(o,["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,t(t({},u),{ref:i}),l);var s=f[0];return r.cloneElement(s,t(t(t({},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,t(t({},u),{ref:i}),l)}));return o.displayName="Primitive.".concat(e),o}(o),e}),{}),c=function(e){var o=e.role,i=void 0===o?"button":o,c=e.label,l=void 0===c?"":c,u=e.description,f=void 0===u?"":u,s=e.disabled,d=void 0!==s&&s,p=e.children,v=n(e,["role","label","description","disabled","children"]);return l&&(v["aria-label"]=l),f&&(v["aria-description"]=f),d&&(v["aria-disabled"]="true",f||(v["aria-description"]="Disabled Button")),r.createElement(a.button,t({role:i,disabled:d},v),p)},l=function(){for(var r=[],t=0;t<arguments.length;t++)r[t]=arguments[t];return e((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])},u="Button",f=function(o){var a,f,s=o.children,d=o.type,p=void 0===d?"button":d,v=o.customRootClass,y=void 0===v?"":v,b=o.className,m=void 0===b?"":b,h=o.variant,O=void 0===h?"":h,g=o.size,j=void 0===g?"":g,E=o.color,w=void 0===E?"":E,C=n(o,["children","type","customRootClass","className","variant","size","color"]),A=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,u),P=e((function(){return f?Object.fromEntries(Object.entries(f).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="button",f={variant:O,size:j}]),N=function(r){return e((function(){return r?{"data-rad-ui-accent-color":r}:{}}),[r])}(w),x=l(P(),N());return r.createElement(c,t({type:p,className:i(A,m)},x(),C),s)};f.displayName=u;export{f as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use client';import r from"react";var o=function(){return o=Object.assign||function(r){for(var
|
|
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};
|