UNPKG

crystara-sdk

Version:

Official SDK for Crystara NFT Marketplace

26 lines 254 kB
"use strict";var e=require("react/jsx-runtime"),t=require("react"),r=require("framer-motion"),n=require("react-dom"),o=require("canvas-confetti"),i=require("crypto");function s(e){var t=Object.create(null);return e&&Object.keys(e).forEach((function(r){if("default"!==r){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return e[r]}})}})),t.default=e,Object.freeze(t)}var a=s(t),l=s(n),c=function(){return c=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},c.apply(this,arguments)};function u(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]])}return r}function d(e,t,r,n){return new(r||(r=Promise))((function(o,i){function s(e){try{l(n.next(e))}catch(e){i(e)}}function a(e){try{l(n.throw(e))}catch(e){i(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}l((n=n.apply(e,t||[])).next())}))}function f(e,t){var r,n,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(a){return function(l){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;i&&(i=0,a[0]&&(s=0)),s;)try{if(r=1,n&&(o=2&a[0]?n.return:a[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,a[1])).done)return o;switch(n=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,n=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(!(o=s.trys,(o=o.length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){s.label=a[1];break}if(6===a[0]&&s.label<o[1]){s.label=o[1],o=a;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(a);break}o[2]&&s.ops.pop(),s.trys.pop();continue}a=t.call(e,s)}catch(e){a=[6,e],n=0}finally{r=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,l])}}}function h(e,t,r){if(r||2===arguments.length)for(var n,o=0,i=t.length;o<i;o++)!n&&o in t||(n||(n=Array.prototype.slice.call(t,0,o)),n[o]=t[o]);return e.concat(n||Array.prototype.slice.call(t))} /** * @license lucide-react v0.513.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const m=e=>{const t=(e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,((e,t,r)=>r?r.toUpperCase():t.toLowerCase())))(e);return t.charAt(0).toUpperCase()+t.slice(1)},p=(...e)=>e.filter(((e,t,r)=>Boolean(e)&&""!==e.trim()&&r.indexOf(e)===t)).join(" ").trim(),g=e=>{for(const t in e)if(t.startsWith("aria-")||"role"===t||"title"===t)return!0}; /** * @license lucide-react v0.513.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */ var v={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}; /** * @license lucide-react v0.513.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const b=t.forwardRef((({color:e="currentColor",size:r=24,strokeWidth:n=2,absoluteStrokeWidth:o,className:i="",children:s,iconNode:a,...l},c)=>t.createElement("svg",{ref:c,...v,width:r,height:r,stroke:e,strokeWidth:o?24*Number(n)/Number(r):n,className:p("lucide",i),...!s&&!g(l)&&{"aria-hidden":"true"},...l},[...a.map((([e,r])=>t.createElement(e,r))),...Array.isArray(s)?s:[s]]))),y=(e,r)=>{const n=t.forwardRef((({className:n,...o},i)=>{return t.createElement(b,{ref:i,iconNode:r,className:p(`lucide-${s=m(e),s.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}`,`lucide-${e}`,n),...o});var s}));return n.displayName=m(e),n},w=y("badge-check",[["path",{d:"M3.85 8.62a4 4 0 0 1 4.78-4.77 4 4 0 0 1 6.74 0 4 4 0 0 1 4.78 4.78 4 4 0 0 1 0 6.74 4 4 0 0 1-4.77 4.78 4 4 0 0 1-6.75 0 4 4 0 0 1-4.78-4.77 4 4 0 0 1 0-6.76Z",key:"3c2336"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]),x=y("image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]),E=y("shield",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]]),k=y("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]); /** * @license lucide-react v0.513.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */function A(e,t,{checkForDefaultPrevented:r=!0}={}){return function(n){if(e?.(n),!1===r||!n.defaultPrevented)return t?.(n)}}function N(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function z(...e){return t=>{let r=!1;const n=e.map((e=>{const n=N(e,t);return r||"function"!=typeof n||(r=!0),n}));if(r)return()=>{for(let t=0;t<n.length;t++){const r=n[t];"function"==typeof r?r():N(e[t],null)}}}}function U(...e){return a.useCallback(z(...e),e)}function S(t,r=[]){let n=[];const o=()=>{const e=n.map((e=>a.createContext(e)));return function(r){const n=r?.[t]||e;return a.useMemo((()=>({[`__scope${t}`]:{...r,[t]:n}})),[r,n])}};return o.scopeName=t,[function(r,o){const i=a.createContext(o),s=n.length;n=[...n,o];const l=r=>{const{scope:n,children:o,...l}=r,c=n?.[t]?.[s]||i,u=a.useMemo((()=>l),Object.values(l));return e.jsx(c.Provider,{value:u,children:o})};return l.displayName=r+"Provider",[l,function(e,n){const l=n?.[t]?.[s]||i,c=a.useContext(l);if(c)return c;if(void 0!==o)return o;throw new Error(`\`${e}\` must be used within \`${r}\``)}]},_(o,...r)]}function _(...e){const t=e[0];if(1===e.length)return t;const r=()=>{const r=e.map((e=>({useScope:e(),scopeName:e.scopeName})));return function(e){const n=r.reduce(((t,{useScope:r,scopeName:n})=>({...t,...r(e)[`__scope${n}`]})),{});return a.useMemo((()=>({[`__scope${t.scopeName}`]:n})),[n])}};return r.scopeName=t.scopeName,r}function T(t){const r=j(t),n=a.forwardRef(((t,n)=>{const{children:o,...i}=t,s=a.Children.toArray(o),l=s.find(R);if(l){const t=l.props.children,o=s.map((e=>e===l?a.Children.count(t)>1?a.Children.only(null):a.isValidElement(t)?t.props.children:null:e));return e.jsx(r,{...i,ref:n,children:a.isValidElement(t)?a.cloneElement(t,void 0,o):null})}return e.jsx(r,{...i,ref:n,children:o})}));return n.displayName=`${t}.Slot`,n}var C=T("Slot");function j(e){const t=a.forwardRef(((e,t)=>{const{children:r,...n}=e;if(a.isValidElement(r)){const e=function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;if(r)return e.ref;if(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r)return e.props.ref;return e.props.ref||e.ref}(r),o=function(e,t){const r={...t};for(const n in t){const o=e[n],i=t[n];/^on[A-Z]/.test(n)?o&&i?r[n]=(...e)=>{const t=i(...e);return o(...e),t}:o&&(r[n]=o):"style"===n?r[n]={...o,...i}:"className"===n&&(r[n]=[o,i].filter(Boolean).join(" "))}return{...e,...r}}(n,r.props);return r.type!==a.Fragment&&(o.ref=t?z(t,e):e),a.cloneElement(r,o)}return a.Children.count(r)>1?a.Children.only(null):null}));return t.displayName=`${e}.SlotClone`,t}var I=Symbol("radix.slottable");function R(e){return a.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===I}var O=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce(((t,r)=>{const n=T(`Primitive.${r}`),o=a.forwardRef(((t,o)=>{const{asChild:i,...s}=t,a=i?n:r;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),e.jsx(a,{...s,ref:o})}));return o.displayName=`Primitive.${r}`,{...t,[r]:o}}),{});function L(e){const t=a.useRef(e);return a.useEffect((()=>{t.current=e})),a.useMemo((()=>(...e)=>t.current?.(...e)),[])}var M,B="dismissableLayer.update",P="dismissableLayer.pointerDownOutside",D="dismissableLayer.focusOutside",F=a.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),H=a.forwardRef(((t,r)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:o,onPointerDownOutside:i,onFocusOutside:s,onInteractOutside:l,onDismiss:c,...u}=t,d=a.useContext(F),[f,h]=a.useState(null),m=f?.ownerDocument??globalThis?.document,[,p]=a.useState({}),g=U(r,(e=>h(e))),v=Array.from(d.layers),[b]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),y=v.indexOf(b),w=f?v.indexOf(f):-1,x=d.layersWithOutsidePointerEventsDisabled.size>0,E=w>=y,k=function(e,t=globalThis?.document){const r=L(e),n=a.useRef(!1),o=a.useRef((()=>{}));return a.useEffect((()=>{const e=e=>{if(e.target&&!n.current){let n=function(){$(P,r,i,{discrete:!0})};const i={originalEvent:e};"touch"===e.pointerType?(t.removeEventListener("click",o.current),o.current=n,t.addEventListener("click",o.current,{once:!0})):n()}else t.removeEventListener("click",o.current);n.current=!1},i=window.setTimeout((()=>{t.addEventListener("pointerdown",e)}),0);return()=>{window.clearTimeout(i),t.removeEventListener("pointerdown",e),t.removeEventListener("click",o.current)}}),[t,r]),{onPointerDownCapture:()=>n.current=!0}}((e=>{const t=e.target,r=[...d.branches].some((e=>e.contains(t)));E&&!r&&(i?.(e),l?.(e),e.defaultPrevented||c?.())}),m),N=function(e,t=globalThis?.document){const r=L(e),n=a.useRef(!1);return a.useEffect((()=>{const e=e=>{if(e.target&&!n.current){$(D,r,{originalEvent:e},{discrete:!1})}};return t.addEventListener("focusin",e),()=>t.removeEventListener("focusin",e)}),[t,r]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}((e=>{const t=e.target;[...d.branches].some((e=>e.contains(t)))||(s?.(e),l?.(e),e.defaultPrevented||c?.())}),m);return function(e,t=globalThis?.document){const r=L(e);a.useEffect((()=>{const e=e=>{"Escape"===e.key&&r(e)};return t.addEventListener("keydown",e,{capture:!0}),()=>t.removeEventListener("keydown",e,{capture:!0})}),[r,t])}((e=>{w===d.layers.size-1&&(o?.(e),!e.defaultPrevented&&c&&(e.preventDefault(),c()))}),m),a.useEffect((()=>{if(f)return n&&(0===d.layersWithOutsidePointerEventsDisabled.size&&(M=m.body.style.pointerEvents,m.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(f)),d.layers.add(f),W(),()=>{n&&1===d.layersWithOutsidePointerEventsDisabled.size&&(m.body.style.pointerEvents=M)}}),[f,m,n,d]),a.useEffect((()=>()=>{f&&(d.layers.delete(f),d.layersWithOutsidePointerEventsDisabled.delete(f),W())}),[f,d]),a.useEffect((()=>{const e=()=>p({});return document.addEventListener(B,e),()=>document.removeEventListener(B,e)}),[]),e.jsx(O.div,{...u,ref:g,style:{pointerEvents:x?E?"auto":"none":void 0,...t.style},onFocusCapture:A(t.onFocusCapture,N.onFocusCapture),onBlurCapture:A(t.onBlurCapture,N.onBlurCapture),onPointerDownCapture:A(t.onPointerDownCapture,k.onPointerDownCapture)})}));H.displayName="DismissableLayer";function W(){const e=new CustomEvent(B);document.dispatchEvent(e)}function $(e,t,r,{discrete:n}){const o=r.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&o.addEventListener(e,t,{once:!0}),n?function(e,t){e&&l.flushSync((()=>e.dispatchEvent(t)))}(o,i):o.dispatchEvent(i)}a.forwardRef(((t,r)=>{const n=a.useContext(F),o=a.useRef(null),i=U(r,o);return a.useEffect((()=>{const e=o.current;if(e)return n.branches.add(e),()=>{n.branches.delete(e)}}),[n.branches]),e.jsx(O.div,{...t,ref:i})})).displayName="DismissableLayerBranch";var G=globalThis?.document?a.useLayoutEffect:()=>{},K=a[" useId ".trim().toString()]||(()=>{}),V=0;function q(e){const[t,r]=a.useState(K());return G((()=>{e||r((e=>e??String(V++)))}),[e]),e||(t?`radix-${t}`:"")}const Y=["top","right","bottom","left"],X=Math.min,Q=Math.max,Z=Math.round,J=Math.floor,ee=e=>({x:e,y:e}),te={left:"right",right:"left",bottom:"top",top:"bottom"},re={start:"end",end:"start"};function ne(e,t,r){return Q(e,X(t,r))}function oe(e,t){return"function"==typeof e?e(t):e}function ie(e){return e.split("-")[0]}function se(e){return e.split("-")[1]}function ae(e){return"x"===e?"y":"x"}function le(e){return"y"===e?"height":"width"}function ce(e){return["top","bottom"].includes(ie(e))?"y":"x"}function ue(e){return ae(ce(e))}function de(e){return e.replace(/start|end/g,(e=>re[e]))}function fe(e){return e.replace(/left|right|bottom|top/g,(e=>te[e]))}function he(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 me(e){const{x:t,y:r,width:n,height:o}=e;return{width:n,height:o,top:r,left:t,right:t+n,bottom:r+o,x:t,y:r}}function pe(e,t,r){let{reference:n,floating:o}=e;const i=ce(t),s=ue(t),a=le(s),l=ie(t),c="y"===i,u=n.x+n.width/2-o.width/2,d=n.y+n.height/2-o.height/2,f=n[a]/2-o[a]/2;let h;switch(l){case"top":h={x:u,y:n.y-o.height};break;case"bottom":h={x:u,y:n.y+n.height};break;case"right":h={x:n.x+n.width,y:d};break;case"left":h={x:n.x-o.width,y:d};break;default:h={x:n.x,y:n.y}}switch(se(t)){case"start":h[s]-=f*(r&&c?-1:1);break;case"end":h[s]+=f*(r&&c?-1:1)}return h}async function ge(e,t){var r;void 0===t&&(t={});const{x:n,y:o,platform:i,rects:s,elements:a,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:f=!1,padding:h=0}=oe(t,e),m=he(h),p=a[f?"floating"===d?"reference":"floating":d],g=me(await i.getClippingRect({element:null==(r=await(null==i.isElement?void 0:i.isElement(p)))||r?p:p.contextElement||await(null==i.getDocumentElement?void 0:i.getDocumentElement(a.floating)),boundary:c,rootBoundary:u,strategy:l})),v="floating"===d?{x:n,y:o,width:s.floating.width,height:s.floating.height}:s.reference,b=await(null==i.getOffsetParent?void 0:i.getOffsetParent(a.floating)),y=await(null==i.isElement?void 0:i.isElement(b))&&await(null==i.getScale?void 0:i.getScale(b))||{x:1,y:1},w=me(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:v,offsetParent:b,strategy:l}):v);return{top:(g.top-w.top+m.top)/y.y,bottom:(w.bottom-g.bottom+m.bottom)/y.y,left:(g.left-w.left+m.left)/y.x,right:(w.right-g.right+m.right)/y.x}}function ve(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function be(e){return Y.some((t=>e[t]>=0))}function ye(){return"undefined"!=typeof window}function we(e){return ke(e)?(e.nodeName||"").toLowerCase():"#document"}function xe(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function Ee(e){var t;return null==(t=(ke(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function ke(e){return!!ye()&&(e instanceof Node||e instanceof xe(e).Node)}function Ae(e){return!!ye()&&(e instanceof Element||e instanceof xe(e).Element)}function Ne(e){return!!ye()&&(e instanceof HTMLElement||e instanceof xe(e).HTMLElement)}function ze(e){return!(!ye()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof xe(e).ShadowRoot)}function Ue(e){const{overflow:t,overflowX:r,overflowY:n,display:o}=Ie(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&!["inline","contents"].includes(o)}function Se(e){return["table","td","th"].includes(we(e))}function _e(e){return[":popover-open",":modal"].some((t=>{try{return e.matches(t)}catch(e){return!1}}))}function Te(e){const t=Ce(),r=Ae(e)?Ie(e):e;return["transform","translate","scale","rotate","perspective"].some((e=>!!r[e]&&"none"!==r[e]))||!!r.containerType&&"normal"!==r.containerType||!t&&!!r.backdropFilter&&"none"!==r.backdropFilter||!t&&!!r.filter&&"none"!==r.filter||["transform","translate","scale","rotate","perspective","filter"].some((e=>(r.willChange||"").includes(e)))||["paint","layout","strict","content"].some((e=>(r.contain||"").includes(e)))}function Ce(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function je(e){return["html","body","#document"].includes(we(e))}function Ie(e){return xe(e).getComputedStyle(e)}function Re(e){return Ae(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Oe(e){if("html"===we(e))return e;const t=e.assignedSlot||e.parentNode||ze(e)&&e.host||Ee(e);return ze(t)?t.host:t}function Le(e){const t=Oe(e);return je(t)?e.ownerDocument?e.ownerDocument.body:e.body:Ne(t)&&Ue(t)?t:Le(t)}function Me(e,t,r){var n;void 0===t&&(t=[]),void 0===r&&(r=!0);const o=Le(e),i=o===(null==(n=e.ownerDocument)?void 0:n.body),s=xe(o);if(i){const e=Be(s);return t.concat(s,s.visualViewport||[],Ue(o)?o:[],e&&r?Me(e):[])}return t.concat(o,Me(o,[],r))}function Be(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Pe(e){const t=Ie(e);let r=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const o=Ne(e),i=o?e.offsetWidth:r,s=o?e.offsetHeight:n,a=Z(r)!==i||Z(n)!==s;return a&&(r=i,n=s),{width:r,height:n,$:a}}function De(e){return Ae(e)?e:e.contextElement}function Fe(e){const t=De(e);if(!Ne(t))return ee(1);const r=t.getBoundingClientRect(),{width:n,height:o,$:i}=Pe(t);let s=(i?Z(r.width):r.width)/n,a=(i?Z(r.height):r.height)/o;return s&&Number.isFinite(s)||(s=1),a&&Number.isFinite(a)||(a=1),{x:s,y:a}}const He=ee(0);function We(e){const t=xe(e);return Ce()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:He}function $e(e,t,r,n){void 0===t&&(t=!1),void 0===r&&(r=!1);const o=e.getBoundingClientRect(),i=De(e);let s=ee(1);t&&(n?Ae(n)&&(s=Fe(n)):s=Fe(e));const a=function(e,t,r){return void 0===t&&(t=!1),!(!r||t&&r!==xe(e))&&t}(i,r,n)?We(i):ee(0);let l=(o.left+a.x)/s.x,c=(o.top+a.y)/s.y,u=o.width/s.x,d=o.height/s.y;if(i){const e=xe(i),t=n&&Ae(n)?xe(n):n;let r=e,o=Be(r);for(;o&&n&&t!==r;){const e=Fe(o),t=o.getBoundingClientRect(),n=Ie(o),i=t.left+(o.clientLeft+parseFloat(n.paddingLeft))*e.x,s=t.top+(o.clientTop+parseFloat(n.paddingTop))*e.y;l*=e.x,c*=e.y,u*=e.x,d*=e.y,l+=i,c+=s,r=xe(o),o=Be(r)}}return me({width:u,height:d,x:l,y:c})}function Ge(e,t){const r=Re(e).scrollLeft;return t?t.left+r:$e(Ee(e)).left+r}function Ke(e,t,r){void 0===r&&(r=!1);const n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-(r?0:Ge(e,n)),y:n.top+t.scrollTop}}function Ve(e,t,r){let n;if("viewport"===t)n=function(e,t){const r=xe(e),n=Ee(e),o=r.visualViewport;let i=n.clientWidth,s=n.clientHeight,a=0,l=0;if(o){i=o.width,s=o.height;const e=Ce();(!e||e&&"fixed"===t)&&(a=o.offsetLeft,l=o.offsetTop)}return{width:i,height:s,x:a,y:l}}(e,r);else if("document"===t)n=function(e){const t=Ee(e),r=Re(e),n=e.ownerDocument.body,o=Q(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),i=Q(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let s=-r.scrollLeft+Ge(e);const a=-r.scrollTop;return"rtl"===Ie(n).direction&&(s+=Q(t.clientWidth,n.clientWidth)-o),{width:o,height:i,x:s,y:a}}(Ee(e));else if(Ae(t))n=function(e,t){const r=$e(e,!0,"fixed"===t),n=r.top+e.clientTop,o=r.left+e.clientLeft,i=Ne(e)?Fe(e):ee(1);return{width:e.clientWidth*i.x,height:e.clientHeight*i.y,x:o*i.x,y:n*i.y}}(t,r);else{const r=We(e);n={x:t.x-r.x,y:t.y-r.y,width:t.width,height:t.height}}return me(n)}function qe(e,t){const r=Oe(e);return!(r===t||!Ae(r)||je(r))&&("fixed"===Ie(r).position||qe(r,t))}function Ye(e,t,r){const n=Ne(t),o=Ee(t),i="fixed"===r,s=$e(e,!0,i,t);let a={scrollLeft:0,scrollTop:0};const l=ee(0);function c(){l.x=Ge(o)}if(n||!n&&!i)if(("body"!==we(t)||Ue(o))&&(a=Re(t)),n){const e=$e(t,!0,i,t);l.x=e.x+t.clientLeft,l.y=e.y+t.clientTop}else o&&c();i&&!n&&o&&c();const u=!o||n||i?ee(0):Ke(o,a);return{x:s.left+a.scrollLeft-l.x-u.x,y:s.top+a.scrollTop-l.y-u.y,width:s.width,height:s.height}}function Xe(e){return"static"===Ie(e).position}function Qe(e,t){if(!Ne(e)||"fixed"===Ie(e).position)return null;if(t)return t(e);let r=e.offsetParent;return Ee(e)===r&&(r=r.ownerDocument.body),r}function Ze(e,t){const r=xe(e);if(_e(e))return r;if(!Ne(e)){let t=Oe(e);for(;t&&!je(t);){if(Ae(t)&&!Xe(t))return t;t=Oe(t)}return r}let n=Qe(e,t);for(;n&&Se(n)&&Xe(n);)n=Qe(n,t);return n&&je(n)&&Xe(n)&&!Te(n)?r:n||function(e){let t=Oe(e);for(;Ne(t)&&!je(t);){if(Te(t))return t;if(_e(t))return null;t=Oe(t)}return null}(e)||r}const Je={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:r,offsetParent:n,strategy:o}=e;const i="fixed"===o,s=Ee(n),a=!!t&&_e(t.floating);if(n===s||a&&i)return r;let l={scrollLeft:0,scrollTop:0},c=ee(1);const u=ee(0),d=Ne(n);if((d||!d&&!i)&&(("body"!==we(n)||Ue(s))&&(l=Re(n)),Ne(n))){const e=$e(n);c=Fe(n),u.x=e.x+n.clientLeft,u.y=e.y+n.clientTop}const f=!s||d||i?ee(0):Ke(s,l,!0);return{width:r.width*c.x,height:r.height*c.y,x:r.x*c.x-l.scrollLeft*c.x+u.x+f.x,y:r.y*c.y-l.scrollTop*c.y+u.y+f.y}},getDocumentElement:Ee,getClippingRect:function(e){let{element:t,boundary:r,rootBoundary:n,strategy:o}=e;const i=[..."clippingAncestors"===r?_e(t)?[]:function(e,t){const r=t.get(e);if(r)return r;let n=Me(e,[],!1).filter((e=>Ae(e)&&"body"!==we(e))),o=null;const i="fixed"===Ie(e).position;let s=i?Oe(e):e;for(;Ae(s)&&!je(s);){const t=Ie(s),r=Te(s);r||"fixed"!==t.position||(o=null),(i?!r&&!o:!r&&"static"===t.position&&o&&["absolute","fixed"].includes(o.position)||Ue(s)&&!r&&qe(e,s))?n=n.filter((e=>e!==s)):o=t,s=Oe(s)}return t.set(e,n),n}(t,this._c):[].concat(r),n],s=i[0],a=i.reduce(((e,r)=>{const n=Ve(t,r,o);return e.top=Q(n.top,e.top),e.right=X(n.right,e.right),e.bottom=X(n.bottom,e.bottom),e.left=Q(n.left,e.left),e}),Ve(t,s,o));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}},getOffsetParent:Ze,getElementRects:async function(e){const t=this.getOffsetParent||Ze,r=this.getDimensions,n=await r(e.floating);return{reference:Ye(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:r}=Pe(e);return{width:t,height:r}},getScale:Fe,isElement:Ae,isRTL:function(e){return"rtl"===Ie(e).direction}};function et(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function tt(e,t,r,n){void 0===n&&(n={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:s="function"==typeof ResizeObserver,layoutShift:a="function"==typeof IntersectionObserver,animationFrame:l=!1}=n,c=De(e),u=o||i?[...c?Me(c):[],...Me(t)]:[];u.forEach((e=>{o&&e.addEventListener("scroll",r,{passive:!0}),i&&e.addEventListener("resize",r)}));const d=c&&a?function(e,t){let r,n=null;const o=Ee(e);function i(){var e;clearTimeout(r),null==(e=n)||e.disconnect(),n=null}return function s(a,l){void 0===a&&(a=!1),void 0===l&&(l=1),i();const c=e.getBoundingClientRect(),{left:u,top:d,width:f,height:h}=c;if(a||t(),!f||!h)return;const m={rootMargin:-J(d)+"px "+-J(o.clientWidth-(u+f))+"px "+-J(o.clientHeight-(d+h))+"px "+-J(u)+"px",threshold:Q(0,X(1,l))||1};let p=!0;function g(t){const n=t[0].intersectionRatio;if(n!==l){if(!p)return s();n?s(!1,n):r=setTimeout((()=>{s(!1,1e-7)}),1e3)}1!==n||et(c,e.getBoundingClientRect())||s(),p=!1}try{n=new IntersectionObserver(g,{...m,root:o.ownerDocument})}catch(e){n=new IntersectionObserver(g,m)}n.observe(e)}(!0),i}(c,r):null;let f,h=-1,m=null;s&&(m=new ResizeObserver((e=>{let[n]=e;n&&n.target===c&&m&&(m.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame((()=>{var e;null==(e=m)||e.observe(t)}))),r()})),c&&!l&&m.observe(c),m.observe(t));let p=l?$e(e):null;return l&&function t(){const n=$e(e);p&&!et(p,n)&&r();p=n,f=requestAnimationFrame(t)}(),r(),()=>{var e;u.forEach((e=>{o&&e.removeEventListener("scroll",r),i&&e.removeEventListener("resize",r)})),null==d||d(),null==(e=m)||e.disconnect(),m=null,l&&cancelAnimationFrame(f)}}const rt=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var r,n;const{x:o,y:i,placement:s,middlewareData:a}=t,l=await async function(e,t){const{placement:r,platform:n,elements:o}=e,i=await(null==n.isRTL?void 0:n.isRTL(o.floating)),s=ie(r),a=se(r),l="y"===ce(r),c=["left","top"].includes(s)?-1:1,u=i&&l?-1:1,d=oe(t,e);let{mainAxis:f,crossAxis:h,alignmentAxis:m}="number"==typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return a&&"number"==typeof m&&(h="end"===a?-1*m:m),l?{x:h*u,y:f*c}:{x:f*c,y:h*u}}(t,e);return s===(null==(r=a.offset)?void 0:r.placement)&&null!=(n=a.arrow)&&n.alignmentOffset?{}:{x:o+l.x,y:i+l.y,data:{...l,placement:s}}}}},nt=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:r,y:n,placement:o}=t,{mainAxis:i=!0,crossAxis:s=!1,limiter:a={fn:e=>{let{x:t,y:r}=e;return{x:t,y:r}}},...l}=oe(e,t),c={x:r,y:n},u=await ge(t,l),d=ce(ie(o)),f=ae(d);let h=c[f],m=c[d];if(i){const e="y"===f?"bottom":"right";h=ne(h+u["y"===f?"top":"left"],h,h-u[e])}if(s){const e="y"===d?"bottom":"right";m=ne(m+u["y"===d?"top":"left"],m,m-u[e])}const p=a.fn({...t,[f]:h,[d]:m});return{...p,data:{x:p.x-r,y:p.y-n,enabled:{[f]:i,[d]:s}}}}}},ot=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var r,n;const{placement:o,middlewareData:i,rects:s,initialPlacement:a,platform:l,elements:c}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:f,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:p=!0,...g}=oe(e,t);if(null!=(r=i.arrow)&&r.alignmentOffset)return{};const v=ie(o),b=ce(a),y=ie(a)===a,w=await(null==l.isRTL?void 0:l.isRTL(c.floating)),x=f||(y||!p?[fe(a)]:function(e){const t=fe(e);return[de(e),t,de(t)]}(a)),E="none"!==m;!f&&E&&x.push(...function(e,t,r,n){const o=se(e);let i=function(e,t,r){const n=["left","right"],o=["right","left"],i=["top","bottom"],s=["bottom","top"];switch(e){case"top":case"bottom":return r?t?o:n:t?n:o;case"left":case"right":return t?i:s;default:return[]}}(ie(e),"start"===r,n);return o&&(i=i.map((e=>e+"-"+o)),t&&(i=i.concat(i.map(de)))),i}(a,p,m,w));const k=[a,...x],A=await ge(t,g),N=[];let z=(null==(n=i.flip)?void 0:n.overflows)||[];if(u&&N.push(A[v]),d){const e=function(e,t,r){void 0===r&&(r=!1);const n=se(e),o=ue(e),i=le(o);let s="x"===o?n===(r?"end":"start")?"right":"left":"start"===n?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=fe(s)),[s,fe(s)]}(o,s,w);N.push(A[e[0]],A[e[1]])}if(z=[...z,{placement:o,overflows:N}],!N.every((e=>e<=0))){var U,S;const e=((null==(U=i.flip)?void 0:U.index)||0)+1,t=k[e];if(t){if(!("alignment"===d&&b!==ce(t))||z.every((e=>e.overflows[0]>0&&ce(e.placement)===b)))return{data:{index:e,overflows:z},reset:{placement:t}}}let r=null==(S=z.filter((e=>e.overflows[0]<=0)).sort(((e,t)=>e.overflows[1]-t.overflows[1]))[0])?void 0:S.placement;if(!r)switch(h){case"bestFit":{var _;const e=null==(_=z.filter((e=>{if(E){const t=ce(e.placement);return t===b||"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:_[0];e&&(r=e);break}case"initialPlacement":r=a}if(o!==r)return{reset:{placement:r}}}return{}}}},it=function(e){return void 0===e&&(e={}),{name:"size",options:e,async fn(t){var r,n;const{placement:o,rects:i,platform:s,elements:a}=t,{apply:l=()=>{},...c}=oe(e,t),u=await ge(t,c),d=ie(o),f=se(o),h="y"===ce(o),{width:m,height:p}=i.floating;let g,v;"top"===d||"bottom"===d?(g=d,v=f===(await(null==s.isRTL?void 0:s.isRTL(a.floating))?"start":"end")?"left":"right"):(v=d,g="end"===f?"top":"bottom");const b=p-u.top-u.bottom,y=m-u.left-u.right,w=X(p-u[g],b),x=X(m-u[v],y),E=!t.middlewareData.shift;let k=w,A=x;if(null!=(r=t.middlewareData.shift)&&r.enabled.x&&(A=y),null!=(n=t.middlewareData.shift)&&n.enabled.y&&(k=b),E&&!f){const e=Q(u.left,0),t=Q(u.right,0),r=Q(u.top,0),n=Q(u.bottom,0);h?A=m-2*(0!==e||0!==t?e+t:Q(u.left,u.right)):k=p-2*(0!==r||0!==n?r+n:Q(u.top,u.bottom))}await l({...t,availableWidth:A,availableHeight:k});const N=await s.getDimensions(a.floating);return m!==N.width||p!==N.height?{reset:{rects:!0}}:{}}}},st=function(e){return void 0===e&&(e={}),{name:"hide",options:e,async fn(t){const{rects:r}=t,{strategy:n="referenceHidden",...o}=oe(e,t);switch(n){case"referenceHidden":{const e=ve(await ge(t,{...o,elementContext:"reference"}),r.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:be(e)}}}case"escaped":{const e=ve(await ge(t,{...o,altBoundary:!0}),r.floating);return{data:{escapedOffsets:e,escaped:be(e)}}}default:return{}}}}},at=e=>({name:"arrow",options:e,async fn(t){const{x:r,y:n,placement:o,rects:i,platform:s,elements:a,middlewareData:l}=t,{element:c,padding:u=0}=oe(e,t)||{};if(null==c)return{};const d=he(u),f={x:r,y:n},h=ue(o),m=le(h),p=await s.getDimensions(c),g="y"===h,v=g?"top":"left",b=g?"bottom":"right",y=g?"clientHeight":"clientWidth",w=i.reference[m]+i.reference[h]-f[h]-i.floating[m],x=f[h]-i.reference[h],E=await(null==s.getOffsetParent?void 0:s.getOffsetParent(c));let k=E?E[y]:0;k&&await(null==s.isElement?void 0:s.isElement(E))||(k=a.floating[y]||i.floating[m]);const A=w/2-x/2,N=k/2-p[m]/2-1,z=X(d[v],N),U=X(d[b],N),S=z,_=k-p[m]-U,T=k/2-p[m]/2+A,C=ne(S,T,_),j=!l.arrow&&null!=se(o)&&T!==C&&i.reference[m]/2-(T<S?z:U)-p[m]/2<0,I=j?T<S?T-S:T-_:0;return{[h]:f[h]+I,data:{[h]:C,centerOffset:T-C-I,...j&&{alignmentOffset:I}},reset:j}}}),lt=function(e){return void 0===e&&(e={}),{options:e,fn(t){const{x:r,y:n,placement:o,rects:i,middlewareData:s}=t,{offset:a=0,mainAxis:l=!0,crossAxis:c=!0}=oe(e,t),u={x:r,y:n},d=ce(o),f=ae(d);let h=u[f],m=u[d];const p=oe(a,t),g="number"==typeof p?{mainAxis:p,crossAxis:0}:{mainAxis:0,crossAxis:0,...p};if(l){const e="y"===f?"height":"width",t=i.reference[f]-i.floating[e]+g.mainAxis,r=i.reference[f]+i.reference[e]-g.mainAxis;h<t?h=t:h>r&&(h=r)}if(c){var v,b;const e="y"===f?"width":"height",t=["top","left"].includes(ie(o)),r=i.reference[d]-i.floating[e]+(t&&(null==(v=s.offset)?void 0:v[d])||0)+(t?0:g.crossAxis),n=i.reference[d]+i.reference[e]+(t?0:(null==(b=s.offset)?void 0:b[d])||0)-(t?g.crossAxis:0);m<r?m=r:m>n&&(m=n)}return{[f]:h,[d]:m}}}},ct=(e,t,r)=>{const n=new Map,o={platform:Je,...r},i={...o.platform,_c:n};return(async(e,t,r)=>{const{placement:n="bottom",strategy:o="absolute",middleware:i=[],platform:s}=r,a=i.filter(Boolean),l=await(null==s.isRTL?void 0:s.isRTL(t));let c=await s.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:d}=pe(c,n,l),f=n,h={},m=0;for(let r=0;r<a.length;r++){const{name:i,fn:p}=a[r],{x:g,y:v,data:b,reset:y}=await p({x:u,y:d,initialPlacement:n,placement:f,strategy:o,middlewareData:h,rects:c,platform:s,elements:{reference:e,floating:t}});u=null!=g?g:u,d=null!=v?v:d,h={...h,[i]:{...h[i],...b}},y&&m<=50&&(m++,"object"==typeof y&&(y.placement&&(f=y.placement),y.rects&&(c=!0===y.rects?await s.getElementRects({reference:e,floating:t,strategy:o}):y.rects),({x:u,y:d}=pe(c,f,l))),r=-1)}return{x:u,y:d,placement:f,strategy:o,middlewareData:h}})(e,t,{...o,platform:i})};var ut="undefined"!=typeof document?t.useLayoutEffect:function(){};function dt(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 r,n,o;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if(r=e.length,r!==t.length)return!1;for(n=r;0!==n--;)if(!dt(e[n],t[n]))return!1;return!0}if(o=Object.keys(e),r=o.length,r!==Object.keys(t).length)return!1;for(n=r;0!==n--;)if(!{}.hasOwnProperty.call(t,o[n]))return!1;for(n=r;0!==n--;){const r=o[n];if(("_owner"!==r||!e.$$typeof)&&!dt(e[r],t[r]))return!1}return!0}return e!=e&&t!=t}function ft(e){if("undefined"==typeof window)return 1;return(e.ownerDocument.defaultView||window).devicePixelRatio||1}function ht(e,t){const r=ft(e);return Math.round(t*r)/r}function mt(e){const t=a.useRef(e);return ut((()=>{t.current=e})),t}const pt=e=>({name:"arrow",options:e,fn(t){const{element:r,padding:n}="function"==typeof e?e(t):e;return r&&(o=r,{}.hasOwnProperty.call(o,"current"))?null!=r.current?at({element:r.current,padding:n}).fn(t):{}:r?at({element:r,padding:n}).fn(t):{};var o}}),gt=(e,t)=>({...rt(e),options:[e,t]}),vt=(e,t)=>({...nt(e),options:[e,t]}),bt=(e,t)=>({...lt(e),options:[e,t]}),yt=(e,t)=>({...ot(e),options:[e,t]}),wt=(e,t)=>({...it(e),options:[e,t]}),xt=(e,t)=>({...st(e),options:[e,t]}),Et=(e,t)=>({...pt(e),options:[e,t]});var kt=a.forwardRef(((t,r)=>{const{children:n,width:o=10,height:i=5,...s}=t;return e.jsx(O.svg,{...s,ref:r,width:o,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:t.asChild?n:e.jsx("polygon",{points:"0,0 30,0 15,10"})})}));kt.displayName="Arrow";var At=kt;var Nt="Popper",[zt,Ut]=S(Nt),[St,_t]=zt(Nt),Tt=t=>{const{__scopePopper:r,children:n}=t,[o,i]=a.useState(null);return e.jsx(St,{scope:r,anchor:o,onAnchorChange:i,children:n})};Tt.displayName=Nt;var Ct="PopperAnchor",jt=a.forwardRef(((t,r)=>{const{__scopePopper:n,virtualRef:o,...i}=t,s=_t(Ct,n),l=a.useRef(null),c=U(r,l);return a.useEffect((()=>{s.onAnchorChange(o?.current||l.current)})),o?null:e.jsx(O.div,{...i,ref:c})}));jt.displayName=Ct;var It="PopperContent",[Rt,Ot]=zt(It),Lt=a.forwardRef(((t,r)=>{const{__scopePopper:n,side:o="bottom",sideOffset:i=0,align:s="center",alignOffset:c=0,arrowPadding:u=0,avoidCollisions:d=!0,collisionBoundary:f=[],collisionPadding:h=0,sticky:m="partial",hideWhenDetached:p=!1,updatePositionStrategy:g="optimized",onPlaced:v,...b}=t,y=_t(It,n),[w,x]=a.useState(null),E=U(r,(e=>x(e))),[k,A]=a.useState(null),N=function(e){const[t,r]=a.useState(void 0);return G((()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});const t=new ResizeObserver((t=>{if(!Array.isArray(t))return;if(!t.length)return;const n=t[0];let o,i;if("borderBoxSize"in n){const e=n.borderBoxSize,t=Array.isArray(e)?e[0]:e;o=t.inlineSize,i=t.blockSize}else o=e.offsetWidth,i=e.offsetHeight;r({width:o,height:i})}));return t.observe(e,{box:"border-box"}),()=>t.unobserve(e)}r(void 0)}),[e]),t}(k),z=N?.width??0,S=N?.height??0,_=o+("center"!==s?"-"+s:""),T="number"==typeof h?h:{top:0,right:0,bottom:0,left:0,...h},C=Array.isArray(f)?f:[f],j=C.length>0,I={padding:T,boundary:C.filter(Dt),altBoundary:j},{refs:R,floatingStyles:M,placement:B,isPositioned:P,middlewareData:D}=function(e){void 0===e&&(e={});const{placement:t="bottom",strategy:r="absolute",middleware:n=[],platform:o,elements:{reference:i,floating:s}={},transform:c=!0,whileElementsMounted:u,open:d}=e,[f,h]=a.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[m,p]=a.useState(n);dt(m,n)||p(n);const[g,v]=a.useState(null),[b,y]=a.useState(null),w=a.useCallback((e=>{e!==A.current&&(A.current=e,v(e))}),[]),x=a.useCallback((e=>{e!==N.current&&(N.current=e,y(e))}),[]),E=i||g,k=s||b,A=a.useRef(null),N=a.useRef(null),z=a.useRef(f),U=null!=u,S=mt(u),_=mt(o),T=mt(d),C=a.useCallback((()=>{if(!A.current||!N.current)return;const e={placement:t,strategy:r,middleware:m};_.current&&(e.platform=_.current),ct(A.current,N.current,e).then((e=>{const t={...e,isPositioned:!1!==T.current};j.current&&!dt(z.current,t)&&(z.current=t,l.flushSync((()=>{h(t)})))}))}),[m,t,r,_,T]);ut((()=>{!1===d&&z.current.isPositioned&&(z.current.isPositioned=!1,h((e=>({...e,isPositioned:!1}))))}),[d]);const j=a.useRef(!1);ut((()=>(j.current=!0,()=>{j.current=!1})),[]),ut((()=>{if(E&&(A.current=E),k&&(N.current=k),E&&k){if(S.current)return S.current(E,k,C);C()}}),[E,k,C,S,U]);const I=a.useMemo((()=>({reference:A,floating:N,setReference:w,setFloating:x})),[w,x]),R=a.useMemo((()=>({reference:E,floating:k})),[E,k]),O=a.useMemo((()=>{const e={position:r,left:0,top:0};if(!R.floating)return e;const t=ht(R.floating,f.x),n=ht(R.floating,f.y);return c?{...e,transform:"translate("+t+"px, "+n+"px)",...ft(R.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:t,top:n}}),[r,c,R.floating,f.x,f.y]);return a.useMemo((()=>({...f,update:C,refs:I,elements:R,floatingStyles:O})),[f,C,I,R,O])}({strategy:"fixed",placement:_,whileElementsMounted:(...e)=>tt(...e,{animationFrame:"always"===g}),elements:{reference:y.anchor},middleware:[gt({mainAxis:i+S,alignmentAxis:c}),d&&vt({mainAxis:!0,crossAxis:!1,limiter:"partial"===m?bt():void 0,...I}),d&&yt({...I}),wt({...I,apply:({elements:e,rects:t,availableWidth:r,availableHeight:n})=>{const{width:o,height:i}=t.reference,s=e.floating.style;s.setProperty("--radix-popper-available-width",`${r}px`),s.setProperty("--radix-popper-available-height",`${n}px`),s.setProperty("--radix-popper-anchor-width",`${o}px`),s.setProperty("--radix-popper-anchor-height",`${i}px`)}}),k&&Et({element:k,padding:u}),Ft({arrowWidth:z,arrowHeight:S}),p&&xt({strategy:"referenceHidden",...I})]}),[F,H]=Ht(B),W=L(v);G((()=>{P&&W?.()}),[P,W]);const $=D.arrow?.x,K=D.arrow?.y,V=0!==D.arrow?.centerOffset,[q,Y]=a.useState();return G((()=>{w&&Y(window.getComputedStyle(w).zIndex)}),[w]),e.jsx("div",{ref:R.setFloating,"data-radix-popper-content-wrapper":"",style:{...M,transform:P?M.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:q,"--radix-popper-transform-origin":[D.transformOrigin?.x,D.transformOrigin?.y].join(" "),...D.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:e.jsx(Rt,{scope:n,placedSide:F,onArrowChange:A,arrowX:$,arrowY:K,shouldHideArrow:V,children:e.jsx(O.div,{"data-side":F,"data-align":H,...b,ref:E,style:{...b.style,animation:P?void 0:"none"}})})})}));Lt.displayName=It;var Mt="PopperArrow",Bt={top:"bottom",right:"left",bottom:"top",left:"right"},Pt=a.forwardRef((function(t,r){const{__scopePopper:n,...o}=t,i=Ot(Mt,n),s=Bt[i.placedSide];return e.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[s]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:e.jsx(At,{...o,ref:r,style:{...o.style,display:"block"}})})}));function Dt(e){return null!==e}Pt.displayName=Mt;var Ft=e=>({name:"transformOrigin",options:e,fn(t){const{placement:r,rects:n,middlewareData:o}=t,i=0!==o.arrow?.centerOffset,s=i?0:e.arrowWidth,a=i?0:e.arrowHeight,[l,c]=Ht(r),u={start:"0%",center:"50%",end:"100%"}[c],d=(o.arrow?.x??0)+s/2,f=(o.arrow?.y??0)+a/2;let h="",m="";return"bottom"===l?(h=i?u:`${d}px`,m=-a+"px"):"top"===l?(h=i?u:`${d}px`,m=`${n.floating.height+a}px`):"right"===l?(h=-a+"px",m=i?u:`${f}px`):"left"===l&&(h=`${n.floating.width+a}px`,m=i?u:`${f}px`),{data:{x:h,y:m}}}});function Ht(e){const[t,r="center"]=e.split("-");return[t,r]}var Wt=Tt,$t=jt,Gt=Lt,Kt=Pt,Vt=a.forwardRef(((t,r)=>{const{container:o,...i}=t,[s,l]=a.useState(!1);G((()=>l(!0)),[]);const c=o||s&&globalThis?.document?.body;return c?n.createPortal(e.jsx(O.div,{...i,ref:r}),c):null}));Vt.displayName="Portal";var qt=e=>{const{present:t,children:r}=e,n=function(e){const[t,r]=a.useState(),n=a.useRef(null),o=a.useRef(e),i=a.useRef("none"),s=e?"mounted":"unmounted",[l,c]=function(e,t){return a.useReducer(((e,r)=>t[e][r]??e),e)}(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return a.useEffect((()=>{const e=Yt(n.current);i.current="mounted"===l?e:"none"}),[l]),G((()=>{const t=n.current,r=o.current;if(r!==e){const n=i.current,s=Yt(t);if(e)c("MOUNT");else if("none"===s||"none"===t?.display)c("UNMOUNT");else{c(r&&n!==s?"ANIMATION_OUT":"UNMOUNT")}o.current=e}}),[e,c]),G((()=>{if(t){let e;const r=t.ownerDocument.defaultView??window,s=i=>{const s=Yt(n.current).includes(i.animationName);if(i.target===t&&s&&(c("ANIMATION_END"),!o.current)){const n=t.style.animationFillMode;t.style.animationFillMode="forwards",e=r.setTimeout((()=>{"forwards"===t.style.animationFillMode&&(t.style.animationFillMode=n)}))}},a=e=>{e.target===t&&(i.current=Yt(n.current))};return t.addEventListener("animationstart",a),t.addEventListener("animationcancel",s),t.addEventListener("animationend",s),()=>{r.clearTimeout(e),t.removeEventListener("animationstart",a),t.removeEventListener("animationcancel",s),t.removeEventListener("animationend",s)}}c("ANIMATION_END")}),[t,c]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:a.useCallback((e=>{n.current=e?getComputedStyle(e):null,r(e)}),[])}}(t),o="function"==typeof r?r({present:n.isPresent}):a.Children.only(r),i=U(n.ref,function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;if(r)return e.ref;if(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r)return e.props.ref;return e.props.ref||e.ref}(o));return"function"==typeof r||n.isPresent?a.cloneElement(o,{ref:i}):null};function Yt(e){return e?.animationName||"none"}qt.displayName="Presence";var Xt=a[" useInsertionEffect ".trim().toString()]||G;function Qt({prop:e,defaultProp:t,onChange:r=()=>{},caller:n}){const[o,i,s]=function({defaultProp:e,onChange:t}){const[r,n]=a.useState(e),o=a.useRef(r),i=a.useRef(t);return Xt((()=>{i.current=t}),[t]),a.useEffect((()=>{o.current!==r&&(i.current?.(r),o.current=r)}),[r,o]),[r,n,i]}({defaultProp:t,onChange:r}),l=void 0!==e,c=l?e:o;{const t=a.useRef(void 0!==e);a.useEffect((()=>{const e=t.current;if(e!==l){const t=e?"controlled":"uncontrolled",r=l?"controlled":"uncontrolled";console.warn(`${n} is changing from ${t} to ${r}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`)}t.current=l}),[l,n])}const u=a.useCallback((t=>{if(l){const r=function(e){return"function"==typeof e}(t)?t(e):t;r!==e&&s.current?.(r)}else i(t)}),[l,e,i,s]);return[c,u]}var Zt=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),Jt=a.forwardRef(((t,r)=>e.jsx(O.span,{...t,ref:r,style:{...Zt,...t.style}})));Jt.displayName="VisuallyHidden";var er=Jt,[tr,rr]=S("Tooltip",[Ut]),nr=Ut(),or="TooltipProvider",ir=700,sr="tooltip.open",[ar,lr]=tr(or),cr=t=>{const{__scopeTooltip:r,delayDuration:n=ir,skipDelayDuration:o=300,disableHoverableContent:i=!1,children:s}=t,l=a.useRef(!0),c=a.useRef(!1),u=a.useRef(0);return a.useEffect((()=>{const e=u.current;return()=>window.clearTimeout(e)}),[]),e.jsx(ar,{scope:r,isOpenDelayedRef:l,delayDuration:n,onOpen:a.useCallback((()=>{window.clearTimeout(u.current),l.current=!1}),[]),onClose:a.useCallback((()=>{window.clearTimeout(u.current),u.current=window.setTimeout((()=>l.current=!0),o)}),[o]),isPointerInTransitRef:c,onPointerInTransitChange:a.useCallback((e=>{c.current=e}),[]),disableHoverableContent:i,children:s})};cr.displayName=or;var ur="Tooltip",[dr,fr]=tr(ur),hr=t=>{const{__scopeTooltip:r,children:n,open:o,defaultOpen:i,onOpenChange:s,disableHoverableContent:l,delayDuration:c}=t,u=lr(ur,t.__scopeTooltip),d=nr(r),[f,h]=a.useState(null),m=q(),p=a.useRef(0),g=l??u.disableHoverableContent,v=c??u.delayDuration,b=a.useRef(!1),[y,w]=Qt({prop:o,defaultProp:i??!1,onChange:e=>{e?(u.onOpen(),document.dispatchEvent(new CustomEvent(sr))):u.onClose(),s?.(e)},caller:ur}),x=a.useMemo((()=>y?b.current?"delayed-open":"instant-open":"closed"),[y]),E=a.useCallback((()=>{window.clearTimeout(p.current),p.current=0,b.current=!1,w(!0)}),[w]),k=a.useCallback((()=>{window.clearTimeout(p.current),p.current=0,w(!1)}),[w]),A=a.useCallback((()=>{window.clearTimeout(p.current),p.current=window.setTimeout((()=>{b.current=!0,w(!0),p.current=0}),v)}),[v,w]);return a.useEffect((()=>()=>{p.current&&(window.clearTimeout(p.current),p.current=0)}),[]),e.jsx(Wt,{...d,children:e.jsx(dr,{scope:r,contentId:m,open:y,stateAttribute:x,trigger:f,onTriggerChange:h,onTriggerEnter:a.useCallback((()=>{u.isOpenDelayedRef.current?A():E()}),[u.isOpenDelayedRef,A,E]),onTriggerLeave:a.useCallback((()=>{g?k():(window.clearTimeout(p.current),p.current=0)}),[k,g]),onOpen:E,onClose:k,disableHoverableContent:g,children:n})})};hr.displayName=ur;var mr="TooltipTrigger",pr=a.forwardRef(((t,r)=>{const{__scopeTooltip:n,...o}=t,i=fr(mr,n),s=lr(mr,n),l=nr(n),c=U(r,a.useRef(null),i.onTriggerChange),u=a.useRef(!1),d=a.useRef(!1),f=a.useCallback((()=>u.current=!1),[]);return a.useEffect((()=>()=>document.removeEventListener("pointerup",f)),[f]),e.jsx($t,{asChild:!0,...l,children:e.jsx(O.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...o,ref:c,onPointerMove:A(t.onPointerMove,(e=>{"touch"!==e.pointerType&&(d.current||s.isPointerInTransitRef.current||(i.onTriggerEnter(),d.current=!0))})),onPointerLeave:A(t.onPointerLeave,(()=>{i.onTriggerLeave(),d.current=!1})),onPointerDown:A(t.onPointerDown,(()=>{i.open&&i.onClose(),u.current=!0,document.addEventListener("pointerup",f,{once:!0})})),onFocus:A(t.onFocus,(()=>{u.current||i.onOpen()})),onBlur:A(t.onBlur,i.onClose),onClick:A(t.onClick,i.onClose)})})}));pr.displayName=mr;var[gr,vr]=tr("TooltipPortal",{forceMount:void 0}),br="TooltipContent",yr=a.forwardRef(((t,r)=>{const n=vr(br,t.__scopeTooltip),{forceMount:o=n.forceMount,side:i="top",...s}=t,a=fr(br,t.__scopeTooltip);return e.jsx(qt,{present:o||a.open,children:a.disableHoverableContent?e.jsx(Ar,{side:i,...s,ref:r}):e.jsx(wr,{side:i,...s,ref:r})})})),wr=a.forwardRef(((t,r)=>{const n=fr(br,t.__scopeTooltip),o=lr(br,t.__scopeTooltip),i=a.useRef(null),s=U(r,i),[l,c]=a.useState(null),{trigger:u,onClose:d}=n,f=i.current,{onPointerInTransitChange:h}=o,m=a.useCallback((()=>{c(null),h(!1)}),[h]),p=a.useCallback(((e,t)=>{const r=e.currentTarget,n={x:e.clientX,y:e.clientY},o=function(e,t,r=5){const n=[];switch(t){case"top":n.push({x:e.x-r,y:e.y+r},{x:e.x+r,y:e.y+r});break;case"bottom":n.push({x:e.x-r,y:e.y-r},{x:e.x+r,y:e.y-r});break;case"left":n.push({x:e.x+r,y:e.y-r},{x:e.x+r,y:e.y+r});break;case"right":n.push({x:e.x-r,y:e.y-r},{x:e.x-r,y:e.y+r})}return n}(n,function(e,t){const r=Math.abs(t.top-e.y),n=Math.abs(t.bottom-e.y),o=Math.abs(t.right-e.x),i=Math.abs(t.left-e.x);switch(Math.min(r,n,o,i)){case i:return"left";case o:return"right";case r:return"top";case n:return"bottom";default:throw new Error("unreachable")}}(n,r.getBoundingClientRect())),i=function(e){const t=e.slice();return t.sort(((e,t)=>e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:e.y>t.y?1:0)),function(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const n=e[r];for(;t.length>=2;){const e=t[t.length-1],r=t[t.length-2];if(!((e.x-r.x)*(n.y-r.y)>=(e.y-r.y)*(n.x-r.x)))break;t.pop()}t.push(n)}t.pop();const r=[];for(let t=e.length-1;t>=0;t--){const n=e[t];for(;r.length>=2;){const e=r[r.length-1],t=r[r.length-2];if(!((e.x-t.x)*(n.y-t.y)>=(e.y-t.y)*(n.x-t.x)))break;r.pop()}r.push(n)}return r.pop(),1===t.length&&1===r.length&&t[0].x===r[0].x&&t[0].y===r[0].y?t:t.concat(r)}(t)}([...o,...function(e){const{top:t,right:r,bottom:n,left:o}=e;return[{x:o,y:t},{x:r,y:t},{x:r,y:n},{x:o,y:n}]}(t.getBoundingClientRect())]);c(i),h(!0)}),[h]);return a.useEffect((()=>()=>m()),[m]),a.useEffect((()=>{if(u&&f){const e=e=>p(e,f),t=e=>p(e,u);return u.addEventListener("pointerleave",e),f.addEventListener("pointerleave",t),()=>{u.removeEventListener("pointerleave",e),f.removeEventListener("pointerleave",t)}}}),[u,f,p,m]),a.useEffect((()=>{if(l){const e=e=>{const t=e.target,r={x:e.clientX,y:e.clientY},n=u?.contains(t)||f?.contains(t),o=!function(e,t){const{x:r,y:n}=e;let o=!1;for(let e=0,i=t.length-1;e<t.length;i=e++){const s=t[e],a=t[i],l=s.x,c=s.y,u=a.x,d=a.y;c>n!=d>n&&r<(u-l)*(n-c)/(d-c)+l&&(o=!o)}return o}(r,l);n?m():o&&(m(),d())};return document.addEventListener("pointermove",e),()=>document.removeEventListener("pointermove",e)}}),[u,f,l,d,m]),e.jsx(Ar,{...t,ref:s})})),[xr,Er]=tr(ur,{isInside:!1}),kr=function(t){const r=({children:t})=>e.jsx(e.Fragment,{children:t});return r.displayName=`${t}.Slottable`,r.__radixId=I,r}("TooltipContent"),Ar=a.forwardRef(((t,r)=>{const{__scopeTooltip:n,children:o,"aria-label":i,onEscapeKeyDown:s,onPointerDownOutside:l,...c}=t,u=fr(br,n),d=nr(n),{onClose:f}=u;return a.useEffect((()=>(document.addEventListener(sr,f),()=>document.removeEventListener(sr,f))),[f]),a.useEffect((()=>{if(u.trigger){const e=e=>{const t=e.target;t?.contains(u.trigger)&&f()};return window.addEventListener("scroll",e,{capture:!0}),()=>window.removeEventListener("scroll",e,{capture:!0})}}),[u.trigger,f]),e.jsx(H,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:s,onPointerDownOutside:l,onFocusOutside:e=>e.preventDefault(),onDismiss:f,children:e.jsxs(Gt,{"data-state":u.stateAttribute,...d,...c,ref:r,style:{...c.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[e.jsx(kr,{children:o}),e.jsx(xr,{scope:n,isInside:!0,children:e.jsx(er,{id:u.contentId,role:"tooltip",children:i||o})})]})})}));yr.displayName=br;var Nr="TooltipArrow";a.forwardRef(((t,r)=>{const{__scopeTooltip:n,...o}=t,i=nr(n);return Er(Nr,n).isInside?null:e.jsx(Kt,{...i,...o,ref:r})})).displayName=Nr;var zr=cr,Ur=hr,Sr=pr,_r=yr;function Tr(e){var t,r,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(r=Tr(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function Cr(){for(var e,t,r=0,n="",o=arguments.length;r<o;r++)(e=arguments[r])&&(t=Tr(e))&&(n&&(n+=" "),n+=t);return n}const jr=e=>{const t=Lr(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:e=>{const r=e.split("-");return""===r[0]&&1!==r.length&&r.shift(),Ir(r,t)||Or(e)}