@epic-web/workshop-app 5.22.3 → 5.22.4
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/build/client/assets/{_-BDcQ_M2J.js → _-CHaVBRQw.js} +2 -2
- package/build/client/assets/{_-BDcQ_M2J.js.map → _-CHaVBRQw.js.map} +1 -1
- package/build/client/assets/{_exerciseNumber-CG2AFTtQ.js → _exerciseNumber-3uq8PYSd.js} +2 -2
- package/build/client/assets/{_exerciseNumber-CG2AFTtQ.js.map → _exerciseNumber-3uq8PYSd.js.map} +1 -1
- package/build/client/assets/{_exerciseNumber_._stepNumber-COWC332q.js → _exerciseNumber_._stepNumber-D5VDI7vZ.js} +2 -2
- package/build/client/assets/{_exerciseNumber_._stepNumber-COWC332q.js.map → _exerciseNumber_._stepNumber-D5VDI7vZ.js.map} +1 -1
- package/build/client/assets/{_exerciseNumber_.finished-BgGBYU74.js → _exerciseNumber_.finished-3Iv9ikNq.js} +2 -2
- package/build/client/assets/{_exerciseNumber_.finished-BgGBYU74.js.map → _exerciseNumber_.finished-3Iv9ikNq.js.map} +1 -1
- package/build/client/assets/_layout-Brb3LPqZ.js +5 -0
- package/build/client/assets/_layout-Brb3LPqZ.js.map +1 -0
- package/build/client/assets/_layout-CkabS-6c.js +9 -0
- package/build/client/assets/_layout-CkabS-6c.js.map +1 -0
- package/build/client/assets/accordion-BjQ-5Z44.js +2 -0
- package/build/client/assets/accordion-BjQ-5Z44.js.map +1 -0
- package/build/client/assets/{account-BwQvf4AS.js → account-CN4B8rm4.js} +2 -2
- package/build/client/assets/{account-BwQvf4AS.js.map → account-CN4B8rm4.js.map} +1 -1
- package/build/client/assets/app-lUkT_xku.js +2 -0
- package/build/client/assets/{app-XHqxOZfy.js.map → app-lUkT_xku.js.map} +1 -1
- package/build/client/assets/{button-DVPKzWkn.js → button-ChOzbirS.js} +2 -2
- package/build/client/assets/{button-DVPKzWkn.js.map → button-ChOzbirS.js.map} +1 -1
- package/build/client/assets/{diff-C7Zh3uuA.js → diff-CTHVtVGQ.js} +2 -2
- package/build/client/assets/{diff-C7Zh3uuA.js.map → diff-CTHVtVGQ.js.map} +1 -1
- package/build/client/assets/diff-CVrsnWqw.js +2 -0
- package/build/client/assets/{diff-DVOUmaq6.js.map → diff-CVrsnWqw.js.map} +1 -1
- package/build/client/assets/discord-Cl4hiMqz.js +2 -0
- package/build/client/assets/discord-Cl4hiMqz.js.map +1 -0
- package/build/client/assets/{discord-CoBo5eVK.js → discord-gROK6Zn6.js} +2 -2
- package/build/client/assets/{discord-CoBo5eVK.js.map → discord-gROK6Zn6.js.map} +1 -1
- package/build/client/assets/{epic-video-DRZssA4U.js → epic-video-BQtjG_Y0.js} +2 -2
- package/build/client/assets/{epic-video-DRZssA4U.js.map → epic-video-BQtjG_Y0.js.map} +1 -1
- package/build/client/assets/{error-boundary-De7jJlR5.js → error-boundary-CAu3AmhN.js} +2 -2
- package/build/client/assets/{error-boundary-De7jJlR5.js.map → error-boundary-CAu3AmhN.js.map} +1 -1
- package/build/client/assets/{finished-6JNE1a1E.js → finished-9PhQncNF.js} +2 -2
- package/build/client/assets/{finished-6JNE1a1E.js.map → finished-9PhQncNF.js.map} +1 -1
- package/build/client/assets/index-BncqUVfr.js +39 -0
- package/build/client/assets/index-BncqUVfr.js.map +1 -0
- package/build/client/assets/{index-BZWIdOoA.js → index-CMYl882D.js} +2 -2
- package/build/client/assets/{index-BZWIdOoA.js.map → index-CMYl882D.js.map} +1 -1
- package/build/client/assets/index-CSGHuBiw.js +5 -0
- package/build/client/assets/index-CSGHuBiw.js.map +1 -0
- package/build/client/assets/{index-Cnxrq9Ny.js → index-CYZfnGWa.js} +2 -2
- package/build/client/assets/{index-Cnxrq9Ny.js.map → index-CYZfnGWa.js.map} +1 -1
- package/build/client/assets/index-mZJ8sz9i.js +2 -0
- package/build/client/assets/{index-M647UyZv.js.map → index-mZJ8sz9i.js.map} +1 -1
- package/build/client/assets/{index-CyFsiCNp.js → index-qo6WmPUa.js} +2 -2
- package/build/client/assets/{index-CyFsiCNp.js.map → index-qo6WmPUa.js.map} +1 -1
- package/build/client/assets/{loading-ClL22bF9.js → loading-CPEkK5hO.js} +2 -2
- package/build/client/assets/{loading-ClL22bF9.js.map → loading-CPEkK5hO.js.map} +1 -1
- package/build/client/assets/{login-C3I5NCrj.js → login-C9JmYc0v.js} +2 -2
- package/build/client/assets/{login-C3I5NCrj.js.map → login-C9JmYc0v.js.map} +1 -1
- package/build/client/assets/{manifest-6899d50c.js → manifest-4acdd3e2.js} +1 -1
- package/build/client/assets/{mdx-Z4bEoKXn.js → mdx-CnaWQCDw.js} +2 -2
- package/build/client/assets/{mdx-Z4bEoKXn.js.map → mdx-CnaWQCDw.js.map} +1 -1
- package/build/client/assets/{misc-BK2EiKtY.js → misc-CQmANiHr.js} +2 -2
- package/build/client/assets/{misc-BK2EiKtY.js.map → misc-CQmANiHr.js.map} +1 -1
- package/build/client/assets/{nav-chevrons-DVD_0i2a.js → nav-chevrons-DCuva9-Q.js} +2 -2
- package/build/client/assets/{nav-chevrons-DVD_0i2a.js.map → nav-chevrons-DCuva9-Q.js.map} +1 -1
- package/build/client/assets/{onboarding-DjyKxkKx.js → onboarding-DzfDHJg_.js} +2 -2
- package/build/client/assets/{onboarding-DjyKxkKx.js.map → onboarding-DzfDHJg_.js.map} +1 -1
- package/build/client/assets/{online-CHlOuJG-.js → online-BsTX44az.js} +2 -2
- package/build/client/assets/{online-CHlOuJG-.js.map → online-BsTX44az.js.map} +1 -1
- package/build/client/assets/{preferences-BmwlU5EC.js → preferences-BYBJKp8k.js} +2 -2
- package/build/client/assets/{preferences-BmwlU5EC.js.map → preferences-BYBJKp8k.js.map} +1 -1
- package/build/client/assets/{presence-CPOTHCHm.js → presence-D5UF-NOM.js} +2 -2
- package/build/client/assets/{presence-CPOTHCHm.js.map → presence-D5UF-NOM.js.map} +1 -1
- package/build/client/assets/{preview-B2BxDDhi.js → preview-DaTpH6lj.js} +2 -2
- package/build/client/assets/{preview-B2BxDDhi.js.map → preview-DaTpH6lj.js.map} +1 -1
- package/build/client/assets/{product-BkDgAOLQ.js → product-BKhLQKd7.js} +2 -2
- package/build/client/assets/{product-BkDgAOLQ.js.map → product-BKhLQKd7.js.map} +1 -1
- package/build/client/assets/{progress-CnHFlUmF.js → progress-DwE8EkAa.js} +2 -2
- package/build/client/assets/{progress-CnHFlUmF.js.map → progress-DwE8EkAa.js.map} +1 -1
- package/build/client/assets/{progress-bar-Q9l2dtTg.js → progress-bar-ZCHf2Y4W.js} +2 -2
- package/build/client/assets/{progress-bar-Q9l2dtTg.js.map → progress-bar-ZCHf2Y4W.js.map} +1 -1
- package/build/client/assets/{revalidation-ws-CLolY6Iu.js → revalidation-ws-BoJZTvOQ.js} +2 -2
- package/build/client/assets/{revalidation-ws-CLolY6Iu.js.map → revalidation-ws-BoJZTvOQ.js.map} +1 -1
- package/build/client/assets/{root-BIqtHKak.js → root-4MvCzrFd.js} +2 -2
- package/build/client/assets/{root-BIqtHKak.js.map → root-4MvCzrFd.js.map} +1 -1
- package/build/client/assets/{set-playground-ZcPraYj5.js → set-playground-IUJCGVu2.js} +2 -2
- package/build/client/assets/{set-playground-ZcPraYj5.js.map → set-playground-IUJCGVu2.js.map} +1 -1
- package/build/client/assets/test-B8jDo0X4.js +2 -0
- package/build/client/assets/{test-Bt9AuCey.js.map → test-B8jDo0X4.js.map} +1 -1
- package/build/client/assets/{tests-CmjMQrMj.js → tests-y-atkhWB.js} +2 -2
- package/build/client/assets/{tests-CmjMQrMj.js.map → tests-y-atkhWB.js.map} +1 -1
- package/build/client/assets/tooltip-Cd0yJoQb.js +2 -0
- package/build/client/assets/tooltip-Cd0yJoQb.js.map +1 -0
- package/build/server/index.js +1 -1
- package/package.json +3 -3
- package/build/client/assets/_layout-DKC1JUTc.js +0 -2
- package/build/client/assets/_layout-DKC1JUTc.js.map +0 -1
- package/build/client/assets/_layout-DuDUPWax.js +0 -6
- package/build/client/assets/_layout-DuDUPWax.js.map +0 -1
- package/build/client/assets/accordion-BPyhq471.js +0 -2
- package/build/client/assets/accordion-BPyhq471.js.map +0 -1
- package/build/client/assets/app-XHqxOZfy.js +0 -2
- package/build/client/assets/diff-DVOUmaq6.js +0 -2
- package/build/client/assets/discord-CFZUT74L.js +0 -2
- package/build/client/assets/discord-CFZUT74L.js.map +0 -1
- package/build/client/assets/index-6Hu4Lmzn.js +0 -2
- package/build/client/assets/index-6Hu4Lmzn.js.map +0 -1
- package/build/client/assets/index-BE3KRz8n.js +0 -42
- package/build/client/assets/index-BE3KRz8n.js.map +0 -1
- package/build/client/assets/index-M647UyZv.js +0 -2
- package/build/client/assets/test-Bt9AuCey.js +0 -2
- package/build/client/assets/tooltip-leWCE50J.js +0 -2
- package/build/client/assets/tooltip-leWCE50J.js.map +0 -1
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{r as l,j as t,e as xe}from"./index-CGzylDPY.js";import{h as pe,u as G,n as ve,P,f as N,e as K,d as he,g as ge,S as je}from"./tooltip-leWCE50J.js";import{f as be,u as B}from"./index-6Hu4Lmzn.js";import{u as $,I as E,c as we}from"./misc-BK2EiKtY.js";import{D as Ne}from"./diff-C7Zh3uuA.js";import{G as ye}from"./error-boundary-De7jJlR5.js";import{L as Ce}from"./loading-ClL22bF9.js";import{D as Te,u as Pe}from"./discord-CoBo5eVK.js";import{u as Ee}from"./online-CHlOuJG-.js";import{u as V,A as Ie,L as H,e as Se}from"./components-DrvY4pal.js";import{J as De}from"./index-CB8bjE90.js";import{S as Re}from"./set-playground-ZcPraYj5.js";import{P as Fe,a as _e}from"./tests-CmjMQrMj.js";import{P as F}from"./preview-B2BxDDhi.js";import"./index-BE3KRz8n.js";import"./accordion-BPyhq471.js";import"./mdx-Z4bEoKXn.js";import"./epic-video-DRZssA4U.js";import"./index-BZWIdOoA.js";import"./pe-DXT2FOp1.js";import"./user-C0j04V55.js";import"./workshop-config-oL_FWDKq.js";import"./progress-bar-Q9l2dtTg.js";import"./revalidation-ws-CLolY6Iu.js";import"./use-event-source-AZJtQsFX.js";import"./button-DVPKzWkn.js";function Ae(e,s=[]){let r=[];function n(c,o){const u=l.createContext(o),x=r.length;r=[...r,o];function f(d){const{scope:p,children:w,...m}=d,g=(p==null?void 0:p[e][x])||u,i=l.useMemo(()=>m,Object.values(m));return t.jsx(g.Provider,{value:i,children:w})}function v(d,p){const w=(p==null?void 0:p[e][x])||u,m=l.useContext(w);if(m)return m;if(o!==void 0)return o;throw new Error(`\`${d}\` must be used within \`${c}\``)}return f.displayName=c+"Provider",[f,v]}const a=()=>{const c=r.map(o=>l.createContext(o));return function(u){const x=(u==null?void 0:u[e])||c;return l.useMemo(()=>({[`__scope${e}`]:{...u,[e]:x}}),[u,x])}};return a.scopeName=e,[n,ke(a,...s)]}function ke(...e){const s=e[0];if(e.length===1)return s;const r=()=>{const n=e.map(a=>({useScope:a(),scopeName:a.scopeName}));return function(c){const o=n.reduce((u,{useScope:x,scopeName:f})=>{const d=x(c)[`__scope${f}`];return{...u,...d}},{});return l.useMemo(()=>({[`__scope${s.scopeName}`]:o}),[o])}};return r.scopeName=s.scopeName,r}var R="rovingFocusGroup.onEntryFocus",Le={bubbles:!1,cancelable:!0},I="RovingFocusGroup",[_,z,Me]=be(I),[Ue,Y]=Ae(I,[Me]),[Oe,Ge]=Ue(I),W=l.forwardRef((e,s)=>t.jsx(_.Provider,{scope:e.__scopeRovingFocusGroup,children:t.jsx(_.Slot,{scope:e.__scopeRovingFocusGroup,children:t.jsx(Ke,{...e,ref:s})})}));W.displayName=I;var Ke=l.forwardRef((e,s)=>{const{__scopeRovingFocusGroup:r,orientation:n,loop:a=!1,dir:c,currentTabStopId:o,defaultCurrentTabStopId:u,onCurrentTabStopIdChange:x,onEntryFocus:f,preventScrollOnEntryFocus:v=!1,...d}=e,p=l.useRef(null),w=pe(s,p),m=B(c),[g=null,i]=G({prop:o,defaultProp:u,onChange:x}),[h,b]=l.useState(!1),C=ve(f),le=z(r),S=l.useRef(!1),[ce,M]=l.useState(0);return l.useEffect(()=>{const j=p.current;if(j)return j.addEventListener(R,C),()=>j.removeEventListener(R,C)},[C]),t.jsx(Oe,{scope:r,orientation:n,dir:m,loop:a,currentTabStopId:g,onItemFocus:l.useCallback(j=>i(j),[i]),onItemShiftTab:l.useCallback(()=>b(!0),[]),onFocusableItemAdd:l.useCallback(()=>M(j=>j+1),[]),onFocusableItemRemove:l.useCallback(()=>M(j=>j-1),[]),children:t.jsx(P.div,{tabIndex:h||ce===0?-1:0,"data-orientation":n,...d,ref:w,style:{outline:"none",...e.style},onMouseDown:N(e.onMouseDown,()=>{S.current=!0}),onFocus:N(e.onFocus,j=>{const ue=!S.current;if(j.target===j.currentTarget&&ue&&!h){const U=new CustomEvent(R,Le);if(j.currentTarget.dispatchEvent(U),!U.defaultPrevented){const D=le().filter(y=>y.focusable),de=D.find(y=>y.active),fe=D.find(y=>y.id===g),me=[de,fe,...D].filter(Boolean).map(y=>y.ref.current);Q(me,v)}}S.current=!1}),onBlur:N(e.onBlur,()=>b(!1))})})}),J="RovingFocusGroupItem",q=l.forwardRef((e,s)=>{const{__scopeRovingFocusGroup:r,focusable:n=!0,active:a=!1,tabStopId:c,...o}=e,u=K(),x=c||u,f=Ge(J,r),v=f.currentTabStopId===x,d=z(r),{onFocusableItemAdd:p,onFocusableItemRemove:w}=f;return l.useEffect(()=>{if(n)return p(),()=>w()},[n,p,w]),t.jsx(_.ItemSlot,{scope:r,id:x,focusable:n,active:a,children:t.jsx(P.span,{tabIndex:v?0:-1,"data-orientation":f.orientation,...o,ref:s,onMouseDown:N(e.onMouseDown,m=>{n?f.onItemFocus(x):m.preventDefault()}),onFocus:N(e.onFocus,()=>f.onItemFocus(x)),onKeyDown:N(e.onKeyDown,m=>{if(m.key==="Tab"&&m.shiftKey){f.onItemShiftTab();return}if(m.target!==m.currentTarget)return;const g=Ve(m,f.orientation,f.dir);if(g!==void 0){if(m.metaKey||m.ctrlKey||m.altKey||m.shiftKey)return;m.preventDefault();let h=d().filter(b=>b.focusable).map(b=>b.ref.current);if(g==="last")h.reverse();else if(g==="prev"||g==="next"){g==="prev"&&h.reverse();const b=h.indexOf(m.currentTarget);h=f.loop?He(h,b+1):h.slice(b+1)}setTimeout(()=>Q(h))}})})})});q.displayName=J;var Be={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function $e(e,s){return s!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function Ve(e,s,r){const n=$e(e.key,r);if(!(s==="vertical"&&["ArrowLeft","ArrowRight"].includes(n))&&!(s==="horizontal"&&["ArrowUp","ArrowDown"].includes(n)))return Be[n]}function Q(e,s=!1){const r=document.activeElement;for(const n of e)if(n===r||(n.focus({preventScroll:s}),document.activeElement!==r))return}function He(e,s){return e.map((r,n)=>e[(s+n)%e.length])}var ze=W,Ye=q,k="Tabs",[We,Ft]=he(k,[Y]),X=Y(),[Je,L]=We(k),Z=l.forwardRef((e,s)=>{const{__scopeTabs:r,value:n,onValueChange:a,defaultValue:c,orientation:o="horizontal",dir:u,activationMode:x="automatic",...f}=e,v=B(u),[d,p]=G({prop:n,onChange:a,defaultProp:c});return t.jsx(Je,{scope:r,baseId:K(),value:d,onValueChange:p,orientation:o,dir:v,activationMode:x,children:t.jsx(P.div,{dir:v,"data-orientation":o,...f,ref:s})})});Z.displayName=k;var ee="TabsList",te=l.forwardRef((e,s)=>{const{__scopeTabs:r,loop:n=!0,...a}=e,c=L(ee,r),o=X(r);return t.jsx(ze,{asChild:!0,...o,orientation:c.orientation,dir:c.dir,loop:n,children:t.jsx(P.div,{role:"tablist","aria-orientation":c.orientation,...a,ref:s})})});te.displayName=ee;var re="TabsTrigger",se=l.forwardRef((e,s)=>{const{__scopeTabs:r,value:n,disabled:a=!1,...c}=e,o=L(re,r),u=X(r),x=ae(o.baseId,n),f=ie(o.baseId,n),v=n===o.value;return t.jsx(Ye,{asChild:!0,...u,focusable:!a,active:v,children:t.jsx(P.button,{type:"button",role:"tab","aria-selected":v,"aria-controls":f,"data-state":v?"active":"inactive","data-disabled":a?"":void 0,disabled:a,id:x,...c,ref:s,onMouseDown:N(e.onMouseDown,d=>{!a&&d.button===0&&d.ctrlKey===!1?o.onValueChange(n):d.preventDefault()}),onKeyDown:N(e.onKeyDown,d=>{[" ","Enter"].includes(d.key)&&o.onValueChange(n)}),onFocus:N(e.onFocus,()=>{const d=o.activationMode!=="manual";!v&&!a&&d&&o.onValueChange(n)})})})});se.displayName=re;var ne="TabsContent",oe=l.forwardRef((e,s)=>{const{__scopeTabs:r,value:n,forceMount:a,children:c,...o}=e,u=L(ne,r),x=ae(u.baseId,n),f=ie(u.baseId,n),v=n===u.value,d=l.useRef(v);return l.useEffect(()=>{const p=requestAnimationFrame(()=>d.current=!1);return()=>cancelAnimationFrame(p)},[]),t.jsx(ge,{present:a||v,children:({present:p})=>t.jsx(P.div,{"data-state":v?"active":"inactive","data-orientation":u.orientation,role:"tabpanel","aria-labelledby":x,hidden:!p,id:f,tabIndex:0,...o,ref:s,style:{...e.style,animationDuration:d.current?"0s":void 0},children:p&&c})})});oe.displayName=ne;function ae(e,s){return`${e}-trigger-${s}`}function ie(e,s){return`${e}-content-${s}`}var qe=Z,Qe=te,Xe=se,T=oe;function Ze(){return t.jsxs("div",{className:"flex h-full w-full flex-col gap-4 pt-4",children:[t.jsx("div",{className:"text-center",children:t.jsx(Te,{})}),t.jsx("div",{className:"flex-1 overflow-y-scroll bg-accent pb-4 scrollbar-thin scrollbar-thumb-scrollbar",children:t.jsx(et,{})})]})}function et(){const e=V(),s=Pe(),r=$();return Ee()?t.jsxs("div",{className:"flex h-full flex-col items-center justify-between",children:[t.jsx(l.Suspense,{fallback:t.jsx("div",{className:"flex h-full w-full flex-col items-center justify-center",children:t.jsx(Ce,{children:"Loading Discord Posts"})}),children:t.jsx(Ie,{resolve:e.discordPostsPromise,errorElement:t.jsx("div",{className:"text-red-500",children:"There was a problem loading the discord posts"}),children:a=>t.jsx("ul",{className:"flex w-full flex-col gap-4 p-3 xl:p-12",children:a.map(c=>t.jsx("li",{className:"rounded-xl border bg-background transition-all duration-200 focus-within:-translate-y-1 focus-within:shadow-lg hover:-translate-y-1 hover:shadow-lg",children:t.jsx(tt,{thread:c})},c.id))})})}),t.jsx("div",{children:t.jsxs(H,{to:r&&!s.includes("oauth")?s.replace(/^https/,"discord"):s,target:s.includes("oauth")?void 0:"_blank",rel:"noreferrer noopener",onClick:r?a=>{a.preventDefault(),window.open(a.currentTarget.href,"_blank","noreferrer noopener")}:void 0,className:"flex items-center gap-2 p-2 text-xl hover:underline",children:["Create Post ",t.jsx(E,{name:"ExternalLink"})]})})]}):t.jsx("div",{className:"flex h-full flex-col items-center justify-between",children:t.jsx("div",{className:"text-foreground-destructive flex h-full w-full flex-col items-center justify-center",children:t.jsx(E,{name:"WifiNoConnection",size:"xl",children:"Unable to load discord messages when offline"})})})}function tt({thread:e}){const s=e.reactions.filter(r=>r.count);return t.jsx("div",{children:t.jsxs("div",{className:"flex flex-col gap-2 p-4",children:[t.jsxs("div",{className:"flex gap-4",children:[t.jsxs("div",{className:"flex flex-col gap-1",children:[e.tags.length?t.jsx("div",{className:"flex gap-2",children:e.tags.map(r=>t.jsxs("div",{className:"flex items-center justify-center gap-1 rounded-full bg-accent px-2 py-1 text-sm",children:[t.jsx("span",{className:"h-3 w-3 leading-3",children:t.jsx(O,{name:r.emojiName,url:r.emojiUrl})}),t.jsx("span",{children:r.name})]},r.name))}):null,t.jsx("strong",{className:"text-xl font-bold",children:e.name}),t.jsxs("div",{className:"flex items-start gap-1",children:[t.jsxs("div",{className:"flex items-center gap-1",children:[e.authorAvatarUrl?t.jsx("img",{src:e.authorAvatarUrl,alt:"",className:"h-6 w-6 rounded-full"}):null,t.jsxs("span",{children:[t.jsx("span",{className:"font-bold",style:e.authorHexAccentColor?{color:e.authorHexAccentColor}:{},children:e.authorDisplayName}),":"," "]})]}),t.jsx("span",{className:"flex-1 overflow-ellipsis text-muted-foreground",children:e.messagePreview})]})]}),e.previewImageUrl?t.jsx("img",{src:e.previewImageUrl,alt:"",className:"h-28 w-28 rounded-lg object-cover"}):null]}),t.jsxs("div",{className:"flex justify-between",children:[t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx("span",{children:s.length?t.jsx("ul",{className:"flex items-center gap-2",children:s.map((r,n)=>t.jsxs("li",{className:"flex items-center gap-1 rounded-md border border-blue-600 bg-blue-500/20 px-[5px] py-[0.5px] text-sm",children:[t.jsx("span",{className:"h-3 w-3 leading-3",children:t.jsx(O,{name:r.emojiName,url:r.emojiUrl})}),t.jsx("span",{children:r.count})]},n))}):null}),t.jsxs("span",{className:"flex items-center gap-1",children:[t.jsxs("span",{className:"inline-flex items-center gap-1",children:[t.jsx(E,{name:"Chat"})," ",e.messageCount]}),` · ${e.lastUpdatedDisplay}`]})]}),t.jsxs("span",{className:"flex items-center gap-4",children:[t.jsx("a",{href:e.link.replace(/^https/,"discord"),children:t.jsx(E,{name:"Discord"})}),t.jsx("a",{href:e.link,target:"_blank",rel:"noreferrer noopener",children:t.jsx(E,{name:"ExternalLink"})})]})]})]})})}function O({name:e,url:s}){return s?t.jsx("img",{src:s,alt:e,className:"h-full w-full"}):e||null}function rt({appInfo:e,inBrowserBrowserRef:s,problemAppName:r,allApps:n,isUpToDate:a}){return t.jsx(Fe,{playgroundAppName:e==null?void 0:e.appName,problemAppName:r,allApps:n,isUpToDate:a,children:(e==null?void 0:e.dev.type)==="none"?t.jsxs("div",{children:[t.jsx("div",{className:"text-foreground-secondary flex h-full items-center justify-center text-2xl",children:"Non-UI playground"}),t.jsx("div",{children:t.jsxs("div",{className:"text-foreground-secondary flex flex-wrap gap-1 text-center",children:["Navigate to"," ",t.jsx(je,{content:e.fullPath,children:t.jsx("span",{className:"underline",onClick:()=>{navigator.clipboard.writeText(e.fullPath),De.success("Copied playground path to clipboard")},children:"the playground directory"})})," ","in your editor and terminal to work on this exercise!"]})})]}):e?t.jsx(F,{id:e.appName,appInfo:e,inBrowserBrowserRef:s}):t.jsxs("div",{className:"flex flex-col justify-center gap-2",children:[t.jsx("p",{children:"Please set the playground first"}),r?t.jsx(Re,{appName:r}):null]})})}const A=["playground","problem","solution","tests","diff","chat"],st=e=>!!(e&&A.includes(e));function nt(e,s,r){const n=new URLSearchParams(e);return r===null?n.delete(s):n.set(s,r),n}function _t(){var v,d,p,w,m,g;const e=V(),[s]=Se(),r=s.get("preview"),n=l.useRef(null),a=$(),c=xe();function o(i){var h,b,C;if(i==="tests")return ENV.EPICSHOP_DEPLOYED||!e.playground||e.playground.test.type==="none";if(i==="problem"||i==="solution"){if(((h=e[i])==null?void 0:h.dev.type)==="none")return!0;if(ENV.EPICSHOP_DEPLOYED)return((b=e[i])==null?void 0:b.dev.type)!=="browser"&&!((C=e[i])!=null&&C.stackBlitzUrl)}return!!(i==="playground"&&ENV.EPICSHOP_DEPLOYED)}const u=st(r)?r:A.find(i=>!o(i)),x=`/diff?${new URLSearchParams({app1:((v=e.problem)==null?void 0:v.name)??"",app2:((d=e.solution)==null?void 0:d.name)??""})}`;function f(i){i.altKey&&!i.ctrlKey&&!i.shiftKey&&!i.metaKey&&(i.preventDefault(),c(x))}return t.jsxs(qe,{className:"relative flex flex-col overflow-y-auto sm:col-span-1 sm:row-span-1",value:u,children:[t.jsx(Qe,{className:"h-14 min-h-14 overflow-x-hidden border-b scrollbar-thin scrollbar-thumb-scrollbar",children:A.map(i=>{const h=o(i);return t.jsx(Xe,{value:i,hidden:h,asChild:!0,children:t.jsx(H,{id:`${i}-tab`,className:we("clip-path-button relative h-full px-6 py-4 font-mono text-sm uppercase outline-none radix-state-active:z-10 radix-state-active:bg-foreground radix-state-active:text-background radix-state-active:hover:bg-foreground/80 radix-state-active:hover:text-background/80 radix-state-inactive:hover:bg-foreground/20 radix-state-inactive:hover:text-foreground/80 focus:bg-foreground/80 focus:text-background/80",h?"hidden":"inline-block"),preventScrollReset:!0,prefetch:"intent",onClick:f,to:i==="diff"&&a?x:`?${nt(s,"preview",i==="playground"?null:i)}`,children:i})},i)})}),t.jsxs("div",{className:"relative z-10 flex min-h-96 flex-grow flex-col overflow-y-auto",children:[t.jsx(T,{value:"playground",className:"flex w-full flex-grow items-center justify-center self-start radix-state-inactive:hidden",forceMount:!0,children:t.jsx(rt,{appInfo:e.playground,problemAppName:(p=e.problem)==null?void 0:p.name,inBrowserBrowserRef:n,allApps:e.allApps,isUpToDate:((w=e.playground)==null?void 0:w.isUpToDate)??!1})}),t.jsx(T,{value:"problem",className:"flex w-full flex-grow items-center justify-center self-start radix-state-inactive:hidden",forceMount:!0,children:t.jsx(F,{appInfo:e.problem,inBrowserBrowserRef:n})}),t.jsx(T,{value:"solution",className:"flex w-full flex-grow items-center justify-center self-start radix-state-inactive:hidden",forceMount:!0,children:t.jsx(F,{appInfo:e.solution,inBrowserBrowserRef:n})}),t.jsx(T,{value:"tests",className:"flex w-full flex-grow items-start justify-center self-start overflow-hidden radix-state-inactive:hidden",children:t.jsx(_e,{appInfo:e.playground,problemAppName:(m=e.problem)==null?void 0:m.name,allApps:e.allApps,isUpToDate:((g=e.playground)==null?void 0:g.isUpToDate)??!1})}),t.jsx(T,{value:"diff",className:"flex h-full w-full flex-grow items-start justify-center self-start radix-state-inactive:hidden",children:t.jsx(Ne,{diff:e.diff,allApps:e.allApps})}),t.jsx(T,{value:"chat",className:"flex h-full w-full flex-grow items-start justify-center self-start radix-state-inactive:hidden",children:t.jsx(Ze,{})})]})]})}function At(){return t.jsx(ye,{statusHandlers:{404:()=>t.jsx("p",{children:"Sorry, we couldn't find an app here."})}})}export{At as ErrorBoundary,_t as default};
|
|
2
|
-
//# sourceMappingURL=index-M647UyZv.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{j as t}from"./index-CGzylDPY.js";import{T as r}from"./tests-CmjMQrMj.js";import{u as p}from"./components-DrvY4pal.js";import"./epic-video-DRZssA4U.js";import"./index-BZWIdOoA.js";import"./misc-BK2EiKtY.js";import"./tooltip-leWCE50J.js";import"./pe-DXT2FOp1.js";import"./online-CHlOuJG-.js";import"./loading-ClL22bF9.js";import"./user-C0j04V55.js";import"./workshop-config-oL_FWDKq.js";import"./accordion-BPyhq471.js";import"./index-6Hu4Lmzn.js";import"./index-BE3KRz8n.js";import"./use-event-source-AZJtQsFX.js";import"./set-playground-ZcPraYj5.js";import"./progress-bar-Q9l2dtTg.js";function A(){const{appInfo:o}=p();return t.jsx(r,{playgroundAppInfo:o},o.name)}export{A as default};
|
|
2
|
-
//# sourceMappingURL=test-Bt9AuCey.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{r as f,j as P,B as nn}from"./index-CGzylDPY.js";import{r as ut}from"./components-DrvY4pal.js";import{a as on}from"./misc-BK2EiKtY.js";function U(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e==null||e(r),n===!1||!r.defaultPrevented)return t==null?void 0:t(r)}}function rn(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function ft(...e){return t=>e.forEach(n=>rn(n,t))}function Q(...e){return f.useCallback(ft(...e),e)}function pr(e,t){const n=f.createContext(t),o=i=>{const{children:s,...c}=i,a=f.useMemo(()=>c,Object.values(c));return P.jsx(n.Provider,{value:a,children:s})};o.displayName=e+"Provider";function r(i){const s=f.useContext(n);if(s)return s;if(t!==void 0)return t;throw new Error(`\`${i}\` must be used within \`${e}\``)}return[o,r]}function sn(e,t=[]){let n=[];function o(i,s){const c=f.createContext(s),a=n.length;n=[...n,s];const l=d=>{var v;const{scope:m,children:p,...h}=d,g=((v=m==null?void 0:m[e])==null?void 0:v[a])||c,x=f.useMemo(()=>h,Object.values(h));return P.jsx(g.Provider,{value:x,children:p})};l.displayName=i+"Provider";function u(d,m){var g;const p=((g=m==null?void 0:m[e])==null?void 0:g[a])||c,h=f.useContext(p);if(h)return h;if(s!==void 0)return s;throw new Error(`\`${d}\` must be used within \`${i}\``)}return[l,u]}const r=()=>{const i=n.map(s=>f.createContext(s));return function(c){const a=(c==null?void 0:c[e])||i;return f.useMemo(()=>({[`__scope${e}`]:{...c,[e]:a}}),[c,a])}};return r.scopeName=e,[o,cn(r,...t)]}function cn(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const o=e.map(r=>({useScope:r(),scopeName:r.scopeName}));return function(i){const s=o.reduce((c,{useScope:a,scopeName:l})=>{const d=a(i)[`__scope${l}`];return{...c,...d}},{});return f.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}var dt=f.forwardRef((e,t)=>{const{children:n,...o}=e,r=f.Children.toArray(n),i=r.find(an);if(i){const s=i.props.children,c=r.map(a=>a===i?f.Children.count(s)>1?f.Children.only(null):f.isValidElement(s)?s.props.children:null:a);return P.jsx(De,{...o,ref:t,children:f.isValidElement(s)?f.cloneElement(s,void 0,c):null})}return P.jsx(De,{...o,ref:t,children:n})});dt.displayName="Slot";var De=f.forwardRef((e,t)=>{const{children:n,...o}=e;if(f.isValidElement(n)){const r=un(n);return f.cloneElement(n,{...ln(o,n.props),ref:t?ft(t,r):r})}return f.Children.count(n)>1?f.Children.only(null):null});De.displayName="SlotClone";var pt=({children:e})=>P.jsx(P.Fragment,{children:e});function an(e){return f.isValidElement(e)&&e.type===pt}function ln(e,t){const n={...t};for(const o in t){const r=e[o],i=t[o];/^on[A-Z]/.test(o)?r&&i?n[o]=(...c)=>{i(...c),r(...c)}:r&&(n[o]=r):o==="style"?n[o]={...r,...i}:o==="className"&&(n[o]=[r,i].filter(Boolean).join(" "))}return{...e,...n}}function un(e){var o,r;let t=(o=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(r=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var fn=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],ee=fn.reduce((e,t)=>{const n=f.forwardRef((o,r)=>{const{asChild:i,...s}=o,c=i?dt:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),P.jsx(c,{...s,ref:r})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function dn(e,t){e&&ut.flushSync(()=>e.dispatchEvent(t))}function ie(e){const t=f.useRef(e);return f.useEffect(()=>{t.current=e}),f.useMemo(()=>(...n)=>{var o;return(o=t.current)==null?void 0:o.call(t,...n)},[])}function pn(e,t=globalThis==null?void 0:globalThis.document){const n=ie(e);f.useEffect(()=>{const o=r=>{r.key==="Escape"&&n(r)};return t.addEventListener("keydown",o,{capture:!0}),()=>t.removeEventListener("keydown",o,{capture:!0})},[n,t])}var mn="DismissableLayer",Ne="dismissableLayer.update",hn="dismissableLayer.pointerDownOutside",gn="dismissableLayer.focusOutside",et,mt=f.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),ht=f.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:o,onPointerDownOutside:r,onFocusOutside:i,onInteractOutside:s,onDismiss:c,...a}=e,l=f.useContext(mt),[u,d]=f.useState(null),m=(u==null?void 0:u.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,p]=f.useState({}),h=Q(t,E=>d(E)),g=Array.from(l.layers),[x]=[...l.layersWithOutsidePointerEventsDisabled].slice(-1),v=g.indexOf(x),y=u?g.indexOf(u):-1,C=l.layersWithOutsidePointerEventsDisabled.size>0,w=y>=v,b=yn(E=>{const O=E.target,M=[...l.branches].some(T=>T.contains(O));!w||M||(r==null||r(E),s==null||s(E),E.defaultPrevented||c==null||c())},m),A=wn(E=>{const O=E.target;[...l.branches].some(T=>T.contains(O))||(i==null||i(E),s==null||s(E),E.defaultPrevented||c==null||c())},m);return pn(E=>{y===l.layers.size-1&&(o==null||o(E),!E.defaultPrevented&&c&&(E.preventDefault(),c()))},m),f.useEffect(()=>{if(u)return n&&(l.layersWithOutsidePointerEventsDisabled.size===0&&(et=m.body.style.pointerEvents,m.body.style.pointerEvents="none"),l.layersWithOutsidePointerEventsDisabled.add(u)),l.layers.add(u),tt(),()=>{n&&l.layersWithOutsidePointerEventsDisabled.size===1&&(m.body.style.pointerEvents=et)}},[u,m,n,l]),f.useEffect(()=>()=>{u&&(l.layers.delete(u),l.layersWithOutsidePointerEventsDisabled.delete(u),tt())},[u,l]),f.useEffect(()=>{const E=()=>p({});return document.addEventListener(Ne,E),()=>document.removeEventListener(Ne,E)},[]),P.jsx(ee.div,{...a,ref:h,style:{pointerEvents:C?w?"auto":"none":void 0,...e.style},onFocusCapture:U(e.onFocusCapture,A.onFocusCapture),onBlurCapture:U(e.onBlurCapture,A.onBlurCapture),onPointerDownCapture:U(e.onPointerDownCapture,b.onPointerDownCapture)})});ht.displayName=mn;var xn="DismissableLayerBranch",vn=f.forwardRef((e,t)=>{const n=f.useContext(mt),o=f.useRef(null),r=Q(t,o);return f.useEffect(()=>{const i=o.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),P.jsx(ee.div,{...e,ref:r})});vn.displayName=xn;function yn(e,t=globalThis==null?void 0:globalThis.document){const n=ie(e),o=f.useRef(!1),r=f.useRef(()=>{});return f.useEffect(()=>{const i=c=>{if(c.target&&!o.current){let a=function(){gt(hn,n,l,{discrete:!0})};const l={originalEvent:c};c.pointerType==="touch"?(t.removeEventListener("click",r.current),r.current=a,t.addEventListener("click",r.current,{once:!0})):a()}else t.removeEventListener("click",r.current);o.current=!1},s=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(s),t.removeEventListener("pointerdown",i),t.removeEventListener("click",r.current)}},[t,n]),{onPointerDownCapture:()=>o.current=!0}}function wn(e,t=globalThis==null?void 0:globalThis.document){const n=ie(e),o=f.useRef(!1);return f.useEffect(()=>{const r=i=>{i.target&&!o.current&>(gn,n,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",r),()=>t.removeEventListener("focusin",r)},[t,n]),{onFocusCapture:()=>o.current=!0,onBlurCapture:()=>o.current=!1}}function tt(){const e=new CustomEvent(Ne);document.dispatchEvent(e)}function gt(e,t,n,{discrete:o}){const r=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&r.addEventListener(e,t,{once:!0}),o?dn(r,i):r.dispatchEvent(i)}var ne=globalThis!=null&&globalThis.document?f.useLayoutEffect:()=>{},bn=nn.useId||(()=>{}),Cn=0;function En(e){const[t,n]=f.useState(bn());return ne(()=>{e||n(o=>o??String(Cn++))},[e]),e||(t?`radix-${t}`:"")}const Pn=["top","right","bottom","left"],G=Math.min,j=Math.max,xe=Math.round,me=Math.floor,q=e=>({x:e,y:e}),An={left:"right",right:"left",bottom:"top",top:"bottom"},Rn={start:"end",end:"start"};function Le(e,t,n){return j(e,G(t,n))}function Y(e,t){return typeof e=="function"?e(t):e}function X(e){return e.split("-")[0]}function se(e){return e.split("-")[1]}function Fe(e){return e==="x"?"y":"x"}function We(e){return e==="y"?"height":"width"}function K(e){return["top","bottom"].includes(X(e))?"y":"x"}function Ie(e){return Fe(K(e))}function On(e,t,n){n===void 0&&(n=!1);const o=se(e),r=Ie(e),i=We(r);let s=r==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=ve(s)),[s,ve(s)]}function Tn(e){const t=ve(e);return[Me(e),t,Me(t)]}function Me(e){return e.replace(/start|end/g,t=>Rn[t])}function Sn(e,t,n){const o=["left","right"],r=["right","left"],i=["top","bottom"],s=["bottom","top"];switch(e){case"top":case"bottom":return n?t?r:o:t?o:r;case"left":case"right":return t?i:s;default:return[]}}function Dn(e,t,n,o){const r=se(e);let i=Sn(X(e),n==="start",o);return r&&(i=i.map(s=>s+"-"+r),t&&(i=i.concat(i.map(Me)))),i}function ve(e){return e.replace(/left|right|bottom|top/g,t=>An[t])}function Nn(e){return{top:0,right:0,bottom:0,left:0,...e}}function xt(e){return typeof e!="number"?Nn(e):{top:e,right:e,bottom:e,left:e}}function ye(e){const{x:t,y:n,width:o,height:r}=e;return{width:o,height:r,top:n,left:t,right:t+o,bottom:n+r,x:t,y:n}}function nt(e,t,n){let{reference:o,floating:r}=e;const i=K(t),s=Ie(t),c=We(s),a=X(t),l=i==="y",u=o.x+o.width/2-r.width/2,d=o.y+o.height/2-r.height/2,m=o[c]/2-r[c]/2;let p;switch(a){case"top":p={x:u,y:o.y-r.height};break;case"bottom":p={x:u,y:o.y+o.height};break;case"right":p={x:o.x+o.width,y:d};break;case"left":p={x:o.x-r.width,y:d};break;default:p={x:o.x,y:o.y}}switch(se(t)){case"start":p[s]-=m*(n&&l?-1:1);break;case"end":p[s]+=m*(n&&l?-1:1);break}return p}const Ln=async(e,t,n)=>{const{placement:o="bottom",strategy:r="absolute",middleware:i=[],platform:s}=n,c=i.filter(Boolean),a=await(s.isRTL==null?void 0:s.isRTL(t));let l=await s.getElementRects({reference:e,floating:t,strategy:r}),{x:u,y:d}=nt(l,o,a),m=o,p={},h=0;for(let g=0;g<c.length;g++){const{name:x,fn:v}=c[g],{x:y,y:C,data:w,reset:b}=await v({x:u,y:d,initialPlacement:o,placement:m,strategy:r,middlewareData:p,rects:l,platform:s,elements:{reference:e,floating:t}});u=y??u,d=C??d,p={...p,[x]:{...p[x],...w}},b&&h<=50&&(h++,typeof b=="object"&&(b.placement&&(m=b.placement),b.rects&&(l=b.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:r}):b.rects),{x:u,y:d}=nt(l,m,a)),g=-1)}return{x:u,y:d,placement:m,strategy:r,middlewareData:p}};async function le(e,t){var n;t===void 0&&(t={});const{x:o,y:r,platform:i,rects:s,elements:c,strategy:a}=e,{boundary:l="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:m=!1,padding:p=0}=Y(t,e),h=xt(p),x=c[m?d==="floating"?"reference":"floating":d],v=ye(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(x)))==null||n?x:x.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(c.floating)),boundary:l,rootBoundary:u,strategy:a})),y=d==="floating"?{x:o,y:r,width:s.floating.width,height:s.floating.height}:s.reference,C=await(i.getOffsetParent==null?void 0:i.getOffsetParent(c.floating)),w=await(i.isElement==null?void 0:i.isElement(C))?await(i.getScale==null?void 0:i.getScale(C))||{x:1,y:1}:{x:1,y:1},b=ye(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:y,offsetParent:C,strategy:a}):y);return{top:(v.top-b.top+h.top)/w.y,bottom:(b.bottom-v.bottom+h.bottom)/w.y,left:(v.left-b.left+h.left)/w.x,right:(b.right-v.right+h.right)/w.x}}const Mn=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:o,placement:r,rects:i,platform:s,elements:c,middlewareData:a}=t,{element:l,padding:u=0}=Y(e,t)||{};if(l==null)return{};const d=xt(u),m={x:n,y:o},p=Ie(r),h=We(p),g=await s.getDimensions(l),x=p==="y",v=x?"top":"left",y=x?"bottom":"right",C=x?"clientHeight":"clientWidth",w=i.reference[h]+i.reference[p]-m[p]-i.floating[h],b=m[p]-i.reference[p],A=await(s.getOffsetParent==null?void 0:s.getOffsetParent(l));let E=A?A[C]:0;(!E||!await(s.isElement==null?void 0:s.isElement(A)))&&(E=c.floating[C]||i.floating[h]);const O=w/2-b/2,M=E/2-g[h]/2-1,T=G(d[v],M),k=G(d[y],M),$=T,D=E-g[h]-k,S=E/2-g[h]/2+O,W=Le($,S,D),N=!a.arrow&&se(r)!=null&&S!==W&&i.reference[h]/2-(S<$?T:k)-g[h]/2<0,L=N?S<$?S-$:S-D:0;return{[p]:m[p]+L,data:{[p]:W,centerOffset:S-W-L,...N&&{alignmentOffset:L}},reset:N}}}),_n=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,o;const{placement:r,middlewareData:i,rects:s,initialPlacement:c,platform:a,elements:l}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:m,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:h="none",flipAlignment:g=!0,...x}=Y(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const v=X(r),y=K(c),C=X(c)===c,w=await(a.isRTL==null?void 0:a.isRTL(l.floating)),b=m||(C||!g?[ve(c)]:Tn(c)),A=h!=="none";!m&&A&&b.push(...Dn(c,g,h,w));const E=[c,...b],O=await le(t,x),M=[];let T=((o=i.flip)==null?void 0:o.overflows)||[];if(u&&M.push(O[v]),d){const S=On(r,s,w);M.push(O[S[0]],O[S[1]])}if(T=[...T,{placement:r,overflows:M}],!M.every(S=>S<=0)){var k,$;const S=(((k=i.flip)==null?void 0:k.index)||0)+1,W=E[S];if(W)return{data:{index:S,overflows:T},reset:{placement:W}};let N=($=T.filter(L=>L.overflows[0]<=0).sort((L,R)=>L.overflows[1]-R.overflows[1])[0])==null?void 0:$.placement;if(!N)switch(p){case"bestFit":{var D;const L=(D=T.filter(R=>{if(A){const _=K(R.placement);return _===y||_==="y"}return!0}).map(R=>[R.placement,R.overflows.filter(_=>_>0).reduce((_,H)=>_+H,0)]).sort((R,_)=>R[1]-_[1])[0])==null?void 0:D[0];L&&(N=L);break}case"initialPlacement":N=c;break}if(r!==N)return{reset:{placement:N}}}return{}}}};function ot(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function rt(e){return Pn.some(t=>e[t]>=0)}const kn=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:o="referenceHidden",...r}=Y(e,t);switch(o){case"referenceHidden":{const i=await le(t,{...r,elementContext:"reference"}),s=ot(i,n.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:rt(s)}}}case"escaped":{const i=await le(t,{...r,altBoundary:!0}),s=ot(i,n.floating);return{data:{escapedOffsets:s,escaped:rt(s)}}}default:return{}}}}};async function $n(e,t){const{placement:n,platform:o,elements:r}=e,i=await(o.isRTL==null?void 0:o.isRTL(r.floating)),s=X(n),c=se(n),a=K(n)==="y",l=["left","top"].includes(s)?-1:1,u=i&&a?-1:1,d=Y(t,e);let{mainAxis:m,crossAxis:p,alignmentAxis:h}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return c&&typeof h=="number"&&(p=c==="end"?h*-1:h),a?{x:p*u,y:m*l}:{x:m*l,y:p*u}}const jn=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,o;const{x:r,y:i,placement:s,middlewareData:c}=t,a=await $n(t,e);return s===((n=c.offset)==null?void 0:n.placement)&&(o=c.arrow)!=null&&o.alignmentOffset?{}:{x:r+a.x,y:i+a.y,data:{...a,placement:s}}}}},Fn=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:o,placement:r}=t,{mainAxis:i=!0,crossAxis:s=!1,limiter:c={fn:x=>{let{x:v,y}=x;return{x:v,y}}},...a}=Y(e,t),l={x:n,y:o},u=await le(t,a),d=K(X(r)),m=Fe(d);let p=l[m],h=l[d];if(i){const x=m==="y"?"top":"left",v=m==="y"?"bottom":"right",y=p+u[x],C=p-u[v];p=Le(y,p,C)}if(s){const x=d==="y"?"top":"left",v=d==="y"?"bottom":"right",y=h+u[x],C=h-u[v];h=Le(y,h,C)}const g=c.fn({...t,[m]:p,[d]:h});return{...g,data:{x:g.x-n,y:g.y-o,enabled:{[m]:i,[d]:s}}}}}},Wn=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:o,placement:r,rects:i,middlewareData:s}=t,{offset:c=0,mainAxis:a=!0,crossAxis:l=!0}=Y(e,t),u={x:n,y:o},d=K(r),m=Fe(d);let p=u[m],h=u[d];const g=Y(c,t),x=typeof g=="number"?{mainAxis:g,crossAxis:0}:{mainAxis:0,crossAxis:0,...g};if(a){const C=m==="y"?"height":"width",w=i.reference[m]-i.floating[C]+x.mainAxis,b=i.reference[m]+i.reference[C]-x.mainAxis;p<w?p=w:p>b&&(p=b)}if(l){var v,y;const C=m==="y"?"width":"height",w=["top","left"].includes(X(r)),b=i.reference[d]-i.floating[C]+(w&&((v=s.offset)==null?void 0:v[d])||0)+(w?0:x.crossAxis),A=i.reference[d]+i.reference[C]+(w?0:((y=s.offset)==null?void 0:y[d])||0)-(w?x.crossAxis:0);h<b?h=b:h>A&&(h=A)}return{[m]:p,[d]:h}}}},In=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,o;const{placement:r,rects:i,platform:s,elements:c}=t,{apply:a=()=>{},...l}=Y(e,t),u=await le(t,l),d=X(r),m=se(r),p=K(r)==="y",{width:h,height:g}=i.floating;let x,v;d==="top"||d==="bottom"?(x=d,v=m===(await(s.isRTL==null?void 0:s.isRTL(c.floating))?"start":"end")?"left":"right"):(v=d,x=m==="end"?"top":"bottom");const y=g-u.top-u.bottom,C=h-u.left-u.right,w=G(g-u[x],y),b=G(h-u[v],C),A=!t.middlewareData.shift;let E=w,O=b;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(O=C),(o=t.middlewareData.shift)!=null&&o.enabled.y&&(E=y),A&&!m){const T=j(u.left,0),k=j(u.right,0),$=j(u.top,0),D=j(u.bottom,0);p?O=h-2*(T!==0||k!==0?T+k:j(u.left,u.right)):E=g-2*($!==0||D!==0?$+D:j(u.top,u.bottom))}await a({...t,availableWidth:O,availableHeight:E});const M=await s.getDimensions(c.floating);return h!==M.width||g!==M.height?{reset:{rects:!0}}:{}}}};function be(){return typeof window<"u"}function ce(e){return vt(e)?(e.nodeName||"").toLowerCase():"#document"}function F(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function V(e){var t;return(t=(vt(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function vt(e){return be()?e instanceof Node||e instanceof F(e).Node:!1}function I(e){return be()?e instanceof Element||e instanceof F(e).Element:!1}function z(e){return be()?e instanceof HTMLElement||e instanceof F(e).HTMLElement:!1}function it(e){return!be()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof F(e).ShadowRoot}function fe(e){const{overflow:t,overflowX:n,overflowY:o,display:r}=B(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+n)&&!["inline","contents"].includes(r)}function Bn(e){return["table","td","th"].includes(ce(e))}function Ce(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function Be(e){const t=He(),n=I(e)?B(e):e;return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","perspective","filter"].some(o=>(n.willChange||"").includes(o))||["paint","layout","strict","content"].some(o=>(n.contain||"").includes(o))}function Hn(e){let t=Z(e);for(;z(t)&&!oe(t);){if(Be(t))return t;if(Ce(t))return null;t=Z(t)}return null}function He(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function oe(e){return["html","body","#document"].includes(ce(e))}function B(e){return F(e).getComputedStyle(e)}function Ee(e){return I(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Z(e){if(ce(e)==="html")return e;const t=e.assignedSlot||e.parentNode||it(e)&&e.host||V(e);return it(t)?t.host:t}function yt(e){const t=Z(e);return oe(t)?e.ownerDocument?e.ownerDocument.body:e.body:z(t)&&fe(t)?t:yt(t)}function ue(e,t,n){var o;t===void 0&&(t=[]),n===void 0&&(n=!0);const r=yt(e),i=r===((o=e.ownerDocument)==null?void 0:o.body),s=F(r);if(i){const c=_e(s);return t.concat(s,s.visualViewport||[],fe(r)?r:[],c&&n?ue(c):[])}return t.concat(r,ue(r,[],n))}function _e(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function wt(e){const t=B(e);let n=parseFloat(t.width)||0,o=parseFloat(t.height)||0;const r=z(e),i=r?e.offsetWidth:n,s=r?e.offsetHeight:o,c=xe(n)!==i||xe(o)!==s;return c&&(n=i,o=s),{width:n,height:o,$:c}}function ze(e){return I(e)?e:e.contextElement}function te(e){const t=ze(e);if(!z(t))return q(1);const n=t.getBoundingClientRect(),{width:o,height:r,$:i}=wt(t);let s=(i?xe(n.width):n.width)/o,c=(i?xe(n.height):n.height)/r;return(!s||!Number.isFinite(s))&&(s=1),(!c||!Number.isFinite(c))&&(c=1),{x:s,y:c}}const zn=q(0);function bt(e){const t=F(e);return!He()||!t.visualViewport?zn:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Vn(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==F(e)?!1:t}function J(e,t,n,o){t===void 0&&(t=!1),n===void 0&&(n=!1);const r=e.getBoundingClientRect(),i=ze(e);let s=q(1);t&&(o?I(o)&&(s=te(o)):s=te(e));const c=Vn(i,n,o)?bt(i):q(0);let a=(r.left+c.x)/s.x,l=(r.top+c.y)/s.y,u=r.width/s.x,d=r.height/s.y;if(i){const m=F(i),p=o&&I(o)?F(o):o;let h=m,g=_e(h);for(;g&&o&&p!==h;){const x=te(g),v=g.getBoundingClientRect(),y=B(g),C=v.left+(g.clientLeft+parseFloat(y.paddingLeft))*x.x,w=v.top+(g.clientTop+parseFloat(y.paddingTop))*x.y;a*=x.x,l*=x.y,u*=x.x,d*=x.y,a+=C,l+=w,h=F(g),g=_e(h)}}return ye({width:u,height:d,x:a,y:l})}function Un(e){let{elements:t,rect:n,offsetParent:o,strategy:r}=e;const i=r==="fixed",s=V(o),c=t?Ce(t.floating):!1;if(o===s||c&&i)return n;let a={scrollLeft:0,scrollTop:0},l=q(1);const u=q(0),d=z(o);if((d||!d&&!i)&&((ce(o)!=="body"||fe(s))&&(a=Ee(o)),z(o))){const m=J(o);l=te(o),u.x=m.x+o.clientLeft,u.y=m.y+o.clientTop}return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-a.scrollLeft*l.x+u.x,y:n.y*l.y-a.scrollTop*l.y+u.y}}function Yn(e){return Array.from(e.getClientRects())}function ke(e,t){const n=Ee(e).scrollLeft;return t?t.left+n:J(V(e)).left+n}function Xn(e){const t=V(e),n=Ee(e),o=e.ownerDocument.body,r=j(t.scrollWidth,t.clientWidth,o.scrollWidth,o.clientWidth),i=j(t.scrollHeight,t.clientHeight,o.scrollHeight,o.clientHeight);let s=-n.scrollLeft+ke(e);const c=-n.scrollTop;return B(o).direction==="rtl"&&(s+=j(t.clientWidth,o.clientWidth)-r),{width:r,height:i,x:s,y:c}}function Gn(e,t){const n=F(e),o=V(e),r=n.visualViewport;let i=o.clientWidth,s=o.clientHeight,c=0,a=0;if(r){i=r.width,s=r.height;const l=He();(!l||l&&t==="fixed")&&(c=r.offsetLeft,a=r.offsetTop)}return{width:i,height:s,x:c,y:a}}function qn(e,t){const n=J(e,!0,t==="fixed"),o=n.top+e.clientTop,r=n.left+e.clientLeft,i=z(e)?te(e):q(1),s=e.clientWidth*i.x,c=e.clientHeight*i.y,a=r*i.x,l=o*i.y;return{width:s,height:c,x:a,y:l}}function st(e,t,n){let o;if(t==="viewport")o=Gn(e,n);else if(t==="document")o=Xn(V(e));else if(I(t))o=qn(t,n);else{const r=bt(e);o={...t,x:t.x-r.x,y:t.y-r.y}}return ye(o)}function Ct(e,t){const n=Z(e);return n===t||!I(n)||oe(n)?!1:B(n).position==="fixed"||Ct(n,t)}function Kn(e,t){const n=t.get(e);if(n)return n;let o=ue(e,[],!1).filter(c=>I(c)&&ce(c)!=="body"),r=null;const i=B(e).position==="fixed";let s=i?Z(e):e;for(;I(s)&&!oe(s);){const c=B(s),a=Be(s);!a&&c.position==="fixed"&&(r=null),(i?!a&&!r:!a&&c.position==="static"&&!!r&&["absolute","fixed"].includes(r.position)||fe(s)&&!a&&Ct(e,s))?o=o.filter(u=>u!==s):r=c,s=Z(s)}return t.set(e,o),o}function Zn(e){let{element:t,boundary:n,rootBoundary:o,strategy:r}=e;const s=[...n==="clippingAncestors"?Ce(t)?[]:Kn(t,this._c):[].concat(n),o],c=s[0],a=s.reduce((l,u)=>{const d=st(t,u,r);return l.top=j(d.top,l.top),l.right=G(d.right,l.right),l.bottom=G(d.bottom,l.bottom),l.left=j(d.left,l.left),l},st(t,c,r));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}}function Jn(e){const{width:t,height:n}=wt(e);return{width:t,height:n}}function Qn(e,t,n){const o=z(t),r=V(t),i=n==="fixed",s=J(e,!0,i,t);let c={scrollLeft:0,scrollTop:0};const a=q(0);if(o||!o&&!i)if((ce(t)!=="body"||fe(r))&&(c=Ee(t)),o){const p=J(t,!0,i,t);a.x=p.x+t.clientLeft,a.y=p.y+t.clientTop}else r&&(a.x=ke(r));let l=0,u=0;if(r&&!o&&!i){const p=r.getBoundingClientRect();u=p.top+c.scrollTop,l=p.left+c.scrollLeft-ke(r,p)}const d=s.left+c.scrollLeft-a.x-l,m=s.top+c.scrollTop-a.y-u;return{x:d,y:m,width:s.width,height:s.height}}function Te(e){return B(e).position==="static"}function ct(e,t){if(!z(e)||B(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return V(e)===n&&(n=n.ownerDocument.body),n}function Et(e,t){const n=F(e);if(Ce(e))return n;if(!z(e)){let r=Z(e);for(;r&&!oe(r);){if(I(r)&&!Te(r))return r;r=Z(r)}return n}let o=ct(e,t);for(;o&&Bn(o)&&Te(o);)o=ct(o,t);return o&&oe(o)&&Te(o)&&!Be(o)?n:o||Hn(e)||n}const eo=async function(e){const t=this.getOffsetParent||Et,n=this.getDimensions,o=await n(e.floating);return{reference:Qn(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function to(e){return B(e).direction==="rtl"}const no={convertOffsetParentRelativeRectToViewportRelativeRect:Un,getDocumentElement:V,getClippingRect:Zn,getOffsetParent:Et,getElementRects:eo,getClientRects:Yn,getDimensions:Jn,getScale:te,isElement:I,isRTL:to};function oo(e,t){let n=null,o;const r=V(e);function i(){var c;clearTimeout(o),(c=n)==null||c.disconnect(),n=null}function s(c,a){c===void 0&&(c=!1),a===void 0&&(a=1),i();const{left:l,top:u,width:d,height:m}=e.getBoundingClientRect();if(c||t(),!d||!m)return;const p=me(u),h=me(r.clientWidth-(l+d)),g=me(r.clientHeight-(u+m)),x=me(l),y={rootMargin:-p+"px "+-h+"px "+-g+"px "+-x+"px",threshold:j(0,G(1,a))||1};let C=!0;function w(b){const A=b[0].intersectionRatio;if(A!==a){if(!C)return s();A?s(!1,A):o=setTimeout(()=>{s(!1,1e-7)},1e3)}C=!1}try{n=new IntersectionObserver(w,{...y,root:r.ownerDocument})}catch{n=new IntersectionObserver(w,y)}n.observe(e)}return s(!0),i}function ro(e,t,n,o){o===void 0&&(o={});const{ancestorScroll:r=!0,ancestorResize:i=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:a=!1}=o,l=ze(e),u=r||i?[...l?ue(l):[],...ue(t)]:[];u.forEach(v=>{r&&v.addEventListener("scroll",n,{passive:!0}),i&&v.addEventListener("resize",n)});const d=l&&c?oo(l,n):null;let m=-1,p=null;s&&(p=new ResizeObserver(v=>{let[y]=v;y&&y.target===l&&p&&(p.unobserve(t),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var C;(C=p)==null||C.observe(t)})),n()}),l&&!a&&p.observe(l),p.observe(t));let h,g=a?J(e):null;a&&x();function x(){const v=J(e);g&&(v.x!==g.x||v.y!==g.y||v.width!==g.width||v.height!==g.height)&&n(),g=v,h=requestAnimationFrame(x)}return n(),()=>{var v;u.forEach(y=>{r&&y.removeEventListener("scroll",n),i&&y.removeEventListener("resize",n)}),d==null||d(),(v=p)==null||v.disconnect(),p=null,a&&cancelAnimationFrame(h)}}const io=jn,so=Fn,co=_n,ao=In,lo=kn,at=Mn,uo=Wn,fo=(e,t,n)=>{const o=new Map,r={platform:no,...n},i={...r.platform,_c:o};return Ln(e,t,{...r,platform:i})};var ge=typeof document<"u"?f.useLayoutEffect:f.useEffect;function we(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,o,r;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(o=n;o--!==0;)if(!we(e[o],t[o]))return!1;return!0}if(r=Object.keys(e),n=r.length,n!==Object.keys(t).length)return!1;for(o=n;o--!==0;)if(!{}.hasOwnProperty.call(t,r[o]))return!1;for(o=n;o--!==0;){const i=r[o];if(!(i==="_owner"&&e.$$typeof)&&!we(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function Pt(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function lt(e,t){const n=Pt(e);return Math.round(t*n)/n}function Se(e){const t=f.useRef(e);return ge(()=>{t.current=e}),t}function po(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:o=[],platform:r,elements:{reference:i,floating:s}={},transform:c=!0,whileElementsMounted:a,open:l}=e,[u,d]=f.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[m,p]=f.useState(o);we(m,o)||p(o);const[h,g]=f.useState(null),[x,v]=f.useState(null),y=f.useCallback(R=>{R!==A.current&&(A.current=R,g(R))},[]),C=f.useCallback(R=>{R!==E.current&&(E.current=R,v(R))},[]),w=i||h,b=s||x,A=f.useRef(null),E=f.useRef(null),O=f.useRef(u),M=a!=null,T=Se(a),k=Se(r),$=Se(l),D=f.useCallback(()=>{if(!A.current||!E.current)return;const R={placement:t,strategy:n,middleware:m};k.current&&(R.platform=k.current),fo(A.current,E.current,R).then(_=>{const H={..._,isPositioned:$.current!==!1};S.current&&!we(O.current,H)&&(O.current=H,ut.flushSync(()=>{d(H)}))})},[m,t,n,k,$]);ge(()=>{l===!1&&O.current.isPositioned&&(O.current.isPositioned=!1,d(R=>({...R,isPositioned:!1})))},[l]);const S=f.useRef(!1);ge(()=>(S.current=!0,()=>{S.current=!1}),[]),ge(()=>{if(w&&(A.current=w),b&&(E.current=b),w&&b){if(T.current)return T.current(w,b,D);D()}},[w,b,D,T,M]);const W=f.useMemo(()=>({reference:A,floating:E,setReference:y,setFloating:C}),[y,C]),N=f.useMemo(()=>({reference:w,floating:b}),[w,b]),L=f.useMemo(()=>{const R={position:n,left:0,top:0};if(!N.floating)return R;const _=lt(N.floating,u.x),H=lt(N.floating,u.y);return c?{...R,transform:"translate("+_+"px, "+H+"px)",...Pt(N.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:_,top:H}},[n,c,N.floating,u.x,u.y]);return f.useMemo(()=>({...u,update:D,refs:W,elements:N,floatingStyles:L}),[u,D,W,N,L])}const mo=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:o,padding:r}=typeof e=="function"?e(n):e;return o&&t(o)?o.current!=null?at({element:o.current,padding:r}).fn(n):{}:o?at({element:o,padding:r}).fn(n):{}}}},ho=(e,t)=>({...io(e),options:[e,t]}),go=(e,t)=>({...so(e),options:[e,t]}),xo=(e,t)=>({...uo(e),options:[e,t]}),vo=(e,t)=>({...co(e),options:[e,t]}),yo=(e,t)=>({...ao(e),options:[e,t]}),wo=(e,t)=>({...lo(e),options:[e,t]}),bo=(e,t)=>({...mo(e),options:[e,t]});var Co="Arrow",At=f.forwardRef((e,t)=>{const{children:n,width:o=10,height:r=5,...i}=e;return P.jsx(ee.svg,{...i,ref:t,width:o,height:r,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:P.jsx("polygon",{points:"0,0 30,0 15,10"})})});At.displayName=Co;var Eo=At;function Po(e,t=[]){let n=[];function o(i,s){const c=f.createContext(s),a=n.length;n=[...n,s];function l(d){const{scope:m,children:p,...h}=d,g=(m==null?void 0:m[e][a])||c,x=f.useMemo(()=>h,Object.values(h));return P.jsx(g.Provider,{value:x,children:p})}function u(d,m){const p=(m==null?void 0:m[e][a])||c,h=f.useContext(p);if(h)return h;if(s!==void 0)return s;throw new Error(`\`${d}\` must be used within \`${i}\``)}return l.displayName=i+"Provider",[l,u]}const r=()=>{const i=n.map(s=>f.createContext(s));return function(c){const a=(c==null?void 0:c[e])||i;return f.useMemo(()=>({[`__scope${e}`]:{...c,[e]:a}}),[c,a])}};return r.scopeName=e,[o,Ao(r,...t)]}function Ao(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const o=e.map(r=>({useScope:r(),scopeName:r.scopeName}));return function(i){const s=o.reduce((c,{useScope:a,scopeName:l})=>{const d=a(i)[`__scope${l}`];return{...c,...d}},{});return f.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}function Ro(e){const[t,n]=f.useState(void 0);return ne(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const o=new ResizeObserver(r=>{if(!Array.isArray(r)||!r.length)return;const i=r[0];let s,c;if("borderBoxSize"in i){const a=i.borderBoxSize,l=Array.isArray(a)?a[0]:a;s=l.inlineSize,c=l.blockSize}else s=e.offsetWidth,c=e.offsetHeight;n({width:s,height:c})});return o.observe(e,{box:"border-box"}),()=>o.unobserve(e)}else n(void 0)},[e]),t}var Ve="Popper",[Rt,Ot]=Po(Ve),[Oo,Tt]=Rt(Ve),St=e=>{const{__scopePopper:t,children:n}=e,[o,r]=f.useState(null);return P.jsx(Oo,{scope:t,anchor:o,onAnchorChange:r,children:n})};St.displayName=Ve;var Dt="PopperAnchor",Nt=f.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:o,...r}=e,i=Tt(Dt,n),s=f.useRef(null),c=Q(t,s);return f.useEffect(()=>{i.onAnchorChange((o==null?void 0:o.current)||s.current)}),o?null:P.jsx(ee.div,{...r,ref:c})});Nt.displayName=Dt;var Ue="PopperContent",[To,So]=Rt(Ue),Lt=f.forwardRef((e,t)=>{var Xe,Ge,qe,Ke,Ze,Je;const{__scopePopper:n,side:o="bottom",sideOffset:r=0,align:i="center",alignOffset:s=0,arrowPadding:c=0,avoidCollisions:a=!0,collisionBoundary:l=[],collisionPadding:u=0,sticky:d="partial",hideWhenDetached:m=!1,updatePositionStrategy:p="optimized",onPlaced:h,...g}=e,x=Tt(Ue,n),[v,y]=f.useState(null),C=Q(t,ae=>y(ae)),[w,b]=f.useState(null),A=Ro(w),E=(A==null?void 0:A.width)??0,O=(A==null?void 0:A.height)??0,M=o+(i!=="center"?"-"+i:""),T=typeof u=="number"?u:{top:0,right:0,bottom:0,left:0,...u},k=Array.isArray(l)?l:[l],$=k.length>0,D={padding:T,boundary:k.filter(No),altBoundary:$},{refs:S,floatingStyles:W,placement:N,isPositioned:L,middlewareData:R}=po({strategy:"fixed",placement:M,whileElementsMounted:(...ae)=>ro(...ae,{animationFrame:p==="always"}),elements:{reference:x.anchor},middleware:[ho({mainAxis:r+O,alignmentAxis:s}),a&&go({mainAxis:!0,crossAxis:!1,limiter:d==="partial"?xo():void 0,...D}),a&&vo({...D}),yo({...D,apply:({elements:ae,rects:Qe,availableWidth:Jt,availableHeight:Qt})=>{const{width:en,height:tn}=Qe.reference,pe=ae.floating.style;pe.setProperty("--radix-popper-available-width",`${Jt}px`),pe.setProperty("--radix-popper-available-height",`${Qt}px`),pe.setProperty("--radix-popper-anchor-width",`${en}px`),pe.setProperty("--radix-popper-anchor-height",`${tn}px`)}}),w&&bo({element:w,padding:c}),Lo({arrowWidth:E,arrowHeight:O}),m&&wo({strategy:"referenceHidden",...D})]}),[_,H]=kt(N),de=ie(h);ne(()=>{L&&(de==null||de())},[L,de]);const Xt=(Xe=R.arrow)==null?void 0:Xe.x,Gt=(Ge=R.arrow)==null?void 0:Ge.y,qt=((qe=R.arrow)==null?void 0:qe.centerOffset)!==0,[Kt,Zt]=f.useState();return ne(()=>{v&&Zt(window.getComputedStyle(v).zIndex)},[v]),P.jsx("div",{ref:S.setFloating,"data-radix-popper-content-wrapper":"",style:{...W,transform:L?W.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Kt,"--radix-popper-transform-origin":[(Ke=R.transformOrigin)==null?void 0:Ke.x,(Ze=R.transformOrigin)==null?void 0:Ze.y].join(" "),...((Je=R.hide)==null?void 0:Je.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:P.jsx(To,{scope:n,placedSide:_,onArrowChange:b,arrowX:Xt,arrowY:Gt,shouldHideArrow:qt,children:P.jsx(ee.div,{"data-side":_,"data-align":H,...g,ref:C,style:{...g.style,animation:L?void 0:"none"}})})})});Lt.displayName=Ue;var Mt="PopperArrow",Do={top:"bottom",right:"left",bottom:"top",left:"right"},_t=f.forwardRef(function(t,n){const{__scopePopper:o,...r}=t,i=So(Mt,o),s=Do[i.placedSide];return P.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:P.jsx(Eo,{...r,ref:n,style:{...r.style,display:"block"}})})});_t.displayName=Mt;function No(e){return e!==null}var Lo=e=>({name:"transformOrigin",options:e,fn(t){var x,v,y;const{placement:n,rects:o,middlewareData:r}=t,s=((x=r.arrow)==null?void 0:x.centerOffset)!==0,c=s?0:e.arrowWidth,a=s?0:e.arrowHeight,[l,u]=kt(n),d={start:"0%",center:"50%",end:"100%"}[u],m=(((v=r.arrow)==null?void 0:v.x)??0)+c/2,p=(((y=r.arrow)==null?void 0:y.y)??0)+a/2;let h="",g="";return l==="bottom"?(h=s?d:`${m}px`,g=`${-a}px`):l==="top"?(h=s?d:`${m}px`,g=`${o.floating.height+a}px`):l==="right"?(h=`${-a}px`,g=s?d:`${p}px`):l==="left"&&(h=`${o.floating.width+a}px`,g=s?d:`${p}px`),{data:{x:h,y:g}}}});function kt(e){const[t,n="center"]=e.split("-");return[t,n]}var Mo=St,_o=Nt,ko=Lt,$o=_t;function jo(e,t){return f.useReducer((n,o)=>t[n][o]??n,e)}var $t=e=>{const{present:t,children:n}=e,o=Fo(t),r=typeof n=="function"?n({present:o.isPresent}):f.Children.only(n),i=Q(o.ref,Wo(r));return typeof n=="function"||o.isPresent?f.cloneElement(r,{ref:i}):null};$t.displayName="Presence";function Fo(e){const[t,n]=f.useState(),o=f.useRef({}),r=f.useRef(e),i=f.useRef("none"),s=e?"mounted":"unmounted",[c,a]=jo(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return f.useEffect(()=>{const l=he(o.current);i.current=c==="mounted"?l:"none"},[c]),ne(()=>{const l=o.current,u=r.current;if(u!==e){const m=i.current,p=he(l);e?a("MOUNT"):p==="none"||(l==null?void 0:l.display)==="none"?a("UNMOUNT"):a(u&&m!==p?"ANIMATION_OUT":"UNMOUNT"),r.current=e}},[e,a]),ne(()=>{if(t){let l;const u=t.ownerDocument.defaultView??window,d=p=>{const g=he(o.current).includes(p.animationName);if(p.target===t&&g&&(a("ANIMATION_END"),!r.current)){const x=t.style.animationFillMode;t.style.animationFillMode="forwards",l=u.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=x)})}},m=p=>{p.target===t&&(i.current=he(o.current))};return t.addEventListener("animationstart",m),t.addEventListener("animationcancel",d),t.addEventListener("animationend",d),()=>{u.clearTimeout(l),t.removeEventListener("animationstart",m),t.removeEventListener("animationcancel",d),t.removeEventListener("animationend",d)}}else a("ANIMATION_END")},[t,a]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:f.useCallback(l=>{l&&(o.current=getComputedStyle(l)),n(l)},[])}}function he(e){return(e==null?void 0:e.animationName)||"none"}function Wo(e){var o,r;let t=(o=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(r=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function Io({prop:e,defaultProp:t,onChange:n=()=>{}}){const[o,r]=Bo({defaultProp:t,onChange:n}),i=e!==void 0,s=i?e:o,c=ie(n),a=f.useCallback(l=>{if(i){const d=typeof l=="function"?l(e):l;d!==e&&c(d)}else r(l)},[i,e,r,c]);return[s,a]}function Bo({defaultProp:e,onChange:t}){const n=f.useState(e),[o]=n,r=f.useRef(o),i=ie(t);return f.useEffect(()=>{r.current!==o&&(i(o),r.current=o)},[o,r,i]),n}var Ho="VisuallyHidden",jt=f.forwardRef((e,t)=>P.jsx(ee.span,{...e,ref:t,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...e.style}}));jt.displayName=Ho;var zo=jt,[Pe,mr]=sn("Tooltip",[Ot]),Ae=Ot(),Ft="TooltipProvider",Vo=700,$e="tooltip.open",[Uo,Ye]=Pe(Ft),Wt=e=>{const{__scopeTooltip:t,delayDuration:n=Vo,skipDelayDuration:o=300,disableHoverableContent:r=!1,children:i}=e,[s,c]=f.useState(!0),a=f.useRef(!1),l=f.useRef(0);return f.useEffect(()=>{const u=l.current;return()=>window.clearTimeout(u)},[]),P.jsx(Uo,{scope:t,isOpenDelayed:s,delayDuration:n,onOpen:f.useCallback(()=>{window.clearTimeout(l.current),c(!1)},[]),onClose:f.useCallback(()=>{window.clearTimeout(l.current),l.current=window.setTimeout(()=>c(!0),o)},[o]),isPointerInTransitRef:a,onPointerInTransitChange:f.useCallback(u=>{a.current=u},[]),disableHoverableContent:r,children:i})};Wt.displayName=Ft;var Re="Tooltip",[Yo,Oe]=Pe(Re),It=e=>{const{__scopeTooltip:t,children:n,open:o,defaultOpen:r=!1,onOpenChange:i,disableHoverableContent:s,delayDuration:c}=e,a=Ye(Re,e.__scopeTooltip),l=Ae(t),[u,d]=f.useState(null),m=En(),p=f.useRef(0),h=s??a.disableHoverableContent,g=c??a.delayDuration,x=f.useRef(!1),[v=!1,y]=Io({prop:o,defaultProp:r,onChange:E=>{E?(a.onOpen(),document.dispatchEvent(new CustomEvent($e))):a.onClose(),i==null||i(E)}}),C=f.useMemo(()=>v?x.current?"delayed-open":"instant-open":"closed",[v]),w=f.useCallback(()=>{window.clearTimeout(p.current),x.current=!1,y(!0)},[y]),b=f.useCallback(()=>{window.clearTimeout(p.current),y(!1)},[y]),A=f.useCallback(()=>{window.clearTimeout(p.current),p.current=window.setTimeout(()=>{x.current=!0,y(!0)},g)},[g,y]);return f.useEffect(()=>()=>window.clearTimeout(p.current),[]),P.jsx(Mo,{...l,children:P.jsx(Yo,{scope:t,contentId:m,open:v,stateAttribute:C,trigger:u,onTriggerChange:d,onTriggerEnter:f.useCallback(()=>{a.isOpenDelayed?A():w()},[a.isOpenDelayed,A,w]),onTriggerLeave:f.useCallback(()=>{h?b():window.clearTimeout(p.current)},[b,h]),onOpen:w,onClose:b,disableHoverableContent:h,children:n})})};It.displayName=Re;var je="TooltipTrigger",Bt=f.forwardRef((e,t)=>{const{__scopeTooltip:n,...o}=e,r=Oe(je,n),i=Ye(je,n),s=Ae(n),c=f.useRef(null),a=Q(t,c,r.onTriggerChange),l=f.useRef(!1),u=f.useRef(!1),d=f.useCallback(()=>l.current=!1,[]);return f.useEffect(()=>()=>document.removeEventListener("pointerup",d),[d]),P.jsx(_o,{asChild:!0,...s,children:P.jsx(ee.button,{"aria-describedby":r.open?r.contentId:void 0,"data-state":r.stateAttribute,...o,ref:a,onPointerMove:U(e.onPointerMove,m=>{m.pointerType!=="touch"&&!u.current&&!i.isPointerInTransitRef.current&&(r.onTriggerEnter(),u.current=!0)}),onPointerLeave:U(e.onPointerLeave,()=>{r.onTriggerLeave(),u.current=!1}),onPointerDown:U(e.onPointerDown,()=>{l.current=!0,document.addEventListener("pointerup",d,{once:!0})}),onFocus:U(e.onFocus,()=>{l.current||r.onOpen()}),onBlur:U(e.onBlur,r.onClose),onClick:U(e.onClick,r.onClose)})})});Bt.displayName=je;var Xo="TooltipPortal",[hr,Go]=Pe(Xo,{forceMount:void 0}),re="TooltipContent",Ht=f.forwardRef((e,t)=>{const n=Go(re,e.__scopeTooltip),{forceMount:o=n.forceMount,side:r="top",...i}=e,s=Oe(re,e.__scopeTooltip);return P.jsx($t,{present:o||s.open,children:s.disableHoverableContent?P.jsx(zt,{side:r,...i,ref:t}):P.jsx(qo,{side:r,...i,ref:t})})}),qo=f.forwardRef((e,t)=>{const n=Oe(re,e.__scopeTooltip),o=Ye(re,e.__scopeTooltip),r=f.useRef(null),i=Q(t,r),[s,c]=f.useState(null),{trigger:a,onClose:l}=n,u=r.current,{onPointerInTransitChange:d}=o,m=f.useCallback(()=>{c(null),d(!1)},[d]),p=f.useCallback((h,g)=>{const x=h.currentTarget,v={x:h.clientX,y:h.clientY},y=Qo(v,x.getBoundingClientRect()),C=er(v,y),w=tr(g.getBoundingClientRect()),b=or([...C,...w]);c(b),d(!0)},[d]);return f.useEffect(()=>()=>m(),[m]),f.useEffect(()=>{if(a&&u){const h=x=>p(x,u),g=x=>p(x,a);return a.addEventListener("pointerleave",h),u.addEventListener("pointerleave",g),()=>{a.removeEventListener("pointerleave",h),u.removeEventListener("pointerleave",g)}}},[a,u,p,m]),f.useEffect(()=>{if(s){const h=g=>{const x=g.target,v={x:g.clientX,y:g.clientY},y=(a==null?void 0:a.contains(x))||(u==null?void 0:u.contains(x)),C=!nr(v,s);y?m():C&&(m(),l())};return document.addEventListener("pointermove",h),()=>document.removeEventListener("pointermove",h)}},[a,u,s,l,m]),P.jsx(zt,{...e,ref:i})}),[Ko,Zo]=Pe(Re,{isInside:!1}),zt=f.forwardRef((e,t)=>{const{__scopeTooltip:n,children:o,"aria-label":r,onEscapeKeyDown:i,onPointerDownOutside:s,...c}=e,a=Oe(re,n),l=Ae(n),{onClose:u}=a;return f.useEffect(()=>(document.addEventListener($e,u),()=>document.removeEventListener($e,u)),[u]),f.useEffect(()=>{if(a.trigger){const d=m=>{const p=m.target;p!=null&&p.contains(a.trigger)&&u()};return window.addEventListener("scroll",d,{capture:!0}),()=>window.removeEventListener("scroll",d,{capture:!0})}},[a.trigger,u]),P.jsx(ht,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:d=>d.preventDefault(),onDismiss:u,children:P.jsxs(ko,{"data-state":a.stateAttribute,...l,...c,ref:t,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:[P.jsx(pt,{children:o}),P.jsx(Ko,{scope:n,isInside:!0,children:P.jsx(zo,{id:a.contentId,role:"tooltip",children:r||o})})]})})});Ht.displayName=re;var Vt="TooltipArrow",Jo=f.forwardRef((e,t)=>{const{__scopeTooltip:n,...o}=e,r=Ae(n);return Zo(Vt,n).isInside?null:P.jsx($o,{...r,...o,ref:t})});Jo.displayName=Vt;function Qo(e,t){const n=Math.abs(t.top-e.y),o=Math.abs(t.bottom-e.y),r=Math.abs(t.right-e.x),i=Math.abs(t.left-e.x);switch(Math.min(n,o,r,i)){case i:return"left";case r:return"right";case n:return"top";case o:return"bottom";default:throw new Error("unreachable")}}function er(e,t,n=5){const o=[];switch(t){case"top":o.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":o.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":o.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":o.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return o}function tr(e){const{top:t,right:n,bottom:o,left:r}=e;return[{x:r,y:t},{x:n,y:t},{x:n,y:o},{x:r,y:o}]}function nr(e,t){const{x:n,y:o}=e;let r=!1;for(let i=0,s=t.length-1;i<t.length;s=i++){const c=t[i].x,a=t[i].y,l=t[s].x,u=t[s].y;a>o!=u>o&&n<(l-c)*(o-a)/(u-a)+c&&(r=!r)}return r}function or(e){const t=e.slice();return t.sort((n,o)=>n.x<o.x?-1:n.x>o.x?1:n.y<o.y?-1:n.y>o.y?1:0),rr(t)}function rr(e){if(e.length<=1)return e.slice();const t=[];for(let o=0;o<e.length;o++){const r=e[o];for(;t.length>=2;){const i=t[t.length-1],s=t[t.length-2];if((i.x-s.x)*(r.y-s.y)>=(i.y-s.y)*(r.x-s.x))t.pop();else break}t.push(r)}t.pop();const n=[];for(let o=e.length-1;o>=0;o--){const r=e[o];for(;n.length>=2;){const i=n[n.length-1],s=n[n.length-2];if((i.x-s.x)*(r.y-s.y)>=(i.y-s.y)*(r.x-s.x))n.pop();else break}n.push(r)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var ir=Wt,sr=It,cr=Bt,Ut=Ht;const gr=ir,ar=sr,lr=cr;function Yt({className:e,sideOffset:t=4,ref:n,...o}){return P.jsx(Ut,{ref:n,sideOffset:t,className:on("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...o})}Yt.displayName=Ut.displayName;function xr({content:e,children:t}){return e?P.jsxs(ar,{children:[P.jsx(lr,{asChild:!0,children:t}),P.jsx(Yt,{children:e})]}):t}export{_o as A,ko as C,ht as D,ee as P,Mo as R,xr as S,gr as T,jt as V,ar as a,lr as b,Yt as c,sn as d,En as e,U as f,$t as g,Q as h,ne as i,Ot as j,dt as k,$o as l,pr as m,ie as n,Io as u};
|
|
2
|
-
//# sourceMappingURL=tooltip-leWCE50J.js.map
|