@golocalinteractive/golocal-cloud-wrapper 1.0.67 → 1.0.68
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/README.md +3 -1
- package/dist/context/PermissionsContext.d.ts.map +1 -1
- package/dist/golocal-cloud-wrapper.cjs.js +1 -1
- package/dist/golocal-cloud-wrapper.es.js +17 -12
- package/dist/lib/auth/permissions.d.ts +3 -0
- package/dist/lib/auth/permissions.d.ts.map +1 -1
- package/dist/lib/auth/server.d.ts.map +1 -1
- package/dist/server.cjs.js +3 -3
- package/dist/server.es.js +522 -519
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -125,7 +125,7 @@ export async function GET() {
|
|
|
125
125
|
return NextResponse.json(permissions);
|
|
126
126
|
} catch (error) {
|
|
127
127
|
return NextResponse.json(
|
|
128
|
-
{ essentialInsights: false, web: false, priceMonster: false },
|
|
128
|
+
{ essentialInsights: false, organic: false, paid: false, web: false, priceMonster: false, se_company_id: null },
|
|
129
129
|
{ status: 500 }
|
|
130
130
|
);
|
|
131
131
|
}
|
|
@@ -153,6 +153,8 @@ function YourComponent() {
|
|
|
153
153
|
return (
|
|
154
154
|
<div>
|
|
155
155
|
{permissions.essentialInsights && <EssentialInsightsContent />}
|
|
156
|
+
{permissions.organic && <OrganicContent />}
|
|
157
|
+
{permissions.paid && <PaidContent />}
|
|
156
158
|
{permissions.web && <WebContent />}
|
|
157
159
|
{permissions.priceMonster && <PriceMonsterContent />}
|
|
158
160
|
</div>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PermissionsContext.d.ts","sourceRoot":"","sources":["../../src/context/PermissionsContext.tsx"],"names":[],"mappings":"AAEA,OAAO,EAKL,SAAS,EACV,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,aAAa,CAAC;AAEjD,UAAU,uBAAuB;IAC/B,WAAW,EAAE,aAAa,CAAC;IAC3B,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,KAAK,GAAG,IAAI,CAAC;IACpB,gBAAgB,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CACvC;AAMD,eAAO,MAAM,cAAc,+BAM1B,CAAC;AAEF,UAAU,wBAAwB;IAChC,QAAQ,EAAE,SAAS,CAAC;IACpB,wBAAwB,CAAC,EAAE,MAAM,CAAC;IAClC,kBAAkB,CAAC,EAAE,aAAa,CAAC;CACpC;AAED,wBAAgB,mBAAmB,CAAC,EAClC,QAAQ,EACR,wBAAkD,EAClD,kBAAkB,GACnB,EAAE,wBAAwB,
|
|
1
|
+
{"version":3,"file":"PermissionsContext.d.ts","sourceRoot":"","sources":["../../src/context/PermissionsContext.tsx"],"names":[],"mappings":"AAEA,OAAO,EAKL,SAAS,EACV,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,aAAa,CAAC;AAEjD,UAAU,uBAAuB;IAC/B,WAAW,EAAE,aAAa,CAAC;IAC3B,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,KAAK,GAAG,IAAI,CAAC;IACpB,gBAAgB,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CACvC;AAMD,eAAO,MAAM,cAAc,+BAM1B,CAAC;AAEF,UAAU,wBAAwB;IAChC,QAAQ,EAAE,SAAS,CAAC;IACpB,wBAAwB,CAAC,EAAE,MAAM,CAAC;IAClC,kBAAkB,CAAC,EAAE,aAAa,CAAC;CACpC;AAED,wBAAgB,mBAAmB,CAAC,EAClC,QAAQ,EACR,wBAAkD,EAClD,kBAAkB,GACnB,EAAE,wBAAwB,2CA6C1B"}
|
|
@@ -163,4 +163,4 @@ React keys must be passed directly to JSX without using spread:
|
|
|
163
163
|
|
|
164
164
|
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
165
165
|
|
|
166
|
-
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return l.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},Wl="DialogDescriptionWarning",Ul=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Ho(Wl).contentName}}.`;return l.useEffect(()=>{var a;const o=(a=e.current)==null?void 0:a.getAttribute("aria-describedby");t&&o&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},Kl=ko,Yl=Po,Zl=_o,Vo=To,Bo=Oo,Go=Do,Wo=Lo,Uo=$o;const Ko=Kl,Xl=Yl,ql=Uo,Yo=Zl,Tn=l.forwardRef(({className:e,...t},n)=>c.jsx(Vo,{className:A("fixed inset-0 z-50 bg-background/80 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t,ref:n}));Tn.displayName=Vo.displayName;const Jl=En("fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500",{variants:{side:{top:"inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",bottom:"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",left:"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",right:"inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"}},defaultVariants:{side:"right"}}),On=l.forwardRef(({side:e="right",className:t,children:n,...r},o)=>c.jsxs(Yo,{children:[c.jsx(Tn,{}),c.jsxs(Bo,{ref:o,className:A(Jl({side:e}),t),...r,children:[n,c.jsxs(Uo,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary",children:[c.jsx(Mc,{className:"h-4 w-4"}),c.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));On.displayName=Bo.displayName;const jn=({className:e,...t})=>c.jsx("div",{className:A("flex flex-col space-y-2 text-center sm:text-left",e),...t});jn.displayName="SheetHeader";const Zo=({className:e,...t})=>c.jsx("div",{className:A("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});Zo.displayName="SheetFooter";const Dn=l.forwardRef(({className:e,...t},n)=>c.jsx(Go,{ref:n,className:A("text-lg font-semibold text-foreground",e),...t}));Dn.displayName=Go.displayName;const In=l.forwardRef(({className:e,...t},n)=>c.jsx(Wo,{ref:n,className:A("text-sm text-muted-foreground",e),...t}));In.displayName=Wo.displayName;function mn({className:e,...t}){return c.jsx("div",{className:A("animate-pulse rounded-md bg-muted",e),...t})}const Ql=["top","right","bottom","left"],ke=Math.min,se=Math.max,At=Math.round,St=Math.floor,me=e=>({x:e,y:e}),eu={left:"right",right:"left",bottom:"top",top:"bottom"},tu={start:"end",end:"start"};function hn(e,t,n){return se(e,ke(t,n))}function we(e,t){return typeof e=="function"?e(t):e}function ye(e){return e.split("-")[0]}function Ye(e){return e.split("-")[1]}function Ln(e){return e==="x"?"y":"x"}function Fn(e){return e==="y"?"height":"width"}function pe(e){return["top","bottom"].includes(ye(e))?"y":"x"}function $n(e){return Ln(pe(e))}function nu(e,t,n){n===void 0&&(n=!1);const r=Ye(e),o=$n(e),a=Fn(o);let s=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[a]>t.floating[a]&&(s=Pt(s)),[s,Pt(s)]}function ru(e){const t=Pt(e);return[gn(e),t,gn(t)]}function gn(e){return e.replace(/start|end/g,t=>tu[t])}function ou(e,t,n){const r=["left","right"],o=["right","left"],a=["top","bottom"],s=["bottom","top"];switch(e){case"top":case"bottom":return n?t?o:r:t?r:o;case"left":case"right":return t?a:s;default:return[]}}function au(e,t,n,r){const o=Ye(e);let a=ou(ye(e),n==="start",r);return o&&(a=a.map(s=>s+"-"+o),t&&(a=a.concat(a.map(gn)))),a}function Pt(e){return e.replace(/left|right|bottom|top/g,t=>eu[t])}function su(e){return{top:0,right:0,bottom:0,left:0,...e}}function Xo(e){return typeof e!="number"?su(e):{top:e,right:e,bottom:e,left:e}}function Nt(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function Tr(e,t,n){let{reference:r,floating:o}=e;const a=pe(t),s=$n(t),i=Fn(s),u=ye(t),f=a==="y",d=r.x+r.width/2-o.width/2,p=r.y+r.height/2-o.height/2,m=r[i]/2-o[i]/2;let g;switch(u){case"top":g={x:d,y:r.y-o.height};break;case"bottom":g={x:d,y:r.y+r.height};break;case"right":g={x:r.x+r.width,y:p};break;case"left":g={x:r.x-o.width,y:p};break;default:g={x:r.x,y:r.y}}switch(Ye(t)){case"start":g[s]-=m*(n&&f?-1:1);break;case"end":g[s]+=m*(n&&f?-1:1);break}return g}const iu=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:a=[],platform:s}=n,i=a.filter(Boolean),u=await(s.isRTL==null?void 0:s.isRTL(t));let f=await s.getElementRects({reference:e,floating:t,strategy:o}),{x:d,y:p}=Tr(f,r,u),m=r,g={},b=0;for(let h=0;h<i.length;h++){const{name:v,fn:x}=i[h],{x:y,y:C,data:S,reset:M}=await x({x:d,y:p,initialPlacement:r,placement:m,strategy:o,middlewareData:g,rects:f,platform:s,elements:{reference:e,floating:t}});d=y??d,p=C??p,g={...g,[v]:{...g[v],...S}},M&&b<=50&&(b++,typeof M=="object"&&(M.placement&&(m=M.placement),M.rects&&(f=M.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:o}):M.rects),{x:d,y:p}=Tr(f,m,u)),h=-1)}return{x:d,y:p,placement:m,strategy:o,middlewareData:g}};async function tt(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:a,rects:s,elements:i,strategy:u}=e,{boundary:f="clippingAncestors",rootBoundary:d="viewport",elementContext:p="floating",altBoundary:m=!1,padding:g=0}=we(t,e),b=Xo(g),v=i[m?p==="floating"?"reference":"floating":p],x=Nt(await a.getClippingRect({element:(n=await(a.isElement==null?void 0:a.isElement(v)))==null||n?v:v.contextElement||await(a.getDocumentElement==null?void 0:a.getDocumentElement(i.floating)),boundary:f,rootBoundary:d,strategy:u})),y=p==="floating"?{x:r,y:o,width:s.floating.width,height:s.floating.height}:s.reference,C=await(a.getOffsetParent==null?void 0:a.getOffsetParent(i.floating)),S=await(a.isElement==null?void 0:a.isElement(C))?await(a.getScale==null?void 0:a.getScale(C))||{x:1,y:1}:{x:1,y:1},M=Nt(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:i,rect:y,offsetParent:C,strategy:u}):y);return{top:(x.top-M.top+b.top)/S.y,bottom:(M.bottom-x.bottom+b.bottom)/S.y,left:(x.left-M.left+b.left)/S.x,right:(M.right-x.right+b.right)/S.x}}const cu=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:a,platform:s,elements:i,middlewareData:u}=t,{element:f,padding:d=0}=we(e,t)||{};if(f==null)return{};const p=Xo(d),m={x:n,y:r},g=$n(o),b=Fn(g),h=await s.getDimensions(f),v=g==="y",x=v?"top":"left",y=v?"bottom":"right",C=v?"clientHeight":"clientWidth",S=a.reference[b]+a.reference[g]-m[g]-a.floating[b],M=m[g]-a.reference[g],T=await(s.getOffsetParent==null?void 0:s.getOffsetParent(f));let k=T?T[C]:0;(!k||!await(s.isElement==null?void 0:s.isElement(T)))&&(k=i.floating[C]||a.floating[b]);const R=S/2-M/2,I=k/2-h[b]/2-1,z=ke(p[x],I),U=ke(p[y],I),G=z,W=k-h[b]-U,H=k/2-h[b]/2+R,Y=hn(G,H,W),D=!u.arrow&&Ye(o)!=null&&H!==Y&&a.reference[b]/2-(H<G?z:U)-h[b]/2<0,V=D?H<G?H-G:H-W:0;return{[g]:m[g]+V,data:{[g]:Y,centerOffset:H-Y-V,...D&&{alignmentOffset:V}},reset:D}}}),lu=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:a,rects:s,initialPlacement:i,platform:u,elements:f}=t,{mainAxis:d=!0,crossAxis:p=!0,fallbackPlacements:m,fallbackStrategy:g="bestFit",fallbackAxisSideDirection:b="none",flipAlignment:h=!0,...v}=we(e,t);if((n=a.arrow)!=null&&n.alignmentOffset)return{};const x=ye(o),y=pe(i),C=ye(i)===i,S=await(u.isRTL==null?void 0:u.isRTL(f.floating)),M=m||(C||!h?[Pt(i)]:ru(i)),T=b!=="none";!m&&T&&M.push(...au(i,h,b,S));const k=[i,...M],R=await tt(t,v),I=[];let z=((r=a.flip)==null?void 0:r.overflows)||[];if(d&&I.push(R[x]),p){const H=nu(o,s,S);I.push(R[H[0]],R[H[1]])}if(z=[...z,{placement:o,overflows:I}],!I.every(H=>H<=0)){var U,G;const H=(((U=a.flip)==null?void 0:U.index)||0)+1,Y=k[H];if(Y&&(!(p==="alignment"?y!==pe(Y):!1)||z.every(E=>E.overflows[0]>0&&pe(E.placement)===y)))return{data:{index:H,overflows:z},reset:{placement:Y}};let D=(G=z.filter(V=>V.overflows[0]<=0).sort((V,E)=>V.overflows[1]-E.overflows[1])[0])==null?void 0:G.placement;if(!D)switch(g){case"bestFit":{var W;const V=(W=z.filter(E=>{if(T){const _=pe(E.placement);return _===y||_==="y"}return!0}).map(E=>[E.placement,E.overflows.filter(_=>_>0).reduce((_,w)=>_+w,0)]).sort((E,_)=>E[1]-_[1])[0])==null?void 0:W[0];V&&(D=V);break}case"initialPlacement":D=i;break}if(o!==D)return{reset:{placement:D}}}return{}}}};function Or(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function jr(e){return Ql.some(t=>e[t]>=0)}const uu=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=we(e,t);switch(r){case"referenceHidden":{const a=await tt(t,{...o,elementContext:"reference"}),s=Or(a,n.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:jr(s)}}}case"escaped":{const a=await tt(t,{...o,altBoundary:!0}),s=Or(a,n.floating);return{data:{escapedOffsets:s,escaped:jr(s)}}}default:return{}}}}};async function du(e,t){const{placement:n,platform:r,elements:o}=e,a=await(r.isRTL==null?void 0:r.isRTL(o.floating)),s=ye(n),i=Ye(n),u=pe(n)==="y",f=["left","top"].includes(s)?-1:1,d=a&&u?-1:1,p=we(t,e);let{mainAxis:m,crossAxis:g,alignmentAxis:b}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return i&&typeof b=="number"&&(g=i==="end"?b*-1:b),u?{x:g*d,y:m*f}:{x:m*f,y:g*d}}const fu=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:a,placement:s,middlewareData:i}=t,u=await du(t,e);return s===((n=i.offset)==null?void 0:n.placement)&&(r=i.arrow)!=null&&r.alignmentOffset?{}:{x:o+u.x,y:a+u.y,data:{...u,placement:s}}}}},pu=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:a=!0,crossAxis:s=!1,limiter:i={fn:v=>{let{x,y}=v;return{x,y}}},...u}=we(e,t),f={x:n,y:r},d=await tt(t,u),p=pe(ye(o)),m=Ln(p);let g=f[m],b=f[p];if(a){const v=m==="y"?"top":"left",x=m==="y"?"bottom":"right",y=g+d[v],C=g-d[x];g=hn(y,g,C)}if(s){const v=p==="y"?"top":"left",x=p==="y"?"bottom":"right",y=b+d[v],C=b-d[x];b=hn(y,b,C)}const h=i.fn({...t,[m]:g,[p]:b});return{...h,data:{x:h.x-n,y:h.y-r,enabled:{[m]:a,[p]:s}}}}}},mu=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:a,middlewareData:s}=t,{offset:i=0,mainAxis:u=!0,crossAxis:f=!0}=we(e,t),d={x:n,y:r},p=pe(o),m=Ln(p);let g=d[m],b=d[p];const h=we(i,t),v=typeof h=="number"?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(u){const C=m==="y"?"height":"width",S=a.reference[m]-a.floating[C]+v.mainAxis,M=a.reference[m]+a.reference[C]-v.mainAxis;g<S?g=S:g>M&&(g=M)}if(f){var x,y;const C=m==="y"?"width":"height",S=["top","left"].includes(ye(o)),M=a.reference[p]-a.floating[C]+(S&&((x=s.offset)==null?void 0:x[p])||0)+(S?0:v.crossAxis),T=a.reference[p]+a.reference[C]+(S?0:((y=s.offset)==null?void 0:y[p])||0)-(S?v.crossAxis:0);b<M?b=M:b>T&&(b=T)}return{[m]:g,[p]:b}}}},hu=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:a,platform:s,elements:i}=t,{apply:u=()=>{},...f}=we(e,t),d=await tt(t,f),p=ye(o),m=Ye(o),g=pe(o)==="y",{width:b,height:h}=a.floating;let v,x;p==="top"||p==="bottom"?(v=p,x=m===(await(s.isRTL==null?void 0:s.isRTL(i.floating))?"start":"end")?"left":"right"):(x=p,v=m==="end"?"top":"bottom");const y=h-d.top-d.bottom,C=b-d.left-d.right,S=ke(h-d[v],y),M=ke(b-d[x],C),T=!t.middlewareData.shift;let k=S,R=M;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(R=C),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(k=y),T&&!m){const z=se(d.left,0),U=se(d.right,0),G=se(d.top,0),W=se(d.bottom,0);g?R=b-2*(z!==0||U!==0?z+U:se(d.left,d.right)):k=h-2*(G!==0||W!==0?G+W:se(d.top,d.bottom))}await u({...t,availableWidth:R,availableHeight:k});const I=await s.getDimensions(i.floating);return b!==I.width||h!==I.height?{reset:{rects:!0}}:{}}}};function zt(){return typeof window<"u"}function Ze(e){return qo(e)?(e.nodeName||"").toLowerCase():"#document"}function ie(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function ve(e){var t;return(t=(qo(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function qo(e){return zt()?e instanceof Node||e instanceof ie(e).Node:!1}function le(e){return zt()?e instanceof Element||e instanceof ie(e).Element:!1}function ge(e){return zt()?e instanceof HTMLElement||e instanceof ie(e).HTMLElement:!1}function Dr(e){return!zt()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof ie(e).ShadowRoot}function it(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=ue(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function gu(e){return["table","td","th"].includes(Ze(e))}function Ht(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function zn(e){const t=Hn(),n=le(e)?ue(e):e;return["transform","translate","scale","rotate","perspective"].some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","translate","scale","rotate","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function vu(e){let t=Ae(e);for(;ge(t)&&!Be(t);){if(zn(t))return t;if(Ht(t))return null;t=Ae(t)}return null}function Hn(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Be(e){return["html","body","#document"].includes(Ze(e))}function ue(e){return ie(e).getComputedStyle(e)}function Vt(e){return le(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Ae(e){if(Ze(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Dr(e)&&e.host||ve(e);return Dr(t)?t.host:t}function Jo(e){const t=Ae(e);return Be(t)?e.ownerDocument?e.ownerDocument.body:e.body:ge(t)&&it(t)?t:Jo(t)}function nt(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=Jo(e),a=o===((r=e.ownerDocument)==null?void 0:r.body),s=ie(o);if(a){const i=vn(s);return t.concat(s,s.visualViewport||[],it(o)?o:[],i&&n?nt(i):[])}return t.concat(o,nt(o,[],n))}function vn(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Qo(e){const t=ue(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=ge(e),a=o?e.offsetWidth:n,s=o?e.offsetHeight:r,i=At(n)!==a||At(r)!==s;return i&&(n=a,r=s),{width:n,height:r,$:i}}function Vn(e){return le(e)?e:e.contextElement}function He(e){const t=Vn(e);if(!ge(t))return me(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:a}=Qo(t);let s=(a?At(n.width):n.width)/r,i=(a?At(n.height):n.height)/o;return(!s||!Number.isFinite(s))&&(s=1),(!i||!Number.isFinite(i))&&(i=1),{x:s,y:i}}const bu=me(0);function ea(e){const t=ie(e);return!Hn()||!t.visualViewport?bu:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function xu(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==ie(e)?!1:t}function Oe(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),a=Vn(e);let s=me(1);t&&(r?le(r)&&(s=He(r)):s=He(e));const i=xu(a,n,r)?ea(a):me(0);let u=(o.left+i.x)/s.x,f=(o.top+i.y)/s.y,d=o.width/s.x,p=o.height/s.y;if(a){const m=ie(a),g=r&&le(r)?ie(r):r;let b=m,h=vn(b);for(;h&&r&&g!==b;){const v=He(h),x=h.getBoundingClientRect(),y=ue(h),C=x.left+(h.clientLeft+parseFloat(y.paddingLeft))*v.x,S=x.top+(h.clientTop+parseFloat(y.paddingTop))*v.y;u*=v.x,f*=v.y,d*=v.x,p*=v.y,u+=C,f+=S,b=ie(h),h=vn(b)}}return Nt({width:d,height:p,x:u,y:f})}function Bn(e,t){const n=Vt(e).scrollLeft;return t?t.left+n:Oe(ve(e)).left+n}function ta(e,t,n){n===void 0&&(n=!1);const r=e.getBoundingClientRect(),o=r.left+t.scrollLeft-(n?0:Bn(e,r)),a=r.top+t.scrollTop;return{x:o,y:a}}function wu(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const a=o==="fixed",s=ve(r),i=t?Ht(t.floating):!1;if(r===s||i&&a)return n;let u={scrollLeft:0,scrollTop:0},f=me(1);const d=me(0),p=ge(r);if((p||!p&&!a)&&((Ze(r)!=="body"||it(s))&&(u=Vt(r)),ge(r))){const g=Oe(r);f=He(r),d.x=g.x+r.clientLeft,d.y=g.y+r.clientTop}const m=s&&!p&&!a?ta(s,u,!0):me(0);return{width:n.width*f.x,height:n.height*f.y,x:n.x*f.x-u.scrollLeft*f.x+d.x+m.x,y:n.y*f.y-u.scrollTop*f.y+d.y+m.y}}function yu(e){return Array.from(e.getClientRects())}function Cu(e){const t=ve(e),n=Vt(e),r=e.ownerDocument.body,o=se(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=se(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+Bn(e);const i=-n.scrollTop;return ue(r).direction==="rtl"&&(s+=se(t.clientWidth,r.clientWidth)-o),{width:o,height:a,x:s,y:i}}function Su(e,t){const n=ie(e),r=ve(e),o=n.visualViewport;let a=r.clientWidth,s=r.clientHeight,i=0,u=0;if(o){a=o.width,s=o.height;const f=Hn();(!f||f&&t==="fixed")&&(i=o.offsetLeft,u=o.offsetTop)}return{width:a,height:s,x:i,y:u}}function Eu(e,t){const n=Oe(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,a=ge(e)?He(e):me(1),s=e.clientWidth*a.x,i=e.clientHeight*a.y,u=o*a.x,f=r*a.y;return{width:s,height:i,x:u,y:f}}function Ir(e,t,n){let r;if(t==="viewport")r=Su(e,n);else if(t==="document")r=Cu(ve(e));else if(le(t))r=Eu(t,n);else{const o=ea(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return Nt(r)}function na(e,t){const n=Ae(e);return n===t||!le(n)||Be(n)?!1:ue(n).position==="fixed"||na(n,t)}function Ru(e,t){const n=t.get(e);if(n)return n;let r=nt(e,[],!1).filter(i=>le(i)&&Ze(i)!=="body"),o=null;const a=ue(e).position==="fixed";let s=a?Ae(e):e;for(;le(s)&&!Be(s);){const i=ue(s),u=zn(s);!u&&i.position==="fixed"&&(o=null),(a?!u&&!o:!u&&i.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||it(s)&&!u&&na(e,s))?r=r.filter(d=>d!==s):o=i,s=Ae(s)}return t.set(e,r),r}function Mu(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const s=[...n==="clippingAncestors"?Ht(t)?[]:Ru(t,this._c):[].concat(n),r],i=s[0],u=s.reduce((f,d)=>{const p=Ir(t,d,o);return f.top=se(p.top,f.top),f.right=ke(p.right,f.right),f.bottom=ke(p.bottom,f.bottom),f.left=se(p.left,f.left),f},Ir(t,i,o));return{width:u.right-u.left,height:u.bottom-u.top,x:u.left,y:u.top}}function ku(e){const{width:t,height:n}=Qo(e);return{width:t,height:n}}function Au(e,t,n){const r=ge(t),o=ve(t),a=n==="fixed",s=Oe(e,!0,a,t);let i={scrollLeft:0,scrollTop:0};const u=me(0);function f(){u.x=Bn(o)}if(r||!r&&!a)if((Ze(t)!=="body"||it(o))&&(i=Vt(t)),r){const g=Oe(t,!0,a,t);u.x=g.x+t.clientLeft,u.y=g.y+t.clientTop}else o&&f();a&&!r&&o&&f();const d=o&&!r&&!a?ta(o,i):me(0),p=s.left+i.scrollLeft-u.x-d.x,m=s.top+i.scrollTop-u.y-d.y;return{x:p,y:m,width:s.width,height:s.height}}function an(e){return ue(e).position==="static"}function Lr(e,t){if(!ge(e)||ue(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return ve(e)===n&&(n=n.ownerDocument.body),n}function ra(e,t){const n=ie(e);if(Ht(e))return n;if(!ge(e)){let o=Ae(e);for(;o&&!Be(o);){if(le(o)&&!an(o))return o;o=Ae(o)}return n}let r=Lr(e,t);for(;r&&gu(r)&&an(r);)r=Lr(r,t);return r&&Be(r)&&an(r)&&!zn(r)?n:r||vu(e)||n}const Pu=async function(e){const t=this.getOffsetParent||ra,n=this.getDimensions,r=await n(e.floating);return{reference:Au(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Nu(e){return ue(e).direction==="rtl"}const _u={convertOffsetParentRelativeRectToViewportRelativeRect:wu,getDocumentElement:ve,getClippingRect:Mu,getOffsetParent:ra,getElementRects:Pu,getClientRects:yu,getDimensions:ku,getScale:He,isElement:le,isRTL:Nu};function oa(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Tu(e,t){let n=null,r;const o=ve(e);function a(){var i;clearTimeout(r),(i=n)==null||i.disconnect(),n=null}function s(i,u){i===void 0&&(i=!1),u===void 0&&(u=1),a();const f=e.getBoundingClientRect(),{left:d,top:p,width:m,height:g}=f;if(i||t(),!m||!g)return;const b=St(p),h=St(o.clientWidth-(d+m)),v=St(o.clientHeight-(p+g)),x=St(d),C={rootMargin:-b+"px "+-h+"px "+-v+"px "+-x+"px",threshold:se(0,ke(1,u))||1};let S=!0;function M(T){const k=T[0].intersectionRatio;if(k!==u){if(!S)return s();k?s(!1,k):r=setTimeout(()=>{s(!1,1e-7)},1e3)}k===1&&!oa(f,e.getBoundingClientRect())&&s(),S=!1}try{n=new IntersectionObserver(M,{...C,root:o.ownerDocument})}catch{n=new IntersectionObserver(M,C)}n.observe(e)}return s(!0),a}function Ou(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:a=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:i=typeof IntersectionObserver=="function",animationFrame:u=!1}=r,f=Vn(e),d=o||a?[...f?nt(f):[],...nt(t)]:[];d.forEach(x=>{o&&x.addEventListener("scroll",n,{passive:!0}),a&&x.addEventListener("resize",n)});const p=f&&i?Tu(f,n):null;let m=-1,g=null;s&&(g=new ResizeObserver(x=>{let[y]=x;y&&y.target===f&&g&&(g.unobserve(t),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var C;(C=g)==null||C.observe(t)})),n()}),f&&!u&&g.observe(f),g.observe(t));let b,h=u?Oe(e):null;u&&v();function v(){const x=Oe(e);h&&!oa(h,x)&&n(),h=x,b=requestAnimationFrame(v)}return n(),()=>{var x;d.forEach(y=>{o&&y.removeEventListener("scroll",n),a&&y.removeEventListener("resize",n)}),p==null||p(),(x=g)==null||x.disconnect(),g=null,u&&cancelAnimationFrame(b)}}const ju=fu,Du=pu,Iu=lu,Lu=hu,Fu=uu,Fr=cu,$u=mu,zu=(e,t,n)=>{const r=new Map,o={platform:_u,...n},a={...o.platform,_c:r};return iu(e,t,{...o,platform:a})};var Hu=typeof document<"u",Vu=function(){},Mt=Hu?Z.useLayoutEffect:Vu;function _t(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,r,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!_t(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const a=o[r];if(!(a==="_owner"&&e.$$typeof)&&!_t(e[a],t[a]))return!1}return!0}return e!==e&&t!==t}function aa(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function $r(e,t){const n=aa(e);return Math.round(t*n)/n}function sn(e){const t=l.useRef(e);return Mt(()=>{t.current=e}),t}function Bu(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:a,floating:s}={},transform:i=!0,whileElementsMounted:u,open:f}=e,[d,p]=l.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[m,g]=l.useState(r);_t(m,r)||g(r);const[b,h]=l.useState(null),[v,x]=l.useState(null),y=l.useCallback(E=>{E!==T.current&&(T.current=E,h(E))},[]),C=l.useCallback(E=>{E!==k.current&&(k.current=E,x(E))},[]),S=a||b,M=s||v,T=l.useRef(null),k=l.useRef(null),R=l.useRef(d),I=u!=null,z=sn(u),U=sn(o),G=sn(f),W=l.useCallback(()=>{if(!T.current||!k.current)return;const E={placement:t,strategy:n,middleware:m};U.current&&(E.platform=U.current),zu(T.current,k.current,E).then(_=>{const w={..._,isPositioned:G.current!==!1};H.current&&!_t(R.current,w)&&(R.current=w,Gr.flushSync(()=>{p(w)}))})},[m,t,n,U,G]);Mt(()=>{f===!1&&R.current.isPositioned&&(R.current.isPositioned=!1,p(E=>({...E,isPositioned:!1})))},[f]);const H=l.useRef(!1);Mt(()=>(H.current=!0,()=>{H.current=!1}),[]),Mt(()=>{if(S&&(T.current=S),M&&(k.current=M),S&&M){if(z.current)return z.current(S,M,W);W()}},[S,M,W,z,I]);const Y=l.useMemo(()=>({reference:T,floating:k,setReference:y,setFloating:C}),[y,C]),D=l.useMemo(()=>({reference:S,floating:M}),[S,M]),V=l.useMemo(()=>{const E={position:n,left:0,top:0};if(!D.floating)return E;const _=$r(D.floating,d.x),w=$r(D.floating,d.y);return i?{...E,transform:"translate("+_+"px, "+w+"px)",...aa(D.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:_,top:w}},[n,i,D.floating,d.x,d.y]);return l.useMemo(()=>({...d,update:W,refs:Y,elements:D,floatingStyles:V}),[d,W,Y,D,V])}const Gu=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:o}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?Fr({element:r.current,padding:o}).fn(n):{}:r?Fr({element:r,padding:o}).fn(n):{}}}},Wu=(e,t)=>({...ju(e),options:[e,t]}),Uu=(e,t)=>({...Du(e),options:[e,t]}),Ku=(e,t)=>({...$u(e),options:[e,t]}),Yu=(e,t)=>({...Iu(e),options:[e,t]}),Zu=(e,t)=>({...Lu(e),options:[e,t]}),Xu=(e,t)=>({...Fu(e),options:[e,t]}),qu=(e,t)=>({...Gu(e),options:[e,t]});var Ju="Arrow",sa=l.forwardRef((e,t)=>{const{children:n,width:r=10,height:o=5,...a}=e;return c.jsx(J.svg,{...a,ref:t,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:c.jsx("polygon",{points:"0,0 30,0 15,10"})})});sa.displayName=Ju;var Qu=sa;function ed(e){const[t,n]=l.useState(void 0);return Me(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const a=o[0];let s,i;if("borderBoxSize"in a){const u=a.borderBoxSize,f=Array.isArray(u)?u[0]:u;s=f.inlineSize,i=f.blockSize}else s=e.offsetWidth,i=e.offsetHeight;n({width:s,height:i})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var Gn="Popper",[ia,Bt]=je(Gn),[td,ca]=ia(Gn),la=e=>{const{__scopePopper:t,children:n}=e,[r,o]=l.useState(null);return c.jsx(td,{scope:t,anchor:r,onAnchorChange:o,children:n})};la.displayName=Gn;var ua="PopperAnchor",da=l.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,a=ca(ua,n),s=l.useRef(null),i=te(t,s);return l.useEffect(()=>{a.onAnchorChange((r==null?void 0:r.current)||s.current)}),r?null:c.jsx(J.div,{...o,ref:i})});da.displayName=ua;var Wn="PopperContent",[nd,rd]=ia(Wn),fa=l.forwardRef((e,t)=>{var B,X,q,ae,Se,Ne;const{__scopePopper:n,side:r="bottom",sideOffset:o=0,align:a="center",alignOffset:s=0,arrowPadding:i=0,avoidCollisions:u=!0,collisionBoundary:f=[],collisionPadding:d=0,sticky:p="partial",hideWhenDetached:m=!1,updatePositionStrategy:g="optimized",onPlaced:b,...h}=e,v=ca(Wn,n),[x,y]=l.useState(null),C=te(t,Xe=>y(Xe)),[S,M]=l.useState(null),T=ed(S),k=(T==null?void 0:T.width)??0,R=(T==null?void 0:T.height)??0,I=r+(a!=="center"?"-"+a:""),z=typeof d=="number"?d:{top:0,right:0,bottom:0,left:0,...d},U=Array.isArray(f)?f:[f],G=U.length>0,W={padding:z,boundary:U.filter(ad),altBoundary:G},{refs:H,floatingStyles:Y,placement:D,isPositioned:V,middlewareData:E}=Bu({strategy:"fixed",placement:I,whileElementsMounted:(...Xe)=>Ou(...Xe,{animationFrame:g==="always"}),elements:{reference:v.anchor},middleware:[Wu({mainAxis:o+R,alignmentAxis:s}),u&&Uu({mainAxis:!0,crossAxis:!1,limiter:p==="partial"?Ku():void 0,...W}),u&&Yu({...W}),Zu({...W,apply:({elements:Xe,rects:ar,availableWidth:qs,availableHeight:Js})=>{const{width:Qs,height:ei}=ar.reference,pt=Xe.floating.style;pt.setProperty("--radix-popper-available-width",`${qs}px`),pt.setProperty("--radix-popper-available-height",`${Js}px`),pt.setProperty("--radix-popper-anchor-width",`${Qs}px`),pt.setProperty("--radix-popper-anchor-height",`${ei}px`)}}),S&&qu({element:S,padding:i}),sd({arrowWidth:k,arrowHeight:R}),m&&Xu({strategy:"referenceHidden",...W})]}),[_,w]=ha(D),O=he(b);Me(()=>{V&&(O==null||O())},[V,O]);const F=(B=E.arrow)==null?void 0:B.x,$=(X=E.arrow)==null?void 0:X.y,K=((q=E.arrow)==null?void 0:q.centerOffset)!==0,[Q,oe]=l.useState();return Me(()=>{x&&oe(window.getComputedStyle(x).zIndex)},[x]),c.jsx("div",{ref:H.setFloating,"data-radix-popper-content-wrapper":"",style:{...Y,transform:V?Y.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Q,"--radix-popper-transform-origin":[(ae=E.transformOrigin)==null?void 0:ae.x,(Se=E.transformOrigin)==null?void 0:Se.y].join(" "),...((Ne=E.hide)==null?void 0:Ne.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:c.jsx(nd,{scope:n,placedSide:_,onArrowChange:M,arrowX:F,arrowY:$,shouldHideArrow:K,children:c.jsx(J.div,{"data-side":_,"data-align":w,...h,ref:C,style:{...h.style,animation:V?void 0:"none"}})})})});fa.displayName=Wn;var pa="PopperArrow",od={top:"bottom",right:"left",bottom:"top",left:"right"},ma=l.forwardRef(function(t,n){const{__scopePopper:r,...o}=t,a=rd(pa,r),s=od[a.placedSide];return c.jsx("span",{ref:a.onArrowChange,style:{position:"absolute",left:a.arrowX,top:a.arrowY,[s]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[a.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[a.placedSide],visibility:a.shouldHideArrow?"hidden":void 0},children:c.jsx(Qu,{...o,ref:n,style:{...o.style,display:"block"}})})});ma.displayName=pa;function ad(e){return e!==null}var sd=e=>({name:"transformOrigin",options:e,fn(t){var v,x,y;const{placement:n,rects:r,middlewareData:o}=t,s=((v=o.arrow)==null?void 0:v.centerOffset)!==0,i=s?0:e.arrowWidth,u=s?0:e.arrowHeight,[f,d]=ha(n),p={start:"0%",center:"50%",end:"100%"}[d],m=(((x=o.arrow)==null?void 0:x.x)??0)+i/2,g=(((y=o.arrow)==null?void 0:y.y)??0)+u/2;let b="",h="";return f==="bottom"?(b=s?p:`${m}px`,h=`${-u}px`):f==="top"?(b=s?p:`${m}px`,h=`${r.floating.height+u}px`):f==="right"?(b=`${-u}px`,h=s?p:`${g}px`):f==="left"&&(b=`${r.floating.width+u}px`,h=s?p:`${g}px`),{data:{x:b,y:h}}}});function ha(e){const[t,n="center"]=e.split("-");return[t,n]}var Un=la,ga=da,va=fa,ba=ma,id=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"}),cd="VisuallyHidden",xa=l.forwardRef((e,t)=>c.jsx(J.span,{...e,ref:t,style:{...id,...e.style}}));xa.displayName=cd;var ld=xa,[Gt,Yp]=je("Tooltip",[Bt]),Wt=Bt(),wa="TooltipProvider",ud=700,bn="tooltip.open",[dd,Kn]=Gt(wa),ya=e=>{const{__scopeTooltip:t,delayDuration:n=ud,skipDelayDuration:r=300,disableHoverableContent:o=!1,children:a}=e,s=l.useRef(!0),i=l.useRef(!1),u=l.useRef(0);return l.useEffect(()=>{const f=u.current;return()=>window.clearTimeout(f)},[]),c.jsx(dd,{scope:t,isOpenDelayedRef:s,delayDuration:n,onOpen:l.useCallback(()=>{window.clearTimeout(u.current),s.current=!1},[]),onClose:l.useCallback(()=>{window.clearTimeout(u.current),u.current=window.setTimeout(()=>s.current=!0,r)},[r]),isPointerInTransitRef:i,onPointerInTransitChange:l.useCallback(f=>{i.current=f},[]),disableHoverableContent:o,children:a})};ya.displayName=wa;var rt="Tooltip",[fd,Ut]=Gt(rt),Ca=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:o,onOpenChange:a,disableHoverableContent:s,delayDuration:i}=e,u=Kn(rt,e.__scopeTooltip),f=Wt(t),[d,p]=l.useState(null),m=xe(),g=l.useRef(0),b=s??u.disableHoverableContent,h=i??u.delayDuration,v=l.useRef(!1),[x,y]=st({prop:r,defaultProp:o??!1,onChange:k=>{k?(u.onOpen(),document.dispatchEvent(new CustomEvent(bn))):u.onClose(),a==null||a(k)},caller:rt}),C=l.useMemo(()=>x?v.current?"delayed-open":"instant-open":"closed",[x]),S=l.useCallback(()=>{window.clearTimeout(g.current),g.current=0,v.current=!1,y(!0)},[y]),M=l.useCallback(()=>{window.clearTimeout(g.current),g.current=0,y(!1)},[y]),T=l.useCallback(()=>{window.clearTimeout(g.current),g.current=window.setTimeout(()=>{v.current=!0,y(!0),g.current=0},h)},[h,y]);return l.useEffect(()=>()=>{g.current&&(window.clearTimeout(g.current),g.current=0)},[]),c.jsx(Un,{...f,children:c.jsx(fd,{scope:t,contentId:m,open:x,stateAttribute:C,trigger:d,onTriggerChange:p,onTriggerEnter:l.useCallback(()=>{u.isOpenDelayedRef.current?T():S()},[u.isOpenDelayedRef,T,S]),onTriggerLeave:l.useCallback(()=>{b?M():(window.clearTimeout(g.current),g.current=0)},[M,b]),onOpen:S,onClose:M,disableHoverableContent:b,children:n})})};Ca.displayName=rt;var xn="TooltipTrigger",Sa=l.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=Ut(xn,n),a=Kn(xn,n),s=Wt(n),i=l.useRef(null),u=te(t,i,o.onTriggerChange),f=l.useRef(!1),d=l.useRef(!1),p=l.useCallback(()=>f.current=!1,[]);return l.useEffect(()=>()=>document.removeEventListener("pointerup",p),[p]),c.jsx(ga,{asChild:!0,...s,children:c.jsx(J.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...r,ref:u,onPointerMove:j(e.onPointerMove,m=>{m.pointerType!=="touch"&&!d.current&&!a.isPointerInTransitRef.current&&(o.onTriggerEnter(),d.current=!0)}),onPointerLeave:j(e.onPointerLeave,()=>{o.onTriggerLeave(),d.current=!1}),onPointerDown:j(e.onPointerDown,()=>{o.open&&o.onClose(),f.current=!0,document.addEventListener("pointerup",p,{once:!0})}),onFocus:j(e.onFocus,()=>{f.current||o.onOpen()}),onBlur:j(e.onBlur,o.onClose),onClick:j(e.onClick,o.onClose)})})});Sa.displayName=xn;var pd="TooltipPortal",[Zp,md]=Gt(pd,{forceMount:void 0}),Ge="TooltipContent",Ea=l.forwardRef((e,t)=>{const n=md(Ge,e.__scopeTooltip),{forceMount:r=n.forceMount,side:o="top",...a}=e,s=Ut(Ge,e.__scopeTooltip);return c.jsx(Ce,{present:r||s.open,children:s.disableHoverableContent?c.jsx(Ra,{side:o,...a,ref:t}):c.jsx(hd,{side:o,...a,ref:t})})}),hd=l.forwardRef((e,t)=>{const n=Ut(Ge,e.__scopeTooltip),r=Kn(Ge,e.__scopeTooltip),o=l.useRef(null),a=te(t,o),[s,i]=l.useState(null),{trigger:u,onClose:f}=n,d=o.current,{onPointerInTransitChange:p}=r,m=l.useCallback(()=>{i(null),p(!1)},[p]),g=l.useCallback((b,h)=>{const v=b.currentTarget,x={x:b.clientX,y:b.clientY},y=wd(x,v.getBoundingClientRect()),C=yd(x,y),S=Cd(h.getBoundingClientRect()),M=Ed([...C,...S]);i(M),p(!0)},[p]);return l.useEffect(()=>()=>m(),[m]),l.useEffect(()=>{if(u&&d){const b=v=>g(v,d),h=v=>g(v,u);return u.addEventListener("pointerleave",b),d.addEventListener("pointerleave",h),()=>{u.removeEventListener("pointerleave",b),d.removeEventListener("pointerleave",h)}}},[u,d,g,m]),l.useEffect(()=>{if(s){const b=h=>{const v=h.target,x={x:h.clientX,y:h.clientY},y=(u==null?void 0:u.contains(v))||(d==null?void 0:d.contains(v)),C=!Sd(x,s);y?m():C&&(m(),f())};return document.addEventListener("pointermove",b),()=>document.removeEventListener("pointermove",b)}},[u,d,s,f,m]),c.jsx(Ra,{...e,ref:a})}),[gd,vd]=Gt(rt,{isInside:!1}),bd=ii("TooltipContent"),Ra=l.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":o,onEscapeKeyDown:a,onPointerDownOutside:s,...i}=e,u=Ut(Ge,n),f=Wt(n),{onClose:d}=u;return l.useEffect(()=>(document.addEventListener(bn,d),()=>document.removeEventListener(bn,d)),[d]),l.useEffect(()=>{if(u.trigger){const p=m=>{const g=m.target;g!=null&&g.contains(u.trigger)&&d()};return window.addEventListener("scroll",p,{capture:!0}),()=>window.removeEventListener("scroll",p,{capture:!0})}},[u.trigger,d]),c.jsx(Lt,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:a,onPointerDownOutside:s,onFocusOutside:p=>p.preventDefault(),onDismiss:d,children:c.jsxs(va,{"data-state":u.stateAttribute,...f,...i,ref:t,style:{...i.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:[c.jsx(bd,{children:r}),c.jsx(gd,{scope:n,isInside:!0,children:c.jsx(ld,{id:u.contentId,role:"tooltip",children:o||r})})]})})});Ea.displayName=Ge;var Ma="TooltipArrow",xd=l.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=Wt(n);return vd(Ma,n).isInside?null:c.jsx(ba,{...o,...r,ref:t})});xd.displayName=Ma;function wd(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),o=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(n,r,o,a)){case a:return"left";case o:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function yd(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function Cd(e){const{top:t,right:n,bottom:r,left:o}=e;return[{x:o,y:t},{x:n,y:t},{x:n,y:r},{x:o,y:r}]}function Sd(e,t){const{x:n,y:r}=e;let o=!1;for(let a=0,s=t.length-1;a<t.length;s=a++){const i=t[a],u=t[s],f=i.x,d=i.y,p=u.x,m=u.y;d>r!=m>r&&n<(p-f)*(r-d)/(m-d)+f&&(o=!o)}return o}function Ed(e){const t=e.slice();return t.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),Rd(t)}function Rd(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const o=e[r];for(;t.length>=2;){const a=t[t.length-1],s=t[t.length-2];if((a.x-s.x)*(o.y-s.y)>=(a.y-s.y)*(o.x-s.x))t.pop();else break}t.push(o)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const o=e[r];for(;n.length>=2;){const a=n[n.length-1],s=n[n.length-2];if((a.x-s.x)*(o.y-s.y)>=(a.y-s.y)*(o.x-s.x))n.pop();else break}n.push(o)}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 Md=ya,kd=Ca,Ad=Sa,ka=Ea;const Yn=Md,Zn=kd,Xn=Ad,Kt=l.forwardRef(({className:e,sideOffset:t=4,...n},r)=>c.jsx(ka,{ref:r,sideOffset:t,className:A("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),...n}));Kt.displayName=ka.displayName;const Pd="sidebar_state",Nd=60*60*24*7,_d="16rem",Td="18rem",Od="3rem",jd="b",Aa=l.createContext(null);function ct(){const e=l.useContext(Aa);if(!e)throw new Error("useSidebar must be used within a SidebarProvider.");return e}function Pa({defaultOpen:e=!0,open:t,onOpenChange:n,className:r,style:o,children:a,...s}){const i=uo(),[u,f]=l.useState(!1),[d,p]=l.useState(e),m=t??d,g=l.useCallback(x=>{const y=typeof x=="function"?x(m):x;n?n(y):p(y),document.cookie=`${Pd}=${y}; path=/; max-age=${Nd}`},[n,m]),b=l.useCallback(()=>i?f(x=>!x):g(x=>!x),[i,g,f]);l.useEffect(()=>{const x=y=>{y.key===jd&&(y.metaKey||y.ctrlKey)&&(y.preventDefault(),b())};return window.addEventListener("keydown",x),()=>window.removeEventListener("keydown",x)},[b]);const h=m?"expanded":"collapsed",v=l.useMemo(()=>({state:h,open:m,setOpen:g,isMobile:i,openMobile:u,setOpenMobile:f,toggleSidebar:b}),[h,m,g,i,u,f,b]);return c.jsx(Aa.Provider,{value:v,children:c.jsx(Yn,{delayDuration:0,children:c.jsx("div",{"data-slot":"sidebar-wrapper",style:{"--sidebar-width":_d,"--sidebar-width-icon":Od,...o},className:A("group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex min-h-svh w-full",r),...s,children:a})})})}function Na({side:e="left",variant:t="sidebar",collapsible:n="offcanvas",className:r,children:o,...a}){const{isMobile:s,state:i,openMobile:u,setOpenMobile:f}=ct();return n==="none"?c.jsx("div",{"data-slot":"sidebar",className:A("bg-white text-sidebar-foreground flex h-full w-(--sidebar-width) flex-col",r),...a,children:o}):s?c.jsx(Ko,{open:u,onOpenChange:f,...a,children:c.jsxs(On,{"data-sidebar":"sidebar","data-slot":"sidebar","data-mobile":"true",className:"bg-white text-sidebar-foreground w-(--sidebar-width) p-0 [&>button]:hidden",style:{"--sidebar-width":Td},side:e,children:[c.jsxs(jn,{className:"sr-only",children:[c.jsx(Dn,{children:"Sidebar"}),c.jsx(In,{children:"Displays the mobile sidebar."})]}),c.jsx("div",{className:"flex h-full w-full flex-col",children:o})]})}):c.jsxs("div",{className:"group peer text-sidebar-foreground hidden md:block","data-state":i,"data-collapsible":i==="collapsed"?n:"","data-variant":t,"data-side":e,"data-slot":"sidebar",children:[c.jsx("div",{"data-slot":"sidebar-gap",className:A("relative w-(--sidebar-width) bg-white transition-[width] duration-200 ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",t==="floating"||t==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon)")}),c.jsx("div",{"data-slot":"sidebar-container",className:A("fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear md:flex",e==="left"?"left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]":"right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",t==="floating"||t==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l",r),...a,children:c.jsx("div",{"data-sidebar":"sidebar","data-slot":"sidebar-inner",className:"bg-white group-data-[variant=floating]:border-sidebar-border flex h-full w-full flex-col px-1 py-2 group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:shadow-sm",children:o})})]})}function _a({className:e,onClick:t,...n}){const{toggleSidebar:r}=ct();return c.jsxs(It,{"data-sidebar":"trigger","data-slot":"sidebar-trigger",variant:"ghost",size:"icon",className:A("size-7",e),onClick:o=>{t==null||t(o),r()},...n,children:[c.jsx(Sc,{}),c.jsx("span",{className:"sr-only",children:"Toggle Sidebar"})]})}function Ta({className:e,...t}){const{toggleSidebar:n}=ct();return c.jsx("button",{"data-sidebar":"rail","data-slot":"sidebar-rail","aria-label":"Toggle Sidebar",tabIndex:-1,onClick:n,title:"Toggle Sidebar",className:A("hover:after:bg-sidebar-border absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear group-data-[side=left]:-right-4 group-data-[side=right]:left-0 after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] sm:flex","in-data-[side=left]:cursor-w-resize in-data-[side=right]:cursor-e-resize","[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize","hover:group-data-[collapsible=offcanvas]:bg-sidebar group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full","[[data-side=left][data-collapsible=offcanvas]_&]:-right-2","[[data-side=right][data-collapsible=offcanvas]_&]:-left-2",e),...t})}function Oa({className:e,...t}){return c.jsx("main",{"data-slot":"sidebar-inset",className:A("bg-white relative flex w-full flex-1 flex-col","md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2",e),...t})}function Dd({className:e,...t}){return c.jsx(Rn,{"data-slot":"sidebar-input","data-sidebar":"input",className:A("bg-background h-8 w-full shadow-none",e),...t})}function ja({className:e,...t}){return c.jsx("div",{"data-slot":"sidebar-header","data-sidebar":"header",className:A("flex flex-col gap-2 p-2",e),...t})}function Id({className:e,...t}){return c.jsx("div",{"data-slot":"sidebar-footer","data-sidebar":"footer",className:A("flex flex-col gap-2 p-2",e),...t})}function Ld({className:e,...t}){return c.jsx(Dt,{"data-slot":"sidebar-separator","data-sidebar":"separator",className:A("bg-sidebar-border mx-2 w-auto",e),...t})}function Da({className:e,...t}){return c.jsx("div",{"data-slot":"sidebar-content","data-sidebar":"content",className:A("flex min-h-0 flex-1 flex-col overflow-auto group-data-[collapsible=icon]:overflow-hidden",e),...t})}function Ia({className:e,...t}){return c.jsx("div",{"data-slot":"sidebar-group","data-sidebar":"group",className:A("relative flex w-full min-w-0 flex-col px-2 py-1",e),...t})}function Fd({className:e,asChild:t=!1,...n}){const r=t?We:"div";return c.jsx(r,{"data-slot":"sidebar-group-label","data-sidebar":"group-label",className:A("text-sidebar-foreground/70 ring-sidebar-ring flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium outline-hidden transition-[margin,opacity] duration-200 ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0",e),...n})}function $d({className:e,asChild:t=!1,...n}){const r=t?We:"button";return c.jsx(r,{"data-slot":"sidebar-group-action","data-sidebar":"group-action",className:A("text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground absolute top-3.5 right-3 flex aspect-square w-5 items-center justify-center rounded-md p-0 outline-hidden transition-transform focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 md:after:hidden","group-data-[collapsible=icon]:hidden",e),...n})}function La({className:e,...t}){return c.jsx("div",{"data-slot":"sidebar-group-content","data-sidebar":"group-content",className:A("w-full text-sm",e),...t})}function zd({className:e,...t}){return c.jsx("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:A("flex w-full min-w-0 flex-col gap-1",e),...t})}function Hd({className:e,...t}){return c.jsx("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:A("group/menu-item relative",e),...t})}const Vd=En("peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-hidden ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-data-[sidebar=menu-action]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",{variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"},size:{default:"h-8 text-sm",sm:"h-7 text-xs",lg:"h-12 text-sm group-data-[collapsible=icon]:p-0!"}},defaultVariants:{variant:"default",size:"default"}});function Bd({asChild:e=!1,isActive:t=!1,variant:n="default",size:r="default",tooltip:o,className:a,...s}){const i=e?We:"button",{isMobile:u,state:f}=ct(),d=c.jsx(i,{"data-slot":"sidebar-menu-button","data-sidebar":"menu-button","data-size":r,"data-active":t,className:A(Vd({variant:n,size:r}),a),...s});return o?(typeof o=="string"&&(o={children:o}),c.jsxs(Zn,{children:[c.jsx(Xn,{asChild:!0,children:d}),c.jsx(Kt,{side:"right",align:"center",hidden:f!=="collapsed"||u,...o})]})):d}function Gd({className:e,asChild:t=!1,showOnHover:n=!1,...r}){const o=t?We:"button";return c.jsx(o,{"data-slot":"sidebar-menu-action","data-sidebar":"menu-action",className:A("text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground peer-hover/menu-button:text-sidebar-accent-foreground absolute top-1.5 right-1 flex aspect-square w-5 items-center justify-center rounded-md p-0 outline-hidden transition-transform focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 md:after:hidden","peer-data-[size=sm]/menu-button:top-1","peer-data-[size=default]/menu-button:top-1.5","peer-data-[size=lg]/menu-button:top-2.5","group-data-[collapsible=icon]:hidden",n&&"peer-data-[active=true]/menu-button:text-sidebar-accent-foreground group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 data-[state=open]:opacity-100 md:opacity-0",e),...r})}function Wd({className:e,...t}){return c.jsx("div",{"data-slot":"sidebar-menu-badge","data-sidebar":"menu-badge",className:A("text-sidebar-foreground pointer-events-none absolute right-1 flex h-5 min-w-5 items-center justify-center rounded-md px-1 text-xs font-medium tabular-nums select-none","peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[active=true]/menu-button:text-sidebar-accent-foreground","peer-data-[size=sm]/menu-button:top-1","peer-data-[size=default]/menu-button:top-1.5","peer-data-[size=lg]/menu-button:top-2.5","group-data-[collapsible=icon]:hidden",e),...t})}function Ud({className:e,showIcon:t=!1,...n}){const r=l.useMemo(()=>`${Math.floor(Math.random()*40)+50}%`,[]);return c.jsxs("div",{"data-slot":"sidebar-menu-skeleton","data-sidebar":"menu-skeleton",className:A("flex h-8 items-center gap-2 rounded-md px-2",e),...n,children:[t&&c.jsx(mn,{className:"size-4 rounded-md","data-sidebar":"menu-skeleton-icon"}),c.jsx(mn,{className:"h-4 max-w-(--skeleton-width) flex-1","data-sidebar":"menu-skeleton-text",style:{"--skeleton-width":r}})]})}function Fa({className:e,...t}){return c.jsx("ul",{"data-slot":"sidebar-menu-sub","data-sidebar":"menu-sub",className:A("border-sidebar-border mx-3 flex min-w-0 translate-x-px flex-col gap-1 border-l px-2.5 py-0.5","group-data-[collapsible=icon]:hidden",e),...t})}function $a({className:e,...t}){return c.jsx("li",{"data-slot":"sidebar-menu-sub-item","data-sidebar":"menu-sub-item",className:A("group/menu-sub-item relative",e),...t})}function za({asChild:e=!1,size:t="md",isActive:n=!1,className:r,...o}){const a=e?We:"a";return c.jsx(a,{"data-slot":"sidebar-menu-sub-button","data-sidebar":"menu-sub-button","data-size":t,"data-active":n,className:A("text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground active:bg-sidebar-accent active:text-sidebar-accent-foreground [&>svg]:text-sidebar-accent-foreground flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 outline-hidden focus-visible:ring-2 disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0","data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground",t==="sm"&&"text-xs",t==="md"&&"text-sm","group-data-[collapsible=icon]:hidden",r),...o})}function Ha(e){const t=e+"CollectionProvider",[n,r]=je(t),[o,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),s=h=>{const{scope:v,children:x}=h,y=Z.useRef(null),C=Z.useRef(new Map).current;return c.jsx(o,{scope:v,itemMap:C,collectionRef:y,children:x})};s.displayName=t;const i=e+"CollectionSlot",u=Ve(i),f=Z.forwardRef((h,v)=>{const{scope:x,children:y}=h,C=a(i,x),S=te(v,C.collectionRef);return c.jsx(u,{ref:S,children:y})});f.displayName=i;const d=e+"CollectionItemSlot",p="data-radix-collection-item",m=Ve(d),g=Z.forwardRef((h,v)=>{const{scope:x,children:y,...C}=h,S=Z.useRef(null),M=te(v,S),T=a(d,x);return Z.useEffect(()=>(T.itemMap.set(S,{ref:S,...C}),()=>void T.itemMap.delete(S))),c.jsx(m,{[p]:"",ref:M,children:y})});g.displayName=d;function b(h){const v=a(e+"CollectionConsumer",h);return Z.useCallback(()=>{const y=v.collectionRef.current;if(!y)return[];const C=Array.from(y.querySelectorAll(`[${p}]`));return Array.from(v.itemMap.values()).sort((T,k)=>C.indexOf(T.ref.current)-C.indexOf(k.ref.current))},[v.collectionRef,v.itemMap])}return[{Provider:s,Slot:f,ItemSlot:g},b,r]}var Kd=l.createContext(void 0);function Va(e){const t=l.useContext(Kd);return e||t||"ltr"}var cn="rovingFocusGroup.onEntryFocus",Yd={bubbles:!1,cancelable:!0},lt="RovingFocusGroup",[wn,Ba,Zd]=Ha(lt),[Xd,Ga]=je(lt,[Zd]),[qd,Jd]=Xd(lt),Wa=l.forwardRef((e,t)=>c.jsx(wn.Provider,{scope:e.__scopeRovingFocusGroup,children:c.jsx(wn.Slot,{scope:e.__scopeRovingFocusGroup,children:c.jsx(Qd,{...e,ref:t})})}));Wa.displayName=lt;var Qd=l.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:o=!1,dir:a,currentTabStopId:s,defaultCurrentTabStopId:i,onCurrentTabStopIdChange:u,onEntryFocus:f,preventScrollOnEntryFocus:d=!1,...p}=e,m=l.useRef(null),g=te(t,m),b=Va(a),[h,v]=st({prop:s,defaultProp:i??null,onChange:u,caller:lt}),[x,y]=l.useState(!1),C=he(f),S=Ba(n),M=l.useRef(!1),[T,k]=l.useState(0);return l.useEffect(()=>{const R=m.current;if(R)return R.addEventListener(cn,C),()=>R.removeEventListener(cn,C)},[C]),c.jsx(qd,{scope:n,orientation:r,dir:b,loop:o,currentTabStopId:h,onItemFocus:l.useCallback(R=>v(R),[v]),onItemShiftTab:l.useCallback(()=>y(!0),[]),onFocusableItemAdd:l.useCallback(()=>k(R=>R+1),[]),onFocusableItemRemove:l.useCallback(()=>k(R=>R-1),[]),children:c.jsx(J.div,{tabIndex:x||T===0?-1:0,"data-orientation":r,...p,ref:g,style:{outline:"none",...e.style},onMouseDown:j(e.onMouseDown,()=>{M.current=!0}),onFocus:j(e.onFocus,R=>{const I=!M.current;if(R.target===R.currentTarget&&I&&!x){const z=new CustomEvent(cn,Yd);if(R.currentTarget.dispatchEvent(z),!z.defaultPrevented){const U=S().filter(D=>D.focusable),G=U.find(D=>D.active),W=U.find(D=>D.id===h),Y=[G,W,...U].filter(Boolean).map(D=>D.ref.current);Ya(Y,d)}}M.current=!1}),onBlur:j(e.onBlur,()=>y(!1))})})}),Ua="RovingFocusGroupItem",Ka=l.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:a,children:s,...i}=e,u=xe(),f=a||u,d=Jd(Ua,n),p=d.currentTabStopId===f,m=Ba(n),{onFocusableItemAdd:g,onFocusableItemRemove:b,currentTabStopId:h}=d;return l.useEffect(()=>{if(r)return g(),()=>b()},[r,g,b]),c.jsx(wn.ItemSlot,{scope:n,id:f,focusable:r,active:o,children:c.jsx(J.span,{tabIndex:p?0:-1,"data-orientation":d.orientation,...i,ref:t,onMouseDown:j(e.onMouseDown,v=>{r?d.onItemFocus(f):v.preventDefault()}),onFocus:j(e.onFocus,()=>d.onItemFocus(f)),onKeyDown:j(e.onKeyDown,v=>{if(v.key==="Tab"&&v.shiftKey){d.onItemShiftTab();return}if(v.target!==v.currentTarget)return;const x=nf(v,d.orientation,d.dir);if(x!==void 0){if(v.metaKey||v.ctrlKey||v.altKey||v.shiftKey)return;v.preventDefault();let C=m().filter(S=>S.focusable).map(S=>S.ref.current);if(x==="last")C.reverse();else if(x==="prev"||x==="next"){x==="prev"&&C.reverse();const S=C.indexOf(v.currentTarget);C=d.loop?rf(C,S+1):C.slice(S+1)}setTimeout(()=>Ya(C))}}),children:typeof s=="function"?s({isCurrentTabStop:p,hasTabStop:h!=null}):s})})});Ka.displayName=Ua;var ef={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function tf(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function nf(e,t,n){const r=tf(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return ef[r]}function Ya(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function rf(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var of=Wa,af=Ka,yn=["Enter"," "],sf=["ArrowDown","PageUp","Home"],Za=["ArrowUp","PageDown","End"],cf=[...sf,...Za],lf={ltr:[...yn,"ArrowRight"],rtl:[...yn,"ArrowLeft"]},uf={ltr:["ArrowLeft"],rtl:["ArrowRight"]},ut="Menu",[ot,df,ff]=Ha(ut),[De,Xa]=je(ut,[ff,Bt,Ga]),dt=Bt(),qa=Ga(),[Ja,Pe]=De(ut),[pf,ft]=De(ut),Qa=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:o,onOpenChange:a,modal:s=!0}=e,i=dt(t),[u,f]=l.useState(null),d=l.useRef(!1),p=he(a),m=Va(o);return l.useEffect(()=>{const g=()=>{d.current=!0,document.addEventListener("pointerdown",b,{capture:!0,once:!0}),document.addEventListener("pointermove",b,{capture:!0,once:!0})},b=()=>d.current=!1;return document.addEventListener("keydown",g,{capture:!0}),()=>{document.removeEventListener("keydown",g,{capture:!0}),document.removeEventListener("pointerdown",b,{capture:!0}),document.removeEventListener("pointermove",b,{capture:!0})}},[]),c.jsx(Un,{...i,children:c.jsx(Ja,{scope:t,open:n,onOpenChange:p,content:u,onContentChange:f,children:c.jsx(pf,{scope:t,onClose:l.useCallback(()=>p(!1),[p]),isUsingKeyboardRef:d,dir:m,modal:s,children:r})})})};Qa.displayName=ut;var mf="MenuAnchor",qn=l.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=dt(n);return c.jsx(ga,{...o,...r,ref:t})});qn.displayName=mf;var Jn="MenuPortal",[hf,es]=De(Jn,{forceMount:void 0}),ts=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:o}=e,a=Pe(Jn,t);return c.jsx(hf,{scope:t,forceMount:n,children:c.jsx(Ce,{present:n||a.open,children:c.jsx(kn,{asChild:!0,container:o,children:r})})})};ts.displayName=Jn;var ce="MenuContent",[gf,Qn]=De(ce),ns=l.forwardRef((e,t)=>{const n=es(ce,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,a=Pe(ce,e.__scopeMenu),s=ft(ce,e.__scopeMenu);return c.jsx(ot.Provider,{scope:e.__scopeMenu,children:c.jsx(Ce,{present:r||a.open,children:c.jsx(ot.Slot,{scope:e.__scopeMenu,children:s.modal?c.jsx(vf,{...o,ref:t}):c.jsx(bf,{...o,ref:t})})})})}),vf=l.forwardRef((e,t)=>{const n=Pe(ce,e.__scopeMenu),r=l.useRef(null),o=te(t,r);return l.useEffect(()=>{const a=r.current;if(a)return Ro(a)},[]),c.jsx(er,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:j(e.onFocusOutside,a=>a.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),bf=l.forwardRef((e,t)=>{const n=Pe(ce,e.__scopeMenu);return c.jsx(er,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),xf=Ve("MenuContent.ScrollLock"),er=l.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:o,onOpenAutoFocus:a,onCloseAutoFocus:s,disableOutsidePointerEvents:i,onEntryFocus:u,onEscapeKeyDown:f,onPointerDownOutside:d,onFocusOutside:p,onInteractOutside:m,onDismiss:g,disableOutsideScroll:b,...h}=e,v=Pe(ce,n),x=ft(ce,n),y=dt(n),C=qa(n),S=df(n),[M,T]=l.useState(null),k=l.useRef(null),R=te(t,k,v.onContentChange),I=l.useRef(0),z=l.useRef(""),U=l.useRef(0),G=l.useRef(null),W=l.useRef("right"),H=l.useRef(0),Y=b?An:l.Fragment,D=b?{as:xf,allowPinchZoom:!0}:void 0,V=_=>{var B,X;const w=z.current+_,O=S().filter(q=>!q.disabled),F=document.activeElement,$=(B=O.find(q=>q.ref.current===F))==null?void 0:B.textValue,K=O.map(q=>q.textValue),Q=_f(K,w,$),oe=(X=O.find(q=>q.textValue===Q))==null?void 0:X.ref.current;(function q(ae){z.current=ae,window.clearTimeout(I.current),ae!==""&&(I.current=window.setTimeout(()=>q(""),1e3))})(w),oe&&setTimeout(()=>oe.focus())};l.useEffect(()=>()=>window.clearTimeout(I.current),[]),go();const E=l.useCallback(_=>{var O,F;return W.current===((O=G.current)==null?void 0:O.side)&&Of(_,(F=G.current)==null?void 0:F.area)},[]);return c.jsx(gf,{scope:n,searchRef:z,onItemEnter:l.useCallback(_=>{E(_)&&_.preventDefault()},[E]),onItemLeave:l.useCallback(_=>{var w;E(_)||((w=k.current)==null||w.focus(),T(null))},[E]),onTriggerLeave:l.useCallback(_=>{E(_)&&_.preventDefault()},[E]),pointerGraceTimerRef:U,onPointerGraceIntentChange:l.useCallback(_=>{G.current=_},[]),children:c.jsx(Y,{...D,children:c.jsx(Mn,{asChild:!0,trapped:o,onMountAutoFocus:j(a,_=>{var w;_.preventDefault(),(w=k.current)==null||w.focus({preventScroll:!0})}),onUnmountAutoFocus:s,children:c.jsx(Lt,{asChild:!0,disableOutsidePointerEvents:i,onEscapeKeyDown:f,onPointerDownOutside:d,onFocusOutside:p,onInteractOutside:m,onDismiss:g,children:c.jsx(of,{asChild:!0,...C,dir:x.dir,orientation:"vertical",loop:r,currentTabStopId:M,onCurrentTabStopIdChange:T,onEntryFocus:j(u,_=>{x.isUsingKeyboardRef.current||_.preventDefault()}),preventScrollOnEntryFocus:!0,children:c.jsx(va,{role:"menu","aria-orientation":"vertical","data-state":xs(v.open),"data-radix-menu-content":"",dir:x.dir,...y,...h,ref:R,style:{outline:"none",...h.style},onKeyDown:j(h.onKeyDown,_=>{const O=_.target.closest("[data-radix-menu-content]")===_.currentTarget,F=_.ctrlKey||_.altKey||_.metaKey,$=_.key.length===1;O&&(_.key==="Tab"&&_.preventDefault(),!F&&$&&V(_.key));const K=k.current;if(_.target!==K||!cf.includes(_.key))return;_.preventDefault();const oe=S().filter(B=>!B.disabled).map(B=>B.ref.current);Za.includes(_.key)&&oe.reverse(),Pf(oe)}),onBlur:j(e.onBlur,_=>{_.currentTarget.contains(_.target)||(window.clearTimeout(I.current),z.current="")}),onPointerMove:j(e.onPointerMove,at(_=>{const w=_.target,O=H.current!==_.clientX;if(_.currentTarget.contains(w)&&O){const F=_.clientX>H.current?"right":"left";W.current=F,H.current=_.clientX}}))})})})})})})});ns.displayName=ce;var wf="MenuGroup",tr=l.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return c.jsx(J.div,{role:"group",...r,ref:t})});tr.displayName=wf;var yf="MenuLabel",rs=l.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return c.jsx(J.div,{...r,ref:t})});rs.displayName=yf;var Tt="MenuItem",zr="menu.itemSelect",Yt=l.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...o}=e,a=l.useRef(null),s=ft(Tt,e.__scopeMenu),i=Qn(Tt,e.__scopeMenu),u=te(t,a),f=l.useRef(!1),d=()=>{const p=a.current;if(!n&&p){const m=new CustomEvent(zr,{bubbles:!0,cancelable:!0});p.addEventListener(zr,g=>r==null?void 0:r(g),{once:!0}),Ur(p,m),m.defaultPrevented?f.current=!1:s.onClose()}};return c.jsx(os,{...o,ref:u,disabled:n,onClick:j(e.onClick,d),onPointerDown:p=>{var m;(m=e.onPointerDown)==null||m.call(e,p),f.current=!0},onPointerUp:j(e.onPointerUp,p=>{var m;f.current||(m=p.currentTarget)==null||m.click()}),onKeyDown:j(e.onKeyDown,p=>{const m=i.searchRef.current!=="";n||m&&p.key===" "||yn.includes(p.key)&&(p.currentTarget.click(),p.preventDefault())})})});Yt.displayName=Tt;var os=l.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:o,...a}=e,s=Qn(Tt,n),i=qa(n),u=l.useRef(null),f=te(t,u),[d,p]=l.useState(!1),[m,g]=l.useState("");return l.useEffect(()=>{const b=u.current;b&&g((b.textContent??"").trim())},[a.children]),c.jsx(ot.ItemSlot,{scope:n,disabled:r,textValue:o??m,children:c.jsx(af,{asChild:!0,...i,focusable:!r,children:c.jsx(J.div,{role:"menuitem","data-highlighted":d?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...a,ref:f,onPointerMove:j(e.onPointerMove,at(b=>{r?s.onItemLeave(b):(s.onItemEnter(b),b.defaultPrevented||b.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:j(e.onPointerLeave,at(b=>s.onItemLeave(b))),onFocus:j(e.onFocus,()=>p(!0)),onBlur:j(e.onBlur,()=>p(!1))})})})}),Cf="MenuCheckboxItem",as=l.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...o}=e;return c.jsx(us,{scope:e.__scopeMenu,checked:n,children:c.jsx(Yt,{role:"menuitemcheckbox","aria-checked":Ot(n)?"mixed":n,...o,ref:t,"data-state":or(n),onSelect:j(o.onSelect,()=>r==null?void 0:r(Ot(n)?!0:!n),{checkForDefaultPrevented:!1})})})});as.displayName=Cf;var ss="MenuRadioGroup",[Sf,Ef]=De(ss,{value:void 0,onValueChange:()=>{}}),is=l.forwardRef((e,t)=>{const{value:n,onValueChange:r,...o}=e,a=he(r);return c.jsx(Sf,{scope:e.__scopeMenu,value:n,onValueChange:a,children:c.jsx(tr,{...o,ref:t})})});is.displayName=ss;var cs="MenuRadioItem",ls=l.forwardRef((e,t)=>{const{value:n,...r}=e,o=Ef(cs,e.__scopeMenu),a=n===o.value;return c.jsx(us,{scope:e.__scopeMenu,checked:a,children:c.jsx(Yt,{role:"menuitemradio","aria-checked":a,...r,ref:t,"data-state":or(a),onSelect:j(r.onSelect,()=>{var s;return(s=o.onValueChange)==null?void 0:s.call(o,n)},{checkForDefaultPrevented:!1})})})});ls.displayName=cs;var nr="MenuItemIndicator",[us,Rf]=De(nr,{checked:!1}),ds=l.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...o}=e,a=Rf(nr,n);return c.jsx(Ce,{present:r||Ot(a.checked)||a.checked===!0,children:c.jsx(J.span,{...o,ref:t,"data-state":or(a.checked)})})});ds.displayName=nr;var Mf="MenuSeparator",fs=l.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return c.jsx(J.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});fs.displayName=Mf;var kf="MenuArrow",ps=l.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=dt(n);return c.jsx(ba,{...o,...r,ref:t})});ps.displayName=kf;var rr="MenuSub",[Af,ms]=De(rr),hs=e=>{const{__scopeMenu:t,children:n,open:r=!1,onOpenChange:o}=e,a=Pe(rr,t),s=dt(t),[i,u]=l.useState(null),[f,d]=l.useState(null),p=he(o);return l.useEffect(()=>(a.open===!1&&p(!1),()=>p(!1)),[a.open,p]),c.jsx(Un,{...s,children:c.jsx(Ja,{scope:t,open:r,onOpenChange:p,content:f,onContentChange:d,children:c.jsx(Af,{scope:t,contentId:xe(),triggerId:xe(),trigger:i,onTriggerChange:u,children:n})})})};hs.displayName=rr;var et="MenuSubTrigger",gs=l.forwardRef((e,t)=>{const n=Pe(et,e.__scopeMenu),r=ft(et,e.__scopeMenu),o=ms(et,e.__scopeMenu),a=Qn(et,e.__scopeMenu),s=l.useRef(null),{pointerGraceTimerRef:i,onPointerGraceIntentChange:u}=a,f={__scopeMenu:e.__scopeMenu},d=l.useCallback(()=>{s.current&&window.clearTimeout(s.current),s.current=null},[]);return l.useEffect(()=>d,[d]),l.useEffect(()=>{const p=i.current;return()=>{window.clearTimeout(p),u(null)}},[i,u]),c.jsx(qn,{asChild:!0,...f,children:c.jsx(os,{id:o.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":o.contentId,"data-state":xs(n.open),...e,ref:jt(t,o.onTriggerChange),onClick:p=>{var m;(m=e.onClick)==null||m.call(e,p),!(e.disabled||p.defaultPrevented)&&(p.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:j(e.onPointerMove,at(p=>{a.onItemEnter(p),!p.defaultPrevented&&!e.disabled&&!n.open&&!s.current&&(a.onPointerGraceIntentChange(null),s.current=window.setTimeout(()=>{n.onOpenChange(!0),d()},100))})),onPointerLeave:j(e.onPointerLeave,at(p=>{var g,b;d();const m=(g=n.content)==null?void 0:g.getBoundingClientRect();if(m){const h=(b=n.content)==null?void 0:b.dataset.side,v=h==="right",x=v?-5:5,y=m[v?"left":"right"],C=m[v?"right":"left"];a.onPointerGraceIntentChange({area:[{x:p.clientX+x,y:p.clientY},{x:y,y:m.top},{x:C,y:m.top},{x:C,y:m.bottom},{x:y,y:m.bottom}],side:h}),window.clearTimeout(i.current),i.current=window.setTimeout(()=>a.onPointerGraceIntentChange(null),300)}else{if(a.onTriggerLeave(p),p.defaultPrevented)return;a.onPointerGraceIntentChange(null)}})),onKeyDown:j(e.onKeyDown,p=>{var g;const m=a.searchRef.current!=="";e.disabled||m&&p.key===" "||lf[r.dir].includes(p.key)&&(n.onOpenChange(!0),(g=n.content)==null||g.focus(),p.preventDefault())})})})});gs.displayName=et;var vs="MenuSubContent",bs=l.forwardRef((e,t)=>{const n=es(ce,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,a=Pe(ce,e.__scopeMenu),s=ft(ce,e.__scopeMenu),i=ms(vs,e.__scopeMenu),u=l.useRef(null),f=te(t,u);return c.jsx(ot.Provider,{scope:e.__scopeMenu,children:c.jsx(Ce,{present:r||a.open,children:c.jsx(ot.Slot,{scope:e.__scopeMenu,children:c.jsx(er,{id:i.contentId,"aria-labelledby":i.triggerId,...o,ref:f,align:"start",side:s.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:d=>{var p;s.isUsingKeyboardRef.current&&((p=u.current)==null||p.focus()),d.preventDefault()},onCloseAutoFocus:d=>d.preventDefault(),onFocusOutside:j(e.onFocusOutside,d=>{d.target!==i.trigger&&a.onOpenChange(!1)}),onEscapeKeyDown:j(e.onEscapeKeyDown,d=>{s.onClose(),d.preventDefault()}),onKeyDown:j(e.onKeyDown,d=>{var g;const p=d.currentTarget.contains(d.target),m=uf[s.dir].includes(d.key);p&&m&&(a.onOpenChange(!1),(g=i.trigger)==null||g.focus(),d.preventDefault())})})})})})});bs.displayName=vs;function xs(e){return e?"open":"closed"}function Ot(e){return e==="indeterminate"}function or(e){return Ot(e)?"indeterminate":e?"checked":"unchecked"}function Pf(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function Nf(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function _f(e,t,n){const o=t.length>1&&Array.from(t).every(f=>f===t[0])?t[0]:t,a=n?e.indexOf(n):-1;let s=Nf(e,Math.max(a,0));o.length===1&&(s=s.filter(f=>f!==n));const u=s.find(f=>f.toLowerCase().startsWith(o.toLowerCase()));return u!==n?u:void 0}function Tf(e,t){const{x:n,y:r}=e;let o=!1;for(let a=0,s=t.length-1;a<t.length;s=a++){const i=t[a],u=t[s],f=i.x,d=i.y,p=u.x,m=u.y;d>r!=m>r&&n<(p-f)*(r-d)/(m-d)+f&&(o=!o)}return o}function Of(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return Tf(n,t)}function at(e){return t=>t.pointerType==="mouse"?e(t):void 0}var jf=Qa,Df=qn,If=ts,Lf=ns,Ff=tr,$f=rs,zf=Yt,Hf=as,Vf=is,Bf=ls,Gf=ds,Wf=fs,Uf=ps,Kf=hs,Yf=gs,Zf=bs,Zt="DropdownMenu",[Xf,Xp]=je(Zt,[Xa]),re=Xa(),[qf,ws]=Xf(Zt),ys=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:o,defaultOpen:a,onOpenChange:s,modal:i=!0}=e,u=re(t),f=l.useRef(null),[d,p]=st({prop:o,defaultProp:a??!1,onChange:s,caller:Zt});return c.jsx(qf,{scope:t,triggerId:xe(),triggerRef:f,contentId:xe(),open:d,onOpenChange:p,onOpenToggle:l.useCallback(()=>p(m=>!m),[p]),modal:i,children:c.jsx(jf,{...u,open:d,onOpenChange:p,dir:r,modal:i,children:n})})};ys.displayName=Zt;var Cs="DropdownMenuTrigger",Ss=l.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...o}=e,a=ws(Cs,n),s=re(n);return c.jsx(Df,{asChild:!0,...s,children:c.jsx(J.button,{type:"button",id:a.triggerId,"aria-haspopup":"menu","aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":a.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...o,ref:jt(t,a.triggerRef),onPointerDown:j(e.onPointerDown,i=>{!r&&i.button===0&&i.ctrlKey===!1&&(a.onOpenToggle(),a.open||i.preventDefault())}),onKeyDown:j(e.onKeyDown,i=>{r||(["Enter"," "].includes(i.key)&&a.onOpenToggle(),i.key==="ArrowDown"&&a.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(i.key)&&i.preventDefault())})})})});Ss.displayName=Cs;var Jf="DropdownMenuPortal",Es=e=>{const{__scopeDropdownMenu:t,...n}=e,r=re(t);return c.jsx(If,{...r,...n})};Es.displayName=Jf;var Rs="DropdownMenuContent",Ms=l.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=ws(Rs,n),a=re(n),s=l.useRef(!1);return c.jsx(Lf,{id:o.contentId,"aria-labelledby":o.triggerId,...a,...r,ref:t,onCloseAutoFocus:j(e.onCloseAutoFocus,i=>{var u;s.current||(u=o.triggerRef.current)==null||u.focus(),s.current=!1,i.preventDefault()}),onInteractOutside:j(e.onInteractOutside,i=>{const u=i.detail.originalEvent,f=u.button===0&&u.ctrlKey===!0,d=u.button===2||f;(!o.modal||d)&&(s.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});Ms.displayName=Rs;var Qf="DropdownMenuGroup",ks=l.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=re(n);return c.jsx(Ff,{...o,...r,ref:t})});ks.displayName=Qf;var ep="DropdownMenuLabel",As=l.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=re(n);return c.jsx($f,{...o,...r,ref:t})});As.displayName=ep;var tp="DropdownMenuItem",Ps=l.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=re(n);return c.jsx(zf,{...o,...r,ref:t})});Ps.displayName=tp;var np="DropdownMenuCheckboxItem",Ns=l.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=re(n);return c.jsx(Hf,{...o,...r,ref:t})});Ns.displayName=np;var rp="DropdownMenuRadioGroup",_s=l.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=re(n);return c.jsx(Vf,{...o,...r,ref:t})});_s.displayName=rp;var op="DropdownMenuRadioItem",Ts=l.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=re(n);return c.jsx(Bf,{...o,...r,ref:t})});Ts.displayName=op;var ap="DropdownMenuItemIndicator",Os=l.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=re(n);return c.jsx(Gf,{...o,...r,ref:t})});Os.displayName=ap;var sp="DropdownMenuSeparator",js=l.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=re(n);return c.jsx(Wf,{...o,...r,ref:t})});js.displayName=sp;var ip="DropdownMenuArrow",cp=l.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=re(n);return c.jsx(Uf,{...o,...r,ref:t})});cp.displayName=ip;var lp=e=>{const{__scopeDropdownMenu:t,children:n,open:r,onOpenChange:o,defaultOpen:a}=e,s=re(t),[i,u]=st({prop:r,defaultProp:a??!1,onChange:o,caller:"DropdownMenuSub"});return c.jsx(Kf,{...s,open:i,onOpenChange:u,children:n})},up="DropdownMenuSubTrigger",Ds=l.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=re(n);return c.jsx(Yf,{...o,...r,ref:t})});Ds.displayName=up;var dp="DropdownMenuSubContent",Is=l.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=re(n);return c.jsx(Zf,{...o,...r,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});Is.displayName=dp;var fp=ys,pp=Ss,Ls=Es,mp=Ms,hp=ks,gp=As,vp=Ps,bp=Ns,xp=_s,wp=Ts,Fs=Os,yp=js,Cp=lp,Sp=Ds,Ep=Is;function $s({...e}){return c.jsx(fp,{"data-slot":"dropdown-menu",...e})}function Rp({...e}){return c.jsx(Ls,{"data-slot":"dropdown-menu-portal",...e})}function zs({...e}){return c.jsx(pp,{"data-slot":"dropdown-menu-trigger",...e})}function Hs({className:e,sideOffset:t=4,...n}){return c.jsx(Ls,{children:c.jsx(mp,{"data-slot":"dropdown-menu-content",sideOffset:t,className:A("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-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 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",e),...n})})}function Mp({...e}){return c.jsx(hp,{"data-slot":"dropdown-menu-group",...e})}function Cn({className:e,inset:t,variant:n="default",...r}){return c.jsx(vp,{"data-slot":"dropdown-menu-item","data-inset":t,"data-variant":n,className:A("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...r})}function kp({className:e,children:t,checked:n,...r}){return c.jsxs(bp,{"data-slot":"dropdown-menu-checkbox-item",className:A("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),checked:n,...r,children:[c.jsx("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:c.jsx(Fs,{children:c.jsx(dc,{className:"size-4"})})}),t]})}function Ap({...e}){return c.jsx(xp,{"data-slot":"dropdown-menu-radio-group",...e})}function Pp({className:e,children:t,...n}){return c.jsxs(wp,{"data-slot":"dropdown-menu-radio-item",className:A("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...n,children:[c.jsx("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:c.jsx(Fs,{children:c.jsx(bc,{className:"size-2 fill-current"})})}),t]})}function Vs({className:e,inset:t,...n}){return c.jsx(gp,{"data-slot":"dropdown-menu-label","data-inset":t,className:A("px-2 py-1.5 text-sm font-medium data-[inset]:pl-8",e),...n})}function Bs({className:e,...t}){return c.jsx(yp,{"data-slot":"dropdown-menu-separator",className:A("bg-border -mx-1 my-1 h-px",e),...t})}function Np({className:e,...t}){return c.jsx("span",{"data-slot":"dropdown-menu-shortcut",className:A("text-muted-foreground ml-auto text-xs tracking-widest",e),...t})}function _p({...e}){return c.jsx(Cp,{"data-slot":"dropdown-menu-sub",...e})}function Tp({className:e,inset:t,children:n,...r}){return c.jsxs(Sp,{"data-slot":"dropdown-menu-sub-trigger","data-inset":t,className:A("focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex cursor-default items-center rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[inset]:pl-8",e),...r,children:[n,c.jsx(co,{className:"ml-auto size-4"})]})}function Op({className:e,...t}){return c.jsx(Ep,{"data-slot":"dropdown-menu-sub-content",className:A("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-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 z-50 min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg",e),...t})}const Gs=({onLogout:e})=>{const{user:t,error:n,isLoading:r}=Vr.useUser(),o=async()=>{try{e&&await e(),window.location.href="/auth/logout"}catch(a){console.error("Error during logout:",a),window.location.href="/auth/logout"}};return r?c.jsx("div",{className:"h-10 w-10 animate-pulse rounded-full bg-gray-200"}):n?c.jsxs("div",{children:["Error: ",n.message]}):t?c.jsx("div",{className:"relative flex items-center gap-3",children:c.jsxs($s,{children:[c.jsx(zs,{asChild:!0,children:c.jsx(It,{variant:"ghost",size:"lg",className:"rounded-full cursor-pointer p-0",children:t.picture?c.jsx("img",{src:t.picture,alt:t.name||"User profile",width:40,height:40,className:"rounded-full"}):c.jsx(xr,{className:"h-5 w-5 text-gray-500"})})}),c.jsxs(Hs,{align:"end",className:"w-72",children:[c.jsx(Vs,{children:c.jsx("div",{className:"flex flex-col space-y-1",children:c.jsxs("div",{className:"flex flex-col space-y-1",children:[c.jsx("p",{className:"text-xs text-gray-500",children:t.name}),c.jsx("p",{className:"truncate text-xs text-gray-500",children:t.email})]})})}),c.jsx(Bs,{}),c.jsx(Cn,{asChild:!0,children:c.jsxs("a",{href:"/profile",className:"flex w-full cursor-default",children:[c.jsx(xr,{className:"mr-2 h-4 w-4"}),c.jsx("span",{children:"Profile"})]})}),c.jsxs(Cn,{onClick:o,children:[c.jsx(yc,{className:"mr-2 h-4 w-4"}),c.jsx("span",{children:"Sign out"})]})]})]})}):null},Ws=({onLogout:e})=>c.jsx("div",{className:"sticky top-0 z-50 bg-white",children:c.jsxs("header",{className:"flex h-16 items-center justify-between border-b bg-white px-4",children:[c.jsxs("div",{className:"flex h-full items-center gap-4 flex-1 min-w-0 overflow-hidden",children:[c.jsx(_a,{}),c.jsx(Dt,{orientation:"vertical"})]}),c.jsx("div",{className:"flex-shrink-0",children:c.jsx(Gs,{onLogout:e})})]})});function jp({className:e,...t}){return c.jsx("div",{"data-slot":"card",className:A("bg-card text-card-foreground flex flex-col gap-4 rounded-xl py-6 shadow-sm",e),...t})}function Dp({className:e,...t}){return c.jsx("div",{"data-slot":"card-header",className:A("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-1 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",e),...t})}function Ip({className:e,...t}){return c.jsx("div",{"data-slot":"card-title",className:A("leading-none font-semibold",e),...t})}function Lp({className:e,...t}){return c.jsx("div",{"data-slot":"card-description",className:A("text-muted-foreground text-sm",e),...t})}function Fp({className:e,...t}){return c.jsx("div",{"data-slot":"card-action",className:A("col-start-2 row-span-2 row-start-1 self-start justify-self-end",e),...t})}function $p({className:e,...t}){return c.jsx("div",{"data-slot":"card-content",className:A("px-6",e),...t})}function zp({className:e,...t}){return c.jsx("div",{"data-slot":"card-footer",className:A("flex items-center px-6 [.border-t]:pt-6",e),...t})}function Us({title:e,url:t,children:n,defaultOpen:r=!1,icon:o,isActive:a=!1,className:s,disabled:i=!1}){const[u,f]=l.useState(r);l.useEffect(()=>{a&&f(!0)},[a]);const d=!i&&t;return c.jsx(Ia,{className:s,children:c.jsxs("div",{className:"flex flex-col",children:[c.jsxs("div",{className:"flex flex-row items-center justify-between",children:[d?c.jsxs("a",{href:t,className:A("flex flex-1 cursor-pointer items-center gap-2 rounded-lg p-2 transition-colors hover:bg-gray-100"),children:[o&&c.jsx("span",{className:A("text-gray-600"),children:o}),c.jsx("span",{className:A("text-gray-600"),children:e})]}):c.jsxs("div",{className:A("flex flex-1 items-center gap-2 rounded-lg p-2",i&&"cursor-default"),children:[o&&c.jsx("span",{className:A("text-gray-600"),children:o}),c.jsx("span",{className:A("text-gray-600"),children:e})]}),c.jsx("button",{type:"button",className:A("mr-3 rounded-lg p-2 text-gray-500",i?"cursor-default opacity-50":"hover:bg-gray-100 hover:text-gray-700"),onClick:p=>{p.preventDefault(),p.stopPropagation(),i||f(!u)},disabled:i,"aria-label":u?"Collapse section":"Expand section",children:u?c.jsx(pc,{className:"h-4 w-4"}):c.jsx(co,{className:"h-4 w-4"})})]}),c.jsx("div",{className:A("overflow-hidden transition-all",u&&!i?"max-h-96":"max-h-0"),children:n})]})})}const Hp="data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20141%2060'%3e%3cpath%20d='M0.059%2019.711V59.673H19.509V49.95H9.779V19.711H0.059Z'%20fill='%2385B9D1'%3e%3c/path%3e%3cpath%20d='M0%200L0.056%204.915V19.715H9.776V9.715H19.5V59.673H29.22V0H0Z'%20fill='%23F68029'%3e%3c/path%3e%3cpath%20d='M23.49%2019.717H9.776V29.439H23.49V19.717Z'%20fill='%23F68029'%3e%3c/path%3e%3cpath%20d='M0.0580006%2019.718L9.785%2029.445V19.718H0.0580006Z'%20fill='%230A3763'%3e%3c/path%3e%3cpath%20d='M9.777%2049.953L19.504%2059.679V49.953H9.777Z'%20fill='%230A3763'%3e%3c/path%3e%3cpath%20d='M50.213%2021.331C50.1839%2019.244%2050.325%2017.1581%2050.635%2015.094C50.8293%2013.6891%2051.2694%2012.3294%2051.935%2011.077C52.4295%2010.1519%2053.1979%209.4023%2054.135%208.93101C55.1033%208.49691%2056.1561%208.28375%2057.217%208.307C58.2628%208.27673%2059.3024%208.47715%2060.262%208.894C61.1441%209.33605%2061.8541%2010.059%2062.28%2010.949C62.8725%2012.1976%2063.2507%2013.5369%2063.399%2014.911C63.6554%2016.9922%2063.7717%2019.0882%2063.747%2021.185C63.7759%2023.338%2063.6421%2025.4901%2063.347%2027.623C63.1657%2029.0675%2062.7378%2030.4702%2062.082%2031.77C61.6022%2032.7122%2060.8471%2033.4862%2059.917%2033.989C58.9503%2034.4507%2057.888%2034.6768%2056.817%2034.649C55.7687%2034.6771%2054.7258%2034.4896%2053.753%2034.098C52.8534%2033.6775%2052.1275%2032.9579%2051.699%2032.062C51.0884%2030.7803%2050.7037%2029.4027%2050.562%2027.99C50.3018%2025.7802%2050.1852%2023.5559%2050.213%2021.331ZM54.913%2022.248C54.913%2023.6913%2054.9377%2024.9267%2054.987%2025.954C55.0147%2026.8043%2055.1127%2027.6509%2055.28%2028.485C55.3666%2029.0149%2055.5877%2029.5138%2055.922%2029.934C56.0643%2030.0868%2056.238%2030.207%2056.4312%2030.2862C56.6244%2030.3655%2056.8324%2030.4019%2057.041%2030.393C57.25%2030.3964%2057.4571%2030.3533%2057.6473%2030.2668C57.8375%2030.1803%2058.0062%2030.0526%2058.141%2029.893C58.4964%2029.4241%2058.7297%2028.8744%2058.82%2028.293C59.0025%2027.3609%2059.1128%2026.4161%2059.15%2025.467C59.2107%2024.3177%2059.2414%2022.936%2059.242%2021.322C59.242%2019.732%2059.224%2018.3747%2059.188%2017.25C59.169%2016.3373%2059.0736%2015.4278%2058.903%2014.531C58.8198%2013.9744%2058.5923%2013.4493%2058.243%2013.008C58.0929%2012.8491%2057.9104%2012.7244%2057.7078%2012.6422C57.5053%2012.5601%2057.2874%2012.5225%2057.069%2012.532C56.8667%2012.5304%2056.6668%2012.576%2056.4852%2012.6652C56.3036%2012.7544%2056.1453%2012.8848%2056.023%2013.046C55.6766%2013.5389%2055.4446%2014.103%2055.344%2014.697C55.1442%2015.6885%2055.0277%2016.695%2054.996%2017.706C54.9347%2018.9533%2054.904%2020.4697%2054.904%2022.255'%20fill='%230A3763'%3e%3c/path%3e%3cpath%20d='M83.329%2021.331C83.2999%2019.244%2083.441%2017.1581%2083.751%2015.094C83.9453%2013.6891%2084.3854%2012.3294%2085.051%2011.077C85.5455%2010.1519%2086.3139%209.40235%2087.251%208.93105C89.2087%208.112%2091.4106%208.09871%2093.378%208.89405C94.2601%209.33609%2094.9701%2010.0591%2095.396%2010.949C95.9885%2012.1976%2096.3667%2013.537%2096.515%2014.911C96.7714%2016.9922%2096.8877%2019.0883%2096.863%2021.185C96.8919%2023.3381%2096.7581%2025.4902%2096.463%2027.6231C96.2817%2029.0676%2095.8538%2030.4703%2095.198%2031.77C94.7182%2032.7123%2093.9631%2033.4862%2093.033%2033.989C92.0663%2034.4507%2091.004%2034.6769%2089.933%2034.649C88.8847%2034.6772%2087.8418%2034.4896%2086.869%2034.098C85.9694%2033.6775%2085.2435%2032.9579%2084.815%2032.062C84.2044%2030.7803%2083.8197%2029.4027%2083.678%2027.99C83.4178%2025.7803%2083.3012%2023.5559%2083.329%2021.331ZM88.029%2022.2481C88.029%2023.6914%2088.0537%2024.9267%2088.103%2025.954C88.1307%2026.8044%2088.2287%2027.6509%2088.396%2028.4851C88.4826%2029.015%2088.7037%2029.5139%2089.038%2029.934C89.1803%2030.0869%2089.354%2030.207%2089.5472%2030.2863C89.7404%2030.3655%2089.9484%2030.4019%2090.157%2030.393C90.366%2030.3964%2090.573%2030.3533%2090.7633%2030.2669C90.9535%2030.1804%2091.1222%2030.0527%2091.257%2029.893C91.6124%2029.4242%2091.8458%2028.8744%2091.936%2028.2931C92.1185%2027.3609%2092.2288%2026.4161%2092.266%2025.467C92.3267%2024.3177%2092.3574%2022.936%2092.358%2021.322C92.358%2019.732%2092.34%2018.3747%2092.304%2017.2501C92.2887%2016.3329%2092.1964%2015.4187%2092.028%2014.517C91.9448%2013.9605%2091.7173%2013.4354%2091.368%2012.994C91.2162%2012.8368%2091.0323%2012.7141%2090.8289%2012.6343C90.6255%2012.5544%2090.4072%2012.5192%2090.189%2012.531C89.9867%2012.5294%2089.7868%2012.575%2089.6052%2012.6643C89.4236%2012.7535%2089.2653%2012.8839%2089.143%2013.045C88.7966%2013.5379%2088.5646%2014.102%2088.464%2014.6961C88.2642%2015.6876%2088.1477%2016.6941%2088.116%2017.705C88.0547%2018.9524%2088.024%2020.4687%2088.024%2022.254'%20fill='%230A3763'%3e%3c/path%3e%3cpath%20d='M131.349%2034.65V8.32202H135.458V30.797H140.631V34.649L131.349%2034.65Z'%20fill='%230A3763'%3e%3c/path%3e%3cpath%20d='M71.95%2034.65V8.33203H76.059V30.796H81.232V34.648L71.95%2034.65Z'%20fill='%230A3763'%3e%3c/path%3e%3cpath%20d='M104.833%2014.692C104.934%2014.098%20105.166%2013.534%20105.512%2013.041C105.634%2012.8798%20105.793%2012.7494%20105.974%2012.6602C106.156%2012.571%20106.356%2012.5253%20106.558%2012.527H110.103V8.30798H106.703C105.642%208.2848%20104.589%208.49794%20103.621%208.93197C102.684%209.40306%20101.915%2010.1527%20101.421%2011.078C100.756%2012.3304%20100.316%2013.6901%20100.121%2015.095C99.8114%2017.1591%2099.6706%2019.245%2099.7%2021.332C99.6722%2023.5568%2099.7885%2025.7811%20100.048%2027.991C100.19%2029.4037%20100.574%2030.7812%20101.185%2032.063C101.614%2032.9584%20102.34%2033.6778%20103.239%2034.099C104.212%2034.4899%20105.255%2034.6771%20106.303%2034.649L110.103%2034.613V30.393H106.522C106.313%2030.402%20106.105%2030.3657%20105.912%2030.2866C105.719%2030.2076%20105.545%2030.0876%20105.403%2029.935C105.069%2029.5144%20104.848%2029.0152%20104.761%2028.485C104.594%2027.6509%20104.496%2026.8043%20104.468%2025.954C104.419%2024.9266%20104.394%2023.6916%20104.394%2022.249C104.394%2020.4636%20104.425%2018.9473%20104.486%2017.7C104.518%2016.6894%20104.633%2015.6832%20104.833%2014.692Z'%20fill='%230A3763'%3e%3c/path%3e%3cpath%20d='M46.728%2019.247H42.878V30.395H41.828C41.6182%2030.4039%2041.409%2030.3669%2041.2149%2030.2868C41.0208%2030.2067%2040.8465%2030.0853%2040.704%2029.931C40.3695%2029.5106%2040.1485%2029.0113%2040.062%2028.481C39.894%2027.647%2039.7956%2026.8004%2039.768%2025.95C39.7187%2024.9227%2039.6944%2023.6877%2039.695%2022.245C39.695%2020.4597%2039.7257%2018.9434%2039.787%2017.696C39.8191%2016.6854%2039.9355%2015.6792%2040.135%2014.688C40.2357%2014.094%2040.4677%2013.53%2040.814%2013.037C40.9376%2012.8768%2041.0968%2012.7476%2041.2791%2012.6598C41.4614%2012.5719%2041.6617%2012.5278%2041.864%2012.531H45.904V8.31202H42.012C40.9511%208.28877%2039.8983%208.50191%2038.93%208.93601C37.9927%209.40699%2037.2241%2010.1567%2036.73%2011.082C36.0644%2012.3344%2035.6243%2013.6941%2035.43%2015.099C35.1189%2017.1613%2034.9764%2019.2456%2035.004%2021.331C34.9762%2023.5559%2035.0925%2025.7802%2035.352%2027.99C35.494%2029.4026%2035.8787%2030.7802%2036.489%2032.062C36.9179%2032.9579%2037.6442%2033.6775%2038.544%2034.098C39.517%2034.4891%2040.5598%2034.6763%2041.608%2034.648L43.587%2034.629H46.727L46.728%2019.247Z'%20fill='%230A3763'%3e%3c/path%3e%3cpath%20d='M123.653%2029.87H118L116.691%2034.65H112.797L120.939%208L128.793%2034.65H124.856L123.653%2029.87ZM122.587%2026.212L120.893%2019.982L119.085%2026.212H122.587Z'%20fill='%230A3763'%3e%3c/path%3e%3cpath%20d='M39.016%2041.436H37.059V54.507H39.016V41.436Z'%20fill='%230A3763'%3e%3c/path%3e%3cpath%20d='M44.559%2041.436H46.384L48.331%2046.651C48.919%2048.1937%2049.4198%2049.7682%2049.831%2051.367C49.6744%2050.357%2049.5584%2049.4427%2049.483%2048.624C49.4077%2047.8054%2049.37%2047.0347%2049.37%2046.312V41.436H51.336V54.511H49.495L47.303%2048.627C47.103%2048.0797%2046.9134%2047.518%2046.734%2046.942C46.5547%2046.366%2046.39%2045.762%2046.24%2045.13C46.2274%2045.0507%2046.207%2044.9547%2046.179%2044.842C46.151%2044.7293%2046.1177%2044.5997%2046.079%2044.453C46.098%2044.6%2046.114%2044.725%2046.126%2044.829C46.138%2044.933%2046.148%2045.022%2046.154%2045.095L46.254%2046.424L46.354%2048.041C46.36%2048.131%2046.365%2048.241%2046.368%2048.371C46.371%2048.501%2046.368%2048.648%2046.368%2048.811L46.468%2054.511H44.559V41.436Z'%20fill='%230A3763'%3e%3c/path%3e%3cpath%20d='M55.493%2041.436H61.861V42.977H59.67V54.511H57.751V42.977H55.493V41.436Z'%20fill='%230A3763'%3e%3c/path%3e%3cpath%20d='M65.828%2041.436H71.028V42.926H67.787V47.065H70.665V48.555H67.787V53.016H71.028V54.506H65.828V41.436Z'%20fill='%230A3763'%3e%3c/path%3e%3cpath%20d='M75.906%2041.436H78.483C79.3332%2041.3696%2080.1787%2041.6132%2080.863%2042.122C81.2131%2042.4774%2081.4826%2042.904%2081.6531%2043.3729C81.8236%2043.8417%2081.8911%2044.3418%2081.851%2044.839C81.8876%2045.6248%2081.7066%2046.4055%2081.328%2047.095C81.1685%2047.3665%2080.9531%2047.6008%2080.696%2047.7826C80.4389%2047.9643%2080.1461%2048.0892%2079.837%2048.149L82.509%2054.507H80.525L77.863%2048.107V54.507H75.906V41.436ZM77.863%2047.227C78.1485%2047.2893%2078.4451%2047.279%2078.7256%2047.1969C79.0061%2047.1148%2079.2615%2046.9637%2079.4684%2046.7573C79.6753%2046.5509%2079.8271%2046.2959%2079.9098%2046.0156C79.9926%2045.7353%2080.0036%2045.4387%2079.942%2045.153C79.9472%2044.8034%2079.9137%2044.4543%2079.842%2044.112C79.7909%2043.8589%2079.6851%2043.62%2079.532%2043.412C79.3909%2043.2304%2079.2018%2043.0918%2078.986%2043.012C78.7308%2042.9221%2078.4615%2042.8791%2078.191%2042.885H77.862L77.863%2047.227Z'%20fill='%230A3763'%3e%3c/path%3e%3cpath%20d='M90.046%2041.06L85.913%2054.514H87.745L88.45%2051.974H91.496L92.135%2054.531H94.028L90.046%2041.06ZM88.876%2050.403L90.013%2046.703L91.048%2050.415L88.876%2050.403Z'%20fill='%230A3763'%3e%3c/path%3e%3cpath%20d='M106.344%2041.436H112.712V42.977H110.52V54.511H108.602V42.977H106.344V41.436Z'%20fill='%230A3763'%3e%3c/path%3e%3cpath%20d='M118.865%2041.462H116.908V54.533H118.865V41.462Z'%20fill='%230A3763'%3e%3c/path%3e%3cpath%20d='M134.181%2041.462H139.381V42.952H136.136V47.093H139.014V48.583H136.136V53.044H139.381V54.534H134.181V41.462Z'%20fill='%230A3763'%3e%3c/path%3e%3cpath%20d='M99.749%2044.338C99.8046%2044.0109%2099.9338%2043.7008%20100.127%2043.431C100.202%2043.3322%20100.3%2043.2523%20100.411%2043.1976C100.523%2043.1429%20100.646%2043.115%20100.77%2043.116H102.464V41.207H100.846C100.318%2041.1955%2099.7949%2041.3011%2099.313%2041.516C98.8543%2041.748%2098.4782%2042.1157%2098.236%2042.569C97.9008%2043.2016%2097.6788%2043.888%2097.58%2044.597C97.4215%2045.6561%2097.3493%2046.7263%2097.364%2047.797C97.3503%2048.9393%2097.4101%2050.0814%2097.543%2051.216C97.6145%2051.9294%2097.808%2052.6252%2098.115%2053.273C98.3244%2053.7086%2098.6776%2054.0586%2099.115%2054.264C99.6001%2054.458%20100.12%2054.5509%20100.642%2054.537L102.469%2054.52V52.61H100.755C100.629%2052.6147%20100.503%2052.592%20100.386%2052.5435C100.269%2052.495%20100.164%2052.4218%20100.078%2052.329C99.8888%2052.0951%2099.7637%2051.816%2099.715%2051.519C99.6273%2051.081%2099.5758%2050.6365%2099.561%2050.19C99.536%2049.66%2099.523%2049.014%2099.523%2048.27C99.523%2047.349%2099.539%2046.557%2099.57%2045.916C99.5873%2045.3865%2099.6485%2044.8594%2099.753%2044.34'%20fill='%230A3763'%3e%3c/path%3e%3cpath%20d='M128.799%2041.466L126.671%2048.91L124.671%2041.466H122.679L126.654%2054.953L130.774%2041.466H128.799Z'%20fill='%230A3763'%3e%3c/path%3e%3c/svg%3e";function Ks(){const[e,t]=Z.useState("");return Z.useEffect(()=>{t(window.location.pathname);const r=()=>{t(window.location.pathname)},o=()=>{t(window.location.pathname)};return window.addEventListener("popstate",r),window.addEventListener("pushstate",o),window.addEventListener("replacestate",o),()=>{window.removeEventListener("popstate",r),window.removeEventListener("pushstate",o),window.removeEventListener("replacestate",o)}},[]),{currentPath:e,isActiveRoute:r=>!!(e===r||r!=="/"&&e.startsWith(r))}}const Ys=Z.createContext(void 0),Zs=()=>{const e=Z.useContext(Ys);if(e===void 0)throw new Error("usePermissions must be used within PermissionsProvider");return e};function Vp({children:e,fetchPermissionsEndpoint:t="/api/auth/permissions",initialPermissions:n}){typeof window<"u"&&console.log("[PermissionsProvider] Initial permissions:",n);const[r,o]=Z.useState(n||{essentialInsights:!1,priceMonster:!1,web:!1}),[a,s]=Z.useState(!n),[i,u]=Z.useState(null),f=async()=>{try{s(!0),u(null);const d=await fetch(t);if(!d.ok)throw new Error(`Failed to fetch permissions: ${d.statusText}`);const p=await d.json();o(p)}catch(d){console.error("Error fetching product access:",d),u(d instanceof Error?d:new Error("Unknown error"))}finally{s(!1)}};return Z.useEffect(()=>{n||f()},[n]),c.jsx(Ys.Provider,{value:{permissions:r,loading:a,error:i,fetchPermissions:f},children:e})}const Bp={navMain:[{title:"Essential Insights",key:"essentialInsights",url:"/essential-insights/overall-performance",icon:c.jsx(lc,{className:"h-5 w-5"}),items:[{title:"Overall Performance",url:"/essential-insights/overall-performance",icon:c.jsx(lo,{className:"h-4 w-4"})},{title:"Organic Performance",url:"/essential-insights/organic-performance",icon:c.jsx(br,{className:"h-4 w-4"})},{title:"Paid Performance",url:"/essential-insights/paid-performance",icon:c.jsx(sc,{className:"h-4 w-4"})},{title:"Keyword Performance",url:"/essential-insights/keyword-performance",icon:c.jsx(br,{className:"h-4 w-4"})},{title:"More Components",url:"/essential-insights/more-components",icon:c.jsx(vt,{className:"h-4 w-4"})}]},{title:"Price Monster",key:"priceMonster",url:"/price-monster",icon:c.jsx(gc,{className:"h-4 w-4"}),items:[{title:"Dashboard",url:"/price-monster/dashboard",icon:c.jsx(vt,{className:"h-4 w-4"})},{title:"Documentation",url:"/price-monster/documentation",icon:c.jsx(tc,{className:"h-4 w-4"})},{title:"Subscriptions",url:"/price-monster/subscriptions",icon:c.jsx(rc,{className:"h-4 w-4"})}]},{title:"CMS",key:"web",url:"/cms",icon:c.jsx(vt,{className:"h-4 w-4"}),items:[{title:"Dashboard",url:"/cms/dashboard",icon:c.jsx(vt,{className:"h-4 w-4"})}]}]};function Xs({...e}){const{isActiveRoute:t}=Ks(),n=Zs();return c.jsxs(Na,{...e,children:[c.jsx(ja,{children:c.jsx("div",{className:"relative h-12 w-32 overflow-hidden",children:c.jsx("img",{src:Hp,alt:"GLI Logo",className:"h-full w-full object-contain"})})}),c.jsxs(Da,{children:[c.jsx("div",{className:"relative flex w-full min-w-0 flex-col px-2 py-1",children:c.jsxs("a",{href:"/",className:A("flex cursor-pointer items-center gap-2 rounded-lg px-2 py-2 transition-colors hover:bg-gray-100",t("/")&&"bg-blue-50 text-gli-bluedark font-medium"),children:[c.jsx(lo,{className:A("h-5 w-5",t("/")?"text-gli-bluedark":"text-gray-500")}),c.jsx("span",{children:"Home"})]})}),c.jsx(Yn,{delayDuration:150,children:Bp.navMain.map(r=>{const o=!r.key||n[r.key],a=o&&(t(r.url)||r.items.some(i=>t(i.url))),s=c.jsx(Us,{url:o?r.url:void 0,title:r.title,icon:r.icon,isActive:!!a,disabled:!o,className:A(!o&&"opacity-50"),children:o&&c.jsx(La,{children:c.jsx(Fa,{children:r.items.map(i=>{const u=t(i.url);return c.jsx($a,{children:c.jsx(za,{asChild:!0,children:c.jsxs("a",{href:i.url,className:A("flex items-center gap-2 pl-4 transition-colors text-muted-foreground hover:bg-muted hover:text-foreground",u&&"bg-blue-50 text-gli-bluedark font-medium"),children:[c.jsx("span",{className:A(u?"text-gli-bluedark":"text-muted-foreground"),children:i.icon}),c.jsx("span",{className:A(u?"text-gli-bluedark":"text-muted-foreground"),children:i.title})]})})},i.title)})})})},r.title);return r.key==="priceMonster"&&!o?c.jsxs(Zn,{children:[c.jsx(Xn,{asChild:!0,children:c.jsx("div",{children:s})}),c.jsx(Kt,{side:"top",align:"center",children:"Coming soon"})]},r.title):s})})]}),c.jsx(Ta,{})]})}async function Gp(){var e,t,n,r;try{const o=await ti.accessToken();if(!o||o==="No token available")return{essentialInsights:!1,web:!1,priceMonster:!1};const s=(e=ni.jwtDecode(o)["https://cloud.golocal.com/org_metadata"])==null?void 0:e.metadata;return{essentialInsights:((t=s==null?void 0:s["essential-insights"])==null?void 0:t.enabled)===!0,web:((n=s==null?void 0:s.web)==null?void 0:n.enabled)===!0,priceMonster:((r=s==null?void 0:s["price-monster"])==null?void 0:r.enabled)===!0}}catch(o){return console.error("Error getting user permissions:",o),{essentialInsights:!1,web:!1,priceMonster:!1}}}const Wp=({children:e,onLogout:t})=>c.jsx(Vr.Auth0Provider,{children:c.jsx(Pa,{children:c.jsxs("div",{className:"flex h-screen w-full",children:[c.jsx(Xs,{}),c.jsxs(Oa,{className:"flex-1 flex flex-col min-w-0",children:[c.jsx(Ws,{onLogout:t}),c.jsx("main",{className:"flex-1 bg-white overflow-auto",id:"page-content",children:e})]})]})})});exports.AppHeader=Ws;exports.AppSidebar=Xs;exports.Button=It;exports.Card=jp;exports.CardAction=Fp;exports.CardContent=$p;exports.CardDescription=Lp;exports.CardFooter=zp;exports.CardHeader=Dp;exports.CardTitle=Ip;exports.CollapsibleSection=Us;exports.DropdownMenu=$s;exports.DropdownMenuCheckboxItem=kp;exports.DropdownMenuContent=Hs;exports.DropdownMenuGroup=Mp;exports.DropdownMenuItem=Cn;exports.DropdownMenuLabel=Vs;exports.DropdownMenuPortal=Rp;exports.DropdownMenuRadioGroup=Ap;exports.DropdownMenuRadioItem=Pp;exports.DropdownMenuSeparator=Bs;exports.DropdownMenuShortcut=Np;exports.DropdownMenuSub=_p;exports.DropdownMenuSubContent=Op;exports.DropdownMenuSubTrigger=Tp;exports.DropdownMenuTrigger=zs;exports.GLICloudProvider=Wp;exports.Input=Rn;exports.PermissionsProvider=Vp;exports.ProfileDropdown=Gs;exports.Separator=Dt;exports.Sheet=Ko;exports.SheetClose=ql;exports.SheetContent=On;exports.SheetDescription=In;exports.SheetFooter=Zo;exports.SheetHeader=jn;exports.SheetOverlay=Tn;exports.SheetPortal=Yo;exports.SheetTitle=Dn;exports.SheetTrigger=Xl;exports.Sidebar=Na;exports.SidebarContent=Da;exports.SidebarFooter=Id;exports.SidebarGroup=Ia;exports.SidebarGroupAction=$d;exports.SidebarGroupContent=La;exports.SidebarGroupLabel=Fd;exports.SidebarHeader=ja;exports.SidebarInput=Dd;exports.SidebarInset=Oa;exports.SidebarMenu=zd;exports.SidebarMenuAction=Gd;exports.SidebarMenuBadge=Wd;exports.SidebarMenuButton=Bd;exports.SidebarMenuItem=Hd;exports.SidebarMenuSkeleton=Ud;exports.SidebarMenuSub=Fa;exports.SidebarMenuSubButton=za;exports.SidebarMenuSubItem=$a;exports.SidebarProvider=Pa;exports.SidebarRail=Ta;exports.SidebarSeparator=Ld;exports.SidebarTrigger=_a;exports.Skeleton=mn;exports.Tooltip=Zn;exports.TooltipContent=Kt;exports.TooltipProvider=Yn;exports.TooltipTrigger=Xn;exports.buttonVariants=fo;exports.getUserPermissions=Gp;exports.useActiveRoute=Ks;exports.useIsMobile=uo;exports.usePermissions=Zs;exports.useSidebar=ct;
|
|
166
|
+
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return l.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},Wl="DialogDescriptionWarning",Ul=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Ho(Wl).contentName}}.`;return l.useEffect(()=>{var a;const o=(a=e.current)==null?void 0:a.getAttribute("aria-describedby");t&&o&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},Kl=ko,Yl=Po,Zl=_o,Vo=To,Bo=Oo,Go=Do,Wo=Lo,Uo=$o;const Ko=Kl,Xl=Yl,ql=Uo,Yo=Zl,Tn=l.forwardRef(({className:e,...t},n)=>c.jsx(Vo,{className:A("fixed inset-0 z-50 bg-background/80 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t,ref:n}));Tn.displayName=Vo.displayName;const Jl=En("fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500",{variants:{side:{top:"inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",bottom:"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",left:"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",right:"inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"}},defaultVariants:{side:"right"}}),On=l.forwardRef(({side:e="right",className:t,children:n,...r},o)=>c.jsxs(Yo,{children:[c.jsx(Tn,{}),c.jsxs(Bo,{ref:o,className:A(Jl({side:e}),t),...r,children:[n,c.jsxs(Uo,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary",children:[c.jsx(Mc,{className:"h-4 w-4"}),c.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));On.displayName=Bo.displayName;const jn=({className:e,...t})=>c.jsx("div",{className:A("flex flex-col space-y-2 text-center sm:text-left",e),...t});jn.displayName="SheetHeader";const Zo=({className:e,...t})=>c.jsx("div",{className:A("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});Zo.displayName="SheetFooter";const Dn=l.forwardRef(({className:e,...t},n)=>c.jsx(Go,{ref:n,className:A("text-lg font-semibold text-foreground",e),...t}));Dn.displayName=Go.displayName;const In=l.forwardRef(({className:e,...t},n)=>c.jsx(Wo,{ref:n,className:A("text-sm text-muted-foreground",e),...t}));In.displayName=Wo.displayName;function mn({className:e,...t}){return c.jsx("div",{className:A("animate-pulse rounded-md bg-muted",e),...t})}const Ql=["top","right","bottom","left"],ke=Math.min,se=Math.max,At=Math.round,St=Math.floor,me=e=>({x:e,y:e}),eu={left:"right",right:"left",bottom:"top",top:"bottom"},tu={start:"end",end:"start"};function hn(e,t,n){return se(e,ke(t,n))}function we(e,t){return typeof e=="function"?e(t):e}function ye(e){return e.split("-")[0]}function Ye(e){return e.split("-")[1]}function Ln(e){return e==="x"?"y":"x"}function Fn(e){return e==="y"?"height":"width"}function pe(e){return["top","bottom"].includes(ye(e))?"y":"x"}function $n(e){return Ln(pe(e))}function nu(e,t,n){n===void 0&&(n=!1);const r=Ye(e),o=$n(e),a=Fn(o);let s=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[a]>t.floating[a]&&(s=Pt(s)),[s,Pt(s)]}function ru(e){const t=Pt(e);return[gn(e),t,gn(t)]}function gn(e){return e.replace(/start|end/g,t=>tu[t])}function ou(e,t,n){const r=["left","right"],o=["right","left"],a=["top","bottom"],s=["bottom","top"];switch(e){case"top":case"bottom":return n?t?o:r:t?r:o;case"left":case"right":return t?a:s;default:return[]}}function au(e,t,n,r){const o=Ye(e);let a=ou(ye(e),n==="start",r);return o&&(a=a.map(s=>s+"-"+o),t&&(a=a.concat(a.map(gn)))),a}function Pt(e){return e.replace(/left|right|bottom|top/g,t=>eu[t])}function su(e){return{top:0,right:0,bottom:0,left:0,...e}}function Xo(e){return typeof e!="number"?su(e):{top:e,right:e,bottom:e,left:e}}function Nt(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function Tr(e,t,n){let{reference:r,floating:o}=e;const a=pe(t),s=$n(t),i=Fn(s),u=ye(t),f=a==="y",d=r.x+r.width/2-o.width/2,p=r.y+r.height/2-o.height/2,m=r[i]/2-o[i]/2;let g;switch(u){case"top":g={x:d,y:r.y-o.height};break;case"bottom":g={x:d,y:r.y+r.height};break;case"right":g={x:r.x+r.width,y:p};break;case"left":g={x:r.x-o.width,y:p};break;default:g={x:r.x,y:r.y}}switch(Ye(t)){case"start":g[s]-=m*(n&&f?-1:1);break;case"end":g[s]+=m*(n&&f?-1:1);break}return g}const iu=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:a=[],platform:s}=n,i=a.filter(Boolean),u=await(s.isRTL==null?void 0:s.isRTL(t));let f=await s.getElementRects({reference:e,floating:t,strategy:o}),{x:d,y:p}=Tr(f,r,u),m=r,g={},b=0;for(let h=0;h<i.length;h++){const{name:v,fn:x}=i[h],{x:y,y:C,data:S,reset:M}=await x({x:d,y:p,initialPlacement:r,placement:m,strategy:o,middlewareData:g,rects:f,platform:s,elements:{reference:e,floating:t}});d=y??d,p=C??p,g={...g,[v]:{...g[v],...S}},M&&b<=50&&(b++,typeof M=="object"&&(M.placement&&(m=M.placement),M.rects&&(f=M.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:o}):M.rects),{x:d,y:p}=Tr(f,m,u)),h=-1)}return{x:d,y:p,placement:m,strategy:o,middlewareData:g}};async function tt(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:a,rects:s,elements:i,strategy:u}=e,{boundary:f="clippingAncestors",rootBoundary:d="viewport",elementContext:p="floating",altBoundary:m=!1,padding:g=0}=we(t,e),b=Xo(g),v=i[m?p==="floating"?"reference":"floating":p],x=Nt(await a.getClippingRect({element:(n=await(a.isElement==null?void 0:a.isElement(v)))==null||n?v:v.contextElement||await(a.getDocumentElement==null?void 0:a.getDocumentElement(i.floating)),boundary:f,rootBoundary:d,strategy:u})),y=p==="floating"?{x:r,y:o,width:s.floating.width,height:s.floating.height}:s.reference,C=await(a.getOffsetParent==null?void 0:a.getOffsetParent(i.floating)),S=await(a.isElement==null?void 0:a.isElement(C))?await(a.getScale==null?void 0:a.getScale(C))||{x:1,y:1}:{x:1,y:1},M=Nt(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:i,rect:y,offsetParent:C,strategy:u}):y);return{top:(x.top-M.top+b.top)/S.y,bottom:(M.bottom-x.bottom+b.bottom)/S.y,left:(x.left-M.left+b.left)/S.x,right:(M.right-x.right+b.right)/S.x}}const cu=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:a,platform:s,elements:i,middlewareData:u}=t,{element:f,padding:d=0}=we(e,t)||{};if(f==null)return{};const p=Xo(d),m={x:n,y:r},g=$n(o),b=Fn(g),h=await s.getDimensions(f),v=g==="y",x=v?"top":"left",y=v?"bottom":"right",C=v?"clientHeight":"clientWidth",S=a.reference[b]+a.reference[g]-m[g]-a.floating[b],M=m[g]-a.reference[g],T=await(s.getOffsetParent==null?void 0:s.getOffsetParent(f));let k=T?T[C]:0;(!k||!await(s.isElement==null?void 0:s.isElement(T)))&&(k=i.floating[C]||a.floating[b]);const R=S/2-M/2,I=k/2-h[b]/2-1,z=ke(p[x],I),U=ke(p[y],I),G=z,W=k-h[b]-U,H=k/2-h[b]/2+R,Y=hn(G,H,W),D=!u.arrow&&Ye(o)!=null&&H!==Y&&a.reference[b]/2-(H<G?z:U)-h[b]/2<0,V=D?H<G?H-G:H-W:0;return{[g]:m[g]+V,data:{[g]:Y,centerOffset:H-Y-V,...D&&{alignmentOffset:V}},reset:D}}}),lu=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:a,rects:s,initialPlacement:i,platform:u,elements:f}=t,{mainAxis:d=!0,crossAxis:p=!0,fallbackPlacements:m,fallbackStrategy:g="bestFit",fallbackAxisSideDirection:b="none",flipAlignment:h=!0,...v}=we(e,t);if((n=a.arrow)!=null&&n.alignmentOffset)return{};const x=ye(o),y=pe(i),C=ye(i)===i,S=await(u.isRTL==null?void 0:u.isRTL(f.floating)),M=m||(C||!h?[Pt(i)]:ru(i)),T=b!=="none";!m&&T&&M.push(...au(i,h,b,S));const k=[i,...M],R=await tt(t,v),I=[];let z=((r=a.flip)==null?void 0:r.overflows)||[];if(d&&I.push(R[x]),p){const H=nu(o,s,S);I.push(R[H[0]],R[H[1]])}if(z=[...z,{placement:o,overflows:I}],!I.every(H=>H<=0)){var U,G;const H=(((U=a.flip)==null?void 0:U.index)||0)+1,Y=k[H];if(Y&&(!(p==="alignment"?y!==pe(Y):!1)||z.every(E=>E.overflows[0]>0&&pe(E.placement)===y)))return{data:{index:H,overflows:z},reset:{placement:Y}};let D=(G=z.filter(V=>V.overflows[0]<=0).sort((V,E)=>V.overflows[1]-E.overflows[1])[0])==null?void 0:G.placement;if(!D)switch(g){case"bestFit":{var W;const V=(W=z.filter(E=>{if(T){const _=pe(E.placement);return _===y||_==="y"}return!0}).map(E=>[E.placement,E.overflows.filter(_=>_>0).reduce((_,w)=>_+w,0)]).sort((E,_)=>E[1]-_[1])[0])==null?void 0:W[0];V&&(D=V);break}case"initialPlacement":D=i;break}if(o!==D)return{reset:{placement:D}}}return{}}}};function Or(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function jr(e){return Ql.some(t=>e[t]>=0)}const uu=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=we(e,t);switch(r){case"referenceHidden":{const a=await tt(t,{...o,elementContext:"reference"}),s=Or(a,n.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:jr(s)}}}case"escaped":{const a=await tt(t,{...o,altBoundary:!0}),s=Or(a,n.floating);return{data:{escapedOffsets:s,escaped:jr(s)}}}default:return{}}}}};async function du(e,t){const{placement:n,platform:r,elements:o}=e,a=await(r.isRTL==null?void 0:r.isRTL(o.floating)),s=ye(n),i=Ye(n),u=pe(n)==="y",f=["left","top"].includes(s)?-1:1,d=a&&u?-1:1,p=we(t,e);let{mainAxis:m,crossAxis:g,alignmentAxis:b}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return i&&typeof b=="number"&&(g=i==="end"?b*-1:b),u?{x:g*d,y:m*f}:{x:m*f,y:g*d}}const fu=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:a,placement:s,middlewareData:i}=t,u=await du(t,e);return s===((n=i.offset)==null?void 0:n.placement)&&(r=i.arrow)!=null&&r.alignmentOffset?{}:{x:o+u.x,y:a+u.y,data:{...u,placement:s}}}}},pu=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:a=!0,crossAxis:s=!1,limiter:i={fn:v=>{let{x,y}=v;return{x,y}}},...u}=we(e,t),f={x:n,y:r},d=await tt(t,u),p=pe(ye(o)),m=Ln(p);let g=f[m],b=f[p];if(a){const v=m==="y"?"top":"left",x=m==="y"?"bottom":"right",y=g+d[v],C=g-d[x];g=hn(y,g,C)}if(s){const v=p==="y"?"top":"left",x=p==="y"?"bottom":"right",y=b+d[v],C=b-d[x];b=hn(y,b,C)}const h=i.fn({...t,[m]:g,[p]:b});return{...h,data:{x:h.x-n,y:h.y-r,enabled:{[m]:a,[p]:s}}}}}},mu=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:a,middlewareData:s}=t,{offset:i=0,mainAxis:u=!0,crossAxis:f=!0}=we(e,t),d={x:n,y:r},p=pe(o),m=Ln(p);let g=d[m],b=d[p];const h=we(i,t),v=typeof h=="number"?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(u){const C=m==="y"?"height":"width",S=a.reference[m]-a.floating[C]+v.mainAxis,M=a.reference[m]+a.reference[C]-v.mainAxis;g<S?g=S:g>M&&(g=M)}if(f){var x,y;const C=m==="y"?"width":"height",S=["top","left"].includes(ye(o)),M=a.reference[p]-a.floating[C]+(S&&((x=s.offset)==null?void 0:x[p])||0)+(S?0:v.crossAxis),T=a.reference[p]+a.reference[C]+(S?0:((y=s.offset)==null?void 0:y[p])||0)-(S?v.crossAxis:0);b<M?b=M:b>T&&(b=T)}return{[m]:g,[p]:b}}}},hu=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:a,platform:s,elements:i}=t,{apply:u=()=>{},...f}=we(e,t),d=await tt(t,f),p=ye(o),m=Ye(o),g=pe(o)==="y",{width:b,height:h}=a.floating;let v,x;p==="top"||p==="bottom"?(v=p,x=m===(await(s.isRTL==null?void 0:s.isRTL(i.floating))?"start":"end")?"left":"right"):(x=p,v=m==="end"?"top":"bottom");const y=h-d.top-d.bottom,C=b-d.left-d.right,S=ke(h-d[v],y),M=ke(b-d[x],C),T=!t.middlewareData.shift;let k=S,R=M;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(R=C),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(k=y),T&&!m){const z=se(d.left,0),U=se(d.right,0),G=se(d.top,0),W=se(d.bottom,0);g?R=b-2*(z!==0||U!==0?z+U:se(d.left,d.right)):k=h-2*(G!==0||W!==0?G+W:se(d.top,d.bottom))}await u({...t,availableWidth:R,availableHeight:k});const I=await s.getDimensions(i.floating);return b!==I.width||h!==I.height?{reset:{rects:!0}}:{}}}};function zt(){return typeof window<"u"}function Ze(e){return qo(e)?(e.nodeName||"").toLowerCase():"#document"}function ie(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function ve(e){var t;return(t=(qo(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function qo(e){return zt()?e instanceof Node||e instanceof ie(e).Node:!1}function le(e){return zt()?e instanceof Element||e instanceof ie(e).Element:!1}function ge(e){return zt()?e instanceof HTMLElement||e instanceof ie(e).HTMLElement:!1}function Dr(e){return!zt()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof ie(e).ShadowRoot}function it(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=ue(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function gu(e){return["table","td","th"].includes(Ze(e))}function Ht(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function zn(e){const t=Hn(),n=le(e)?ue(e):e;return["transform","translate","scale","rotate","perspective"].some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","translate","scale","rotate","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function vu(e){let t=Ae(e);for(;ge(t)&&!Be(t);){if(zn(t))return t;if(Ht(t))return null;t=Ae(t)}return null}function Hn(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Be(e){return["html","body","#document"].includes(Ze(e))}function ue(e){return ie(e).getComputedStyle(e)}function Vt(e){return le(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Ae(e){if(Ze(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Dr(e)&&e.host||ve(e);return Dr(t)?t.host:t}function Jo(e){const t=Ae(e);return Be(t)?e.ownerDocument?e.ownerDocument.body:e.body:ge(t)&&it(t)?t:Jo(t)}function nt(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=Jo(e),a=o===((r=e.ownerDocument)==null?void 0:r.body),s=ie(o);if(a){const i=vn(s);return t.concat(s,s.visualViewport||[],it(o)?o:[],i&&n?nt(i):[])}return t.concat(o,nt(o,[],n))}function vn(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Qo(e){const t=ue(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=ge(e),a=o?e.offsetWidth:n,s=o?e.offsetHeight:r,i=At(n)!==a||At(r)!==s;return i&&(n=a,r=s),{width:n,height:r,$:i}}function Vn(e){return le(e)?e:e.contextElement}function He(e){const t=Vn(e);if(!ge(t))return me(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:a}=Qo(t);let s=(a?At(n.width):n.width)/r,i=(a?At(n.height):n.height)/o;return(!s||!Number.isFinite(s))&&(s=1),(!i||!Number.isFinite(i))&&(i=1),{x:s,y:i}}const bu=me(0);function ea(e){const t=ie(e);return!Hn()||!t.visualViewport?bu:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function xu(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==ie(e)?!1:t}function Oe(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),a=Vn(e);let s=me(1);t&&(r?le(r)&&(s=He(r)):s=He(e));const i=xu(a,n,r)?ea(a):me(0);let u=(o.left+i.x)/s.x,f=(o.top+i.y)/s.y,d=o.width/s.x,p=o.height/s.y;if(a){const m=ie(a),g=r&&le(r)?ie(r):r;let b=m,h=vn(b);for(;h&&r&&g!==b;){const v=He(h),x=h.getBoundingClientRect(),y=ue(h),C=x.left+(h.clientLeft+parseFloat(y.paddingLeft))*v.x,S=x.top+(h.clientTop+parseFloat(y.paddingTop))*v.y;u*=v.x,f*=v.y,d*=v.x,p*=v.y,u+=C,f+=S,b=ie(h),h=vn(b)}}return Nt({width:d,height:p,x:u,y:f})}function Bn(e,t){const n=Vt(e).scrollLeft;return t?t.left+n:Oe(ve(e)).left+n}function ta(e,t,n){n===void 0&&(n=!1);const r=e.getBoundingClientRect(),o=r.left+t.scrollLeft-(n?0:Bn(e,r)),a=r.top+t.scrollTop;return{x:o,y:a}}function wu(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const a=o==="fixed",s=ve(r),i=t?Ht(t.floating):!1;if(r===s||i&&a)return n;let u={scrollLeft:0,scrollTop:0},f=me(1);const d=me(0),p=ge(r);if((p||!p&&!a)&&((Ze(r)!=="body"||it(s))&&(u=Vt(r)),ge(r))){const g=Oe(r);f=He(r),d.x=g.x+r.clientLeft,d.y=g.y+r.clientTop}const m=s&&!p&&!a?ta(s,u,!0):me(0);return{width:n.width*f.x,height:n.height*f.y,x:n.x*f.x-u.scrollLeft*f.x+d.x+m.x,y:n.y*f.y-u.scrollTop*f.y+d.y+m.y}}function yu(e){return Array.from(e.getClientRects())}function Cu(e){const t=ve(e),n=Vt(e),r=e.ownerDocument.body,o=se(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=se(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+Bn(e);const i=-n.scrollTop;return ue(r).direction==="rtl"&&(s+=se(t.clientWidth,r.clientWidth)-o),{width:o,height:a,x:s,y:i}}function Su(e,t){const n=ie(e),r=ve(e),o=n.visualViewport;let a=r.clientWidth,s=r.clientHeight,i=0,u=0;if(o){a=o.width,s=o.height;const f=Hn();(!f||f&&t==="fixed")&&(i=o.offsetLeft,u=o.offsetTop)}return{width:a,height:s,x:i,y:u}}function Eu(e,t){const n=Oe(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,a=ge(e)?He(e):me(1),s=e.clientWidth*a.x,i=e.clientHeight*a.y,u=o*a.x,f=r*a.y;return{width:s,height:i,x:u,y:f}}function Ir(e,t,n){let r;if(t==="viewport")r=Su(e,n);else if(t==="document")r=Cu(ve(e));else if(le(t))r=Eu(t,n);else{const o=ea(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return Nt(r)}function na(e,t){const n=Ae(e);return n===t||!le(n)||Be(n)?!1:ue(n).position==="fixed"||na(n,t)}function Ru(e,t){const n=t.get(e);if(n)return n;let r=nt(e,[],!1).filter(i=>le(i)&&Ze(i)!=="body"),o=null;const a=ue(e).position==="fixed";let s=a?Ae(e):e;for(;le(s)&&!Be(s);){const i=ue(s),u=zn(s);!u&&i.position==="fixed"&&(o=null),(a?!u&&!o:!u&&i.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||it(s)&&!u&&na(e,s))?r=r.filter(d=>d!==s):o=i,s=Ae(s)}return t.set(e,r),r}function Mu(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const s=[...n==="clippingAncestors"?Ht(t)?[]:Ru(t,this._c):[].concat(n),r],i=s[0],u=s.reduce((f,d)=>{const p=Ir(t,d,o);return f.top=se(p.top,f.top),f.right=ke(p.right,f.right),f.bottom=ke(p.bottom,f.bottom),f.left=se(p.left,f.left),f},Ir(t,i,o));return{width:u.right-u.left,height:u.bottom-u.top,x:u.left,y:u.top}}function ku(e){const{width:t,height:n}=Qo(e);return{width:t,height:n}}function Au(e,t,n){const r=ge(t),o=ve(t),a=n==="fixed",s=Oe(e,!0,a,t);let i={scrollLeft:0,scrollTop:0};const u=me(0);function f(){u.x=Bn(o)}if(r||!r&&!a)if((Ze(t)!=="body"||it(o))&&(i=Vt(t)),r){const g=Oe(t,!0,a,t);u.x=g.x+t.clientLeft,u.y=g.y+t.clientTop}else o&&f();a&&!r&&o&&f();const d=o&&!r&&!a?ta(o,i):me(0),p=s.left+i.scrollLeft-u.x-d.x,m=s.top+i.scrollTop-u.y-d.y;return{x:p,y:m,width:s.width,height:s.height}}function an(e){return ue(e).position==="static"}function Lr(e,t){if(!ge(e)||ue(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return ve(e)===n&&(n=n.ownerDocument.body),n}function ra(e,t){const n=ie(e);if(Ht(e))return n;if(!ge(e)){let o=Ae(e);for(;o&&!Be(o);){if(le(o)&&!an(o))return o;o=Ae(o)}return n}let r=Lr(e,t);for(;r&&gu(r)&&an(r);)r=Lr(r,t);return r&&Be(r)&&an(r)&&!zn(r)?n:r||vu(e)||n}const Pu=async function(e){const t=this.getOffsetParent||ra,n=this.getDimensions,r=await n(e.floating);return{reference:Au(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Nu(e){return ue(e).direction==="rtl"}const _u={convertOffsetParentRelativeRectToViewportRelativeRect:wu,getDocumentElement:ve,getClippingRect:Mu,getOffsetParent:ra,getElementRects:Pu,getClientRects:yu,getDimensions:ku,getScale:He,isElement:le,isRTL:Nu};function oa(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Tu(e,t){let n=null,r;const o=ve(e);function a(){var i;clearTimeout(r),(i=n)==null||i.disconnect(),n=null}function s(i,u){i===void 0&&(i=!1),u===void 0&&(u=1),a();const f=e.getBoundingClientRect(),{left:d,top:p,width:m,height:g}=f;if(i||t(),!m||!g)return;const b=St(p),h=St(o.clientWidth-(d+m)),v=St(o.clientHeight-(p+g)),x=St(d),C={rootMargin:-b+"px "+-h+"px "+-v+"px "+-x+"px",threshold:se(0,ke(1,u))||1};let S=!0;function M(T){const k=T[0].intersectionRatio;if(k!==u){if(!S)return s();k?s(!1,k):r=setTimeout(()=>{s(!1,1e-7)},1e3)}k===1&&!oa(f,e.getBoundingClientRect())&&s(),S=!1}try{n=new IntersectionObserver(M,{...C,root:o.ownerDocument})}catch{n=new IntersectionObserver(M,C)}n.observe(e)}return s(!0),a}function Ou(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:a=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:i=typeof IntersectionObserver=="function",animationFrame:u=!1}=r,f=Vn(e),d=o||a?[...f?nt(f):[],...nt(t)]:[];d.forEach(x=>{o&&x.addEventListener("scroll",n,{passive:!0}),a&&x.addEventListener("resize",n)});const p=f&&i?Tu(f,n):null;let m=-1,g=null;s&&(g=new ResizeObserver(x=>{let[y]=x;y&&y.target===f&&g&&(g.unobserve(t),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var C;(C=g)==null||C.observe(t)})),n()}),f&&!u&&g.observe(f),g.observe(t));let b,h=u?Oe(e):null;u&&v();function v(){const x=Oe(e);h&&!oa(h,x)&&n(),h=x,b=requestAnimationFrame(v)}return n(),()=>{var x;d.forEach(y=>{o&&y.removeEventListener("scroll",n),a&&y.removeEventListener("resize",n)}),p==null||p(),(x=g)==null||x.disconnect(),g=null,u&&cancelAnimationFrame(b)}}const ju=fu,Du=pu,Iu=lu,Lu=hu,Fu=uu,Fr=cu,$u=mu,zu=(e,t,n)=>{const r=new Map,o={platform:_u,...n},a={...o.platform,_c:r};return iu(e,t,{...o,platform:a})};var Hu=typeof document<"u",Vu=function(){},Mt=Hu?Z.useLayoutEffect:Vu;function _t(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,r,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!_t(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const a=o[r];if(!(a==="_owner"&&e.$$typeof)&&!_t(e[a],t[a]))return!1}return!0}return e!==e&&t!==t}function aa(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function $r(e,t){const n=aa(e);return Math.round(t*n)/n}function sn(e){const t=l.useRef(e);return Mt(()=>{t.current=e}),t}function Bu(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:a,floating:s}={},transform:i=!0,whileElementsMounted:u,open:f}=e,[d,p]=l.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[m,g]=l.useState(r);_t(m,r)||g(r);const[b,h]=l.useState(null),[v,x]=l.useState(null),y=l.useCallback(E=>{E!==T.current&&(T.current=E,h(E))},[]),C=l.useCallback(E=>{E!==k.current&&(k.current=E,x(E))},[]),S=a||b,M=s||v,T=l.useRef(null),k=l.useRef(null),R=l.useRef(d),I=u!=null,z=sn(u),U=sn(o),G=sn(f),W=l.useCallback(()=>{if(!T.current||!k.current)return;const E={placement:t,strategy:n,middleware:m};U.current&&(E.platform=U.current),zu(T.current,k.current,E).then(_=>{const w={..._,isPositioned:G.current!==!1};H.current&&!_t(R.current,w)&&(R.current=w,Gr.flushSync(()=>{p(w)}))})},[m,t,n,U,G]);Mt(()=>{f===!1&&R.current.isPositioned&&(R.current.isPositioned=!1,p(E=>({...E,isPositioned:!1})))},[f]);const H=l.useRef(!1);Mt(()=>(H.current=!0,()=>{H.current=!1}),[]),Mt(()=>{if(S&&(T.current=S),M&&(k.current=M),S&&M){if(z.current)return z.current(S,M,W);W()}},[S,M,W,z,I]);const Y=l.useMemo(()=>({reference:T,floating:k,setReference:y,setFloating:C}),[y,C]),D=l.useMemo(()=>({reference:S,floating:M}),[S,M]),V=l.useMemo(()=>{const E={position:n,left:0,top:0};if(!D.floating)return E;const _=$r(D.floating,d.x),w=$r(D.floating,d.y);return i?{...E,transform:"translate("+_+"px, "+w+"px)",...aa(D.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:_,top:w}},[n,i,D.floating,d.x,d.y]);return l.useMemo(()=>({...d,update:W,refs:Y,elements:D,floatingStyles:V}),[d,W,Y,D,V])}const Gu=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:o}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?Fr({element:r.current,padding:o}).fn(n):{}:r?Fr({element:r,padding:o}).fn(n):{}}}},Wu=(e,t)=>({...ju(e),options:[e,t]}),Uu=(e,t)=>({...Du(e),options:[e,t]}),Ku=(e,t)=>({...$u(e),options:[e,t]}),Yu=(e,t)=>({...Iu(e),options:[e,t]}),Zu=(e,t)=>({...Lu(e),options:[e,t]}),Xu=(e,t)=>({...Fu(e),options:[e,t]}),qu=(e,t)=>({...Gu(e),options:[e,t]});var Ju="Arrow",sa=l.forwardRef((e,t)=>{const{children:n,width:r=10,height:o=5,...a}=e;return c.jsx(J.svg,{...a,ref:t,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:c.jsx("polygon",{points:"0,0 30,0 15,10"})})});sa.displayName=Ju;var Qu=sa;function ed(e){const[t,n]=l.useState(void 0);return Me(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const a=o[0];let s,i;if("borderBoxSize"in a){const u=a.borderBoxSize,f=Array.isArray(u)?u[0]:u;s=f.inlineSize,i=f.blockSize}else s=e.offsetWidth,i=e.offsetHeight;n({width:s,height:i})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var Gn="Popper",[ia,Bt]=je(Gn),[td,ca]=ia(Gn),la=e=>{const{__scopePopper:t,children:n}=e,[r,o]=l.useState(null);return c.jsx(td,{scope:t,anchor:r,onAnchorChange:o,children:n})};la.displayName=Gn;var ua="PopperAnchor",da=l.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,a=ca(ua,n),s=l.useRef(null),i=te(t,s);return l.useEffect(()=>{a.onAnchorChange((r==null?void 0:r.current)||s.current)}),r?null:c.jsx(J.div,{...o,ref:i})});da.displayName=ua;var Wn="PopperContent",[nd,rd]=ia(Wn),fa=l.forwardRef((e,t)=>{var B,X,q,ae,Se,Ne;const{__scopePopper:n,side:r="bottom",sideOffset:o=0,align:a="center",alignOffset:s=0,arrowPadding:i=0,avoidCollisions:u=!0,collisionBoundary:f=[],collisionPadding:d=0,sticky:p="partial",hideWhenDetached:m=!1,updatePositionStrategy:g="optimized",onPlaced:b,...h}=e,v=ca(Wn,n),[x,y]=l.useState(null),C=te(t,Xe=>y(Xe)),[S,M]=l.useState(null),T=ed(S),k=(T==null?void 0:T.width)??0,R=(T==null?void 0:T.height)??0,I=r+(a!=="center"?"-"+a:""),z=typeof d=="number"?d:{top:0,right:0,bottom:0,left:0,...d},U=Array.isArray(f)?f:[f],G=U.length>0,W={padding:z,boundary:U.filter(ad),altBoundary:G},{refs:H,floatingStyles:Y,placement:D,isPositioned:V,middlewareData:E}=Bu({strategy:"fixed",placement:I,whileElementsMounted:(...Xe)=>Ou(...Xe,{animationFrame:g==="always"}),elements:{reference:v.anchor},middleware:[Wu({mainAxis:o+R,alignmentAxis:s}),u&&Uu({mainAxis:!0,crossAxis:!1,limiter:p==="partial"?Ku():void 0,...W}),u&&Yu({...W}),Zu({...W,apply:({elements:Xe,rects:ar,availableWidth:qs,availableHeight:Js})=>{const{width:Qs,height:ei}=ar.reference,pt=Xe.floating.style;pt.setProperty("--radix-popper-available-width",`${qs}px`),pt.setProperty("--radix-popper-available-height",`${Js}px`),pt.setProperty("--radix-popper-anchor-width",`${Qs}px`),pt.setProperty("--radix-popper-anchor-height",`${ei}px`)}}),S&&qu({element:S,padding:i}),sd({arrowWidth:k,arrowHeight:R}),m&&Xu({strategy:"referenceHidden",...W})]}),[_,w]=ha(D),O=he(b);Me(()=>{V&&(O==null||O())},[V,O]);const F=(B=E.arrow)==null?void 0:B.x,$=(X=E.arrow)==null?void 0:X.y,K=((q=E.arrow)==null?void 0:q.centerOffset)!==0,[Q,oe]=l.useState();return Me(()=>{x&&oe(window.getComputedStyle(x).zIndex)},[x]),c.jsx("div",{ref:H.setFloating,"data-radix-popper-content-wrapper":"",style:{...Y,transform:V?Y.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Q,"--radix-popper-transform-origin":[(ae=E.transformOrigin)==null?void 0:ae.x,(Se=E.transformOrigin)==null?void 0:Se.y].join(" "),...((Ne=E.hide)==null?void 0:Ne.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:c.jsx(nd,{scope:n,placedSide:_,onArrowChange:M,arrowX:F,arrowY:$,shouldHideArrow:K,children:c.jsx(J.div,{"data-side":_,"data-align":w,...h,ref:C,style:{...h.style,animation:V?void 0:"none"}})})})});fa.displayName=Wn;var pa="PopperArrow",od={top:"bottom",right:"left",bottom:"top",left:"right"},ma=l.forwardRef(function(t,n){const{__scopePopper:r,...o}=t,a=rd(pa,r),s=od[a.placedSide];return c.jsx("span",{ref:a.onArrowChange,style:{position:"absolute",left:a.arrowX,top:a.arrowY,[s]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[a.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[a.placedSide],visibility:a.shouldHideArrow?"hidden":void 0},children:c.jsx(Qu,{...o,ref:n,style:{...o.style,display:"block"}})})});ma.displayName=pa;function ad(e){return e!==null}var sd=e=>({name:"transformOrigin",options:e,fn(t){var v,x,y;const{placement:n,rects:r,middlewareData:o}=t,s=((v=o.arrow)==null?void 0:v.centerOffset)!==0,i=s?0:e.arrowWidth,u=s?0:e.arrowHeight,[f,d]=ha(n),p={start:"0%",center:"50%",end:"100%"}[d],m=(((x=o.arrow)==null?void 0:x.x)??0)+i/2,g=(((y=o.arrow)==null?void 0:y.y)??0)+u/2;let b="",h="";return f==="bottom"?(b=s?p:`${m}px`,h=`${-u}px`):f==="top"?(b=s?p:`${m}px`,h=`${r.floating.height+u}px`):f==="right"?(b=`${-u}px`,h=s?p:`${g}px`):f==="left"&&(b=`${r.floating.width+u}px`,h=s?p:`${g}px`),{data:{x:b,y:h}}}});function ha(e){const[t,n="center"]=e.split("-");return[t,n]}var Un=la,ga=da,va=fa,ba=ma,id=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"}),cd="VisuallyHidden",xa=l.forwardRef((e,t)=>c.jsx(J.span,{...e,ref:t,style:{...id,...e.style}}));xa.displayName=cd;var ld=xa,[Gt,Yp]=je("Tooltip",[Bt]),Wt=Bt(),wa="TooltipProvider",ud=700,bn="tooltip.open",[dd,Kn]=Gt(wa),ya=e=>{const{__scopeTooltip:t,delayDuration:n=ud,skipDelayDuration:r=300,disableHoverableContent:o=!1,children:a}=e,s=l.useRef(!0),i=l.useRef(!1),u=l.useRef(0);return l.useEffect(()=>{const f=u.current;return()=>window.clearTimeout(f)},[]),c.jsx(dd,{scope:t,isOpenDelayedRef:s,delayDuration:n,onOpen:l.useCallback(()=>{window.clearTimeout(u.current),s.current=!1},[]),onClose:l.useCallback(()=>{window.clearTimeout(u.current),u.current=window.setTimeout(()=>s.current=!0,r)},[r]),isPointerInTransitRef:i,onPointerInTransitChange:l.useCallback(f=>{i.current=f},[]),disableHoverableContent:o,children:a})};ya.displayName=wa;var rt="Tooltip",[fd,Ut]=Gt(rt),Ca=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:o,onOpenChange:a,disableHoverableContent:s,delayDuration:i}=e,u=Kn(rt,e.__scopeTooltip),f=Wt(t),[d,p]=l.useState(null),m=xe(),g=l.useRef(0),b=s??u.disableHoverableContent,h=i??u.delayDuration,v=l.useRef(!1),[x,y]=st({prop:r,defaultProp:o??!1,onChange:k=>{k?(u.onOpen(),document.dispatchEvent(new CustomEvent(bn))):u.onClose(),a==null||a(k)},caller:rt}),C=l.useMemo(()=>x?v.current?"delayed-open":"instant-open":"closed",[x]),S=l.useCallback(()=>{window.clearTimeout(g.current),g.current=0,v.current=!1,y(!0)},[y]),M=l.useCallback(()=>{window.clearTimeout(g.current),g.current=0,y(!1)},[y]),T=l.useCallback(()=>{window.clearTimeout(g.current),g.current=window.setTimeout(()=>{v.current=!0,y(!0),g.current=0},h)},[h,y]);return l.useEffect(()=>()=>{g.current&&(window.clearTimeout(g.current),g.current=0)},[]),c.jsx(Un,{...f,children:c.jsx(fd,{scope:t,contentId:m,open:x,stateAttribute:C,trigger:d,onTriggerChange:p,onTriggerEnter:l.useCallback(()=>{u.isOpenDelayedRef.current?T():S()},[u.isOpenDelayedRef,T,S]),onTriggerLeave:l.useCallback(()=>{b?M():(window.clearTimeout(g.current),g.current=0)},[M,b]),onOpen:S,onClose:M,disableHoverableContent:b,children:n})})};Ca.displayName=rt;var xn="TooltipTrigger",Sa=l.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=Ut(xn,n),a=Kn(xn,n),s=Wt(n),i=l.useRef(null),u=te(t,i,o.onTriggerChange),f=l.useRef(!1),d=l.useRef(!1),p=l.useCallback(()=>f.current=!1,[]);return l.useEffect(()=>()=>document.removeEventListener("pointerup",p),[p]),c.jsx(ga,{asChild:!0,...s,children:c.jsx(J.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...r,ref:u,onPointerMove:j(e.onPointerMove,m=>{m.pointerType!=="touch"&&!d.current&&!a.isPointerInTransitRef.current&&(o.onTriggerEnter(),d.current=!0)}),onPointerLeave:j(e.onPointerLeave,()=>{o.onTriggerLeave(),d.current=!1}),onPointerDown:j(e.onPointerDown,()=>{o.open&&o.onClose(),f.current=!0,document.addEventListener("pointerup",p,{once:!0})}),onFocus:j(e.onFocus,()=>{f.current||o.onOpen()}),onBlur:j(e.onBlur,o.onClose),onClick:j(e.onClick,o.onClose)})})});Sa.displayName=xn;var pd="TooltipPortal",[Zp,md]=Gt(pd,{forceMount:void 0}),Ge="TooltipContent",Ea=l.forwardRef((e,t)=>{const n=md(Ge,e.__scopeTooltip),{forceMount:r=n.forceMount,side:o="top",...a}=e,s=Ut(Ge,e.__scopeTooltip);return c.jsx(Ce,{present:r||s.open,children:s.disableHoverableContent?c.jsx(Ra,{side:o,...a,ref:t}):c.jsx(hd,{side:o,...a,ref:t})})}),hd=l.forwardRef((e,t)=>{const n=Ut(Ge,e.__scopeTooltip),r=Kn(Ge,e.__scopeTooltip),o=l.useRef(null),a=te(t,o),[s,i]=l.useState(null),{trigger:u,onClose:f}=n,d=o.current,{onPointerInTransitChange:p}=r,m=l.useCallback(()=>{i(null),p(!1)},[p]),g=l.useCallback((b,h)=>{const v=b.currentTarget,x={x:b.clientX,y:b.clientY},y=wd(x,v.getBoundingClientRect()),C=yd(x,y),S=Cd(h.getBoundingClientRect()),M=Ed([...C,...S]);i(M),p(!0)},[p]);return l.useEffect(()=>()=>m(),[m]),l.useEffect(()=>{if(u&&d){const b=v=>g(v,d),h=v=>g(v,u);return u.addEventListener("pointerleave",b),d.addEventListener("pointerleave",h),()=>{u.removeEventListener("pointerleave",b),d.removeEventListener("pointerleave",h)}}},[u,d,g,m]),l.useEffect(()=>{if(s){const b=h=>{const v=h.target,x={x:h.clientX,y:h.clientY},y=(u==null?void 0:u.contains(v))||(d==null?void 0:d.contains(v)),C=!Sd(x,s);y?m():C&&(m(),f())};return document.addEventListener("pointermove",b),()=>document.removeEventListener("pointermove",b)}},[u,d,s,f,m]),c.jsx(Ra,{...e,ref:a})}),[gd,vd]=Gt(rt,{isInside:!1}),bd=ii("TooltipContent"),Ra=l.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":o,onEscapeKeyDown:a,onPointerDownOutside:s,...i}=e,u=Ut(Ge,n),f=Wt(n),{onClose:d}=u;return l.useEffect(()=>(document.addEventListener(bn,d),()=>document.removeEventListener(bn,d)),[d]),l.useEffect(()=>{if(u.trigger){const p=m=>{const g=m.target;g!=null&&g.contains(u.trigger)&&d()};return window.addEventListener("scroll",p,{capture:!0}),()=>window.removeEventListener("scroll",p,{capture:!0})}},[u.trigger,d]),c.jsx(Lt,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:a,onPointerDownOutside:s,onFocusOutside:p=>p.preventDefault(),onDismiss:d,children:c.jsxs(va,{"data-state":u.stateAttribute,...f,...i,ref:t,style:{...i.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:[c.jsx(bd,{children:r}),c.jsx(gd,{scope:n,isInside:!0,children:c.jsx(ld,{id:u.contentId,role:"tooltip",children:o||r})})]})})});Ea.displayName=Ge;var Ma="TooltipArrow",xd=l.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=Wt(n);return vd(Ma,n).isInside?null:c.jsx(ba,{...o,...r,ref:t})});xd.displayName=Ma;function wd(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),o=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(n,r,o,a)){case a:return"left";case o:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function yd(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function Cd(e){const{top:t,right:n,bottom:r,left:o}=e;return[{x:o,y:t},{x:n,y:t},{x:n,y:r},{x:o,y:r}]}function Sd(e,t){const{x:n,y:r}=e;let o=!1;for(let a=0,s=t.length-1;a<t.length;s=a++){const i=t[a],u=t[s],f=i.x,d=i.y,p=u.x,m=u.y;d>r!=m>r&&n<(p-f)*(r-d)/(m-d)+f&&(o=!o)}return o}function Ed(e){const t=e.slice();return t.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),Rd(t)}function Rd(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const o=e[r];for(;t.length>=2;){const a=t[t.length-1],s=t[t.length-2];if((a.x-s.x)*(o.y-s.y)>=(a.y-s.y)*(o.x-s.x))t.pop();else break}t.push(o)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const o=e[r];for(;n.length>=2;){const a=n[n.length-1],s=n[n.length-2];if((a.x-s.x)*(o.y-s.y)>=(a.y-s.y)*(o.x-s.x))n.pop();else break}n.push(o)}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 Md=ya,kd=Ca,Ad=Sa,ka=Ea;const Yn=Md,Zn=kd,Xn=Ad,Kt=l.forwardRef(({className:e,sideOffset:t=4,...n},r)=>c.jsx(ka,{ref:r,sideOffset:t,className:A("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),...n}));Kt.displayName=ka.displayName;const Pd="sidebar_state",Nd=60*60*24*7,_d="16rem",Td="18rem",Od="3rem",jd="b",Aa=l.createContext(null);function ct(){const e=l.useContext(Aa);if(!e)throw new Error("useSidebar must be used within a SidebarProvider.");return e}function Pa({defaultOpen:e=!0,open:t,onOpenChange:n,className:r,style:o,children:a,...s}){const i=uo(),[u,f]=l.useState(!1),[d,p]=l.useState(e),m=t??d,g=l.useCallback(x=>{const y=typeof x=="function"?x(m):x;n?n(y):p(y),document.cookie=`${Pd}=${y}; path=/; max-age=${Nd}`},[n,m]),b=l.useCallback(()=>i?f(x=>!x):g(x=>!x),[i,g,f]);l.useEffect(()=>{const x=y=>{y.key===jd&&(y.metaKey||y.ctrlKey)&&(y.preventDefault(),b())};return window.addEventListener("keydown",x),()=>window.removeEventListener("keydown",x)},[b]);const h=m?"expanded":"collapsed",v=l.useMemo(()=>({state:h,open:m,setOpen:g,isMobile:i,openMobile:u,setOpenMobile:f,toggleSidebar:b}),[h,m,g,i,u,f,b]);return c.jsx(Aa.Provider,{value:v,children:c.jsx(Yn,{delayDuration:0,children:c.jsx("div",{"data-slot":"sidebar-wrapper",style:{"--sidebar-width":_d,"--sidebar-width-icon":Od,...o},className:A("group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex min-h-svh w-full",r),...s,children:a})})})}function Na({side:e="left",variant:t="sidebar",collapsible:n="offcanvas",className:r,children:o,...a}){const{isMobile:s,state:i,openMobile:u,setOpenMobile:f}=ct();return n==="none"?c.jsx("div",{"data-slot":"sidebar",className:A("bg-white text-sidebar-foreground flex h-full w-(--sidebar-width) flex-col",r),...a,children:o}):s?c.jsx(Ko,{open:u,onOpenChange:f,...a,children:c.jsxs(On,{"data-sidebar":"sidebar","data-slot":"sidebar","data-mobile":"true",className:"bg-white text-sidebar-foreground w-(--sidebar-width) p-0 [&>button]:hidden",style:{"--sidebar-width":Td},side:e,children:[c.jsxs(jn,{className:"sr-only",children:[c.jsx(Dn,{children:"Sidebar"}),c.jsx(In,{children:"Displays the mobile sidebar."})]}),c.jsx("div",{className:"flex h-full w-full flex-col",children:o})]})}):c.jsxs("div",{className:"group peer text-sidebar-foreground hidden md:block","data-state":i,"data-collapsible":i==="collapsed"?n:"","data-variant":t,"data-side":e,"data-slot":"sidebar",children:[c.jsx("div",{"data-slot":"sidebar-gap",className:A("relative w-(--sidebar-width) bg-white transition-[width] duration-200 ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",t==="floating"||t==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon)")}),c.jsx("div",{"data-slot":"sidebar-container",className:A("fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear md:flex",e==="left"?"left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]":"right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",t==="floating"||t==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l",r),...a,children:c.jsx("div",{"data-sidebar":"sidebar","data-slot":"sidebar-inner",className:"bg-white group-data-[variant=floating]:border-sidebar-border flex h-full w-full flex-col px-1 py-2 group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:shadow-sm",children:o})})]})}function _a({className:e,onClick:t,...n}){const{toggleSidebar:r}=ct();return c.jsxs(It,{"data-sidebar":"trigger","data-slot":"sidebar-trigger",variant:"ghost",size:"icon",className:A("size-7",e),onClick:o=>{t==null||t(o),r()},...n,children:[c.jsx(Sc,{}),c.jsx("span",{className:"sr-only",children:"Toggle Sidebar"})]})}function Ta({className:e,...t}){const{toggleSidebar:n}=ct();return c.jsx("button",{"data-sidebar":"rail","data-slot":"sidebar-rail","aria-label":"Toggle Sidebar",tabIndex:-1,onClick:n,title:"Toggle Sidebar",className:A("hover:after:bg-sidebar-border absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear group-data-[side=left]:-right-4 group-data-[side=right]:left-0 after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] sm:flex","in-data-[side=left]:cursor-w-resize in-data-[side=right]:cursor-e-resize","[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize","hover:group-data-[collapsible=offcanvas]:bg-sidebar group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full","[[data-side=left][data-collapsible=offcanvas]_&]:-right-2","[[data-side=right][data-collapsible=offcanvas]_&]:-left-2",e),...t})}function Oa({className:e,...t}){return c.jsx("main",{"data-slot":"sidebar-inset",className:A("bg-white relative flex w-full flex-1 flex-col","md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2",e),...t})}function Dd({className:e,...t}){return c.jsx(Rn,{"data-slot":"sidebar-input","data-sidebar":"input",className:A("bg-background h-8 w-full shadow-none",e),...t})}function ja({className:e,...t}){return c.jsx("div",{"data-slot":"sidebar-header","data-sidebar":"header",className:A("flex flex-col gap-2 p-2",e),...t})}function Id({className:e,...t}){return c.jsx("div",{"data-slot":"sidebar-footer","data-sidebar":"footer",className:A("flex flex-col gap-2 p-2",e),...t})}function Ld({className:e,...t}){return c.jsx(Dt,{"data-slot":"sidebar-separator","data-sidebar":"separator",className:A("bg-sidebar-border mx-2 w-auto",e),...t})}function Da({className:e,...t}){return c.jsx("div",{"data-slot":"sidebar-content","data-sidebar":"content",className:A("flex min-h-0 flex-1 flex-col overflow-auto group-data-[collapsible=icon]:overflow-hidden",e),...t})}function Ia({className:e,...t}){return c.jsx("div",{"data-slot":"sidebar-group","data-sidebar":"group",className:A("relative flex w-full min-w-0 flex-col px-2 py-1",e),...t})}function Fd({className:e,asChild:t=!1,...n}){const r=t?We:"div";return c.jsx(r,{"data-slot":"sidebar-group-label","data-sidebar":"group-label",className:A("text-sidebar-foreground/70 ring-sidebar-ring flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium outline-hidden transition-[margin,opacity] duration-200 ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0",e),...n})}function $d({className:e,asChild:t=!1,...n}){const r=t?We:"button";return c.jsx(r,{"data-slot":"sidebar-group-action","data-sidebar":"group-action",className:A("text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground absolute top-3.5 right-3 flex aspect-square w-5 items-center justify-center rounded-md p-0 outline-hidden transition-transform focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 md:after:hidden","group-data-[collapsible=icon]:hidden",e),...n})}function La({className:e,...t}){return c.jsx("div",{"data-slot":"sidebar-group-content","data-sidebar":"group-content",className:A("w-full text-sm",e),...t})}function zd({className:e,...t}){return c.jsx("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:A("flex w-full min-w-0 flex-col gap-1",e),...t})}function Hd({className:e,...t}){return c.jsx("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:A("group/menu-item relative",e),...t})}const Vd=En("peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-hidden ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-data-[sidebar=menu-action]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",{variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"},size:{default:"h-8 text-sm",sm:"h-7 text-xs",lg:"h-12 text-sm group-data-[collapsible=icon]:p-0!"}},defaultVariants:{variant:"default",size:"default"}});function Bd({asChild:e=!1,isActive:t=!1,variant:n="default",size:r="default",tooltip:o,className:a,...s}){const i=e?We:"button",{isMobile:u,state:f}=ct(),d=c.jsx(i,{"data-slot":"sidebar-menu-button","data-sidebar":"menu-button","data-size":r,"data-active":t,className:A(Vd({variant:n,size:r}),a),...s});return o?(typeof o=="string"&&(o={children:o}),c.jsxs(Zn,{children:[c.jsx(Xn,{asChild:!0,children:d}),c.jsx(Kt,{side:"right",align:"center",hidden:f!=="collapsed"||u,...o})]})):d}function Gd({className:e,asChild:t=!1,showOnHover:n=!1,...r}){const o=t?We:"button";return c.jsx(o,{"data-slot":"sidebar-menu-action","data-sidebar":"menu-action",className:A("text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground peer-hover/menu-button:text-sidebar-accent-foreground absolute top-1.5 right-1 flex aspect-square w-5 items-center justify-center rounded-md p-0 outline-hidden transition-transform focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 md:after:hidden","peer-data-[size=sm]/menu-button:top-1","peer-data-[size=default]/menu-button:top-1.5","peer-data-[size=lg]/menu-button:top-2.5","group-data-[collapsible=icon]:hidden",n&&"peer-data-[active=true]/menu-button:text-sidebar-accent-foreground group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 data-[state=open]:opacity-100 md:opacity-0",e),...r})}function Wd({className:e,...t}){return c.jsx("div",{"data-slot":"sidebar-menu-badge","data-sidebar":"menu-badge",className:A("text-sidebar-foreground pointer-events-none absolute right-1 flex h-5 min-w-5 items-center justify-center rounded-md px-1 text-xs font-medium tabular-nums select-none","peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[active=true]/menu-button:text-sidebar-accent-foreground","peer-data-[size=sm]/menu-button:top-1","peer-data-[size=default]/menu-button:top-1.5","peer-data-[size=lg]/menu-button:top-2.5","group-data-[collapsible=icon]:hidden",e),...t})}function Ud({className:e,showIcon:t=!1,...n}){const r=l.useMemo(()=>`${Math.floor(Math.random()*40)+50}%`,[]);return c.jsxs("div",{"data-slot":"sidebar-menu-skeleton","data-sidebar":"menu-skeleton",className:A("flex h-8 items-center gap-2 rounded-md px-2",e),...n,children:[t&&c.jsx(mn,{className:"size-4 rounded-md","data-sidebar":"menu-skeleton-icon"}),c.jsx(mn,{className:"h-4 max-w-(--skeleton-width) flex-1","data-sidebar":"menu-skeleton-text",style:{"--skeleton-width":r}})]})}function Fa({className:e,...t}){return c.jsx("ul",{"data-slot":"sidebar-menu-sub","data-sidebar":"menu-sub",className:A("border-sidebar-border mx-3 flex min-w-0 translate-x-px flex-col gap-1 border-l px-2.5 py-0.5","group-data-[collapsible=icon]:hidden",e),...t})}function $a({className:e,...t}){return c.jsx("li",{"data-slot":"sidebar-menu-sub-item","data-sidebar":"menu-sub-item",className:A("group/menu-sub-item relative",e),...t})}function za({asChild:e=!1,size:t="md",isActive:n=!1,className:r,...o}){const a=e?We:"a";return c.jsx(a,{"data-slot":"sidebar-menu-sub-button","data-sidebar":"menu-sub-button","data-size":t,"data-active":n,className:A("text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground active:bg-sidebar-accent active:text-sidebar-accent-foreground [&>svg]:text-sidebar-accent-foreground flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 outline-hidden focus-visible:ring-2 disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0","data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground",t==="sm"&&"text-xs",t==="md"&&"text-sm","group-data-[collapsible=icon]:hidden",r),...o})}function Ha(e){const t=e+"CollectionProvider",[n,r]=je(t),[o,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),s=h=>{const{scope:v,children:x}=h,y=Z.useRef(null),C=Z.useRef(new Map).current;return c.jsx(o,{scope:v,itemMap:C,collectionRef:y,children:x})};s.displayName=t;const i=e+"CollectionSlot",u=Ve(i),f=Z.forwardRef((h,v)=>{const{scope:x,children:y}=h,C=a(i,x),S=te(v,C.collectionRef);return c.jsx(u,{ref:S,children:y})});f.displayName=i;const d=e+"CollectionItemSlot",p="data-radix-collection-item",m=Ve(d),g=Z.forwardRef((h,v)=>{const{scope:x,children:y,...C}=h,S=Z.useRef(null),M=te(v,S),T=a(d,x);return Z.useEffect(()=>(T.itemMap.set(S,{ref:S,...C}),()=>void T.itemMap.delete(S))),c.jsx(m,{[p]:"",ref:M,children:y})});g.displayName=d;function b(h){const v=a(e+"CollectionConsumer",h);return Z.useCallback(()=>{const y=v.collectionRef.current;if(!y)return[];const C=Array.from(y.querySelectorAll(`[${p}]`));return Array.from(v.itemMap.values()).sort((T,k)=>C.indexOf(T.ref.current)-C.indexOf(k.ref.current))},[v.collectionRef,v.itemMap])}return[{Provider:s,Slot:f,ItemSlot:g},b,r]}var Kd=l.createContext(void 0);function Va(e){const t=l.useContext(Kd);return e||t||"ltr"}var cn="rovingFocusGroup.onEntryFocus",Yd={bubbles:!1,cancelable:!0},lt="RovingFocusGroup",[wn,Ba,Zd]=Ha(lt),[Xd,Ga]=je(lt,[Zd]),[qd,Jd]=Xd(lt),Wa=l.forwardRef((e,t)=>c.jsx(wn.Provider,{scope:e.__scopeRovingFocusGroup,children:c.jsx(wn.Slot,{scope:e.__scopeRovingFocusGroup,children:c.jsx(Qd,{...e,ref:t})})}));Wa.displayName=lt;var Qd=l.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:o=!1,dir:a,currentTabStopId:s,defaultCurrentTabStopId:i,onCurrentTabStopIdChange:u,onEntryFocus:f,preventScrollOnEntryFocus:d=!1,...p}=e,m=l.useRef(null),g=te(t,m),b=Va(a),[h,v]=st({prop:s,defaultProp:i??null,onChange:u,caller:lt}),[x,y]=l.useState(!1),C=he(f),S=Ba(n),M=l.useRef(!1),[T,k]=l.useState(0);return l.useEffect(()=>{const R=m.current;if(R)return R.addEventListener(cn,C),()=>R.removeEventListener(cn,C)},[C]),c.jsx(qd,{scope:n,orientation:r,dir:b,loop:o,currentTabStopId:h,onItemFocus:l.useCallback(R=>v(R),[v]),onItemShiftTab:l.useCallback(()=>y(!0),[]),onFocusableItemAdd:l.useCallback(()=>k(R=>R+1),[]),onFocusableItemRemove:l.useCallback(()=>k(R=>R-1),[]),children:c.jsx(J.div,{tabIndex:x||T===0?-1:0,"data-orientation":r,...p,ref:g,style:{outline:"none",...e.style},onMouseDown:j(e.onMouseDown,()=>{M.current=!0}),onFocus:j(e.onFocus,R=>{const I=!M.current;if(R.target===R.currentTarget&&I&&!x){const z=new CustomEvent(cn,Yd);if(R.currentTarget.dispatchEvent(z),!z.defaultPrevented){const U=S().filter(D=>D.focusable),G=U.find(D=>D.active),W=U.find(D=>D.id===h),Y=[G,W,...U].filter(Boolean).map(D=>D.ref.current);Ya(Y,d)}}M.current=!1}),onBlur:j(e.onBlur,()=>y(!1))})})}),Ua="RovingFocusGroupItem",Ka=l.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:a,children:s,...i}=e,u=xe(),f=a||u,d=Jd(Ua,n),p=d.currentTabStopId===f,m=Ba(n),{onFocusableItemAdd:g,onFocusableItemRemove:b,currentTabStopId:h}=d;return l.useEffect(()=>{if(r)return g(),()=>b()},[r,g,b]),c.jsx(wn.ItemSlot,{scope:n,id:f,focusable:r,active:o,children:c.jsx(J.span,{tabIndex:p?0:-1,"data-orientation":d.orientation,...i,ref:t,onMouseDown:j(e.onMouseDown,v=>{r?d.onItemFocus(f):v.preventDefault()}),onFocus:j(e.onFocus,()=>d.onItemFocus(f)),onKeyDown:j(e.onKeyDown,v=>{if(v.key==="Tab"&&v.shiftKey){d.onItemShiftTab();return}if(v.target!==v.currentTarget)return;const x=nf(v,d.orientation,d.dir);if(x!==void 0){if(v.metaKey||v.ctrlKey||v.altKey||v.shiftKey)return;v.preventDefault();let C=m().filter(S=>S.focusable).map(S=>S.ref.current);if(x==="last")C.reverse();else if(x==="prev"||x==="next"){x==="prev"&&C.reverse();const S=C.indexOf(v.currentTarget);C=d.loop?rf(C,S+1):C.slice(S+1)}setTimeout(()=>Ya(C))}}),children:typeof s=="function"?s({isCurrentTabStop:p,hasTabStop:h!=null}):s})})});Ka.displayName=Ua;var ef={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function tf(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function nf(e,t,n){const r=tf(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return ef[r]}function Ya(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function rf(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var of=Wa,af=Ka,yn=["Enter"," "],sf=["ArrowDown","PageUp","Home"],Za=["ArrowUp","PageDown","End"],cf=[...sf,...Za],lf={ltr:[...yn,"ArrowRight"],rtl:[...yn,"ArrowLeft"]},uf={ltr:["ArrowLeft"],rtl:["ArrowRight"]},ut="Menu",[ot,df,ff]=Ha(ut),[De,Xa]=je(ut,[ff,Bt,Ga]),dt=Bt(),qa=Ga(),[Ja,Pe]=De(ut),[pf,ft]=De(ut),Qa=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:o,onOpenChange:a,modal:s=!0}=e,i=dt(t),[u,f]=l.useState(null),d=l.useRef(!1),p=he(a),m=Va(o);return l.useEffect(()=>{const g=()=>{d.current=!0,document.addEventListener("pointerdown",b,{capture:!0,once:!0}),document.addEventListener("pointermove",b,{capture:!0,once:!0})},b=()=>d.current=!1;return document.addEventListener("keydown",g,{capture:!0}),()=>{document.removeEventListener("keydown",g,{capture:!0}),document.removeEventListener("pointerdown",b,{capture:!0}),document.removeEventListener("pointermove",b,{capture:!0})}},[]),c.jsx(Un,{...i,children:c.jsx(Ja,{scope:t,open:n,onOpenChange:p,content:u,onContentChange:f,children:c.jsx(pf,{scope:t,onClose:l.useCallback(()=>p(!1),[p]),isUsingKeyboardRef:d,dir:m,modal:s,children:r})})})};Qa.displayName=ut;var mf="MenuAnchor",qn=l.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=dt(n);return c.jsx(ga,{...o,...r,ref:t})});qn.displayName=mf;var Jn="MenuPortal",[hf,es]=De(Jn,{forceMount:void 0}),ts=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:o}=e,a=Pe(Jn,t);return c.jsx(hf,{scope:t,forceMount:n,children:c.jsx(Ce,{present:n||a.open,children:c.jsx(kn,{asChild:!0,container:o,children:r})})})};ts.displayName=Jn;var ce="MenuContent",[gf,Qn]=De(ce),ns=l.forwardRef((e,t)=>{const n=es(ce,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,a=Pe(ce,e.__scopeMenu),s=ft(ce,e.__scopeMenu);return c.jsx(ot.Provider,{scope:e.__scopeMenu,children:c.jsx(Ce,{present:r||a.open,children:c.jsx(ot.Slot,{scope:e.__scopeMenu,children:s.modal?c.jsx(vf,{...o,ref:t}):c.jsx(bf,{...o,ref:t})})})})}),vf=l.forwardRef((e,t)=>{const n=Pe(ce,e.__scopeMenu),r=l.useRef(null),o=te(t,r);return l.useEffect(()=>{const a=r.current;if(a)return Ro(a)},[]),c.jsx(er,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:j(e.onFocusOutside,a=>a.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),bf=l.forwardRef((e,t)=>{const n=Pe(ce,e.__scopeMenu);return c.jsx(er,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),xf=Ve("MenuContent.ScrollLock"),er=l.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:o,onOpenAutoFocus:a,onCloseAutoFocus:s,disableOutsidePointerEvents:i,onEntryFocus:u,onEscapeKeyDown:f,onPointerDownOutside:d,onFocusOutside:p,onInteractOutside:m,onDismiss:g,disableOutsideScroll:b,...h}=e,v=Pe(ce,n),x=ft(ce,n),y=dt(n),C=qa(n),S=df(n),[M,T]=l.useState(null),k=l.useRef(null),R=te(t,k,v.onContentChange),I=l.useRef(0),z=l.useRef(""),U=l.useRef(0),G=l.useRef(null),W=l.useRef("right"),H=l.useRef(0),Y=b?An:l.Fragment,D=b?{as:xf,allowPinchZoom:!0}:void 0,V=_=>{var B,X;const w=z.current+_,O=S().filter(q=>!q.disabled),F=document.activeElement,$=(B=O.find(q=>q.ref.current===F))==null?void 0:B.textValue,K=O.map(q=>q.textValue),Q=_f(K,w,$),oe=(X=O.find(q=>q.textValue===Q))==null?void 0:X.ref.current;(function q(ae){z.current=ae,window.clearTimeout(I.current),ae!==""&&(I.current=window.setTimeout(()=>q(""),1e3))})(w),oe&&setTimeout(()=>oe.focus())};l.useEffect(()=>()=>window.clearTimeout(I.current),[]),go();const E=l.useCallback(_=>{var O,F;return W.current===((O=G.current)==null?void 0:O.side)&&Of(_,(F=G.current)==null?void 0:F.area)},[]);return c.jsx(gf,{scope:n,searchRef:z,onItemEnter:l.useCallback(_=>{E(_)&&_.preventDefault()},[E]),onItemLeave:l.useCallback(_=>{var w;E(_)||((w=k.current)==null||w.focus(),T(null))},[E]),onTriggerLeave:l.useCallback(_=>{E(_)&&_.preventDefault()},[E]),pointerGraceTimerRef:U,onPointerGraceIntentChange:l.useCallback(_=>{G.current=_},[]),children:c.jsx(Y,{...D,children:c.jsx(Mn,{asChild:!0,trapped:o,onMountAutoFocus:j(a,_=>{var w;_.preventDefault(),(w=k.current)==null||w.focus({preventScroll:!0})}),onUnmountAutoFocus:s,children:c.jsx(Lt,{asChild:!0,disableOutsidePointerEvents:i,onEscapeKeyDown:f,onPointerDownOutside:d,onFocusOutside:p,onInteractOutside:m,onDismiss:g,children:c.jsx(of,{asChild:!0,...C,dir:x.dir,orientation:"vertical",loop:r,currentTabStopId:M,onCurrentTabStopIdChange:T,onEntryFocus:j(u,_=>{x.isUsingKeyboardRef.current||_.preventDefault()}),preventScrollOnEntryFocus:!0,children:c.jsx(va,{role:"menu","aria-orientation":"vertical","data-state":xs(v.open),"data-radix-menu-content":"",dir:x.dir,...y,...h,ref:R,style:{outline:"none",...h.style},onKeyDown:j(h.onKeyDown,_=>{const O=_.target.closest("[data-radix-menu-content]")===_.currentTarget,F=_.ctrlKey||_.altKey||_.metaKey,$=_.key.length===1;O&&(_.key==="Tab"&&_.preventDefault(),!F&&$&&V(_.key));const K=k.current;if(_.target!==K||!cf.includes(_.key))return;_.preventDefault();const oe=S().filter(B=>!B.disabled).map(B=>B.ref.current);Za.includes(_.key)&&oe.reverse(),Pf(oe)}),onBlur:j(e.onBlur,_=>{_.currentTarget.contains(_.target)||(window.clearTimeout(I.current),z.current="")}),onPointerMove:j(e.onPointerMove,at(_=>{const w=_.target,O=H.current!==_.clientX;if(_.currentTarget.contains(w)&&O){const F=_.clientX>H.current?"right":"left";W.current=F,H.current=_.clientX}}))})})})})})})});ns.displayName=ce;var wf="MenuGroup",tr=l.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return c.jsx(J.div,{role:"group",...r,ref:t})});tr.displayName=wf;var yf="MenuLabel",rs=l.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return c.jsx(J.div,{...r,ref:t})});rs.displayName=yf;var Tt="MenuItem",zr="menu.itemSelect",Yt=l.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...o}=e,a=l.useRef(null),s=ft(Tt,e.__scopeMenu),i=Qn(Tt,e.__scopeMenu),u=te(t,a),f=l.useRef(!1),d=()=>{const p=a.current;if(!n&&p){const m=new CustomEvent(zr,{bubbles:!0,cancelable:!0});p.addEventListener(zr,g=>r==null?void 0:r(g),{once:!0}),Ur(p,m),m.defaultPrevented?f.current=!1:s.onClose()}};return c.jsx(os,{...o,ref:u,disabled:n,onClick:j(e.onClick,d),onPointerDown:p=>{var m;(m=e.onPointerDown)==null||m.call(e,p),f.current=!0},onPointerUp:j(e.onPointerUp,p=>{var m;f.current||(m=p.currentTarget)==null||m.click()}),onKeyDown:j(e.onKeyDown,p=>{const m=i.searchRef.current!=="";n||m&&p.key===" "||yn.includes(p.key)&&(p.currentTarget.click(),p.preventDefault())})})});Yt.displayName=Tt;var os=l.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:o,...a}=e,s=Qn(Tt,n),i=qa(n),u=l.useRef(null),f=te(t,u),[d,p]=l.useState(!1),[m,g]=l.useState("");return l.useEffect(()=>{const b=u.current;b&&g((b.textContent??"").trim())},[a.children]),c.jsx(ot.ItemSlot,{scope:n,disabled:r,textValue:o??m,children:c.jsx(af,{asChild:!0,...i,focusable:!r,children:c.jsx(J.div,{role:"menuitem","data-highlighted":d?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...a,ref:f,onPointerMove:j(e.onPointerMove,at(b=>{r?s.onItemLeave(b):(s.onItemEnter(b),b.defaultPrevented||b.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:j(e.onPointerLeave,at(b=>s.onItemLeave(b))),onFocus:j(e.onFocus,()=>p(!0)),onBlur:j(e.onBlur,()=>p(!1))})})})}),Cf="MenuCheckboxItem",as=l.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...o}=e;return c.jsx(us,{scope:e.__scopeMenu,checked:n,children:c.jsx(Yt,{role:"menuitemcheckbox","aria-checked":Ot(n)?"mixed":n,...o,ref:t,"data-state":or(n),onSelect:j(o.onSelect,()=>r==null?void 0:r(Ot(n)?!0:!n),{checkForDefaultPrevented:!1})})})});as.displayName=Cf;var ss="MenuRadioGroup",[Sf,Ef]=De(ss,{value:void 0,onValueChange:()=>{}}),is=l.forwardRef((e,t)=>{const{value:n,onValueChange:r,...o}=e,a=he(r);return c.jsx(Sf,{scope:e.__scopeMenu,value:n,onValueChange:a,children:c.jsx(tr,{...o,ref:t})})});is.displayName=ss;var cs="MenuRadioItem",ls=l.forwardRef((e,t)=>{const{value:n,...r}=e,o=Ef(cs,e.__scopeMenu),a=n===o.value;return c.jsx(us,{scope:e.__scopeMenu,checked:a,children:c.jsx(Yt,{role:"menuitemradio","aria-checked":a,...r,ref:t,"data-state":or(a),onSelect:j(r.onSelect,()=>{var s;return(s=o.onValueChange)==null?void 0:s.call(o,n)},{checkForDefaultPrevented:!1})})})});ls.displayName=cs;var nr="MenuItemIndicator",[us,Rf]=De(nr,{checked:!1}),ds=l.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...o}=e,a=Rf(nr,n);return c.jsx(Ce,{present:r||Ot(a.checked)||a.checked===!0,children:c.jsx(J.span,{...o,ref:t,"data-state":or(a.checked)})})});ds.displayName=nr;var Mf="MenuSeparator",fs=l.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return c.jsx(J.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});fs.displayName=Mf;var kf="MenuArrow",ps=l.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=dt(n);return c.jsx(ba,{...o,...r,ref:t})});ps.displayName=kf;var rr="MenuSub",[Af,ms]=De(rr),hs=e=>{const{__scopeMenu:t,children:n,open:r=!1,onOpenChange:o}=e,a=Pe(rr,t),s=dt(t),[i,u]=l.useState(null),[f,d]=l.useState(null),p=he(o);return l.useEffect(()=>(a.open===!1&&p(!1),()=>p(!1)),[a.open,p]),c.jsx(Un,{...s,children:c.jsx(Ja,{scope:t,open:r,onOpenChange:p,content:f,onContentChange:d,children:c.jsx(Af,{scope:t,contentId:xe(),triggerId:xe(),trigger:i,onTriggerChange:u,children:n})})})};hs.displayName=rr;var et="MenuSubTrigger",gs=l.forwardRef((e,t)=>{const n=Pe(et,e.__scopeMenu),r=ft(et,e.__scopeMenu),o=ms(et,e.__scopeMenu),a=Qn(et,e.__scopeMenu),s=l.useRef(null),{pointerGraceTimerRef:i,onPointerGraceIntentChange:u}=a,f={__scopeMenu:e.__scopeMenu},d=l.useCallback(()=>{s.current&&window.clearTimeout(s.current),s.current=null},[]);return l.useEffect(()=>d,[d]),l.useEffect(()=>{const p=i.current;return()=>{window.clearTimeout(p),u(null)}},[i,u]),c.jsx(qn,{asChild:!0,...f,children:c.jsx(os,{id:o.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":o.contentId,"data-state":xs(n.open),...e,ref:jt(t,o.onTriggerChange),onClick:p=>{var m;(m=e.onClick)==null||m.call(e,p),!(e.disabled||p.defaultPrevented)&&(p.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:j(e.onPointerMove,at(p=>{a.onItemEnter(p),!p.defaultPrevented&&!e.disabled&&!n.open&&!s.current&&(a.onPointerGraceIntentChange(null),s.current=window.setTimeout(()=>{n.onOpenChange(!0),d()},100))})),onPointerLeave:j(e.onPointerLeave,at(p=>{var g,b;d();const m=(g=n.content)==null?void 0:g.getBoundingClientRect();if(m){const h=(b=n.content)==null?void 0:b.dataset.side,v=h==="right",x=v?-5:5,y=m[v?"left":"right"],C=m[v?"right":"left"];a.onPointerGraceIntentChange({area:[{x:p.clientX+x,y:p.clientY},{x:y,y:m.top},{x:C,y:m.top},{x:C,y:m.bottom},{x:y,y:m.bottom}],side:h}),window.clearTimeout(i.current),i.current=window.setTimeout(()=>a.onPointerGraceIntentChange(null),300)}else{if(a.onTriggerLeave(p),p.defaultPrevented)return;a.onPointerGraceIntentChange(null)}})),onKeyDown:j(e.onKeyDown,p=>{var g;const m=a.searchRef.current!=="";e.disabled||m&&p.key===" "||lf[r.dir].includes(p.key)&&(n.onOpenChange(!0),(g=n.content)==null||g.focus(),p.preventDefault())})})})});gs.displayName=et;var vs="MenuSubContent",bs=l.forwardRef((e,t)=>{const n=es(ce,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,a=Pe(ce,e.__scopeMenu),s=ft(ce,e.__scopeMenu),i=ms(vs,e.__scopeMenu),u=l.useRef(null),f=te(t,u);return c.jsx(ot.Provider,{scope:e.__scopeMenu,children:c.jsx(Ce,{present:r||a.open,children:c.jsx(ot.Slot,{scope:e.__scopeMenu,children:c.jsx(er,{id:i.contentId,"aria-labelledby":i.triggerId,...o,ref:f,align:"start",side:s.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:d=>{var p;s.isUsingKeyboardRef.current&&((p=u.current)==null||p.focus()),d.preventDefault()},onCloseAutoFocus:d=>d.preventDefault(),onFocusOutside:j(e.onFocusOutside,d=>{d.target!==i.trigger&&a.onOpenChange(!1)}),onEscapeKeyDown:j(e.onEscapeKeyDown,d=>{s.onClose(),d.preventDefault()}),onKeyDown:j(e.onKeyDown,d=>{var g;const p=d.currentTarget.contains(d.target),m=uf[s.dir].includes(d.key);p&&m&&(a.onOpenChange(!1),(g=i.trigger)==null||g.focus(),d.preventDefault())})})})})})});bs.displayName=vs;function xs(e){return e?"open":"closed"}function Ot(e){return e==="indeterminate"}function or(e){return Ot(e)?"indeterminate":e?"checked":"unchecked"}function Pf(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function Nf(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function _f(e,t,n){const o=t.length>1&&Array.from(t).every(f=>f===t[0])?t[0]:t,a=n?e.indexOf(n):-1;let s=Nf(e,Math.max(a,0));o.length===1&&(s=s.filter(f=>f!==n));const u=s.find(f=>f.toLowerCase().startsWith(o.toLowerCase()));return u!==n?u:void 0}function Tf(e,t){const{x:n,y:r}=e;let o=!1;for(let a=0,s=t.length-1;a<t.length;s=a++){const i=t[a],u=t[s],f=i.x,d=i.y,p=u.x,m=u.y;d>r!=m>r&&n<(p-f)*(r-d)/(m-d)+f&&(o=!o)}return o}function Of(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return Tf(n,t)}function at(e){return t=>t.pointerType==="mouse"?e(t):void 0}var jf=Qa,Df=qn,If=ts,Lf=ns,Ff=tr,$f=rs,zf=Yt,Hf=as,Vf=is,Bf=ls,Gf=ds,Wf=fs,Uf=ps,Kf=hs,Yf=gs,Zf=bs,Zt="DropdownMenu",[Xf,Xp]=je(Zt,[Xa]),re=Xa(),[qf,ws]=Xf(Zt),ys=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:o,defaultOpen:a,onOpenChange:s,modal:i=!0}=e,u=re(t),f=l.useRef(null),[d,p]=st({prop:o,defaultProp:a??!1,onChange:s,caller:Zt});return c.jsx(qf,{scope:t,triggerId:xe(),triggerRef:f,contentId:xe(),open:d,onOpenChange:p,onOpenToggle:l.useCallback(()=>p(m=>!m),[p]),modal:i,children:c.jsx(jf,{...u,open:d,onOpenChange:p,dir:r,modal:i,children:n})})};ys.displayName=Zt;var Cs="DropdownMenuTrigger",Ss=l.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...o}=e,a=ws(Cs,n),s=re(n);return c.jsx(Df,{asChild:!0,...s,children:c.jsx(J.button,{type:"button",id:a.triggerId,"aria-haspopup":"menu","aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":a.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...o,ref:jt(t,a.triggerRef),onPointerDown:j(e.onPointerDown,i=>{!r&&i.button===0&&i.ctrlKey===!1&&(a.onOpenToggle(),a.open||i.preventDefault())}),onKeyDown:j(e.onKeyDown,i=>{r||(["Enter"," "].includes(i.key)&&a.onOpenToggle(),i.key==="ArrowDown"&&a.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(i.key)&&i.preventDefault())})})})});Ss.displayName=Cs;var Jf="DropdownMenuPortal",Es=e=>{const{__scopeDropdownMenu:t,...n}=e,r=re(t);return c.jsx(If,{...r,...n})};Es.displayName=Jf;var Rs="DropdownMenuContent",Ms=l.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=ws(Rs,n),a=re(n),s=l.useRef(!1);return c.jsx(Lf,{id:o.contentId,"aria-labelledby":o.triggerId,...a,...r,ref:t,onCloseAutoFocus:j(e.onCloseAutoFocus,i=>{var u;s.current||(u=o.triggerRef.current)==null||u.focus(),s.current=!1,i.preventDefault()}),onInteractOutside:j(e.onInteractOutside,i=>{const u=i.detail.originalEvent,f=u.button===0&&u.ctrlKey===!0,d=u.button===2||f;(!o.modal||d)&&(s.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});Ms.displayName=Rs;var Qf="DropdownMenuGroup",ks=l.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=re(n);return c.jsx(Ff,{...o,...r,ref:t})});ks.displayName=Qf;var ep="DropdownMenuLabel",As=l.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=re(n);return c.jsx($f,{...o,...r,ref:t})});As.displayName=ep;var tp="DropdownMenuItem",Ps=l.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=re(n);return c.jsx(zf,{...o,...r,ref:t})});Ps.displayName=tp;var np="DropdownMenuCheckboxItem",Ns=l.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=re(n);return c.jsx(Hf,{...o,...r,ref:t})});Ns.displayName=np;var rp="DropdownMenuRadioGroup",_s=l.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=re(n);return c.jsx(Vf,{...o,...r,ref:t})});_s.displayName=rp;var op="DropdownMenuRadioItem",Ts=l.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=re(n);return c.jsx(Bf,{...o,...r,ref:t})});Ts.displayName=op;var ap="DropdownMenuItemIndicator",Os=l.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=re(n);return c.jsx(Gf,{...o,...r,ref:t})});Os.displayName=ap;var sp="DropdownMenuSeparator",js=l.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=re(n);return c.jsx(Wf,{...o,...r,ref:t})});js.displayName=sp;var ip="DropdownMenuArrow",cp=l.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=re(n);return c.jsx(Uf,{...o,...r,ref:t})});cp.displayName=ip;var lp=e=>{const{__scopeDropdownMenu:t,children:n,open:r,onOpenChange:o,defaultOpen:a}=e,s=re(t),[i,u]=st({prop:r,defaultProp:a??!1,onChange:o,caller:"DropdownMenuSub"});return c.jsx(Kf,{...s,open:i,onOpenChange:u,children:n})},up="DropdownMenuSubTrigger",Ds=l.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=re(n);return c.jsx(Yf,{...o,...r,ref:t})});Ds.displayName=up;var dp="DropdownMenuSubContent",Is=l.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=re(n);return c.jsx(Zf,{...o,...r,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});Is.displayName=dp;var fp=ys,pp=Ss,Ls=Es,mp=Ms,hp=ks,gp=As,vp=Ps,bp=Ns,xp=_s,wp=Ts,Fs=Os,yp=js,Cp=lp,Sp=Ds,Ep=Is;function $s({...e}){return c.jsx(fp,{"data-slot":"dropdown-menu",...e})}function Rp({...e}){return c.jsx(Ls,{"data-slot":"dropdown-menu-portal",...e})}function zs({...e}){return c.jsx(pp,{"data-slot":"dropdown-menu-trigger",...e})}function Hs({className:e,sideOffset:t=4,...n}){return c.jsx(Ls,{children:c.jsx(mp,{"data-slot":"dropdown-menu-content",sideOffset:t,className:A("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-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 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",e),...n})})}function Mp({...e}){return c.jsx(hp,{"data-slot":"dropdown-menu-group",...e})}function Cn({className:e,inset:t,variant:n="default",...r}){return c.jsx(vp,{"data-slot":"dropdown-menu-item","data-inset":t,"data-variant":n,className:A("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...r})}function kp({className:e,children:t,checked:n,...r}){return c.jsxs(bp,{"data-slot":"dropdown-menu-checkbox-item",className:A("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),checked:n,...r,children:[c.jsx("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:c.jsx(Fs,{children:c.jsx(dc,{className:"size-4"})})}),t]})}function Ap({...e}){return c.jsx(xp,{"data-slot":"dropdown-menu-radio-group",...e})}function Pp({className:e,children:t,...n}){return c.jsxs(wp,{"data-slot":"dropdown-menu-radio-item",className:A("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...n,children:[c.jsx("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:c.jsx(Fs,{children:c.jsx(bc,{className:"size-2 fill-current"})})}),t]})}function Vs({className:e,inset:t,...n}){return c.jsx(gp,{"data-slot":"dropdown-menu-label","data-inset":t,className:A("px-2 py-1.5 text-sm font-medium data-[inset]:pl-8",e),...n})}function Bs({className:e,...t}){return c.jsx(yp,{"data-slot":"dropdown-menu-separator",className:A("bg-border -mx-1 my-1 h-px",e),...t})}function Np({className:e,...t}){return c.jsx("span",{"data-slot":"dropdown-menu-shortcut",className:A("text-muted-foreground ml-auto text-xs tracking-widest",e),...t})}function _p({...e}){return c.jsx(Cp,{"data-slot":"dropdown-menu-sub",...e})}function Tp({className:e,inset:t,children:n,...r}){return c.jsxs(Sp,{"data-slot":"dropdown-menu-sub-trigger","data-inset":t,className:A("focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex cursor-default items-center rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[inset]:pl-8",e),...r,children:[n,c.jsx(co,{className:"ml-auto size-4"})]})}function Op({className:e,...t}){return c.jsx(Ep,{"data-slot":"dropdown-menu-sub-content",className:A("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-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 z-50 min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg",e),...t})}const Gs=({onLogout:e})=>{const{user:t,error:n,isLoading:r}=Vr.useUser(),o=async()=>{try{e&&await e(),window.location.href="/auth/logout"}catch(a){console.error("Error during logout:",a),window.location.href="/auth/logout"}};return r?c.jsx("div",{className:"h-10 w-10 animate-pulse rounded-full bg-gray-200"}):n?c.jsxs("div",{children:["Error: ",n.message]}):t?c.jsx("div",{className:"relative flex items-center gap-3",children:c.jsxs($s,{children:[c.jsx(zs,{asChild:!0,children:c.jsx(It,{variant:"ghost",size:"lg",className:"rounded-full cursor-pointer p-0",children:t.picture?c.jsx("img",{src:t.picture,alt:t.name||"User profile",width:40,height:40,className:"rounded-full"}):c.jsx(xr,{className:"h-5 w-5 text-gray-500"})})}),c.jsxs(Hs,{align:"end",className:"w-72",children:[c.jsx(Vs,{children:c.jsx("div",{className:"flex flex-col space-y-1",children:c.jsxs("div",{className:"flex flex-col space-y-1",children:[c.jsx("p",{className:"text-xs text-gray-500",children:t.name}),c.jsx("p",{className:"truncate text-xs text-gray-500",children:t.email})]})})}),c.jsx(Bs,{}),c.jsx(Cn,{asChild:!0,children:c.jsxs("a",{href:"/profile",className:"flex w-full cursor-default",children:[c.jsx(xr,{className:"mr-2 h-4 w-4"}),c.jsx("span",{children:"Profile"})]})}),c.jsxs(Cn,{onClick:o,children:[c.jsx(yc,{className:"mr-2 h-4 w-4"}),c.jsx("span",{children:"Sign out"})]})]})]})}):null},Ws=({onLogout:e})=>c.jsx("div",{className:"sticky top-0 z-50 bg-white",children:c.jsxs("header",{className:"flex h-16 items-center justify-between border-b bg-white px-4",children:[c.jsxs("div",{className:"flex h-full items-center gap-4 flex-1 min-w-0 overflow-hidden",children:[c.jsx(_a,{}),c.jsx(Dt,{orientation:"vertical"})]}),c.jsx("div",{className:"flex-shrink-0",children:c.jsx(Gs,{onLogout:e})})]})});function jp({className:e,...t}){return c.jsx("div",{"data-slot":"card",className:A("bg-card text-card-foreground flex flex-col gap-4 rounded-xl py-6 shadow-sm",e),...t})}function Dp({className:e,...t}){return c.jsx("div",{"data-slot":"card-header",className:A("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-1 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",e),...t})}function Ip({className:e,...t}){return c.jsx("div",{"data-slot":"card-title",className:A("leading-none font-semibold",e),...t})}function Lp({className:e,...t}){return c.jsx("div",{"data-slot":"card-description",className:A("text-muted-foreground text-sm",e),...t})}function Fp({className:e,...t}){return c.jsx("div",{"data-slot":"card-action",className:A("col-start-2 row-span-2 row-start-1 self-start justify-self-end",e),...t})}function $p({className:e,...t}){return c.jsx("div",{"data-slot":"card-content",className:A("px-6",e),...t})}function zp({className:e,...t}){return c.jsx("div",{"data-slot":"card-footer",className:A("flex items-center px-6 [.border-t]:pt-6",e),...t})}function Us({title:e,url:t,children:n,defaultOpen:r=!1,icon:o,isActive:a=!1,className:s,disabled:i=!1}){const[u,f]=l.useState(r);l.useEffect(()=>{a&&f(!0)},[a]);const d=!i&&t;return c.jsx(Ia,{className:s,children:c.jsxs("div",{className:"flex flex-col",children:[c.jsxs("div",{className:"flex flex-row items-center justify-between",children:[d?c.jsxs("a",{href:t,className:A("flex flex-1 cursor-pointer items-center gap-2 rounded-lg p-2 transition-colors hover:bg-gray-100"),children:[o&&c.jsx("span",{className:A("text-gray-600"),children:o}),c.jsx("span",{className:A("text-gray-600"),children:e})]}):c.jsxs("div",{className:A("flex flex-1 items-center gap-2 rounded-lg p-2",i&&"cursor-default"),children:[o&&c.jsx("span",{className:A("text-gray-600"),children:o}),c.jsx("span",{className:A("text-gray-600"),children:e})]}),c.jsx("button",{type:"button",className:A("mr-3 rounded-lg p-2 text-gray-500",i?"cursor-default opacity-50":"hover:bg-gray-100 hover:text-gray-700"),onClick:p=>{p.preventDefault(),p.stopPropagation(),i||f(!u)},disabled:i,"aria-label":u?"Collapse section":"Expand section",children:u?c.jsx(pc,{className:"h-4 w-4"}):c.jsx(co,{className:"h-4 w-4"})})]}),c.jsx("div",{className:A("overflow-hidden transition-all",u&&!i?"max-h-96":"max-h-0"),children:n})]})})}const Hp="data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20141%2060'%3e%3cpath%20d='M0.059%2019.711V59.673H19.509V49.95H9.779V19.711H0.059Z'%20fill='%2385B9D1'%3e%3c/path%3e%3cpath%20d='M0%200L0.056%204.915V19.715H9.776V9.715H19.5V59.673H29.22V0H0Z'%20fill='%23F68029'%3e%3c/path%3e%3cpath%20d='M23.49%2019.717H9.776V29.439H23.49V19.717Z'%20fill='%23F68029'%3e%3c/path%3e%3cpath%20d='M0.0580006%2019.718L9.785%2029.445V19.718H0.0580006Z'%20fill='%230A3763'%3e%3c/path%3e%3cpath%20d='M9.777%2049.953L19.504%2059.679V49.953H9.777Z'%20fill='%230A3763'%3e%3c/path%3e%3cpath%20d='M50.213%2021.331C50.1839%2019.244%2050.325%2017.1581%2050.635%2015.094C50.8293%2013.6891%2051.2694%2012.3294%2051.935%2011.077C52.4295%2010.1519%2053.1979%209.4023%2054.135%208.93101C55.1033%208.49691%2056.1561%208.28375%2057.217%208.307C58.2628%208.27673%2059.3024%208.47715%2060.262%208.894C61.1441%209.33605%2061.8541%2010.059%2062.28%2010.949C62.8725%2012.1976%2063.2507%2013.5369%2063.399%2014.911C63.6554%2016.9922%2063.7717%2019.0882%2063.747%2021.185C63.7759%2023.338%2063.6421%2025.4901%2063.347%2027.623C63.1657%2029.0675%2062.7378%2030.4702%2062.082%2031.77C61.6022%2032.7122%2060.8471%2033.4862%2059.917%2033.989C58.9503%2034.4507%2057.888%2034.6768%2056.817%2034.649C55.7687%2034.6771%2054.7258%2034.4896%2053.753%2034.098C52.8534%2033.6775%2052.1275%2032.9579%2051.699%2032.062C51.0884%2030.7803%2050.7037%2029.4027%2050.562%2027.99C50.3018%2025.7802%2050.1852%2023.5559%2050.213%2021.331ZM54.913%2022.248C54.913%2023.6913%2054.9377%2024.9267%2054.987%2025.954C55.0147%2026.8043%2055.1127%2027.6509%2055.28%2028.485C55.3666%2029.0149%2055.5877%2029.5138%2055.922%2029.934C56.0643%2030.0868%2056.238%2030.207%2056.4312%2030.2862C56.6244%2030.3655%2056.8324%2030.4019%2057.041%2030.393C57.25%2030.3964%2057.4571%2030.3533%2057.6473%2030.2668C57.8375%2030.1803%2058.0062%2030.0526%2058.141%2029.893C58.4964%2029.4241%2058.7297%2028.8744%2058.82%2028.293C59.0025%2027.3609%2059.1128%2026.4161%2059.15%2025.467C59.2107%2024.3177%2059.2414%2022.936%2059.242%2021.322C59.242%2019.732%2059.224%2018.3747%2059.188%2017.25C59.169%2016.3373%2059.0736%2015.4278%2058.903%2014.531C58.8198%2013.9744%2058.5923%2013.4493%2058.243%2013.008C58.0929%2012.8491%2057.9104%2012.7244%2057.7078%2012.6422C57.5053%2012.5601%2057.2874%2012.5225%2057.069%2012.532C56.8667%2012.5304%2056.6668%2012.576%2056.4852%2012.6652C56.3036%2012.7544%2056.1453%2012.8848%2056.023%2013.046C55.6766%2013.5389%2055.4446%2014.103%2055.344%2014.697C55.1442%2015.6885%2055.0277%2016.695%2054.996%2017.706C54.9347%2018.9533%2054.904%2020.4697%2054.904%2022.255'%20fill='%230A3763'%3e%3c/path%3e%3cpath%20d='M83.329%2021.331C83.2999%2019.244%2083.441%2017.1581%2083.751%2015.094C83.9453%2013.6891%2084.3854%2012.3294%2085.051%2011.077C85.5455%2010.1519%2086.3139%209.40235%2087.251%208.93105C89.2087%208.112%2091.4106%208.09871%2093.378%208.89405C94.2601%209.33609%2094.9701%2010.0591%2095.396%2010.949C95.9885%2012.1976%2096.3667%2013.537%2096.515%2014.911C96.7714%2016.9922%2096.8877%2019.0883%2096.863%2021.185C96.8919%2023.3381%2096.7581%2025.4902%2096.463%2027.6231C96.2817%2029.0676%2095.8538%2030.4703%2095.198%2031.77C94.7182%2032.7123%2093.9631%2033.4862%2093.033%2033.989C92.0663%2034.4507%2091.004%2034.6769%2089.933%2034.649C88.8847%2034.6772%2087.8418%2034.4896%2086.869%2034.098C85.9694%2033.6775%2085.2435%2032.9579%2084.815%2032.062C84.2044%2030.7803%2083.8197%2029.4027%2083.678%2027.99C83.4178%2025.7803%2083.3012%2023.5559%2083.329%2021.331ZM88.029%2022.2481C88.029%2023.6914%2088.0537%2024.9267%2088.103%2025.954C88.1307%2026.8044%2088.2287%2027.6509%2088.396%2028.4851C88.4826%2029.015%2088.7037%2029.5139%2089.038%2029.934C89.1803%2030.0869%2089.354%2030.207%2089.5472%2030.2863C89.7404%2030.3655%2089.9484%2030.4019%2090.157%2030.393C90.366%2030.3964%2090.573%2030.3533%2090.7633%2030.2669C90.9535%2030.1804%2091.1222%2030.0527%2091.257%2029.893C91.6124%2029.4242%2091.8458%2028.8744%2091.936%2028.2931C92.1185%2027.3609%2092.2288%2026.4161%2092.266%2025.467C92.3267%2024.3177%2092.3574%2022.936%2092.358%2021.322C92.358%2019.732%2092.34%2018.3747%2092.304%2017.2501C92.2887%2016.3329%2092.1964%2015.4187%2092.028%2014.517C91.9448%2013.9605%2091.7173%2013.4354%2091.368%2012.994C91.2162%2012.8368%2091.0323%2012.7141%2090.8289%2012.6343C90.6255%2012.5544%2090.4072%2012.5192%2090.189%2012.531C89.9867%2012.5294%2089.7868%2012.575%2089.6052%2012.6643C89.4236%2012.7535%2089.2653%2012.8839%2089.143%2013.045C88.7966%2013.5379%2088.5646%2014.102%2088.464%2014.6961C88.2642%2015.6876%2088.1477%2016.6941%2088.116%2017.705C88.0547%2018.9524%2088.024%2020.4687%2088.024%2022.254'%20fill='%230A3763'%3e%3c/path%3e%3cpath%20d='M131.349%2034.65V8.32202H135.458V30.797H140.631V34.649L131.349%2034.65Z'%20fill='%230A3763'%3e%3c/path%3e%3cpath%20d='M71.95%2034.65V8.33203H76.059V30.796H81.232V34.648L71.95%2034.65Z'%20fill='%230A3763'%3e%3c/path%3e%3cpath%20d='M104.833%2014.692C104.934%2014.098%20105.166%2013.534%20105.512%2013.041C105.634%2012.8798%20105.793%2012.7494%20105.974%2012.6602C106.156%2012.571%20106.356%2012.5253%20106.558%2012.527H110.103V8.30798H106.703C105.642%208.2848%20104.589%208.49794%20103.621%208.93197C102.684%209.40306%20101.915%2010.1527%20101.421%2011.078C100.756%2012.3304%20100.316%2013.6901%20100.121%2015.095C99.8114%2017.1591%2099.6706%2019.245%2099.7%2021.332C99.6722%2023.5568%2099.7885%2025.7811%20100.048%2027.991C100.19%2029.4037%20100.574%2030.7812%20101.185%2032.063C101.614%2032.9584%20102.34%2033.6778%20103.239%2034.099C104.212%2034.4899%20105.255%2034.6771%20106.303%2034.649L110.103%2034.613V30.393H106.522C106.313%2030.402%20106.105%2030.3657%20105.912%2030.2866C105.719%2030.2076%20105.545%2030.0876%20105.403%2029.935C105.069%2029.5144%20104.848%2029.0152%20104.761%2028.485C104.594%2027.6509%20104.496%2026.8043%20104.468%2025.954C104.419%2024.9266%20104.394%2023.6916%20104.394%2022.249C104.394%2020.4636%20104.425%2018.9473%20104.486%2017.7C104.518%2016.6894%20104.633%2015.6832%20104.833%2014.692Z'%20fill='%230A3763'%3e%3c/path%3e%3cpath%20d='M46.728%2019.247H42.878V30.395H41.828C41.6182%2030.4039%2041.409%2030.3669%2041.2149%2030.2868C41.0208%2030.2067%2040.8465%2030.0853%2040.704%2029.931C40.3695%2029.5106%2040.1485%2029.0113%2040.062%2028.481C39.894%2027.647%2039.7956%2026.8004%2039.768%2025.95C39.7187%2024.9227%2039.6944%2023.6877%2039.695%2022.245C39.695%2020.4597%2039.7257%2018.9434%2039.787%2017.696C39.8191%2016.6854%2039.9355%2015.6792%2040.135%2014.688C40.2357%2014.094%2040.4677%2013.53%2040.814%2013.037C40.9376%2012.8768%2041.0968%2012.7476%2041.2791%2012.6598C41.4614%2012.5719%2041.6617%2012.5278%2041.864%2012.531H45.904V8.31202H42.012C40.9511%208.28877%2039.8983%208.50191%2038.93%208.93601C37.9927%209.40699%2037.2241%2010.1567%2036.73%2011.082C36.0644%2012.3344%2035.6243%2013.6941%2035.43%2015.099C35.1189%2017.1613%2034.9764%2019.2456%2035.004%2021.331C34.9762%2023.5559%2035.0925%2025.7802%2035.352%2027.99C35.494%2029.4026%2035.8787%2030.7802%2036.489%2032.062C36.9179%2032.9579%2037.6442%2033.6775%2038.544%2034.098C39.517%2034.4891%2040.5598%2034.6763%2041.608%2034.648L43.587%2034.629H46.727L46.728%2019.247Z'%20fill='%230A3763'%3e%3c/path%3e%3cpath%20d='M123.653%2029.87H118L116.691%2034.65H112.797L120.939%208L128.793%2034.65H124.856L123.653%2029.87ZM122.587%2026.212L120.893%2019.982L119.085%2026.212H122.587Z'%20fill='%230A3763'%3e%3c/path%3e%3cpath%20d='M39.016%2041.436H37.059V54.507H39.016V41.436Z'%20fill='%230A3763'%3e%3c/path%3e%3cpath%20d='M44.559%2041.436H46.384L48.331%2046.651C48.919%2048.1937%2049.4198%2049.7682%2049.831%2051.367C49.6744%2050.357%2049.5584%2049.4427%2049.483%2048.624C49.4077%2047.8054%2049.37%2047.0347%2049.37%2046.312V41.436H51.336V54.511H49.495L47.303%2048.627C47.103%2048.0797%2046.9134%2047.518%2046.734%2046.942C46.5547%2046.366%2046.39%2045.762%2046.24%2045.13C46.2274%2045.0507%2046.207%2044.9547%2046.179%2044.842C46.151%2044.7293%2046.1177%2044.5997%2046.079%2044.453C46.098%2044.6%2046.114%2044.725%2046.126%2044.829C46.138%2044.933%2046.148%2045.022%2046.154%2045.095L46.254%2046.424L46.354%2048.041C46.36%2048.131%2046.365%2048.241%2046.368%2048.371C46.371%2048.501%2046.368%2048.648%2046.368%2048.811L46.468%2054.511H44.559V41.436Z'%20fill='%230A3763'%3e%3c/path%3e%3cpath%20d='M55.493%2041.436H61.861V42.977H59.67V54.511H57.751V42.977H55.493V41.436Z'%20fill='%230A3763'%3e%3c/path%3e%3cpath%20d='M65.828%2041.436H71.028V42.926H67.787V47.065H70.665V48.555H67.787V53.016H71.028V54.506H65.828V41.436Z'%20fill='%230A3763'%3e%3c/path%3e%3cpath%20d='M75.906%2041.436H78.483C79.3332%2041.3696%2080.1787%2041.6132%2080.863%2042.122C81.2131%2042.4774%2081.4826%2042.904%2081.6531%2043.3729C81.8236%2043.8417%2081.8911%2044.3418%2081.851%2044.839C81.8876%2045.6248%2081.7066%2046.4055%2081.328%2047.095C81.1685%2047.3665%2080.9531%2047.6008%2080.696%2047.7826C80.4389%2047.9643%2080.1461%2048.0892%2079.837%2048.149L82.509%2054.507H80.525L77.863%2048.107V54.507H75.906V41.436ZM77.863%2047.227C78.1485%2047.2893%2078.4451%2047.279%2078.7256%2047.1969C79.0061%2047.1148%2079.2615%2046.9637%2079.4684%2046.7573C79.6753%2046.5509%2079.8271%2046.2959%2079.9098%2046.0156C79.9926%2045.7353%2080.0036%2045.4387%2079.942%2045.153C79.9472%2044.8034%2079.9137%2044.4543%2079.842%2044.112C79.7909%2043.8589%2079.6851%2043.62%2079.532%2043.412C79.3909%2043.2304%2079.2018%2043.0918%2078.986%2043.012C78.7308%2042.9221%2078.4615%2042.8791%2078.191%2042.885H77.862L77.863%2047.227Z'%20fill='%230A3763'%3e%3c/path%3e%3cpath%20d='M90.046%2041.06L85.913%2054.514H87.745L88.45%2051.974H91.496L92.135%2054.531H94.028L90.046%2041.06ZM88.876%2050.403L90.013%2046.703L91.048%2050.415L88.876%2050.403Z'%20fill='%230A3763'%3e%3c/path%3e%3cpath%20d='M106.344%2041.436H112.712V42.977H110.52V54.511H108.602V42.977H106.344V41.436Z'%20fill='%230A3763'%3e%3c/path%3e%3cpath%20d='M118.865%2041.462H116.908V54.533H118.865V41.462Z'%20fill='%230A3763'%3e%3c/path%3e%3cpath%20d='M134.181%2041.462H139.381V42.952H136.136V47.093H139.014V48.583H136.136V53.044H139.381V54.534H134.181V41.462Z'%20fill='%230A3763'%3e%3c/path%3e%3cpath%20d='M99.749%2044.338C99.8046%2044.0109%2099.9338%2043.7008%20100.127%2043.431C100.202%2043.3322%20100.3%2043.2523%20100.411%2043.1976C100.523%2043.1429%20100.646%2043.115%20100.77%2043.116H102.464V41.207H100.846C100.318%2041.1955%2099.7949%2041.3011%2099.313%2041.516C98.8543%2041.748%2098.4782%2042.1157%2098.236%2042.569C97.9008%2043.2016%2097.6788%2043.888%2097.58%2044.597C97.4215%2045.6561%2097.3493%2046.7263%2097.364%2047.797C97.3503%2048.9393%2097.4101%2050.0814%2097.543%2051.216C97.6145%2051.9294%2097.808%2052.6252%2098.115%2053.273C98.3244%2053.7086%2098.6776%2054.0586%2099.115%2054.264C99.6001%2054.458%20100.12%2054.5509%20100.642%2054.537L102.469%2054.52V52.61H100.755C100.629%2052.6147%20100.503%2052.592%20100.386%2052.5435C100.269%2052.495%20100.164%2052.4218%20100.078%2052.329C99.8888%2052.0951%2099.7637%2051.816%2099.715%2051.519C99.6273%2051.081%2099.5758%2050.6365%2099.561%2050.19C99.536%2049.66%2099.523%2049.014%2099.523%2048.27C99.523%2047.349%2099.539%2046.557%2099.57%2045.916C99.5873%2045.3865%2099.6485%2044.8594%2099.753%2044.34'%20fill='%230A3763'%3e%3c/path%3e%3cpath%20d='M128.799%2041.466L126.671%2048.91L124.671%2041.466H122.679L126.654%2054.953L130.774%2041.466H128.799Z'%20fill='%230A3763'%3e%3c/path%3e%3c/svg%3e";function Ks(){const[e,t]=Z.useState("");return Z.useEffect(()=>{t(window.location.pathname);const r=()=>{t(window.location.pathname)},o=()=>{t(window.location.pathname)};return window.addEventListener("popstate",r),window.addEventListener("pushstate",o),window.addEventListener("replacestate",o),()=>{window.removeEventListener("popstate",r),window.removeEventListener("pushstate",o),window.removeEventListener("replacestate",o)}},[]),{currentPath:e,isActiveRoute:r=>!!(e===r||r!=="/"&&e.startsWith(r))}}const Ys=Z.createContext(void 0),Zs=()=>{const e=Z.useContext(Ys);if(e===void 0)throw new Error("usePermissions must be used within PermissionsProvider");return e};function Vp({children:e,fetchPermissionsEndpoint:t="/api/auth/permissions",initialPermissions:n}){const[r,o]=Z.useState(n||{essentialInsights:!1,organic:!1,paid:!1,web:!1,priceMonster:!1,se_company_id:null}),[a,s]=Z.useState(!n),[i,u]=Z.useState(null),f=async()=>{try{s(!0),u(null);const d=await fetch(t);if(!d.ok)throw new Error(`Failed to fetch permissions: ${d.statusText}`);const p=await d.json();o(p)}catch(d){console.error("Error fetching product access:",d),u(d instanceof Error?d:new Error("Unknown error"))}finally{s(!1)}};return Z.useEffect(()=>{n||f()},[n]),c.jsx(Ys.Provider,{value:{permissions:r,loading:a,error:i,fetchPermissions:f},children:e})}const Bp={navMain:[{title:"Essential Insights",key:"essentialInsights",url:"/essential-insights/overall-performance",icon:c.jsx(lc,{className:"h-5 w-5"}),items:[{title:"Overall Performance",url:"/essential-insights/overall-performance",icon:c.jsx(lo,{className:"h-4 w-4"})},{title:"Organic Performance",url:"/essential-insights/organic-performance",icon:c.jsx(br,{className:"h-4 w-4"})},{title:"Paid Performance",url:"/essential-insights/paid-performance",icon:c.jsx(sc,{className:"h-4 w-4"})},{title:"Keyword Performance",url:"/essential-insights/keyword-performance",icon:c.jsx(br,{className:"h-4 w-4"})},{title:"More Components",url:"/essential-insights/more-components",icon:c.jsx(vt,{className:"h-4 w-4"})}]},{title:"Price Monster",key:"priceMonster",url:"/price-monster",icon:c.jsx(gc,{className:"h-4 w-4"}),items:[{title:"Dashboard",url:"/price-monster/dashboard",icon:c.jsx(vt,{className:"h-4 w-4"})},{title:"Documentation",url:"/price-monster/documentation",icon:c.jsx(tc,{className:"h-4 w-4"})},{title:"Subscriptions",url:"/price-monster/subscriptions",icon:c.jsx(rc,{className:"h-4 w-4"})}]},{title:"CMS",key:"web",url:"/cms",icon:c.jsx(vt,{className:"h-4 w-4"}),items:[{title:"Dashboard",url:"/cms/dashboard",icon:c.jsx(vt,{className:"h-4 w-4"})}]}]};function Xs({...e}){const{isActiveRoute:t}=Ks(),n=Zs();return c.jsxs(Na,{...e,children:[c.jsx(ja,{children:c.jsx("div",{className:"relative h-12 w-32 overflow-hidden",children:c.jsx("img",{src:Hp,alt:"GLI Logo",className:"h-full w-full object-contain"})})}),c.jsxs(Da,{children:[c.jsx("div",{className:"relative flex w-full min-w-0 flex-col px-2 py-1",children:c.jsxs("a",{href:"/",className:A("flex cursor-pointer items-center gap-2 rounded-lg px-2 py-2 transition-colors hover:bg-gray-100",t("/")&&"bg-blue-50 text-gli-bluedark font-medium"),children:[c.jsx(lo,{className:A("h-5 w-5",t("/")?"text-gli-bluedark":"text-gray-500")}),c.jsx("span",{children:"Home"})]})}),c.jsx(Yn,{delayDuration:150,children:Bp.navMain.map(r=>{const o=!r.key||n[r.key],a=o&&(t(r.url)||r.items.some(i=>t(i.url))),s=c.jsx(Us,{url:o?r.url:void 0,title:r.title,icon:r.icon,isActive:!!a,disabled:!o,className:A(!o&&"opacity-50"),children:o&&c.jsx(La,{children:c.jsx(Fa,{children:r.items.map(i=>{const u=t(i.url);return c.jsx($a,{children:c.jsx(za,{asChild:!0,children:c.jsxs("a",{href:i.url,className:A("flex items-center gap-2 pl-4 transition-colors text-muted-foreground hover:bg-muted hover:text-foreground",u&&"bg-blue-50 text-gli-bluedark font-medium"),children:[c.jsx("span",{className:A(u?"text-gli-bluedark":"text-muted-foreground"),children:i.icon}),c.jsx("span",{className:A(u?"text-gli-bluedark":"text-muted-foreground"),children:i.title})]})})},i.title)})})})},r.title);return r.key==="priceMonster"&&!o?c.jsxs(Zn,{children:[c.jsx(Xn,{asChild:!0,children:c.jsx("div",{children:s})}),c.jsx(Kt,{side:"top",align:"center",children:"Coming soon"})]},r.title):s})})]}),c.jsx(Ta,{})]})}async function Gp(){var e,t,n,r,o,a;try{const s=await ti.accessToken();if(!s||s==="No token available")return{essentialInsights:!1,organic:!1,paid:!1,web:!1,priceMonster:!1,se_company_id:null};const u=(e=ni.jwtDecode(s)["https://cloud.golocal.com/org_metadata"])==null?void 0:e.metadata;return{essentialInsights:((t=u==null?void 0:u["essential-insights"])==null?void 0:t.enabled)===!0,organic:((n=u==null?void 0:u.organic)==null?void 0:n.enabled)===!0,paid:((r=u==null?void 0:u.paid)==null?void 0:r.enabled)===!0,web:((o=u==null?void 0:u.web)==null?void 0:o.enabled)===!0,priceMonster:((a=u==null?void 0:u["price-monster"])==null?void 0:a.enabled)===!0,se_company_id:(u==null?void 0:u.se_company_id)||null}}catch(s){return console.error("Error getting user permissions:",s),{essentialInsights:!1,organic:!1,paid:!1,web:!1,priceMonster:!1,se_company_id:null}}}const Wp=({children:e,onLogout:t})=>c.jsx(Vr.Auth0Provider,{children:c.jsx(Pa,{children:c.jsxs("div",{className:"flex h-screen w-full",children:[c.jsx(Xs,{}),c.jsxs(Oa,{className:"flex-1 flex flex-col min-w-0",children:[c.jsx(Ws,{onLogout:t}),c.jsx("main",{className:"flex-1 bg-white overflow-auto",id:"page-content",children:e})]})]})})});exports.AppHeader=Ws;exports.AppSidebar=Xs;exports.Button=It;exports.Card=jp;exports.CardAction=Fp;exports.CardContent=$p;exports.CardDescription=Lp;exports.CardFooter=zp;exports.CardHeader=Dp;exports.CardTitle=Ip;exports.CollapsibleSection=Us;exports.DropdownMenu=$s;exports.DropdownMenuCheckboxItem=kp;exports.DropdownMenuContent=Hs;exports.DropdownMenuGroup=Mp;exports.DropdownMenuItem=Cn;exports.DropdownMenuLabel=Vs;exports.DropdownMenuPortal=Rp;exports.DropdownMenuRadioGroup=Ap;exports.DropdownMenuRadioItem=Pp;exports.DropdownMenuSeparator=Bs;exports.DropdownMenuShortcut=Np;exports.DropdownMenuSub=_p;exports.DropdownMenuSubContent=Op;exports.DropdownMenuSubTrigger=Tp;exports.DropdownMenuTrigger=zs;exports.GLICloudProvider=Wp;exports.Input=Rn;exports.PermissionsProvider=Vp;exports.ProfileDropdown=Gs;exports.Separator=Dt;exports.Sheet=Ko;exports.SheetClose=ql;exports.SheetContent=On;exports.SheetDescription=In;exports.SheetFooter=Zo;exports.SheetHeader=jn;exports.SheetOverlay=Tn;exports.SheetPortal=Yo;exports.SheetTitle=Dn;exports.SheetTrigger=Xl;exports.Sidebar=Na;exports.SidebarContent=Da;exports.SidebarFooter=Id;exports.SidebarGroup=Ia;exports.SidebarGroupAction=$d;exports.SidebarGroupContent=La;exports.SidebarGroupLabel=Fd;exports.SidebarHeader=ja;exports.SidebarInput=Dd;exports.SidebarInset=Oa;exports.SidebarMenu=zd;exports.SidebarMenuAction=Gd;exports.SidebarMenuBadge=Wd;exports.SidebarMenuButton=Bd;exports.SidebarMenuItem=Hd;exports.SidebarMenuSkeleton=Ud;exports.SidebarMenuSub=Fa;exports.SidebarMenuSubButton=za;exports.SidebarMenuSubItem=$a;exports.SidebarProvider=Pa;exports.SidebarRail=Ta;exports.SidebarSeparator=Ld;exports.SidebarTrigger=_a;exports.Skeleton=mn;exports.Tooltip=Zn;exports.TooltipContent=Kt;exports.TooltipProvider=Yn;exports.TooltipTrigger=Xn;exports.buttonVariants=fo;exports.getUserPermissions=Gp;exports.useActiveRoute=Ks;exports.useIsMobile=uo;exports.usePermissions=Zs;exports.useSidebar=ct;
|