@hir4ta/mneme 0.18.0 → 0.18.2
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/.claude-plugin/plugin.json +1 -1
- package/dist/public/assets/{index-EMvn4VEa.js → index-CVJnAGLW.js} +2 -2
- package/dist/public/assets/{react-force-graph-2d-DWoBaKmT.js → react-force-graph-2d-DZOG11W0.js} +1 -1
- package/dist/public/index.html +1 -1
- package/dist/server.js +16 -1
- package/package.json +1 -1
|
@@ -240,7 +240,7 @@ For more information, see https://radix-ui.com/primitives/docs/components/${t.do
|
|
|
240
240
|
*
|
|
241
241
|
* This source code is licensed under the ISC license.
|
|
242
242
|
* See the LICENSE file in the root directory of this source tree.
|
|
243
|
-
*/const KV=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],lR=Ht("zap",KV),r1=oV,GV=aV,uR=y.forwardRef(({className:e,...t},n)=>g.jsx(tR,{ref:n,"data-slot":"dialog-overlay",className:Qe("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",e),...t}));uR.displayName=tR.displayName;const Pm=y.forwardRef(({className:e,children:t,showCloseButton:n=!0,"aria-describedby":r,...i},o)=>g.jsxs(GV,{children:[g.jsx(uR,{}),g.jsxs(nR,{ref:o,"aria-describedby":r,"data-slot":"dialog-content",className:Qe("bg-background 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 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 outline-none sm:max-w-lg",e),...i,children:[t,n&&g.jsxs(oR,{"data-slot":"dialog-close",className:"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",children:[g.jsx(qV,{}),g.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Pm.displayName=nR.displayName;function i1({className:e,...t}){return g.jsx("div",{"data-slot":"dialog-header",className:Qe("flex flex-col gap-2 text-center sm:text-left",e),...t})}function YV({className:e,showCloseButton:t=!1,children:n,...r}){return g.jsxs("div",{"data-slot":"dialog-footer",className:Qe("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...r,children:[n,t&&g.jsx(oR,{asChild:!0,children:g.jsx(Dr,{variant:"outline",children:"Close"})})]})}const Cm=y.forwardRef(({className:e,...t},n)=>g.jsx(rR,{ref:n,"data-slot":"dialog-title",className:Qe("text-lg leading-none font-semibold",e),...t}));Cm.displayName=rR.displayName;const QV=y.forwardRef(({className:e,...t},n)=>g.jsx(iR,{ref:n,"data-slot":"dialog-description",className:Qe("text-muted-foreground text-sm",e),...t}));QV.displayName=iR.displayName;function mf({className:e,type:t,...n}){return g.jsx("input",{type:t,"data-slot":"input",className:Qe("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input flex h-9 w-full min-w-0 rounded-sm border bg-white/80 px-3 py-1 text-base transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",e),...n})}function cR({page:e,totalPages:t,hasNext:n,hasPrev:r,onPageChange:i}){const{t:o}=Ke("common");return t<=1?null:g.jsxs("div",{className:"flex items-center justify-center gap-2",children:[g.jsx(Dr,{variant:"outline",size:"sm",onClick:()=>i(e-1),disabled:!r,children:o("pagination.previous")}),g.jsx("span",{className:"text-sm text-muted-foreground px-2",children:o("pagination.pageOf",{page:e,totalPages:t})}),g.jsx(Dr,{variant:"outline",size:"sm",onClick:()=>i(e+1),disabled:!n,children:o("pagination.next")})]})}function fj(e,[t,n]){return Math.min(n,Math.max(t,e))}function dj(e){const t=XV(e),n=y.forwardRef((r,i)=>{const{children:o,...a}=r,s=y.Children.toArray(o),u=s.find(JV);if(u){const f=u.props.children,d=s.map(h=>h===u?y.Children.count(f)>1?y.Children.only(null):y.isValidElement(f)?f.props.children:null:h);return g.jsx(t,{...a,ref:i,children:y.isValidElement(f)?y.cloneElement(f,void 0,d):null})}return g.jsx(t,{...a,ref:i,children:o})});return n.displayName=`${e}.Slot`,n}function XV(e){const t=y.forwardRef((n,r)=>{const{children:i,...o}=n;if(y.isValidElement(i)){const a=tq(i),s=eq(o,i.props);return i.type!==y.Fragment&&(s.ref=r?iu(r,a):a),y.cloneElement(i,s)}return y.Children.count(i)>1?y.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var ZV=Symbol("radix.slottable");function JV(e){return y.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===ZV}function eq(e,t){const n={...t};for(const r in t){const i=e[r],o=t[r];/^on[A-Z]/.test(r)?i&&o?n[r]=(...s)=>{const u=o(...s);return i(...s),u}:i&&(n[r]=i):r==="style"?n[r]={...i,...o}:r==="className"&&(n[r]=[i,o].filter(Boolean).join(" "))}return{...e,...n}}function tq(e){var r,i;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function fR(e){const t=e+"CollectionProvider",[n,r]=su(t),[i,o]=n(t,{collectionRef:{current:null},itemMap:new Map}),a=b=>{const{scope:S,children:k}=b,C=sa.useRef(null),j=sa.useRef(new Map).current;return g.jsx(i,{scope:S,itemMap:j,collectionRef:C,children:k})};a.displayName=t;const s=e+"CollectionSlot",u=dj(s),f=sa.forwardRef((b,S)=>{const{scope:k,children:C}=b,j=o(s,k),O=Dt(S,j.collectionRef);return g.jsx(u,{ref:O,children:C})});f.displayName=s;const d=e+"CollectionItemSlot",h="data-radix-collection-item",m=dj(d),v=sa.forwardRef((b,S)=>{const{scope:k,children:C,...j}=b,O=sa.useRef(null),A=Dt(S,O),N=o(d,k);return sa.useEffect(()=>(N.itemMap.set(O,{ref:O,...j}),()=>void N.itemMap.delete(O))),g.jsx(m,{[h]:"",ref:A,children:C})});v.displayName=d;function w(b){const S=o(e+"CollectionConsumer",b);return sa.useCallback(()=>{const C=S.collectionRef.current;if(!C)return[];const j=Array.from(C.querySelectorAll(`[${h}]`));return Array.from(S.itemMap.values()).sort((N,I)=>j.indexOf(N.ref.current)-j.indexOf(I.ref.current))},[S.collectionRef,S.itemMap])}return[{Provider:a,Slot:f,ItemSlot:v},w,r]}var nq=y.createContext(void 0);function o1(e){const t=y.useContext(nq);return e||t||"ltr"}const rq=["top","right","bottom","left"],Ea=Math.min,fr=Math.max,up=Math.round,uh=Math.floor,Li=e=>({x:e,y:e}),iq={left:"right",right:"left",bottom:"top",top:"bottom"},oq={start:"end",end:"start"};function db(e,t,n){return fr(e,Ea(t,n))}function xo(e,t){return typeof e=="function"?e(t):e}function bo(e){return e.split("-")[0]}function lu(e){return e.split("-")[1]}function a1(e){return e==="x"?"y":"x"}function s1(e){return e==="y"?"height":"width"}const aq=new Set(["top","bottom"]);function Oi(e){return aq.has(bo(e))?"y":"x"}function l1(e){return a1(Oi(e))}function sq(e,t,n){n===void 0&&(n=!1);const r=lu(e),i=l1(e),o=s1(i);let a=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(a=cp(a)),[a,cp(a)]}function lq(e){const t=cp(e);return[hb(e),t,hb(t)]}function hb(e){return e.replace(/start|end/g,t=>oq[t])}const hj=["left","right"],pj=["right","left"],uq=["top","bottom"],cq=["bottom","top"];function fq(e,t,n){switch(e){case"top":case"bottom":return n?t?pj:hj:t?hj:pj;case"left":case"right":return t?uq:cq;default:return[]}}function dq(e,t,n,r){const i=lu(e);let o=fq(bo(e),n==="start",r);return i&&(o=o.map(a=>a+"-"+i),t&&(o=o.concat(o.map(hb)))),o}function cp(e){return e.replace(/left|right|bottom|top/g,t=>iq[t])}function hq(e){return{top:0,right:0,bottom:0,left:0,...e}}function dR(e){return typeof e!="number"?hq(e):{top:e,right:e,bottom:e,left:e}}function fp(e){const{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function mj(e,t,n){let{reference:r,floating:i}=e;const o=Oi(t),a=l1(t),s=s1(a),u=bo(t),f=o==="y",d=r.x+r.width/2-i.width/2,h=r.y+r.height/2-i.height/2,m=r[s]/2-i[s]/2;let v;switch(u){case"top":v={x:d,y:r.y-i.height};break;case"bottom":v={x:d,y:r.y+r.height};break;case"right":v={x:r.x+r.width,y:h};break;case"left":v={x:r.x-i.width,y:h};break;default:v={x:r.x,y:r.y}}switch(lu(t)){case"start":v[a]-=m*(n&&f?-1:1);break;case"end":v[a]+=m*(n&&f?-1:1);break}return v}const pq=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:o=[],platform:a}=n,s=o.filter(Boolean),u=await(a.isRTL==null?void 0:a.isRTL(t));let f=await a.getElementRects({reference:e,floating:t,strategy:i}),{x:d,y:h}=mj(f,r,u),m=r,v={},w=0;for(let b=0;b<s.length;b++){const{name:S,fn:k}=s[b],{x:C,y:j,data:O,reset:A}=await k({x:d,y:h,initialPlacement:r,placement:m,strategy:i,middlewareData:v,rects:f,platform:a,elements:{reference:e,floating:t}});d=C??d,h=j??h,v={...v,[S]:{...v[S],...O}},A&&w<=50&&(w++,typeof A=="object"&&(A.placement&&(m=A.placement),A.rects&&(f=A.rects===!0?await a.getElementRects({reference:e,floating:t,strategy:i}):A.rects),{x:d,y:h}=mj(f,m,u)),b=-1)}return{x:d,y:h,placement:m,strategy:i,middlewareData:v}};async function zc(e,t){var n;t===void 0&&(t={});const{x:r,y:i,platform:o,rects:a,elements:s,strategy:u}=e,{boundary:f="clippingAncestors",rootBoundary:d="viewport",elementContext:h="floating",altBoundary:m=!1,padding:v=0}=xo(t,e),w=dR(v),S=s[m?h==="floating"?"reference":"floating":h],k=fp(await o.getClippingRect({element:(n=await(o.isElement==null?void 0:o.isElement(S)))==null||n?S:S.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(s.floating)),boundary:f,rootBoundary:d,strategy:u})),C=h==="floating"?{x:r,y:i,width:a.floating.width,height:a.floating.height}:a.reference,j=await(o.getOffsetParent==null?void 0:o.getOffsetParent(s.floating)),O=await(o.isElement==null?void 0:o.isElement(j))?await(o.getScale==null?void 0:o.getScale(j))||{x:1,y:1}:{x:1,y:1},A=fp(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:C,offsetParent:j,strategy:u}):C);return{top:(k.top-A.top+w.top)/O.y,bottom:(A.bottom-k.bottom+w.bottom)/O.y,left:(k.left-A.left+w.left)/O.x,right:(A.right-k.right+w.right)/O.x}}const mq=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:i,rects:o,platform:a,elements:s,middlewareData:u}=t,{element:f,padding:d=0}=xo(e,t)||{};if(f==null)return{};const h=dR(d),m={x:n,y:r},v=l1(i),w=s1(v),b=await a.getDimensions(f),S=v==="y",k=S?"top":"left",C=S?"bottom":"right",j=S?"clientHeight":"clientWidth",O=o.reference[w]+o.reference[v]-m[v]-o.floating[w],A=m[v]-o.reference[v],N=await(a.getOffsetParent==null?void 0:a.getOffsetParent(f));let I=N?N[j]:0;(!I||!await(a.isElement==null?void 0:a.isElement(N)))&&(I=s.floating[j]||o.floating[w]);const T=O/2-A/2,$=I/2-b[w]/2-1,D=Ea(h[k],$),U=Ea(h[C],$),L=D,q=I-b[w]-U,W=I/2-b[w]/2+T,H=db(L,W,q),X=!u.arrow&&lu(i)!=null&&W!==H&&o.reference[w]/2-(W<L?D:U)-b[w]/2<0,ne=X?W<L?W-L:W-q:0;return{[v]:m[v]+ne,data:{[v]:H,centerOffset:W-H-ne,...X&&{alignmentOffset:ne}},reset:X}}}),gq=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:i,middlewareData:o,rects:a,initialPlacement:s,platform:u,elements:f}=t,{mainAxis:d=!0,crossAxis:h=!0,fallbackPlacements:m,fallbackStrategy:v="bestFit",fallbackAxisSideDirection:w="none",flipAlignment:b=!0,...S}=xo(e,t);if((n=o.arrow)!=null&&n.alignmentOffset)return{};const k=bo(i),C=Oi(s),j=bo(s)===s,O=await(u.isRTL==null?void 0:u.isRTL(f.floating)),A=m||(j||!b?[cp(s)]:lq(s)),N=w!=="none";!m&&N&&A.push(...dq(s,b,w,O));const I=[s,...A],T=await zc(t,S),$=[];let D=((r=o.flip)==null?void 0:r.overflows)||[];if(d&&$.push(T[k]),h){const W=sq(i,a,O);$.push(T[W[0]],T[W[1]])}if(D=[...D,{placement:i,overflows:$}],!$.every(W=>W<=0)){var U,L;const W=(((U=o.flip)==null?void 0:U.index)||0)+1,H=I[W];if(H&&(!(h==="alignment"?C!==Oi(H):!1)||D.every(B=>Oi(B.placement)===C?B.overflows[0]>0:!0)))return{data:{index:W,overflows:D},reset:{placement:H}};let X=(L=D.filter(ne=>ne.overflows[0]<=0).sort((ne,B)=>ne.overflows[1]-B.overflows[1])[0])==null?void 0:L.placement;if(!X)switch(v){case"bestFit":{var q;const ne=(q=D.filter(B=>{if(N){const re=Oi(B.placement);return re===C||re==="y"}return!0}).map(B=>[B.placement,B.overflows.filter(re=>re>0).reduce((re,R)=>re+R,0)]).sort((B,re)=>B[1]-re[1])[0])==null?void 0:q[0];ne&&(X=ne);break}case"initialPlacement":X=s;break}if(i!==X)return{reset:{placement:X}}}return{}}}};function gj(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function vj(e){return rq.some(t=>e[t]>=0)}const vq=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...i}=xo(e,t);switch(r){case"referenceHidden":{const o=await zc(t,{...i,elementContext:"reference"}),a=gj(o,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:vj(a)}}}case"escaped":{const o=await zc(t,{...i,altBoundary:!0}),a=gj(o,n.floating);return{data:{escapedOffsets:a,escaped:vj(a)}}}default:return{}}}}},hR=new Set(["left","top"]);async function yq(e,t){const{placement:n,platform:r,elements:i}=e,o=await(r.isRTL==null?void 0:r.isRTL(i.floating)),a=bo(n),s=lu(n),u=Oi(n)==="y",f=hR.has(a)?-1:1,d=o&&u?-1:1,h=xo(t,e);let{mainAxis:m,crossAxis:v,alignmentAxis:w}=typeof h=="number"?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return s&&typeof w=="number"&&(v=s==="end"?w*-1:w),u?{x:v*d,y:m*f}:{x:m*f,y:v*d}}const xq=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:i,y:o,placement:a,middlewareData:s}=t,u=await yq(t,e);return a===((n=s.offset)==null?void 0:n.placement)&&(r=s.arrow)!=null&&r.alignmentOffset?{}:{x:i+u.x,y:o+u.y,data:{...u,placement:a}}}}},bq=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:i}=t,{mainAxis:o=!0,crossAxis:a=!1,limiter:s={fn:S=>{let{x:k,y:C}=S;return{x:k,y:C}}},...u}=xo(e,t),f={x:n,y:r},d=await zc(t,u),h=Oi(bo(i)),m=a1(h);let v=f[m],w=f[h];if(o){const S=m==="y"?"top":"left",k=m==="y"?"bottom":"right",C=v+d[S],j=v-d[k];v=db(C,v,j)}if(a){const S=h==="y"?"top":"left",k=h==="y"?"bottom":"right",C=w+d[S],j=w-d[k];w=db(C,w,j)}const b=s.fn({...t,[m]:v,[h]:w});return{...b,data:{x:b.x-n,y:b.y-r,enabled:{[m]:o,[h]:a}}}}}},wq=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:i,rects:o,middlewareData:a}=t,{offset:s=0,mainAxis:u=!0,crossAxis:f=!0}=xo(e,t),d={x:n,y:r},h=Oi(i),m=a1(h);let v=d[m],w=d[h];const b=xo(s,t),S=typeof b=="number"?{mainAxis:b,crossAxis:0}:{mainAxis:0,crossAxis:0,...b};if(u){const j=m==="y"?"height":"width",O=o.reference[m]-o.floating[j]+S.mainAxis,A=o.reference[m]+o.reference[j]-S.mainAxis;v<O?v=O:v>A&&(v=A)}if(f){var k,C;const j=m==="y"?"width":"height",O=hR.has(bo(i)),A=o.reference[h]-o.floating[j]+(O&&((k=a.offset)==null?void 0:k[h])||0)+(O?0:S.crossAxis),N=o.reference[h]+o.reference[j]+(O?0:((C=a.offset)==null?void 0:C[h])||0)-(O?S.crossAxis:0);w<A?w=A:w>N&&(w=N)}return{[m]:v,[h]:w}}}},Sq=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:i,rects:o,platform:a,elements:s}=t,{apply:u=()=>{},...f}=xo(e,t),d=await zc(t,f),h=bo(i),m=lu(i),v=Oi(i)==="y",{width:w,height:b}=o.floating;let S,k;h==="top"||h==="bottom"?(S=h,k=m===(await(a.isRTL==null?void 0:a.isRTL(s.floating))?"start":"end")?"left":"right"):(k=h,S=m==="end"?"top":"bottom");const C=b-d.top-d.bottom,j=w-d.left-d.right,O=Ea(b-d[S],C),A=Ea(w-d[k],j),N=!t.middlewareData.shift;let I=O,T=A;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(T=j),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(I=C),N&&!m){const D=fr(d.left,0),U=fr(d.right,0),L=fr(d.top,0),q=fr(d.bottom,0);v?T=w-2*(D!==0||U!==0?D+U:fr(d.left,d.right)):I=b-2*(L!==0||q!==0?L+q:fr(d.top,d.bottom))}await u({...t,availableWidth:T,availableHeight:I});const $=await a.getDimensions(s.floating);return w!==$.width||b!==$.height?{reset:{rects:!0}}:{}}}};function Em(){return typeof window<"u"}function uu(e){return pR(e)?(e.nodeName||"").toLowerCase():"#document"}function pr(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Hi(e){var t;return(t=(pR(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function pR(e){return Em()?e instanceof Node||e instanceof pr(e).Node:!1}function oi(e){return Em()?e instanceof Element||e instanceof pr(e).Element:!1}function Fi(e){return Em()?e instanceof HTMLElement||e instanceof pr(e).HTMLElement:!1}function yj(e){return!Em()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof pr(e).ShadowRoot}const kq=new Set(["inline","contents"]);function gf(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=ai(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!kq.has(i)}const Pq=new Set(["table","td","th"]);function Cq(e){return Pq.has(uu(e))}const Eq=[":popover-open",":modal"];function jm(e){return Eq.some(t=>{try{return e.matches(t)}catch{return!1}})}const jq=["transform","translate","scale","rotate","perspective"],Oq=["transform","translate","scale","rotate","perspective","filter"],Nq=["paint","layout","strict","content"];function u1(e){const t=c1(),n=oi(e)?ai(e):e;return jq.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)||Oq.some(r=>(n.willChange||"").includes(r))||Nq.some(r=>(n.contain||"").includes(r))}function Aq(e){let t=ja(e);for(;Fi(t)&&!Hl(t);){if(u1(t))return t;if(jm(t))return null;t=ja(t)}return null}function c1(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const Tq=new Set(["html","body","#document"]);function Hl(e){return Tq.has(uu(e))}function ai(e){return pr(e).getComputedStyle(e)}function Om(e){return oi(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function ja(e){if(uu(e)==="html")return e;const t=e.assignedSlot||e.parentNode||yj(e)&&e.host||Hi(e);return yj(t)?t.host:t}function mR(e){const t=ja(e);return Hl(t)?e.ownerDocument?e.ownerDocument.body:e.body:Fi(t)&&gf(t)?t:mR(t)}function Bc(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=mR(e),o=i===((r=e.ownerDocument)==null?void 0:r.body),a=pr(i);if(o){const s=pb(a);return t.concat(a,a.visualViewport||[],gf(i)?i:[],s&&n?Bc(s):[])}return t.concat(i,Bc(i,[],n))}function pb(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function gR(e){const t=ai(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=Fi(e),o=i?e.offsetWidth:n,a=i?e.offsetHeight:r,s=up(n)!==o||up(r)!==a;return s&&(n=o,r=a),{width:n,height:r,$:s}}function f1(e){return oi(e)?e:e.contextElement}function Ol(e){const t=f1(e);if(!Fi(t))return Li(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:o}=gR(t);let a=(o?up(n.width):n.width)/r,s=(o?up(n.height):n.height)/i;return(!a||!Number.isFinite(a))&&(a=1),(!s||!Number.isFinite(s))&&(s=1),{x:a,y:s}}const _q=Li(0);function vR(e){const t=pr(e);return!c1()||!t.visualViewport?_q:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Iq(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==pr(e)?!1:t}function Ps(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),o=f1(e);let a=Li(1);t&&(r?oi(r)&&(a=Ol(r)):a=Ol(e));const s=Iq(o,n,r)?vR(o):Li(0);let u=(i.left+s.x)/a.x,f=(i.top+s.y)/a.y,d=i.width/a.x,h=i.height/a.y;if(o){const m=pr(o),v=r&&oi(r)?pr(r):r;let w=m,b=pb(w);for(;b&&r&&v!==w;){const S=Ol(b),k=b.getBoundingClientRect(),C=ai(b),j=k.left+(b.clientLeft+parseFloat(C.paddingLeft))*S.x,O=k.top+(b.clientTop+parseFloat(C.paddingTop))*S.y;u*=S.x,f*=S.y,d*=S.x,h*=S.y,u+=j,f+=O,w=pr(b),b=pb(w)}}return fp({width:d,height:h,x:u,y:f})}function Nm(e,t){const n=Om(e).scrollLeft;return t?t.left+n:Ps(Hi(e)).left+n}function yR(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-Nm(e,n),i=n.top+t.scrollTop;return{x:r,y:i}}function Rq(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e;const o=i==="fixed",a=Hi(r),s=t?jm(t.floating):!1;if(r===a||s&&o)return n;let u={scrollLeft:0,scrollTop:0},f=Li(1);const d=Li(0),h=Fi(r);if((h||!h&&!o)&&((uu(r)!=="body"||gf(a))&&(u=Om(r)),Fi(r))){const v=Ps(r);f=Ol(r),d.x=v.x+r.clientLeft,d.y=v.y+r.clientTop}const m=a&&!h&&!o?yR(a,u):Li(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 Dq(e){return Array.from(e.getClientRects())}function Mq(e){const t=Hi(e),n=Om(e),r=e.ownerDocument.body,i=fr(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),o=fr(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+Nm(e);const s=-n.scrollTop;return ai(r).direction==="rtl"&&(a+=fr(t.clientWidth,r.clientWidth)-i),{width:i,height:o,x:a,y:s}}const xj=25;function Lq(e,t){const n=pr(e),r=Hi(e),i=n.visualViewport;let o=r.clientWidth,a=r.clientHeight,s=0,u=0;if(i){o=i.width,a=i.height;const d=c1();(!d||d&&t==="fixed")&&(s=i.offsetLeft,u=i.offsetTop)}const f=Nm(r);if(f<=0){const d=r.ownerDocument,h=d.body,m=getComputedStyle(h),v=d.compatMode==="CSS1Compat"&&parseFloat(m.marginLeft)+parseFloat(m.marginRight)||0,w=Math.abs(r.clientWidth-h.clientWidth-v);w<=xj&&(o-=w)}else f<=xj&&(o+=f);return{width:o,height:a,x:s,y:u}}const $q=new Set(["absolute","fixed"]);function Fq(e,t){const n=Ps(e,!0,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft,o=Fi(e)?Ol(e):Li(1),a=e.clientWidth*o.x,s=e.clientHeight*o.y,u=i*o.x,f=r*o.y;return{width:a,height:s,x:u,y:f}}function bj(e,t,n){let r;if(t==="viewport")r=Lq(e,n);else if(t==="document")r=Mq(Hi(e));else if(oi(t))r=Fq(t,n);else{const i=vR(e);r={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return fp(r)}function xR(e,t){const n=ja(e);return n===t||!oi(n)||Hl(n)?!1:ai(n).position==="fixed"||xR(n,t)}function zq(e,t){const n=t.get(e);if(n)return n;let r=Bc(e,[],!1).filter(s=>oi(s)&&uu(s)!=="body"),i=null;const o=ai(e).position==="fixed";let a=o?ja(e):e;for(;oi(a)&&!Hl(a);){const s=ai(a),u=u1(a);!u&&s.position==="fixed"&&(i=null),(o?!u&&!i:!u&&s.position==="static"&&!!i&&$q.has(i.position)||gf(a)&&!u&&xR(e,a))?r=r.filter(d=>d!==a):i=s,a=ja(a)}return t.set(e,r),r}function Bq(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const a=[...n==="clippingAncestors"?jm(t)?[]:zq(t,this._c):[].concat(n),r],s=a[0],u=a.reduce((f,d)=>{const h=bj(t,d,i);return f.top=fr(h.top,f.top),f.right=Ea(h.right,f.right),f.bottom=Ea(h.bottom,f.bottom),f.left=fr(h.left,f.left),f},bj(t,s,i));return{width:u.right-u.left,height:u.bottom-u.top,x:u.left,y:u.top}}function Uq(e){const{width:t,height:n}=gR(e);return{width:t,height:n}}function Wq(e,t,n){const r=Fi(t),i=Hi(t),o=n==="fixed",a=Ps(e,!0,o,t);let s={scrollLeft:0,scrollTop:0};const u=Li(0);function f(){u.x=Nm(i)}if(r||!r&&!o)if((uu(t)!=="body"||gf(i))&&(s=Om(t)),r){const v=Ps(t,!0,o,t);u.x=v.x+t.clientLeft,u.y=v.y+t.clientTop}else i&&f();o&&!r&&i&&f();const d=i&&!r&&!o?yR(i,s):Li(0),h=a.left+s.scrollLeft-u.x-d.x,m=a.top+s.scrollTop-u.y-d.y;return{x:h,y:m,width:a.width,height:a.height}}function By(e){return ai(e).position==="static"}function wj(e,t){if(!Fi(e)||ai(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Hi(e)===n&&(n=n.ownerDocument.body),n}function bR(e,t){const n=pr(e);if(jm(e))return n;if(!Fi(e)){let i=ja(e);for(;i&&!Hl(i);){if(oi(i)&&!By(i))return i;i=ja(i)}return n}let r=wj(e,t);for(;r&&Cq(r)&&By(r);)r=wj(r,t);return r&&Hl(r)&&By(r)&&!u1(r)?n:r||Aq(e)||n}const Hq=async function(e){const t=this.getOffsetParent||bR,n=this.getDimensions,r=await n(e.floating);return{reference:Wq(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Vq(e){return ai(e).direction==="rtl"}const qq={convertOffsetParentRelativeRectToViewportRelativeRect:Rq,getDocumentElement:Hi,getClippingRect:Bq,getOffsetParent:bR,getElementRects:Hq,getClientRects:Dq,getDimensions:Uq,getScale:Ol,isElement:oi,isRTL:Vq};function wR(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Kq(e,t){let n=null,r;const i=Hi(e);function o(){var s;clearTimeout(r),(s=n)==null||s.disconnect(),n=null}function a(s,u){s===void 0&&(s=!1),u===void 0&&(u=1),o();const f=e.getBoundingClientRect(),{left:d,top:h,width:m,height:v}=f;if(s||t(),!m||!v)return;const w=uh(h),b=uh(i.clientWidth-(d+m)),S=uh(i.clientHeight-(h+v)),k=uh(d),j={rootMargin:-w+"px "+-b+"px "+-S+"px "+-k+"px",threshold:fr(0,Ea(1,u))||1};let O=!0;function A(N){const I=N[0].intersectionRatio;if(I!==u){if(!O)return a();I?a(!1,I):r=setTimeout(()=>{a(!1,1e-7)},1e3)}I===1&&!wR(f,e.getBoundingClientRect())&&a(),O=!1}try{n=new IntersectionObserver(A,{...j,root:i.ownerDocument})}catch{n=new IntersectionObserver(A,j)}n.observe(e)}return a(!0),o}function Gq(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:s=typeof IntersectionObserver=="function",animationFrame:u=!1}=r,f=f1(e),d=i||o?[...f?Bc(f):[],...Bc(t)]:[];d.forEach(k=>{i&&k.addEventListener("scroll",n,{passive:!0}),o&&k.addEventListener("resize",n)});const h=f&&s?Kq(f,n):null;let m=-1,v=null;a&&(v=new ResizeObserver(k=>{let[C]=k;C&&C.target===f&&v&&(v.unobserve(t),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var j;(j=v)==null||j.observe(t)})),n()}),f&&!u&&v.observe(f),v.observe(t));let w,b=u?Ps(e):null;u&&S();function S(){const k=Ps(e);b&&!wR(b,k)&&n(),b=k,w=requestAnimationFrame(S)}return n(),()=>{var k;d.forEach(C=>{i&&C.removeEventListener("scroll",n),o&&C.removeEventListener("resize",n)}),h==null||h(),(k=v)==null||k.disconnect(),v=null,u&&cancelAnimationFrame(w)}}const Yq=xq,Qq=bq,Xq=gq,Zq=Sq,Jq=vq,Sj=mq,e9=wq,t9=(e,t,n)=>{const r=new Map,i={platform:qq,...n},o={...i.platform,_c:r};return pq(e,t,{...i,platform:o})};var n9=typeof document<"u",r9=function(){},Bh=n9?y.useLayoutEffect:r9;function dp(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,i;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(!dp(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){const o=i[r];if(!(o==="_owner"&&e.$$typeof)&&!dp(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function SR(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function kj(e,t){const n=SR(e);return Math.round(t*n)/n}function Uy(e){const t=y.useRef(e);return Bh(()=>{t.current=e}),t}function i9(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:o,floating:a}={},transform:s=!0,whileElementsMounted:u,open:f}=e,[d,h]=y.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[m,v]=y.useState(r);dp(m,r)||v(r);const[w,b]=y.useState(null),[S,k]=y.useState(null),C=y.useCallback(B=>{B!==N.current&&(N.current=B,b(B))},[]),j=y.useCallback(B=>{B!==I.current&&(I.current=B,k(B))},[]),O=o||w,A=a||S,N=y.useRef(null),I=y.useRef(null),T=y.useRef(d),$=u!=null,D=Uy(u),U=Uy(i),L=Uy(f),q=y.useCallback(()=>{if(!N.current||!I.current)return;const B={placement:t,strategy:n,middleware:m};U.current&&(B.platform=U.current),t9(N.current,I.current,B).then(re=>{const R={...re,isPositioned:L.current!==!1};W.current&&!dp(T.current,R)&&(T.current=R,Aa.flushSync(()=>{h(R)}))})},[m,t,n,U,L]);Bh(()=>{f===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,h(B=>({...B,isPositioned:!1})))},[f]);const W=y.useRef(!1);Bh(()=>(W.current=!0,()=>{W.current=!1}),[]),Bh(()=>{if(O&&(N.current=O),A&&(I.current=A),O&&A){if(D.current)return D.current(O,A,q);q()}},[O,A,q,D,$]);const H=y.useMemo(()=>({reference:N,floating:I,setReference:C,setFloating:j}),[C,j]),X=y.useMemo(()=>({reference:O,floating:A}),[O,A]),ne=y.useMemo(()=>{const B={position:n,left:0,top:0};if(!X.floating)return B;const re=kj(X.floating,d.x),R=kj(X.floating,d.y);return s?{...B,transform:"translate("+re+"px, "+R+"px)",...SR(X.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:re,top:R}},[n,s,X.floating,d.x,d.y]);return y.useMemo(()=>({...d,update:q,refs:H,elements:X,floatingStyles:ne}),[d,q,H,X,ne])}const o9=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:i}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?Sj({element:r.current,padding:i}).fn(n):{}:r?Sj({element:r,padding:i}).fn(n):{}}}},a9=(e,t)=>({...Yq(e),options:[e,t]}),s9=(e,t)=>({...Qq(e),options:[e,t]}),l9=(e,t)=>({...e9(e),options:[e,t]}),u9=(e,t)=>({...Xq(e),options:[e,t]}),c9=(e,t)=>({...Zq(e),options:[e,t]}),f9=(e,t)=>({...Jq(e),options:[e,t]}),d9=(e,t)=>({...o9(e),options:[e,t]});var h9="Arrow",kR=y.forwardRef((e,t)=>{const{children:n,width:r=10,height:i=5,...o}=e;return g.jsx(ot.svg,{...o,ref:t,width:r,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:g.jsx("polygon",{points:"0,0 30,0 15,10"})})});kR.displayName=h9;var p9=kR;function m9(e){const[t,n]=y.useState(void 0);return jn(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const o=i[0];let a,s;if("borderBoxSize"in o){const u=o.borderBoxSize,f=Array.isArray(u)?u[0]:u;a=f.inlineSize,s=f.blockSize}else a=e.offsetWidth,s=e.offsetHeight;n({width:a,height:s})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var d1="Popper",[PR,CR]=su(d1),[g9,ER]=PR(d1),jR=e=>{const{__scopePopper:t,children:n}=e,[r,i]=y.useState(null);return g.jsx(g9,{scope:t,anchor:r,onAnchorChange:i,children:n})};jR.displayName=d1;var OR="PopperAnchor",NR=y.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...i}=e,o=ER(OR,n),a=y.useRef(null),s=Dt(t,a),u=y.useRef(null);return y.useEffect(()=>{const f=u.current;u.current=(r==null?void 0:r.current)||a.current,f!==u.current&&o.onAnchorChange(u.current)}),r?null:g.jsx(ot.div,{...i,ref:s})});NR.displayName=OR;var h1="PopperContent",[v9,y9]=PR(h1),AR=y.forwardRef((e,t)=>{var ae,ge,Z,de,me,ie;const{__scopePopper:n,side:r="bottom",sideOffset:i=0,align:o="center",alignOffset:a=0,arrowPadding:s=0,avoidCollisions:u=!0,collisionBoundary:f=[],collisionPadding:d=0,sticky:h="partial",hideWhenDetached:m=!1,updatePositionStrategy:v="optimized",onPlaced:w,...b}=e,S=ER(h1,n),[k,C]=y.useState(null),j=Dt(t,He=>C(He)),[O,A]=y.useState(null),N=m9(O),I=(N==null?void 0:N.width)??0,T=(N==null?void 0:N.height)??0,$=r+(o!=="center"?"-"+o:""),D=typeof d=="number"?d:{top:0,right:0,bottom:0,left:0,...d},U=Array.isArray(f)?f:[f],L=U.length>0,q={padding:D,boundary:U.filter(b9),altBoundary:L},{refs:W,floatingStyles:H,placement:X,isPositioned:ne,middlewareData:B}=i9({strategy:"fixed",placement:$,whileElementsMounted:(...He)=>Gq(...He,{animationFrame:v==="always"}),elements:{reference:S.anchor},middleware:[a9({mainAxis:i+T,alignmentAxis:a}),u&&s9({mainAxis:!0,crossAxis:!1,limiter:h==="partial"?l9():void 0,...q}),u&&u9({...q}),c9({...q,apply:({elements:He,rects:Le,availableWidth:yt,availableHeight:xt})=>{const{width:Ft,height:Yi}=Le.reference,Br=He.floating.style;Br.setProperty("--radix-popper-available-width",`${yt}px`),Br.setProperty("--radix-popper-available-height",`${xt}px`),Br.setProperty("--radix-popper-anchor-width",`${Ft}px`),Br.setProperty("--radix-popper-anchor-height",`${Yi}px`)}}),O&&d9({element:O,padding:s}),w9({arrowWidth:I,arrowHeight:T}),m&&f9({strategy:"referenceHidden",...q})]}),[re,R]=IR(X),z=Ca(w);jn(()=>{ne&&(z==null||z())},[ne,z]);const J=(ae=B.arrow)==null?void 0:ae.x,M=(ge=B.arrow)==null?void 0:ge.y,ce=((Z=B.arrow)==null?void 0:Z.centerOffset)!==0,[we,xe]=y.useState();return jn(()=>{k&&xe(window.getComputedStyle(k).zIndex)},[k]),g.jsx("div",{ref:W.setFloating,"data-radix-popper-content-wrapper":"",style:{...H,transform:ne?H.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:we,"--radix-popper-transform-origin":[(de=B.transformOrigin)==null?void 0:de.x,(me=B.transformOrigin)==null?void 0:me.y].join(" "),...((ie=B.hide)==null?void 0:ie.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:g.jsx(v9,{scope:n,placedSide:re,onArrowChange:A,arrowX:J,arrowY:M,shouldHideArrow:ce,children:g.jsx(ot.div,{"data-side":re,"data-align":R,...b,ref:j,style:{...b.style,animation:ne?void 0:"none"}})})})});AR.displayName=h1;var TR="PopperArrow",x9={top:"bottom",right:"left",bottom:"top",left:"right"},_R=y.forwardRef(function(t,n){const{__scopePopper:r,...i}=t,o=y9(TR,r),a=x9[o.placedSide];return g.jsx("span",{ref:o.onArrowChange,style:{position:"absolute",left:o.arrowX,top:o.arrowY,[a]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[o.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[o.placedSide],visibility:o.shouldHideArrow?"hidden":void 0},children:g.jsx(p9,{...i,ref:n,style:{...i.style,display:"block"}})})});_R.displayName=TR;function b9(e){return e!==null}var w9=e=>({name:"transformOrigin",options:e,fn(t){var S,k,C;const{placement:n,rects:r,middlewareData:i}=t,a=((S=i.arrow)==null?void 0:S.centerOffset)!==0,s=a?0:e.arrowWidth,u=a?0:e.arrowHeight,[f,d]=IR(n),h={start:"0%",center:"50%",end:"100%"}[d],m=(((k=i.arrow)==null?void 0:k.x)??0)+s/2,v=(((C=i.arrow)==null?void 0:C.y)??0)+u/2;let w="",b="";return f==="bottom"?(w=a?h:`${m}px`,b=`${-u}px`):f==="top"?(w=a?h:`${m}px`,b=`${r.floating.height+u}px`):f==="right"?(w=`${-u}px`,b=a?h:`${v}px`):f==="left"&&(w=`${r.floating.width+u}px`,b=a?h:`${v}px`),{data:{x:w,y:b}}}});function IR(e){const[t,n="center"]=e.split("-");return[t,n]}var S9=jR,k9=NR,P9=AR,C9=_R;function E9(e){const t=j9(e),n=y.forwardRef((r,i)=>{const{children:o,...a}=r,s=y.Children.toArray(o),u=s.find(N9);if(u){const f=u.props.children,d=s.map(h=>h===u?y.Children.count(f)>1?y.Children.only(null):y.isValidElement(f)?f.props.children:null:h);return g.jsx(t,{...a,ref:i,children:y.isValidElement(f)?y.cloneElement(f,void 0,d):null})}return g.jsx(t,{...a,ref:i,children:o})});return n.displayName=`${e}.Slot`,n}function j9(e){const t=y.forwardRef((n,r)=>{const{children:i,...o}=n;if(y.isValidElement(i)){const a=T9(i),s=A9(o,i.props);return i.type!==y.Fragment&&(s.ref=r?iu(r,a):a),y.cloneElement(i,s)}return y.Children.count(i)>1?y.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var O9=Symbol("radix.slottable");function N9(e){return y.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===O9}function A9(e,t){const n={...t};for(const r in t){const i=e[r],o=t[r];/^on[A-Z]/.test(r)?i&&o?n[r]=(...s)=>{const u=o(...s);return i(...s),u}:i&&(n[r]=i):r==="style"?n[r]={...i,...o}:r==="className"&&(n[r]=[i,o].filter(Boolean).join(" "))}return{...e,...n}}function T9(e){var r,i;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function _9(e){const t=y.useRef({value:e,previous:e});return y.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var RR=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"}),I9="VisuallyHidden",R9=y.forwardRef((e,t)=>g.jsx(ot.span,{...e,ref:t,style:{...RR,...e.style}}));R9.displayName=I9;var D9=[" ","Enter","ArrowUp","ArrowDown"],M9=[" ","Enter"],Cs="Select",[Am,Tm,L9]=fR(Cs),[cu]=su(Cs,[L9,CR]),_m=CR(),[$9,Ta]=cu(Cs),[F9,z9]=cu(Cs),DR=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:i,onOpenChange:o,value:a,defaultValue:s,onValueChange:u,dir:f,name:d,autoComplete:h,disabled:m,required:v,form:w}=e,b=_m(t),[S,k]=y.useState(null),[C,j]=y.useState(null),[O,A]=y.useState(!1),N=o1(f),[I,T]=Fc({prop:r,defaultProp:i??!1,onChange:o,caller:Cs}),[$,D]=Fc({prop:a,defaultProp:s,onChange:u,caller:Cs}),U=y.useRef(null),L=S?w||!!S.closest("form"):!0,[q,W]=y.useState(new Set),H=Array.from(q).map(X=>X.props.value).join(";");return g.jsx(S9,{...b,children:g.jsxs($9,{required:v,scope:t,trigger:S,onTriggerChange:k,valueNode:C,onValueNodeChange:j,valueNodeHasChildren:O,onValueNodeHasChildrenChange:A,contentId:Sa(),value:$,onValueChange:D,open:I,onOpenChange:T,dir:N,triggerPointerDownPosRef:U,disabled:m,children:[g.jsx(Am.Provider,{scope:t,children:g.jsx(F9,{scope:e.__scopeSelect,onNativeOptionAdd:y.useCallback(X=>{W(ne=>new Set(ne).add(X))},[]),onNativeOptionRemove:y.useCallback(X=>{W(ne=>{const B=new Set(ne);return B.delete(X),B})},[]),children:n})}),L?g.jsxs(aD,{"aria-hidden":!0,required:v,tabIndex:-1,name:d,autoComplete:h,value:$,onChange:X=>D(X.target.value),disabled:m,form:w,children:[$===void 0?g.jsx("option",{value:""}):null,Array.from(q)]},H):null]})})};DR.displayName=Cs;var MR="SelectTrigger",LR=y.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...i}=e,o=_m(n),a=Ta(MR,n),s=a.disabled||r,u=Dt(t,a.onTriggerChange),f=Tm(n),d=y.useRef("touch"),[h,m,v]=lD(b=>{const S=f().filter(j=>!j.disabled),k=S.find(j=>j.value===a.value),C=uD(S,b,k);C!==void 0&&a.onValueChange(C.value)}),w=b=>{s||(a.onOpenChange(!0),v()),b&&(a.triggerPointerDownPosRef.current={x:Math.round(b.pageX),y:Math.round(b.pageY)})};return g.jsx(k9,{asChild:!0,...o,children:g.jsx(ot.button,{type:"button",role:"combobox","aria-controls":a.contentId,"aria-expanded":a.open,"aria-required":a.required,"aria-autocomplete":"none",dir:a.dir,"data-state":a.open?"open":"closed",disabled:s,"data-disabled":s?"":void 0,"data-placeholder":sD(a.value)?"":void 0,...i,ref:u,onClick:Ge(i.onClick,b=>{b.currentTarget.focus(),d.current!=="mouse"&&w(b)}),onPointerDown:Ge(i.onPointerDown,b=>{d.current=b.pointerType;const S=b.target;S.hasPointerCapture(b.pointerId)&&S.releasePointerCapture(b.pointerId),b.button===0&&b.ctrlKey===!1&&b.pointerType==="mouse"&&(w(b),b.preventDefault())}),onKeyDown:Ge(i.onKeyDown,b=>{const S=h.current!=="";!(b.ctrlKey||b.altKey||b.metaKey)&&b.key.length===1&&m(b.key),!(S&&b.key===" ")&&D9.includes(b.key)&&(w(),b.preventDefault())})})})});LR.displayName=MR;var $R="SelectValue",FR=y.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:i,children:o,placeholder:a="",...s}=e,u=Ta($R,n),{onValueNodeHasChildrenChange:f}=u,d=o!==void 0,h=Dt(t,u.onValueNodeChange);return jn(()=>{f(d)},[f,d]),g.jsx(ot.span,{...s,ref:h,style:{pointerEvents:"none"},children:sD(u.value)?g.jsx(g.Fragment,{children:a}):o})});FR.displayName=$R;var B9="SelectIcon",zR=y.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...i}=e;return g.jsx(ot.span,{"aria-hidden":!0,...i,ref:t,children:r||"▼"})});zR.displayName=B9;var U9="SelectPortal",BR=e=>g.jsx(Xw,{asChild:!0,...e});BR.displayName=U9;var Es="SelectContent",UR=y.forwardRef((e,t)=>{const n=Ta(Es,e.__scopeSelect),[r,i]=y.useState();if(jn(()=>{i(new DocumentFragment)},[]),!n.open){const o=r;return o?Aa.createPortal(g.jsx(WR,{scope:e.__scopeSelect,children:g.jsx(Am.Slot,{scope:e.__scopeSelect,children:g.jsx("div",{children:e.children})})}),o):null}return g.jsx(HR,{...e,ref:t})});UR.displayName=Es;var Yr=10,[WR,_a]=cu(Es),W9="SelectContentImpl",H9=E9("SelectContent.RemoveScroll"),HR=y.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:i,onEscapeKeyDown:o,onPointerDownOutside:a,side:s,sideOffset:u,align:f,alignOffset:d,arrowPadding:h,collisionBoundary:m,collisionPadding:v,sticky:w,hideWhenDetached:b,avoidCollisions:S,...k}=e,C=Ta(Es,n),[j,O]=y.useState(null),[A,N]=y.useState(null),I=Dt(t,ae=>O(ae)),[T,$]=y.useState(null),[D,U]=y.useState(null),L=Tm(n),[q,W]=y.useState(!1),H=y.useRef(!1);y.useEffect(()=>{if(j)return F2(j)},[j]),A2();const X=y.useCallback(ae=>{const[ge,...Z]=L().map(ie=>ie.ref.current),[de]=Z.slice(-1),me=document.activeElement;for(const ie of ae)if(ie===me||(ie==null||ie.scrollIntoView({block:"nearest"}),ie===ge&&A&&(A.scrollTop=0),ie===de&&A&&(A.scrollTop=A.scrollHeight),ie==null||ie.focus(),document.activeElement!==me))return},[L,A]),ne=y.useCallback(()=>X([T,j]),[X,T,j]);y.useEffect(()=>{q&&ne()},[q,ne]);const{onOpenChange:B,triggerPointerDownPosRef:re}=C;y.useEffect(()=>{if(j){let ae={x:0,y:0};const ge=de=>{var me,ie;ae={x:Math.abs(Math.round(de.pageX)-(((me=re.current)==null?void 0:me.x)??0)),y:Math.abs(Math.round(de.pageY)-(((ie=re.current)==null?void 0:ie.y)??0))}},Z=de=>{ae.x<=10&&ae.y<=10?de.preventDefault():j.contains(de.target)||B(!1),document.removeEventListener("pointermove",ge),re.current=null};return re.current!==null&&(document.addEventListener("pointermove",ge),document.addEventListener("pointerup",Z,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",ge),document.removeEventListener("pointerup",Z,{capture:!0})}}},[j,B,re]),y.useEffect(()=>{const ae=()=>B(!1);return window.addEventListener("blur",ae),window.addEventListener("resize",ae),()=>{window.removeEventListener("blur",ae),window.removeEventListener("resize",ae)}},[B]);const[R,z]=lD(ae=>{const ge=L().filter(me=>!me.disabled),Z=ge.find(me=>me.ref.current===document.activeElement),de=uD(ge,ae,Z);de&&setTimeout(()=>de.ref.current.focus())}),J=y.useCallback((ae,ge,Z)=>{const de=!H.current&&!Z;(C.value!==void 0&&C.value===ge||de)&&($(ae),de&&(H.current=!0))},[C.value]),M=y.useCallback(()=>j==null?void 0:j.focus(),[j]),ce=y.useCallback((ae,ge,Z)=>{const de=!H.current&&!Z;(C.value!==void 0&&C.value===ge||de)&&U(ae)},[C.value]),we=r==="popper"?mb:VR,xe=we===mb?{side:s,sideOffset:u,align:f,alignOffset:d,arrowPadding:h,collisionBoundary:m,collisionPadding:v,sticky:w,hideWhenDetached:b,avoidCollisions:S}:{};return g.jsx(WR,{scope:n,content:j,viewport:A,onViewportChange:N,itemRefCallback:J,selectedItem:T,onItemLeave:M,itemTextRefCallback:ce,focusSelectedItem:ne,selectedItemText:D,position:r,isPositioned:q,searchRef:R,children:g.jsx(Zw,{as:H9,allowPinchZoom:!0,children:g.jsx(Qw,{asChild:!0,trapped:C.open,onMountAutoFocus:ae=>{ae.preventDefault()},onUnmountAutoFocus:Ge(i,ae=>{var ge;(ge=C.trigger)==null||ge.focus({preventScroll:!0}),ae.preventDefault()}),children:g.jsx(Yw,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:o,onPointerDownOutside:a,onFocusOutside:ae=>ae.preventDefault(),onDismiss:()=>C.onOpenChange(!1),children:g.jsx(we,{role:"listbox",id:C.contentId,"data-state":C.open?"open":"closed",dir:C.dir,onContextMenu:ae=>ae.preventDefault(),...k,...xe,onPlaced:()=>W(!0),ref:I,style:{display:"flex",flexDirection:"column",outline:"none",...k.style},onKeyDown:Ge(k.onKeyDown,ae=>{const ge=ae.ctrlKey||ae.altKey||ae.metaKey;if(ae.key==="Tab"&&ae.preventDefault(),!ge&&ae.key.length===1&&z(ae.key),["ArrowUp","ArrowDown","Home","End"].includes(ae.key)){let de=L().filter(me=>!me.disabled).map(me=>me.ref.current);if(["ArrowUp","End"].includes(ae.key)&&(de=de.slice().reverse()),["ArrowUp","ArrowDown"].includes(ae.key)){const me=ae.target,ie=de.indexOf(me);de=de.slice(ie+1)}setTimeout(()=>X(de)),ae.preventDefault()}})})})})})})});HR.displayName=W9;var V9="SelectItemAlignedPosition",VR=y.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...i}=e,o=Ta(Es,n),a=_a(Es,n),[s,u]=y.useState(null),[f,d]=y.useState(null),h=Dt(t,I=>d(I)),m=Tm(n),v=y.useRef(!1),w=y.useRef(!0),{viewport:b,selectedItem:S,selectedItemText:k,focusSelectedItem:C}=a,j=y.useCallback(()=>{if(o.trigger&&o.valueNode&&s&&f&&b&&S&&k){const I=o.trigger.getBoundingClientRect(),T=f.getBoundingClientRect(),$=o.valueNode.getBoundingClientRect(),D=k.getBoundingClientRect();if(o.dir!=="rtl"){const me=D.left-T.left,ie=$.left-me,He=I.left-ie,Le=I.width+He,yt=Math.max(Le,T.width),xt=window.innerWidth-Yr,Ft=fj(ie,[Yr,Math.max(Yr,xt-yt)]);s.style.minWidth=Le+"px",s.style.left=Ft+"px"}else{const me=T.right-D.right,ie=window.innerWidth-$.right-me,He=window.innerWidth-I.right-ie,Le=I.width+He,yt=Math.max(Le,T.width),xt=window.innerWidth-Yr,Ft=fj(ie,[Yr,Math.max(Yr,xt-yt)]);s.style.minWidth=Le+"px",s.style.right=Ft+"px"}const U=m(),L=window.innerHeight-Yr*2,q=b.scrollHeight,W=window.getComputedStyle(f),H=parseInt(W.borderTopWidth,10),X=parseInt(W.paddingTop,10),ne=parseInt(W.borderBottomWidth,10),B=parseInt(W.paddingBottom,10),re=H+X+q+B+ne,R=Math.min(S.offsetHeight*5,re),z=window.getComputedStyle(b),J=parseInt(z.paddingTop,10),M=parseInt(z.paddingBottom,10),ce=I.top+I.height/2-Yr,we=L-ce,xe=S.offsetHeight/2,ae=S.offsetTop+xe,ge=H+X+ae,Z=re-ge;if(ge<=ce){const me=U.length>0&&S===U[U.length-1].ref.current;s.style.bottom="0px";const ie=f.clientHeight-b.offsetTop-b.offsetHeight,He=Math.max(we,xe+(me?M:0)+ie+ne),Le=ge+He;s.style.height=Le+"px"}else{const me=U.length>0&&S===U[0].ref.current;s.style.top="0px";const He=Math.max(ce,H+b.offsetTop+(me?J:0)+xe)+Z;s.style.height=He+"px",b.scrollTop=ge-ce+b.offsetTop}s.style.margin=`${Yr}px 0`,s.style.minHeight=R+"px",s.style.maxHeight=L+"px",r==null||r(),requestAnimationFrame(()=>v.current=!0)}},[m,o.trigger,o.valueNode,s,f,b,S,k,o.dir,r]);jn(()=>j(),[j]);const[O,A]=y.useState();jn(()=>{f&&A(window.getComputedStyle(f).zIndex)},[f]);const N=y.useCallback(I=>{I&&w.current===!0&&(j(),C==null||C(),w.current=!1)},[j,C]);return g.jsx(K9,{scope:n,contentWrapper:s,shouldExpandOnScrollRef:v,onScrollButtonChange:N,children:g.jsx("div",{ref:u,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:O},children:g.jsx(ot.div,{...i,ref:h,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}})})})});VR.displayName=V9;var q9="SelectPopperPosition",mb=y.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:i=Yr,...o}=e,a=_m(n);return g.jsx(P9,{...a,...o,ref:t,align:r,collisionPadding:i,style:{boxSizing:"border-box",...o.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});mb.displayName=q9;var[K9,p1]=cu(Es,{}),gb="SelectViewport",qR=y.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...i}=e,o=_a(gb,n),a=p1(gb,n),s=Dt(t,o.onViewportChange),u=y.useRef(0);return g.jsxs(g.Fragment,{children:[g.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),g.jsx(Am.Slot,{scope:n,children:g.jsx(ot.div,{"data-radix-select-viewport":"",role:"presentation",...i,ref:s,style:{position:"relative",flex:1,overflow:"hidden auto",...i.style},onScroll:Ge(i.onScroll,f=>{const d=f.currentTarget,{contentWrapper:h,shouldExpandOnScrollRef:m}=a;if(m!=null&&m.current&&h){const v=Math.abs(u.current-d.scrollTop);if(v>0){const w=window.innerHeight-Yr*2,b=parseFloat(h.style.minHeight),S=parseFloat(h.style.height),k=Math.max(b,S);if(k<w){const C=k+v,j=Math.min(w,C),O=C-j;h.style.height=j+"px",h.style.bottom==="0px"&&(d.scrollTop=O>0?O:0,h.style.justifyContent="flex-end")}}}u.current=d.scrollTop})})})]})});qR.displayName=gb;var KR="SelectGroup",[G9,Y9]=cu(KR),GR=y.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=Sa();return g.jsx(G9,{scope:n,id:i,children:g.jsx(ot.div,{role:"group","aria-labelledby":i,...r,ref:t})})});GR.displayName=KR;var YR="SelectLabel",QR=y.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=Y9(YR,n);return g.jsx(ot.div,{id:i.id,...r,ref:t})});QR.displayName=YR;var hp="SelectItem",[Q9,XR]=cu(hp),ZR=y.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:i=!1,textValue:o,...a}=e,s=Ta(hp,n),u=_a(hp,n),f=s.value===r,[d,h]=y.useState(o??""),[m,v]=y.useState(!1),w=Dt(t,C=>{var j;return(j=u.itemRefCallback)==null?void 0:j.call(u,C,r,i)}),b=Sa(),S=y.useRef("touch"),k=()=>{i||(s.onValueChange(r),s.onOpenChange(!1))};if(r==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return g.jsx(Q9,{scope:n,value:r,disabled:i,textId:b,isSelected:f,onItemTextChange:y.useCallback(C=>{h(j=>j||((C==null?void 0:C.textContent)??"").trim())},[]),children:g.jsx(Am.ItemSlot,{scope:n,value:r,disabled:i,textValue:d,children:g.jsx(ot.div,{role:"option","aria-labelledby":b,"data-highlighted":m?"":void 0,"aria-selected":f&&m,"data-state":f?"checked":"unchecked","aria-disabled":i||void 0,"data-disabled":i?"":void 0,tabIndex:i?void 0:-1,...a,ref:w,onFocus:Ge(a.onFocus,()=>v(!0)),onBlur:Ge(a.onBlur,()=>v(!1)),onClick:Ge(a.onClick,()=>{S.current!=="mouse"&&k()}),onPointerUp:Ge(a.onPointerUp,()=>{S.current==="mouse"&&k()}),onPointerDown:Ge(a.onPointerDown,C=>{S.current=C.pointerType}),onPointerMove:Ge(a.onPointerMove,C=>{var j;S.current=C.pointerType,i?(j=u.onItemLeave)==null||j.call(u):S.current==="mouse"&&C.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Ge(a.onPointerLeave,C=>{var j;C.currentTarget===document.activeElement&&((j=u.onItemLeave)==null||j.call(u))}),onKeyDown:Ge(a.onKeyDown,C=>{var O;((O=u.searchRef)==null?void 0:O.current)!==""&&C.key===" "||(M9.includes(C.key)&&k(),C.key===" "&&C.preventDefault())})})})})});ZR.displayName=hp;var Pc="SelectItemText",JR=y.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:i,...o}=e,a=Ta(Pc,n),s=_a(Pc,n),u=XR(Pc,n),f=z9(Pc,n),[d,h]=y.useState(null),m=Dt(t,k=>h(k),u.onItemTextChange,k=>{var C;return(C=s.itemTextRefCallback)==null?void 0:C.call(s,k,u.value,u.disabled)}),v=d==null?void 0:d.textContent,w=y.useMemo(()=>g.jsx("option",{value:u.value,disabled:u.disabled,children:v},u.value),[u.disabled,u.value,v]),{onNativeOptionAdd:b,onNativeOptionRemove:S}=f;return jn(()=>(b(w),()=>S(w)),[b,S,w]),g.jsxs(g.Fragment,{children:[g.jsx(ot.span,{id:u.textId,...o,ref:m}),u.isSelected&&a.valueNode&&!a.valueNodeHasChildren?Aa.createPortal(o.children,a.valueNode):null]})});JR.displayName=Pc;var eD="SelectItemIndicator",tD=y.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return XR(eD,n).isSelected?g.jsx(ot.span,{"aria-hidden":!0,...r,ref:t}):null});tD.displayName=eD;var vb="SelectScrollUpButton",nD=y.forwardRef((e,t)=>{const n=_a(vb,e.__scopeSelect),r=p1(vb,e.__scopeSelect),[i,o]=y.useState(!1),a=Dt(t,r.onScrollButtonChange);return jn(()=>{if(n.viewport&&n.isPositioned){let s=function(){const f=u.scrollTop>0;o(f)};const u=n.viewport;return s(),u.addEventListener("scroll",s),()=>u.removeEventListener("scroll",s)}},[n.viewport,n.isPositioned]),i?g.jsx(iD,{...e,ref:a,onAutoScroll:()=>{const{viewport:s,selectedItem:u}=n;s&&u&&(s.scrollTop=s.scrollTop-u.offsetHeight)}}):null});nD.displayName=vb;var yb="SelectScrollDownButton",rD=y.forwardRef((e,t)=>{const n=_a(yb,e.__scopeSelect),r=p1(yb,e.__scopeSelect),[i,o]=y.useState(!1),a=Dt(t,r.onScrollButtonChange);return jn(()=>{if(n.viewport&&n.isPositioned){let s=function(){const f=u.scrollHeight-u.clientHeight,d=Math.ceil(u.scrollTop)<f;o(d)};const u=n.viewport;return s(),u.addEventListener("scroll",s),()=>u.removeEventListener("scroll",s)}},[n.viewport,n.isPositioned]),i?g.jsx(iD,{...e,ref:a,onAutoScroll:()=>{const{viewport:s,selectedItem:u}=n;s&&u&&(s.scrollTop=s.scrollTop+u.offsetHeight)}}):null});rD.displayName=yb;var iD=y.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...i}=e,o=_a("SelectScrollButton",n),a=y.useRef(null),s=Tm(n),u=y.useCallback(()=>{a.current!==null&&(window.clearInterval(a.current),a.current=null)},[]);return y.useEffect(()=>()=>u(),[u]),jn(()=>{var d;const f=s().find(h=>h.ref.current===document.activeElement);(d=f==null?void 0:f.ref.current)==null||d.scrollIntoView({block:"nearest"})},[s]),g.jsx(ot.div,{"aria-hidden":!0,...i,ref:t,style:{flexShrink:0,...i.style},onPointerDown:Ge(i.onPointerDown,()=>{a.current===null&&(a.current=window.setInterval(r,50))}),onPointerMove:Ge(i.onPointerMove,()=>{var f;(f=o.onItemLeave)==null||f.call(o),a.current===null&&(a.current=window.setInterval(r,50))}),onPointerLeave:Ge(i.onPointerLeave,()=>{u()})})}),X9="SelectSeparator",oD=y.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return g.jsx(ot.div,{"aria-hidden":!0,...r,ref:t})});oD.displayName=X9;var xb="SelectArrow",Z9=y.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=_m(n),o=Ta(xb,n),a=_a(xb,n);return o.open&&a.position==="popper"?g.jsx(C9,{...i,...r,ref:t}):null});Z9.displayName=xb;var J9="SelectBubbleInput",aD=y.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const i=y.useRef(null),o=Dt(r,i),a=_9(t);return y.useEffect(()=>{const s=i.current;if(!s)return;const u=window.HTMLSelectElement.prototype,d=Object.getOwnPropertyDescriptor(u,"value").set;if(a!==t&&d){const h=new Event("change",{bubbles:!0});d.call(s,t),s.dispatchEvent(h)}},[a,t]),g.jsx(ot.select,{...n,style:{...RR,...n.style},ref:o,defaultValue:t})});aD.displayName=J9;function sD(e){return e===""||e===void 0}function lD(e){const t=Ca(e),n=y.useRef(""),r=y.useRef(0),i=y.useCallback(a=>{const s=n.current+a;t(s),(function u(f){n.current=f,window.clearTimeout(r.current),f!==""&&(r.current=window.setTimeout(()=>u(""),1e3))})(s)},[t]),o=y.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return y.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,o]}function uD(e,t,n){const i=t.length>1&&Array.from(t).every(f=>f===t[0])?t[0]:t,o=n?e.indexOf(n):-1;let a=eK(e,Math.max(o,0));i.length===1&&(a=a.filter(f=>f!==n));const u=a.find(f=>f.textValue.toLowerCase().startsWith(i.toLowerCase()));return u!==n?u:void 0}function eK(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var tK=DR,nK=LR,rK=FR,iK=zR,oK=BR,aK=UR,sK=qR,lK=GR,uK=QR,cK=ZR,fK=JR,dK=tD,hK=nD,pK=rD,mK=oD;function Ni({...e}){return g.jsx(tK,{"data-slot":"select",...e})}function gK({...e}){return g.jsx(lK,{"data-slot":"select-group",...e})}function Ai({...e}){return g.jsx(rK,{"data-slot":"select-value",...e})}function Ti({className:e,size:t="default",children:n,...r}){return g.jsxs(nK,{"data-slot":"select-trigger","data-size":t,className:Qe("border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...r,children:[n,g.jsx(iK,{asChild:!0,children:g.jsx(n1,{className:"size-4 opacity-50"})})]})}function _i({className:e,children:t,position:n="item-aligned",align:r="center",...i}){return g.jsx(oK,{children:g.jsxs(aK,{"data-slot":"select-content",className:Qe("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 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:n,align:r,...i,children:[g.jsx(xK,{}),g.jsx(sK,{className:Qe("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:t}),g.jsx(bK,{})]})})}function vK({className:e,...t}){return g.jsx(uK,{"data-slot":"select-label",className:Qe("text-muted-foreground px-2 py-1.5 text-xs",e),...t})}function vt({className:e,children:t,...n}){return g.jsxs(cK,{"data-slot":"select-item",className:Qe("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 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 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",e),...n,children:[g.jsx("span",{"data-slot":"select-item-indicator",className:"absolute right-2 flex size-3.5 items-center justify-center",children:g.jsx(dK,{children:g.jsx(bV,{className:"size-4"})})}),g.jsx(fK,{children:t})]})}function yK({className:e,...t}){return g.jsx(mK,{"data-slot":"select-separator",className:Qe("bg-border pointer-events-none -mx-1 my-1 h-px",e),...t})}function xK({className:e,...t}){return g.jsx(hK,{"data-slot":"select-scroll-up-button",className:Qe("flex cursor-default items-center justify-center py-1",e),...t,children:g.jsx(CV,{className:"size-4"})})}function bK({className:e,...t}){return g.jsx(pK,{"data-slot":"select-scroll-down-button",className:Qe("flex cursor-default items-center justify-center py-1",e),...t,children:g.jsx(n1,{className:"size-4"})})}function wK(e={}){const{page:t=1,limit:n=20,tag:r,search:i,paginate:o=!0}=e;return Di({queryKey:["decisions",{page:t,limit:n,tag:r,search:i,paginate:o}],queryFn:()=>o?cW({page:t,limit:n,tag:r,search:i}):uW().then(a=>({data:a,pagination:{page:1,limit:a.length,total:a.length,totalPages:1,hasNext:!1,hasPrev:!1}}))})}function SK({decision:e,onClick:t}){const{i18n:n}=Ke("decisions"),r=new Date(e.createdAt).toLocaleDateString(n.language==="ja"?"ja-JP":"en-US");return g.jsx(nt,{className:"hover:bg-stone-50 dark:hover:bg-stone-800 transition-colors cursor-pointer h-full",onClick:t,children:g.jsxs(rt,{className:"p-3",children:[g.jsx("div",{className:"flex items-start justify-between gap-2 mb-1",children:g.jsx(nr,{className:"text-sm font-medium line-clamp-2",children:e.title})}),g.jsx("div",{className:"text-xs text-stone-500 dark:text-stone-400 mb-2",children:r}),e.tags&&e.tags.length>0&&g.jsx("div",{className:"flex flex-wrap gap-1",children:e.tags.slice(0,3).map(i=>g.jsx(tt,{variant:"secondary",className:"text-xs px-1.5 py-0",children:i},i))})]})})}function kK({decisionId:e,open:t,onOpenChange:n}){var f,d;const{t:r}=Ke("decisions"),{t:i}=Ke("common"),[o,a]=y.useState(null),[s,u]=y.useState(!1);return y.useEffect(()=>{if(!e||!t){a(null);return}u(!0),fW(e).then(a).catch(()=>a(null)).finally(()=>u(!1))},[e,t]),g.jsx(r1,{open:t,onOpenChange:n,children:g.jsxs(Pm,{className:"sm:max-w-2xl max-h-[80vh] overflow-y-auto","aria-describedby":void 0,children:[g.jsx(i1,{children:g.jsx(Cm,{children:s?g.jsx(et,{className:"h-6 w-3/4"}):(o==null?void 0:o.title)||i("loading")})}),s?g.jsxs("div",{className:"space-y-4",children:[g.jsx(et,{className:"h-20 w-full"}),g.jsx(et,{className:"h-20 w-full"})]}):o?g.jsxs("div",{className:"space-y-4",children:[g.jsxs("div",{className:"space-y-1",children:[g.jsx("span",{className:"text-xs font-medium text-stone-500 dark:text-stone-400 uppercase tracking-wide",children:r("detail.decision")}),g.jsx("div",{className:"bg-stone-100 dark:bg-stone-800 border border-stone-300 dark:border-stone-600 rounded px-4 py-3",children:g.jsx("p",{className:"whitespace-pre-wrap text-sm leading-relaxed",children:o.decision})})]}),g.jsxs("div",{className:"space-y-1",children:[g.jsx("span",{className:"text-xs font-medium text-stone-500 dark:text-stone-400 uppercase tracking-wide",children:r("detail.reasoning")}),g.jsx("div",{className:"bg-amber-50 dark:bg-amber-950/50 border border-amber-300 dark:border-amber-800 rounded px-4 py-3",children:g.jsx("p",{className:"whitespace-pre-wrap text-sm leading-relaxed text-amber-900 dark:text-amber-100",children:o.reasoning})})]}),((f=o.alternatives)==null?void 0:f.length)>0&&g.jsxs("div",{className:"space-y-1",children:[g.jsx("span",{className:"text-xs font-medium text-stone-500 dark:text-stone-400 uppercase tracking-wide",children:r("detail.alternatives")}),g.jsx("div",{className:"space-y-2",children:o.alternatives.map(h=>{const m=h.name||h.option;return g.jsxs("div",{className:"border border-stone-300 dark:border-stone-600 rounded px-4 py-3",children:[g.jsx("span",{className:"font-medium text-sm",children:m}),g.jsx("p",{className:"text-sm text-stone-500 dark:text-stone-400 mt-1",children:h.reason})]},`${m}-${h.reason}`)})})]}),((d=o.tags)==null?void 0:d.length)>0&&g.jsx("div",{className:"flex flex-wrap gap-1 pt-2",children:o.tags.map(h=>g.jsx(tt,{variant:"secondary",className:"text-xs",children:h},h))})]}):g.jsx("div",{className:"text-center py-8 text-muted-foreground",children:i("loading")})]})})}function PK(){const{t:e}=Ke("decisions"),{t}=Ke("common"),[n,r]=y.useState(1),[i,o]=y.useState(""),[a,s]=y.useState("all"),[u,f]=y.useState(null),[d,h]=y.useState("");y.useMemo(()=>{const C=setTimeout(()=>{h(i),r(1)},300);return()=>clearTimeout(C)},[i]);const{data:m,isLoading:v,error:w}=wK({page:n,limit:20,tag:a!=="all"?a:void 0,search:d||void 0}),b=y.useMemo(()=>{if(!(m!=null&&m.data))return[];const C=new Set;for(const j of m.data)for(const O of j.tags||[])C.add(O);return Array.from(C).sort()},[m==null?void 0:m.data]);if(v)return g.jsxs("div",{className:"space-y-6",children:[g.jsx("div",{className:"flex items-center justify-between",children:g.jsx("h1",{className:"text-2xl font-bold",children:e("title")})}),g.jsx(SW,{count:5})]});if(w)return g.jsx("div",{className:"text-center py-12 text-destructive",children:e("errors:failedToLoad.decisions")});const S=(m==null?void 0:m.data)||[],k=m==null?void 0:m.pagination;return g.jsxs("div",{className:"space-y-6",children:[g.jsxs("div",{className:"flex items-center justify-between",children:[g.jsxs("div",{children:[g.jsx("h1",{className:"text-2xl font-bold",children:e("title")}),g.jsx("p",{className:"text-sm text-muted-foreground",children:e("subtitle")})]}),g.jsx("p",{className:"text-sm text-muted-foreground",children:e("decisionCount",{count:(k==null?void 0:k.total)||0})})]}),((k==null?void 0:k.total)||0)===0&&!d&&a==="all"?g.jsxs("div",{className:"text-center py-12 text-muted-foreground",children:[g.jsx("p",{children:e("noDecisionsFound")}),g.jsx("p",{className:"text-sm mt-2",children:e("noDecisionsDescription")})]}):g.jsxs(g.Fragment,{children:[g.jsxs("div",{className:"flex gap-4 items-center flex-wrap",children:[g.jsx(mf,{placeholder:e("searchPlaceholder"),value:i,onChange:C=>o(C.target.value),className:"max-w-xs"}),g.jsxs(Ni,{value:a,onValueChange:C=>{s(C),r(1)},children:[g.jsx(Ti,{className:"w-[180px]",children:g.jsx(Ai,{placeholder:t("allTags")})}),g.jsxs(_i,{children:[g.jsx(vt,{value:"all",children:t("allTags")}),b.map(C=>g.jsx(vt,{value:C,children:C},C))]})]})]}),S.length===0?g.jsx("div",{className:"text-center py-12 text-muted-foreground",children:g.jsx("p",{children:e("noMatchingFilters")})}):g.jsxs(g.Fragment,{children:[g.jsx("div",{className:"grid gap-3 sm:grid-cols-2 md:grid-cols-3",children:S.map(C=>g.jsx(SK,{decision:C,onClick:()=>f(C.id)},C.id))}),k&&g.jsx(cR,{page:k.page,totalPages:k.totalPages,hasNext:k.hasNext,hasPrev:k.hasPrev,onPageChange:r})]})]}),g.jsx(kK,{decisionId:u,open:!!u,onOpenChange:C=>!C&&f(null)})]})}function CK(){return g.jsx(E6,{to:"/decisions",replace:!0})}const EK="modulepreload",jK=function(e){return"/"+e},Pj={},OK=function(t,n,r){let i=Promise.resolve();if(n&&n.length>0){let a=function(f){return Promise.all(f.map(d=>Promise.resolve(d).then(h=>({status:"fulfilled",value:h}),h=>({status:"rejected",reason:h}))))};document.getElementsByTagName("link");const s=document.querySelector("meta[property=csp-nonce]"),u=(s==null?void 0:s.nonce)||(s==null?void 0:s.getAttribute("nonce"));i=a(n.map(f=>{if(f=jK(f),f in Pj)return;Pj[f]=!0;const d=f.endsWith(".css"),h=d?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${f}"]${h}`))return;const m=document.createElement("link");if(m.rel=d?"stylesheet":EK,d||(m.as="script"),m.crossOrigin="",m.href=f,u&&m.setAttribute("nonce",u),document.head.appendChild(m),d)return new Promise((v,w)=>{m.addEventListener("load",v),m.addEventListener("error",()=>w(new Error(`Unable to preload CSS for ${f}`)))})}))}function o(a){const s=new Event("vite:preloadError",{cancelable:!0});if(s.payload=a,window.dispatchEvent(s),!s.defaultPrevented)throw a}return i.then(a=>{for(const s of a||[])s.status==="rejected"&&o(s.reason);return t().catch(o)})},NK=y.lazy(()=>OK(()=>import("./react-force-graph-2d-DWoBaKmT.js"),[]));function AK(e){const[t,n]=y.useState({width:800,height:500});return y.useEffect(()=>{const r=()=>{if(e.current){const i=window.innerHeight-184;n({width:e.current.offsetWidth,height:Math.max(400,i)})}};return r(),window.addEventListener("resize",r),()=>window.removeEventListener("resize",r)},[e]),t}async function TK(){const e=await fetch("/api/sessions/graph");if(!e.ok)throw new Error("Failed to fetch graph");return e.json()}const uc={decision:"#f59e0b",implementation:"#3b82f6",research:"#8b5cf6",exploration:"#10b981",discussion:"#6366f1",debug:"#ef4444",review:"#ec4899",unknown:"#6b7280"};function _K(){const{t:e}=Ke("graph"),t=ym(),n=y.useRef(null),r=y.useRef(null),[i,o]=y.useState(null),[a,s]=y.useState({x:0,y:0}),u=AK(r),{data:f,isLoading:d,error:h}=Di({queryKey:["sessions","graph"],queryFn:TK}),m=y.useMemo(()=>f?{nodes:f.nodes.map(S=>({...S,color:uc[S.type]||uc.unknown})),links:f.edges.map(S=>({source:S.source,target:S.target,value:S.weight}))}:{nodes:[],links:[]},[f]),v=y.useCallback(S=>{S.id&&t(`/sessions/${S.id}`)},[t]),w=y.useCallback(S=>{o(S)},[]),b=y.useCallback(S=>{const k=S.currentTarget.getBoundingClientRect();s({x:S.clientX-k.left,y:S.clientY-k.top})},[]);return h?g.jsx("div",{className:"text-center py-12 text-destructive",children:e("errors:failedToLoad.graph")}):g.jsxs("div",{className:"h-full flex flex-col",children:[g.jsxs("div",{className:"mb-4",children:[g.jsx("h1",{className:"text-xl font-bold",children:e("title")}),g.jsx("p",{className:"text-xs text-muted-foreground",children:e("subtitle")})]}),g.jsxs("div",{className:"grid gap-4 lg:grid-cols-[1fr_280px] flex-1 min-h-0",children:[g.jsx(nt,{className:"overflow-hidden",children:g.jsxs(rt,{className:"p-0 relative",ref:r,onMouseMove:b,children:[d?g.jsx(et,{className:"h-full min-h-[400px] w-full"}):m.nodes.length===0?g.jsx("div",{className:"h-full min-h-[400px] flex items-center justify-center text-muted-foreground",children:e("noSessions")}):g.jsx(y.Suspense,{fallback:g.jsx(et,{className:"h-full min-h-[400px] w-full"}),children:g.jsx(NK,{ref:n,graphData:m,nodeColor:"color",nodeRelSize:6,linkWidth:S=>Math.sqrt(S.value||1),linkColor:()=>"#cbd5e1",onNodeClick:v,onNodeHover:w,width:u.width,height:u.height,backgroundColor:"#ffffff"})}),i&&g.jsxs("div",{className:"absolute pointer-events-none bg-white border border-stone-200 rounded-lg shadow-lg p-3 max-w-[240px] z-10",style:{left:Math.min(a.x+12,u.width-260),top:Math.min(a.y+12,u.height-120)},children:[g.jsx("p",{className:"font-medium text-sm line-clamp-2 mb-1",children:i.title}),g.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-muted-foreground mb-1",children:[g.jsx("span",{className:"h-2 w-2 rounded-full",style:{backgroundColor:uc[i.type]||uc.unknown}}),g.jsx("span",{children:e(`types.${i.type}`)})]}),i.tags.length>0&&g.jsxs("div",{className:"flex flex-wrap gap-1 mb-1",children:[i.tags.slice(0,3).map(S=>g.jsx("span",{className:"text-xs bg-stone-100 px-1.5 py-0.5 rounded",children:S},S)),i.tags.length>3&&g.jsxs("span",{className:"text-xs text-muted-foreground",children:["+",i.tags.length-3]})]}),g.jsx("p",{className:"text-xs text-stone-400",children:e("clickToViewDetails")})]})]})}),g.jsxs("div",{className:"space-y-4",children:[g.jsxs(nt,{children:[g.jsx(tr,{children:g.jsx(nr,{className:"text-sm",children:e("howToRead.title")})}),g.jsxs(rt,{className:"space-y-2 text-sm text-muted-foreground",children:[g.jsxs("div",{className:"flex items-start gap-2",children:[g.jsx("span",{className:"inline-block w-3 h-3 rounded-full bg-blue-500 mt-1 shrink-0"}),g.jsxs("span",{children:[g.jsx("strong",{children:"Nodes"})," = ",e("howToRead.nodes")]})]}),g.jsxs("div",{className:"flex items-start gap-2",children:[g.jsx("span",{className:"inline-block w-6 h-0.5 bg-slate-300 mt-2 shrink-0"}),g.jsxs("span",{children:[g.jsx("strong",{children:"Lines"})," = ",e("howToRead.lines")]})]}),g.jsx("p",{className:"pt-2 text-xs",children:e("howToRead.clickHint")})]})]}),g.jsxs(nt,{children:[g.jsx(tr,{children:g.jsx(nr,{className:"text-sm",children:e("sessionTypes")})}),g.jsx(rt,{className:"grid grid-cols-2 gap-x-4 gap-y-2",children:Object.entries(uc).map(([S,k])=>g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx("span",{className:"h-3 w-3 rounded-full shrink-0",style:{backgroundColor:k}}),g.jsx("span",{className:"text-sm capitalize truncate",children:e(`types.${S}`)})]},S))})]}),g.jsxs(nt,{children:[g.jsx(tr,{children:g.jsx(nr,{className:"text-sm",children:e("graphStats.title")})}),g.jsxs(rt,{className:"space-y-1 text-sm",children:[g.jsxs("p",{children:[e("graphStats.nodes"),": ",m.nodes.length]}),g.jsxs("p",{children:[e("graphStats.connections"),": ",m.links.length]})]})]})]})]})]})}const IK=[{path:"/guide",labelKey:"nav.overview"},{path:"/guide/workflow",labelKey:"nav.workflow"},{path:"/guide/commands",labelKey:"nav.commands"},{path:"/guide/use-cases",labelKey:"nav.useCases"},{path:"/guide/faq",labelKey:"nav.faq"}];function vf(){const{t:e}=Ke("guide"),t=Wi();return g.jsx("nav",{className:"flex flex-wrap gap-2 mb-6 pb-4 border-b border-stone-200 dark:border-stone-700",children:IK.map(n=>{const r=t.pathname===n.path;return g.jsx(Mi,{to:n.path,className:Qe("px-3 py-1.5 rounded-md text-sm font-medium transition-colors",r?"bg-stone-800 text-white dark:bg-stone-700":"text-stone-600 hover:text-stone-900 hover:bg-stone-100 dark:text-stone-400 dark:hover:text-stone-100 dark:hover:bg-stone-800"),children:e(n.labelKey)},n.path)})})}function RK(){const{t:e}=Ke("guide"),t=e("overview.features.items",{returnObjects:!0}),n=e("overview.quickStart.steps",{returnObjects:!0});return g.jsxs("div",{className:"space-y-6",children:[g.jsxs("div",{children:[g.jsx("h1",{className:"text-2xl font-bold",children:e("overview.title")}),g.jsx("p",{className:"text-sm text-muted-foreground",children:e("overview.subtitle")})]}),g.jsx(vf,{}),g.jsx("p",{className:"text-stone-600 dark:text-stone-300",children:e("overview.description")}),g.jsxs("section",{className:"space-y-4",children:[g.jsx("h2",{className:"text-lg font-semibold",children:e("overview.features.title")}),g.jsx("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-3",children:t.map(r=>g.jsx(nt,{children:g.jsxs(rt,{className:"p-4",children:[g.jsx("h3",{className:"font-medium mb-1",children:r.title}),g.jsx("p",{className:"text-sm text-muted-foreground",children:r.description})]})},r.title))})]}),g.jsxs("section",{className:"space-y-4",children:[g.jsx("h2",{className:"text-lg font-semibold",children:e("overview.quickStart.title")}),g.jsx("div",{className:"space-y-4",children:n.map((r,i)=>g.jsxs("div",{className:"flex gap-4",children:[g.jsx("div",{className:"flex-shrink-0 w-8 h-8 rounded-full bg-stone-800 dark:bg-stone-700 text-white flex items-center justify-center text-sm font-medium",children:i+1}),g.jsxs("div",{className:"flex-1",children:[g.jsx("h3",{className:"font-medium",children:r.title}),g.jsx("p",{className:"text-sm text-muted-foreground mb-2",children:r.description}),r.code&&g.jsx("code",{className:"block bg-stone-100 dark:bg-stone-800 px-3 py-2 rounded text-sm font-mono",children:r.code})]})]},r.title))})]})]})}function m1({id:e,isExpanded:t,onToggle:n,header:r,children:i,className:o}){const{t:a}=Ke("guide"),s=`${e}-content`;return g.jsxs(nt,{className:Qe("overflow-hidden",o),children:[g.jsx("button",{type:"button",className:"w-full text-left",onClick:n,"aria-expanded":t,"aria-controls":s,children:g.jsx(rt,{className:"p-4",children:g.jsxs("div",{className:"flex items-start justify-between gap-4",children:[g.jsx("div",{id:e,className:"flex-1 min-w-0",children:r}),g.jsx("svg",{className:Qe("h-5 w-5 text-muted-foreground transition-transform shrink-0",t&&"rotate-180"),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:g.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})}),g.jsx("span",{className:"sr-only",children:a(t?"common.collapse":"common.expand")})]})})}),t&&g.jsx("section",{id:s,"aria-labelledby":e,className:"px-4 pb-4 border-t border-stone-100 dark:border-stone-800 pt-4",children:i})]})}function DK(){const{t:e}=Ke("guide"),[t,n]=y.useState(null),r=e("commands.categories",{returnObjects:!0}),i=o=>{n(t===o?null:o)};return g.jsxs("div",{className:"space-y-6",children:[g.jsxs("div",{children:[g.jsx("h1",{className:"text-2xl font-bold",children:e("commands.title")}),g.jsx("p",{className:"text-sm text-muted-foreground",children:e("commands.subtitle")})]}),g.jsx(vf,{}),Object.entries(r).map(([o,a])=>g.jsxs("section",{className:"space-y-3",children:[g.jsx("h2",{className:"text-lg font-semibold",children:a.title}),g.jsx("div",{className:"space-y-2",children:a.commands.map(s=>{const u=t===s.name,f=`command-${s.name.replace(/[^a-zA-Z0-9]/g,"-")}`;return g.jsx(m1,{id:f,isExpanded:u,onToggle:()=>i(s.name),header:g.jsxs(g.Fragment,{children:[g.jsx("div",{className:"flex items-center gap-2 mb-1",children:g.jsx("code",{className:"font-mono font-semibold text-sm",children:s.name})}),g.jsx("p",{className:"text-sm text-muted-foreground",children:s.description})]}),children:g.jsxs("div",{className:"space-y-4",children:[g.jsxs("div",{children:[g.jsx("span",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide",children:e("common.usage")}),g.jsx("code",{className:"block bg-stone-100 dark:bg-stone-800 px-3 py-2 rounded text-sm font-mono mt-1",children:s.usage})]}),g.jsxs("div",{children:[g.jsx("span",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide",children:e("common.details")}),g.jsx("p",{className:"text-sm mt-1",children:s.details})]}),s.options.length>0&&g.jsxs("div",{children:[g.jsx("span",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide",children:e("common.options")}),g.jsx("div",{className:"mt-2 space-y-2",children:s.options.map(d=>g.jsxs("div",{className:"flex gap-2",children:[g.jsx(tt,{variant:"outline",className:"font-mono text-xs shrink-0",children:d.name}),g.jsx("span",{className:"text-sm text-muted-foreground",children:d.description})]},d.name))})]}),s.phases&&s.phases.length>0&&g.jsxs("div",{children:[g.jsx("span",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide",children:e("common.phases")}),g.jsx("ol",{className:"mt-2 space-y-1",children:s.phases.map((d,h)=>g.jsxs("li",{className:"text-sm flex items-start gap-2",children:[g.jsx("span",{className:"w-5 h-5 rounded-full bg-stone-200 dark:bg-stone-700 text-xs flex items-center justify-center shrink-0",children:h+1}),g.jsx("span",{children:d})]},d))})]})]})},s.name)})})]},o))]})}function MK(){const{t:e}=Ke("guide"),[t,n]=y.useState(null),r=e("faq.categories",{returnObjects:!0}),i=o=>{n(t===o?null:o)};return g.jsxs("div",{className:"space-y-6",children:[g.jsxs("div",{children:[g.jsx("h1",{className:"text-2xl font-bold",children:e("faq.title")}),g.jsx("p",{className:"text-sm text-muted-foreground",children:e("faq.subtitle")})]}),g.jsx(vf,{}),Object.entries(r).map(([o,a])=>g.jsxs("section",{className:"space-y-3",children:[g.jsx("h2",{className:"text-lg font-semibold",children:a.title}),g.jsx("div",{className:"space-y-2",children:a.items.map((s,u)=>{const f=t===s.question,d=`faq-${o}-${u}`;return g.jsx(m1,{id:d,isExpanded:f,onToggle:()=>i(s.question),header:g.jsxs("div",{className:"flex items-start gap-3",children:[g.jsx("span",{className:"text-stone-400 dark:text-stone-500 shrink-0",children:e("common.question")}),g.jsx("span",{className:"font-medium",children:s.question})]}),children:g.jsxs("div",{className:"flex gap-3",children:[g.jsx("span",{className:"text-green-600 dark:text-green-400 shrink-0",children:e("common.answer")}),g.jsx("p",{className:"text-sm text-muted-foreground",children:s.answer})]})},s.question)})})]},o))]})}function LK(){const{t:e}=Ke("guide"),[t,n]=y.useState(null),r=e("useCases.cases",{returnObjects:!0}),i=o=>{n(t===o?null:o)};return g.jsxs("div",{className:"space-y-6",children:[g.jsxs("div",{children:[g.jsx("h1",{className:"text-2xl font-bold",children:e("useCases.title")}),g.jsx("p",{className:"text-sm text-muted-foreground",children:e("useCases.subtitle")})]}),g.jsx(vf,{}),g.jsx("div",{className:"space-y-3",children:r.map((o,a)=>{const s=t===o.title,u=`usecase-${a}`;return g.jsx(m1,{id:u,isExpanded:s,onToggle:()=>i(o.title),header:g.jsxs(g.Fragment,{children:[g.jsx("h3",{className:"font-medium mb-1",children:o.title}),g.jsx("p",{className:"text-sm text-muted-foreground",children:o.scenario})]}),children:g.jsx("div",{className:"space-y-3",children:o.steps.map((f,d)=>g.jsxs("div",{className:"flex gap-3",children:[g.jsxs("div",{className:"flex flex-col items-center",children:[g.jsx("div",{className:"w-6 h-6 rounded-full bg-stone-800 dark:bg-stone-700 text-white text-xs flex items-center justify-center shrink-0",children:d+1}),d<o.steps.length-1&&g.jsx("div",{className:"w-0.5 flex-1 bg-stone-200 dark:bg-stone-700 mt-1"})]}),g.jsxs("div",{className:"flex-1 pb-2",children:[g.jsx("p",{className:"text-sm font-medium",children:f.action}),g.jsxs("p",{className:"text-sm text-green-600 dark:text-green-400 mt-1",children:["→ ",f.result]})]})]},f.action))})},o.title)})})]})}function $K(){const{t:e}=Ke("guide"),t=e("workflow.phases",{returnObjects:!0}),n=e("workflow.dataFlow.steps",{returnObjects:!0});return g.jsxs("div",{className:"space-y-6",children:[g.jsxs("div",{children:[g.jsx("h1",{className:"text-2xl font-bold",children:e("workflow.title")}),g.jsx("p",{className:"text-sm text-muted-foreground",children:e("workflow.subtitle")})]}),g.jsx(vf,{}),g.jsx("p",{className:"text-stone-600 dark:text-stone-300",children:e("workflow.intro")}),g.jsx("section",{className:"space-y-4",children:g.jsx("div",{className:"grid gap-4 md:grid-cols-2",children:t.map((r,i)=>g.jsxs(nt,{className:"relative overflow-hidden",children:[g.jsx("div",{className:"absolute top-0 left-0 w-1 h-full bg-stone-800 dark:bg-stone-600"}),g.jsxs(rt,{className:"p-4 pl-5",children:[g.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[g.jsx("span",{className:"w-6 h-6 rounded-full bg-stone-800 dark:bg-stone-700 text-white text-xs flex items-center justify-center",children:i+1}),g.jsx("h3",{className:"font-semibold",children:r.name}),r.command&&g.jsx(tt,{variant:"secondary",className:"font-mono text-xs",children:r.command})]}),g.jsx("p",{className:"text-sm text-muted-foreground mb-3",children:r.description}),g.jsx("ul",{className:"space-y-1 mb-3",children:r.benefits.map(o=>g.jsxs("li",{className:"text-sm flex items-start gap-2",children:[g.jsx("span",{className:"text-green-600 dark:text-green-400 mt-0.5",children:"+"}),g.jsx("span",{children:o})]},o))}),r.example&&g.jsx("code",{className:"block bg-stone-100 dark:bg-stone-800 px-2 py-1 rounded text-xs font-mono",children:r.example})]})]},r.name))})}),g.jsxs("section",{className:"space-y-4",children:[g.jsx("h2",{className:"text-lg font-semibold",children:e("workflow.dataFlow.title")}),g.jsx("p",{className:"text-sm text-muted-foreground",children:e("workflow.dataFlow.description")}),g.jsxs("div",{className:"relative",children:[g.jsx("div",{className:"absolute left-4 top-0 bottom-0 w-0.5 bg-stone-200 dark:bg-stone-700"}),g.jsx("div",{className:"space-y-4",children:n.map((r,i)=>g.jsxs("div",{className:"flex gap-4 relative",children:[g.jsx("div",{className:"w-8 h-8 rounded-full bg-white dark:bg-stone-900 border-2 border-stone-300 dark:border-stone-600 flex items-center justify-center text-xs font-medium z-10",children:i+1}),g.jsxs("div",{className:"flex-1 pb-4",children:[g.jsx("h4",{className:"font-medium text-sm",children:r.event}),g.jsx("p",{className:"text-sm text-muted-foreground",children:r.action})]})]},r.event))})]})]})]})}function FK(){const{t:e}=Ke("errors");return g.jsxs("div",{className:"text-center py-12",children:[g.jsx("h1",{className:"text-4xl font-bold mb-4",children:e("notFound.title")}),g.jsx("p",{className:"text-muted-foreground mb-4",children:e("notFound.message")}),g.jsx(Mi,{to:"/",className:"text-primary underline",children:e("notFound.backToHome")})]})}async function zK(){const e=await fetch("/api/patterns");if(!e.ok)throw new Error("Failed to fetch patterns");return e.json()}async function BK(){const e=await fetch("/api/patterns/stats");if(!e.ok)throw new Error("Failed to fetch stats");return e.json()}const pp={good:{bg:"bg-emerald-50 dark:bg-emerald-950/30",text:"text-emerald-700 dark:text-emerald-300",border:"border-emerald-200 dark:border-emerald-800"},bad:{bg:"bg-rose-50 dark:bg-rose-950/30",text:"text-rose-700 dark:text-rose-300",border:"border-rose-200 dark:border-rose-800"},"error-solution":{bg:"bg-amber-50 dark:bg-amber-950/30",text:"text-amber-700 dark:text-amber-300",border:"border-amber-200 dark:border-amber-800"}};function UK({pattern:e,onClick:t}){const{t:n,i18n:r}=Ke("patterns"),i=pp[e.type]||pp.good,o=new Date(e.createdAt).toLocaleDateString(r.language==="ja"?"ja-JP":"en-US"),a={good:n("types.good"),bad:n("types.bad"),"error-solution":n("types.errorSolution")};return g.jsx(nt,{className:`${i.border} border hover:bg-stone-50 dark:hover:bg-stone-800 transition-colors cursor-pointer h-full`,onClick:t,children:g.jsxs(rt,{className:"p-3",children:[g.jsx("div",{className:"flex items-start justify-between gap-2 mb-1",children:g.jsx(nr,{className:"text-sm font-medium line-clamp-2",children:e.title||e.description||e.errorPattern||e.solution||"Untitled"})}),g.jsxs("div",{className:"flex items-center gap-2 text-xs text-stone-500 dark:text-stone-400 mb-2",children:[g.jsx(tt,{className:`${i.bg} ${i.text} border-0 text-xs`,children:a[e.type]||e.type}),g.jsx("span",{children:o})]}),e.tags&&e.tags.length>0&&g.jsxs("div",{className:"flex flex-wrap gap-1",children:[e.tags.slice(0,3).map(s=>g.jsx(tt,{variant:"secondary",className:"text-xs px-1.5 py-0",children:s},s)),e.tags.length>3&&g.jsxs(tt,{variant:"outline",className:"text-xs px-1.5 py-0",children:["+",e.tags.length-3]})]})]})})}function WK({pattern:e,open:t,onOpenChange:n}){const{t:r}=Ke("patterns");if(!e)return null;const i=pp[e.type]||pp.good,o={good:r("types.good"),bad:r("types.bad"),"error-solution":r("types.errorSolution")};return g.jsx(r1,{open:t,onOpenChange:n,children:g.jsxs(Pm,{className:"sm:max-w-2xl max-h-[80vh] overflow-y-auto","aria-describedby":void 0,children:[g.jsxs(i1,{children:[g.jsx("div",{className:"flex items-center gap-2",children:g.jsx(tt,{className:`${i.bg} ${i.text} border-0`,children:o[e.type]||e.type})}),g.jsx(Cm,{className:"mt-2",children:e.title||e.description||e.errorPattern||e.solution||"Untitled"})]}),g.jsxs("div",{className:"space-y-4",children:[e.title&&e.description!==e.title&&g.jsxs("div",{className:"space-y-1",children:[g.jsx("span",{className:"text-xs font-medium text-stone-500 dark:text-stone-400 uppercase tracking-wide",children:r("fields.description")}),g.jsx("p",{className:"text-sm leading-relaxed",children:e.description})]}),e.type==="error-solution"&&e.errorPattern&&g.jsxs("div",{className:"space-y-1",children:[g.jsx("span",{className:"text-xs font-medium text-rose-600 dark:text-rose-400 uppercase tracking-wide",children:r("fields.errorPattern")}),g.jsx("pre",{className:"text-xs bg-rose-50 dark:bg-rose-950/30 text-rose-800 dark:text-rose-200 p-3 rounded overflow-x-auto whitespace-pre-wrap border border-rose-200 dark:border-rose-800",children:e.errorPattern})]}),e.type==="error-solution"&&e.solution&&g.jsxs("div",{className:"space-y-1",children:[g.jsx("span",{className:"text-xs font-medium text-emerald-600 dark:text-emerald-400 uppercase tracking-wide",children:r("fields.solution")}),g.jsx("pre",{className:"text-xs bg-emerald-50 dark:bg-emerald-950/30 text-emerald-800 dark:text-emerald-200 p-3 rounded overflow-x-auto whitespace-pre-wrap border border-emerald-200 dark:border-emerald-800",children:e.solution})]}),e.codeExample&&g.jsxs("div",{className:"space-y-1",children:[g.jsx("span",{className:"text-xs font-medium text-stone-500 dark:text-stone-400 uppercase tracking-wide",children:r("fields.codeExample")}),g.jsx("pre",{className:"text-xs bg-stone-100 dark:bg-stone-800 text-stone-700 dark:text-stone-300 p-3 rounded overflow-x-auto whitespace-pre-wrap border border-stone-300 dark:border-stone-600",children:e.codeExample})]}),e.context&&g.jsxs("div",{className:"space-y-1",children:[g.jsx("span",{className:"text-xs font-medium text-stone-500 dark:text-stone-400 uppercase tracking-wide",children:r("fields.context")}),g.jsx("pre",{className:"text-xs bg-stone-100 dark:bg-stone-800 text-stone-700 dark:text-stone-300 p-3 rounded overflow-x-auto whitespace-pre-wrap border border-stone-300 dark:border-stone-600",children:e.context})]}),e.tags&&e.tags.length>0&&g.jsx("div",{className:"flex flex-wrap gap-1 pt-2",children:e.tags.map(a=>g.jsx(tt,{variant:"secondary",className:"text-xs",children:a},a))})]})]})})}function ch({title:e,value:t,color:n}){return g.jsx(nt,{children:g.jsxs(rt,{className:"pt-4",children:[g.jsx("div",{className:"text-2xl font-bold",style:{color:n},children:t}),g.jsx("div",{className:"text-xs text-stone-500 dark:text-stone-400",children:e})]})})}function HK(){var b,S,k;const{t:e}=Ke("patterns"),[t,n]=y.useState(""),[r,i]=y.useState("all"),[o,a]=y.useState(null),{data:s,isLoading:u,error:f}=Di({queryKey:["patterns"],queryFn:zK}),{data:d,isLoading:h,error:m}=Di({queryKey:["patterns","stats"],queryFn:BK});if(f||m)return g.jsx("div",{className:"text-center py-12 text-destructive",children:e("errors:failedToLoad.patterns")});const v=(s==null?void 0:s.patterns)||[],w=v.filter(C=>{var A,N,I;const j=t===""||((A=C.title)==null?void 0:A.toLowerCase().includes(t.toLowerCase()))||C.description.toLowerCase().includes(t.toLowerCase())||((N=C.errorPattern)==null?void 0:N.toLowerCase().includes(t.toLowerCase()))||((I=C.solution)==null?void 0:I.toLowerCase().includes(t.toLowerCase())),O=r==="all"||C.type===r;return j&&O});return g.jsxs("div",{className:"space-y-6",children:[g.jsxs("div",{className:"flex items-center justify-between",children:[g.jsxs("div",{children:[g.jsx("h1",{className:"text-2xl font-bold",children:e("title")}),g.jsx("p",{className:"text-sm text-muted-foreground",children:e("subtitle")})]}),g.jsx("p",{className:"text-sm text-muted-foreground",children:e("patternCount",{count:v.length})})]}),v.length===0&&!u&&g.jsx(nt,{className:"border-dashed",children:g.jsxs(rt,{className:"py-6",children:[g.jsx("h3",{className:"font-medium mb-2",children:e("explanation.title")}),g.jsxs("div",{className:"text-sm text-muted-foreground space-y-2",children:[g.jsxs("div",{className:"flex items-start gap-2",children:[g.jsx("span",{className:"inline-block w-3 h-3 rounded-full bg-green-500 mt-1 shrink-0"}),g.jsxs("div",{children:[g.jsx("strong",{children:e("types.good")}),":"," ",e("explanation.goodPattern")]})]}),g.jsxs("div",{className:"flex items-start gap-2",children:[g.jsx("span",{className:"inline-block w-3 h-3 rounded-full bg-red-500 mt-1 shrink-0"}),g.jsxs("div",{children:[g.jsx("strong",{children:e("types.bad")}),":"," ",e("explanation.antiPattern")]})]}),g.jsxs("div",{className:"flex items-start gap-2",children:[g.jsx("span",{className:"inline-block w-3 h-3 rounded-full bg-amber-500 mt-1 shrink-0"}),g.jsxs("div",{children:[g.jsx("strong",{children:e("types.errorSolution")}),":"," ",e("explanation.errorSolution")]})]})]}),g.jsx("p",{className:"text-sm text-muted-foreground mt-3",children:g.jsx(u2,{i18nKey:"explanation.description",ns:"patterns",components:{code:g.jsx("code",{className:"bg-muted px-1 rounded"})}})})]})}),g.jsx("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-4",children:h?[0,1,2,3].map(C=>g.jsx(nt,{children:g.jsxs(rt,{className:"pt-4",children:[g.jsx(et,{className:"h-8 w-12 mb-1"}),g.jsx(et,{className:"h-4 w-20"})]})},C)):g.jsxs(g.Fragment,{children:[g.jsx(ch,{title:e("stats.totalPatterns"),value:(d==null?void 0:d.total)||0}),g.jsx(ch,{title:e("stats.goodPatterns"),value:((b=d==null?void 0:d.byType)==null?void 0:b.good)||0,color:"#16a34a"}),g.jsx(ch,{title:e("stats.antiPatterns"),value:((S=d==null?void 0:d.byType)==null?void 0:S.bad)||0,color:"#dc2626"}),g.jsx(ch,{title:e("stats.errorSolutions"),value:((k=d==null?void 0:d.byType)==null?void 0:k["error-solution"])||0,color:"#d97706"})]})}),g.jsxs("div",{className:"flex gap-4 items-center",children:[g.jsx(mf,{placeholder:e("searchPlaceholder"),value:t,onChange:C=>n(C.target.value),className:"max-w-sm"}),g.jsxs(Ni,{value:r,onValueChange:i,children:[g.jsx(Ti,{className:"w-[180px]",children:g.jsx(Ai,{placeholder:e("types.allTypes")})}),g.jsxs(_i,{children:[g.jsx(vt,{value:"all",children:e("types.allTypes")}),g.jsx(vt,{value:"good",children:e("types.goodPatterns")}),g.jsx(vt,{value:"bad",children:e("types.antiPatterns")}),g.jsx(vt,{value:"error-solution",children:e("types.errorSolutions")})]})]})]}),u?g.jsx("div",{className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4",children:[0,1,2,3,4,5].map(C=>g.jsx(nt,{children:g.jsxs(rt,{className:"p-3",children:[g.jsx(et,{className:"h-4 w-full mb-2"}),g.jsx(et,{className:"h-3 w-24 mb-2"}),g.jsx(et,{className:"h-3 w-16"})]})},C))}):w.length===0?g.jsx(nt,{children:g.jsx(rt,{className:"py-12 text-center text-muted-foreground",children:v.length===0?e("noPatterns"):e("noMatchingFilters")})}):g.jsx("div",{className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4",children:w.map(C=>g.jsx(UK,{pattern:C,onClick:()=>a(C)},C.id))}),g.jsx(WK,{pattern:o,open:!!o,onOpenChange:C=>!C&&a(null)})]})}function Wy({className:e,...t}){return g.jsx("textarea",{"data-slot":"textarea",className:Qe("border-input placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 flex field-sizing-content min-h-16 w-full rounded-md border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),...t})}const Cj=["dev-rules","review-guidelines"],cD={active:"default",deprecated:"secondary"},fD={p0:"destructive",p1:"default",p2:"secondary"},VK=e=>Array.from(new Set(e)).sort((t,n)=>t.localeCompare(n));function Uh(e){return e.text||e.title||""}function dD(e){if(e==="error")return"p0";if(e==="warning")return"p1"}function qK({item:e,onClick:t}){const n=e.priority??dD(e.severity)??"p2",r=e.category??"general",i=Uh(e);return g.jsx(nt,{className:"hover:bg-stone-50 dark:hover:bg-stone-800 transition-colors cursor-pointer h-full",onClick:t,children:g.jsxs(rt,{className:"p-3",children:[g.jsx("p",{className:"text-sm font-medium line-clamp-2 mb-2",children:i}),g.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[g.jsx(tt,{variant:fD[n],className:"text-xs",children:n}),g.jsx(tt,{variant:cD[e.status]??"secondary",className:"text-xs",children:e.status}),g.jsx("span",{className:"text-xs text-stone-500 dark:text-stone-400",children:r}),g.jsx("span",{className:"text-xs text-stone-400 dark:text-stone-500",children:e.ruleType})]})]})})}function KK({item:e,open:t,onOpenChange:n,onSave:r}){const{t:i}=Ke("rules"),{t:o}=Ke("common"),[a,s]=y.useState(!1),[u,f]=y.useState(null),[d,h]=y.useState(!1),[m,v]=y.useState(null);if(y.useEffect(()=>{t&&e&&(f({...e}),s(!1),v(null))},[t,e]),!e)return null;const w=e.priority??dD(e.severity)??"p2",b=e.category??"general",S=Uh(e),k=(O,A)=>{f(N=>N&&{...N,[O]:A})},C=async()=>{var A,N;if(!u)return;const O=Uh(u).trim();if(!O){v(i("errors.emptyText"));return}h(!0),v(null);try{const I={...u,category:((A=u.category)==null?void 0:A.trim())||void 0,rationale:((N=u.rationale)==null?void 0:N.trim())||void 0,updatedAt:new Date().toISOString()};u.title!==void 0?I.title=O:I.text=O,await r(I),s(!1),n(!1)}catch{v(i("errors.saveFailed"))}finally{h(!1)}},j=()=>{f({...e}),s(!1),v(null)};return g.jsx(r1,{open:t,onOpenChange:n,children:g.jsxs(Pm,{className:"sm:max-w-2xl max-h-[80vh] overflow-y-auto","aria-describedby":void 0,children:[g.jsxs(i1,{children:[g.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[g.jsx(tt,{variant:fD[w],children:w}),g.jsx(tt,{variant:cD[e.status]??"secondary",children:e.status}),g.jsx("span",{className:"text-xs text-stone-500 dark:text-stone-400",children:e.ruleType})]}),g.jsx(Cm,{className:"text-left",children:a?i("editRule"):S})]}),m&&g.jsx("p",{className:"text-sm text-destructive",children:m}),a&&u?g.jsxs("div",{className:"space-y-4",children:[g.jsxs("div",{children:[g.jsx("span",{className:"text-xs font-medium text-muted-foreground block mb-1",children:i("fields.text")}),g.jsx(Wy,{className:"min-h-[80px]",value:Uh(u),onChange:O=>{u.title!==void 0?k("title",O.target.value):k("text",O.target.value)}})]}),u.description!==void 0&&g.jsxs("div",{children:[g.jsx("span",{className:"text-xs font-medium text-muted-foreground block mb-1",children:i("fields.description")}),g.jsx(Wy,{className:"min-h-[60px]",value:u.description??"",onChange:O=>k("description",O.target.value)})]}),g.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[g.jsxs("div",{children:[g.jsx("span",{className:"text-xs font-medium text-muted-foreground block mb-1",children:i("fields.priority")}),g.jsxs(Ni,{value:u.priority??"p2",onValueChange:O=>k("priority",O),children:[g.jsx(Ti,{children:g.jsx(Ai,{})}),g.jsxs(_i,{children:[g.jsx(vt,{value:"p0",children:"p0 - Critical"}),g.jsx(vt,{value:"p1",children:"p1 - Important"}),g.jsx(vt,{value:"p2",children:"p2 - Normal"})]})]})]}),g.jsxs("div",{children:[g.jsx("span",{className:"text-xs font-medium text-muted-foreground block mb-1",children:i("fields.status")}),g.jsxs(Ni,{value:u.status,onValueChange:O=>k("status",O),children:[g.jsx(Ti,{children:g.jsx(Ai,{})}),g.jsxs(_i,{children:[g.jsx(vt,{value:"active",children:i("status.active")}),g.jsx(vt,{value:"deprecated",children:i("status.deprecated")})]})]})]})]}),g.jsxs("div",{children:[g.jsx("span",{className:"text-xs font-medium text-muted-foreground block mb-1",children:i("fields.category")}),g.jsx(mf,{value:u.category??"",onChange:O=>k("category",O.target.value),placeholder:"general"})]}),g.jsxs("div",{children:[g.jsx("span",{className:"text-xs font-medium text-muted-foreground block mb-1",children:i("fields.rationale")}),g.jsx(Wy,{className:"min-h-[60px]",value:u.rationale??"",onChange:O=>k("rationale",O.target.value)})]})]}):g.jsxs("div",{className:"space-y-4",children:[e.description&&g.jsxs("div",{children:[g.jsx("span",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide",children:i("fields.description")}),g.jsx("p",{className:"text-sm mt-1 whitespace-pre-wrap",children:e.description})]}),g.jsxs("div",{children:[g.jsx("span",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide",children:i("fields.category")}),g.jsx("p",{className:"text-sm mt-1",children:b})]}),(e.rationale||e.check)&&g.jsxs("div",{children:[g.jsx("span",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide",children:e.check?i("fields.check"):i("fields.rationale")}),g.jsx("p",{className:"text-sm mt-1 whitespace-pre-wrap",children:e.rationale||e.check})]}),e.source&&g.jsxs("div",{children:[g.jsx("span",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide",children:i("fields.source")}),g.jsx("p",{className:"text-sm mt-1 text-stone-500",children:e.source})]})]}),g.jsx(YV,{className:"gap-2",children:a?g.jsxs(g.Fragment,{children:[g.jsx(Dr,{variant:"outline",onClick:j,disabled:d,children:o("cancel")}),g.jsx(Dr,{onClick:C,disabled:d,children:o(d?"saving":"save")})]}):g.jsx(Dr,{variant:"outline",onClick:()=>s(!0),children:o("edit")})})]})})}function GK(){const{t:e}=Ke("rules"),{t}=Ke("common"),[n,r]=y.useState([]),[i,o]=y.useState(!0),[a,s]=y.useState(""),[u,f]=y.useState("all"),[d,h]=y.useState("all"),[m,v]=y.useState("all"),[w,b]=y.useState("all"),[S,k]=y.useState(null);y.useEffect(()=>{(async()=>{const $=[];for(const D of Cj){const U=await fetch(`/api/rules/${D}`);if(!U.ok)continue;const L=await U.json();L.ruleType=D,$.push(L)}r($),o(!1)})()},[]);const C=y.useMemo(()=>n.flatMap(T=>T.items.map($=>({...$,ruleType:T.ruleType}))),[n]),j=y.useMemo(()=>VK(C.map(T=>T.category??"general")),[C]),O=y.useMemo(()=>{const T=a.trim().toLowerCase();return C.filter($=>{if(u!=="all"&&$.ruleType!==u||d!=="all"&&$.status!==d)return!1;const D=$.priority??"p2";if(m!=="all"&&D!==m)return!1;const U=$.category??"general";return w!=="all"&&U!==w?!1:T?[$.text,$.title,$.description,$.key,U,$.status,D,$.ruleType].filter(Boolean).join(" ").toLowerCase().includes(T):!0})},[C,a,u,d,m,w]),A=async T=>{const $=T.ruleType;if(!$)throw new Error("Missing rule type");const D=n.find(ne=>ne.ruleType===$);if(!D)throw new Error("Document not found");const{ruleType:U,...L}=T,W={...{...D,items:D.items.map(ne=>ne.id===L.id?L:ne)}};delete W.ruleType;const H=await fetch(`/api/rules/${$}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(W)});if(!H.ok)throw new Error("Failed to save");const X=await H.json();X.ruleType=$,r(ne=>ne.map(B=>B.ruleType===$?X:B)),k({...L,ruleType:$})},N=a.trim().length>0||u!=="all"||d!=="all"||m!=="all"||w!=="all",I=()=>{s(""),f("all"),h("all"),v("all"),b("all")};return g.jsxs("div",{className:"space-y-6",children:[g.jsxs("div",{className:"flex items-center justify-between",children:[g.jsxs("div",{children:[g.jsx("h1",{className:"text-2xl font-bold",children:e("title")}),g.jsx("p",{className:"text-sm text-muted-foreground",children:e("subtitle")})]}),g.jsx("p",{className:"text-sm text-muted-foreground",children:e("count",{filtered:O.length,total:C.length})})]}),C.length===0&&!i&&g.jsx(nt,{className:"border-dashed",children:g.jsxs(rt,{className:"py-6",children:[g.jsx("h3",{className:"font-medium mb-2",children:e("explanation.title")}),g.jsxs("ul",{className:"text-sm text-muted-foreground space-y-1 list-disc list-inside",children:[g.jsxs("li",{children:[g.jsx("strong",{children:"dev-rules"}),": ",e("explanation.devRules")]}),g.jsxs("li",{children:[g.jsx("strong",{children:"review-guidelines"}),":"," ",e("explanation.reviewGuidelines")]})]}),g.jsx("p",{className:"text-sm text-muted-foreground mt-3",children:g.jsx(u2,{i18nKey:"explanation.description",ns:"rules",components:{code:g.jsx("code",{className:"bg-muted px-1 rounded"})}})})]})}),g.jsxs("div",{className:"flex flex-wrap gap-3 items-center",children:[g.jsx(mf,{value:a,onChange:T=>s(T.target.value),placeholder:e("searchPlaceholder"),className:"w-64"}),g.jsxs(Ni,{value:u,onValueChange:T=>f(T),children:[g.jsx(Ti,{className:"w-[180px]",children:g.jsx(Ai,{placeholder:t("allTypes")})}),g.jsxs(_i,{children:[g.jsx(vt,{value:"all",children:t("allTypes")}),Cj.map(T=>g.jsx(vt,{value:T,children:T},T))]})]}),g.jsxs(Ni,{value:d,onValueChange:T=>h(T),children:[g.jsx(Ti,{className:"w-[180px]",children:g.jsx(Ai,{placeholder:t("allStatus")})}),g.jsxs(_i,{children:[g.jsx(vt,{value:"all",children:t("allStatus")}),g.jsx(vt,{value:"active",children:e("status.active")}),g.jsx(vt,{value:"deprecated",children:e("status.deprecated")})]})]}),g.jsxs(Ni,{value:m,onValueChange:T=>v(T),children:[g.jsx(Ti,{className:"w-[180px]",children:g.jsx(Ai,{placeholder:e("allPriority")})}),g.jsxs(_i,{children:[g.jsx(vt,{value:"all",children:e("allPriority")}),g.jsx(vt,{value:"p0",children:"p0"}),g.jsx(vt,{value:"p1",children:"p1"}),g.jsx(vt,{value:"p2",children:"p2"})]})]}),g.jsxs(Ni,{value:w,onValueChange:b,children:[g.jsx(Ti,{className:"w-[180px]",children:g.jsx(Ai,{placeholder:e("allCategories")})}),g.jsxs(_i,{children:[g.jsx(vt,{value:"all",children:e("allCategories")}),j.map(T=>g.jsx(vt,{value:T,children:T},T))]})]}),N&&g.jsx(Dr,{variant:"outline",size:"sm",onClick:I,children:t("reset")})]}),i?g.jsx("div",{className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4",children:[0,1,2,3,4,5].map(T=>g.jsx(nt,{children:g.jsxs(rt,{className:"p-3",children:[g.jsx("div",{className:"h-4 bg-stone-200 dark:bg-stone-700 rounded w-full mb-2 animate-pulse"}),g.jsx("div",{className:"h-3 bg-stone-200 dark:bg-stone-700 rounded w-24 animate-pulse"})]})},T))}):O.length===0?g.jsx(nt,{children:g.jsx(rt,{className:"py-10 text-center text-muted-foreground",children:C.length===0?e("noRules"):e("noMatchingFilters")})}):g.jsx("div",{className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4",children:O.map(T=>g.jsx(qK,{item:T,onClick:()=>k(T)},T.id))}),g.jsx(KK,{item:S,open:!!S,onOpenChange:T=>!T&&k(null),onSave:A})]})}function YK(){return g.jsxs(nt,{children:[g.jsx(tr,{className:"pb-2",children:g.jsxs("div",{className:"flex items-start justify-between",children:[g.jsx(et,{className:"h-5 w-48"}),g.jsx(et,{className:"h-8 w-8"})]})}),g.jsxs(rt,{children:[g.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[g.jsx(et,{className:"h-4 w-20"}),g.jsx(et,{className:"h-4 w-24"}),g.jsx(et,{className:"h-4 w-16"})]}),g.jsx(et,{className:"h-4 w-full mb-2"}),g.jsxs("div",{className:"flex flex-wrap gap-1",children:[g.jsx(et,{className:"h-5 w-16"}),g.jsx(et,{className:"h-5 w-20"}),g.jsx(et,{className:"h-5 w-14"})]})]})]})}function QK({count:e=5}){return g.jsx("div",{className:"grid gap-4",children:Array.from({length:e}).map((t,n)=>g.jsx(YK,{},n))})}function XK(e={}){const{page:t=1,limit:n=20,tag:r,type:i,project:o,search:a,paginate:s=!0}=e;return Di({queryKey:["sessions",{page:t,limit:n,tag:r,type:i,project:o,search:a,paginate:s}],queryFn:()=>s?aW({page:t,limit:n,tag:r,type:i,project:o,search:a}):oW().then(u=>({data:u,pagination:{page:1,limit:u.length,total:u.length,totalPages:1,hasNext:!1,hasPrev:!1}}))})}function ZK(){return Di({queryKey:["tags"],queryFn:E2,staleTime:1e3*60*5})}function JK(){const e=II();return()=>e.invalidateQueries({queryKey:["sessions"],refetchType:"active"})}const e7=["decision","implementation","research","exploration","discussion","debug","review"];function t7({session:e,tags:t}){var a;const{t:n,i18n:r}=Ke("sessions"),i=new Date(e.createdAt).toLocaleDateString(r.language==="ja"?"ja-JP":"en-US"),o=s=>{const u=t.find(f=>f.id===s);return(u==null?void 0:u.color)||"#6B7280"};return g.jsx(Mi,{to:`/sessions/${e.id}`,children:g.jsx(nt,{className:"hover:bg-stone-50 dark:hover:bg-stone-800 transition-colors cursor-pointer h-full",children:g.jsxs(rt,{className:"p-3",children:[g.jsxs("div",{className:"flex items-start justify-between gap-2 mb-1",children:[g.jsx(nr,{className:"text-sm font-medium text-stone-800 dark:text-stone-100 line-clamp-2",children:e.title||n("untitled")}),e.sessionType&&g.jsx(tt,{variant:"outline",className:"text-xs font-normal shrink-0",children:n(`types.${e.sessionType}`)})]}),g.jsxs("div",{className:"flex items-center gap-1.5 flex-wrap text-xs text-stone-500 dark:text-stone-400 mb-2",children:[g.jsx("span",{children:i}),((a=e.context)==null?void 0:a.branch)&&g.jsxs(g.Fragment,{children:[g.jsx("span",{children:"·"}),g.jsx("span",{className:"font-mono bg-stone-100 dark:bg-stone-800 px-1 py-0.5 rounded text-xs",children:e.context.branch})]})]}),e.tags&&e.tags.length>0&&g.jsxs("div",{className:"flex flex-wrap gap-1",children:[e.tags.slice(0,4).map(s=>g.jsx(tt,{variant:"secondary",className:"text-xs px-1.5 py-0",style:{backgroundColor:`${o(s)}20`,color:o(s),borderColor:o(s)},children:s},s)),e.tags.length>4&&g.jsxs(tt,{variant:"outline",className:"text-xs px-1.5 py-0",children:["+",e.tags.length-4]})]})]})})})}function n7(){const{t:e}=Ke("sessions"),{t}=Ke("common"),[n,r]=y.useState(1),[i,o]=y.useState(""),[a,s]=y.useState("all"),[u,f]=y.useState("all"),[d,h]=y.useState("");y.useMemo(()=>{const A=setTimeout(()=>{h(i),r(1)},300);return()=>clearTimeout(A)},[i]);const{data:m,isLoading:v,error:w}=XK({page:n,limit:20,tag:a!=="all"?a:void 0,type:u!=="all"?u:void 0,search:d||void 0}),{data:b}=ZK(),S=(b==null?void 0:b.tags)||[],k=y.useMemo(()=>{if(!S.length)return{};const A=new Set;for(const I of(m==null?void 0:m.data)||[])for(const T of I.tags||[])A.add(T);const N={};for(const I of S){if(!A.has(I.id))continue;const T=I.category||"other";N[T]||(N[T]=[]),N[T].push(I)}for(const I of Object.keys(N))N[I].sort((T,$)=>T.label.localeCompare($.label));return N},[S,m==null?void 0:m.data]),C=["domain","phase","feature","ui","architecture","infra","cloud","data","ai","quality","workflow"];if(v)return g.jsxs("div",{className:"space-y-6",children:[g.jsx("div",{className:"flex items-center justify-between",children:g.jsx("h1",{className:"text-2xl font-bold",children:e("title")})}),g.jsx(QK,{count:5})]});if(w)return g.jsx("div",{className:"text-center py-12 text-destructive",children:e("errors:failedToLoad.sessions")});const j=(m==null?void 0:m.data)||[],O=m==null?void 0:m.pagination;return g.jsxs("div",{className:"space-y-6",children:[g.jsxs("div",{className:"flex items-center justify-between",children:[g.jsxs("div",{children:[g.jsx("h1",{className:"text-2xl font-bold",children:e("title")}),g.jsx("p",{className:"text-sm text-muted-foreground",children:e("subtitle")})]}),g.jsx("p",{className:"text-sm text-muted-foreground",children:e("sessionCount",{count:(O==null?void 0:O.total)||0})})]}),((O==null?void 0:O.total)||0)===0&&!d&&a==="all"&&u==="all"?g.jsxs("div",{className:"text-center py-12 text-muted-foreground",children:[g.jsx("p",{children:e("noSessionsFound")}),g.jsx("p",{className:"text-sm mt-2",children:e("noSessionsDescription")})]}):g.jsxs(g.Fragment,{children:[g.jsxs("div",{className:"flex gap-4 items-center flex-wrap",children:[g.jsx(mf,{placeholder:e("searchPlaceholder"),value:i,onChange:A=>o(A.target.value),className:"max-w-xs"}),g.jsxs(Ni,{value:u,onValueChange:A=>{f(A),r(1)},children:[g.jsx(Ti,{className:"w-[180px]",children:g.jsx(Ai,{placeholder:t("allTypes")})}),g.jsxs(_i,{children:[g.jsx(vt,{value:"all",children:t("allTypes")}),e7.map(A=>g.jsx(vt,{value:A,children:e(`types.${A}`)},A))]})]}),g.jsxs(Ni,{value:a,onValueChange:A=>{s(A),r(1)},children:[g.jsx(Ti,{className:"w-[180px]",children:g.jsx(Ai,{placeholder:t("allTags")})}),g.jsxs(_i,{children:[g.jsx(vt,{value:"all",children:t("allTags")}),C.filter(A=>{var N;return((N=k[A])==null?void 0:N.length)>0}).map((A,N)=>g.jsxs(gK,{children:[N>0&&g.jsx(yK,{}),g.jsx(vK,{children:t(`tagCategories.${A}`)}),k[A].map(I=>g.jsxs(vt,{value:I.id,children:[g.jsx("span",{className:"inline-block w-2 h-2 rounded-full mr-2",style:{backgroundColor:I.color}}),I.label]},I.id))]},A))]})]})]}),j.length===0?g.jsx("div",{className:"text-center py-12 text-muted-foreground",children:g.jsx("p",{children:e("noMatchingFilters")})}):g.jsxs(g.Fragment,{children:[g.jsx("div",{className:"grid gap-3 sm:grid-cols-2 md:grid-cols-3",children:j.map(A=>g.jsx(t7,{session:A,tags:S},A.id))}),O&&g.jsx(cR,{page:O.page,totalPages:O.totalPages,hasNext:O.hasNext,hasPrev:O.hasPrev,onPageChange:r})]})]})]})}function r7(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const i7=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,o7=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,a7={};function Ej(e,t){return(a7.jsx?o7:i7).test(e)}const s7=/[ \t\n\f\r]/g;function l7(e){return typeof e=="object"?e.type==="text"?jj(e.value):!1:jj(e)}function jj(e){return e.replace(s7,"")===""}class yf{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}yf.prototype.normal={};yf.prototype.property={};yf.prototype.space=void 0;function hD(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new yf(n,r,t)}function bb(e){return e.toLowerCase()}class rr{constructor(t,n){this.attribute=n,this.property=t}}rr.prototype.attribute="";rr.prototype.booleanish=!1;rr.prototype.boolean=!1;rr.prototype.commaOrSpaceSeparated=!1;rr.prototype.commaSeparated=!1;rr.prototype.defined=!1;rr.prototype.mustUseProperty=!1;rr.prototype.number=!1;rr.prototype.overloadedBoolean=!1;rr.prototype.property="";rr.prototype.spaceSeparated=!1;rr.prototype.space=void 0;let u7=0;const $e=Ms(),Bt=Ms(),wb=Ms(),fe=Ms(),mt=Ms(),Nl=Ms(),cr=Ms();function Ms(){return 2**++u7}const Sb=Object.freeze(Object.defineProperty({__proto__:null,boolean:$e,booleanish:Bt,commaOrSpaceSeparated:cr,commaSeparated:Nl,number:fe,overloadedBoolean:wb,spaceSeparated:mt},Symbol.toStringTag,{value:"Module"})),Hy=Object.keys(Sb);class g1 extends rr{constructor(t,n,r,i){let o=-1;if(super(t,n),Oj(this,"space",i),typeof r=="number")for(;++o<Hy.length;){const a=Hy[o];Oj(this,Hy[o],(r&Sb[a])===Sb[a])}}}g1.prototype.defined=!0;function Oj(e,t,n){n&&(e[t]=n)}function fu(e){const t={},n={};for(const[r,i]of Object.entries(e.properties)){const o=new g1(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(o.mustUseProperty=!0),t[r]=o,n[bb(r)]=r,n[bb(o.attribute)]=r}return new yf(t,n,e.space)}const pD=fu({properties:{ariaActiveDescendant:null,ariaAtomic:Bt,ariaAutoComplete:null,ariaBusy:Bt,ariaChecked:Bt,ariaColCount:fe,ariaColIndex:fe,ariaColSpan:fe,ariaControls:mt,ariaCurrent:null,ariaDescribedBy:mt,ariaDetails:null,ariaDisabled:Bt,ariaDropEffect:mt,ariaErrorMessage:null,ariaExpanded:Bt,ariaFlowTo:mt,ariaGrabbed:Bt,ariaHasPopup:null,ariaHidden:Bt,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:mt,ariaLevel:fe,ariaLive:null,ariaModal:Bt,ariaMultiLine:Bt,ariaMultiSelectable:Bt,ariaOrientation:null,ariaOwns:mt,ariaPlaceholder:null,ariaPosInSet:fe,ariaPressed:Bt,ariaReadOnly:Bt,ariaRelevant:null,ariaRequired:Bt,ariaRoleDescription:mt,ariaRowCount:fe,ariaRowIndex:fe,ariaRowSpan:fe,ariaSelected:Bt,ariaSetSize:fe,ariaSort:null,ariaValueMax:fe,ariaValueMin:fe,ariaValueNow:fe,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function mD(e,t){return t in e?e[t]:t}function gD(e,t){return mD(e,t.toLowerCase())}const c7=fu({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Nl,acceptCharset:mt,accessKey:mt,action:null,allow:null,allowFullScreen:$e,allowPaymentRequest:$e,allowUserMedia:$e,alt:null,as:null,async:$e,autoCapitalize:null,autoComplete:mt,autoFocus:$e,autoPlay:$e,blocking:mt,capture:null,charSet:null,checked:$e,cite:null,className:mt,cols:fe,colSpan:null,content:null,contentEditable:Bt,controls:$e,controlsList:mt,coords:fe|Nl,crossOrigin:null,data:null,dateTime:null,decoding:null,default:$e,defer:$e,dir:null,dirName:null,disabled:$e,download:wb,draggable:Bt,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:$e,formTarget:null,headers:mt,height:fe,hidden:wb,high:fe,href:null,hrefLang:null,htmlFor:mt,httpEquiv:mt,id:null,imageSizes:null,imageSrcSet:null,inert:$e,inputMode:null,integrity:null,is:null,isMap:$e,itemId:null,itemProp:mt,itemRef:mt,itemScope:$e,itemType:mt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:$e,low:fe,manifest:null,max:null,maxLength:fe,media:null,method:null,min:null,minLength:fe,multiple:$e,muted:$e,name:null,nonce:null,noModule:$e,noValidate:$e,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:$e,optimum:fe,pattern:null,ping:mt,placeholder:null,playsInline:$e,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:$e,referrerPolicy:null,rel:mt,required:$e,reversed:$e,rows:fe,rowSpan:fe,sandbox:mt,scope:null,scoped:$e,seamless:$e,selected:$e,shadowRootClonable:$e,shadowRootDelegatesFocus:$e,shadowRootMode:null,shape:null,size:fe,sizes:null,slot:null,span:fe,spellCheck:Bt,src:null,srcDoc:null,srcLang:null,srcSet:null,start:fe,step:null,style:null,tabIndex:fe,target:null,title:null,translate:null,type:null,typeMustMatch:$e,useMap:null,value:Bt,width:fe,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:mt,axis:null,background:null,bgColor:null,border:fe,borderColor:null,bottomMargin:fe,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:$e,declare:$e,event:null,face:null,frame:null,frameBorder:null,hSpace:fe,leftMargin:fe,link:null,longDesc:null,lowSrc:null,marginHeight:fe,marginWidth:fe,noResize:$e,noHref:$e,noShade:$e,noWrap:$e,object:null,profile:null,prompt:null,rev:null,rightMargin:fe,rules:null,scheme:null,scrolling:Bt,standby:null,summary:null,text:null,topMargin:fe,valueType:null,version:null,vAlign:null,vLink:null,vSpace:fe,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:$e,disableRemotePlayback:$e,prefix:null,property:null,results:fe,security:null,unselectable:null},space:"html",transform:gD}),f7=fu({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:cr,accentHeight:fe,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:fe,amplitude:fe,arabicForm:null,ascent:fe,attributeName:null,attributeType:null,azimuth:fe,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:fe,by:null,calcMode:null,capHeight:fe,className:mt,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:fe,diffuseConstant:fe,direction:null,display:null,dur:null,divisor:fe,dominantBaseline:null,download:$e,dx:null,dy:null,edgeMode:null,editable:null,elevation:fe,enableBackground:null,end:null,event:null,exponent:fe,externalResourcesRequired:null,fill:null,fillOpacity:fe,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Nl,g2:Nl,glyphName:Nl,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:fe,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:fe,horizOriginX:fe,horizOriginY:fe,id:null,ideographic:fe,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:fe,k:fe,k1:fe,k2:fe,k3:fe,k4:fe,kernelMatrix:cr,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:fe,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:fe,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:fe,overlineThickness:fe,paintOrder:null,panose1:null,path:null,pathLength:fe,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:mt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:fe,pointsAtY:fe,pointsAtZ:fe,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:cr,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:cr,rev:cr,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:cr,requiredFeatures:cr,requiredFonts:cr,requiredFormats:cr,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:fe,specularExponent:fe,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:fe,strikethroughThickness:fe,string:null,stroke:null,strokeDashArray:cr,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:fe,strokeOpacity:fe,strokeWidth:null,style:null,surfaceScale:fe,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:cr,tabIndex:fe,tableValues:null,target:null,targetX:fe,targetY:fe,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:cr,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:fe,underlineThickness:fe,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:fe,values:null,vAlphabetic:fe,vMathematical:fe,vectorEffect:null,vHanging:fe,vIdeographic:fe,version:null,vertAdvY:fe,vertOriginX:fe,vertOriginY:fe,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:fe,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:mD}),vD=fu({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),yD=fu({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:gD}),xD=fu({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),d7={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},h7=/[A-Z]/g,Nj=/-[a-z]/g,p7=/^data[-\w.:]+$/i;function m7(e,t){const n=bb(t);let r=t,i=rr;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&p7.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(Nj,v7);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!Nj.test(o)){let a=o.replace(h7,g7);a.charAt(0)!=="-"&&(a="-"+a),t="data"+a}}i=g1}return new i(r,t)}function g7(e){return"-"+e.toLowerCase()}function v7(e){return e.charAt(1).toUpperCase()}const y7=hD([pD,c7,vD,yD,xD],"html"),v1=hD([pD,f7,vD,yD,xD],"svg");function x7(e){return e.join(" ").trim()}var gl={},Vy,Aj;function b7(){if(Aj)return Vy;Aj=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,o=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,a=/^[;\s]*/,s=/^\s+|\s+$/g,u=`
|
|
243
|
+
*/const KV=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],lR=Ht("zap",KV),r1=oV,GV=aV,uR=y.forwardRef(({className:e,...t},n)=>g.jsx(tR,{ref:n,"data-slot":"dialog-overlay",className:Qe("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",e),...t}));uR.displayName=tR.displayName;const Pm=y.forwardRef(({className:e,children:t,showCloseButton:n=!0,"aria-describedby":r,...i},o)=>g.jsxs(GV,{children:[g.jsx(uR,{}),g.jsxs(nR,{ref:o,"aria-describedby":r,"data-slot":"dialog-content",className:Qe("bg-background 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 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 outline-none sm:max-w-lg",e),...i,children:[t,n&&g.jsxs(oR,{"data-slot":"dialog-close",className:"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",children:[g.jsx(qV,{}),g.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Pm.displayName=nR.displayName;function i1({className:e,...t}){return g.jsx("div",{"data-slot":"dialog-header",className:Qe("flex flex-col gap-2 text-center sm:text-left",e),...t})}function YV({className:e,showCloseButton:t=!1,children:n,...r}){return g.jsxs("div",{"data-slot":"dialog-footer",className:Qe("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...r,children:[n,t&&g.jsx(oR,{asChild:!0,children:g.jsx(Dr,{variant:"outline",children:"Close"})})]})}const Cm=y.forwardRef(({className:e,...t},n)=>g.jsx(rR,{ref:n,"data-slot":"dialog-title",className:Qe("text-lg leading-none font-semibold",e),...t}));Cm.displayName=rR.displayName;const QV=y.forwardRef(({className:e,...t},n)=>g.jsx(iR,{ref:n,"data-slot":"dialog-description",className:Qe("text-muted-foreground text-sm",e),...t}));QV.displayName=iR.displayName;function mf({className:e,type:t,...n}){return g.jsx("input",{type:t,"data-slot":"input",className:Qe("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input flex h-9 w-full min-w-0 rounded-sm border bg-white/80 px-3 py-1 text-base transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",e),...n})}function cR({page:e,totalPages:t,hasNext:n,hasPrev:r,onPageChange:i}){const{t:o}=Ke("common");return t<=1?null:g.jsxs("div",{className:"flex items-center justify-center gap-2",children:[g.jsx(Dr,{variant:"outline",size:"sm",onClick:()=>i(e-1),disabled:!r,children:o("pagination.previous")}),g.jsx("span",{className:"text-sm text-muted-foreground px-2",children:o("pagination.pageOf",{page:e,totalPages:t})}),g.jsx(Dr,{variant:"outline",size:"sm",onClick:()=>i(e+1),disabled:!n,children:o("pagination.next")})]})}function fj(e,[t,n]){return Math.min(n,Math.max(t,e))}function dj(e){const t=XV(e),n=y.forwardRef((r,i)=>{const{children:o,...a}=r,s=y.Children.toArray(o),u=s.find(JV);if(u){const f=u.props.children,d=s.map(h=>h===u?y.Children.count(f)>1?y.Children.only(null):y.isValidElement(f)?f.props.children:null:h);return g.jsx(t,{...a,ref:i,children:y.isValidElement(f)?y.cloneElement(f,void 0,d):null})}return g.jsx(t,{...a,ref:i,children:o})});return n.displayName=`${e}.Slot`,n}function XV(e){const t=y.forwardRef((n,r)=>{const{children:i,...o}=n;if(y.isValidElement(i)){const a=tq(i),s=eq(o,i.props);return i.type!==y.Fragment&&(s.ref=r?iu(r,a):a),y.cloneElement(i,s)}return y.Children.count(i)>1?y.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var ZV=Symbol("radix.slottable");function JV(e){return y.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===ZV}function eq(e,t){const n={...t};for(const r in t){const i=e[r],o=t[r];/^on[A-Z]/.test(r)?i&&o?n[r]=(...s)=>{const u=o(...s);return i(...s),u}:i&&(n[r]=i):r==="style"?n[r]={...i,...o}:r==="className"&&(n[r]=[i,o].filter(Boolean).join(" "))}return{...e,...n}}function tq(e){var r,i;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function fR(e){const t=e+"CollectionProvider",[n,r]=su(t),[i,o]=n(t,{collectionRef:{current:null},itemMap:new Map}),a=b=>{const{scope:S,children:k}=b,C=sa.useRef(null),j=sa.useRef(new Map).current;return g.jsx(i,{scope:S,itemMap:j,collectionRef:C,children:k})};a.displayName=t;const s=e+"CollectionSlot",u=dj(s),f=sa.forwardRef((b,S)=>{const{scope:k,children:C}=b,j=o(s,k),O=Dt(S,j.collectionRef);return g.jsx(u,{ref:O,children:C})});f.displayName=s;const d=e+"CollectionItemSlot",h="data-radix-collection-item",m=dj(d),v=sa.forwardRef((b,S)=>{const{scope:k,children:C,...j}=b,O=sa.useRef(null),A=Dt(S,O),N=o(d,k);return sa.useEffect(()=>(N.itemMap.set(O,{ref:O,...j}),()=>void N.itemMap.delete(O))),g.jsx(m,{[h]:"",ref:A,children:C})});v.displayName=d;function w(b){const S=o(e+"CollectionConsumer",b);return sa.useCallback(()=>{const C=S.collectionRef.current;if(!C)return[];const j=Array.from(C.querySelectorAll(`[${h}]`));return Array.from(S.itemMap.values()).sort((N,I)=>j.indexOf(N.ref.current)-j.indexOf(I.ref.current))},[S.collectionRef,S.itemMap])}return[{Provider:a,Slot:f,ItemSlot:v},w,r]}var nq=y.createContext(void 0);function o1(e){const t=y.useContext(nq);return e||t||"ltr"}const rq=["top","right","bottom","left"],Ea=Math.min,fr=Math.max,up=Math.round,uh=Math.floor,Li=e=>({x:e,y:e}),iq={left:"right",right:"left",bottom:"top",top:"bottom"},oq={start:"end",end:"start"};function db(e,t,n){return fr(e,Ea(t,n))}function xo(e,t){return typeof e=="function"?e(t):e}function bo(e){return e.split("-")[0]}function lu(e){return e.split("-")[1]}function a1(e){return e==="x"?"y":"x"}function s1(e){return e==="y"?"height":"width"}const aq=new Set(["top","bottom"]);function Oi(e){return aq.has(bo(e))?"y":"x"}function l1(e){return a1(Oi(e))}function sq(e,t,n){n===void 0&&(n=!1);const r=lu(e),i=l1(e),o=s1(i);let a=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(a=cp(a)),[a,cp(a)]}function lq(e){const t=cp(e);return[hb(e),t,hb(t)]}function hb(e){return e.replace(/start|end/g,t=>oq[t])}const hj=["left","right"],pj=["right","left"],uq=["top","bottom"],cq=["bottom","top"];function fq(e,t,n){switch(e){case"top":case"bottom":return n?t?pj:hj:t?hj:pj;case"left":case"right":return t?uq:cq;default:return[]}}function dq(e,t,n,r){const i=lu(e);let o=fq(bo(e),n==="start",r);return i&&(o=o.map(a=>a+"-"+i),t&&(o=o.concat(o.map(hb)))),o}function cp(e){return e.replace(/left|right|bottom|top/g,t=>iq[t])}function hq(e){return{top:0,right:0,bottom:0,left:0,...e}}function dR(e){return typeof e!="number"?hq(e):{top:e,right:e,bottom:e,left:e}}function fp(e){const{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function mj(e,t,n){let{reference:r,floating:i}=e;const o=Oi(t),a=l1(t),s=s1(a),u=bo(t),f=o==="y",d=r.x+r.width/2-i.width/2,h=r.y+r.height/2-i.height/2,m=r[s]/2-i[s]/2;let v;switch(u){case"top":v={x:d,y:r.y-i.height};break;case"bottom":v={x:d,y:r.y+r.height};break;case"right":v={x:r.x+r.width,y:h};break;case"left":v={x:r.x-i.width,y:h};break;default:v={x:r.x,y:r.y}}switch(lu(t)){case"start":v[a]-=m*(n&&f?-1:1);break;case"end":v[a]+=m*(n&&f?-1:1);break}return v}const pq=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:o=[],platform:a}=n,s=o.filter(Boolean),u=await(a.isRTL==null?void 0:a.isRTL(t));let f=await a.getElementRects({reference:e,floating:t,strategy:i}),{x:d,y:h}=mj(f,r,u),m=r,v={},w=0;for(let b=0;b<s.length;b++){const{name:S,fn:k}=s[b],{x:C,y:j,data:O,reset:A}=await k({x:d,y:h,initialPlacement:r,placement:m,strategy:i,middlewareData:v,rects:f,platform:a,elements:{reference:e,floating:t}});d=C??d,h=j??h,v={...v,[S]:{...v[S],...O}},A&&w<=50&&(w++,typeof A=="object"&&(A.placement&&(m=A.placement),A.rects&&(f=A.rects===!0?await a.getElementRects({reference:e,floating:t,strategy:i}):A.rects),{x:d,y:h}=mj(f,m,u)),b=-1)}return{x:d,y:h,placement:m,strategy:i,middlewareData:v}};async function zc(e,t){var n;t===void 0&&(t={});const{x:r,y:i,platform:o,rects:a,elements:s,strategy:u}=e,{boundary:f="clippingAncestors",rootBoundary:d="viewport",elementContext:h="floating",altBoundary:m=!1,padding:v=0}=xo(t,e),w=dR(v),S=s[m?h==="floating"?"reference":"floating":h],k=fp(await o.getClippingRect({element:(n=await(o.isElement==null?void 0:o.isElement(S)))==null||n?S:S.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(s.floating)),boundary:f,rootBoundary:d,strategy:u})),C=h==="floating"?{x:r,y:i,width:a.floating.width,height:a.floating.height}:a.reference,j=await(o.getOffsetParent==null?void 0:o.getOffsetParent(s.floating)),O=await(o.isElement==null?void 0:o.isElement(j))?await(o.getScale==null?void 0:o.getScale(j))||{x:1,y:1}:{x:1,y:1},A=fp(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:C,offsetParent:j,strategy:u}):C);return{top:(k.top-A.top+w.top)/O.y,bottom:(A.bottom-k.bottom+w.bottom)/O.y,left:(k.left-A.left+w.left)/O.x,right:(A.right-k.right+w.right)/O.x}}const mq=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:i,rects:o,platform:a,elements:s,middlewareData:u}=t,{element:f,padding:d=0}=xo(e,t)||{};if(f==null)return{};const h=dR(d),m={x:n,y:r},v=l1(i),w=s1(v),b=await a.getDimensions(f),S=v==="y",k=S?"top":"left",C=S?"bottom":"right",j=S?"clientHeight":"clientWidth",O=o.reference[w]+o.reference[v]-m[v]-o.floating[w],A=m[v]-o.reference[v],N=await(a.getOffsetParent==null?void 0:a.getOffsetParent(f));let I=N?N[j]:0;(!I||!await(a.isElement==null?void 0:a.isElement(N)))&&(I=s.floating[j]||o.floating[w]);const T=O/2-A/2,$=I/2-b[w]/2-1,D=Ea(h[k],$),U=Ea(h[C],$),L=D,q=I-b[w]-U,W=I/2-b[w]/2+T,H=db(L,W,q),X=!u.arrow&&lu(i)!=null&&W!==H&&o.reference[w]/2-(W<L?D:U)-b[w]/2<0,ne=X?W<L?W-L:W-q:0;return{[v]:m[v]+ne,data:{[v]:H,centerOffset:W-H-ne,...X&&{alignmentOffset:ne}},reset:X}}}),gq=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:i,middlewareData:o,rects:a,initialPlacement:s,platform:u,elements:f}=t,{mainAxis:d=!0,crossAxis:h=!0,fallbackPlacements:m,fallbackStrategy:v="bestFit",fallbackAxisSideDirection:w="none",flipAlignment:b=!0,...S}=xo(e,t);if((n=o.arrow)!=null&&n.alignmentOffset)return{};const k=bo(i),C=Oi(s),j=bo(s)===s,O=await(u.isRTL==null?void 0:u.isRTL(f.floating)),A=m||(j||!b?[cp(s)]:lq(s)),N=w!=="none";!m&&N&&A.push(...dq(s,b,w,O));const I=[s,...A],T=await zc(t,S),$=[];let D=((r=o.flip)==null?void 0:r.overflows)||[];if(d&&$.push(T[k]),h){const W=sq(i,a,O);$.push(T[W[0]],T[W[1]])}if(D=[...D,{placement:i,overflows:$}],!$.every(W=>W<=0)){var U,L;const W=(((U=o.flip)==null?void 0:U.index)||0)+1,H=I[W];if(H&&(!(h==="alignment"?C!==Oi(H):!1)||D.every(B=>Oi(B.placement)===C?B.overflows[0]>0:!0)))return{data:{index:W,overflows:D},reset:{placement:H}};let X=(L=D.filter(ne=>ne.overflows[0]<=0).sort((ne,B)=>ne.overflows[1]-B.overflows[1])[0])==null?void 0:L.placement;if(!X)switch(v){case"bestFit":{var q;const ne=(q=D.filter(B=>{if(N){const re=Oi(B.placement);return re===C||re==="y"}return!0}).map(B=>[B.placement,B.overflows.filter(re=>re>0).reduce((re,R)=>re+R,0)]).sort((B,re)=>B[1]-re[1])[0])==null?void 0:q[0];ne&&(X=ne);break}case"initialPlacement":X=s;break}if(i!==X)return{reset:{placement:X}}}return{}}}};function gj(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function vj(e){return rq.some(t=>e[t]>=0)}const vq=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...i}=xo(e,t);switch(r){case"referenceHidden":{const o=await zc(t,{...i,elementContext:"reference"}),a=gj(o,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:vj(a)}}}case"escaped":{const o=await zc(t,{...i,altBoundary:!0}),a=gj(o,n.floating);return{data:{escapedOffsets:a,escaped:vj(a)}}}default:return{}}}}},hR=new Set(["left","top"]);async function yq(e,t){const{placement:n,platform:r,elements:i}=e,o=await(r.isRTL==null?void 0:r.isRTL(i.floating)),a=bo(n),s=lu(n),u=Oi(n)==="y",f=hR.has(a)?-1:1,d=o&&u?-1:1,h=xo(t,e);let{mainAxis:m,crossAxis:v,alignmentAxis:w}=typeof h=="number"?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return s&&typeof w=="number"&&(v=s==="end"?w*-1:w),u?{x:v*d,y:m*f}:{x:m*f,y:v*d}}const xq=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:i,y:o,placement:a,middlewareData:s}=t,u=await yq(t,e);return a===((n=s.offset)==null?void 0:n.placement)&&(r=s.arrow)!=null&&r.alignmentOffset?{}:{x:i+u.x,y:o+u.y,data:{...u,placement:a}}}}},bq=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:i}=t,{mainAxis:o=!0,crossAxis:a=!1,limiter:s={fn:S=>{let{x:k,y:C}=S;return{x:k,y:C}}},...u}=xo(e,t),f={x:n,y:r},d=await zc(t,u),h=Oi(bo(i)),m=a1(h);let v=f[m],w=f[h];if(o){const S=m==="y"?"top":"left",k=m==="y"?"bottom":"right",C=v+d[S],j=v-d[k];v=db(C,v,j)}if(a){const S=h==="y"?"top":"left",k=h==="y"?"bottom":"right",C=w+d[S],j=w-d[k];w=db(C,w,j)}const b=s.fn({...t,[m]:v,[h]:w});return{...b,data:{x:b.x-n,y:b.y-r,enabled:{[m]:o,[h]:a}}}}}},wq=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:i,rects:o,middlewareData:a}=t,{offset:s=0,mainAxis:u=!0,crossAxis:f=!0}=xo(e,t),d={x:n,y:r},h=Oi(i),m=a1(h);let v=d[m],w=d[h];const b=xo(s,t),S=typeof b=="number"?{mainAxis:b,crossAxis:0}:{mainAxis:0,crossAxis:0,...b};if(u){const j=m==="y"?"height":"width",O=o.reference[m]-o.floating[j]+S.mainAxis,A=o.reference[m]+o.reference[j]-S.mainAxis;v<O?v=O:v>A&&(v=A)}if(f){var k,C;const j=m==="y"?"width":"height",O=hR.has(bo(i)),A=o.reference[h]-o.floating[j]+(O&&((k=a.offset)==null?void 0:k[h])||0)+(O?0:S.crossAxis),N=o.reference[h]+o.reference[j]+(O?0:((C=a.offset)==null?void 0:C[h])||0)-(O?S.crossAxis:0);w<A?w=A:w>N&&(w=N)}return{[m]:v,[h]:w}}}},Sq=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:i,rects:o,platform:a,elements:s}=t,{apply:u=()=>{},...f}=xo(e,t),d=await zc(t,f),h=bo(i),m=lu(i),v=Oi(i)==="y",{width:w,height:b}=o.floating;let S,k;h==="top"||h==="bottom"?(S=h,k=m===(await(a.isRTL==null?void 0:a.isRTL(s.floating))?"start":"end")?"left":"right"):(k=h,S=m==="end"?"top":"bottom");const C=b-d.top-d.bottom,j=w-d.left-d.right,O=Ea(b-d[S],C),A=Ea(w-d[k],j),N=!t.middlewareData.shift;let I=O,T=A;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(T=j),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(I=C),N&&!m){const D=fr(d.left,0),U=fr(d.right,0),L=fr(d.top,0),q=fr(d.bottom,0);v?T=w-2*(D!==0||U!==0?D+U:fr(d.left,d.right)):I=b-2*(L!==0||q!==0?L+q:fr(d.top,d.bottom))}await u({...t,availableWidth:T,availableHeight:I});const $=await a.getDimensions(s.floating);return w!==$.width||b!==$.height?{reset:{rects:!0}}:{}}}};function Em(){return typeof window<"u"}function uu(e){return pR(e)?(e.nodeName||"").toLowerCase():"#document"}function pr(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Hi(e){var t;return(t=(pR(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function pR(e){return Em()?e instanceof Node||e instanceof pr(e).Node:!1}function oi(e){return Em()?e instanceof Element||e instanceof pr(e).Element:!1}function Fi(e){return Em()?e instanceof HTMLElement||e instanceof pr(e).HTMLElement:!1}function yj(e){return!Em()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof pr(e).ShadowRoot}const kq=new Set(["inline","contents"]);function gf(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=ai(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!kq.has(i)}const Pq=new Set(["table","td","th"]);function Cq(e){return Pq.has(uu(e))}const Eq=[":popover-open",":modal"];function jm(e){return Eq.some(t=>{try{return e.matches(t)}catch{return!1}})}const jq=["transform","translate","scale","rotate","perspective"],Oq=["transform","translate","scale","rotate","perspective","filter"],Nq=["paint","layout","strict","content"];function u1(e){const t=c1(),n=oi(e)?ai(e):e;return jq.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)||Oq.some(r=>(n.willChange||"").includes(r))||Nq.some(r=>(n.contain||"").includes(r))}function Aq(e){let t=ja(e);for(;Fi(t)&&!Hl(t);){if(u1(t))return t;if(jm(t))return null;t=ja(t)}return null}function c1(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const Tq=new Set(["html","body","#document"]);function Hl(e){return Tq.has(uu(e))}function ai(e){return pr(e).getComputedStyle(e)}function Om(e){return oi(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function ja(e){if(uu(e)==="html")return e;const t=e.assignedSlot||e.parentNode||yj(e)&&e.host||Hi(e);return yj(t)?t.host:t}function mR(e){const t=ja(e);return Hl(t)?e.ownerDocument?e.ownerDocument.body:e.body:Fi(t)&&gf(t)?t:mR(t)}function Bc(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=mR(e),o=i===((r=e.ownerDocument)==null?void 0:r.body),a=pr(i);if(o){const s=pb(a);return t.concat(a,a.visualViewport||[],gf(i)?i:[],s&&n?Bc(s):[])}return t.concat(i,Bc(i,[],n))}function pb(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function gR(e){const t=ai(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=Fi(e),o=i?e.offsetWidth:n,a=i?e.offsetHeight:r,s=up(n)!==o||up(r)!==a;return s&&(n=o,r=a),{width:n,height:r,$:s}}function f1(e){return oi(e)?e:e.contextElement}function Ol(e){const t=f1(e);if(!Fi(t))return Li(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:o}=gR(t);let a=(o?up(n.width):n.width)/r,s=(o?up(n.height):n.height)/i;return(!a||!Number.isFinite(a))&&(a=1),(!s||!Number.isFinite(s))&&(s=1),{x:a,y:s}}const _q=Li(0);function vR(e){const t=pr(e);return!c1()||!t.visualViewport?_q:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Iq(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==pr(e)?!1:t}function Ps(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),o=f1(e);let a=Li(1);t&&(r?oi(r)&&(a=Ol(r)):a=Ol(e));const s=Iq(o,n,r)?vR(o):Li(0);let u=(i.left+s.x)/a.x,f=(i.top+s.y)/a.y,d=i.width/a.x,h=i.height/a.y;if(o){const m=pr(o),v=r&&oi(r)?pr(r):r;let w=m,b=pb(w);for(;b&&r&&v!==w;){const S=Ol(b),k=b.getBoundingClientRect(),C=ai(b),j=k.left+(b.clientLeft+parseFloat(C.paddingLeft))*S.x,O=k.top+(b.clientTop+parseFloat(C.paddingTop))*S.y;u*=S.x,f*=S.y,d*=S.x,h*=S.y,u+=j,f+=O,w=pr(b),b=pb(w)}}return fp({width:d,height:h,x:u,y:f})}function Nm(e,t){const n=Om(e).scrollLeft;return t?t.left+n:Ps(Hi(e)).left+n}function yR(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-Nm(e,n),i=n.top+t.scrollTop;return{x:r,y:i}}function Rq(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e;const o=i==="fixed",a=Hi(r),s=t?jm(t.floating):!1;if(r===a||s&&o)return n;let u={scrollLeft:0,scrollTop:0},f=Li(1);const d=Li(0),h=Fi(r);if((h||!h&&!o)&&((uu(r)!=="body"||gf(a))&&(u=Om(r)),Fi(r))){const v=Ps(r);f=Ol(r),d.x=v.x+r.clientLeft,d.y=v.y+r.clientTop}const m=a&&!h&&!o?yR(a,u):Li(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 Dq(e){return Array.from(e.getClientRects())}function Mq(e){const t=Hi(e),n=Om(e),r=e.ownerDocument.body,i=fr(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),o=fr(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+Nm(e);const s=-n.scrollTop;return ai(r).direction==="rtl"&&(a+=fr(t.clientWidth,r.clientWidth)-i),{width:i,height:o,x:a,y:s}}const xj=25;function Lq(e,t){const n=pr(e),r=Hi(e),i=n.visualViewport;let o=r.clientWidth,a=r.clientHeight,s=0,u=0;if(i){o=i.width,a=i.height;const d=c1();(!d||d&&t==="fixed")&&(s=i.offsetLeft,u=i.offsetTop)}const f=Nm(r);if(f<=0){const d=r.ownerDocument,h=d.body,m=getComputedStyle(h),v=d.compatMode==="CSS1Compat"&&parseFloat(m.marginLeft)+parseFloat(m.marginRight)||0,w=Math.abs(r.clientWidth-h.clientWidth-v);w<=xj&&(o-=w)}else f<=xj&&(o+=f);return{width:o,height:a,x:s,y:u}}const $q=new Set(["absolute","fixed"]);function Fq(e,t){const n=Ps(e,!0,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft,o=Fi(e)?Ol(e):Li(1),a=e.clientWidth*o.x,s=e.clientHeight*o.y,u=i*o.x,f=r*o.y;return{width:a,height:s,x:u,y:f}}function bj(e,t,n){let r;if(t==="viewport")r=Lq(e,n);else if(t==="document")r=Mq(Hi(e));else if(oi(t))r=Fq(t,n);else{const i=vR(e);r={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return fp(r)}function xR(e,t){const n=ja(e);return n===t||!oi(n)||Hl(n)?!1:ai(n).position==="fixed"||xR(n,t)}function zq(e,t){const n=t.get(e);if(n)return n;let r=Bc(e,[],!1).filter(s=>oi(s)&&uu(s)!=="body"),i=null;const o=ai(e).position==="fixed";let a=o?ja(e):e;for(;oi(a)&&!Hl(a);){const s=ai(a),u=u1(a);!u&&s.position==="fixed"&&(i=null),(o?!u&&!i:!u&&s.position==="static"&&!!i&&$q.has(i.position)||gf(a)&&!u&&xR(e,a))?r=r.filter(d=>d!==a):i=s,a=ja(a)}return t.set(e,r),r}function Bq(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const a=[...n==="clippingAncestors"?jm(t)?[]:zq(t,this._c):[].concat(n),r],s=a[0],u=a.reduce((f,d)=>{const h=bj(t,d,i);return f.top=fr(h.top,f.top),f.right=Ea(h.right,f.right),f.bottom=Ea(h.bottom,f.bottom),f.left=fr(h.left,f.left),f},bj(t,s,i));return{width:u.right-u.left,height:u.bottom-u.top,x:u.left,y:u.top}}function Uq(e){const{width:t,height:n}=gR(e);return{width:t,height:n}}function Wq(e,t,n){const r=Fi(t),i=Hi(t),o=n==="fixed",a=Ps(e,!0,o,t);let s={scrollLeft:0,scrollTop:0};const u=Li(0);function f(){u.x=Nm(i)}if(r||!r&&!o)if((uu(t)!=="body"||gf(i))&&(s=Om(t)),r){const v=Ps(t,!0,o,t);u.x=v.x+t.clientLeft,u.y=v.y+t.clientTop}else i&&f();o&&!r&&i&&f();const d=i&&!r&&!o?yR(i,s):Li(0),h=a.left+s.scrollLeft-u.x-d.x,m=a.top+s.scrollTop-u.y-d.y;return{x:h,y:m,width:a.width,height:a.height}}function By(e){return ai(e).position==="static"}function wj(e,t){if(!Fi(e)||ai(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Hi(e)===n&&(n=n.ownerDocument.body),n}function bR(e,t){const n=pr(e);if(jm(e))return n;if(!Fi(e)){let i=ja(e);for(;i&&!Hl(i);){if(oi(i)&&!By(i))return i;i=ja(i)}return n}let r=wj(e,t);for(;r&&Cq(r)&&By(r);)r=wj(r,t);return r&&Hl(r)&&By(r)&&!u1(r)?n:r||Aq(e)||n}const Hq=async function(e){const t=this.getOffsetParent||bR,n=this.getDimensions,r=await n(e.floating);return{reference:Wq(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Vq(e){return ai(e).direction==="rtl"}const qq={convertOffsetParentRelativeRectToViewportRelativeRect:Rq,getDocumentElement:Hi,getClippingRect:Bq,getOffsetParent:bR,getElementRects:Hq,getClientRects:Dq,getDimensions:Uq,getScale:Ol,isElement:oi,isRTL:Vq};function wR(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Kq(e,t){let n=null,r;const i=Hi(e);function o(){var s;clearTimeout(r),(s=n)==null||s.disconnect(),n=null}function a(s,u){s===void 0&&(s=!1),u===void 0&&(u=1),o();const f=e.getBoundingClientRect(),{left:d,top:h,width:m,height:v}=f;if(s||t(),!m||!v)return;const w=uh(h),b=uh(i.clientWidth-(d+m)),S=uh(i.clientHeight-(h+v)),k=uh(d),j={rootMargin:-w+"px "+-b+"px "+-S+"px "+-k+"px",threshold:fr(0,Ea(1,u))||1};let O=!0;function A(N){const I=N[0].intersectionRatio;if(I!==u){if(!O)return a();I?a(!1,I):r=setTimeout(()=>{a(!1,1e-7)},1e3)}I===1&&!wR(f,e.getBoundingClientRect())&&a(),O=!1}try{n=new IntersectionObserver(A,{...j,root:i.ownerDocument})}catch{n=new IntersectionObserver(A,j)}n.observe(e)}return a(!0),o}function Gq(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:s=typeof IntersectionObserver=="function",animationFrame:u=!1}=r,f=f1(e),d=i||o?[...f?Bc(f):[],...Bc(t)]:[];d.forEach(k=>{i&&k.addEventListener("scroll",n,{passive:!0}),o&&k.addEventListener("resize",n)});const h=f&&s?Kq(f,n):null;let m=-1,v=null;a&&(v=new ResizeObserver(k=>{let[C]=k;C&&C.target===f&&v&&(v.unobserve(t),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var j;(j=v)==null||j.observe(t)})),n()}),f&&!u&&v.observe(f),v.observe(t));let w,b=u?Ps(e):null;u&&S();function S(){const k=Ps(e);b&&!wR(b,k)&&n(),b=k,w=requestAnimationFrame(S)}return n(),()=>{var k;d.forEach(C=>{i&&C.removeEventListener("scroll",n),o&&C.removeEventListener("resize",n)}),h==null||h(),(k=v)==null||k.disconnect(),v=null,u&&cancelAnimationFrame(w)}}const Yq=xq,Qq=bq,Xq=gq,Zq=Sq,Jq=vq,Sj=mq,e9=wq,t9=(e,t,n)=>{const r=new Map,i={platform:qq,...n},o={...i.platform,_c:r};return pq(e,t,{...i,platform:o})};var n9=typeof document<"u",r9=function(){},Bh=n9?y.useLayoutEffect:r9;function dp(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,i;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(!dp(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){const o=i[r];if(!(o==="_owner"&&e.$$typeof)&&!dp(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function SR(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function kj(e,t){const n=SR(e);return Math.round(t*n)/n}function Uy(e){const t=y.useRef(e);return Bh(()=>{t.current=e}),t}function i9(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:o,floating:a}={},transform:s=!0,whileElementsMounted:u,open:f}=e,[d,h]=y.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[m,v]=y.useState(r);dp(m,r)||v(r);const[w,b]=y.useState(null),[S,k]=y.useState(null),C=y.useCallback(B=>{B!==N.current&&(N.current=B,b(B))},[]),j=y.useCallback(B=>{B!==I.current&&(I.current=B,k(B))},[]),O=o||w,A=a||S,N=y.useRef(null),I=y.useRef(null),T=y.useRef(d),$=u!=null,D=Uy(u),U=Uy(i),L=Uy(f),q=y.useCallback(()=>{if(!N.current||!I.current)return;const B={placement:t,strategy:n,middleware:m};U.current&&(B.platform=U.current),t9(N.current,I.current,B).then(re=>{const R={...re,isPositioned:L.current!==!1};W.current&&!dp(T.current,R)&&(T.current=R,Aa.flushSync(()=>{h(R)}))})},[m,t,n,U,L]);Bh(()=>{f===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,h(B=>({...B,isPositioned:!1})))},[f]);const W=y.useRef(!1);Bh(()=>(W.current=!0,()=>{W.current=!1}),[]),Bh(()=>{if(O&&(N.current=O),A&&(I.current=A),O&&A){if(D.current)return D.current(O,A,q);q()}},[O,A,q,D,$]);const H=y.useMemo(()=>({reference:N,floating:I,setReference:C,setFloating:j}),[C,j]),X=y.useMemo(()=>({reference:O,floating:A}),[O,A]),ne=y.useMemo(()=>{const B={position:n,left:0,top:0};if(!X.floating)return B;const re=kj(X.floating,d.x),R=kj(X.floating,d.y);return s?{...B,transform:"translate("+re+"px, "+R+"px)",...SR(X.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:re,top:R}},[n,s,X.floating,d.x,d.y]);return y.useMemo(()=>({...d,update:q,refs:H,elements:X,floatingStyles:ne}),[d,q,H,X,ne])}const o9=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:i}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?Sj({element:r.current,padding:i}).fn(n):{}:r?Sj({element:r,padding:i}).fn(n):{}}}},a9=(e,t)=>({...Yq(e),options:[e,t]}),s9=(e,t)=>({...Qq(e),options:[e,t]}),l9=(e,t)=>({...e9(e),options:[e,t]}),u9=(e,t)=>({...Xq(e),options:[e,t]}),c9=(e,t)=>({...Zq(e),options:[e,t]}),f9=(e,t)=>({...Jq(e),options:[e,t]}),d9=(e,t)=>({...o9(e),options:[e,t]});var h9="Arrow",kR=y.forwardRef((e,t)=>{const{children:n,width:r=10,height:i=5,...o}=e;return g.jsx(ot.svg,{...o,ref:t,width:r,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:g.jsx("polygon",{points:"0,0 30,0 15,10"})})});kR.displayName=h9;var p9=kR;function m9(e){const[t,n]=y.useState(void 0);return jn(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const o=i[0];let a,s;if("borderBoxSize"in o){const u=o.borderBoxSize,f=Array.isArray(u)?u[0]:u;a=f.inlineSize,s=f.blockSize}else a=e.offsetWidth,s=e.offsetHeight;n({width:a,height:s})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var d1="Popper",[PR,CR]=su(d1),[g9,ER]=PR(d1),jR=e=>{const{__scopePopper:t,children:n}=e,[r,i]=y.useState(null);return g.jsx(g9,{scope:t,anchor:r,onAnchorChange:i,children:n})};jR.displayName=d1;var OR="PopperAnchor",NR=y.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...i}=e,o=ER(OR,n),a=y.useRef(null),s=Dt(t,a),u=y.useRef(null);return y.useEffect(()=>{const f=u.current;u.current=(r==null?void 0:r.current)||a.current,f!==u.current&&o.onAnchorChange(u.current)}),r?null:g.jsx(ot.div,{...i,ref:s})});NR.displayName=OR;var h1="PopperContent",[v9,y9]=PR(h1),AR=y.forwardRef((e,t)=>{var ae,ge,Z,de,me,ie;const{__scopePopper:n,side:r="bottom",sideOffset:i=0,align:o="center",alignOffset:a=0,arrowPadding:s=0,avoidCollisions:u=!0,collisionBoundary:f=[],collisionPadding:d=0,sticky:h="partial",hideWhenDetached:m=!1,updatePositionStrategy:v="optimized",onPlaced:w,...b}=e,S=ER(h1,n),[k,C]=y.useState(null),j=Dt(t,He=>C(He)),[O,A]=y.useState(null),N=m9(O),I=(N==null?void 0:N.width)??0,T=(N==null?void 0:N.height)??0,$=r+(o!=="center"?"-"+o:""),D=typeof d=="number"?d:{top:0,right:0,bottom:0,left:0,...d},U=Array.isArray(f)?f:[f],L=U.length>0,q={padding:D,boundary:U.filter(b9),altBoundary:L},{refs:W,floatingStyles:H,placement:X,isPositioned:ne,middlewareData:B}=i9({strategy:"fixed",placement:$,whileElementsMounted:(...He)=>Gq(...He,{animationFrame:v==="always"}),elements:{reference:S.anchor},middleware:[a9({mainAxis:i+T,alignmentAxis:a}),u&&s9({mainAxis:!0,crossAxis:!1,limiter:h==="partial"?l9():void 0,...q}),u&&u9({...q}),c9({...q,apply:({elements:He,rects:Le,availableWidth:yt,availableHeight:xt})=>{const{width:Ft,height:Yi}=Le.reference,Br=He.floating.style;Br.setProperty("--radix-popper-available-width",`${yt}px`),Br.setProperty("--radix-popper-available-height",`${xt}px`),Br.setProperty("--radix-popper-anchor-width",`${Ft}px`),Br.setProperty("--radix-popper-anchor-height",`${Yi}px`)}}),O&&d9({element:O,padding:s}),w9({arrowWidth:I,arrowHeight:T}),m&&f9({strategy:"referenceHidden",...q})]}),[re,R]=IR(X),z=Ca(w);jn(()=>{ne&&(z==null||z())},[ne,z]);const J=(ae=B.arrow)==null?void 0:ae.x,M=(ge=B.arrow)==null?void 0:ge.y,ce=((Z=B.arrow)==null?void 0:Z.centerOffset)!==0,[we,xe]=y.useState();return jn(()=>{k&&xe(window.getComputedStyle(k).zIndex)},[k]),g.jsx("div",{ref:W.setFloating,"data-radix-popper-content-wrapper":"",style:{...H,transform:ne?H.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:we,"--radix-popper-transform-origin":[(de=B.transformOrigin)==null?void 0:de.x,(me=B.transformOrigin)==null?void 0:me.y].join(" "),...((ie=B.hide)==null?void 0:ie.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:g.jsx(v9,{scope:n,placedSide:re,onArrowChange:A,arrowX:J,arrowY:M,shouldHideArrow:ce,children:g.jsx(ot.div,{"data-side":re,"data-align":R,...b,ref:j,style:{...b.style,animation:ne?void 0:"none"}})})})});AR.displayName=h1;var TR="PopperArrow",x9={top:"bottom",right:"left",bottom:"top",left:"right"},_R=y.forwardRef(function(t,n){const{__scopePopper:r,...i}=t,o=y9(TR,r),a=x9[o.placedSide];return g.jsx("span",{ref:o.onArrowChange,style:{position:"absolute",left:o.arrowX,top:o.arrowY,[a]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[o.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[o.placedSide],visibility:o.shouldHideArrow?"hidden":void 0},children:g.jsx(p9,{...i,ref:n,style:{...i.style,display:"block"}})})});_R.displayName=TR;function b9(e){return e!==null}var w9=e=>({name:"transformOrigin",options:e,fn(t){var S,k,C;const{placement:n,rects:r,middlewareData:i}=t,a=((S=i.arrow)==null?void 0:S.centerOffset)!==0,s=a?0:e.arrowWidth,u=a?0:e.arrowHeight,[f,d]=IR(n),h={start:"0%",center:"50%",end:"100%"}[d],m=(((k=i.arrow)==null?void 0:k.x)??0)+s/2,v=(((C=i.arrow)==null?void 0:C.y)??0)+u/2;let w="",b="";return f==="bottom"?(w=a?h:`${m}px`,b=`${-u}px`):f==="top"?(w=a?h:`${m}px`,b=`${r.floating.height+u}px`):f==="right"?(w=`${-u}px`,b=a?h:`${v}px`):f==="left"&&(w=`${r.floating.width+u}px`,b=a?h:`${v}px`),{data:{x:w,y:b}}}});function IR(e){const[t,n="center"]=e.split("-");return[t,n]}var S9=jR,k9=NR,P9=AR,C9=_R;function E9(e){const t=j9(e),n=y.forwardRef((r,i)=>{const{children:o,...a}=r,s=y.Children.toArray(o),u=s.find(N9);if(u){const f=u.props.children,d=s.map(h=>h===u?y.Children.count(f)>1?y.Children.only(null):y.isValidElement(f)?f.props.children:null:h);return g.jsx(t,{...a,ref:i,children:y.isValidElement(f)?y.cloneElement(f,void 0,d):null})}return g.jsx(t,{...a,ref:i,children:o})});return n.displayName=`${e}.Slot`,n}function j9(e){const t=y.forwardRef((n,r)=>{const{children:i,...o}=n;if(y.isValidElement(i)){const a=T9(i),s=A9(o,i.props);return i.type!==y.Fragment&&(s.ref=r?iu(r,a):a),y.cloneElement(i,s)}return y.Children.count(i)>1?y.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var O9=Symbol("radix.slottable");function N9(e){return y.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===O9}function A9(e,t){const n={...t};for(const r in t){const i=e[r],o=t[r];/^on[A-Z]/.test(r)?i&&o?n[r]=(...s)=>{const u=o(...s);return i(...s),u}:i&&(n[r]=i):r==="style"?n[r]={...i,...o}:r==="className"&&(n[r]=[i,o].filter(Boolean).join(" "))}return{...e,...n}}function T9(e){var r,i;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function _9(e){const t=y.useRef({value:e,previous:e});return y.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var RR=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"}),I9="VisuallyHidden",R9=y.forwardRef((e,t)=>g.jsx(ot.span,{...e,ref:t,style:{...RR,...e.style}}));R9.displayName=I9;var D9=[" ","Enter","ArrowUp","ArrowDown"],M9=[" ","Enter"],Cs="Select",[Am,Tm,L9]=fR(Cs),[cu]=su(Cs,[L9,CR]),_m=CR(),[$9,Ta]=cu(Cs),[F9,z9]=cu(Cs),DR=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:i,onOpenChange:o,value:a,defaultValue:s,onValueChange:u,dir:f,name:d,autoComplete:h,disabled:m,required:v,form:w}=e,b=_m(t),[S,k]=y.useState(null),[C,j]=y.useState(null),[O,A]=y.useState(!1),N=o1(f),[I,T]=Fc({prop:r,defaultProp:i??!1,onChange:o,caller:Cs}),[$,D]=Fc({prop:a,defaultProp:s,onChange:u,caller:Cs}),U=y.useRef(null),L=S?w||!!S.closest("form"):!0,[q,W]=y.useState(new Set),H=Array.from(q).map(X=>X.props.value).join(";");return g.jsx(S9,{...b,children:g.jsxs($9,{required:v,scope:t,trigger:S,onTriggerChange:k,valueNode:C,onValueNodeChange:j,valueNodeHasChildren:O,onValueNodeHasChildrenChange:A,contentId:Sa(),value:$,onValueChange:D,open:I,onOpenChange:T,dir:N,triggerPointerDownPosRef:U,disabled:m,children:[g.jsx(Am.Provider,{scope:t,children:g.jsx(F9,{scope:e.__scopeSelect,onNativeOptionAdd:y.useCallback(X=>{W(ne=>new Set(ne).add(X))},[]),onNativeOptionRemove:y.useCallback(X=>{W(ne=>{const B=new Set(ne);return B.delete(X),B})},[]),children:n})}),L?g.jsxs(aD,{"aria-hidden":!0,required:v,tabIndex:-1,name:d,autoComplete:h,value:$,onChange:X=>D(X.target.value),disabled:m,form:w,children:[$===void 0?g.jsx("option",{value:""}):null,Array.from(q)]},H):null]})})};DR.displayName=Cs;var MR="SelectTrigger",LR=y.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...i}=e,o=_m(n),a=Ta(MR,n),s=a.disabled||r,u=Dt(t,a.onTriggerChange),f=Tm(n),d=y.useRef("touch"),[h,m,v]=lD(b=>{const S=f().filter(j=>!j.disabled),k=S.find(j=>j.value===a.value),C=uD(S,b,k);C!==void 0&&a.onValueChange(C.value)}),w=b=>{s||(a.onOpenChange(!0),v()),b&&(a.triggerPointerDownPosRef.current={x:Math.round(b.pageX),y:Math.round(b.pageY)})};return g.jsx(k9,{asChild:!0,...o,children:g.jsx(ot.button,{type:"button",role:"combobox","aria-controls":a.contentId,"aria-expanded":a.open,"aria-required":a.required,"aria-autocomplete":"none",dir:a.dir,"data-state":a.open?"open":"closed",disabled:s,"data-disabled":s?"":void 0,"data-placeholder":sD(a.value)?"":void 0,...i,ref:u,onClick:Ge(i.onClick,b=>{b.currentTarget.focus(),d.current!=="mouse"&&w(b)}),onPointerDown:Ge(i.onPointerDown,b=>{d.current=b.pointerType;const S=b.target;S.hasPointerCapture(b.pointerId)&&S.releasePointerCapture(b.pointerId),b.button===0&&b.ctrlKey===!1&&b.pointerType==="mouse"&&(w(b),b.preventDefault())}),onKeyDown:Ge(i.onKeyDown,b=>{const S=h.current!=="";!(b.ctrlKey||b.altKey||b.metaKey)&&b.key.length===1&&m(b.key),!(S&&b.key===" ")&&D9.includes(b.key)&&(w(),b.preventDefault())})})})});LR.displayName=MR;var $R="SelectValue",FR=y.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:i,children:o,placeholder:a="",...s}=e,u=Ta($R,n),{onValueNodeHasChildrenChange:f}=u,d=o!==void 0,h=Dt(t,u.onValueNodeChange);return jn(()=>{f(d)},[f,d]),g.jsx(ot.span,{...s,ref:h,style:{pointerEvents:"none"},children:sD(u.value)?g.jsx(g.Fragment,{children:a}):o})});FR.displayName=$R;var B9="SelectIcon",zR=y.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...i}=e;return g.jsx(ot.span,{"aria-hidden":!0,...i,ref:t,children:r||"▼"})});zR.displayName=B9;var U9="SelectPortal",BR=e=>g.jsx(Xw,{asChild:!0,...e});BR.displayName=U9;var Es="SelectContent",UR=y.forwardRef((e,t)=>{const n=Ta(Es,e.__scopeSelect),[r,i]=y.useState();if(jn(()=>{i(new DocumentFragment)},[]),!n.open){const o=r;return o?Aa.createPortal(g.jsx(WR,{scope:e.__scopeSelect,children:g.jsx(Am.Slot,{scope:e.__scopeSelect,children:g.jsx("div",{children:e.children})})}),o):null}return g.jsx(HR,{...e,ref:t})});UR.displayName=Es;var Yr=10,[WR,_a]=cu(Es),W9="SelectContentImpl",H9=E9("SelectContent.RemoveScroll"),HR=y.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:i,onEscapeKeyDown:o,onPointerDownOutside:a,side:s,sideOffset:u,align:f,alignOffset:d,arrowPadding:h,collisionBoundary:m,collisionPadding:v,sticky:w,hideWhenDetached:b,avoidCollisions:S,...k}=e,C=Ta(Es,n),[j,O]=y.useState(null),[A,N]=y.useState(null),I=Dt(t,ae=>O(ae)),[T,$]=y.useState(null),[D,U]=y.useState(null),L=Tm(n),[q,W]=y.useState(!1),H=y.useRef(!1);y.useEffect(()=>{if(j)return F2(j)},[j]),A2();const X=y.useCallback(ae=>{const[ge,...Z]=L().map(ie=>ie.ref.current),[de]=Z.slice(-1),me=document.activeElement;for(const ie of ae)if(ie===me||(ie==null||ie.scrollIntoView({block:"nearest"}),ie===ge&&A&&(A.scrollTop=0),ie===de&&A&&(A.scrollTop=A.scrollHeight),ie==null||ie.focus(),document.activeElement!==me))return},[L,A]),ne=y.useCallback(()=>X([T,j]),[X,T,j]);y.useEffect(()=>{q&&ne()},[q,ne]);const{onOpenChange:B,triggerPointerDownPosRef:re}=C;y.useEffect(()=>{if(j){let ae={x:0,y:0};const ge=de=>{var me,ie;ae={x:Math.abs(Math.round(de.pageX)-(((me=re.current)==null?void 0:me.x)??0)),y:Math.abs(Math.round(de.pageY)-(((ie=re.current)==null?void 0:ie.y)??0))}},Z=de=>{ae.x<=10&&ae.y<=10?de.preventDefault():j.contains(de.target)||B(!1),document.removeEventListener("pointermove",ge),re.current=null};return re.current!==null&&(document.addEventListener("pointermove",ge),document.addEventListener("pointerup",Z,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",ge),document.removeEventListener("pointerup",Z,{capture:!0})}}},[j,B,re]),y.useEffect(()=>{const ae=()=>B(!1);return window.addEventListener("blur",ae),window.addEventListener("resize",ae),()=>{window.removeEventListener("blur",ae),window.removeEventListener("resize",ae)}},[B]);const[R,z]=lD(ae=>{const ge=L().filter(me=>!me.disabled),Z=ge.find(me=>me.ref.current===document.activeElement),de=uD(ge,ae,Z);de&&setTimeout(()=>de.ref.current.focus())}),J=y.useCallback((ae,ge,Z)=>{const de=!H.current&&!Z;(C.value!==void 0&&C.value===ge||de)&&($(ae),de&&(H.current=!0))},[C.value]),M=y.useCallback(()=>j==null?void 0:j.focus(),[j]),ce=y.useCallback((ae,ge,Z)=>{const de=!H.current&&!Z;(C.value!==void 0&&C.value===ge||de)&&U(ae)},[C.value]),we=r==="popper"?mb:VR,xe=we===mb?{side:s,sideOffset:u,align:f,alignOffset:d,arrowPadding:h,collisionBoundary:m,collisionPadding:v,sticky:w,hideWhenDetached:b,avoidCollisions:S}:{};return g.jsx(WR,{scope:n,content:j,viewport:A,onViewportChange:N,itemRefCallback:J,selectedItem:T,onItemLeave:M,itemTextRefCallback:ce,focusSelectedItem:ne,selectedItemText:D,position:r,isPositioned:q,searchRef:R,children:g.jsx(Zw,{as:H9,allowPinchZoom:!0,children:g.jsx(Qw,{asChild:!0,trapped:C.open,onMountAutoFocus:ae=>{ae.preventDefault()},onUnmountAutoFocus:Ge(i,ae=>{var ge;(ge=C.trigger)==null||ge.focus({preventScroll:!0}),ae.preventDefault()}),children:g.jsx(Yw,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:o,onPointerDownOutside:a,onFocusOutside:ae=>ae.preventDefault(),onDismiss:()=>C.onOpenChange(!1),children:g.jsx(we,{role:"listbox",id:C.contentId,"data-state":C.open?"open":"closed",dir:C.dir,onContextMenu:ae=>ae.preventDefault(),...k,...xe,onPlaced:()=>W(!0),ref:I,style:{display:"flex",flexDirection:"column",outline:"none",...k.style},onKeyDown:Ge(k.onKeyDown,ae=>{const ge=ae.ctrlKey||ae.altKey||ae.metaKey;if(ae.key==="Tab"&&ae.preventDefault(),!ge&&ae.key.length===1&&z(ae.key),["ArrowUp","ArrowDown","Home","End"].includes(ae.key)){let de=L().filter(me=>!me.disabled).map(me=>me.ref.current);if(["ArrowUp","End"].includes(ae.key)&&(de=de.slice().reverse()),["ArrowUp","ArrowDown"].includes(ae.key)){const me=ae.target,ie=de.indexOf(me);de=de.slice(ie+1)}setTimeout(()=>X(de)),ae.preventDefault()}})})})})})})});HR.displayName=W9;var V9="SelectItemAlignedPosition",VR=y.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...i}=e,o=Ta(Es,n),a=_a(Es,n),[s,u]=y.useState(null),[f,d]=y.useState(null),h=Dt(t,I=>d(I)),m=Tm(n),v=y.useRef(!1),w=y.useRef(!0),{viewport:b,selectedItem:S,selectedItemText:k,focusSelectedItem:C}=a,j=y.useCallback(()=>{if(o.trigger&&o.valueNode&&s&&f&&b&&S&&k){const I=o.trigger.getBoundingClientRect(),T=f.getBoundingClientRect(),$=o.valueNode.getBoundingClientRect(),D=k.getBoundingClientRect();if(o.dir!=="rtl"){const me=D.left-T.left,ie=$.left-me,He=I.left-ie,Le=I.width+He,yt=Math.max(Le,T.width),xt=window.innerWidth-Yr,Ft=fj(ie,[Yr,Math.max(Yr,xt-yt)]);s.style.minWidth=Le+"px",s.style.left=Ft+"px"}else{const me=T.right-D.right,ie=window.innerWidth-$.right-me,He=window.innerWidth-I.right-ie,Le=I.width+He,yt=Math.max(Le,T.width),xt=window.innerWidth-Yr,Ft=fj(ie,[Yr,Math.max(Yr,xt-yt)]);s.style.minWidth=Le+"px",s.style.right=Ft+"px"}const U=m(),L=window.innerHeight-Yr*2,q=b.scrollHeight,W=window.getComputedStyle(f),H=parseInt(W.borderTopWidth,10),X=parseInt(W.paddingTop,10),ne=parseInt(W.borderBottomWidth,10),B=parseInt(W.paddingBottom,10),re=H+X+q+B+ne,R=Math.min(S.offsetHeight*5,re),z=window.getComputedStyle(b),J=parseInt(z.paddingTop,10),M=parseInt(z.paddingBottom,10),ce=I.top+I.height/2-Yr,we=L-ce,xe=S.offsetHeight/2,ae=S.offsetTop+xe,ge=H+X+ae,Z=re-ge;if(ge<=ce){const me=U.length>0&&S===U[U.length-1].ref.current;s.style.bottom="0px";const ie=f.clientHeight-b.offsetTop-b.offsetHeight,He=Math.max(we,xe+(me?M:0)+ie+ne),Le=ge+He;s.style.height=Le+"px"}else{const me=U.length>0&&S===U[0].ref.current;s.style.top="0px";const He=Math.max(ce,H+b.offsetTop+(me?J:0)+xe)+Z;s.style.height=He+"px",b.scrollTop=ge-ce+b.offsetTop}s.style.margin=`${Yr}px 0`,s.style.minHeight=R+"px",s.style.maxHeight=L+"px",r==null||r(),requestAnimationFrame(()=>v.current=!0)}},[m,o.trigger,o.valueNode,s,f,b,S,k,o.dir,r]);jn(()=>j(),[j]);const[O,A]=y.useState();jn(()=>{f&&A(window.getComputedStyle(f).zIndex)},[f]);const N=y.useCallback(I=>{I&&w.current===!0&&(j(),C==null||C(),w.current=!1)},[j,C]);return g.jsx(K9,{scope:n,contentWrapper:s,shouldExpandOnScrollRef:v,onScrollButtonChange:N,children:g.jsx("div",{ref:u,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:O},children:g.jsx(ot.div,{...i,ref:h,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}})})})});VR.displayName=V9;var q9="SelectPopperPosition",mb=y.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:i=Yr,...o}=e,a=_m(n);return g.jsx(P9,{...a,...o,ref:t,align:r,collisionPadding:i,style:{boxSizing:"border-box",...o.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});mb.displayName=q9;var[K9,p1]=cu(Es,{}),gb="SelectViewport",qR=y.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...i}=e,o=_a(gb,n),a=p1(gb,n),s=Dt(t,o.onViewportChange),u=y.useRef(0);return g.jsxs(g.Fragment,{children:[g.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),g.jsx(Am.Slot,{scope:n,children:g.jsx(ot.div,{"data-radix-select-viewport":"",role:"presentation",...i,ref:s,style:{position:"relative",flex:1,overflow:"hidden auto",...i.style},onScroll:Ge(i.onScroll,f=>{const d=f.currentTarget,{contentWrapper:h,shouldExpandOnScrollRef:m}=a;if(m!=null&&m.current&&h){const v=Math.abs(u.current-d.scrollTop);if(v>0){const w=window.innerHeight-Yr*2,b=parseFloat(h.style.minHeight),S=parseFloat(h.style.height),k=Math.max(b,S);if(k<w){const C=k+v,j=Math.min(w,C),O=C-j;h.style.height=j+"px",h.style.bottom==="0px"&&(d.scrollTop=O>0?O:0,h.style.justifyContent="flex-end")}}}u.current=d.scrollTop})})})]})});qR.displayName=gb;var KR="SelectGroup",[G9,Y9]=cu(KR),GR=y.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=Sa();return g.jsx(G9,{scope:n,id:i,children:g.jsx(ot.div,{role:"group","aria-labelledby":i,...r,ref:t})})});GR.displayName=KR;var YR="SelectLabel",QR=y.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=Y9(YR,n);return g.jsx(ot.div,{id:i.id,...r,ref:t})});QR.displayName=YR;var hp="SelectItem",[Q9,XR]=cu(hp),ZR=y.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:i=!1,textValue:o,...a}=e,s=Ta(hp,n),u=_a(hp,n),f=s.value===r,[d,h]=y.useState(o??""),[m,v]=y.useState(!1),w=Dt(t,C=>{var j;return(j=u.itemRefCallback)==null?void 0:j.call(u,C,r,i)}),b=Sa(),S=y.useRef("touch"),k=()=>{i||(s.onValueChange(r),s.onOpenChange(!1))};if(r==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return g.jsx(Q9,{scope:n,value:r,disabled:i,textId:b,isSelected:f,onItemTextChange:y.useCallback(C=>{h(j=>j||((C==null?void 0:C.textContent)??"").trim())},[]),children:g.jsx(Am.ItemSlot,{scope:n,value:r,disabled:i,textValue:d,children:g.jsx(ot.div,{role:"option","aria-labelledby":b,"data-highlighted":m?"":void 0,"aria-selected":f&&m,"data-state":f?"checked":"unchecked","aria-disabled":i||void 0,"data-disabled":i?"":void 0,tabIndex:i?void 0:-1,...a,ref:w,onFocus:Ge(a.onFocus,()=>v(!0)),onBlur:Ge(a.onBlur,()=>v(!1)),onClick:Ge(a.onClick,()=>{S.current!=="mouse"&&k()}),onPointerUp:Ge(a.onPointerUp,()=>{S.current==="mouse"&&k()}),onPointerDown:Ge(a.onPointerDown,C=>{S.current=C.pointerType}),onPointerMove:Ge(a.onPointerMove,C=>{var j;S.current=C.pointerType,i?(j=u.onItemLeave)==null||j.call(u):S.current==="mouse"&&C.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Ge(a.onPointerLeave,C=>{var j;C.currentTarget===document.activeElement&&((j=u.onItemLeave)==null||j.call(u))}),onKeyDown:Ge(a.onKeyDown,C=>{var O;((O=u.searchRef)==null?void 0:O.current)!==""&&C.key===" "||(M9.includes(C.key)&&k(),C.key===" "&&C.preventDefault())})})})})});ZR.displayName=hp;var Pc="SelectItemText",JR=y.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:i,...o}=e,a=Ta(Pc,n),s=_a(Pc,n),u=XR(Pc,n),f=z9(Pc,n),[d,h]=y.useState(null),m=Dt(t,k=>h(k),u.onItemTextChange,k=>{var C;return(C=s.itemTextRefCallback)==null?void 0:C.call(s,k,u.value,u.disabled)}),v=d==null?void 0:d.textContent,w=y.useMemo(()=>g.jsx("option",{value:u.value,disabled:u.disabled,children:v},u.value),[u.disabled,u.value,v]),{onNativeOptionAdd:b,onNativeOptionRemove:S}=f;return jn(()=>(b(w),()=>S(w)),[b,S,w]),g.jsxs(g.Fragment,{children:[g.jsx(ot.span,{id:u.textId,...o,ref:m}),u.isSelected&&a.valueNode&&!a.valueNodeHasChildren?Aa.createPortal(o.children,a.valueNode):null]})});JR.displayName=Pc;var eD="SelectItemIndicator",tD=y.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return XR(eD,n).isSelected?g.jsx(ot.span,{"aria-hidden":!0,...r,ref:t}):null});tD.displayName=eD;var vb="SelectScrollUpButton",nD=y.forwardRef((e,t)=>{const n=_a(vb,e.__scopeSelect),r=p1(vb,e.__scopeSelect),[i,o]=y.useState(!1),a=Dt(t,r.onScrollButtonChange);return jn(()=>{if(n.viewport&&n.isPositioned){let s=function(){const f=u.scrollTop>0;o(f)};const u=n.viewport;return s(),u.addEventListener("scroll",s),()=>u.removeEventListener("scroll",s)}},[n.viewport,n.isPositioned]),i?g.jsx(iD,{...e,ref:a,onAutoScroll:()=>{const{viewport:s,selectedItem:u}=n;s&&u&&(s.scrollTop=s.scrollTop-u.offsetHeight)}}):null});nD.displayName=vb;var yb="SelectScrollDownButton",rD=y.forwardRef((e,t)=>{const n=_a(yb,e.__scopeSelect),r=p1(yb,e.__scopeSelect),[i,o]=y.useState(!1),a=Dt(t,r.onScrollButtonChange);return jn(()=>{if(n.viewport&&n.isPositioned){let s=function(){const f=u.scrollHeight-u.clientHeight,d=Math.ceil(u.scrollTop)<f;o(d)};const u=n.viewport;return s(),u.addEventListener("scroll",s),()=>u.removeEventListener("scroll",s)}},[n.viewport,n.isPositioned]),i?g.jsx(iD,{...e,ref:a,onAutoScroll:()=>{const{viewport:s,selectedItem:u}=n;s&&u&&(s.scrollTop=s.scrollTop+u.offsetHeight)}}):null});rD.displayName=yb;var iD=y.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...i}=e,o=_a("SelectScrollButton",n),a=y.useRef(null),s=Tm(n),u=y.useCallback(()=>{a.current!==null&&(window.clearInterval(a.current),a.current=null)},[]);return y.useEffect(()=>()=>u(),[u]),jn(()=>{var d;const f=s().find(h=>h.ref.current===document.activeElement);(d=f==null?void 0:f.ref.current)==null||d.scrollIntoView({block:"nearest"})},[s]),g.jsx(ot.div,{"aria-hidden":!0,...i,ref:t,style:{flexShrink:0,...i.style},onPointerDown:Ge(i.onPointerDown,()=>{a.current===null&&(a.current=window.setInterval(r,50))}),onPointerMove:Ge(i.onPointerMove,()=>{var f;(f=o.onItemLeave)==null||f.call(o),a.current===null&&(a.current=window.setInterval(r,50))}),onPointerLeave:Ge(i.onPointerLeave,()=>{u()})})}),X9="SelectSeparator",oD=y.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return g.jsx(ot.div,{"aria-hidden":!0,...r,ref:t})});oD.displayName=X9;var xb="SelectArrow",Z9=y.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=_m(n),o=Ta(xb,n),a=_a(xb,n);return o.open&&a.position==="popper"?g.jsx(C9,{...i,...r,ref:t}):null});Z9.displayName=xb;var J9="SelectBubbleInput",aD=y.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const i=y.useRef(null),o=Dt(r,i),a=_9(t);return y.useEffect(()=>{const s=i.current;if(!s)return;const u=window.HTMLSelectElement.prototype,d=Object.getOwnPropertyDescriptor(u,"value").set;if(a!==t&&d){const h=new Event("change",{bubbles:!0});d.call(s,t),s.dispatchEvent(h)}},[a,t]),g.jsx(ot.select,{...n,style:{...RR,...n.style},ref:o,defaultValue:t})});aD.displayName=J9;function sD(e){return e===""||e===void 0}function lD(e){const t=Ca(e),n=y.useRef(""),r=y.useRef(0),i=y.useCallback(a=>{const s=n.current+a;t(s),(function u(f){n.current=f,window.clearTimeout(r.current),f!==""&&(r.current=window.setTimeout(()=>u(""),1e3))})(s)},[t]),o=y.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return y.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,o]}function uD(e,t,n){const i=t.length>1&&Array.from(t).every(f=>f===t[0])?t[0]:t,o=n?e.indexOf(n):-1;let a=eK(e,Math.max(o,0));i.length===1&&(a=a.filter(f=>f!==n));const u=a.find(f=>f.textValue.toLowerCase().startsWith(i.toLowerCase()));return u!==n?u:void 0}function eK(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var tK=DR,nK=LR,rK=FR,iK=zR,oK=BR,aK=UR,sK=qR,lK=GR,uK=QR,cK=ZR,fK=JR,dK=tD,hK=nD,pK=rD,mK=oD;function Ni({...e}){return g.jsx(tK,{"data-slot":"select",...e})}function gK({...e}){return g.jsx(lK,{"data-slot":"select-group",...e})}function Ai({...e}){return g.jsx(rK,{"data-slot":"select-value",...e})}function Ti({className:e,size:t="default",children:n,...r}){return g.jsxs(nK,{"data-slot":"select-trigger","data-size":t,className:Qe("border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...r,children:[n,g.jsx(iK,{asChild:!0,children:g.jsx(n1,{className:"size-4 opacity-50"})})]})}function _i({className:e,children:t,position:n="item-aligned",align:r="center",...i}){return g.jsx(oK,{children:g.jsxs(aK,{"data-slot":"select-content",className:Qe("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 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:n,align:r,...i,children:[g.jsx(xK,{}),g.jsx(sK,{className:Qe("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:t}),g.jsx(bK,{})]})})}function vK({className:e,...t}){return g.jsx(uK,{"data-slot":"select-label",className:Qe("text-muted-foreground px-2 py-1.5 text-xs",e),...t})}function vt({className:e,children:t,...n}){return g.jsxs(cK,{"data-slot":"select-item",className:Qe("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 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 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",e),...n,children:[g.jsx("span",{"data-slot":"select-item-indicator",className:"absolute right-2 flex size-3.5 items-center justify-center",children:g.jsx(dK,{children:g.jsx(bV,{className:"size-4"})})}),g.jsx(fK,{children:t})]})}function yK({className:e,...t}){return g.jsx(mK,{"data-slot":"select-separator",className:Qe("bg-border pointer-events-none -mx-1 my-1 h-px",e),...t})}function xK({className:e,...t}){return g.jsx(hK,{"data-slot":"select-scroll-up-button",className:Qe("flex cursor-default items-center justify-center py-1",e),...t,children:g.jsx(CV,{className:"size-4"})})}function bK({className:e,...t}){return g.jsx(pK,{"data-slot":"select-scroll-down-button",className:Qe("flex cursor-default items-center justify-center py-1",e),...t,children:g.jsx(n1,{className:"size-4"})})}function wK(e={}){const{page:t=1,limit:n=20,tag:r,search:i,paginate:o=!0}=e;return Di({queryKey:["decisions",{page:t,limit:n,tag:r,search:i,paginate:o}],queryFn:()=>o?cW({page:t,limit:n,tag:r,search:i}):uW().then(a=>({data:a,pagination:{page:1,limit:a.length,total:a.length,totalPages:1,hasNext:!1,hasPrev:!1}}))})}function SK({decision:e,onClick:t}){const{i18n:n}=Ke("decisions"),r=new Date(e.createdAt).toLocaleDateString(n.language==="ja"?"ja-JP":"en-US");return g.jsx(nt,{className:"hover:bg-stone-50 dark:hover:bg-stone-800 transition-colors cursor-pointer h-full",onClick:t,children:g.jsxs(rt,{className:"p-3",children:[g.jsx("div",{className:"flex items-start justify-between gap-2 mb-1",children:g.jsx(nr,{className:"text-sm font-medium line-clamp-2",children:e.title})}),g.jsx("div",{className:"text-xs text-stone-500 dark:text-stone-400 mb-2",children:r}),e.tags&&e.tags.length>0&&g.jsx("div",{className:"flex flex-wrap gap-1",children:e.tags.slice(0,3).map(i=>g.jsx(tt,{variant:"secondary",className:"text-xs px-1.5 py-0",children:i},i))})]})})}function kK({decisionId:e,open:t,onOpenChange:n}){var f,d;const{t:r}=Ke("decisions"),{t:i}=Ke("common"),[o,a]=y.useState(null),[s,u]=y.useState(!1);return y.useEffect(()=>{if(!e||!t){a(null);return}u(!0),fW(e).then(a).catch(()=>a(null)).finally(()=>u(!1))},[e,t]),g.jsx(r1,{open:t,onOpenChange:n,children:g.jsxs(Pm,{className:"sm:max-w-2xl max-h-[80vh] overflow-y-auto","aria-describedby":void 0,children:[g.jsx(i1,{children:g.jsx(Cm,{children:s?g.jsx(et,{className:"h-6 w-3/4"}):(o==null?void 0:o.title)||i("loading")})}),s?g.jsxs("div",{className:"space-y-4",children:[g.jsx(et,{className:"h-20 w-full"}),g.jsx(et,{className:"h-20 w-full"})]}):o?g.jsxs("div",{className:"space-y-4",children:[g.jsxs("div",{className:"space-y-1",children:[g.jsx("span",{className:"text-xs font-medium text-stone-500 dark:text-stone-400 uppercase tracking-wide",children:r("detail.decision")}),g.jsx("div",{className:"bg-stone-100 dark:bg-stone-800 border border-stone-300 dark:border-stone-600 rounded px-4 py-3",children:g.jsx("p",{className:"whitespace-pre-wrap text-sm leading-relaxed",children:o.decision})})]}),g.jsxs("div",{className:"space-y-1",children:[g.jsx("span",{className:"text-xs font-medium text-stone-500 dark:text-stone-400 uppercase tracking-wide",children:r("detail.reasoning")}),g.jsx("div",{className:"bg-amber-50 dark:bg-amber-950/50 border border-amber-300 dark:border-amber-800 rounded px-4 py-3",children:g.jsx("p",{className:"whitespace-pre-wrap text-sm leading-relaxed text-amber-900 dark:text-amber-100",children:o.reasoning})})]}),((f=o.alternatives)==null?void 0:f.length)>0&&g.jsxs("div",{className:"space-y-1",children:[g.jsx("span",{className:"text-xs font-medium text-stone-500 dark:text-stone-400 uppercase tracking-wide",children:r("detail.alternatives")}),g.jsx("div",{className:"space-y-2",children:o.alternatives.map(h=>{const m=h.name||h.option;return g.jsxs("div",{className:"border border-stone-300 dark:border-stone-600 rounded px-4 py-3",children:[g.jsx("span",{className:"font-medium text-sm",children:m}),g.jsx("p",{className:"text-sm text-stone-500 dark:text-stone-400 mt-1",children:h.reason})]},`${m}-${h.reason}`)})})]}),((d=o.tags)==null?void 0:d.length)>0&&g.jsx("div",{className:"flex flex-wrap gap-1 pt-2",children:o.tags.map(h=>g.jsx(tt,{variant:"secondary",className:"text-xs",children:h},h))})]}):g.jsx("div",{className:"text-center py-8 text-muted-foreground",children:i("loading")})]})})}function PK(){const{t:e}=Ke("decisions"),{t}=Ke("common"),[n,r]=y.useState(1),[i,o]=y.useState(""),[a,s]=y.useState("all"),[u,f]=y.useState(null),[d,h]=y.useState("");y.useMemo(()=>{const C=setTimeout(()=>{h(i),r(1)},300);return()=>clearTimeout(C)},[i]);const{data:m,isLoading:v,error:w}=wK({page:n,limit:20,tag:a!=="all"?a:void 0,search:d||void 0}),b=y.useMemo(()=>{if(!(m!=null&&m.data))return[];const C=new Set;for(const j of m.data)for(const O of j.tags||[])C.add(O);return Array.from(C).sort()},[m==null?void 0:m.data]);if(v)return g.jsxs("div",{className:"space-y-6",children:[g.jsx("div",{className:"flex items-center justify-between",children:g.jsx("h1",{className:"text-2xl font-bold",children:e("title")})}),g.jsx(SW,{count:5})]});if(w)return g.jsx("div",{className:"text-center py-12 text-destructive",children:e("errors:failedToLoad.decisions")});const S=(m==null?void 0:m.data)||[],k=m==null?void 0:m.pagination;return g.jsxs("div",{className:"space-y-6",children:[g.jsxs("div",{className:"flex items-center justify-between",children:[g.jsxs("div",{children:[g.jsx("h1",{className:"text-2xl font-bold",children:e("title")}),g.jsx("p",{className:"text-sm text-muted-foreground",children:e("subtitle")})]}),g.jsx("p",{className:"text-sm text-muted-foreground",children:e("decisionCount",{count:(k==null?void 0:k.total)||0})})]}),((k==null?void 0:k.total)||0)===0&&!d&&a==="all"?g.jsxs("div",{className:"text-center py-12 text-muted-foreground",children:[g.jsx("p",{children:e("noDecisionsFound")}),g.jsx("p",{className:"text-sm mt-2",children:e("noDecisionsDescription")})]}):g.jsxs(g.Fragment,{children:[g.jsxs("div",{className:"flex gap-4 items-center flex-wrap",children:[g.jsx(mf,{placeholder:e("searchPlaceholder"),value:i,onChange:C=>o(C.target.value),className:"max-w-xs"}),g.jsxs(Ni,{value:a,onValueChange:C=>{s(C),r(1)},children:[g.jsx(Ti,{className:"w-[180px]",children:g.jsx(Ai,{placeholder:t("allTags")})}),g.jsxs(_i,{children:[g.jsx(vt,{value:"all",children:t("allTags")}),b.map(C=>g.jsx(vt,{value:C,children:C},C))]})]})]}),S.length===0?g.jsx("div",{className:"text-center py-12 text-muted-foreground",children:g.jsx("p",{children:e("noMatchingFilters")})}):g.jsxs(g.Fragment,{children:[g.jsx("div",{className:"grid gap-3 sm:grid-cols-2 md:grid-cols-3",children:S.map(C=>g.jsx(SK,{decision:C,onClick:()=>f(C.id)},C.id))}),k&&g.jsx(cR,{page:k.page,totalPages:k.totalPages,hasNext:k.hasNext,hasPrev:k.hasPrev,onPageChange:r})]})]}),g.jsx(kK,{decisionId:u,open:!!u,onOpenChange:C=>!C&&f(null)})]})}function CK(){return g.jsx(E6,{to:"/decisions",replace:!0})}const EK="modulepreload",jK=function(e){return"/"+e},Pj={},OK=function(t,n,r){let i=Promise.resolve();if(n&&n.length>0){let a=function(f){return Promise.all(f.map(d=>Promise.resolve(d).then(h=>({status:"fulfilled",value:h}),h=>({status:"rejected",reason:h}))))};document.getElementsByTagName("link");const s=document.querySelector("meta[property=csp-nonce]"),u=(s==null?void 0:s.nonce)||(s==null?void 0:s.getAttribute("nonce"));i=a(n.map(f=>{if(f=jK(f),f in Pj)return;Pj[f]=!0;const d=f.endsWith(".css"),h=d?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${f}"]${h}`))return;const m=document.createElement("link");if(m.rel=d?"stylesheet":EK,d||(m.as="script"),m.crossOrigin="",m.href=f,u&&m.setAttribute("nonce",u),document.head.appendChild(m),d)return new Promise((v,w)=>{m.addEventListener("load",v),m.addEventListener("error",()=>w(new Error(`Unable to preload CSS for ${f}`)))})}))}function o(a){const s=new Event("vite:preloadError",{cancelable:!0});if(s.payload=a,window.dispatchEvent(s),!s.defaultPrevented)throw a}return i.then(a=>{for(const s of a||[])s.status==="rejected"&&o(s.reason);return t().catch(o)})},NK=y.lazy(()=>OK(()=>import("./react-force-graph-2d-DZOG11W0.js"),[]));function AK(e){const[t,n]=y.useState({width:800,height:500});return y.useEffect(()=>{const r=()=>{if(e.current){const i=window.innerHeight-184;n({width:e.current.offsetWidth,height:Math.max(400,i)})}};return r(),window.addEventListener("resize",r),()=>window.removeEventListener("resize",r)},[e]),t}async function TK(){const e=await fetch("/api/sessions/graph");if(!e.ok)throw new Error("Failed to fetch graph");return e.json()}const uc={decision:"#f59e0b",implementation:"#3b82f6",research:"#8b5cf6",exploration:"#10b981",discussion:"#6366f1",debug:"#ef4444",review:"#ec4899",unknown:"#6b7280"};function _K(){const{t:e}=Ke("graph"),t=ym(),n=y.useRef(null),r=y.useRef(null),[i,o]=y.useState(null),[a,s]=y.useState({x:0,y:0}),u=AK(r),{data:f,isLoading:d,error:h}=Di({queryKey:["sessions","graph"],queryFn:TK}),m=y.useMemo(()=>f?{nodes:f.nodes.map(S=>({...S,color:uc[S.type]||uc.unknown})),links:f.edges.map(S=>({source:S.source,target:S.target,value:S.weight}))}:{nodes:[],links:[]},[f]),v=y.useCallback(S=>{S.id&&t(`/sessions/${S.id}`)},[t]),w=y.useCallback(S=>{o(S)},[]),b=y.useCallback(S=>{const k=S.currentTarget.getBoundingClientRect();s({x:S.clientX-k.left,y:S.clientY-k.top})},[]);return h?g.jsx("div",{className:"text-center py-12 text-destructive",children:e("errors:failedToLoad.graph")}):g.jsxs("div",{className:"h-full flex flex-col",children:[g.jsxs("div",{className:"mb-4",children:[g.jsx("h1",{className:"text-xl font-bold",children:e("title")}),g.jsx("p",{className:"text-xs text-muted-foreground",children:e("subtitle")})]}),g.jsxs("div",{className:"grid gap-4 lg:grid-cols-[1fr_280px] flex-1 min-h-0",children:[g.jsx(nt,{className:"overflow-hidden",children:g.jsxs(rt,{className:"p-0 relative",ref:r,onMouseMove:b,children:[d?g.jsx(et,{className:"h-full min-h-[400px] w-full"}):m.nodes.length===0?g.jsx("div",{className:"h-full min-h-[400px] flex items-center justify-center text-muted-foreground",children:e("noSessions")}):g.jsx(y.Suspense,{fallback:g.jsx(et,{className:"h-full min-h-[400px] w-full"}),children:g.jsx(NK,{ref:n,graphData:m,nodeColor:"color",nodeRelSize:6,linkWidth:S=>Math.sqrt(S.value||1),linkColor:()=>"#cbd5e1",onNodeClick:v,onNodeHover:w,width:u.width,height:u.height,backgroundColor:"#ffffff"})}),i&&g.jsxs("div",{className:"absolute pointer-events-none bg-white border border-stone-200 rounded-lg shadow-lg p-3 max-w-[240px] z-10",style:{left:Math.min(a.x+12,u.width-260),top:Math.min(a.y+12,u.height-120)},children:[g.jsx("p",{className:"font-medium text-sm line-clamp-2 mb-1",children:i.title}),g.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-muted-foreground mb-1",children:[g.jsx("span",{className:"h-2 w-2 rounded-full",style:{backgroundColor:uc[i.type]||uc.unknown}}),g.jsx("span",{children:e(`types.${i.type}`)})]}),i.tags.length>0&&g.jsxs("div",{className:"flex flex-wrap gap-1 mb-1",children:[i.tags.slice(0,3).map(S=>g.jsx("span",{className:"text-xs bg-stone-100 px-1.5 py-0.5 rounded",children:S},S)),i.tags.length>3&&g.jsxs("span",{className:"text-xs text-muted-foreground",children:["+",i.tags.length-3]})]}),g.jsx("p",{className:"text-xs text-stone-400",children:e("clickToViewDetails")})]})]})}),g.jsxs("div",{className:"space-y-4",children:[g.jsxs(nt,{children:[g.jsx(tr,{children:g.jsx(nr,{className:"text-sm",children:e("howToRead.title")})}),g.jsxs(rt,{className:"space-y-2 text-sm text-muted-foreground",children:[g.jsxs("div",{className:"flex items-start gap-2",children:[g.jsx("span",{className:"inline-block w-3 h-3 rounded-full bg-blue-500 mt-1 shrink-0"}),g.jsxs("span",{children:[g.jsx("strong",{children:"Nodes"})," = ",e("howToRead.nodes")]})]}),g.jsxs("div",{className:"flex items-start gap-2",children:[g.jsx("span",{className:"inline-block w-6 h-0.5 bg-slate-300 mt-2 shrink-0"}),g.jsxs("span",{children:[g.jsx("strong",{children:"Lines"})," = ",e("howToRead.lines")]})]}),g.jsx("p",{className:"pt-2 text-xs",children:e("howToRead.clickHint")})]})]}),g.jsxs(nt,{children:[g.jsx(tr,{children:g.jsx(nr,{className:"text-sm",children:e("sessionTypes")})}),g.jsx(rt,{className:"grid grid-cols-2 gap-x-4 gap-y-2",children:Object.entries(uc).map(([S,k])=>g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx("span",{className:"h-3 w-3 rounded-full shrink-0",style:{backgroundColor:k}}),g.jsx("span",{className:"text-sm capitalize truncate",children:e(`types.${S}`)})]},S))})]}),g.jsxs(nt,{children:[g.jsx(tr,{children:g.jsx(nr,{className:"text-sm",children:e("graphStats.title")})}),g.jsxs(rt,{className:"space-y-1 text-sm",children:[g.jsxs("p",{children:[e("graphStats.nodes"),": ",m.nodes.length]}),g.jsxs("p",{children:[e("graphStats.connections"),": ",m.links.length]})]})]})]})]})]})}const IK=[{path:"/guide",labelKey:"nav.overview"},{path:"/guide/workflow",labelKey:"nav.workflow"},{path:"/guide/commands",labelKey:"nav.commands"},{path:"/guide/use-cases",labelKey:"nav.useCases"},{path:"/guide/faq",labelKey:"nav.faq"}];function vf(){const{t:e}=Ke("guide"),t=Wi();return g.jsx("nav",{className:"flex flex-wrap gap-2 mb-6 pb-4 border-b border-stone-200 dark:border-stone-700",children:IK.map(n=>{const r=t.pathname===n.path;return g.jsx(Mi,{to:n.path,className:Qe("px-3 py-1.5 rounded-md text-sm font-medium transition-colors",r?"bg-stone-800 text-white dark:bg-stone-700":"text-stone-600 hover:text-stone-900 hover:bg-stone-100 dark:text-stone-400 dark:hover:text-stone-100 dark:hover:bg-stone-800"),children:e(n.labelKey)},n.path)})})}function RK(){const{t:e}=Ke("guide"),t=e("overview.features.items",{returnObjects:!0}),n=e("overview.quickStart.steps",{returnObjects:!0});return g.jsxs("div",{className:"space-y-6",children:[g.jsxs("div",{children:[g.jsx("h1",{className:"text-2xl font-bold",children:e("overview.title")}),g.jsx("p",{className:"text-sm text-muted-foreground",children:e("overview.subtitle")})]}),g.jsx(vf,{}),g.jsx("p",{className:"text-stone-600 dark:text-stone-300",children:e("overview.description")}),g.jsxs("section",{className:"space-y-4",children:[g.jsx("h2",{className:"text-lg font-semibold",children:e("overview.features.title")}),g.jsx("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-3",children:t.map(r=>g.jsx(nt,{children:g.jsxs(rt,{className:"p-4",children:[g.jsx("h3",{className:"font-medium mb-1",children:r.title}),g.jsx("p",{className:"text-sm text-muted-foreground",children:r.description})]})},r.title))})]}),g.jsxs("section",{className:"space-y-4",children:[g.jsx("h2",{className:"text-lg font-semibold",children:e("overview.quickStart.title")}),g.jsx("div",{className:"space-y-4",children:n.map((r,i)=>g.jsxs("div",{className:"flex gap-4",children:[g.jsx("div",{className:"flex-shrink-0 w-8 h-8 rounded-full bg-stone-800 dark:bg-stone-700 text-white flex items-center justify-center text-sm font-medium",children:i+1}),g.jsxs("div",{className:"flex-1",children:[g.jsx("h3",{className:"font-medium",children:r.title}),g.jsx("p",{className:"text-sm text-muted-foreground mb-2",children:r.description}),r.code&&g.jsx("code",{className:"block bg-stone-100 dark:bg-stone-800 px-3 py-2 rounded text-sm font-mono",children:r.code})]})]},r.title))})]})]})}function m1({id:e,isExpanded:t,onToggle:n,header:r,children:i,className:o}){const{t:a}=Ke("guide"),s=`${e}-content`;return g.jsxs(nt,{className:Qe("overflow-hidden",o),children:[g.jsx("button",{type:"button",className:"w-full text-left",onClick:n,"aria-expanded":t,"aria-controls":s,children:g.jsx(rt,{className:"p-4",children:g.jsxs("div",{className:"flex items-start justify-between gap-4",children:[g.jsx("div",{id:e,className:"flex-1 min-w-0",children:r}),g.jsx("svg",{className:Qe("h-5 w-5 text-muted-foreground transition-transform shrink-0",t&&"rotate-180"),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:g.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})}),g.jsx("span",{className:"sr-only",children:a(t?"common.collapse":"common.expand")})]})})}),t&&g.jsx("section",{id:s,"aria-labelledby":e,className:"px-4 pb-4 border-t border-stone-100 dark:border-stone-800 pt-4",children:i})]})}function DK(){const{t:e}=Ke("guide"),[t,n]=y.useState(null),r=e("commands.categories",{returnObjects:!0}),i=o=>{n(t===o?null:o)};return g.jsxs("div",{className:"space-y-6",children:[g.jsxs("div",{children:[g.jsx("h1",{className:"text-2xl font-bold",children:e("commands.title")}),g.jsx("p",{className:"text-sm text-muted-foreground",children:e("commands.subtitle")})]}),g.jsx(vf,{}),Object.entries(r).map(([o,a])=>g.jsxs("section",{className:"space-y-3",children:[g.jsx("h2",{className:"text-lg font-semibold",children:a.title}),g.jsx("div",{className:"space-y-2",children:a.commands.map(s=>{const u=t===s.name,f=`command-${s.name.replace(/[^a-zA-Z0-9]/g,"-")}`;return g.jsx(m1,{id:f,isExpanded:u,onToggle:()=>i(s.name),header:g.jsxs(g.Fragment,{children:[g.jsx("div",{className:"flex items-center gap-2 mb-1",children:g.jsx("code",{className:"font-mono font-semibold text-sm",children:s.name})}),g.jsx("p",{className:"text-sm text-muted-foreground",children:s.description})]}),children:g.jsxs("div",{className:"space-y-4",children:[g.jsxs("div",{children:[g.jsx("span",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide",children:e("common.usage")}),g.jsx("code",{className:"block bg-stone-100 dark:bg-stone-800 px-3 py-2 rounded text-sm font-mono mt-1",children:s.usage})]}),g.jsxs("div",{children:[g.jsx("span",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide",children:e("common.details")}),g.jsx("p",{className:"text-sm mt-1",children:s.details})]}),s.options.length>0&&g.jsxs("div",{children:[g.jsx("span",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide",children:e("common.options")}),g.jsx("div",{className:"mt-2 space-y-2",children:s.options.map(d=>g.jsxs("div",{className:"flex gap-2",children:[g.jsx(tt,{variant:"outline",className:"font-mono text-xs shrink-0",children:d.name}),g.jsx("span",{className:"text-sm text-muted-foreground",children:d.description})]},d.name))})]}),s.phases&&s.phases.length>0&&g.jsxs("div",{children:[g.jsx("span",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide",children:e("common.phases")}),g.jsx("ol",{className:"mt-2 space-y-1",children:s.phases.map((d,h)=>g.jsxs("li",{className:"text-sm flex items-start gap-2",children:[g.jsx("span",{className:"w-5 h-5 rounded-full bg-stone-200 dark:bg-stone-700 text-xs flex items-center justify-center shrink-0",children:h+1}),g.jsx("span",{children:d})]},d))})]})]})},s.name)})})]},o))]})}function MK(){const{t:e}=Ke("guide"),[t,n]=y.useState(null),r=e("faq.categories",{returnObjects:!0}),i=o=>{n(t===o?null:o)};return g.jsxs("div",{className:"space-y-6",children:[g.jsxs("div",{children:[g.jsx("h1",{className:"text-2xl font-bold",children:e("faq.title")}),g.jsx("p",{className:"text-sm text-muted-foreground",children:e("faq.subtitle")})]}),g.jsx(vf,{}),Object.entries(r).map(([o,a])=>g.jsxs("section",{className:"space-y-3",children:[g.jsx("h2",{className:"text-lg font-semibold",children:a.title}),g.jsx("div",{className:"space-y-2",children:a.items.map((s,u)=>{const f=t===s.question,d=`faq-${o}-${u}`;return g.jsx(m1,{id:d,isExpanded:f,onToggle:()=>i(s.question),header:g.jsxs("div",{className:"flex items-start gap-3",children:[g.jsx("span",{className:"text-stone-400 dark:text-stone-500 shrink-0",children:e("common.question")}),g.jsx("span",{className:"font-medium",children:s.question})]}),children:g.jsxs("div",{className:"flex gap-3",children:[g.jsx("span",{className:"text-green-600 dark:text-green-400 shrink-0",children:e("common.answer")}),g.jsx("p",{className:"text-sm text-muted-foreground",children:s.answer})]})},s.question)})})]},o))]})}function LK(){const{t:e}=Ke("guide"),[t,n]=y.useState(null),r=e("useCases.cases",{returnObjects:!0}),i=o=>{n(t===o?null:o)};return g.jsxs("div",{className:"space-y-6",children:[g.jsxs("div",{children:[g.jsx("h1",{className:"text-2xl font-bold",children:e("useCases.title")}),g.jsx("p",{className:"text-sm text-muted-foreground",children:e("useCases.subtitle")})]}),g.jsx(vf,{}),g.jsx("div",{className:"space-y-3",children:r.map((o,a)=>{const s=t===o.title,u=`usecase-${a}`;return g.jsx(m1,{id:u,isExpanded:s,onToggle:()=>i(o.title),header:g.jsxs(g.Fragment,{children:[g.jsx("h3",{className:"font-medium mb-1",children:o.title}),g.jsx("p",{className:"text-sm text-muted-foreground",children:o.scenario})]}),children:g.jsx("div",{className:"space-y-3",children:o.steps.map((f,d)=>g.jsxs("div",{className:"flex gap-3",children:[g.jsxs("div",{className:"flex flex-col items-center",children:[g.jsx("div",{className:"w-6 h-6 rounded-full bg-stone-800 dark:bg-stone-700 text-white text-xs flex items-center justify-center shrink-0",children:d+1}),d<o.steps.length-1&&g.jsx("div",{className:"w-0.5 flex-1 bg-stone-200 dark:bg-stone-700 mt-1"})]}),g.jsxs("div",{className:"flex-1 pb-2",children:[g.jsx("p",{className:"text-sm font-medium",children:f.action}),g.jsxs("p",{className:"text-sm text-green-600 dark:text-green-400 mt-1",children:["→ ",f.result]})]})]},f.action))})},o.title)})})]})}function $K(){const{t:e}=Ke("guide"),t=e("workflow.phases",{returnObjects:!0}),n=e("workflow.dataFlow.steps",{returnObjects:!0});return g.jsxs("div",{className:"space-y-6",children:[g.jsxs("div",{children:[g.jsx("h1",{className:"text-2xl font-bold",children:e("workflow.title")}),g.jsx("p",{className:"text-sm text-muted-foreground",children:e("workflow.subtitle")})]}),g.jsx(vf,{}),g.jsx("p",{className:"text-stone-600 dark:text-stone-300",children:e("workflow.intro")}),g.jsx("section",{className:"space-y-4",children:g.jsx("div",{className:"grid gap-4 md:grid-cols-2",children:t.map((r,i)=>g.jsxs(nt,{className:"relative overflow-hidden",children:[g.jsx("div",{className:"absolute top-0 left-0 w-1 h-full bg-stone-800 dark:bg-stone-600"}),g.jsxs(rt,{className:"p-4 pl-5",children:[g.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[g.jsx("span",{className:"w-6 h-6 rounded-full bg-stone-800 dark:bg-stone-700 text-white text-xs flex items-center justify-center",children:i+1}),g.jsx("h3",{className:"font-semibold",children:r.name}),r.command&&g.jsx(tt,{variant:"secondary",className:"font-mono text-xs",children:r.command})]}),g.jsx("p",{className:"text-sm text-muted-foreground mb-3",children:r.description}),g.jsx("ul",{className:"space-y-1 mb-3",children:r.benefits.map(o=>g.jsxs("li",{className:"text-sm flex items-start gap-2",children:[g.jsx("span",{className:"text-green-600 dark:text-green-400 mt-0.5",children:"+"}),g.jsx("span",{children:o})]},o))}),r.example&&g.jsx("code",{className:"block bg-stone-100 dark:bg-stone-800 px-2 py-1 rounded text-xs font-mono",children:r.example})]})]},r.name))})}),g.jsxs("section",{className:"space-y-4",children:[g.jsx("h2",{className:"text-lg font-semibold",children:e("workflow.dataFlow.title")}),g.jsx("p",{className:"text-sm text-muted-foreground",children:e("workflow.dataFlow.description")}),g.jsxs("div",{className:"relative",children:[g.jsx("div",{className:"absolute left-4 top-0 bottom-0 w-0.5 bg-stone-200 dark:bg-stone-700"}),g.jsx("div",{className:"space-y-4",children:n.map((r,i)=>g.jsxs("div",{className:"flex gap-4 relative",children:[g.jsx("div",{className:"w-8 h-8 rounded-full bg-white dark:bg-stone-900 border-2 border-stone-300 dark:border-stone-600 flex items-center justify-center text-xs font-medium z-10",children:i+1}),g.jsxs("div",{className:"flex-1 pb-4",children:[g.jsx("h4",{className:"font-medium text-sm",children:r.event}),g.jsx("p",{className:"text-sm text-muted-foreground",children:r.action})]})]},r.event))})]})]})]})}function FK(){const{t:e}=Ke("errors");return g.jsxs("div",{className:"text-center py-12",children:[g.jsx("h1",{className:"text-4xl font-bold mb-4",children:e("notFound.title")}),g.jsx("p",{className:"text-muted-foreground mb-4",children:e("notFound.message")}),g.jsx(Mi,{to:"/",className:"text-primary underline",children:e("notFound.backToHome")})]})}async function zK(){const e=await fetch("/api/patterns");if(!e.ok)throw new Error("Failed to fetch patterns");return e.json()}async function BK(){const e=await fetch("/api/patterns/stats");if(!e.ok)throw new Error("Failed to fetch stats");return e.json()}const pp={good:{bg:"bg-emerald-50 dark:bg-emerald-950/30",text:"text-emerald-700 dark:text-emerald-300",border:"border-emerald-200 dark:border-emerald-800"},bad:{bg:"bg-rose-50 dark:bg-rose-950/30",text:"text-rose-700 dark:text-rose-300",border:"border-rose-200 dark:border-rose-800"},"error-solution":{bg:"bg-amber-50 dark:bg-amber-950/30",text:"text-amber-700 dark:text-amber-300",border:"border-amber-200 dark:border-amber-800"}};function UK({pattern:e,onClick:t}){const{t:n,i18n:r}=Ke("patterns"),i=pp[e.type]||pp.good,o=new Date(e.createdAt).toLocaleDateString(r.language==="ja"?"ja-JP":"en-US"),a={good:n("types.good"),bad:n("types.bad"),"error-solution":n("types.errorSolution")};return g.jsx(nt,{className:`${i.border} border hover:bg-stone-50 dark:hover:bg-stone-800 transition-colors cursor-pointer h-full`,onClick:t,children:g.jsxs(rt,{className:"p-3",children:[g.jsx("div",{className:"flex items-start justify-between gap-2 mb-1",children:g.jsx(nr,{className:"text-sm font-medium line-clamp-2",children:e.title||e.description||e.errorPattern||e.solution||"Untitled"})}),g.jsxs("div",{className:"flex items-center gap-2 text-xs text-stone-500 dark:text-stone-400 mb-2",children:[g.jsx(tt,{className:`${i.bg} ${i.text} border-0 text-xs`,children:a[e.type]||e.type}),g.jsx("span",{children:o})]}),e.tags&&e.tags.length>0&&g.jsxs("div",{className:"flex flex-wrap gap-1",children:[e.tags.slice(0,3).map(s=>g.jsx(tt,{variant:"secondary",className:"text-xs px-1.5 py-0",children:s},s)),e.tags.length>3&&g.jsxs(tt,{variant:"outline",className:"text-xs px-1.5 py-0",children:["+",e.tags.length-3]})]})]})})}function WK({pattern:e,open:t,onOpenChange:n}){const{t:r}=Ke("patterns");if(!e)return null;const i=pp[e.type]||pp.good,o={good:r("types.good"),bad:r("types.bad"),"error-solution":r("types.errorSolution")};return g.jsx(r1,{open:t,onOpenChange:n,children:g.jsxs(Pm,{className:"sm:max-w-2xl max-h-[80vh] overflow-y-auto","aria-describedby":void 0,children:[g.jsxs(i1,{children:[g.jsx("div",{className:"flex items-center gap-2",children:g.jsx(tt,{className:`${i.bg} ${i.text} border-0`,children:o[e.type]||e.type})}),g.jsx(Cm,{className:"mt-2",children:e.title||e.description||e.errorPattern||e.solution||"Untitled"})]}),g.jsxs("div",{className:"space-y-4",children:[e.title&&e.description!==e.title&&g.jsxs("div",{className:"space-y-1",children:[g.jsx("span",{className:"text-xs font-medium text-stone-500 dark:text-stone-400 uppercase tracking-wide",children:r("fields.description")}),g.jsx("p",{className:"text-sm leading-relaxed",children:e.description})]}),e.type==="error-solution"&&e.errorPattern&&g.jsxs("div",{className:"space-y-1",children:[g.jsx("span",{className:"text-xs font-medium text-rose-600 dark:text-rose-400 uppercase tracking-wide",children:r("fields.errorPattern")}),g.jsx("pre",{className:"text-xs bg-rose-50 dark:bg-rose-950/30 text-rose-800 dark:text-rose-200 p-3 rounded overflow-x-auto whitespace-pre-wrap border border-rose-200 dark:border-rose-800",children:e.errorPattern})]}),e.type==="error-solution"&&e.solution&&g.jsxs("div",{className:"space-y-1",children:[g.jsx("span",{className:"text-xs font-medium text-emerald-600 dark:text-emerald-400 uppercase tracking-wide",children:r("fields.solution")}),g.jsx("pre",{className:"text-xs bg-emerald-50 dark:bg-emerald-950/30 text-emerald-800 dark:text-emerald-200 p-3 rounded overflow-x-auto whitespace-pre-wrap border border-emerald-200 dark:border-emerald-800",children:e.solution})]}),e.codeExample&&g.jsxs("div",{className:"space-y-1",children:[g.jsx("span",{className:"text-xs font-medium text-stone-500 dark:text-stone-400 uppercase tracking-wide",children:r("fields.codeExample")}),g.jsx("pre",{className:"text-xs bg-stone-100 dark:bg-stone-800 text-stone-700 dark:text-stone-300 p-3 rounded overflow-x-auto whitespace-pre-wrap border border-stone-300 dark:border-stone-600",children:e.codeExample})]}),e.context&&g.jsxs("div",{className:"space-y-1",children:[g.jsx("span",{className:"text-xs font-medium text-stone-500 dark:text-stone-400 uppercase tracking-wide",children:r("fields.context")}),g.jsx("pre",{className:"text-xs bg-stone-100 dark:bg-stone-800 text-stone-700 dark:text-stone-300 p-3 rounded overflow-x-auto whitespace-pre-wrap border border-stone-300 dark:border-stone-600",children:e.context})]}),e.tags&&e.tags.length>0&&g.jsx("div",{className:"flex flex-wrap gap-1 pt-2",children:e.tags.map(a=>g.jsx(tt,{variant:"secondary",className:"text-xs",children:a},a))})]})]})})}function ch({title:e,value:t,color:n}){return g.jsx(nt,{children:g.jsxs(rt,{className:"pt-4",children:[g.jsx("div",{className:"text-2xl font-bold",style:{color:n},children:t}),g.jsx("div",{className:"text-xs text-stone-500 dark:text-stone-400",children:e})]})})}function HK(){var b,S,k;const{t:e}=Ke("patterns"),[t,n]=y.useState(""),[r,i]=y.useState("all"),[o,a]=y.useState(null),{data:s,isLoading:u,error:f}=Di({queryKey:["patterns"],queryFn:zK}),{data:d,isLoading:h,error:m}=Di({queryKey:["patterns","stats"],queryFn:BK});if(f||m)return g.jsx("div",{className:"text-center py-12 text-destructive",children:e("errors:failedToLoad.patterns")});const v=(s==null?void 0:s.patterns)||[],w=v.filter(C=>{var A,N,I;const j=t===""||((A=C.title)==null?void 0:A.toLowerCase().includes(t.toLowerCase()))||C.description.toLowerCase().includes(t.toLowerCase())||((N=C.errorPattern)==null?void 0:N.toLowerCase().includes(t.toLowerCase()))||((I=C.solution)==null?void 0:I.toLowerCase().includes(t.toLowerCase())),O=r==="all"||C.type===r;return j&&O});return g.jsxs("div",{className:"space-y-6",children:[g.jsxs("div",{className:"flex items-center justify-between",children:[g.jsxs("div",{children:[g.jsx("h1",{className:"text-2xl font-bold",children:e("title")}),g.jsx("p",{className:"text-sm text-muted-foreground",children:e("subtitle")})]}),g.jsx("p",{className:"text-sm text-muted-foreground",children:e("patternCount",{count:v.length})})]}),v.length===0&&!u&&g.jsx(nt,{className:"border-dashed",children:g.jsxs(rt,{className:"py-6",children:[g.jsx("h3",{className:"font-medium mb-2",children:e("explanation.title")}),g.jsxs("div",{className:"text-sm text-muted-foreground space-y-2",children:[g.jsxs("div",{className:"flex items-start gap-2",children:[g.jsx("span",{className:"inline-block w-3 h-3 rounded-full bg-green-500 mt-1 shrink-0"}),g.jsxs("div",{children:[g.jsx("strong",{children:e("types.good")}),":"," ",e("explanation.goodPattern")]})]}),g.jsxs("div",{className:"flex items-start gap-2",children:[g.jsx("span",{className:"inline-block w-3 h-3 rounded-full bg-red-500 mt-1 shrink-0"}),g.jsxs("div",{children:[g.jsx("strong",{children:e("types.bad")}),":"," ",e("explanation.antiPattern")]})]}),g.jsxs("div",{className:"flex items-start gap-2",children:[g.jsx("span",{className:"inline-block w-3 h-3 rounded-full bg-amber-500 mt-1 shrink-0"}),g.jsxs("div",{children:[g.jsx("strong",{children:e("types.errorSolution")}),":"," ",e("explanation.errorSolution")]})]})]}),g.jsx("p",{className:"text-sm text-muted-foreground mt-3",children:g.jsx(u2,{i18nKey:"explanation.description",ns:"patterns",components:{code:g.jsx("code",{className:"bg-muted px-1 rounded"})}})})]})}),g.jsx("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-4",children:h?[0,1,2,3].map(C=>g.jsx(nt,{children:g.jsxs(rt,{className:"pt-4",children:[g.jsx(et,{className:"h-8 w-12 mb-1"}),g.jsx(et,{className:"h-4 w-20"})]})},C)):g.jsxs(g.Fragment,{children:[g.jsx(ch,{title:e("stats.totalPatterns"),value:(d==null?void 0:d.total)||0}),g.jsx(ch,{title:e("stats.goodPatterns"),value:((b=d==null?void 0:d.byType)==null?void 0:b.good)||0,color:"#16a34a"}),g.jsx(ch,{title:e("stats.antiPatterns"),value:((S=d==null?void 0:d.byType)==null?void 0:S.bad)||0,color:"#dc2626"}),g.jsx(ch,{title:e("stats.errorSolutions"),value:((k=d==null?void 0:d.byType)==null?void 0:k["error-solution"])||0,color:"#d97706"})]})}),g.jsxs("div",{className:"flex gap-4 items-center",children:[g.jsx(mf,{placeholder:e("searchPlaceholder"),value:t,onChange:C=>n(C.target.value),className:"max-w-sm"}),g.jsxs(Ni,{value:r,onValueChange:i,children:[g.jsx(Ti,{className:"w-[180px]",children:g.jsx(Ai,{placeholder:e("types.allTypes")})}),g.jsxs(_i,{children:[g.jsx(vt,{value:"all",children:e("types.allTypes")}),g.jsx(vt,{value:"good",children:e("types.goodPatterns")}),g.jsx(vt,{value:"bad",children:e("types.antiPatterns")}),g.jsx(vt,{value:"error-solution",children:e("types.errorSolutions")})]})]})]}),u?g.jsx("div",{className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4",children:[0,1,2,3,4,5].map(C=>g.jsx(nt,{children:g.jsxs(rt,{className:"p-3",children:[g.jsx(et,{className:"h-4 w-full mb-2"}),g.jsx(et,{className:"h-3 w-24 mb-2"}),g.jsx(et,{className:"h-3 w-16"})]})},C))}):w.length===0?g.jsx(nt,{children:g.jsx(rt,{className:"py-12 text-center text-muted-foreground",children:v.length===0?e("noPatterns"):e("noMatchingFilters")})}):g.jsx("div",{className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4",children:w.map(C=>g.jsx(UK,{pattern:C,onClick:()=>a(C)},C.id))}),g.jsx(WK,{pattern:o,open:!!o,onOpenChange:C=>!C&&a(null)})]})}function Wy({className:e,...t}){return g.jsx("textarea",{"data-slot":"textarea",className:Qe("border-input placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 flex field-sizing-content min-h-16 w-full rounded-md border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),...t})}const Cj=["dev-rules","review-guidelines"],cD={active:"default",deprecated:"secondary"},fD={p0:"destructive",p1:"default",p2:"secondary"},VK=e=>Array.from(new Set(e)).sort((t,n)=>t.localeCompare(n));function Uh(e){return e.text||e.title||""}function dD(e){if(e==="error")return"p0";if(e==="warning")return"p1"}function qK({item:e,onClick:t}){const n=e.priority??dD(e.severity)??"p2",r=e.category??"general",i=Uh(e);return g.jsx(nt,{className:"hover:bg-stone-50 dark:hover:bg-stone-800 transition-colors cursor-pointer h-full",onClick:t,children:g.jsxs(rt,{className:"p-3",children:[g.jsx("p",{className:"text-sm font-medium line-clamp-2 mb-2",children:i}),g.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[g.jsx(tt,{variant:fD[n],className:"text-xs",children:n}),g.jsx(tt,{variant:cD[e.status]??"secondary",className:"text-xs",children:e.status}),g.jsx("span",{className:"text-xs text-stone-500 dark:text-stone-400",children:r}),g.jsx("span",{className:"text-xs text-stone-400 dark:text-stone-500",children:e.ruleType})]})]})})}function KK({item:e,open:t,onOpenChange:n,onSave:r}){const{t:i}=Ke("rules"),{t:o}=Ke("common"),[a,s]=y.useState(!1),[u,f]=y.useState(null),[d,h]=y.useState(!1),[m,v]=y.useState(null);if(y.useEffect(()=>{t&&e&&(f({...e}),s(!1),v(null))},[t,e]),!e)return null;const w=e.priority??dD(e.severity)??"p2",b=e.category??"general",S=Uh(e),k=(O,A)=>{f(N=>N&&{...N,[O]:A})},C=async()=>{var A,N;if(!u)return;const O=Uh(u).trim();if(!O){v(i("errors.emptyText"));return}h(!0),v(null);try{const I={...u,category:((A=u.category)==null?void 0:A.trim())||void 0,rationale:((N=u.rationale)==null?void 0:N.trim())||void 0,updatedAt:new Date().toISOString()};u.title!==void 0?I.title=O:I.text=O,await r(I),s(!1),n(!1)}catch{v(i("errors.saveFailed"))}finally{h(!1)}},j=()=>{f({...e}),s(!1),v(null)};return g.jsx(r1,{open:t,onOpenChange:n,children:g.jsxs(Pm,{className:"sm:max-w-2xl max-h-[80vh] overflow-y-auto","aria-describedby":void 0,children:[g.jsxs(i1,{children:[g.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[g.jsx(tt,{variant:fD[w],children:w}),g.jsx(tt,{variant:cD[e.status]??"secondary",children:e.status}),g.jsx("span",{className:"text-xs text-stone-500 dark:text-stone-400",children:e.ruleType})]}),g.jsx(Cm,{className:"text-left",children:a?i("editRule"):S})]}),m&&g.jsx("p",{className:"text-sm text-destructive",children:m}),a&&u?g.jsxs("div",{className:"space-y-4",children:[g.jsxs("div",{children:[g.jsx("span",{className:"text-xs font-medium text-muted-foreground block mb-1",children:i("fields.text")}),g.jsx(Wy,{className:"min-h-[80px]",value:Uh(u),onChange:O=>{u.title!==void 0?k("title",O.target.value):k("text",O.target.value)}})]}),u.description!==void 0&&g.jsxs("div",{children:[g.jsx("span",{className:"text-xs font-medium text-muted-foreground block mb-1",children:i("fields.description")}),g.jsx(Wy,{className:"min-h-[60px]",value:u.description??"",onChange:O=>k("description",O.target.value)})]}),g.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[g.jsxs("div",{children:[g.jsx("span",{className:"text-xs font-medium text-muted-foreground block mb-1",children:i("fields.priority")}),g.jsxs(Ni,{value:u.priority??"p2",onValueChange:O=>k("priority",O),children:[g.jsx(Ti,{children:g.jsx(Ai,{})}),g.jsxs(_i,{children:[g.jsx(vt,{value:"p0",children:"p0 - Critical"}),g.jsx(vt,{value:"p1",children:"p1 - Important"}),g.jsx(vt,{value:"p2",children:"p2 - Normal"})]})]})]}),g.jsxs("div",{children:[g.jsx("span",{className:"text-xs font-medium text-muted-foreground block mb-1",children:i("fields.status")}),g.jsxs(Ni,{value:u.status,onValueChange:O=>k("status",O),children:[g.jsx(Ti,{children:g.jsx(Ai,{})}),g.jsxs(_i,{children:[g.jsx(vt,{value:"active",children:i("status.active")}),g.jsx(vt,{value:"deprecated",children:i("status.deprecated")})]})]})]})]}),g.jsxs("div",{children:[g.jsx("span",{className:"text-xs font-medium text-muted-foreground block mb-1",children:i("fields.category")}),g.jsx(mf,{value:u.category??"",onChange:O=>k("category",O.target.value),placeholder:"general"})]}),g.jsxs("div",{children:[g.jsx("span",{className:"text-xs font-medium text-muted-foreground block mb-1",children:i("fields.rationale")}),g.jsx(Wy,{className:"min-h-[60px]",value:u.rationale??"",onChange:O=>k("rationale",O.target.value)})]})]}):g.jsxs("div",{className:"space-y-4",children:[e.description&&g.jsxs("div",{children:[g.jsx("span",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide",children:i("fields.description")}),g.jsx("p",{className:"text-sm mt-1 whitespace-pre-wrap",children:e.description})]}),g.jsxs("div",{children:[g.jsx("span",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide",children:i("fields.category")}),g.jsx("p",{className:"text-sm mt-1",children:b})]}),(e.rationale||e.check)&&g.jsxs("div",{children:[g.jsx("span",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide",children:e.check?i("fields.check"):i("fields.rationale")}),g.jsx("p",{className:"text-sm mt-1 whitespace-pre-wrap",children:e.rationale||e.check})]}),e.source&&g.jsxs("div",{children:[g.jsx("span",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide",children:i("fields.source")}),g.jsx("p",{className:"text-sm mt-1 text-stone-500",children:e.source})]})]}),g.jsx(YV,{className:"gap-2",children:a?g.jsxs(g.Fragment,{children:[g.jsx(Dr,{variant:"outline",onClick:j,disabled:d,children:o("cancel")}),g.jsx(Dr,{onClick:C,disabled:d,children:o(d?"saving":"save")})]}):g.jsx(Dr,{variant:"outline",onClick:()=>s(!0),children:o("edit")})})]})})}function GK(){const{t:e}=Ke("rules"),{t}=Ke("common"),[n,r]=y.useState([]),[i,o]=y.useState(!0),[a,s]=y.useState(""),[u,f]=y.useState("all"),[d,h]=y.useState("all"),[m,v]=y.useState("all"),[w,b]=y.useState("all"),[S,k]=y.useState(null);y.useEffect(()=>{(async()=>{const $=[];for(const D of Cj){const U=await fetch(`/api/rules/${D}`);if(!U.ok)continue;const L=await U.json();L.ruleType=D,$.push(L)}r($),o(!1)})()},[]);const C=y.useMemo(()=>n.flatMap(T=>T.items.map($=>({...$,ruleType:T.ruleType}))),[n]),j=y.useMemo(()=>VK(C.map(T=>T.category??"general")),[C]),O=y.useMemo(()=>{const T=a.trim().toLowerCase();return C.filter($=>{if(u!=="all"&&$.ruleType!==u||d!=="all"&&$.status!==d)return!1;const D=$.priority??"p2";if(m!=="all"&&D!==m)return!1;const U=$.category??"general";return w!=="all"&&U!==w?!1:T?[$.text,$.title,$.description,$.key,U,$.status,D,$.ruleType].filter(Boolean).join(" ").toLowerCase().includes(T):!0})},[C,a,u,d,m,w]),A=async T=>{const $=T.ruleType;if(!$)throw new Error("Missing rule type");const D=n.find(ne=>ne.ruleType===$);if(!D)throw new Error("Document not found");const{ruleType:U,...L}=T,W={...{...D,items:D.items.map(ne=>ne.id===L.id?L:ne)}};delete W.ruleType;const H=await fetch(`/api/rules/${$}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(W)});if(!H.ok)throw new Error("Failed to save");const X=await H.json();X.ruleType=$,r(ne=>ne.map(B=>B.ruleType===$?X:B)),k({...L,ruleType:$})},N=a.trim().length>0||u!=="all"||d!=="all"||m!=="all"||w!=="all",I=()=>{s(""),f("all"),h("all"),v("all"),b("all")};return g.jsxs("div",{className:"space-y-6",children:[g.jsxs("div",{className:"flex items-center justify-between",children:[g.jsxs("div",{children:[g.jsx("h1",{className:"text-2xl font-bold",children:e("title")}),g.jsx("p",{className:"text-sm text-muted-foreground",children:e("subtitle")})]}),g.jsx("p",{className:"text-sm text-muted-foreground",children:e("count",{filtered:O.length,total:C.length})})]}),C.length===0&&!i&&g.jsx(nt,{className:"border-dashed",children:g.jsxs(rt,{className:"py-6",children:[g.jsx("h3",{className:"font-medium mb-2",children:e("explanation.title")}),g.jsxs("ul",{className:"text-sm text-muted-foreground space-y-1 list-disc list-inside",children:[g.jsxs("li",{children:[g.jsx("strong",{children:"dev-rules"}),": ",e("explanation.devRules")]}),g.jsxs("li",{children:[g.jsx("strong",{children:"review-guidelines"}),":"," ",e("explanation.reviewGuidelines")]})]}),g.jsx("p",{className:"text-sm text-muted-foreground mt-3",children:g.jsx(u2,{i18nKey:"explanation.description",ns:"rules",components:{code:g.jsx("code",{className:"bg-muted px-1 rounded"})}})})]})}),g.jsxs("div",{className:"flex flex-wrap gap-3 items-center",children:[g.jsx(mf,{value:a,onChange:T=>s(T.target.value),placeholder:e("searchPlaceholder"),className:"w-64"}),g.jsxs(Ni,{value:u,onValueChange:T=>f(T),children:[g.jsx(Ti,{className:"w-[180px]",children:g.jsx(Ai,{placeholder:t("allTypes")})}),g.jsxs(_i,{children:[g.jsx(vt,{value:"all",children:t("allTypes")}),Cj.map(T=>g.jsx(vt,{value:T,children:T},T))]})]}),g.jsxs(Ni,{value:d,onValueChange:T=>h(T),children:[g.jsx(Ti,{className:"w-[180px]",children:g.jsx(Ai,{placeholder:t("allStatus")})}),g.jsxs(_i,{children:[g.jsx(vt,{value:"all",children:t("allStatus")}),g.jsx(vt,{value:"active",children:e("status.active")}),g.jsx(vt,{value:"deprecated",children:e("status.deprecated")})]})]}),g.jsxs(Ni,{value:m,onValueChange:T=>v(T),children:[g.jsx(Ti,{className:"w-[180px]",children:g.jsx(Ai,{placeholder:e("allPriority")})}),g.jsxs(_i,{children:[g.jsx(vt,{value:"all",children:e("allPriority")}),g.jsx(vt,{value:"p0",children:"p0"}),g.jsx(vt,{value:"p1",children:"p1"}),g.jsx(vt,{value:"p2",children:"p2"})]})]}),g.jsxs(Ni,{value:w,onValueChange:b,children:[g.jsx(Ti,{className:"w-[180px]",children:g.jsx(Ai,{placeholder:e("allCategories")})}),g.jsxs(_i,{children:[g.jsx(vt,{value:"all",children:e("allCategories")}),j.map(T=>g.jsx(vt,{value:T,children:T},T))]})]}),N&&g.jsx(Dr,{variant:"outline",size:"sm",onClick:I,children:t("reset")})]}),i?g.jsx("div",{className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4",children:[0,1,2,3,4,5].map(T=>g.jsx(nt,{children:g.jsxs(rt,{className:"p-3",children:[g.jsx("div",{className:"h-4 bg-stone-200 dark:bg-stone-700 rounded w-full mb-2 animate-pulse"}),g.jsx("div",{className:"h-3 bg-stone-200 dark:bg-stone-700 rounded w-24 animate-pulse"})]})},T))}):O.length===0?g.jsx(nt,{children:g.jsx(rt,{className:"py-10 text-center text-muted-foreground",children:C.length===0?e("noRules"):e("noMatchingFilters")})}):g.jsx("div",{className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4",children:O.map(T=>g.jsx(qK,{item:T,onClick:()=>k(T)},T.id))}),g.jsx(KK,{item:S,open:!!S,onOpenChange:T=>!T&&k(null),onSave:A})]})}function YK(){return g.jsxs(nt,{children:[g.jsx(tr,{className:"pb-2",children:g.jsxs("div",{className:"flex items-start justify-between",children:[g.jsx(et,{className:"h-5 w-48"}),g.jsx(et,{className:"h-8 w-8"})]})}),g.jsxs(rt,{children:[g.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[g.jsx(et,{className:"h-4 w-20"}),g.jsx(et,{className:"h-4 w-24"}),g.jsx(et,{className:"h-4 w-16"})]}),g.jsx(et,{className:"h-4 w-full mb-2"}),g.jsxs("div",{className:"flex flex-wrap gap-1",children:[g.jsx(et,{className:"h-5 w-16"}),g.jsx(et,{className:"h-5 w-20"}),g.jsx(et,{className:"h-5 w-14"})]})]})]})}function QK({count:e=5}){return g.jsx("div",{className:"grid gap-4",children:Array.from({length:e}).map((t,n)=>g.jsx(YK,{},n))})}function XK(e={}){const{page:t=1,limit:n=20,tag:r,type:i,project:o,search:a,paginate:s=!0}=e;return Di({queryKey:["sessions",{page:t,limit:n,tag:r,type:i,project:o,search:a,paginate:s}],queryFn:()=>s?aW({page:t,limit:n,tag:r,type:i,project:o,search:a}):oW().then(u=>({data:u,pagination:{page:1,limit:u.length,total:u.length,totalPages:1,hasNext:!1,hasPrev:!1}}))})}function ZK(){return Di({queryKey:["tags"],queryFn:E2,staleTime:1e3*60*5})}function JK(){const e=II();return t=>(t&&e.setQueriesData({queryKey:["sessions"]},n=>n!=null&&n.data?{...n,data:n.data.filter(r=>r.id!==t),pagination:n.pagination?{...n.pagination,total:Math.max(0,n.pagination.total-1)}:void 0}:n),e.invalidateQueries({queryKey:["sessions"]}))}const e7=["decision","implementation","research","exploration","discussion","debug","review"];function t7({session:e,tags:t}){var a;const{t:n,i18n:r}=Ke("sessions"),i=new Date(e.createdAt).toLocaleDateString(r.language==="ja"?"ja-JP":"en-US"),o=s=>{const u=t.find(f=>f.id===s);return(u==null?void 0:u.color)||"#6B7280"};return g.jsx(Mi,{to:`/sessions/${e.id}`,children:g.jsx(nt,{className:"hover:bg-stone-50 dark:hover:bg-stone-800 transition-colors cursor-pointer h-full",children:g.jsxs(rt,{className:"p-3",children:[g.jsxs("div",{className:"flex items-start justify-between gap-2 mb-1",children:[g.jsx(nr,{className:"text-sm font-medium text-stone-800 dark:text-stone-100 line-clamp-2",children:e.title||n("untitled")}),e.sessionType&&g.jsx(tt,{variant:"outline",className:"text-xs font-normal shrink-0",children:n(`types.${e.sessionType}`)})]}),g.jsxs("div",{className:"flex items-center gap-1.5 flex-wrap text-xs text-stone-500 dark:text-stone-400 mb-2",children:[g.jsx("span",{children:i}),((a=e.context)==null?void 0:a.branch)&&g.jsxs(g.Fragment,{children:[g.jsx("span",{children:"·"}),g.jsx("span",{className:"font-mono bg-stone-100 dark:bg-stone-800 px-1 py-0.5 rounded text-xs",children:e.context.branch})]})]}),e.tags&&e.tags.length>0&&g.jsxs("div",{className:"flex flex-wrap gap-1",children:[e.tags.slice(0,4).map(s=>g.jsx(tt,{variant:"secondary",className:"text-xs px-1.5 py-0",style:{backgroundColor:`${o(s)}20`,color:o(s),borderColor:o(s)},children:s},s)),e.tags.length>4&&g.jsxs(tt,{variant:"outline",className:"text-xs px-1.5 py-0",children:["+",e.tags.length-4]})]})]})})})}function n7(){const{t:e}=Ke("sessions"),{t}=Ke("common"),[n,r]=y.useState(1),[i,o]=y.useState(""),[a,s]=y.useState("all"),[u,f]=y.useState("all"),[d,h]=y.useState("");y.useMemo(()=>{const A=setTimeout(()=>{h(i),r(1)},300);return()=>clearTimeout(A)},[i]);const{data:m,isLoading:v,error:w}=XK({page:n,limit:20,tag:a!=="all"?a:void 0,type:u!=="all"?u:void 0,search:d||void 0}),{data:b}=ZK(),S=(b==null?void 0:b.tags)||[],k=y.useMemo(()=>{if(!S.length)return{};const A=new Set;for(const I of(m==null?void 0:m.data)||[])for(const T of I.tags||[])A.add(T);const N={};for(const I of S){if(!A.has(I.id))continue;const T=I.category||"other";N[T]||(N[T]=[]),N[T].push(I)}for(const I of Object.keys(N))N[I].sort((T,$)=>T.label.localeCompare($.label));return N},[S,m==null?void 0:m.data]),C=["domain","phase","feature","ui","architecture","infra","cloud","data","ai","quality","workflow"];if(v)return g.jsxs("div",{className:"space-y-6",children:[g.jsx("div",{className:"flex items-center justify-between",children:g.jsx("h1",{className:"text-2xl font-bold",children:e("title")})}),g.jsx(QK,{count:5})]});if(w)return g.jsx("div",{className:"text-center py-12 text-destructive",children:e("errors:failedToLoad.sessions")});const j=(m==null?void 0:m.data)||[],O=m==null?void 0:m.pagination;return g.jsxs("div",{className:"space-y-6",children:[g.jsxs("div",{className:"flex items-center justify-between",children:[g.jsxs("div",{children:[g.jsx("h1",{className:"text-2xl font-bold",children:e("title")}),g.jsx("p",{className:"text-sm text-muted-foreground",children:e("subtitle")})]}),g.jsx("p",{className:"text-sm text-muted-foreground",children:e("sessionCount",{count:(O==null?void 0:O.total)||0})})]}),((O==null?void 0:O.total)||0)===0&&!d&&a==="all"&&u==="all"?g.jsxs("div",{className:"text-center py-12 text-muted-foreground",children:[g.jsx("p",{children:e("noSessionsFound")}),g.jsx("p",{className:"text-sm mt-2",children:e("noSessionsDescription")})]}):g.jsxs(g.Fragment,{children:[g.jsxs("div",{className:"flex gap-4 items-center flex-wrap",children:[g.jsx(mf,{placeholder:e("searchPlaceholder"),value:i,onChange:A=>o(A.target.value),className:"max-w-xs"}),g.jsxs(Ni,{value:u,onValueChange:A=>{f(A),r(1)},children:[g.jsx(Ti,{className:"w-[180px]",children:g.jsx(Ai,{placeholder:t("allTypes")})}),g.jsxs(_i,{children:[g.jsx(vt,{value:"all",children:t("allTypes")}),e7.map(A=>g.jsx(vt,{value:A,children:e(`types.${A}`)},A))]})]}),g.jsxs(Ni,{value:a,onValueChange:A=>{s(A),r(1)},children:[g.jsx(Ti,{className:"w-[180px]",children:g.jsx(Ai,{placeholder:t("allTags")})}),g.jsxs(_i,{children:[g.jsx(vt,{value:"all",children:t("allTags")}),C.filter(A=>{var N;return((N=k[A])==null?void 0:N.length)>0}).map((A,N)=>g.jsxs(gK,{children:[N>0&&g.jsx(yK,{}),g.jsx(vK,{children:t(`tagCategories.${A}`)}),k[A].map(I=>g.jsxs(vt,{value:I.id,children:[g.jsx("span",{className:"inline-block w-2 h-2 rounded-full mr-2",style:{backgroundColor:I.color}}),I.label]},I.id))]},A))]})]})]}),j.length===0?g.jsx("div",{className:"text-center py-12 text-muted-foreground",children:g.jsx("p",{children:e("noMatchingFilters")})}):g.jsxs(g.Fragment,{children:[g.jsx("div",{className:"grid gap-3 sm:grid-cols-2 md:grid-cols-3",children:j.map(A=>g.jsx(t7,{session:A,tags:S},A.id))}),O&&g.jsx(cR,{page:O.page,totalPages:O.totalPages,hasNext:O.hasNext,hasPrev:O.hasPrev,onPageChange:r})]})]})]})}function r7(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const i7=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,o7=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,a7={};function Ej(e,t){return(a7.jsx?o7:i7).test(e)}const s7=/[ \t\n\f\r]/g;function l7(e){return typeof e=="object"?e.type==="text"?jj(e.value):!1:jj(e)}function jj(e){return e.replace(s7,"")===""}class yf{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}yf.prototype.normal={};yf.prototype.property={};yf.prototype.space=void 0;function hD(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new yf(n,r,t)}function bb(e){return e.toLowerCase()}class rr{constructor(t,n){this.attribute=n,this.property=t}}rr.prototype.attribute="";rr.prototype.booleanish=!1;rr.prototype.boolean=!1;rr.prototype.commaOrSpaceSeparated=!1;rr.prototype.commaSeparated=!1;rr.prototype.defined=!1;rr.prototype.mustUseProperty=!1;rr.prototype.number=!1;rr.prototype.overloadedBoolean=!1;rr.prototype.property="";rr.prototype.spaceSeparated=!1;rr.prototype.space=void 0;let u7=0;const $e=Ms(),Bt=Ms(),wb=Ms(),fe=Ms(),mt=Ms(),Nl=Ms(),cr=Ms();function Ms(){return 2**++u7}const Sb=Object.freeze(Object.defineProperty({__proto__:null,boolean:$e,booleanish:Bt,commaOrSpaceSeparated:cr,commaSeparated:Nl,number:fe,overloadedBoolean:wb,spaceSeparated:mt},Symbol.toStringTag,{value:"Module"})),Hy=Object.keys(Sb);class g1 extends rr{constructor(t,n,r,i){let o=-1;if(super(t,n),Oj(this,"space",i),typeof r=="number")for(;++o<Hy.length;){const a=Hy[o];Oj(this,Hy[o],(r&Sb[a])===Sb[a])}}}g1.prototype.defined=!0;function Oj(e,t,n){n&&(e[t]=n)}function fu(e){const t={},n={};for(const[r,i]of Object.entries(e.properties)){const o=new g1(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(o.mustUseProperty=!0),t[r]=o,n[bb(r)]=r,n[bb(o.attribute)]=r}return new yf(t,n,e.space)}const pD=fu({properties:{ariaActiveDescendant:null,ariaAtomic:Bt,ariaAutoComplete:null,ariaBusy:Bt,ariaChecked:Bt,ariaColCount:fe,ariaColIndex:fe,ariaColSpan:fe,ariaControls:mt,ariaCurrent:null,ariaDescribedBy:mt,ariaDetails:null,ariaDisabled:Bt,ariaDropEffect:mt,ariaErrorMessage:null,ariaExpanded:Bt,ariaFlowTo:mt,ariaGrabbed:Bt,ariaHasPopup:null,ariaHidden:Bt,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:mt,ariaLevel:fe,ariaLive:null,ariaModal:Bt,ariaMultiLine:Bt,ariaMultiSelectable:Bt,ariaOrientation:null,ariaOwns:mt,ariaPlaceholder:null,ariaPosInSet:fe,ariaPressed:Bt,ariaReadOnly:Bt,ariaRelevant:null,ariaRequired:Bt,ariaRoleDescription:mt,ariaRowCount:fe,ariaRowIndex:fe,ariaRowSpan:fe,ariaSelected:Bt,ariaSetSize:fe,ariaSort:null,ariaValueMax:fe,ariaValueMin:fe,ariaValueNow:fe,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function mD(e,t){return t in e?e[t]:t}function gD(e,t){return mD(e,t.toLowerCase())}const c7=fu({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Nl,acceptCharset:mt,accessKey:mt,action:null,allow:null,allowFullScreen:$e,allowPaymentRequest:$e,allowUserMedia:$e,alt:null,as:null,async:$e,autoCapitalize:null,autoComplete:mt,autoFocus:$e,autoPlay:$e,blocking:mt,capture:null,charSet:null,checked:$e,cite:null,className:mt,cols:fe,colSpan:null,content:null,contentEditable:Bt,controls:$e,controlsList:mt,coords:fe|Nl,crossOrigin:null,data:null,dateTime:null,decoding:null,default:$e,defer:$e,dir:null,dirName:null,disabled:$e,download:wb,draggable:Bt,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:$e,formTarget:null,headers:mt,height:fe,hidden:wb,high:fe,href:null,hrefLang:null,htmlFor:mt,httpEquiv:mt,id:null,imageSizes:null,imageSrcSet:null,inert:$e,inputMode:null,integrity:null,is:null,isMap:$e,itemId:null,itemProp:mt,itemRef:mt,itemScope:$e,itemType:mt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:$e,low:fe,manifest:null,max:null,maxLength:fe,media:null,method:null,min:null,minLength:fe,multiple:$e,muted:$e,name:null,nonce:null,noModule:$e,noValidate:$e,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:$e,optimum:fe,pattern:null,ping:mt,placeholder:null,playsInline:$e,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:$e,referrerPolicy:null,rel:mt,required:$e,reversed:$e,rows:fe,rowSpan:fe,sandbox:mt,scope:null,scoped:$e,seamless:$e,selected:$e,shadowRootClonable:$e,shadowRootDelegatesFocus:$e,shadowRootMode:null,shape:null,size:fe,sizes:null,slot:null,span:fe,spellCheck:Bt,src:null,srcDoc:null,srcLang:null,srcSet:null,start:fe,step:null,style:null,tabIndex:fe,target:null,title:null,translate:null,type:null,typeMustMatch:$e,useMap:null,value:Bt,width:fe,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:mt,axis:null,background:null,bgColor:null,border:fe,borderColor:null,bottomMargin:fe,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:$e,declare:$e,event:null,face:null,frame:null,frameBorder:null,hSpace:fe,leftMargin:fe,link:null,longDesc:null,lowSrc:null,marginHeight:fe,marginWidth:fe,noResize:$e,noHref:$e,noShade:$e,noWrap:$e,object:null,profile:null,prompt:null,rev:null,rightMargin:fe,rules:null,scheme:null,scrolling:Bt,standby:null,summary:null,text:null,topMargin:fe,valueType:null,version:null,vAlign:null,vLink:null,vSpace:fe,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:$e,disableRemotePlayback:$e,prefix:null,property:null,results:fe,security:null,unselectable:null},space:"html",transform:gD}),f7=fu({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:cr,accentHeight:fe,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:fe,amplitude:fe,arabicForm:null,ascent:fe,attributeName:null,attributeType:null,azimuth:fe,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:fe,by:null,calcMode:null,capHeight:fe,className:mt,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:fe,diffuseConstant:fe,direction:null,display:null,dur:null,divisor:fe,dominantBaseline:null,download:$e,dx:null,dy:null,edgeMode:null,editable:null,elevation:fe,enableBackground:null,end:null,event:null,exponent:fe,externalResourcesRequired:null,fill:null,fillOpacity:fe,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Nl,g2:Nl,glyphName:Nl,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:fe,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:fe,horizOriginX:fe,horizOriginY:fe,id:null,ideographic:fe,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:fe,k:fe,k1:fe,k2:fe,k3:fe,k4:fe,kernelMatrix:cr,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:fe,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:fe,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:fe,overlineThickness:fe,paintOrder:null,panose1:null,path:null,pathLength:fe,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:mt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:fe,pointsAtY:fe,pointsAtZ:fe,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:cr,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:cr,rev:cr,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:cr,requiredFeatures:cr,requiredFonts:cr,requiredFormats:cr,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:fe,specularExponent:fe,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:fe,strikethroughThickness:fe,string:null,stroke:null,strokeDashArray:cr,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:fe,strokeOpacity:fe,strokeWidth:null,style:null,surfaceScale:fe,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:cr,tabIndex:fe,tableValues:null,target:null,targetX:fe,targetY:fe,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:cr,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:fe,underlineThickness:fe,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:fe,values:null,vAlphabetic:fe,vMathematical:fe,vectorEffect:null,vHanging:fe,vIdeographic:fe,version:null,vertAdvY:fe,vertOriginX:fe,vertOriginY:fe,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:fe,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:mD}),vD=fu({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),yD=fu({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:gD}),xD=fu({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),d7={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},h7=/[A-Z]/g,Nj=/-[a-z]/g,p7=/^data[-\w.:]+$/i;function m7(e,t){const n=bb(t);let r=t,i=rr;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&p7.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(Nj,v7);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!Nj.test(o)){let a=o.replace(h7,g7);a.charAt(0)!=="-"&&(a="-"+a),t="data"+a}}i=g1}return new i(r,t)}function g7(e){return"-"+e.toLowerCase()}function v7(e){return e.charAt(1).toUpperCase()}const y7=hD([pD,c7,vD,yD,xD],"html"),v1=hD([pD,f7,vD,yD,xD],"svg");function x7(e){return e.join(" ").trim()}var gl={},Vy,Aj;function b7(){if(Aj)return Vy;Aj=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,o=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,a=/^[;\s]*/,s=/^\s+|\s+$/g,u=`
|
|
244
244
|
`,f="/",d="*",h="",m="comment",v="declaration";function w(S,k){if(typeof S!="string")throw new TypeError("First argument must be a string");if(!S)return[];k=k||{};var C=1,j=1;function O(W){var H=W.match(t);H&&(C+=H.length);var X=W.lastIndexOf(u);j=~X?W.length-X:j+W.length}function A(){var W={line:C,column:j};return function(H){return H.position=new N(W),$(),H}}function N(W){this.start=W,this.end={line:C,column:j},this.source=k.source}N.prototype.content=S;function I(W){var H=new Error(k.source+":"+C+":"+j+": "+W);if(H.reason=W,H.filename=k.source,H.line=C,H.column=j,H.source=S,!k.silent)throw H}function T(W){var H=W.exec(S);if(H){var X=H[0];return O(X),S=S.slice(X.length),H}}function $(){T(n)}function D(W){var H;for(W=W||[];H=U();)H!==!1&&W.push(H);return W}function U(){var W=A();if(!(f!=S.charAt(0)||d!=S.charAt(1))){for(var H=2;h!=S.charAt(H)&&(d!=S.charAt(H)||f!=S.charAt(H+1));)++H;if(H+=2,h===S.charAt(H-1))return I("End of comment missing");var X=S.slice(2,H-2);return j+=2,O(X),S=S.slice(H),j+=2,W({type:m,comment:X})}}function L(){var W=A(),H=T(r);if(H){if(U(),!T(i))return I("property missing ':'");var X=T(o),ne=W({type:v,property:b(H[0].replace(e,h)),value:X?b(X[0].replace(e,h)):h});return T(a),ne}}function q(){var W=[];D(W);for(var H;H=L();)H!==!1&&(W.push(H),D(W));return W}return $(),q()}function b(S){return S?S.replace(s,h):h}return Vy=w,Vy}var Tj;function w7(){if(Tj)return gl;Tj=1;var e=gl&&gl.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(gl,"__esModule",{value:!0}),gl.default=n;const t=e(b7());function n(r,i){let o=null;if(!r||typeof r!="string")return o;const a=(0,t.default)(r),s=typeof i=="function";return a.forEach(u=>{if(u.type!=="declaration")return;const{property:f,value:d}=u;s?i(f,d,u):d&&(o=o||{},o[f]=d)}),o}return gl}var cc={},_j;function S7(){if(_j)return cc;_j=1,Object.defineProperty(cc,"__esModule",{value:!0}),cc.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,i=/^-(ms)-/,o=function(f){return!f||n.test(f)||e.test(f)},a=function(f,d){return d.toUpperCase()},s=function(f,d){return"".concat(d,"-")},u=function(f,d){return d===void 0&&(d={}),o(f)?f:(f=f.toLowerCase(),d.reactCompat?f=f.replace(i,s):f=f.replace(r,s),f.replace(t,a))};return cc.camelCase=u,cc}var fc,Ij;function k7(){if(Ij)return fc;Ij=1;var e=fc&&fc.__importDefault||function(i){return i&&i.__esModule?i:{default:i}},t=e(w7()),n=S7();function r(i,o){var a={};return!i||typeof i!="string"||(0,t.default)(i,function(s,u){s&&u&&(a[(0,n.camelCase)(s,o)]=u)}),a}return r.default=r,fc=r,fc}var P7=k7();const C7=yr(P7),bD=wD("end"),y1=wD("start");function wD(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function E7(e){const t=y1(e),n=bD(e);if(t&&n)return{start:t,end:n}}function Ac(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Rj(e.position):"start"in e||"end"in e?Rj(e):"line"in e||"column"in e?kb(e):""}function kb(e){return Dj(e&&e.line)+":"+Dj(e&&e.column)}function Rj(e){return kb(e&&e.start)+"-"+kb(e&&e.end)}function Dj(e){return e&&typeof e=="number"?e:1}class On extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",o={},a=!1;if(n&&("line"in n&&"column"in n?o={place:n}:"start"in n&&"end"in n?o={place:n}:"type"in n?o={ancestors:[n],place:n.position}:o={...n}),typeof t=="string"?i=t:!o.cause&&t&&(a=!0,i=t.message,o.cause=t),!o.ruleId&&!o.source&&typeof r=="string"){const u=r.indexOf(":");u===-1?o.ruleId=r:(o.source=r.slice(0,u),o.ruleId=r.slice(u+1))}if(!o.place&&o.ancestors&&o.ancestors){const u=o.ancestors[o.ancestors.length-1];u&&(o.place=u.position)}const s=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=s?s.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=s?s.line:void 0,this.name=Ac(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=a&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}On.prototype.file="";On.prototype.name="";On.prototype.reason="";On.prototype.message="";On.prototype.stack="";On.prototype.column=void 0;On.prototype.line=void 0;On.prototype.ancestors=void 0;On.prototype.cause=void 0;On.prototype.fatal=void 0;On.prototype.place=void 0;On.prototype.ruleId=void 0;On.prototype.source=void 0;const x1={}.hasOwnProperty,j7=new Map,O7=/[A-Z]/g,N7=new Set(["table","tbody","thead","tfoot","tr"]),A7=new Set(["td","th"]),SD="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function T7(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=F7(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=$7(n,t.jsx,t.jsxs)}const i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?v1:y7,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},o=kD(i,e,void 0);return o&&typeof o!="string"?o:i.create(e,i.Fragment,{children:o||void 0},void 0)}function kD(e,t,n){if(t.type==="element")return _7(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return I7(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return D7(e,t,n);if(t.type==="mdxjsEsm")return R7(e,t);if(t.type==="root")return M7(e,t,n);if(t.type==="text")return L7(e,t)}function _7(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=v1,e.schema=i),e.ancestors.push(t);const o=CD(e,t.tagName,!1),a=z7(e,t);let s=w1(e,t);return N7.has(t.tagName)&&(s=s.filter(function(u){return typeof u=="string"?!l7(u):!0})),PD(e,a,o,t),b1(a,s),e.ancestors.pop(),e.schema=r,e.create(t,o,a,n)}function I7(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}Uc(e,t.position)}function R7(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Uc(e,t.position)}function D7(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=v1,e.schema=i),e.ancestors.push(t);const o=t.name===null?e.Fragment:CD(e,t.name,!0),a=B7(e,t),s=w1(e,t);return PD(e,a,o,t),b1(a,s),e.ancestors.pop(),e.schema=r,e.create(t,o,a,n)}function M7(e,t,n){const r={};return b1(r,w1(e,t)),e.create(t,e.Fragment,r,n)}function L7(e,t){return t.value}function PD(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function b1(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function $7(e,t,n){return r;function r(i,o,a,s){const f=Array.isArray(a.children)?n:t;return s?f(o,a,s):f(o,a)}}function F7(e,t){return n;function n(r,i,o,a){const s=Array.isArray(o.children),u=y1(r);return t(i,o,a,s,{columnNumber:u?u.column-1:void 0,fileName:e,lineNumber:u?u.line:void 0},void 0)}}function z7(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&x1.call(t.properties,i)){const o=U7(e,i,t.properties[i]);if(o){const[a,s]=o;e.tableCellAlignToStyle&&a==="align"&&typeof s=="string"&&A7.has(t.tagName)?r=s:n[a]=s}}if(r){const o=n.style||(n.style={});o[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function B7(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const o=r.data.estree.body[0];o.type;const a=o.expression;a.type;const s=a.properties[0];s.type,Object.assign(n,e.evaluater.evaluateExpression(s.argument))}else Uc(e,t.position);else{const i=r.name;let o;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const s=r.value.data.estree.body[0];s.type,o=e.evaluater.evaluateExpression(s.expression)}else Uc(e,t.position);else o=r.value===null?!0:r.value;n[i]=o}return n}function w1(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:j7;for(;++r<t.children.length;){const o=t.children[r];let a;if(e.passKeys){const u=o.type==="element"?o.tagName:o.type==="mdxJsxFlowElement"||o.type==="mdxJsxTextElement"?o.name:void 0;if(u){const f=i.get(u)||0;a=u+"-"+f,i.set(u,f+1)}}const s=kD(e,o,a);s!==void 0&&n.push(s)}return n}function U7(e,t,n){const r=m7(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?r7(n):x7(n)),r.property==="style"){let i=typeof n=="object"?n:W7(e,String(n));return e.stylePropertyNameCase==="css"&&(i=H7(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?d7[r.property]||r.property:r.attribute,n]}}function W7(e,t){try{return C7(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,i=new On("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw i.file=e.filePath||void 0,i.url=SD+"#cannot-parse-style-attribute",i}}function CD(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const i=t.split(".");let o=-1,a;for(;++o<i.length;){const s=Ej(i[o])?{type:"Identifier",name:i[o]}:{type:"Literal",value:i[o]};a=a?{type:"MemberExpression",object:a,property:s,computed:!!(o&&s.type==="Literal"),optional:!1}:s}r=a}else r=Ej(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const i=r.value;return x1.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);Uc(e)}function Uc(e,t){const n=new On("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=SD+"#cannot-handle-mdx-estrees-without-createevaluater",n}function H7(e){const t={};let n;for(n in e)x1.call(e,n)&&(t[V7(n)]=e[n]);return t}function V7(e){let t=e.replace(O7,q7);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function q7(e){return"-"+e.toLowerCase()}const qy={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},K7={};function S1(e,t){const n=K7,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return ED(e,r,i)}function ED(e,t,n){if(G7(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return Mj(e.children,t,n)}return Array.isArray(e)?Mj(e,t,n):""}function Mj(e,t,n){const r=[];let i=-1;for(;++i<e.length;)r[i]=ED(e[i],t,n);return r.join("")}function G7(e){return!!(e&&typeof e=="object")}const Lj=document.createElement("i");function k1(e){const t="&"+e+";";Lj.innerHTML=t;const n=Lj.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function mr(e,t,n,r){const i=e.length;let o=0,a;if(t<0?t=-t>i?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)a=Array.from(r),a.unshift(t,n),e.splice(...a);else for(n&&e.splice(t,n);o<r.length;)a=r.slice(o,o+1e4),a.unshift(t,0),e.splice(...a),o+=1e4,t+=1e4}function Ir(e,t){return e.length>0?(mr(e,e.length,0,t),e):t}const $j={}.hasOwnProperty;function jD(e){const t={};let n=-1;for(;++n<e.length;)Y7(t,e[n]);return t}function Y7(e,t){let n;for(n in t){const i=($j.call(e,n)?e[n]:void 0)||(e[n]={}),o=t[n];let a;if(o)for(a in o){$j.call(i,a)||(i[a]=[]);const s=o[a];Q7(i[a],Array.isArray(s)?s:s?[s]:[])}}}function Q7(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);mr(e,0,0,r)}function OD(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function ti(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Dn=Ia(/[A-Za-z]/),En=Ia(/[\dA-Za-z]/),X7=Ia(/[#-'*+\--9=?A-Z^-~]/);function mp(e){return e!==null&&(e<32||e===127)}const Pb=Ia(/\d/),Z7=Ia(/[\dA-Fa-f]/),J7=Ia(/[!-/:-@[-`{-~]/);function _e(e){return e!==null&&e<-2}function ht(e){return e!==null&&(e<0||e===32)}function We(e){return e===-2||e===-1||e===32}const Im=Ia(new RegExp("\\p{P}|\\p{S}","u")),js=Ia(/\s/);function Ia(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function du(e){const t=[];let n=-1,r=0,i=0;for(;++n<e.length;){const o=e.charCodeAt(n);let a="";if(o===37&&En(e.charCodeAt(n+1))&&En(e.charCodeAt(n+2)))i=2;else if(o<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(o))||(a=String.fromCharCode(o));else if(o>55295&&o<57344){const s=e.charCodeAt(n+1);o<56320&&s>56319&&s<57344?(a=String.fromCharCode(o,s),i=1):a="�"}else a=String.fromCharCode(o);a&&(t.push(e.slice(r,n),encodeURIComponent(a)),r=n+i+1,a=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function Ye(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let o=0;return a;function a(u){return We(u)?(e.enter(n),s(u)):t(u)}function s(u){return We(u)&&o++<i?(e.consume(u),s):(e.exit(n),t(u))}}const eG={tokenize:tG};function tG(e){const t=e.attempt(this.parser.constructs.contentInitial,r,i);let n;return t;function r(s){if(s===null){e.consume(s);return}return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),Ye(e,t,"linePrefix")}function i(s){return e.enter("paragraph"),o(s)}function o(s){const u=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=u),n=u,a(s)}function a(s){if(s===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(s);return}return _e(s)?(e.consume(s),e.exit("chunkText"),o):(e.consume(s),a)}}const nG={tokenize:rG},Fj={tokenize:iG};function rG(e){const t=this,n=[];let r=0,i,o,a;return s;function s(j){if(r<n.length){const O=n[r];return t.containerState=O[1],e.attempt(O[0].continuation,u,f)(j)}return f(j)}function u(j){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&C();const O=t.events.length;let A=O,N;for(;A--;)if(t.events[A][0]==="exit"&&t.events[A][1].type==="chunkFlow"){N=t.events[A][1].end;break}k(r);let I=O;for(;I<t.events.length;)t.events[I][1].end={...N},I++;return mr(t.events,A+1,0,t.events.slice(O)),t.events.length=I,f(j)}return s(j)}function f(j){if(r===n.length){if(!i)return m(j);if(i.currentConstruct&&i.currentConstruct.concrete)return w(j);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(Fj,d,h)(j)}function d(j){return i&&C(),k(r),m(j)}function h(j){return t.parser.lazy[t.now().line]=r!==n.length,a=t.now().offset,w(j)}function m(j){return t.containerState={},e.attempt(Fj,v,w)(j)}function v(j){return r++,n.push([t.currentConstruct,t.containerState]),m(j)}function w(j){if(j===null){i&&C(),k(0),e.consume(j);return}return i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:o}),b(j)}function b(j){if(j===null){S(e.exit("chunkFlow"),!0),k(0),e.consume(j);return}return _e(j)?(e.consume(j),S(e.exit("chunkFlow")),r=0,t.interrupt=void 0,s):(e.consume(j),b)}function S(j,O){const A=t.sliceStream(j);if(O&&A.push(null),j.previous=o,o&&(o.next=j),o=j,i.defineSkip(j.start),i.write(A),t.parser.lazy[j.start.line]){let N=i.events.length;for(;N--;)if(i.events[N][1].start.offset<a&&(!i.events[N][1].end||i.events[N][1].end.offset>a))return;const I=t.events.length;let T=I,$,D;for(;T--;)if(t.events[T][0]==="exit"&&t.events[T][1].type==="chunkFlow"){if($){D=t.events[T][1].end;break}$=!0}for(k(r),N=I;N<t.events.length;)t.events[N][1].end={...D},N++;mr(t.events,T+1,0,t.events.slice(I)),t.events.length=N}}function k(j){let O=n.length;for(;O-- >j;){const A=n[O];t.containerState=A[1],A[0].exit.call(t,e)}n.length=j}function C(){i.write([null]),o=void 0,i=void 0,t.containerState._closeFlow=void 0}}function iG(e,t,n){return Ye(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Vl(e){if(e===null||ht(e)||js(e))return 1;if(Im(e))return 2}function Rm(e,t,n){const r=[];let i=-1;for(;++i<e.length;){const o=e[i].resolveAll;o&&!r.includes(o)&&(t=o(t,n),r.push(o))}return t}const Cb={name:"attention",resolveAll:oG,tokenize:aG};function oG(e,t){let n=-1,r,i,o,a,s,u,f,d;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;u=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const h={...e[r][1].end},m={...e[n][1].start};zj(h,-u),zj(m,u),a={type:u>1?"strongSequence":"emphasisSequence",start:h,end:{...e[r][1].end}},s={type:u>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:m},o={type:u>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},i={type:u>1?"strong":"emphasis",start:{...a.start},end:{...s.end}},e[r][1].end={...a.start},e[n][1].start={...s.end},f=[],e[r][1].end.offset-e[r][1].start.offset&&(f=Ir(f,[["enter",e[r][1],t],["exit",e[r][1],t]])),f=Ir(f,[["enter",i,t],["enter",a,t],["exit",a,t],["enter",o,t]]),f=Ir(f,Rm(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),f=Ir(f,[["exit",o,t],["enter",s,t],["exit",s,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(d=2,f=Ir(f,[["enter",e[n][1],t],["exit",e[n][1],t]])):d=0,mr(e,r-1,n-r+3,f),n=r+f.length-d-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function aG(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=Vl(r);let o;return a;function a(u){return o=u,e.enter("attentionSequence"),s(u)}function s(u){if(u===o)return e.consume(u),s;const f=e.exit("attentionSequence"),d=Vl(u),h=!d||d===2&&i||n.includes(u),m=!i||i===2&&d||n.includes(r);return f._open=!!(o===42?h:h&&(i||!m)),f._close=!!(o===42?m:m&&(d||!h)),t(u)}}function zj(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const sG={name:"autolink",tokenize:lG};function lG(e,t,n){let r=0;return i;function i(v){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(v),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),o}function o(v){return Dn(v)?(e.consume(v),a):v===64?n(v):f(v)}function a(v){return v===43||v===45||v===46||En(v)?(r=1,s(v)):f(v)}function s(v){return v===58?(e.consume(v),r=0,u):(v===43||v===45||v===46||En(v))&&r++<32?(e.consume(v),s):(r=0,f(v))}function u(v){return v===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(v),e.exit("autolinkMarker"),e.exit("autolink"),t):v===null||v===32||v===60||mp(v)?n(v):(e.consume(v),u)}function f(v){return v===64?(e.consume(v),d):X7(v)?(e.consume(v),f):n(v)}function d(v){return En(v)?h(v):n(v)}function h(v){return v===46?(e.consume(v),r=0,d):v===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(v),e.exit("autolinkMarker"),e.exit("autolink"),t):m(v)}function m(v){if((v===45||En(v))&&r++<63){const w=v===45?m:h;return e.consume(v),w}return n(v)}}const xf={partial:!0,tokenize:uG};function uG(e,t,n){return r;function r(o){return We(o)?Ye(e,i,"linePrefix")(o):i(o)}function i(o){return o===null||_e(o)?t(o):n(o)}}const ND={continuation:{tokenize:fG},exit:dG,name:"blockQuote",tokenize:cG};function cG(e,t,n){const r=this;return i;function i(a){if(a===62){const s=r.containerState;return s.open||(e.enter("blockQuote",{_container:!0}),s.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(a),e.exit("blockQuoteMarker"),o}return n(a)}function o(a){return We(a)?(e.enter("blockQuotePrefixWhitespace"),e.consume(a),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(a))}}function fG(e,t,n){const r=this;return i;function i(a){return We(a)?Ye(e,o,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a):o(a)}function o(a){return e.attempt(ND,t,n)(a)}}function dG(e){e.exit("blockQuote")}const AD={name:"characterEscape",tokenize:hG};function hG(e,t,n){return r;function r(o){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(o),e.exit("escapeMarker"),i}function i(o){return J7(o)?(e.enter("characterEscapeValue"),e.consume(o),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(o)}}const TD={name:"characterReference",tokenize:pG};function pG(e,t,n){const r=this;let i=0,o,a;return s;function s(h){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(h),e.exit("characterReferenceMarker"),u}function u(h){return h===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(h),e.exit("characterReferenceMarkerNumeric"),f):(e.enter("characterReferenceValue"),o=31,a=En,d(h))}function f(h){return h===88||h===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(h),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),o=6,a=Z7,d):(e.enter("characterReferenceValue"),o=7,a=Pb,d(h))}function d(h){if(h===59&&i){const m=e.exit("characterReferenceValue");return a===En&&!k1(r.sliceSerialize(m))?n(h):(e.enter("characterReferenceMarker"),e.consume(h),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return a(h)&&i++<o?(e.consume(h),d):n(h)}}const Bj={partial:!0,tokenize:gG},Uj={concrete:!0,name:"codeFenced",tokenize:mG};function mG(e,t,n){const r=this,i={partial:!0,tokenize:A};let o=0,a=0,s;return u;function u(N){return f(N)}function f(N){const I=r.events[r.events.length-1];return o=I&&I[1].type==="linePrefix"?I[2].sliceSerialize(I[1],!0).length:0,s=N,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),d(N)}function d(N){return N===s?(a++,e.consume(N),d):a<3?n(N):(e.exit("codeFencedFenceSequence"),We(N)?Ye(e,h,"whitespace")(N):h(N))}function h(N){return N===null||_e(N)?(e.exit("codeFencedFence"),r.interrupt?t(N):e.check(Bj,b,O)(N)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),m(N))}function m(N){return N===null||_e(N)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),h(N)):We(N)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),Ye(e,v,"whitespace")(N)):N===96&&N===s?n(N):(e.consume(N),m)}function v(N){return N===null||_e(N)?h(N):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),w(N))}function w(N){return N===null||_e(N)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),h(N)):N===96&&N===s?n(N):(e.consume(N),w)}function b(N){return e.attempt(i,O,S)(N)}function S(N){return e.enter("lineEnding"),e.consume(N),e.exit("lineEnding"),k}function k(N){return o>0&&We(N)?Ye(e,C,"linePrefix",o+1)(N):C(N)}function C(N){return N===null||_e(N)?e.check(Bj,b,O)(N):(e.enter("codeFlowValue"),j(N))}function j(N){return N===null||_e(N)?(e.exit("codeFlowValue"),C(N)):(e.consume(N),j)}function O(N){return e.exit("codeFenced"),t(N)}function A(N,I,T){let $=0;return D;function D(H){return N.enter("lineEnding"),N.consume(H),N.exit("lineEnding"),U}function U(H){return N.enter("codeFencedFence"),We(H)?Ye(N,L,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(H):L(H)}function L(H){return H===s?(N.enter("codeFencedFenceSequence"),q(H)):T(H)}function q(H){return H===s?($++,N.consume(H),q):$>=a?(N.exit("codeFencedFenceSequence"),We(H)?Ye(N,W,"whitespace")(H):W(H)):T(H)}function W(H){return H===null||_e(H)?(N.exit("codeFencedFence"),I(H)):T(H)}}}function gG(e,t,n){const r=this;return i;function i(a){return a===null?n(a):(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),o)}function o(a){return r.parser.lazy[r.now().line]?n(a):t(a)}}const Ky={name:"codeIndented",tokenize:yG},vG={partial:!0,tokenize:xG};function yG(e,t,n){const r=this;return i;function i(f){return e.enter("codeIndented"),Ye(e,o,"linePrefix",5)(f)}function o(f){const d=r.events[r.events.length-1];return d&&d[1].type==="linePrefix"&&d[2].sliceSerialize(d[1],!0).length>=4?a(f):n(f)}function a(f){return f===null?u(f):_e(f)?e.attempt(vG,a,u)(f):(e.enter("codeFlowValue"),s(f))}function s(f){return f===null||_e(f)?(e.exit("codeFlowValue"),a(f)):(e.consume(f),s)}function u(f){return e.exit("codeIndented"),t(f)}}function xG(e,t,n){const r=this;return i;function i(a){return r.parser.lazy[r.now().line]?n(a):_e(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),i):Ye(e,o,"linePrefix",5)(a)}function o(a){const s=r.events[r.events.length-1];return s&&s[1].type==="linePrefix"&&s[2].sliceSerialize(s[1],!0).length>=4?t(a):_e(a)?i(a):n(a)}}const bG={name:"codeText",previous:SG,resolve:wG,tokenize:kG};function wG(e){let t=e.length-4,n=3,r,i;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(i=r):(r===t||e[r][1].type==="lineEnding")&&(e[i][1].type="codeTextData",r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function SG(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function kG(e,t,n){let r=0,i,o;return a;function a(h){return e.enter("codeText"),e.enter("codeTextSequence"),s(h)}function s(h){return h===96?(e.consume(h),r++,s):(e.exit("codeTextSequence"),u(h))}function u(h){return h===null?n(h):h===32?(e.enter("space"),e.consume(h),e.exit("space"),u):h===96?(o=e.enter("codeTextSequence"),i=0,d(h)):_e(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),u):(e.enter("codeTextData"),f(h))}function f(h){return h===null||h===32||h===96||_e(h)?(e.exit("codeTextData"),u(h)):(e.consume(h),f)}function d(h){return h===96?(e.consume(h),i++,d):i===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(h)):(o.type="codeTextData",f(h))}}class PG{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const i=n||0;this.setCursor(Math.trunc(t));const o=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&dc(this.left,r),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),dc(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),dc(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);dc(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);dc(this.left,n.reverse())}}}function dc(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function _D(e){const t={};let n=-1,r,i,o,a,s,u,f;const d=new PG(e);for(;++n<d.length;){for(;n in t;)n=t[n];if(r=d.get(n),n&&r[1].type==="chunkFlow"&&d.get(n-1)[1].type==="listItemPrefix"&&(u=r[1]._tokenizer.events,o=0,o<u.length&&u[o][1].type==="lineEndingBlank"&&(o+=2),o<u.length&&u[o][1].type==="content"))for(;++o<u.length&&u[o][1].type!=="content";)u[o][1].type==="chunkText"&&(u[o][1]._isInFirstContentOfListItem=!0,o++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,CG(d,n)),n=t[n],f=!0);else if(r[1]._container){for(o=n,i=void 0;o--;)if(a=d.get(o),a[1].type==="lineEnding"||a[1].type==="lineEndingBlank")a[0]==="enter"&&(i&&(d.get(i)[1].type="lineEndingBlank"),a[1].type="lineEnding",i=o);else if(!(a[1].type==="linePrefix"||a[1].type==="listItemIndent"))break;i&&(r[1].end={...d.get(i)[1].start},s=d.slice(i,n),s.unshift(r),d.splice(i,n-i+1,s))}}return mr(e,0,Number.POSITIVE_INFINITY,d.slice(0)),!f}function CG(e,t){const n=e.get(t)[1],r=e.get(t)[2];let i=t-1;const o=[];let a=n._tokenizer;a||(a=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(a._contentTypeTextTrailing=!0));const s=a.events,u=[],f={};let d,h,m=-1,v=n,w=0,b=0;const S=[b];for(;v;){for(;e.get(++i)[1]!==v;);o.push(i),v._tokenizer||(d=r.sliceStream(v),v.next||d.push(null),h&&a.defineSkip(v.start),v._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=!0),a.write(d),v._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=void 0)),h=v,v=v.next}for(v=n;++m<s.length;)s[m][0]==="exit"&&s[m-1][0]==="enter"&&s[m][1].type===s[m-1][1].type&&s[m][1].start.line!==s[m][1].end.line&&(b=m+1,S.push(b),v._tokenizer=void 0,v.previous=void 0,v=v.next);for(a.events=[],v?(v._tokenizer=void 0,v.previous=void 0):S.pop(),m=S.length;m--;){const k=s.slice(S[m],S[m+1]),C=o.pop();u.push([C,C+k.length-1]),e.splice(C,2,k)}for(u.reverse(),m=-1;++m<u.length;)f[w+u[m][0]]=w+u[m][1],w+=u[m][1]-u[m][0]-1;return f}const EG={resolve:OG,tokenize:NG},jG={partial:!0,tokenize:AG};function OG(e){return _D(e),e}function NG(e,t){let n;return r;function r(s){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),i(s)}function i(s){return s===null?o(s):_e(s)?e.check(jG,a,o)(s):(e.consume(s),i)}function o(s){return e.exit("chunkContent"),e.exit("content"),t(s)}function a(s){return e.consume(s),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function AG(e,t,n){const r=this;return i;function i(a){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),Ye(e,o,"linePrefix")}function o(a){if(a===null||_e(a))return n(a);const s=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&s&&s[1].type==="linePrefix"&&s[2].sliceSerialize(s[1],!0).length>=4?t(a):e.interrupt(r.parser.constructs.flow,n,t)(a)}}function ID(e,t,n,r,i,o,a,s,u){const f=u||Number.POSITIVE_INFINITY;let d=0;return h;function h(k){return k===60?(e.enter(r),e.enter(i),e.enter(o),e.consume(k),e.exit(o),m):k===null||k===32||k===41||mp(k)?n(k):(e.enter(r),e.enter(a),e.enter(s),e.enter("chunkString",{contentType:"string"}),b(k))}function m(k){return k===62?(e.enter(o),e.consume(k),e.exit(o),e.exit(i),e.exit(r),t):(e.enter(s),e.enter("chunkString",{contentType:"string"}),v(k))}function v(k){return k===62?(e.exit("chunkString"),e.exit(s),m(k)):k===null||k===60||_e(k)?n(k):(e.consume(k),k===92?w:v)}function w(k){return k===60||k===62||k===92?(e.consume(k),v):v(k)}function b(k){return!d&&(k===null||k===41||ht(k))?(e.exit("chunkString"),e.exit(s),e.exit(a),e.exit(r),t(k)):d<f&&k===40?(e.consume(k),d++,b):k===41?(e.consume(k),d--,b):k===null||k===32||k===40||mp(k)?n(k):(e.consume(k),k===92?S:b)}function S(k){return k===40||k===41||k===92?(e.consume(k),b):b(k)}}function RD(e,t,n,r,i,o){const a=this;let s=0,u;return f;function f(v){return e.enter(r),e.enter(i),e.consume(v),e.exit(i),e.enter(o),d}function d(v){return s>999||v===null||v===91||v===93&&!u||v===94&&!s&&"_hiddenFootnoteSupport"in a.parser.constructs?n(v):v===93?(e.exit(o),e.enter(i),e.consume(v),e.exit(i),e.exit(r),t):_e(v)?(e.enter("lineEnding"),e.consume(v),e.exit("lineEnding"),d):(e.enter("chunkString",{contentType:"string"}),h(v))}function h(v){return v===null||v===91||v===93||_e(v)||s++>999?(e.exit("chunkString"),d(v)):(e.consume(v),u||(u=!We(v)),v===92?m:h)}function m(v){return v===91||v===92||v===93?(e.consume(v),s++,h):h(v)}}function DD(e,t,n,r,i,o){let a;return s;function s(m){return m===34||m===39||m===40?(e.enter(r),e.enter(i),e.consume(m),e.exit(i),a=m===40?41:m,u):n(m)}function u(m){return m===a?(e.enter(i),e.consume(m),e.exit(i),e.exit(r),t):(e.enter(o),f(m))}function f(m){return m===a?(e.exit(o),u(a)):m===null?n(m):_e(m)?(e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),Ye(e,f,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),d(m))}function d(m){return m===a||m===null||_e(m)?(e.exit("chunkString"),f(m)):(e.consume(m),m===92?h:d)}function h(m){return m===a||m===92?(e.consume(m),d):d(m)}}function Tc(e,t){let n;return r;function r(i){return _e(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):We(i)?Ye(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const TG={name:"definition",tokenize:IG},_G={partial:!0,tokenize:RG};function IG(e,t,n){const r=this;let i;return o;function o(v){return e.enter("definition"),a(v)}function a(v){return RD.call(r,e,s,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(v)}function s(v){return i=ti(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),v===58?(e.enter("definitionMarker"),e.consume(v),e.exit("definitionMarker"),u):n(v)}function u(v){return ht(v)?Tc(e,f)(v):f(v)}function f(v){return ID(e,d,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(v)}function d(v){return e.attempt(_G,h,h)(v)}function h(v){return We(v)?Ye(e,m,"whitespace")(v):m(v)}function m(v){return v===null||_e(v)?(e.exit("definition"),r.parser.defined.push(i),t(v)):n(v)}}function RG(e,t,n){return r;function r(s){return ht(s)?Tc(e,i)(s):n(s)}function i(s){return DD(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(s)}function o(s){return We(s)?Ye(e,a,"whitespace")(s):a(s)}function a(s){return s===null||_e(s)?t(s):n(s)}}const DG={name:"hardBreakEscape",tokenize:MG};function MG(e,t,n){return r;function r(o){return e.enter("hardBreakEscape"),e.consume(o),i}function i(o){return _e(o)?(e.exit("hardBreakEscape"),t(o)):n(o)}}const LG={name:"headingAtx",resolve:$G,tokenize:FG};function $G(e,t){let n=e.length-2,r=3,i,o;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},o={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},mr(e,r,n-r+1,[["enter",i,t],["enter",o,t],["exit",o,t],["exit",i,t]])),e}function FG(e,t,n){let r=0;return i;function i(d){return e.enter("atxHeading"),o(d)}function o(d){return e.enter("atxHeadingSequence"),a(d)}function a(d){return d===35&&r++<6?(e.consume(d),a):d===null||ht(d)?(e.exit("atxHeadingSequence"),s(d)):n(d)}function s(d){return d===35?(e.enter("atxHeadingSequence"),u(d)):d===null||_e(d)?(e.exit("atxHeading"),t(d)):We(d)?Ye(e,s,"whitespace")(d):(e.enter("atxHeadingText"),f(d))}function u(d){return d===35?(e.consume(d),u):(e.exit("atxHeadingSequence"),s(d))}function f(d){return d===null||d===35||ht(d)?(e.exit("atxHeadingText"),s(d)):(e.consume(d),f)}}const zG=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],Wj=["pre","script","style","textarea"],BG={concrete:!0,name:"htmlFlow",resolveTo:HG,tokenize:VG},UG={partial:!0,tokenize:KG},WG={partial:!0,tokenize:qG};function HG(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function VG(e,t,n){const r=this;let i,o,a,s,u;return f;function f(M){return d(M)}function d(M){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(M),h}function h(M){return M===33?(e.consume(M),m):M===47?(e.consume(M),o=!0,b):M===63?(e.consume(M),i=3,r.interrupt?t:R):Dn(M)?(e.consume(M),a=String.fromCharCode(M),S):n(M)}function m(M){return M===45?(e.consume(M),i=2,v):M===91?(e.consume(M),i=5,s=0,w):Dn(M)?(e.consume(M),i=4,r.interrupt?t:R):n(M)}function v(M){return M===45?(e.consume(M),r.interrupt?t:R):n(M)}function w(M){const ce="CDATA[";return M===ce.charCodeAt(s++)?(e.consume(M),s===ce.length?r.interrupt?t:L:w):n(M)}function b(M){return Dn(M)?(e.consume(M),a=String.fromCharCode(M),S):n(M)}function S(M){if(M===null||M===47||M===62||ht(M)){const ce=M===47,we=a.toLowerCase();return!ce&&!o&&Wj.includes(we)?(i=1,r.interrupt?t(M):L(M)):zG.includes(a.toLowerCase())?(i=6,ce?(e.consume(M),k):r.interrupt?t(M):L(M)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(M):o?C(M):j(M))}return M===45||En(M)?(e.consume(M),a+=String.fromCharCode(M),S):n(M)}function k(M){return M===62?(e.consume(M),r.interrupt?t:L):n(M)}function C(M){return We(M)?(e.consume(M),C):D(M)}function j(M){return M===47?(e.consume(M),D):M===58||M===95||Dn(M)?(e.consume(M),O):We(M)?(e.consume(M),j):D(M)}function O(M){return M===45||M===46||M===58||M===95||En(M)?(e.consume(M),O):A(M)}function A(M){return M===61?(e.consume(M),N):We(M)?(e.consume(M),A):j(M)}function N(M){return M===null||M===60||M===61||M===62||M===96?n(M):M===34||M===39?(e.consume(M),u=M,I):We(M)?(e.consume(M),N):T(M)}function I(M){return M===u?(e.consume(M),u=null,$):M===null||_e(M)?n(M):(e.consume(M),I)}function T(M){return M===null||M===34||M===39||M===47||M===60||M===61||M===62||M===96||ht(M)?A(M):(e.consume(M),T)}function $(M){return M===47||M===62||We(M)?j(M):n(M)}function D(M){return M===62?(e.consume(M),U):n(M)}function U(M){return M===null||_e(M)?L(M):We(M)?(e.consume(M),U):n(M)}function L(M){return M===45&&i===2?(e.consume(M),X):M===60&&i===1?(e.consume(M),ne):M===62&&i===4?(e.consume(M),z):M===63&&i===3?(e.consume(M),R):M===93&&i===5?(e.consume(M),re):_e(M)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(UG,J,q)(M)):M===null||_e(M)?(e.exit("htmlFlowData"),q(M)):(e.consume(M),L)}function q(M){return e.check(WG,W,J)(M)}function W(M){return e.enter("lineEnding"),e.consume(M),e.exit("lineEnding"),H}function H(M){return M===null||_e(M)?q(M):(e.enter("htmlFlowData"),L(M))}function X(M){return M===45?(e.consume(M),R):L(M)}function ne(M){return M===47?(e.consume(M),a="",B):L(M)}function B(M){if(M===62){const ce=a.toLowerCase();return Wj.includes(ce)?(e.consume(M),z):L(M)}return Dn(M)&&a.length<8?(e.consume(M),a+=String.fromCharCode(M),B):L(M)}function re(M){return M===93?(e.consume(M),R):L(M)}function R(M){return M===62?(e.consume(M),z):M===45&&i===2?(e.consume(M),R):L(M)}function z(M){return M===null||_e(M)?(e.exit("htmlFlowData"),J(M)):(e.consume(M),z)}function J(M){return e.exit("htmlFlow"),t(M)}}function qG(e,t,n){const r=this;return i;function i(a){return _e(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),o):n(a)}function o(a){return r.parser.lazy[r.now().line]?n(a):t(a)}}function KG(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(xf,t,n)}}const GG={name:"htmlText",tokenize:YG};function YG(e,t,n){const r=this;let i,o,a;return s;function s(R){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(R),u}function u(R){return R===33?(e.consume(R),f):R===47?(e.consume(R),A):R===63?(e.consume(R),j):Dn(R)?(e.consume(R),T):n(R)}function f(R){return R===45?(e.consume(R),d):R===91?(e.consume(R),o=0,w):Dn(R)?(e.consume(R),C):n(R)}function d(R){return R===45?(e.consume(R),v):n(R)}function h(R){return R===null?n(R):R===45?(e.consume(R),m):_e(R)?(a=h,ne(R)):(e.consume(R),h)}function m(R){return R===45?(e.consume(R),v):h(R)}function v(R){return R===62?X(R):R===45?m(R):h(R)}function w(R){const z="CDATA[";return R===z.charCodeAt(o++)?(e.consume(R),o===z.length?b:w):n(R)}function b(R){return R===null?n(R):R===93?(e.consume(R),S):_e(R)?(a=b,ne(R)):(e.consume(R),b)}function S(R){return R===93?(e.consume(R),k):b(R)}function k(R){return R===62?X(R):R===93?(e.consume(R),k):b(R)}function C(R){return R===null||R===62?X(R):_e(R)?(a=C,ne(R)):(e.consume(R),C)}function j(R){return R===null?n(R):R===63?(e.consume(R),O):_e(R)?(a=j,ne(R)):(e.consume(R),j)}function O(R){return R===62?X(R):j(R)}function A(R){return Dn(R)?(e.consume(R),N):n(R)}function N(R){return R===45||En(R)?(e.consume(R),N):I(R)}function I(R){return _e(R)?(a=I,ne(R)):We(R)?(e.consume(R),I):X(R)}function T(R){return R===45||En(R)?(e.consume(R),T):R===47||R===62||ht(R)?$(R):n(R)}function $(R){return R===47?(e.consume(R),X):R===58||R===95||Dn(R)?(e.consume(R),D):_e(R)?(a=$,ne(R)):We(R)?(e.consume(R),$):X(R)}function D(R){return R===45||R===46||R===58||R===95||En(R)?(e.consume(R),D):U(R)}function U(R){return R===61?(e.consume(R),L):_e(R)?(a=U,ne(R)):We(R)?(e.consume(R),U):$(R)}function L(R){return R===null||R===60||R===61||R===62||R===96?n(R):R===34||R===39?(e.consume(R),i=R,q):_e(R)?(a=L,ne(R)):We(R)?(e.consume(R),L):(e.consume(R),W)}function q(R){return R===i?(e.consume(R),i=void 0,H):R===null?n(R):_e(R)?(a=q,ne(R)):(e.consume(R),q)}function W(R){return R===null||R===34||R===39||R===60||R===61||R===96?n(R):R===47||R===62||ht(R)?$(R):(e.consume(R),W)}function H(R){return R===47||R===62||ht(R)?$(R):n(R)}function X(R){return R===62?(e.consume(R),e.exit("htmlTextData"),e.exit("htmlText"),t):n(R)}function ne(R){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(R),e.exit("lineEnding"),B}function B(R){return We(R)?Ye(e,re,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(R):re(R)}function re(R){return e.enter("htmlTextData"),a(R)}}const P1={name:"labelEnd",resolveAll:JG,resolveTo:eY,tokenize:tY},QG={tokenize:nY},XG={tokenize:rY},ZG={tokenize:iY};function JG(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const i=r.type==="labelImage"?4:2;r.type="data",t+=i}}return e.length!==n.length&&mr(e,0,e.length,n),e}function eY(e,t){let n=e.length,r=0,i,o,a,s;for(;n--;)if(i=e[n][1],o){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;e[n][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(a){if(e[n][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(o=n,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(a=n);const u={type:e[o][1].type==="labelLink"?"link":"image",start:{...e[o][1].start},end:{...e[e.length-1][1].end}},f={type:"label",start:{...e[o][1].start},end:{...e[a][1].end}},d={type:"labelText",start:{...e[o+r+2][1].end},end:{...e[a-2][1].start}};return s=[["enter",u,t],["enter",f,t]],s=Ir(s,e.slice(o+1,o+r+3)),s=Ir(s,[["enter",d,t]]),s=Ir(s,Rm(t.parser.constructs.insideSpan.null,e.slice(o+r+4,a-3),t)),s=Ir(s,[["exit",d,t],e[a-2],e[a-1],["exit",f,t]]),s=Ir(s,e.slice(a+1)),s=Ir(s,[["exit",u,t]]),mr(e,o,e.length,s),e}function tY(e,t,n){const r=this;let i=r.events.length,o,a;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){o=r.events[i][1];break}return s;function s(m){return o?o._inactive?h(m):(a=r.parser.defined.includes(ti(r.sliceSerialize({start:o.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(m),e.exit("labelMarker"),e.exit("labelEnd"),u):n(m)}function u(m){return m===40?e.attempt(QG,d,a?d:h)(m):m===91?e.attempt(XG,d,a?f:h)(m):a?d(m):h(m)}function f(m){return e.attempt(ZG,d,h)(m)}function d(m){return t(m)}function h(m){return o._balanced=!0,n(m)}}function nY(e,t,n){return r;function r(h){return e.enter("resource"),e.enter("resourceMarker"),e.consume(h),e.exit("resourceMarker"),i}function i(h){return ht(h)?Tc(e,o)(h):o(h)}function o(h){return h===41?d(h):ID(e,a,s,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(h)}function a(h){return ht(h)?Tc(e,u)(h):d(h)}function s(h){return n(h)}function u(h){return h===34||h===39||h===40?DD(e,f,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(h):d(h)}function f(h){return ht(h)?Tc(e,d)(h):d(h)}function d(h){return h===41?(e.enter("resourceMarker"),e.consume(h),e.exit("resourceMarker"),e.exit("resource"),t):n(h)}}function rY(e,t,n){const r=this;return i;function i(s){return RD.call(r,e,o,a,"reference","referenceMarker","referenceString")(s)}function o(s){return r.parser.defined.includes(ti(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(s):n(s)}function a(s){return n(s)}}function iY(e,t,n){return r;function r(o){return e.enter("reference"),e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),i}function i(o){return o===93?(e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),e.exit("reference"),t):n(o)}}const oY={name:"labelStartImage",resolveAll:P1.resolveAll,tokenize:aY};function aY(e,t,n){const r=this;return i;function i(s){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(s),e.exit("labelImageMarker"),o}function o(s){return s===91?(e.enter("labelMarker"),e.consume(s),e.exit("labelMarker"),e.exit("labelImage"),a):n(s)}function a(s){return s===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(s):t(s)}}const sY={name:"labelStartLink",resolveAll:P1.resolveAll,tokenize:lY};function lY(e,t,n){const r=this;return i;function i(a){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(a),e.exit("labelMarker"),e.exit("labelLink"),o}function o(a){return a===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(a):t(a)}}const Gy={name:"lineEnding",tokenize:uY};function uY(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),Ye(e,t,"linePrefix")}}const Wh={name:"thematicBreak",tokenize:cY};function cY(e,t,n){let r=0,i;return o;function o(f){return e.enter("thematicBreak"),a(f)}function a(f){return i=f,s(f)}function s(f){return f===i?(e.enter("thematicBreakSequence"),u(f)):r>=3&&(f===null||_e(f))?(e.exit("thematicBreak"),t(f)):n(f)}function u(f){return f===i?(e.consume(f),r++,u):(e.exit("thematicBreakSequence"),We(f)?Ye(e,s,"whitespace")(f):s(f))}}const Gn={continuation:{tokenize:pY},exit:gY,name:"list",tokenize:hY},fY={partial:!0,tokenize:vY},dY={partial:!0,tokenize:mY};function hY(e,t,n){const r=this,i=r.events[r.events.length-1];let o=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,a=0;return s;function s(v){const w=r.containerState.type||(v===42||v===43||v===45?"listUnordered":"listOrdered");if(w==="listUnordered"?!r.containerState.marker||v===r.containerState.marker:Pb(v)){if(r.containerState.type||(r.containerState.type=w,e.enter(w,{_container:!0})),w==="listUnordered")return e.enter("listItemPrefix"),v===42||v===45?e.check(Wh,n,f)(v):f(v);if(!r.interrupt||v===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),u(v)}return n(v)}function u(v){return Pb(v)&&++a<10?(e.consume(v),u):(!r.interrupt||a<2)&&(r.containerState.marker?v===r.containerState.marker:v===41||v===46)?(e.exit("listItemValue"),f(v)):n(v)}function f(v){return e.enter("listItemMarker"),e.consume(v),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||v,e.check(xf,r.interrupt?n:d,e.attempt(fY,m,h))}function d(v){return r.containerState.initialBlankLine=!0,o++,m(v)}function h(v){return We(v)?(e.enter("listItemPrefixWhitespace"),e.consume(v),e.exit("listItemPrefixWhitespace"),m):n(v)}function m(v){return r.containerState.size=o+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(v)}}function pY(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(xf,i,o);function i(s){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Ye(e,t,"listItemIndent",r.containerState.size+1)(s)}function o(s){return r.containerState.furtherBlankLines||!We(s)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,a(s)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(dY,t,a)(s))}function a(s){return r.containerState._closeFlow=!0,r.interrupt=void 0,Ye(e,e.attempt(Gn,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s)}}function mY(e,t,n){const r=this;return Ye(e,i,"listItemIndent",r.containerState.size+1);function i(o){const a=r.events[r.events.length-1];return a&&a[1].type==="listItemIndent"&&a[2].sliceSerialize(a[1],!0).length===r.containerState.size?t(o):n(o)}}function gY(e){e.exit(this.containerState.type)}function vY(e,t,n){const r=this;return Ye(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(o){const a=r.events[r.events.length-1];return!We(o)&&a&&a[1].type==="listItemPrefixWhitespace"?t(o):n(o)}}const Hj={name:"setextUnderline",resolveTo:yY,tokenize:xY};function yY(e,t){let n=e.length,r,i,o;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(i=n)}else e[n][1].type==="content"&&e.splice(n,1),!o&&e[n][1].type==="definition"&&(o=n);const a={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",o?(e.splice(i,0,["enter",a,t]),e.splice(o+1,0,["exit",e[r][1],t]),e[r][1].end={...e[o][1].end}):e[r][1]=a,e.push(["exit",a,t]),e}function xY(e,t,n){const r=this;let i;return o;function o(f){let d=r.events.length,h;for(;d--;)if(r.events[d][1].type!=="lineEnding"&&r.events[d][1].type!=="linePrefix"&&r.events[d][1].type!=="content"){h=r.events[d][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||h)?(e.enter("setextHeadingLine"),i=f,a(f)):n(f)}function a(f){return e.enter("setextHeadingLineSequence"),s(f)}function s(f){return f===i?(e.consume(f),s):(e.exit("setextHeadingLineSequence"),We(f)?Ye(e,u,"lineSuffix")(f):u(f))}function u(f){return f===null||_e(f)?(e.exit("setextHeadingLine"),t(f)):n(f)}}const bY={tokenize:wY};function wY(e){const t=this,n=e.attempt(xf,r,e.attempt(this.parser.constructs.flowInitial,i,Ye(e,e.attempt(this.parser.constructs.flow,i,e.attempt(EG,i)),"linePrefix")));return n;function r(o){if(o===null){e.consume(o);return}return e.enter("lineEndingBlank"),e.consume(o),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const SY={resolveAll:LD()},kY=MD("string"),PY=MD("text");function MD(e){return{resolveAll:LD(e==="text"?CY:void 0),tokenize:t};function t(n){const r=this,i=this.parser.constructs[e],o=n.attempt(i,a,s);return a;function a(d){return f(d)?o(d):s(d)}function s(d){if(d===null){n.consume(d);return}return n.enter("data"),n.consume(d),u}function u(d){return f(d)?(n.exit("data"),o(d)):(n.consume(d),u)}function f(d){if(d===null)return!0;const h=i[d];let m=-1;if(h)for(;++m<h.length;){const v=h[m];if(!v.previous||v.previous.call(r,r.previous))return!0}return!1}}}function LD(e){return t;function t(n,r){let i=-1,o;for(;++i<=n.length;)o===void 0?n[i]&&n[i][1].type==="data"&&(o=i,i++):(!n[i]||n[i][1].type!=="data")&&(i!==o+2&&(n[o][1].end=n[i-1][1].end,n.splice(o+2,i-o-2),i=o+2),o=void 0);return e?e(n,r):n}}function CY(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],i=t.sliceStream(r);let o=i.length,a=-1,s=0,u;for(;o--;){const f=i[o];if(typeof f=="string"){for(a=f.length;f.charCodeAt(a-1)===32;)s++,a--;if(a)break;a=-1}else if(f===-2)u=!0,s++;else if(f!==-1){o++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(s=0),s){const f={type:n===e.length||u||s<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:o?a:r.start._bufferIndex+a,_index:r.start._index+o,line:r.end.line,column:r.end.column-s,offset:r.end.offset-s},end:{...r.end}};r.end={...f.start},r.start.offset===r.end.offset?Object.assign(r,f):(e.splice(n,0,["enter",f,t],["exit",f,t]),n+=2)}n++}return e}const EY={42:Gn,43:Gn,45:Gn,48:Gn,49:Gn,50:Gn,51:Gn,52:Gn,53:Gn,54:Gn,55:Gn,56:Gn,57:Gn,62:ND},jY={91:TG},OY={[-2]:Ky,[-1]:Ky,32:Ky},NY={35:LG,42:Wh,45:[Hj,Wh],60:BG,61:Hj,95:Wh,96:Uj,126:Uj},AY={38:TD,92:AD},TY={[-5]:Gy,[-4]:Gy,[-3]:Gy,33:oY,38:TD,42:Cb,60:[sG,GG],91:sY,92:[DG,AD],93:P1,95:Cb,96:bG},_Y={null:[Cb,SY]},IY={null:[42,95]},RY={null:[]},DY=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:IY,contentInitial:jY,disable:RY,document:EY,flow:NY,flowInitial:OY,insideSpan:_Y,string:AY,text:TY},Symbol.toStringTag,{value:"Module"}));function MY(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const i={},o=[];let a=[],s=[];const u={attempt:I(A),check:I(N),consume:C,enter:j,exit:O,interrupt:I(N,{interrupt:!0})},f={code:null,containerState:{},defineSkip:b,events:[],now:w,parser:e,previous:null,sliceSerialize:m,sliceStream:v,write:h};let d=t.tokenize.call(f,u);return t.resolveAll&&o.push(t),f;function h(U){return a=Ir(a,U),S(),a[a.length-1]!==null?[]:(T(t,0),f.events=Rm(o,f.events,f),f.events)}function m(U,L){return $Y(v(U),L)}function v(U){return LY(a,U)}function w(){const{_bufferIndex:U,_index:L,line:q,column:W,offset:H}=r;return{_bufferIndex:U,_index:L,line:q,column:W,offset:H}}function b(U){i[U.line]=U.column,D()}function S(){let U;for(;r._index<a.length;){const L=a[r._index];if(typeof L=="string")for(U=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===U&&r._bufferIndex<L.length;)k(L.charCodeAt(r._bufferIndex));else k(L)}}function k(U){d=d(U)}function C(U){_e(U)?(r.line++,r.column=1,r.offset+=U===-3?2:1,D()):U!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===a[r._index].length&&(r._bufferIndex=-1,r._index++)),f.previous=U}function j(U,L){const q=L||{};return q.type=U,q.start=w(),f.events.push(["enter",q,f]),s.push(q),q}function O(U){const L=s.pop();return L.end=w(),f.events.push(["exit",L,f]),L}function A(U,L){T(U,L.from)}function N(U,L){L.restore()}function I(U,L){return q;function q(W,H,X){let ne,B,re,R;return Array.isArray(W)?J(W):"tokenize"in W?J([W]):z(W);function z(xe){return ae;function ae(ge){const Z=ge!==null&&xe[ge],de=ge!==null&&xe.null,me=[...Array.isArray(Z)?Z:Z?[Z]:[],...Array.isArray(de)?de:de?[de]:[]];return J(me)(ge)}}function J(xe){return ne=xe,B=0,xe.length===0?X:M(xe[B])}function M(xe){return ae;function ae(ge){return R=$(),re=xe,xe.partial||(f.currentConstruct=xe),xe.name&&f.parser.constructs.disable.null.includes(xe.name)?we():xe.tokenize.call(L?Object.assign(Object.create(f),L):f,u,ce,we)(ge)}}function ce(xe){return U(re,R),H}function we(xe){return R.restore(),++B<ne.length?M(ne[B]):X}}}function T(U,L){U.resolveAll&&!o.includes(U)&&o.push(U),U.resolve&&mr(f.events,L,f.events.length-L,U.resolve(f.events.slice(L),f)),U.resolveTo&&(f.events=U.resolveTo(f.events,f))}function $(){const U=w(),L=f.previous,q=f.currentConstruct,W=f.events.length,H=Array.from(s);return{from:W,restore:X};function X(){r=U,f.previous=L,f.currentConstruct=q,f.events.length=W,s=H,D()}}function D(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function LY(e,t){const n=t.start._index,r=t.start._bufferIndex,i=t.end._index,o=t.end._bufferIndex;let a;if(n===i)a=[e[n].slice(r,o)];else{if(a=e.slice(n,i),r>-1){const s=a[0];typeof s=="string"?a[0]=s.slice(r):a.shift()}o>0&&a.push(e[i].slice(0,o))}return a}function $Y(e,t){let n=-1;const r=[];let i;for(;++n<e.length;){const o=e[n];let a;if(typeof o=="string")a=o;else switch(o){case-5:{a="\r";break}case-4:{a=`
|
|
245
245
|
`;break}case-3:{a=`\r
|
|
246
246
|
`;break}case-2:{a=t?" ":" ";break}case-1:{if(!t&&i)continue;a=" ";break}default:a=String.fromCharCode(o)}i=o===-2,r.push(a)}return r.join("")}function FY(e){const r={constructs:jD([DY,...(e||{}).extensions||[]]),content:i(eG),defined:[],document:i(nG),flow:i(bY),lazy:{},string:i(kY),text:i(PY)};return r;function i(o){return a;function a(s){return MY(r,o,s)}}}function zY(e){for(;!_D(e););return e}const Vj=/[\0\t\n\r]/g;function BY(){let e=1,t="",n=!0,r;return i;function i(o,a,s){const u=[];let f,d,h,m,v;for(o=t+(typeof o=="string"?o.toString():new TextDecoder(a||void 0).decode(o)),h=0,t="",n&&(o.charCodeAt(0)===65279&&h++,n=void 0);h<o.length;){if(Vj.lastIndex=h,f=Vj.exec(o),m=f&&f.index!==void 0?f.index:o.length,v=o.charCodeAt(m),!f){t=o.slice(h);break}if(v===10&&h===m&&r)u.push(-3),r=void 0;else switch(r&&(u.push(-5),r=void 0),h<m&&(u.push(o.slice(h,m)),e+=m-h),v){case 0:{u.push(65533),e++;break}case 9:{for(d=Math.ceil(e/4)*4,u.push(-2);e++<d;)u.push(-1);break}case 10:{u.push(-4),e=1;break}default:r=!0,e=1}h=m+1}return s&&(r&&u.push(-5),t&&u.push(t),u.push(null)),u}}const UY=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function WY(e){return e.replace(UY,HY)}function HY(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),o=i===120||i===88;return OD(n.slice(o?2:1),o?16:10)}return k1(n)||e}const $D={}.hasOwnProperty;function VY(e,t,n){return typeof t!="string"&&(n=t,t=void 0),qY(n)(zY(FY(n).document().write(BY()(e,t,!0))))}function qY(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(Br),autolinkProtocol:$,autolinkEmail:$,atxHeading:o(yt),blockQuote:o(de),characterEscape:$,characterReference:$,codeFenced:o(me),codeFencedFenceInfo:a,codeFencedFenceMeta:a,codeIndented:o(me,a),codeText:o(ie,a),codeTextData:$,data:$,codeFlowValue:$,definition:o(He),definitionDestinationString:a,definitionLabelString:a,definitionTitleString:a,emphasis:o(Le),hardBreakEscape:o(xt),hardBreakTrailing:o(xt),htmlFlow:o(Ft,a),htmlFlowData:$,htmlText:o(Ft,a),htmlTextData:$,image:o(Yi),label:a,link:o(Br),listItem:o(Lo),listItemValue:m,listOrdered:o(Mo,h),listUnordered:o(Mo),paragraph:o(Su),reference:M,referenceString:a,resourceDestinationString:a,resourceTitleString:a,setextHeading:o(yt),strong:o(Bf),thematicBreak:o(Wf)},exit:{atxHeading:u(),atxHeadingSequence:A,autolink:u(),autolinkEmail:Z,autolinkProtocol:ge,blockQuote:u(),characterEscapeValue:D,characterReferenceMarkerHexadecimal:we,characterReferenceMarkerNumeric:we,characterReferenceValue:xe,characterReference:ae,codeFenced:u(S),codeFencedFence:b,codeFencedFenceInfo:v,codeFencedFenceMeta:w,codeFlowValue:D,codeIndented:u(k),codeText:u(H),codeTextData:D,data:D,definition:u(),definitionDestinationString:O,definitionLabelString:C,definitionTitleString:j,emphasis:u(),hardBreakEscape:u(L),hardBreakTrailing:u(L),htmlFlow:u(q),htmlFlowData:D,htmlText:u(W),htmlTextData:D,image:u(ne),label:re,labelText:B,lineEnding:U,link:u(X),listItem:u(),listOrdered:u(),listUnordered:u(),paragraph:u(),referenceString:ce,resourceDestinationString:R,resourceTitleString:z,resource:J,setextHeading:u(T),setextHeadingLineSequence:I,setextHeadingText:N,strong:u(),thematicBreak:u()}};FD(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(oe){let pe={type:"root",children:[]};const Re={stack:[pe],tokenStack:[],config:t,enter:s,exit:f,buffer:a,resume:d,data:n},Be=[];let Xe=-1;for(;++Xe<oe.length;)if(oe[Xe][1].type==="listOrdered"||oe[Xe][1].type==="listUnordered")if(oe[Xe][0]==="enter")Be.push(Xe);else{const cn=Be.pop();Xe=i(oe,cn,Xe)}for(Xe=-1;++Xe<oe.length;){const cn=t[oe[Xe][0]];$D.call(cn,oe[Xe][1].type)&&cn[oe[Xe][1].type].call(Object.assign({sliceSerialize:oe[Xe][2].sliceSerialize},Re),oe[Xe][1])}if(Re.tokenStack.length>0){const cn=Re.tokenStack[Re.tokenStack.length-1];(cn[1]||qj).call(Re,void 0,cn[0])}for(pe.position={start:oa(oe.length>0?oe[0][1].start:{line:1,column:1,offset:0}),end:oa(oe.length>0?oe[oe.length-2][1].end:{line:1,column:1,offset:0})},Xe=-1;++Xe<t.transforms.length;)pe=t.transforms[Xe](pe)||pe;return pe}function i(oe,pe,Re){let Be=pe-1,Xe=-1,cn=!1,Qi,br,$o,Ma;for(;++Be<=Re;){const fn=oe[Be];switch(fn[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{fn[0]==="enter"?Xe++:Xe--,Ma=void 0;break}case"lineEndingBlank":{fn[0]==="enter"&&(Qi&&!Ma&&!Xe&&!$o&&($o=Be),Ma=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Ma=void 0}if(!Xe&&fn[0]==="enter"&&fn[1].type==="listItemPrefix"||Xe===-1&&fn[0]==="exit"&&(fn[1].type==="listUnordered"||fn[1].type==="listOrdered")){if(Qi){let hi=Be;for(br=void 0;hi--;){const or=oe[hi];if(or[1].type==="lineEnding"||or[1].type==="lineEndingBlank"){if(or[0]==="exit")continue;br&&(oe[br][1].type="lineEndingBlank",cn=!0),or[1].type="lineEnding",br=hi}else if(!(or[1].type==="linePrefix"||or[1].type==="blockQuotePrefix"||or[1].type==="blockQuotePrefixWhitespace"||or[1].type==="blockQuoteMarker"||or[1].type==="listItemIndent"))break}$o&&(!br||$o<br)&&(Qi._spread=!0),Qi.end=Object.assign({},br?oe[br][1].start:fn[1].end),oe.splice(br||Be,0,["exit",Qi,fn[2]]),Be++,Re++}if(fn[1].type==="listItemPrefix"){const hi={type:"listItem",_spread:!1,start:Object.assign({},fn[1].start),end:void 0};Qi=hi,oe.splice(Be,0,["enter",hi,fn[2]]),Be++,Re++,$o=void 0,Ma=!0}}}return oe[pe][1]._spread=cn,Re}function o(oe,pe){return Re;function Re(Be){s.call(this,oe(Be),Be),pe&&pe.call(this,Be)}}function a(){this.stack.push({type:"fragment",children:[]})}function s(oe,pe,Re){this.stack[this.stack.length-1].children.push(oe),this.stack.push(oe),this.tokenStack.push([pe,Re||void 0]),oe.position={start:oa(pe.start),end:void 0}}function u(oe){return pe;function pe(Re){oe&&oe.call(this,Re),f.call(this,Re)}}function f(oe,pe){const Re=this.stack.pop(),Be=this.tokenStack.pop();if(Be)Be[0].type!==oe.type&&(pe?pe.call(this,oe,Be[0]):(Be[1]||qj).call(this,oe,Be[0]));else throw new Error("Cannot close `"+oe.type+"` ("+Ac({start:oe.start,end:oe.end})+"): it’s not open");Re.position.end=oa(oe.end)}function d(){return S1(this.stack.pop())}function h(){this.data.expectingFirstListItemValue=!0}function m(oe){if(this.data.expectingFirstListItemValue){const pe=this.stack[this.stack.length-2];pe.start=Number.parseInt(this.sliceSerialize(oe),10),this.data.expectingFirstListItemValue=void 0}}function v(){const oe=this.resume(),pe=this.stack[this.stack.length-1];pe.lang=oe}function w(){const oe=this.resume(),pe=this.stack[this.stack.length-1];pe.meta=oe}function b(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function S(){const oe=this.resume(),pe=this.stack[this.stack.length-1];pe.value=oe.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function k(){const oe=this.resume(),pe=this.stack[this.stack.length-1];pe.value=oe.replace(/(\r?\n|\r)$/g,"")}function C(oe){const pe=this.resume(),Re=this.stack[this.stack.length-1];Re.label=pe,Re.identifier=ti(this.sliceSerialize(oe)).toLowerCase()}function j(){const oe=this.resume(),pe=this.stack[this.stack.length-1];pe.title=oe}function O(){const oe=this.resume(),pe=this.stack[this.stack.length-1];pe.url=oe}function A(oe){const pe=this.stack[this.stack.length-1];if(!pe.depth){const Re=this.sliceSerialize(oe).length;pe.depth=Re}}function N(){this.data.setextHeadingSlurpLineEnding=!0}function I(oe){const pe=this.stack[this.stack.length-1];pe.depth=this.sliceSerialize(oe).codePointAt(0)===61?1:2}function T(){this.data.setextHeadingSlurpLineEnding=void 0}function $(oe){const Re=this.stack[this.stack.length-1].children;let Be=Re[Re.length-1];(!Be||Be.type!=="text")&&(Be=Uf(),Be.position={start:oa(oe.start),end:void 0},Re.push(Be)),this.stack.push(Be)}function D(oe){const pe=this.stack.pop();pe.value+=this.sliceSerialize(oe),pe.position.end=oa(oe.end)}function U(oe){const pe=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Re=pe.children[pe.children.length-1];Re.position.end=oa(oe.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(pe.type)&&($.call(this,oe),D.call(this,oe))}function L(){this.data.atHardBreak=!0}function q(){const oe=this.resume(),pe=this.stack[this.stack.length-1];pe.value=oe}function W(){const oe=this.resume(),pe=this.stack[this.stack.length-1];pe.value=oe}function H(){const oe=this.resume(),pe=this.stack[this.stack.length-1];pe.value=oe}function X(){const oe=this.stack[this.stack.length-1];if(this.data.inReference){const pe=this.data.referenceType||"shortcut";oe.type+="Reference",oe.referenceType=pe,delete oe.url,delete oe.title}else delete oe.identifier,delete oe.label;this.data.referenceType=void 0}function ne(){const oe=this.stack[this.stack.length-1];if(this.data.inReference){const pe=this.data.referenceType||"shortcut";oe.type+="Reference",oe.referenceType=pe,delete oe.url,delete oe.title}else delete oe.identifier,delete oe.label;this.data.referenceType=void 0}function B(oe){const pe=this.sliceSerialize(oe),Re=this.stack[this.stack.length-2];Re.label=WY(pe),Re.identifier=ti(pe).toLowerCase()}function re(){const oe=this.stack[this.stack.length-1],pe=this.resume(),Re=this.stack[this.stack.length-1];if(this.data.inReference=!0,Re.type==="link"){const Be=oe.children;Re.children=Be}else Re.alt=pe}function R(){const oe=this.resume(),pe=this.stack[this.stack.length-1];pe.url=oe}function z(){const oe=this.resume(),pe=this.stack[this.stack.length-1];pe.title=oe}function J(){this.data.inReference=void 0}function M(){this.data.referenceType="collapsed"}function ce(oe){const pe=this.resume(),Re=this.stack[this.stack.length-1];Re.label=pe,Re.identifier=ti(this.sliceSerialize(oe)).toLowerCase(),this.data.referenceType="full"}function we(oe){this.data.characterReferenceType=oe.type}function xe(oe){const pe=this.sliceSerialize(oe),Re=this.data.characterReferenceType;let Be;Re?(Be=OD(pe,Re==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Be=k1(pe);const Xe=this.stack[this.stack.length-1];Xe.value+=Be}function ae(oe){const pe=this.stack.pop();pe.position.end=oa(oe.end)}function ge(oe){D.call(this,oe);const pe=this.stack[this.stack.length-1];pe.url=this.sliceSerialize(oe)}function Z(oe){D.call(this,oe);const pe=this.stack[this.stack.length-1];pe.url="mailto:"+this.sliceSerialize(oe)}function de(){return{type:"blockquote",children:[]}}function me(){return{type:"code",lang:null,meta:null,value:""}}function ie(){return{type:"inlineCode",value:""}}function He(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Le(){return{type:"emphasis",children:[]}}function yt(){return{type:"heading",depth:0,children:[]}}function xt(){return{type:"break"}}function Ft(){return{type:"html",value:""}}function Yi(){return{type:"image",title:null,url:"",alt:null}}function Br(){return{type:"link",title:null,url:"",children:[]}}function Mo(oe){return{type:"list",ordered:oe.type==="listOrdered",start:null,spread:oe._spread,children:[]}}function Lo(oe){return{type:"listItem",spread:oe._spread,checked:null,children:[]}}function Su(){return{type:"paragraph",children:[]}}function Bf(){return{type:"strong",children:[]}}function Uf(){return{type:"text",value:""}}function Wf(){return{type:"thematicBreak"}}}function oa(e){return{line:e.line,column:e.column,offset:e.offset}}function FD(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?FD(e,r):KY(e,r)}}function KY(e,t){let n;for(n in t)if($D.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function qj(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Ac({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Ac({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Ac({start:t.start,end:t.end})+") is still open")}function GY(e){const t=this;t.parser=n;function n(r){return VY(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function YY(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function QY(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
|
|
@@ -268,7 +268,7 @@ For more information, see https://radix-ui.com/primitives/docs/components/${t.do
|
|
|
268
268
|
`))+1))}const a="#".repeat(i),s=n.enter("headingAtx"),u=n.enter("phrasing");o.move(a+" ");let f=n.containerPhrasing(e,{before:"# ",after:`
|
|
269
269
|
`,...o.current()});return/^[\t ]/.test(f)&&(f=Wc(f.charCodeAt(0))+f.slice(1)),f=f?a+" "+f:a,n.options.closeAtx&&(f+=" "+a),u(),s(),f}JD.peek=mZ;function JD(e){return e.value||""}function mZ(){return"<"}eM.peek=gZ;function eM(e,t,n,r){const i=T1(n),o=i==='"'?"Quote":"Apostrophe",a=n.enter("image");let s=n.enter("label");const u=n.createTracker(r);let f=u.move("![");return f+=u.move(n.safe(e.alt,{before:f,after:"]",...u.current()})),f+=u.move("]("),s(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(s=n.enter("destinationLiteral"),f+=u.move("<"),f+=u.move(n.safe(e.url,{before:f,after:">",...u.current()})),f+=u.move(">")):(s=n.enter("destinationRaw"),f+=u.move(n.safe(e.url,{before:f,after:e.title?" ":")",...u.current()}))),s(),e.title&&(s=n.enter(`title${o}`),f+=u.move(" "+i),f+=u.move(n.safe(e.title,{before:f,after:i,...u.current()})),f+=u.move(i),s()),f+=u.move(")"),a(),f}function gZ(){return"!"}tM.peek=vZ;function tM(e,t,n,r){const i=e.referenceType,o=n.enter("imageReference");let a=n.enter("label");const s=n.createTracker(r);let u=s.move("![");const f=n.safe(e.alt,{before:u,after:"]",...s.current()});u+=s.move(f+"]["),a();const d=n.stack;n.stack=[],a=n.enter("reference");const h=n.safe(n.associationId(e),{before:u,after:"]",...s.current()});return a(),n.stack=d,o(),i==="full"||!f||f!==h?u+=s.move(h+"]"):i==="shortcut"?u=u.slice(0,-1):u+=s.move("]"),u}function vZ(){return"!"}nM.peek=yZ;function nM(e,t,n){let r=e.value||"",i="`",o=-1;for(;new RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++o<n.unsafe.length;){const a=n.unsafe[o],s=n.compilePattern(a);let u;if(a.atBreak)for(;u=s.exec(r);){let f=u.index;r.charCodeAt(f)===10&&r.charCodeAt(f-1)===13&&f--,r=r.slice(0,f)+" "+r.slice(u.index+1)}}return i+r+i}function yZ(){return"`"}function rM(e,t){const n=S1(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(n===e.url||"mailto:"+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}iM.peek=xZ;function iM(e,t,n,r){const i=T1(n),o=i==='"'?"Quote":"Apostrophe",a=n.createTracker(r);let s,u;if(rM(e,n)){const d=n.stack;n.stack=[],s=n.enter("autolink");let h=a.move("<");return h+=a.move(n.containerPhrasing(e,{before:h,after:">",...a.current()})),h+=a.move(">"),s(),n.stack=d,h}s=n.enter("link"),u=n.enter("label");let f=a.move("[");return f+=a.move(n.containerPhrasing(e,{before:f,after:"](",...a.current()})),f+=a.move("]("),u(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(u=n.enter("destinationLiteral"),f+=a.move("<"),f+=a.move(n.safe(e.url,{before:f,after:">",...a.current()})),f+=a.move(">")):(u=n.enter("destinationRaw"),f+=a.move(n.safe(e.url,{before:f,after:e.title?" ":")",...a.current()}))),u(),e.title&&(u=n.enter(`title${o}`),f+=a.move(" "+i),f+=a.move(n.safe(e.title,{before:f,after:i,...a.current()})),f+=a.move(i),u()),f+=a.move(")"),s(),f}function xZ(e,t,n){return rM(e,n)?"<":"["}oM.peek=bZ;function oM(e,t,n,r){const i=e.referenceType,o=n.enter("linkReference");let a=n.enter("label");const s=n.createTracker(r);let u=s.move("[");const f=n.containerPhrasing(e,{before:u,after:"]",...s.current()});u+=s.move(f+"]["),a();const d=n.stack;n.stack=[],a=n.enter("reference");const h=n.safe(n.associationId(e),{before:u,after:"]",...s.current()});return a(),n.stack=d,o(),i==="full"||!f||f!==h?u+=s.move(h+"]"):i==="shortcut"?u=u.slice(0,-1):u+=s.move("]"),u}function bZ(){return"["}function _1(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function wZ(e){const t=_1(e),n=e.options.bulletOther;if(!n)return t==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function SZ(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function aM(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function kZ(e,t,n,r){const i=n.enter("list"),o=n.bulletCurrent;let a=e.ordered?SZ(n):_1(n);const s=e.ordered?a==="."?")":".":wZ(n);let u=t&&n.bulletLastUsed?a===n.bulletLastUsed:!1;if(!e.ordered){const d=e.children?e.children[0]:void 0;if((a==="*"||a==="-")&&d&&(!d.children||!d.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(u=!0),aM(n)===a&&d){let h=-1;for(;++h<e.children.length;){const m=e.children[h];if(m&&m.type==="listItem"&&m.children&&m.children[0]&&m.children[0].type==="thematicBreak"){u=!0;break}}}}u&&(a=s),n.bulletCurrent=a;const f=n.containerFlow(e,r);return n.bulletLastUsed=a,n.bulletCurrent=o,i(),f}function PZ(e){const t=e.options.listItemIndent||"one";if(t!=="tab"&&t!=="one"&&t!=="mixed")throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function CZ(e,t,n,r){const i=PZ(n);let o=n.bulletCurrent||_1(n);t&&t.type==="list"&&t.ordered&&(o=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+o);let a=o.length+1;(i==="tab"||i==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(a=Math.ceil(a/4)*4);const s=n.createTracker(r);s.move(o+" ".repeat(a-o.length)),s.shift(a);const u=n.enter("listItem"),f=n.indentLines(n.containerFlow(e,s.current()),d);return u(),f;function d(h,m,v){return m?(v?"":" ".repeat(a))+h:(v?o:o+" ".repeat(a-o.length))+h}}function EZ(e,t,n,r){const i=n.enter("paragraph"),o=n.enter("phrasing"),a=n.containerPhrasing(e,r);return o(),i(),a}const jZ=Mm(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function OZ(e,t,n,r){return(e.children.some(function(a){return jZ(a)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function NZ(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}sM.peek=AZ;function sM(e,t,n,r){const i=NZ(n),o=n.enter("strong"),a=n.createTracker(r),s=a.move(i+i);let u=a.move(n.containerPhrasing(e,{after:i,before:s,...a.current()}));const f=u.charCodeAt(0),d=yp(r.before.charCodeAt(r.before.length-1),f,i);d.inside&&(u=Wc(f)+u.slice(1));const h=u.charCodeAt(u.length-1),m=yp(r.after.charCodeAt(0),h,i);m.inside&&(u=u.slice(0,-1)+Wc(h));const v=a.move(i+i);return o(),n.attentionEncodeSurroundingInfo={after:m.outside,before:d.outside},s+u+v}function AZ(e,t,n){return n.options.strong||"*"}function TZ(e,t,n,r){return n.safe(e.value,r)}function _Z(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function IZ(e,t,n){const r=(aM(n)+(n.options.ruleSpaces?" ":"")).repeat(_Z(n));return n.options.ruleSpaces?r.slice(0,-1):r}const lM={blockquote:nZ,break:fO,code:lZ,definition:cZ,emphasis:ZD,hardBreak:fO,heading:pZ,html:JD,image:eM,imageReference:tM,inlineCode:nM,link:iM,linkReference:oM,list:kZ,listItem:CZ,paragraph:EZ,root:OZ,strong:sM,text:TZ,thematicBreak:IZ};function RZ(){return{enter:{table:DZ,tableData:dO,tableHeader:dO,tableRow:LZ},exit:{codeText:$Z,table:MZ,tableData:ax,tableHeader:ax,tableRow:ax}}}function DZ(e){const t=e._align;this.enter({type:"table",align:t.map(function(n){return n==="none"?null:n}),children:[]},e),this.data.inTable=!0}function MZ(e){this.exit(e),this.data.inTable=void 0}function LZ(e){this.enter({type:"tableRow",children:[]},e)}function ax(e){this.exit(e)}function dO(e){this.enter({type:"tableCell",children:[]},e)}function $Z(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,FZ));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function FZ(e,t){return t==="|"?t:e}function zZ(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,o=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
|
|
270
270
|
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:m,table:a,tableCell:u,tableRow:s}};function a(v,w,b,S){return f(d(v,b,S),v.align)}function s(v,w,b,S){const k=h(v,b,S),C=f([k]);return C.slice(0,C.indexOf(`
|
|
271
|
-
`))}function u(v,w,b,S){const k=b.enter("tableCell"),C=b.enter("phrasing"),j=b.containerPhrasing(v,{...S,before:o,after:o});return C(),k(),j}function f(v,w){return eZ(v,{align:w,alignDelimiters:r,padding:n,stringLength:i})}function d(v,w,b){const S=v.children;let k=-1;const C=[],j=w.enter("table");for(;++k<S.length;)C[k]=h(S[k],w,b);return j(),C}function h(v,w,b){const S=v.children;let k=-1;const C=[],j=w.enter("tableRow");for(;++k<S.length;)C[k]=u(S[k],v,w,b);return j(),C}function m(v,w,b){let S=lM.inlineCode(v,w,b);return b.stack.includes("tableCell")&&(S=S.replace(/\|/g,"\\$&")),S}}function BZ(){return{exit:{taskListCheckValueChecked:hO,taskListCheckValueUnchecked:hO,paragraph:WZ}}}function UZ(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:HZ}}}function hO(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function WZ(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const r=n.children[0];if(r&&r.type==="text"){const i=t.children;let o=-1,a;for(;++o<i.length;){const s=i[o];if(s.type==="paragraph"){a=s;break}}a===n&&(r.value=r.value.slice(1),r.value.length===0?n.children.shift():n.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,n.position.start=Object.assign({},r.position.start)))}}this.exit(e)}function HZ(e,t,n,r){const i=e.children[0],o=typeof e.checked=="boolean"&&i&&i.type==="paragraph",a="["+(e.checked?"x":" ")+"] ",s=n.createTracker(r);o&&s.move(a);let u=lM.listItem(e,t,n,{...r,...s.current()});return o&&(u=u.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,f)),u;function f(d){return d+a}}function VZ(){return[kX(),HX(),GX(),RZ(),BZ()]}function qZ(e){return{extensions:[PX(),VX(e),YX(),zZ(e),UZ()]}}const KZ={tokenize:JZ,partial:!0},uM={tokenize:eJ,partial:!0},cM={tokenize:tJ,partial:!0},fM={tokenize:nJ,partial:!0},GZ={tokenize:rJ,partial:!0},dM={name:"wwwAutolink",tokenize:XZ,previous:pM},hM={name:"protocolAutolink",tokenize:ZZ,previous:mM},Oo={name:"emailAutolink",tokenize:QZ,previous:gM},Vi={};function YZ(){return{text:Vi}}let Xa=48;for(;Xa<123;)Vi[Xa]=Oo,Xa++,Xa===58?Xa=65:Xa===91&&(Xa=97);Vi[43]=Oo;Vi[45]=Oo;Vi[46]=Oo;Vi[95]=Oo;Vi[72]=[Oo,hM];Vi[104]=[Oo,hM];Vi[87]=[Oo,dM];Vi[119]=[Oo,dM];function QZ(e,t,n){const r=this;let i,o;return a;function a(h){return!Ab(h)||!gM.call(r,r.previous)||I1(r.events)?n(h):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),s(h))}function s(h){return Ab(h)?(e.consume(h),s):h===64?(e.consume(h),u):n(h)}function u(h){return h===46?e.check(GZ,d,f)(h):h===45||h===95||En(h)?(o=!0,e.consume(h),u):d(h)}function f(h){return e.consume(h),i=!0,u}function d(h){return o&&i&&Dn(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(h)):n(h)}}function XZ(e,t,n){const r=this;return i;function i(a){return a!==87&&a!==119||!pM.call(r,r.previous)||I1(r.events)?n(a):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(KZ,e.attempt(uM,e.attempt(cM,o),n),n)(a))}function o(a){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(a)}}function ZZ(e,t,n){const r=this;let i="",o=!1;return a;function a(h){return(h===72||h===104)&&mM.call(r,r.previous)&&!I1(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),i+=String.fromCodePoint(h),e.consume(h),s):n(h)}function s(h){if(Dn(h)&&i.length<5)return i+=String.fromCodePoint(h),e.consume(h),s;if(h===58){const m=i.toLowerCase();if(m==="http"||m==="https")return e.consume(h),u}return n(h)}function u(h){return h===47?(e.consume(h),o?f:(o=!0,u)):n(h)}function f(h){return h===null||mp(h)||ht(h)||js(h)||Im(h)?n(h):e.attempt(uM,e.attempt(cM,d),n)(h)}function d(h){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(h)}}function JZ(e,t,n){let r=0;return i;function i(a){return(a===87||a===119)&&r<3?(r++,e.consume(a),i):a===46&&r===3?(e.consume(a),o):n(a)}function o(a){return a===null?n(a):t(a)}}function eJ(e,t,n){let r,i,o;return a;function a(f){return f===46||f===95?e.check(fM,u,s)(f):f===null||ht(f)||js(f)||f!==45&&Im(f)?u(f):(o=!0,e.consume(f),a)}function s(f){return f===95?r=!0:(i=r,r=void 0),e.consume(f),a}function u(f){return i||r||!o?n(f):t(f)}}function tJ(e,t){let n=0,r=0;return i;function i(a){return a===40?(n++,e.consume(a),i):a===41&&r<n?o(a):a===33||a===34||a===38||a===39||a===41||a===42||a===44||a===46||a===58||a===59||a===60||a===63||a===93||a===95||a===126?e.check(fM,t,o)(a):a===null||ht(a)||js(a)?t(a):(e.consume(a),i)}function o(a){return a===41&&r++,e.consume(a),i}}function nJ(e,t,n){return r;function r(s){return s===33||s===34||s===39||s===41||s===42||s===44||s===46||s===58||s===59||s===63||s===95||s===126?(e.consume(s),r):s===38?(e.consume(s),o):s===93?(e.consume(s),i):s===60||s===null||ht(s)||js(s)?t(s):n(s)}function i(s){return s===null||s===40||s===91||ht(s)||js(s)?t(s):r(s)}function o(s){return Dn(s)?a(s):n(s)}function a(s){return s===59?(e.consume(s),r):Dn(s)?(e.consume(s),a):n(s)}}function rJ(e,t,n){return r;function r(o){return e.consume(o),i}function i(o){return En(o)?n(o):t(o)}}function pM(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||ht(e)}function mM(e){return!Dn(e)}function gM(e){return!(e===47||Ab(e))}function Ab(e){return e===43||e===45||e===46||e===95||En(e)}function I1(e){let t=e.length,n=!1;for(;t--;){const r=e[t][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const iJ={tokenize:dJ,partial:!0};function oJ(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:uJ,continuation:{tokenize:cJ},exit:fJ}},text:{91:{name:"gfmFootnoteCall",tokenize:lJ},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:aJ,resolveTo:sJ}}}}function aJ(e,t,n){const r=this;let i=r.events.length;const o=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a;for(;i--;){const u=r.events[i][1];if(u.type==="labelImage"){a=u;break}if(u.type==="gfmFootnoteCall"||u.type==="labelLink"||u.type==="label"||u.type==="image"||u.type==="link")break}return s;function s(u){if(!a||!a._balanced)return n(u);const f=ti(r.sliceSerialize({start:a.end,end:r.now()}));return f.codePointAt(0)!==94||!o.includes(f.slice(1))?n(u):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(u),e.exit("gfmFootnoteCallLabelMarker"),t(u))}}function sJ(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;const o={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},a={type:"chunkString",contentType:"string",start:Object.assign({},o.start),end:Object.assign({},o.end)},s=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",i,t],["exit",i,t],["enter",o,t],["enter",a,t],["exit",a,t],["exit",o,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...s),e}function lJ(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o=0,a;return s;function s(h){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(h),e.exit("gfmFootnoteCallLabelMarker"),u}function u(h){return h!==94?n(h):(e.enter("gfmFootnoteCallMarker"),e.consume(h),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",f)}function f(h){if(o>999||h===93&&!a||h===null||h===91||ht(h))return n(h);if(h===93){e.exit("chunkString");const m=e.exit("gfmFootnoteCallString");return i.includes(ti(r.sliceSerialize(m)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(h),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(h)}return ht(h)||(a=!0),o++,e.consume(h),h===92?d:f}function d(h){return h===91||h===92||h===93?(e.consume(h),o++,f):f(h)}}function uJ(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o,a=0,s;return u;function u(w){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(w),e.exit("gfmFootnoteDefinitionLabelMarker"),f}function f(w){return w===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(w),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",d):n(w)}function d(w){if(a>999||w===93&&!s||w===null||w===91||ht(w))return n(w);if(w===93){e.exit("chunkString");const b=e.exit("gfmFootnoteDefinitionLabelString");return o=ti(r.sliceSerialize(b)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(w),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),m}return ht(w)||(s=!0),a++,e.consume(w),w===92?h:d}function h(w){return w===91||w===92||w===93?(e.consume(w),a++,d):d(w)}function m(w){return w===58?(e.enter("definitionMarker"),e.consume(w),e.exit("definitionMarker"),i.includes(o)||i.push(o),Ye(e,v,"gfmFootnoteDefinitionWhitespace")):n(w)}function v(w){return t(w)}}function cJ(e,t,n){return e.check(xf,t,e.attempt(iJ,t,n))}function fJ(e){e.exit("gfmFootnoteDefinition")}function dJ(e,t,n){const r=this;return Ye(e,i,"gfmFootnoteDefinitionIndent",5);function i(o){const a=r.events[r.events.length-1];return a&&a[1].type==="gfmFootnoteDefinitionIndent"&&a[2].sliceSerialize(a[1],!0).length===4?t(o):n(o)}}function hJ(e){let n=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:o,resolveAll:i};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function i(a,s){let u=-1;for(;++u<a.length;)if(a[u][0]==="enter"&&a[u][1].type==="strikethroughSequenceTemporary"&&a[u][1]._close){let f=u;for(;f--;)if(a[f][0]==="exit"&&a[f][1].type==="strikethroughSequenceTemporary"&&a[f][1]._open&&a[u][1].end.offset-a[u][1].start.offset===a[f][1].end.offset-a[f][1].start.offset){a[u][1].type="strikethroughSequence",a[f][1].type="strikethroughSequence";const d={type:"strikethrough",start:Object.assign({},a[f][1].start),end:Object.assign({},a[u][1].end)},h={type:"strikethroughText",start:Object.assign({},a[f][1].end),end:Object.assign({},a[u][1].start)},m=[["enter",d,s],["enter",a[f][1],s],["exit",a[f][1],s],["enter",h,s]],v=s.parser.constructs.insideSpan.null;v&&mr(m,m.length,0,Rm(v,a.slice(f+1,u),s)),mr(m,m.length,0,[["exit",h,s],["enter",a[u][1],s],["exit",a[u][1],s],["exit",d,s]]),mr(a,f-1,u-f+3,m),u=f+m.length-2;break}}for(u=-1;++u<a.length;)a[u][1].type==="strikethroughSequenceTemporary"&&(a[u][1].type="data");return a}function o(a,s,u){const f=this.previous,d=this.events;let h=0;return m;function m(w){return f===126&&d[d.length-1][1].type!=="characterEscape"?u(w):(a.enter("strikethroughSequenceTemporary"),v(w))}function v(w){const b=Vl(f);if(w===126)return h>1?u(w):(a.consume(w),h++,v);if(h<2&&!n)return u(w);const S=a.exit("strikethroughSequenceTemporary"),k=Vl(w);return S._open=!k||k===2&&!!b,S._close=!b||b===2&&!!k,s(w)}}}class pJ{constructor(){this.map=[]}add(t,n,r){mJ(this,t,n,r)}consume(t){if(this.map.sort(function(o,a){return o[0]-a[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];r.push(t.slice()),t.length=0;let i=r.pop();for(;i;){for(const o of i)t.push(o);i=r.pop()}this.map.length=0}}function mJ(e,t,n,r){let i=0;if(!(n===0&&r.length===0)){for(;i<e.map.length;){if(e.map[i][0]===t){e.map[i][1]+=n,e.map[i][2].push(...r);return}i+=1}e.map.push([t,n,r])}}function gJ(e,t){let n=!1;const r=[];for(;t<e.length;){const i=e[t];if(n){if(i[0]==="enter")i[1].type==="tableContent"&&r.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(i[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const o=r.length-1;r[o]=r[o]==="left"?"center":"right"}}else if(i[1].type==="tableDelimiterRow")break}else i[0]==="enter"&&i[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return r}function vJ(){return{flow:{null:{name:"table",tokenize:yJ,resolveAll:xJ}}}}function yJ(e,t,n){const r=this;let i=0,o=0,a;return s;function s(D){let U=r.events.length-1;for(;U>-1;){const W=r.events[U][1].type;if(W==="lineEnding"||W==="linePrefix")U--;else break}const L=U>-1?r.events[U][1].type:null,q=L==="tableHead"||L==="tableRow"?N:u;return q===N&&r.parser.lazy[r.now().line]?n(D):q(D)}function u(D){return e.enter("tableHead"),e.enter("tableRow"),f(D)}function f(D){return D===124||(a=!0,o+=1),d(D)}function d(D){return D===null?n(D):_e(D)?o>1?(o=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(D),e.exit("lineEnding"),v):n(D):We(D)?Ye(e,d,"whitespace")(D):(o+=1,a&&(a=!1,i+=1),D===124?(e.enter("tableCellDivider"),e.consume(D),e.exit("tableCellDivider"),a=!0,d):(e.enter("data"),h(D)))}function h(D){return D===null||D===124||ht(D)?(e.exit("data"),d(D)):(e.consume(D),D===92?m:h)}function m(D){return D===92||D===124?(e.consume(D),h):h(D)}function v(D){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(D):(e.enter("tableDelimiterRow"),a=!1,We(D)?Ye(e,w,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(D):w(D))}function w(D){return D===45||D===58?S(D):D===124?(a=!0,e.enter("tableCellDivider"),e.consume(D),e.exit("tableCellDivider"),b):A(D)}function b(D){return We(D)?Ye(e,S,"whitespace")(D):S(D)}function S(D){return D===58?(o+=1,a=!0,e.enter("tableDelimiterMarker"),e.consume(D),e.exit("tableDelimiterMarker"),k):D===45?(o+=1,k(D)):D===null||_e(D)?O(D):A(D)}function k(D){return D===45?(e.enter("tableDelimiterFiller"),C(D)):A(D)}function C(D){return D===45?(e.consume(D),C):D===58?(a=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(D),e.exit("tableDelimiterMarker"),j):(e.exit("tableDelimiterFiller"),j(D))}function j(D){return We(D)?Ye(e,O,"whitespace")(D):O(D)}function O(D){return D===124?w(D):D===null||_e(D)?!a||i!==o?A(D):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(D)):A(D)}function A(D){return n(D)}function N(D){return e.enter("tableRow"),I(D)}function I(D){return D===124?(e.enter("tableCellDivider"),e.consume(D),e.exit("tableCellDivider"),I):D===null||_e(D)?(e.exit("tableRow"),t(D)):We(D)?Ye(e,I,"whitespace")(D):(e.enter("data"),T(D))}function T(D){return D===null||D===124||ht(D)?(e.exit("data"),I(D)):(e.consume(D),D===92?$:T)}function $(D){return D===92||D===124?(e.consume(D),T):T(D)}}function xJ(e,t){let n=-1,r=!0,i=0,o=[0,0,0,0],a=[0,0,0,0],s=!1,u=0,f,d,h;const m=new pJ;for(;++n<e.length;){const v=e[n],w=v[1];v[0]==="enter"?w.type==="tableHead"?(s=!1,u!==0&&(pO(m,t,u,f,d),d=void 0,u=0),f={type:"table",start:Object.assign({},w.start),end:Object.assign({},w.end)},m.add(n,0,[["enter",f,t]])):w.type==="tableRow"||w.type==="tableDelimiterRow"?(r=!0,h=void 0,o=[0,0,0,0],a=[0,n+1,0,0],s&&(s=!1,d={type:"tableBody",start:Object.assign({},w.start),end:Object.assign({},w.end)},m.add(n,0,[["enter",d,t]])),i=w.type==="tableDelimiterRow"?2:d?3:1):i&&(w.type==="data"||w.type==="tableDelimiterMarker"||w.type==="tableDelimiterFiller")?(r=!1,a[2]===0&&(o[1]!==0&&(a[0]=a[1],h=ph(m,t,o,i,void 0,h),o=[0,0,0,0]),a[2]=n)):w.type==="tableCellDivider"&&(r?r=!1:(o[1]!==0&&(a[0]=a[1],h=ph(m,t,o,i,void 0,h)),o=a,a=[o[1],n,0,0])):w.type==="tableHead"?(s=!0,u=n):w.type==="tableRow"||w.type==="tableDelimiterRow"?(u=n,o[1]!==0?(a[0]=a[1],h=ph(m,t,o,i,n,h)):a[1]!==0&&(h=ph(m,t,a,i,n,h)),i=0):i&&(w.type==="data"||w.type==="tableDelimiterMarker"||w.type==="tableDelimiterFiller")&&(a[3]=n)}for(u!==0&&pO(m,t,u,f,d),m.consume(t.events),n=-1;++n<t.events.length;){const v=t.events[n];v[0]==="enter"&&v[1].type==="table"&&(v[1]._align=gJ(t.events,n))}return e}function ph(e,t,n,r,i,o){const a=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",s="tableContent";n[0]!==0&&(o.end=Object.assign({},Sl(t.events,n[0])),e.add(n[0],0,[["exit",o,t]]));const u=Sl(t.events,n[1]);if(o={type:a,start:Object.assign({},u),end:Object.assign({},u)},e.add(n[1],0,[["enter",o,t]]),n[2]!==0){const f=Sl(t.events,n[2]),d=Sl(t.events,n[3]),h={type:s,start:Object.assign({},f),end:Object.assign({},d)};if(e.add(n[2],0,[["enter",h,t]]),r!==2){const m=t.events[n[2]],v=t.events[n[3]];if(m[1].end=Object.assign({},v[1].end),m[1].type="chunkText",m[1].contentType="text",n[3]>n[2]+1){const w=n[2]+1,b=n[3]-n[2]-1;e.add(w,b,[])}}e.add(n[3]+1,0,[["exit",h,t]])}return i!==void 0&&(o.end=Object.assign({},Sl(t.events,i)),e.add(i,0,[["exit",o,t]]),o=void 0),o}function pO(e,t,n,r,i){const o=[],a=Sl(t.events,n);i&&(i.end=Object.assign({},a),o.push(["exit",i,t])),r.end=Object.assign({},a),o.push(["exit",r,t]),e.add(n+1,0,o)}function Sl(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const bJ={name:"tasklistCheck",tokenize:SJ};function wJ(){return{text:{91:bJ}}}function SJ(e,t,n){const r=this;return i;function i(u){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(u):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(u),e.exit("taskListCheckMarker"),o)}function o(u){return ht(u)?(e.enter("taskListCheckValueUnchecked"),e.consume(u),e.exit("taskListCheckValueUnchecked"),a):u===88||u===120?(e.enter("taskListCheckValueChecked"),e.consume(u),e.exit("taskListCheckValueChecked"),a):n(u)}function a(u){return u===93?(e.enter("taskListCheckMarker"),e.consume(u),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),s):n(u)}function s(u){return _e(u)?t(u):We(u)?e.check({tokenize:kJ},t,n)(u):n(u)}}function kJ(e,t,n){return Ye(e,r,"whitespace");function r(i){return i===null?n(i):t(i)}}function PJ(e){return jD([YZ(),oJ(),hJ(e),vJ(),wJ()])}const CJ={};function EJ(e){const t=this,n=e||CJ,r=t.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),o=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),a=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(PJ(n)),o.push(VZ()),a.push(qZ(n))}function Hh({content:e,className:t="",variant:n="default"}){const r=n==="dark";return g.jsx("div",{className:`prose prose-sm prose-stone dark:prose-invert max-w-none ${t}`,children:g.jsx(hX,{remarkPlugins:[EJ],components:{pre:({children:i})=>g.jsx("pre",{className:r?"bg-[#1a1816]/60 text-stone-100 rounded-lg p-3 overflow-x-auto my-2 text-xs border border-white/20 [&>code]:bg-transparent [&>code]:p-0 [&>code]:border-0 [&>code]:text-inherit":"bg-stone-700 dark:bg-stone-800 text-stone-100 rounded-lg p-3 overflow-x-auto my-2 text-xs [&>code]:bg-transparent [&>code]:p-0 [&>code]:border-0 [&>code]:text-inherit",children:i}),code:({children:i,className:o})=>o?g.jsx("code",{className:"text-xs font-mono",children:i}):g.jsx("code",{className:r?"bg-white/15 text-white px-1.5 py-0.5 rounded text-xs font-mono":"bg-stone-200 dark:bg-stone-700 text-stone-700 dark:text-stone-200 px-1.5 py-0.5 rounded text-xs font-mono",children:i}),p:({children:i})=>g.jsx("p",{className:"my-1.5 leading-relaxed",children:i}),ul:({children:i})=>g.jsx("ul",{className:"list-disc list-inside my-1.5 space-y-0.5",children:i}),ol:({children:i})=>g.jsx("ol",{className:"list-decimal list-inside my-1.5 space-y-0.5",children:i}),li:({children:i})=>g.jsx("li",{className:"ml-2",children:i}),h1:({children:i})=>g.jsx("h1",{className:"text-lg font-bold mt-3 mb-1.5",children:i}),h2:({children:i})=>g.jsx("h2",{className:"text-base font-bold mt-2.5 mb-1",children:i}),h3:({children:i})=>g.jsx("h3",{className:"text-sm font-bold mt-2 mb-1",children:i}),a:({children:i,href:o})=>g.jsx("a",{href:o,target:"_blank",rel:"noopener noreferrer",className:r?"text-orange-200 hover:underline":"text-[#C15F3C] dark:text-orange-400 hover:underline",children:i}),blockquote:({children:i})=>g.jsx("blockquote",{className:r?"border-l-2 border-white/30 pl-3 my-2 text-stone-200 italic":"border-l-2 border-stone-300 dark:border-stone-600 pl-3 my-2 text-stone-600 dark:text-stone-400 italic",children:i}),table:({children:i})=>g.jsx("div",{className:"overflow-x-auto my-2",children:g.jsx("table",{className:"min-w-full border-collapse text-xs",children:i})}),th:({children:i})=>g.jsx("th",{className:r?"border border-white/20 px-2 py-1 bg-white/10 font-medium text-left":"border border-stone-300 dark:border-stone-600 px-2 py-1 bg-stone-100 dark:bg-stone-800 font-medium text-left",children:i}),td:({children:i})=>g.jsx("td",{className:r?"border border-white/20 px-2 py-1":"border border-stone-300 dark:border-stone-600 px-2 py-1",children:i}),hr:()=>g.jsx("hr",{className:r?"my-3 border-white/20":"my-3 border-stone-200 dark:border-stone-700"}),strong:({children:i})=>g.jsx("strong",{className:"font-semibold",children:i}),em:({children:i})=>g.jsx("em",{className:"italic",children:i})},children:e})})}const jJ={summary:g.jsx(sR,{className:"h-4 w-4"}),plan:g.jsx(jV,{className:"h-4 w-4"}),discussions:g.jsx(MV,{className:"h-4 w-4"}),codeExamples:g.jsx(NV,{className:"h-4 w-4"}),references:g.jsx(RV,{className:"h-4 w-4"}),handoff:g.jsx(hV,{className:"h-4 w-4"}),errors:g.jsx(UV,{className:"h-4 w-4"})},OJ={summary:"border-l-blue-500",plan:"border-l-purple-500",discussions:"border-l-indigo-500",codeExamples:"border-l-green-500",references:"border-l-yellow-500",handoff:"border-l-orange-500",errors:"border-l-red-500"};function Za({sectionKey:e,label:t,children:n}){const[r,i]=y.useState(!0),o=jJ[e]||g.jsx(sR,{className:"h-4 w-4"}),a=OJ[e]||"border-l-gray-500";return g.jsxs("div",{className:`border-l-4 ${a} bg-card rounded-r-lg shadow-sm overflow-hidden`,children:[g.jsxs("button",{type:"button",className:"w-full px-4 py-3 flex items-center justify-between bg-muted/30 hover:bg-muted/50 transition-colors",onClick:()=>i(!r),children:[g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx("span",{className:"text-muted-foreground",children:o}),g.jsx("span",{className:"font-medium text-sm",children:t})]}),g.jsx("span",{className:"text-muted-foreground",children:r?g.jsx(n1,{className:"h-4 w-4"}):g.jsx(kV,{className:"h-4 w-4"})})]}),r&&g.jsx("div",{className:"px-4 py-3",children:n})]})}function NJ({summary:e,t}){return g.jsxs("div",{className:"space-y-2 text-sm",children:[e.goal&&g.jsxs("div",{children:[g.jsxs("span",{className:"text-muted-foreground",children:[t("context.fields.goal"),":"]})," ",g.jsx("span",{children:e.goal})]}),e.outcome&&g.jsxs("div",{children:[g.jsxs("span",{className:"text-muted-foreground",children:[t("context.fields.outcome"),":"]})," ",g.jsx(tt,{variant:e.outcome==="success"?"default":"secondary",className:"text-xs",children:e.outcome})]}),e.description&&g.jsxs("div",{children:[g.jsxs("span",{className:"text-muted-foreground",children:[t("context.fields.description"),":"]}),g.jsx("p",{className:"mt-1 whitespace-pre-wrap",children:e.description})]}),e.sessionType&&g.jsxs("div",{children:[g.jsxs("span",{className:"text-muted-foreground",children:[t("context.fields.type"),":"]})," ",g.jsx(tt,{variant:"outline",className:"text-xs",children:e.sessionType})]})]})}function AJ({plan:e,t}){return g.jsxs("div",{className:"space-y-3 text-sm",children:[e.goals&&e.goals.length>0&&g.jsxs("div",{children:[g.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:t("context.fields.goals")}),g.jsx("ul",{className:"list-disc list-inside space-y-1",children:e.goals.map(n=>g.jsx("li",{children:n},n))})]}),e.tasks&&e.tasks.length>0&&g.jsxs("div",{children:[g.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:t("context.fields.tasks")}),g.jsx("ul",{className:"space-y-1 font-mono text-xs",children:e.tasks.map(n=>g.jsx("li",{className:n.startsWith("[x]")?"text-green-600 dark:text-green-400":"",children:n},n))})]}),e.remaining&&e.remaining.length>0&&g.jsxs("div",{children:[g.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:t("context.fields.remaining")}),g.jsx("ul",{className:"list-disc list-inside space-y-1 text-orange-600 dark:text-orange-400",children:e.remaining.map(n=>g.jsx("li",{children:n},n))})]})]})}function TJ({discussions:e,t}){return g.jsx("div",{className:"space-y-3",children:e.map(n=>g.jsxs("div",{className:"bg-muted/30 rounded p-3 space-y-2 text-sm",children:[g.jsx("div",{className:"font-medium",children:n.topic}),g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsxs("span",{className:"text-muted-foreground",children:[t("context.fields.decision"),":"]}),g.jsx(tt,{variant:"default",className:"text-xs",children:n.decision})]}),n.reasoning&&g.jsx("div",{className:"text-muted-foreground text-xs",children:n.reasoning}),n.alternatives&&n.alternatives.length>0&&g.jsxs("div",{className:"text-xs",children:[g.jsxs("span",{className:"text-muted-foreground",children:[t("context.fields.alternatives"),":"," "]}),n.alternatives.join(", ")]})]},`${n.topic}-${n.decision}`))})}function _J({codeExamples:e,t}){return g.jsx("div",{className:"space-y-3",children:e.map(n=>g.jsxs("div",{className:"space-y-2",children:[g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx(tt,{variant:"outline",className:"text-xs font-mono",children:n.file}),n.description&&g.jsx("span",{className:"text-xs text-muted-foreground",children:n.description})]}),n.before&&g.jsxs("div",{children:[g.jsxs("div",{className:"text-xs text-muted-foreground mb-1",children:[t("context.fields.before"),":"]}),g.jsx("pre",{className:"bg-muted p-2 rounded text-xs font-mono overflow-x-auto",children:n.before})]}),n.after&&g.jsxs("div",{children:[g.jsxs("div",{className:"text-xs text-muted-foreground mb-1",children:[t("context.fields.after"),":"]}),g.jsx("pre",{className:"bg-muted p-2 rounded text-xs font-mono overflow-x-auto",children:n.after})]})]},`${n.file}-${n.description||""}`))})}function IJ({errors:e,t}){return g.jsx("div",{className:"space-y-3",children:e.map(n=>g.jsxs("div",{className:"bg-destructive/10 border border-destructive/20 rounded p-3 space-y-2 text-sm",children:[g.jsx("div",{className:"font-mono text-xs text-destructive",children:n.error}),n.context&&g.jsxs("div",{className:"text-xs",children:[g.jsxs("span",{className:"text-muted-foreground",children:[t("context.fields.context"),":"," "]}),n.context]}),n.cause&&g.jsxs("div",{className:"text-xs",children:[g.jsxs("span",{className:"text-muted-foreground",children:[t("context.fields.cause"),":"," "]}),n.cause]}),n.solution&&g.jsxs("div",{className:"text-xs text-green-600 dark:text-green-400",children:[g.jsxs("span",{className:"text-muted-foreground",children:[t("context.fields.solution"),":"," "]}),n.solution]}),n.files&&n.files.length>0&&g.jsx("div",{className:"flex flex-wrap gap-1",children:n.files.map(r=>g.jsx(tt,{variant:"secondary",className:"text-xs font-mono",children:r},r))})]},`${n.error}-${n.cause||""}`))})}function RJ({handoff:e,t}){return g.jsxs("div",{className:"space-y-2 text-sm",children:[e.stoppedReason&&g.jsxs("div",{children:[g.jsxs("span",{className:"text-muted-foreground",children:[t("context.fields.stoppedReason"),":"]})," ",g.jsx("span",{children:e.stoppedReason})]}),e.notes&&g.jsxs("div",{children:[g.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:t("context.fields.notes")}),Array.isArray(e.notes)?e.notes.length>0&&g.jsx("ul",{className:"list-disc list-inside space-y-1",children:e.notes.map(n=>g.jsx("li",{children:n},n))}):g.jsx("p",{className:"whitespace-pre-wrap",children:e.notes})]}),e.nextSteps&&e.nextSteps.length>0&&g.jsxs("div",{children:[g.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:t("context.fields.nextSteps")}),g.jsx("ul",{className:"list-disc list-inside space-y-1 text-primary",children:e.nextSteps.map(n=>g.jsx("li",{children:n},n))})]})]})}function DJ({references:e}){return g.jsx("div",{className:"space-y-2",children:e.map(t=>typeof t=="string"?g.jsx("div",{className:"flex items-start gap-2 text-sm",children:g.jsx("code",{className:"bg-muted px-1.5 py-0.5 rounded text-xs font-mono",children:t})},t):g.jsxs("div",{className:"flex items-start gap-2 text-sm",children:[t.type&&g.jsx(tt,{variant:"outline",className:"text-xs",children:t.type}),t.url?g.jsx("a",{href:t.url,target:"_blank",rel:"noreferrer",className:"text-primary hover:underline",children:t.title||t.url}):t.path?g.jsx("code",{className:"bg-muted px-1.5 py-0.5 rounded text-xs font-mono",children:t.path}):t.title,t.description&&g.jsxs("span",{className:"text-muted-foreground text-xs",children:["- ",t.description]})]},`${t.type||""}-${t.url||t.path||t.title||""}`))})}function MJ({session:e,embedded:t=!1}){var a,s,u,f,d,h,m,v;const{t:n}=Ke("sessions"),r=[e.summary&&(e.summary.goal||e.summary.description),e.plan&&(((a=e.plan.tasks)==null?void 0:a.length)||((s=e.plan.remaining)==null?void 0:s.length)),e.discussions&&e.discussions.length>0,e.codeExamples&&e.codeExamples.length>0,e.errors&&e.errors.length>0,e.handoff&&(e.handoff.stoppedReason||((u=e.handoff.notes)==null?void 0:u.length)||((f=e.handoff.nextSteps)==null?void 0:f.length)),e.references&&e.references.length>0].filter(Boolean).length;if(r===0)return null;const i=g.jsxs(g.Fragment,{children:[g.jsxs("div",{className:"text-lg flex items-center gap-2 font-semibold",children:[g.jsx(cj,{className:"h-5 w-5 text-muted-foreground"}),n("context.title"),g.jsx(tt,{variant:"secondary",className:"text-xs font-normal",children:n("context.sections",{count:r})})]}),e.summary&&g.jsxs("div",{className:"flex flex-wrap gap-2 mt-2 text-xs text-muted-foreground",children:[e.summary.outcome&&g.jsx(tt,{variant:e.summary.outcome==="success"?"default":"outline",className:"text-xs",children:e.summary.outcome}),e.summary.sessionType&&g.jsx(tt,{variant:"outline",className:"text-xs",children:e.summary.sessionType})]})]}),o=g.jsxs("div",{className:"space-y-3",children:[e.summary&&(e.summary.goal||e.summary.description)&&g.jsx(Za,{sectionKey:"summary",label:n("context.sectionLabels.summary"),children:g.jsx(NJ,{summary:e.summary,t:n})}),e.plan&&(((d=e.plan.tasks)==null?void 0:d.length)||((h=e.plan.remaining)==null?void 0:h.length))&&g.jsx(Za,{sectionKey:"plan",label:n("context.sectionLabels.plan"),children:g.jsx(AJ,{plan:e.plan,t:n})}),e.discussions&&e.discussions.length>0&&g.jsx(Za,{sectionKey:"discussions",label:n("context.sectionLabels.discussions"),children:g.jsx(TJ,{discussions:e.discussions,t:n})}),e.codeExamples&&e.codeExamples.length>0&&g.jsx(Za,{sectionKey:"codeExamples",label:n("context.sectionLabels.code_examples"),children:g.jsx(_J,{codeExamples:e.codeExamples,t:n})}),e.errors&&e.errors.length>0&&g.jsx(Za,{sectionKey:"errors",label:n("context.sectionLabels.errors"),children:g.jsx(IJ,{errors:e.errors,t:n})}),e.handoff&&(e.handoff.stoppedReason||((m=e.handoff.notes)==null?void 0:m.length)||((v=e.handoff.nextSteps)==null?void 0:v.length))&&g.jsx(Za,{sectionKey:"handoff",label:n("context.sectionLabels.handoff"),children:g.jsx(RJ,{handoff:e.handoff,t:n})}),e.references&&e.references.length>0&&g.jsx(Za,{sectionKey:"references",label:n("context.sectionLabels.references"),children:g.jsx(DJ,{references:e.references})})]});return t?g.jsxs("div",{className:"space-y-4",children:[g.jsx("div",{className:"pb-3",children:i}),o]}):g.jsxs(nt,{children:[g.jsxs(tr,{className:"pb-3",children:[g.jsxs(nr,{className:"text-lg flex items-center gap-2",children:[g.jsx(cj,{className:"h-5 w-5 text-muted-foreground"}),n("context.title"),g.jsx(tt,{variant:"secondary",className:"text-xs font-normal",children:n("context.sections",{count:r})})]}),e.summary&&g.jsxs("div",{className:"flex flex-wrap gap-2 mt-2 text-xs text-muted-foreground",children:[e.summary.outcome&&g.jsx(tt,{variant:e.summary.outcome==="success"?"default":"outline",className:"text-xs",children:e.summary.outcome}),e.summary.sessionType&&g.jsx(tt,{variant:"outline",className:"text-xs",children:e.summary.sessionType})]})]}),g.jsx(rt,{children:o})]})}var sx="rovingFocusGroup.onEntryFocus",LJ={bubbles:!1,cancelable:!0},wf="RovingFocusGroup",[Tb,vM,$J]=fR(wf),[FJ,yM]=su(wf,[$J]),[zJ,BJ]=FJ(wf),xM=y.forwardRef((e,t)=>g.jsx(Tb.Provider,{scope:e.__scopeRovingFocusGroup,children:g.jsx(Tb.Slot,{scope:e.__scopeRovingFocusGroup,children:g.jsx(UJ,{...e,ref:t})})}));xM.displayName=wf;var UJ=y.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:o,currentTabStopId:a,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:u,onEntryFocus:f,preventScrollOnEntryFocus:d=!1,...h}=e,m=y.useRef(null),v=Dt(t,m),w=o1(o),[b,S]=Fc({prop:a,defaultProp:s??null,onChange:u,caller:wf}),[k,C]=y.useState(!1),j=Ca(f),O=vM(n),A=y.useRef(!1),[N,I]=y.useState(0);return y.useEffect(()=>{const T=m.current;if(T)return T.addEventListener(sx,j),()=>T.removeEventListener(sx,j)},[j]),g.jsx(zJ,{scope:n,orientation:r,dir:w,loop:i,currentTabStopId:b,onItemFocus:y.useCallback(T=>S(T),[S]),onItemShiftTab:y.useCallback(()=>C(!0),[]),onFocusableItemAdd:y.useCallback(()=>I(T=>T+1),[]),onFocusableItemRemove:y.useCallback(()=>I(T=>T-1),[]),children:g.jsx(ot.div,{tabIndex:k||N===0?-1:0,"data-orientation":r,...h,ref:v,style:{outline:"none",...e.style},onMouseDown:Ge(e.onMouseDown,()=>{A.current=!0}),onFocus:Ge(e.onFocus,T=>{const $=!A.current;if(T.target===T.currentTarget&&$&&!k){const D=new CustomEvent(sx,LJ);if(T.currentTarget.dispatchEvent(D),!D.defaultPrevented){const U=O().filter(X=>X.focusable),L=U.find(X=>X.active),q=U.find(X=>X.id===b),H=[L,q,...U].filter(Boolean).map(X=>X.ref.current);SM(H,d)}}A.current=!1}),onBlur:Ge(e.onBlur,()=>C(!1))})})}),bM="RovingFocusGroupItem",wM=y.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:o,children:a,...s}=e,u=Sa(),f=o||u,d=BJ(bM,n),h=d.currentTabStopId===f,m=vM(n),{onFocusableItemAdd:v,onFocusableItemRemove:w,currentTabStopId:b}=d;return y.useEffect(()=>{if(r)return v(),()=>w()},[r,v,w]),g.jsx(Tb.ItemSlot,{scope:n,id:f,focusable:r,active:i,children:g.jsx(ot.span,{tabIndex:h?0:-1,"data-orientation":d.orientation,...s,ref:t,onMouseDown:Ge(e.onMouseDown,S=>{r?d.onItemFocus(f):S.preventDefault()}),onFocus:Ge(e.onFocus,()=>d.onItemFocus(f)),onKeyDown:Ge(e.onKeyDown,S=>{if(S.key==="Tab"&&S.shiftKey){d.onItemShiftTab();return}if(S.target!==S.currentTarget)return;const k=VJ(S,d.orientation,d.dir);if(k!==void 0){if(S.metaKey||S.ctrlKey||S.altKey||S.shiftKey)return;S.preventDefault();let j=m().filter(O=>O.focusable).map(O=>O.ref.current);if(k==="last")j.reverse();else if(k==="prev"||k==="next"){k==="prev"&&j.reverse();const O=j.indexOf(S.currentTarget);j=d.loop?qJ(j,O+1):j.slice(O+1)}setTimeout(()=>SM(j))}}),children:typeof a=="function"?a({isCurrentTabStop:h,hasTabStop:b!=null}):a})})});wM.displayName=bM;var WJ={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function HJ(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function VJ(e,t,n){const r=HJ(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return WJ[r]}function SM(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function qJ(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var KJ=xM,GJ=wM,$m="Tabs",[YJ]=su($m,[yM]),kM=yM(),[QJ,R1]=YJ($m),PM=y.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:i,defaultValue:o,orientation:a="horizontal",dir:s,activationMode:u="automatic",...f}=e,d=o1(s),[h,m]=Fc({prop:r,onChange:i,defaultProp:o??"",caller:$m});return g.jsx(QJ,{scope:n,baseId:Sa(),value:h,onValueChange:m,orientation:a,dir:d,activationMode:u,children:g.jsx(ot.div,{dir:d,"data-orientation":a,...f,ref:t})})});PM.displayName=$m;var CM="TabsList",EM=y.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...i}=e,o=R1(CM,n),a=kM(n);return g.jsx(KJ,{asChild:!0,...a,orientation:o.orientation,dir:o.dir,loop:r,children:g.jsx(ot.div,{role:"tablist","aria-orientation":o.orientation,...i,ref:t})})});EM.displayName=CM;var jM="TabsTrigger",OM=y.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:i=!1,...o}=e,a=R1(jM,n),s=kM(n),u=TM(a.baseId,r),f=_M(a.baseId,r),d=r===a.value;return g.jsx(GJ,{asChild:!0,...s,focusable:!i,active:d,children:g.jsx(ot.button,{type:"button",role:"tab","aria-selected":d,"aria-controls":f,"data-state":d?"active":"inactive","data-disabled":i?"":void 0,disabled:i,id:u,...o,ref:t,onMouseDown:Ge(e.onMouseDown,h=>{!i&&h.button===0&&h.ctrlKey===!1?a.onValueChange(r):h.preventDefault()}),onKeyDown:Ge(e.onKeyDown,h=>{[" ","Enter"].includes(h.key)&&a.onValueChange(r)}),onFocus:Ge(e.onFocus,()=>{const h=a.activationMode!=="manual";!d&&!i&&h&&a.onValueChange(r)})})})});OM.displayName=jM;var NM="TabsContent",AM=y.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:i,children:o,...a}=e,s=R1(NM,n),u=TM(s.baseId,r),f=_M(s.baseId,r),d=r===s.value,h=y.useRef(d);return y.useEffect(()=>{const m=requestAnimationFrame(()=>h.current=!1);return()=>cancelAnimationFrame(m)},[]),g.jsx(pf,{present:i||d,children:({present:m})=>g.jsx(ot.div,{"data-state":d?"active":"inactive","data-orientation":s.orientation,role:"tabpanel","aria-labelledby":u,hidden:!m,id:f,tabIndex:0,...a,ref:t,style:{...e.style,animationDuration:h.current?"0s":void 0},children:m&&o})})});AM.displayName=NM;function TM(e,t){return`${e}-trigger-${t}`}function _M(e,t){return`${e}-content-${t}`}var XJ=PM,ZJ=EM,JJ=OM,eee=AM;function tee({className:e,orientation:t="horizontal",...n}){return g.jsx(XJ,{"data-slot":"tabs","data-orientation":t,orientation:t,className:Qe("group/tabs flex gap-2 data-[orientation=horizontal]:flex-col",e),...n})}const nee=Kw("rounded-lg p-[3px] group-data-[orientation=horizontal]/tabs:h-9 data-[variant=line]:rounded-none group/tabs-list text-muted-foreground inline-flex w-fit items-center justify-center group-data-[orientation=vertical]/tabs:h-fit group-data-[orientation=vertical]/tabs:flex-col",{variants:{variant:{default:"bg-muted",line:"gap-1 bg-transparent"}},defaultVariants:{variant:"default"}});function ree({className:e,variant:t="default",...n}){return g.jsx(ZJ,{"data-slot":"tabs-list","data-variant":t,className:Qe(nee({variant:t}),e),...n})}function mO({className:e,...t}){return g.jsx(JJ,{"data-slot":"tabs-trigger",className:Qe("focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring text-foreground/60 hover:text-foreground dark:text-muted-foreground dark:hover:text-foreground relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap transition-all group-data-[orientation=vertical]/tabs:w-full group-data-[orientation=vertical]/tabs:justify-start focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 group-data-[variant=default]/tabs-list:data-[state=active]:shadow-sm group-data-[variant=line]/tabs-list:data-[state=active]:shadow-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4","group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-[state=active]:bg-transparent dark:group-data-[variant=line]/tabs-list:data-[state=active]:border-transparent dark:group-data-[variant=line]/tabs-list:data-[state=active]:bg-transparent","data-[state=active]:bg-background dark:data-[state=active]:text-foreground dark:data-[state=active]:border-input dark:data-[state=active]:bg-input/30 data-[state=active]:text-foreground","after:bg-foreground after:absolute after:opacity-0 after:transition-opacity group-data-[orientation=horizontal]/tabs:after:inset-x-0 group-data-[orientation=horizontal]/tabs:after:bottom-[-5px] group-data-[orientation=horizontal]/tabs:after:h-0.5 group-data-[orientation=vertical]/tabs:after:inset-y-0 group-data-[orientation=vertical]/tabs:after:-right-1 group-data-[orientation=vertical]/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-[state=active]:after:opacity-100",e),...t})}function gO({className:e,...t}){return g.jsx(eee,{"data-slot":"tabs-content",className:Qe("flex-1 outline-none",e),...t})}function IM(e){const t=new Date(e),n=t.getFullYear(),r=t.getMonth()+1,i=t.getDate(),o=String(t.getHours()).padStart(2,"0"),a=String(t.getMinutes()).padStart(2,"0"),s=String(t.getSeconds()).padStart(2,"0");return`${n}/${r}/${i} ${o}:${a}:${s}`}function iee(e){var r;const t=e.match(/<command-name>([^<]+)<\/command-name>/),n=e.match(/<command-args>([^<]*)<\/command-args>/);return t?{isCommand:!0,commandName:t[1].trim(),commandArgs:((r=n==null?void 0:n[1])==null?void 0:r.trim())||"",originalText:e}:{isCommand:!1,originalText:e}}function oee({commandName:e,commandArgs:t}){return g.jsxs("div",{className:"inline-flex items-center gap-1.5 font-mono text-sm text-stone-300",children:[g.jsx("span",{className:"text-stone-400",children:"$"}),g.jsx("span",{className:"text-white font-medium",children:e}),t&&g.jsx("span",{className:"text-stone-400",children:t})]})}function aee({interaction:e}){const{t}=Ke("sessions"),[n,r]=y.useState(!1),i=IM(e.timestamp);return g.jsxs("div",{className:"space-y-3",children:[g.jsx("div",{className:"flex justify-center",children:g.jsxs("button",{type:"button",onClick:()=>r(!n),className:"text-xs text-amber-700 dark:text-amber-400 bg-amber-100 dark:bg-amber-950/40 border border-amber-300 dark:border-amber-800 px-3 py-1.5 rounded-full flex items-center gap-2 hover:bg-amber-200 dark:hover:bg-amber-900/50 transition-colors cursor-pointer",children:[g.jsx(lR,{className:"w-3 h-3"}),g.jsx("span",{className:"font-medium",children:t("interaction.contextCompacted")}),g.jsx("span",{className:"text-amber-600 dark:text-amber-500",children:"·"}),g.jsx("span",{className:"text-amber-600 dark:text-amber-500",children:i}),g.jsx("span",{className:"ml-1",children:n?"▲":"▼"})]})}),n&&g.jsxs("div",{className:"mx-4 bg-amber-50 dark:bg-amber-950/20 border border-amber-200 dark:border-amber-800 rounded-xl p-4",children:[g.jsx("div",{className:"text-xs text-amber-700 dark:text-amber-400 font-medium mb-2",children:t("interaction.summaryFromPreviousContext")}),g.jsx("div",{className:"text-xs max-h-96 overflow-y-auto",children:g.jsx(Hh,{content:e.user,className:"text-amber-800 dark:text-amber-200 prose-headings:text-amber-800 dark:prose-headings:text-amber-200 prose-strong:text-amber-800 dark:prose-strong:text-amber-200 prose-code:text-amber-800 dark:prose-code:text-amber-200"})})]})]})}function see({interaction:e}){var v,w;const{t}=Ke("sessions"),[n,r]=y.useState(!1),[i,o]=y.useState(!1),[a,s]=y.useState(!1),u=IM(e.timestamp),f=e.thinking&&e.thinking.trim()!=="",d=e.toolDetails&&e.toolDetails.length>0,h=!!e.agentId,m=iee(e.user);return g.jsxs("div",{className:"space-y-3",children:[g.jsxs("div",{className:"flex justify-center items-center gap-2",children:[g.jsx("span",{className:"text-xs text-stone-500 dark:text-stone-400 bg-stone-100 dark:bg-stone-800 px-2 py-0.5 rounded-full",children:u}),h&&g.jsxs("span",{className:"text-xs text-cyan-700 dark:text-cyan-400 bg-cyan-100 dark:bg-cyan-950/40 border border-cyan-300 dark:border-cyan-800 px-2 py-0.5 rounded-full flex items-center gap-1",children:[g.jsx(gV,{className:"w-3 h-3"}),g.jsx("span",{className:"font-medium",children:e.agentType||"Agent"})]})]}),g.jsxs("div",{className:"flex flex-col items-end",children:[g.jsx("span",{className:"text-xs text-stone-500 dark:text-stone-400 mb-1 mr-1",children:t("interaction.user")}),m.isCommand?g.jsx("div",{className:"max-w-[85%] bg-stone-800/80 backdrop-blur rounded-lg px-3 py-1.5 shadow-sm border border-stone-700/50",children:g.jsx(oee,{commandName:m.commandName||"",commandArgs:m.commandArgs||""})}):g.jsx("div",{className:"max-w-[85%] bg-[#39414B] text-white rounded-2xl rounded-br-sm px-4 py-2 shadow-sm",children:g.jsx(Hh,{content:e.user,variant:"dark",className:"text-sm text-white prose-headings:text-white prose-strong:text-white"})})]}),e.hasPlanMode&&g.jsx("div",{className:"flex justify-center",children:g.jsxs("div",{className:"text-xs text-violet-700 dark:text-violet-400 bg-violet-100 dark:bg-violet-950/40 border border-violet-300 dark:border-violet-800 px-3 py-1.5 rounded-full flex items-center gap-2",children:[g.jsx($V,{className:"w-3 h-3"}),g.jsx("span",{className:"font-medium",children:t("interaction.planMode")}),e.planTools&&e.planTools.length>0&&g.jsxs(g.Fragment,{children:[g.jsx("span",{className:"text-violet-500",children:"·"}),g.jsxs("span",{className:"text-violet-600 dark:text-violet-500",children:[e.planTools.slice(0,3).map(b=>`${b.name}×${b.count}`).join(", "),e.planTools.length>3&&"..."]})]})]})}),!e.hasPlanMode&&e.toolsUsed&&e.toolsUsed.length>0&&g.jsx("div",{className:"flex justify-center",children:g.jsxs("div",{className:"text-xs text-stone-500 dark:text-stone-400 bg-stone-100 dark:bg-stone-800 px-2 py-0.5 rounded-full flex items-center gap-1",children:[g.jsx(HV,{className:"w-3 h-3"}),g.jsx("span",{children:e.toolsUsed.slice(0,4).join(", ")}),e.toolsUsed.length>4&&g.jsxs("span",{children:["+",e.toolsUsed.length-4]})]})}),e.assistant&&g.jsxs("div",{className:"flex flex-col items-start",children:[g.jsx("span",{className:"text-xs text-stone-500 dark:text-stone-400 mb-1 ml-1",children:t("interaction.assistant")}),g.jsxs("div",{className:"max-w-[85%] bg-[#F5F5F0] dark:bg-stone-800 text-stone-800 dark:text-stone-100 rounded-2xl rounded-bl-sm px-4 py-2 shadow-sm border border-stone-200 dark:border-stone-700",children:[g.jsx(Hh,{content:e.assistant.length>500&&!n?`${e.assistant.substring(0,500)}...`:e.assistant,className:"text-sm"}),e.assistant.length>500&&!n&&g.jsx("button",{type:"button",onClick:()=>r(!0),className:"text-xs text-[#C15F3C] hover:underline mt-2",children:t("interaction.showMore")})]})]}),f&&g.jsx("div",{className:"flex justify-start",children:g.jsxs("div",{className:"max-w-[85%]",children:[g.jsxs("button",{type:"button",onClick:()=>o(!i),className:"text-xs text-muted-foreground hover:text-foreground cursor-pointer flex items-center gap-1 mb-1",children:[g.jsx(yV,{className:"w-3 h-3 text-amber-500"}),t(i?"interaction.hideThinking":"interaction.showThinking")]}),i&&g.jsx("div",{className:"bg-amber-50 dark:bg-amber-950/30 border border-amber-200 dark:border-amber-800 rounded-xl px-4 py-2",children:g.jsx(Hh,{content:e.thinking||"",className:"text-xs text-amber-800 dark:text-amber-200 prose-headings:text-amber-800 dark:prose-headings:text-amber-200 prose-code:text-amber-700 dark:prose-code:text-amber-300"})})]})}),d&&g.jsx("div",{className:"flex justify-start",children:g.jsxs("div",{className:"max-w-[85%]",children:[g.jsxs("button",{type:"button",onClick:()=>s(!a),className:"text-xs text-muted-foreground hover:text-foreground cursor-pointer flex items-center gap-1 mb-1",children:[g.jsx(lR,{className:"w-3 h-3 text-blue-500"}),t(a?"interaction.hideToolDetails":"interaction.showToolDetails"),g.jsxs("span",{className:"text-stone-400",children:["(",(v=e.toolDetails)==null?void 0:v.length,")"]})]}),a&&g.jsx("div",{className:"bg-blue-50 dark:bg-blue-950/30 border border-blue-200 dark:border-blue-800 rounded-xl px-3 py-2",children:g.jsx("div",{className:"space-y-1 font-mono text-xs",children:(w=e.toolDetails)==null?void 0:w.map((b,S)=>g.jsxs("div",{className:"flex items-start gap-2 text-blue-800 dark:text-blue-200",children:[g.jsx("span",{className:"text-blue-600 dark:text-blue-400 font-semibold shrink-0",children:b.name}),g.jsx("span",{className:"text-blue-700 dark:text-blue-300 break-all",children:typeof b.detail=="string"?b.detail.length>80?`${b.detail.substring(0,80)}...`:b.detail:b.detail?JSON.stringify(b.detail):""})]},`${b.name}-${S}`))})})]})})]})}function lee({session:e}){var h,m;const{t}=Ke("sessions"),{t:n}=Ke("common"),[r,i]=y.useState(!1),o=new Set,a=e.files||[];for(const v of a){const w=typeof v=="string"?v:v.path;w&&o.add(w)}const s=(h=e.context)==null?void 0:h.projectDir,u=(m=e.context)==null?void 0:m.branch,f=`/mneme:resume ${e.id}`,d=()=>{navigator.clipboard.writeText(f),i(!0),setTimeout(()=>i(!1),2e3)};return!s&&!u&&o.size===0?null:g.jsxs(nt,{children:[g.jsx(tr,{children:g.jsxs(nr,{className:"text-lg flex items-center gap-2",children:[g.jsxs("svg",{className:"h-5 w-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:[g.jsx("title",{children:"Context"}),g.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})]}),t("contextRestoration.title")]})}),g.jsxs(rt,{className:"space-y-4",children:[g.jsxs("div",{children:[g.jsx("div",{className:"text-sm font-medium text-muted-foreground mb-2",children:t("contextRestoration.quickResume")}),g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx("code",{className:"flex-1 bg-muted p-2 rounded text-sm font-mono overflow-x-auto",children:f}),g.jsx(Dr,{variant:"outline",size:"sm",onClick:d,children:n(r?"copied":"copy")})]}),g.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:t("contextRestoration.quickResumeDescription")})]}),o.size>0&&g.jsxs("div",{children:[g.jsx("div",{className:"text-sm font-medium text-muted-foreground mb-2",children:t("contextRestoration.modifiedFiles",{count:o.size})}),g.jsx("div",{className:"max-h-48 overflow-y-auto",children:g.jsx("div",{className:"flex flex-wrap gap-1",children:Array.from(o).sort().map(v=>g.jsx(tt,{variant:"secondary",className:"text-xs font-mono",children:v.split("/").pop()},v))})}),g.jsxs("details",{className:"mt-2",children:[g.jsx("summary",{className:"text-xs text-muted-foreground cursor-pointer",children:t("contextRestoration.showFullPaths")}),g.jsx("div",{className:"mt-2 space-y-1",children:Array.from(o).sort().map(v=>g.jsx("div",{className:"text-xs font-mono text-muted-foreground truncate",children:v},v))})]})]})]})]})}function uee(){var D,U,L;const{t:e,i18n:t}=Ke("sessions"),{t:n}=Ke("common"),{id:r}=d6(),i=ym(),o=JK(),[a,s]=y.useState(null),[u,f]=y.useState([]),[d,h]=y.useState([]),[m,v]=y.useState(!0),[w,b]=y.useState(null),[S,k]=y.useState(!1),[C,j]=y.useState(!1),O=y.useCallback(async()=>{if(r)try{const[q,W]=await Promise.all([sW(r),E2()]);s(q),f(W.tags||[]);try{const H=await dW(r);h(H?H.interactions:[])}catch{h([])}b(null)}catch{b("Failed to load session")}finally{v(!1)}},[r]);y.useEffect(()=>{O()},[O]);const A=q=>{const W=u.find(H=>H.id===q);return(W==null?void 0:W.color)||"#6B7280"},N=async()=>{if(!(!r||!S)){j(!0);try{await lW(r),o(),i("/")}catch(q){b(q instanceof Error?q.message:"Failed to delete session"),j(!1),k(!1)}}};if(m)return g.jsx("div",{className:"text-center py-12",children:n("loading")});if(w||!a)return g.jsxs("div",{className:"text-center py-12",children:[g.jsx("p",{className:"text-destructive",children:w||e("errors:sessionNotFound")}),g.jsx(Mi,{to:"/",className:"text-primary underline mt-4 block",children:e("errors:backToSessions")})]});const I=new Date(a.createdAt).toLocaleString(t.language==="ja"?"ja-JP":"en-US"),T=((D=a.context.user)==null?void 0:D.name)||((U=a.user)==null?void 0:U.name)||n("unknown"),$=d.length;return g.jsx("div",{className:"h-[calc(100%+32px)] flex flex-col overflow-hidden -my-4 -mx-6 px-6 py-4",children:g.jsxs("div",{className:"flex gap-6 flex-1 min-h-0",children:[g.jsxs("div",{className:"w-[30%] min-w-[300px] overflow-y-auto space-y-4",children:[g.jsxs(nt,{children:[g.jsx(tr,{className:"pb-3",children:g.jsx(nr,{className:"text-lg",children:a.title||e("untitled")})}),g.jsxs(rt,{className:"space-y-3 text-sm",children:[g.jsxs("div",{className:"space-y-1.5",children:[g.jsxs("div",{className:"flex justify-between",children:[g.jsx("span",{className:"text-muted-foreground",children:n("user")}),g.jsx("span",{children:T})]}),g.jsxs("div",{className:"flex justify-between",children:[g.jsx("span",{className:"text-muted-foreground",children:n("date")}),g.jsx("span",{children:I})]}),g.jsxs("div",{className:"flex justify-between",children:[g.jsx("span",{className:"text-muted-foreground",children:n("branch")}),g.jsx("span",{className:"font-mono text-xs",children:a.context.branch||n("na")})]}),a.context.repository&&g.jsxs("div",{className:"flex justify-between",children:[g.jsx("span",{className:"text-muted-foreground",children:n("repository")}),g.jsx("span",{className:"font-mono text-xs",children:a.context.repository})]}),a.sessionType&&g.jsxs("div",{className:"flex justify-between items-center",children:[g.jsx("span",{className:"text-muted-foreground",children:n("type")}),g.jsx(tt,{variant:"outline",className:"text-xs",children:e(`types.${a.sessionType}`)})]}),a.status&&g.jsxs("div",{className:"flex justify-between items-center",children:[g.jsx("span",{className:"text-muted-foreground",children:n("status")}),g.jsx(tt,{variant:a.status==="complete"?"default":"secondary",className:"text-xs",children:a.status})]})]}),a.relatedSessions&&a.relatedSessions.length>0&&g.jsxs("div",{className:"pt-2 border-t",children:[g.jsx("span",{className:"text-muted-foreground text-xs",children:e("detail.relatedSessions")}),g.jsx("div",{className:"flex flex-wrap gap-1 mt-1",children:a.relatedSessions.map(q=>g.jsxs(Mi,{to:`/sessions/${q}`,className:"inline-flex items-center gap-1 px-1.5 py-0.5 bg-muted hover:bg-muted/80 rounded text-xs font-mono transition-colors",children:[g.jsx(_V,{className:"h-3 w-3"}),q]},q))})]}),g.jsxs("div",{className:"pt-2 border-t",children:[g.jsx("span",{className:"text-muted-foreground text-xs",children:n("tags")}),g.jsx("div",{className:"flex flex-wrap gap-1 mt-1",children:(((L=a.tags)==null?void 0:L.length)??0)>0?a.tags.map(q=>g.jsx(tt,{variant:"secondary",className:"text-xs",style:{backgroundColor:`${A(q)}20`,color:A(q),borderColor:A(q)},children:q},q)):g.jsx("span",{className:"text-muted-foreground text-xs",children:n("noTags")})})]}),g.jsx("div",{className:"pt-2 border-t",children:S?g.jsxs("div",{className:"space-y-2",children:[g.jsx("p",{className:"text-xs text-destructive",children:e("detail.deleteConfirmMessage")}),g.jsxs("div",{className:"flex gap-2",children:[g.jsx(Dr,{variant:"destructive",size:"sm",className:"flex-1",onClick:N,disabled:C,children:n(C?"deleting":"delete")}),g.jsx(Dr,{variant:"outline",size:"sm",className:"flex-1",onClick:()=>k(!1),disabled:C,children:n("cancel")})]})]}):g.jsxs(Dr,{variant:"outline",size:"sm",className:"w-full text-destructive hover:text-destructive hover:bg-destructive/10",onClick:()=>k(!0),children:[g.jsx(zV,{className:"h-4 w-4 mr-2"}),e("detail.deleteSession")]})})]})]}),g.jsx(lee,{session:a})]}),g.jsx("div",{className:"flex-1 min-w-0 flex flex-col min-h-0",children:g.jsxs(tee,{defaultValue:"context",className:"flex flex-col flex-1 min-h-0",children:[g.jsxs("div",{className:"flex items-center justify-between flex-shrink-0 mb-2",children:[g.jsxs(ree,{children:[g.jsx(mO,{value:"context",children:e("detail.sessionContext")}),g.jsxs(mO,{value:"interactions",children:[e("detail.interactions")," (",$,")"]})]}),g.jsxs(Mi,{to:"/",className:"text-sm text-muted-foreground hover:text-foreground",children:["← ",n("back")]})]}),g.jsx(gO,{value:"context",className:"flex-1 min-h-0 data-[state=inactive]:hidden",children:g.jsx(nt,{className:"h-full flex flex-col py-0 gap-0",children:g.jsx(rt,{className:"py-4 flex-1 overflow-y-auto",children:g.jsx(MJ,{session:a,embedded:!0})})})}),g.jsx(gO,{value:"interactions",className:"flex-1 min-h-0 data-[state=inactive]:hidden",children:g.jsx(nt,{className:"h-full flex flex-col py-0 gap-0",children:g.jsx(rt,{className:"py-4 flex-1 overflow-y-auto",children:$>0?g.jsx("div",{className:"space-y-6",children:d.map(q=>q.isCompactSummary?g.jsx(aee,{interaction:q},q.id):g.jsx(see,{interaction:q},q.id))}):g.jsx("div",{className:"py-8 text-center text-muted-foreground",children:e("detail.noInteractions")})})})})]})})]})})}var cee=["dangerouslySetInnerHTML","onCopy","onCopyCapture","onCut","onCutCapture","onPaste","onPasteCapture","onCompositionEnd","onCompositionEndCapture","onCompositionStart","onCompositionStartCapture","onCompositionUpdate","onCompositionUpdateCapture","onFocus","onFocusCapture","onBlur","onBlurCapture","onChange","onChangeCapture","onBeforeInput","onBeforeInputCapture","onInput","onInputCapture","onReset","onResetCapture","onSubmit","onSubmitCapture","onInvalid","onInvalidCapture","onLoad","onLoadCapture","onError","onErrorCapture","onKeyDown","onKeyDownCapture","onKeyPress","onKeyPressCapture","onKeyUp","onKeyUpCapture","onAbort","onAbortCapture","onCanPlay","onCanPlayCapture","onCanPlayThrough","onCanPlayThroughCapture","onDurationChange","onDurationChangeCapture","onEmptied","onEmptiedCapture","onEncrypted","onEncryptedCapture","onEnded","onEndedCapture","onLoadedData","onLoadedDataCapture","onLoadedMetadata","onLoadedMetadataCapture","onLoadStart","onLoadStartCapture","onPause","onPauseCapture","onPlay","onPlayCapture","onPlaying","onPlayingCapture","onProgress","onProgressCapture","onRateChange","onRateChangeCapture","onSeeked","onSeekedCapture","onSeeking","onSeekingCapture","onStalled","onStalledCapture","onSuspend","onSuspendCapture","onTimeUpdate","onTimeUpdateCapture","onVolumeChange","onVolumeChangeCapture","onWaiting","onWaitingCapture","onAuxClick","onAuxClickCapture","onClick","onClickCapture","onContextMenu","onContextMenuCapture","onDoubleClick","onDoubleClickCapture","onDrag","onDragCapture","onDragEnd","onDragEndCapture","onDragEnter","onDragEnterCapture","onDragExit","onDragExitCapture","onDragLeave","onDragLeaveCapture","onDragOver","onDragOverCapture","onDragStart","onDragStartCapture","onDrop","onDropCapture","onMouseDown","onMouseDownCapture","onMouseEnter","onMouseLeave","onMouseMove","onMouseMoveCapture","onMouseOut","onMouseOutCapture","onMouseOver","onMouseOverCapture","onMouseUp","onMouseUpCapture","onSelect","onSelectCapture","onTouchCancel","onTouchCancelCapture","onTouchEnd","onTouchEndCapture","onTouchMove","onTouchMoveCapture","onTouchStart","onTouchStartCapture","onPointerDown","onPointerDownCapture","onPointerMove","onPointerMoveCapture","onPointerUp","onPointerUpCapture","onPointerCancel","onPointerCancelCapture","onPointerEnter","onPointerEnterCapture","onPointerLeave","onPointerLeaveCapture","onPointerOver","onPointerOverCapture","onPointerOut","onPointerOutCapture","onGotPointerCapture","onGotPointerCaptureCapture","onLostPointerCapture","onLostPointerCaptureCapture","onScroll","onScrollCapture","onWheel","onWheelCapture","onAnimationStart","onAnimationStartCapture","onAnimationEnd","onAnimationEndCapture","onAnimationIteration","onAnimationIterationCapture","onTransitionEnd","onTransitionEndCapture"];function D1(e){if(typeof e!="string")return!1;var t=cee;return t.includes(e)}var fee=["aria-activedescendant","aria-atomic","aria-autocomplete","aria-busy","aria-checked","aria-colcount","aria-colindex","aria-colspan","aria-controls","aria-current","aria-describedby","aria-details","aria-disabled","aria-errormessage","aria-expanded","aria-flowto","aria-haspopup","aria-hidden","aria-invalid","aria-keyshortcuts","aria-label","aria-labelledby","aria-level","aria-live","aria-modal","aria-multiline","aria-multiselectable","aria-orientation","aria-owns","aria-placeholder","aria-posinset","aria-pressed","aria-readonly","aria-relevant","aria-required","aria-roledescription","aria-rowcount","aria-rowindex","aria-rowspan","aria-selected","aria-setsize","aria-sort","aria-valuemax","aria-valuemin","aria-valuenow","aria-valuetext","className","color","height","id","lang","max","media","method","min","name","style","target","width","role","tabIndex","accentHeight","accumulate","additive","alignmentBaseline","allowReorder","alphabetic","amplitude","arabicForm","ascent","attributeName","attributeType","autoReverse","azimuth","baseFrequency","baselineShift","baseProfile","bbox","begin","bias","by","calcMode","capHeight","clip","clipPath","clipPathUnits","clipRule","colorInterpolation","colorInterpolationFilters","colorProfile","colorRendering","contentScriptType","contentStyleType","cursor","cx","cy","d","decelerate","descent","diffuseConstant","direction","display","divisor","dominantBaseline","dur","dx","dy","edgeMode","elevation","enableBackground","end","exponent","externalResourcesRequired","fill","fillOpacity","fillRule","filter","filterRes","filterUnits","floodColor","floodOpacity","focusable","fontFamily","fontSize","fontSizeAdjust","fontStretch","fontStyle","fontVariant","fontWeight","format","from","fx","fy","g1","g2","glyphName","glyphOrientationHorizontal","glyphOrientationVertical","glyphRef","gradientTransform","gradientUnits","hanging","horizAdvX","horizOriginX","href","ideographic","imageRendering","in2","in","intercept","k1","k2","k3","k4","k","kernelMatrix","kernelUnitLength","kerning","keyPoints","keySplines","keyTimes","lengthAdjust","letterSpacing","lightingColor","limitingConeAngle","local","markerEnd","markerHeight","markerMid","markerStart","markerUnits","markerWidth","mask","maskContentUnits","maskUnits","mathematical","mode","numOctaves","offset","opacity","operator","order","orient","orientation","origin","overflow","overlinePosition","overlineThickness","paintOrder","panose1","pathLength","patternContentUnits","patternTransform","patternUnits","pointerEvents","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","r","radius","refX","refY","renderingIntent","repeatCount","repeatDur","requiredExtensions","requiredFeatures","restart","result","rotate","rx","ry","seed","shapeRendering","slope","spacing","specularConstant","specularExponent","speed","spreadMethod","startOffset","stdDeviation","stemh","stemv","stitchTiles","stopColor","stopOpacity","strikethroughPosition","strikethroughThickness","string","stroke","strokeDasharray","strokeDashoffset","strokeLinecap","strokeLinejoin","strokeMiterlimit","strokeOpacity","strokeWidth","surfaceScale","systemLanguage","tableValues","targetX","targetY","textAnchor","textDecoration","textLength","textRendering","to","transform","u1","u2","underlinePosition","underlineThickness","unicode","unicodeBidi","unicodeRange","unitsPerEm","vAlphabetic","values","vectorEffect","version","vertAdvY","vertOriginX","vertOriginY","vHanging","vIdeographic","viewTarget","visibility","vMathematical","widths","wordSpacing","writingMode","x1","x2","x","xChannelSelector","xHeight","xlinkActuate","xlinkArcrole","xlinkHref","xlinkRole","xlinkShow","xlinkTitle","xlinkType","xmlBase","xmlLang","xmlns","xmlnsXlink","xmlSpace","y1","y2","y","yChannelSelector","z","zoomAndPan","ref","key","angle"],dee=new Set(fee);function RM(e){return typeof e!="string"?!1:dee.has(e)}function DM(e){return typeof e=="string"&&e.startsWith("data-")}function Mr(e){if(typeof e!="object"||e===null)return{};var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(RM(n)||DM(n))&&(t[n]=e[n]);return t}function Sf(e){if(e==null)return null;if(y.isValidElement(e)&&typeof e.props=="object"&&e.props!==null){var t=e.props;return Mr(t)}return typeof e=="object"&&!Array.isArray(e)?Mr(e):null}function Ln(e){var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(RM(n)||DM(n)||D1(n))&&(t[n]=e[n]);return t}function hee(e){return e==null?null:y.isValidElement(e)?Ln(e.props):typeof e=="object"&&!Array.isArray(e)?Ln(e):null}var pee=["children","width","height","viewBox","className","style","title","desc"];function _b(){return _b=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},_b.apply(null,arguments)}function mee(e,t){if(e==null)return{};var n,r,i=gee(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function gee(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var M1=y.forwardRef((e,t)=>{var{children:n,width:r,height:i,viewBox:o,className:a,style:s,title:u,desc:f}=e,d=mee(e,pee),h=o||{width:r,height:i,x:0,y:0},m=at("recharts-surface",a);return y.createElement("svg",_b({},Ln(d),{className:m,width:r,height:i,style:s,viewBox:"".concat(h.x," ").concat(h.y," ").concat(h.width," ").concat(h.height),ref:t}),y.createElement("title",null,u),y.createElement("desc",null,f),n)}),vee=["children","className"];function Ib(){return Ib=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ib.apply(null,arguments)}function yee(e,t){if(e==null)return{};var n,r,i=xee(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function xee(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var $n=y.forwardRef((e,t)=>{var{children:n,className:r}=e,i=yee(e,vee),o=at("recharts-layer",r);return y.createElement("g",Ib({className:o},Ln(i),{ref:t}),n)}),MM=y.createContext(null),bee=()=>y.useContext(MM);function gt(e){return function(){return e}}const LM=Math.cos,xp=Math.sin,di=Math.sqrt,bp=Math.PI,Fm=2*bp,Rb=Math.PI,Db=2*Rb,es=1e-6,wee=Db-es;function $M(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function See(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return $M;const n=10**t;return function(r){this._+=r[0];for(let i=1,o=r.length;i<o;++i)this._+=Math.round(arguments[i]*n)/n+r[i]}}class kee{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?$M:See(t)}moveTo(t,n){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(t,n){this._append`L${this._x1=+t},${this._y1=+n}`}quadraticCurveTo(t,n,r,i){this._append`Q${+t},${+n},${this._x1=+r},${this._y1=+i}`}bezierCurveTo(t,n,r,i,o,a){this._append`C${+t},${+n},${+r},${+i},${this._x1=+o},${this._y1=+a}`}arcTo(t,n,r,i,o){if(t=+t,n=+n,r=+r,i=+i,o=+o,o<0)throw new Error(`negative radius: ${o}`);let a=this._x1,s=this._y1,u=r-t,f=i-n,d=a-t,h=s-n,m=d*d+h*h;if(this._x1===null)this._append`M${this._x1=t},${this._y1=n}`;else if(m>es)if(!(Math.abs(h*u-f*d)>es)||!o)this._append`L${this._x1=t},${this._y1=n}`;else{let v=r-a,w=i-s,b=u*u+f*f,S=v*v+w*w,k=Math.sqrt(b),C=Math.sqrt(m),j=o*Math.tan((Rb-Math.acos((b+m-S)/(2*k*C)))/2),O=j/C,A=j/k;Math.abs(O-1)>es&&this._append`L${t+O*d},${n+O*h}`,this._append`A${o},${o},0,0,${+(h*v>d*w)},${this._x1=t+A*u},${this._y1=n+A*f}`}}arc(t,n,r,i,o,a){if(t=+t,n=+n,r=+r,a=!!a,r<0)throw new Error(`negative radius: ${r}`);let s=r*Math.cos(i),u=r*Math.sin(i),f=t+s,d=n+u,h=1^a,m=a?i-o:o-i;this._x1===null?this._append`M${f},${d}`:(Math.abs(this._x1-f)>es||Math.abs(this._y1-d)>es)&&this._append`L${f},${d}`,r&&(m<0&&(m=m%Db+Db),m>wee?this._append`A${r},${r},0,1,${h},${t-s},${n-u}A${r},${r},0,1,${h},${this._x1=f},${this._y1=d}`:m>es&&this._append`A${r},${r},0,${+(m>=Rb)},${h},${this._x1=t+r*Math.cos(o)},${this._y1=n+r*Math.sin(o)}`)}rect(t,n,r,i){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}h${r=+r}v${+i}h${-r}Z`}toString(){return this._}}function L1(e){let t=3;return e.digits=function(n){if(!arguments.length)return t;if(n==null)t=null;else{const r=Math.floor(n);if(!(r>=0))throw new RangeError(`invalid digits: ${n}`);t=r}return e},()=>new kee(t)}function $1(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function FM(e){this._context=e}FM.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}};function zm(e){return new FM(e)}function zM(e){return e[0]}function BM(e){return e[1]}function UM(e,t){var n=gt(!0),r=null,i=zm,o=null,a=L1(s);e=typeof e=="function"?e:e===void 0?zM:gt(e),t=typeof t=="function"?t:t===void 0?BM:gt(t);function s(u){var f,d=(u=$1(u)).length,h,m=!1,v;for(r==null&&(o=i(v=a())),f=0;f<=d;++f)!(f<d&&n(h=u[f],f,u))===m&&((m=!m)?o.lineStart():o.lineEnd()),m&&o.point(+e(h,f,u),+t(h,f,u));if(v)return o=null,v+""||null}return s.x=function(u){return arguments.length?(e=typeof u=="function"?u:gt(+u),s):e},s.y=function(u){return arguments.length?(t=typeof u=="function"?u:gt(+u),s):t},s.defined=function(u){return arguments.length?(n=typeof u=="function"?u:gt(!!u),s):n},s.curve=function(u){return arguments.length?(i=u,r!=null&&(o=i(r)),s):i},s.context=function(u){return arguments.length?(u==null?r=o=null:o=i(r=u),s):r},s}function mh(e,t,n){var r=null,i=gt(!0),o=null,a=zm,s=null,u=L1(f);e=typeof e=="function"?e:e===void 0?zM:gt(+e),t=typeof t=="function"?t:gt(t===void 0?0:+t),n=typeof n=="function"?n:n===void 0?BM:gt(+n);function f(h){var m,v,w,b=(h=$1(h)).length,S,k=!1,C,j=new Array(b),O=new Array(b);for(o==null&&(s=a(C=u())),m=0;m<=b;++m){if(!(m<b&&i(S=h[m],m,h))===k)if(k=!k)v=m,s.areaStart(),s.lineStart();else{for(s.lineEnd(),s.lineStart(),w=m-1;w>=v;--w)s.point(j[w],O[w]);s.lineEnd(),s.areaEnd()}k&&(j[m]=+e(S,m,h),O[m]=+t(S,m,h),s.point(r?+r(S,m,h):j[m],n?+n(S,m,h):O[m]))}if(C)return s=null,C+""||null}function d(){return UM().defined(i).curve(a).context(o)}return f.x=function(h){return arguments.length?(e=typeof h=="function"?h:gt(+h),r=null,f):e},f.x0=function(h){return arguments.length?(e=typeof h=="function"?h:gt(+h),f):e},f.x1=function(h){return arguments.length?(r=h==null?null:typeof h=="function"?h:gt(+h),f):r},f.y=function(h){return arguments.length?(t=typeof h=="function"?h:gt(+h),n=null,f):t},f.y0=function(h){return arguments.length?(t=typeof h=="function"?h:gt(+h),f):t},f.y1=function(h){return arguments.length?(n=h==null?null:typeof h=="function"?h:gt(+h),f):n},f.lineX0=f.lineY0=function(){return d().x(e).y(t)},f.lineY1=function(){return d().x(e).y(n)},f.lineX1=function(){return d().x(r).y(t)},f.defined=function(h){return arguments.length?(i=typeof h=="function"?h:gt(!!h),f):i},f.curve=function(h){return arguments.length?(a=h,o!=null&&(s=a(o)),f):a},f.context=function(h){return arguments.length?(h==null?o=s=null:s=a(o=h),f):o},f}class WM{constructor(t,n){this._context=t,this._x=n}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(t,n){switch(t=+t,n=+n,this._point){case 0:{this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,n,t,n):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+n)/2,t,this._y0,t,n);break}}this._x0=t,this._y0=n}}function Pee(e){return new WM(e,!0)}function Cee(e){return new WM(e,!1)}const F1={draw(e,t){const n=di(t/bp);e.moveTo(n,0),e.arc(0,0,n,0,Fm)}},Eee={draw(e,t){const n=di(t/5)/2;e.moveTo(-3*n,-n),e.lineTo(-n,-n),e.lineTo(-n,-3*n),e.lineTo(n,-3*n),e.lineTo(n,-n),e.lineTo(3*n,-n),e.lineTo(3*n,n),e.lineTo(n,n),e.lineTo(n,3*n),e.lineTo(-n,3*n),e.lineTo(-n,n),e.lineTo(-3*n,n),e.closePath()}},HM=di(1/3),jee=HM*2,Oee={draw(e,t){const n=di(t/jee),r=n*HM;e.moveTo(0,-n),e.lineTo(r,0),e.lineTo(0,n),e.lineTo(-r,0),e.closePath()}},Nee={draw(e,t){const n=di(t),r=-n/2;e.rect(r,r,n,n)}},Aee=.8908130915292852,VM=xp(bp/10)/xp(7*bp/10),Tee=xp(Fm/10)*VM,_ee=-LM(Fm/10)*VM,Iee={draw(e,t){const n=di(t*Aee),r=Tee*n,i=_ee*n;e.moveTo(0,-n),e.lineTo(r,i);for(let o=1;o<5;++o){const a=Fm*o/5,s=LM(a),u=xp(a);e.lineTo(u*n,-s*n),e.lineTo(s*r-u*i,u*r+s*i)}e.closePath()}},lx=di(3),Ree={draw(e,t){const n=-di(t/(lx*3));e.moveTo(0,n*2),e.lineTo(-lx*n,-n),e.lineTo(lx*n,-n),e.closePath()}},jr=-.5,Or=di(3)/2,Mb=1/di(12),Dee=(Mb/2+1)*3,Mee={draw(e,t){const n=di(t/Dee),r=n/2,i=n*Mb,o=r,a=n*Mb+n,s=-o,u=a;e.moveTo(r,i),e.lineTo(o,a),e.lineTo(s,u),e.lineTo(jr*r-Or*i,Or*r+jr*i),e.lineTo(jr*o-Or*a,Or*o+jr*a),e.lineTo(jr*s-Or*u,Or*s+jr*u),e.lineTo(jr*r+Or*i,jr*i-Or*r),e.lineTo(jr*o+Or*a,jr*a-Or*o),e.lineTo(jr*s+Or*u,jr*u-Or*s),e.closePath()}};function Lee(e,t){let n=null,r=L1(i);e=typeof e=="function"?e:gt(e||F1),t=typeof t=="function"?t:gt(t===void 0?64:+t);function i(){let o;if(n||(n=o=r()),e.apply(this,arguments).draw(n,+t.apply(this,arguments)),o)return n=null,o+""||null}return i.type=function(o){return arguments.length?(e=typeof o=="function"?o:gt(o),i):e},i.size=function(o){return arguments.length?(t=typeof o=="function"?o:gt(+o),i):t},i.context=function(o){return arguments.length?(n=o??null,i):n},i}function wp(){}function Sp(e,t,n){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+n)/6)}function qM(e){this._context=e}qM.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:Sp(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:Sp(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function $ee(e){return new qM(e)}function KM(e){this._context=e}KM.prototype={areaStart:wp,areaEnd:wp,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:Sp(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Fee(e){return new KM(e)}function GM(e){this._context=e}GM.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+e)/6,r=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:Sp(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function zee(e){return new GM(e)}function YM(e){this._context=e}YM.prototype={areaStart:wp,areaEnd:wp,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function Bee(e){return new YM(e)}function vO(e){return e<0?-1:1}function yO(e,t,n){var r=e._x1-e._x0,i=t-e._x1,o=(e._y1-e._y0)/(r||i<0&&-0),a=(n-e._y1)/(i||r<0&&-0),s=(o*i+a*r)/(r+i);return(vO(o)+vO(a))*Math.min(Math.abs(o),Math.abs(a),.5*Math.abs(s))||0}function xO(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function ux(e,t,n){var r=e._x0,i=e._y0,o=e._x1,a=e._y1,s=(o-r)/3;e._context.bezierCurveTo(r+s,i+s*t,o-s,a-s*n,o,a)}function kp(e){this._context=e}kp.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:ux(this,this._t0,xO(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var n=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,ux(this,xO(this,n=yO(this,e,t)),n);break;default:ux(this,this._t0,n=yO(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function QM(e){this._context=new XM(e)}(QM.prototype=Object.create(kp.prototype)).point=function(e,t){kp.prototype.point.call(this,t,e)};function XM(e){this._context=e}XM.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,n,r,i,o){this._context.bezierCurveTo(t,e,r,n,o,i)}};function Uee(e){return new kp(e)}function Wee(e){return new QM(e)}function ZM(e){this._context=e}ZM.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,n=e.length;if(n)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),n===2)this._context.lineTo(e[1],t[1]);else for(var r=bO(e),i=bO(t),o=0,a=1;a<n;++o,++a)this._context.bezierCurveTo(r[0][o],i[0][o],r[1][o],i[1][o],e[a],t[a]);(this._line||this._line!==0&&n===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(e,t){this._x.push(+e),this._y.push(+t)}};function bO(e){var t,n=e.length-1,r,i=new Array(n),o=new Array(n),a=new Array(n);for(i[0]=0,o[0]=2,a[0]=e[0]+2*e[1],t=1;t<n-1;++t)i[t]=1,o[t]=4,a[t]=4*e[t]+2*e[t+1];for(i[n-1]=2,o[n-1]=7,a[n-1]=8*e[n-1]+e[n],t=1;t<n;++t)r=i[t]/o[t-1],o[t]-=r,a[t]-=r*a[t-1];for(i[n-1]=a[n-1]/o[n-1],t=n-2;t>=0;--t)i[t]=(a[t]-i[t+1])/o[t];for(o[n-1]=(e[n]+i[n-1])/2,t=0;t<n-1;++t)o[t]=2*e[t+1]-i[t+1];return[i,o]}function Hee(e){return new ZM(e)}function Bm(e,t){this._context=e,this._t=t}Bm.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&this._point===2&&this._context.lineTo(this._x,this._y),(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var n=this._x*(1-this._t)+e*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,t)}break}}this._x=e,this._y=t}};function Vee(e){return new Bm(e,.5)}function qee(e){return new Bm(e,0)}function Kee(e){return new Bm(e,1)}function Os(e,t){if((a=e.length)>1)for(var n=1,r,i,o=e[t[0]],a,s=o.length;n<a;++n)for(i=o,o=e[t[n]],r=0;r<s;++r)o[r][1]+=o[r][0]=isNaN(i[r][1])?i[r][0]:i[r][1]}function Lb(e){for(var t=e.length,n=new Array(t);--t>=0;)n[t]=t;return n}function Gee(e,t){return e[t]}function Yee(e){const t=[];return t.key=e,t}function Qee(){var e=gt([]),t=Lb,n=Os,r=Gee;function i(o){var a=Array.from(e.apply(this,arguments),Yee),s,u=a.length,f=-1,d;for(const h of o)for(s=0,++f;s<u;++s)(a[s][f]=[0,+r(h,a[s].key,f,o)]).data=h;for(s=0,d=$1(t(a));s<u;++s)a[d[s]].index=s;return n(a,d),a}return i.keys=function(o){return arguments.length?(e=typeof o=="function"?o:gt(Array.from(o)),i):e},i.value=function(o){return arguments.length?(r=typeof o=="function"?o:gt(+o),i):r},i.order=function(o){return arguments.length?(t=o==null?Lb:typeof o=="function"?o:gt(Array.from(o)),i):t},i.offset=function(o){return arguments.length?(n=o??Os,i):n},i}function Xee(e,t){if((r=e.length)>0){for(var n,r,i=0,o=e[0].length,a;i<o;++i){for(a=n=0;n<r;++n)a+=e[n][i][1]||0;if(a)for(n=0;n<r;++n)e[n][i][1]/=a}Os(e,t)}}function Zee(e,t){if((i=e.length)>0){for(var n=0,r=e[t[0]],i,o=r.length;n<o;++n){for(var a=0,s=0;a<i;++a)s+=e[a][n][1]||0;r[n][1]+=r[n][0]=-s/2}Os(e,t)}}function Jee(e,t){if(!(!((a=e.length)>0)||!((o=(i=e[t[0]]).length)>0))){for(var n=0,r=1,i,o,a;r<o;++r){for(var s=0,u=0,f=0;s<a;++s){for(var d=e[t[s]],h=d[r][1]||0,m=d[r-1][1]||0,v=(h-m)/2,w=0;w<s;++w){var b=e[t[w]],S=b[r][1]||0,k=b[r-1][1]||0;v+=S-k}u+=h,f+=v*h}i[r-1][1]+=i[r-1][0]=n,u&&(n-=f/u)}i[r-1][1]+=i[r-1][0]=n,Os(e,t)}}var cx={},fx={},wO;function ete(){return wO||(wO=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return n==="__proto__"}e.isUnsafeProperty=t})(fx)),fx}var dx={},SO;function JM(){return SO||(SO=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){switch(typeof n){case"number":case"symbol":return!1;case"string":return n.includes(".")||n.includes("[")||n.includes("]")}}e.isDeepKey=t})(dx)),dx}var hx={},kO;function z1(){return kO||(kO=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){var r;return typeof n=="string"||typeof n=="symbol"?n:Object.is((r=n==null?void 0:n.valueOf)==null?void 0:r.call(n),-0)?"-0":String(n)}e.toKey=t})(hx)),hx}var px={},mx={},PO;function tte(){return PO||(PO=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){if(n==null)return"";if(typeof n=="string")return n;if(Array.isArray(n))return n.map(t).join(",");const r=String(n);return r==="0"&&Object.is(Number(n),-0)?"-0":r}e.toString=t})(mx)),mx}var CO;function B1(){return CO||(CO=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=tte(),n=z1();function r(i){if(Array.isArray(i))return i.map(n.toKey);if(typeof i=="symbol")return[i];i=t.toString(i);const o=[],a=i.length;if(a===0)return o;let s=0,u="",f="",d=!1;for(i.charCodeAt(0)===46&&(o.push(""),s++);s<a;){const h=i[s];f?h==="\\"&&s+1<a?(s++,u+=i[s]):h===f?f="":u+=h:d?h==='"'||h==="'"?f=h:h==="]"?(d=!1,o.push(u),u=""):u+=h:h==="["?(d=!0,u&&(o.push(u),u="")):h==="."?u&&(o.push(u),u=""):u+=h,s++}return u&&o.push(u),o}e.toPath=r})(px)),px}var EO;function U1(){return EO||(EO=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=ete(),n=JM(),r=z1(),i=B1();function o(s,u,f){if(s==null)return f;switch(typeof u){case"string":{if(t.isUnsafeProperty(u))return f;const d=s[u];return d===void 0?n.isDeepKey(u)?o(s,i.toPath(u),f):f:d}case"number":case"symbol":{typeof u=="number"&&(u=r.toKey(u));const d=s[u];return d===void 0?f:d}default:{if(Array.isArray(u))return a(s,u,f);if(Object.is(u==null?void 0:u.valueOf(),-0)?u="-0":u=String(u),t.isUnsafeProperty(u))return f;const d=s[u];return d===void 0?f:d}}}function a(s,u,f){if(u.length===0)return f;let d=s;for(let h=0;h<u.length;h++){if(d==null||t.isUnsafeProperty(u[h]))return f;d=d[u[h]]}return d===void 0?f:d}e.get=o})(cx)),cx}var gx,jO;function nte(){return jO||(jO=1,gx=U1().get),gx}var rte=nte();const ql=yr(rte);var ite=4;function ba(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:ite,n=10**t,r=Math.round(e*n)/n;return Object.is(r,-0)?0:r}function Rt(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return e.reduce((i,o,a)=>{var s=n[a-1];return typeof s=="string"?i+s+o:s!==void 0?i+ba(s)+o:i+o},"")}var Xn=e=>e===0?0:e>0?1:-1,si=e=>typeof e=="number"&&e!=+e,Ns=e=>typeof e=="string"&&e.indexOf("%")===e.length-1,ye=e=>(typeof e=="number"||e instanceof Number)&&!si(e),zi=e=>ye(e)||typeof e=="string",ote=0,Hc=e=>{var t=++ote;return"".concat(e||"").concat(t)},li=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!ye(t)&&typeof t!="string")return r;var o;if(Ns(t)){if(n==null)return r;var a=t.indexOf("%");o=n*parseFloat(t.slice(0,a))/100}else o=+t;return si(o)&&(o=r),i&&n!=null&&o>n&&(o=n),o},eL=e=>{if(!Array.isArray(e))return!1;for(var t=e.length,n={},r=0;r<t;r++)if(!n[String(e[r])])n[String(e[r])]=!0;else return!0;return!1};function Nt(e,t,n){return ye(e)&&ye(t)?ba(e+n*(t-e)):t}function tL(e,t,n){if(!(!e||!e.length))return e.find(r=>r&&(typeof t=="function"?t(r):ql(r,t))===n)}var Mt=e=>e===null||typeof e>"u",kf=e=>Mt(e)?e:"".concat(e.charAt(0).toUpperCase()).concat(e.slice(1));function Zn(e){return e!=null}function Ls(){}var ate=["type","size","sizeType"];function $b(){return $b=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},$b.apply(null,arguments)}function OO(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function NO(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?OO(Object(n),!0).forEach(function(r){ste(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):OO(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function ste(e,t,n){return(t=lte(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function lte(e){var t=ute(e,"string");return typeof t=="symbol"?t:t+""}function ute(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function cte(e,t){if(e==null)return{};var n,r,i=fte(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function fte(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var nL={symbolCircle:F1,symbolCross:Eee,symbolDiamond:Oee,symbolSquare:Nee,symbolStar:Iee,symbolTriangle:Ree,symbolWye:Mee},dte=Math.PI/180,hte=e=>{var t="symbol".concat(kf(e));return nL[t]||F1},pte=(e,t,n)=>{if(t==="area")return e;switch(n){case"cross":return 5*e*e/9;case"diamond":return .5*e*e/Math.sqrt(3);case"square":return e*e;case"star":{var r=18*dte;return 1.25*e*e*(Math.tan(r)-Math.tan(r*2)*Math.tan(r)**2)}case"triangle":return Math.sqrt(3)*e*e/4;case"wye":return(21-10*Math.sqrt(3))*e*e/8;default:return Math.PI*e*e/4}},mte=(e,t)=>{nL["symbol".concat(kf(e))]=t},W1=e=>{var{type:t="circle",size:n=64,sizeType:r="area"}=e,i=cte(e,ate),o=NO(NO({},i),{},{type:t,size:n,sizeType:r}),a="circle";typeof t=="string"&&(a=t);var s=()=>{var m=hte(a),v=Lee().type(m).size(pte(n,r,a)),w=v();if(w!==null)return w},{className:u,cx:f,cy:d}=o,h=Ln(o);return ye(f)&&ye(d)&&ye(n)?y.createElement("path",$b({},h,{className:at("recharts-symbols",u),transform:"translate(".concat(f,", ").concat(d,")"),d:s()})):null};W1.registerSymbol=mte;var rL=e=>"radius"in e&&"startAngle"in e&&"endAngle"in e,H1=(e,t)=>{if(!e||typeof e=="function"||typeof e=="boolean")return null;var n=e;if(y.isValidElement(e)&&(n=e.props),typeof n!="object"&&typeof n!="function")return null;var r={};return Object.keys(n).forEach(i=>{D1(i)&&(r[i]=(o=>n[i](n,o)))}),r},gte=(e,t,n)=>r=>(e(t,n,r),null),Um=(e,t,n)=>{if(e===null||typeof e!="object"&&typeof e!="function")return null;var r=null;return Object.keys(e).forEach(i=>{var o=e[i];D1(i)&&typeof o=="function"&&(r||(r={}),r[i]=gte(o,t,n))}),r};function AO(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function vte(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?AO(Object(n),!0).forEach(function(r){yte(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):AO(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function yte(e,t,n){return(t=xte(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function xte(e){var t=bte(e,"string");return typeof t=="symbol"?t:t+""}function bte(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function yn(e,t){var n=vte({},e),r=t,i=Object.keys(t),o=i.reduce((a,s)=>(a[s]===void 0&&r[s]!==void 0&&(a[s]=r[s]),a),n);return o}function Pp(){return Pp=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Pp.apply(null,arguments)}function TO(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function wte(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?TO(Object(n),!0).forEach(function(r){Ste(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):TO(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Ste(e,t,n){return(t=kte(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function kte(e){var t=Pte(e,"string");return typeof t=="symbol"?t:t+""}function Pte(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Ar=32,Cte={align:"center",iconSize:14,inactiveColor:"#ccc",layout:"horizontal",verticalAlign:"middle"};function Ete(e){var{data:t,iconType:n,inactiveColor:r}=e,i=Ar/2,o=Ar/6,a=Ar/3,s=t.inactive?r:t.color,u=n??t.type;if(u==="none")return null;if(u==="plainline"){var f;return y.createElement("line",{strokeWidth:4,fill:"none",stroke:s,strokeDasharray:(f=t.payload)===null||f===void 0?void 0:f.strokeDasharray,x1:0,y1:i,x2:Ar,y2:i,className:"recharts-legend-icon"})}if(u==="line")return y.createElement("path",{strokeWidth:4,fill:"none",stroke:s,d:"M0,".concat(i,"h").concat(a,`
|
|
271
|
+
`))}function u(v,w,b,S){const k=b.enter("tableCell"),C=b.enter("phrasing"),j=b.containerPhrasing(v,{...S,before:o,after:o});return C(),k(),j}function f(v,w){return eZ(v,{align:w,alignDelimiters:r,padding:n,stringLength:i})}function d(v,w,b){const S=v.children;let k=-1;const C=[],j=w.enter("table");for(;++k<S.length;)C[k]=h(S[k],w,b);return j(),C}function h(v,w,b){const S=v.children;let k=-1;const C=[],j=w.enter("tableRow");for(;++k<S.length;)C[k]=u(S[k],v,w,b);return j(),C}function m(v,w,b){let S=lM.inlineCode(v,w,b);return b.stack.includes("tableCell")&&(S=S.replace(/\|/g,"\\$&")),S}}function BZ(){return{exit:{taskListCheckValueChecked:hO,taskListCheckValueUnchecked:hO,paragraph:WZ}}}function UZ(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:HZ}}}function hO(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function WZ(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const r=n.children[0];if(r&&r.type==="text"){const i=t.children;let o=-1,a;for(;++o<i.length;){const s=i[o];if(s.type==="paragraph"){a=s;break}}a===n&&(r.value=r.value.slice(1),r.value.length===0?n.children.shift():n.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,n.position.start=Object.assign({},r.position.start)))}}this.exit(e)}function HZ(e,t,n,r){const i=e.children[0],o=typeof e.checked=="boolean"&&i&&i.type==="paragraph",a="["+(e.checked?"x":" ")+"] ",s=n.createTracker(r);o&&s.move(a);let u=lM.listItem(e,t,n,{...r,...s.current()});return o&&(u=u.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,f)),u;function f(d){return d+a}}function VZ(){return[kX(),HX(),GX(),RZ(),BZ()]}function qZ(e){return{extensions:[PX(),VX(e),YX(),zZ(e),UZ()]}}const KZ={tokenize:JZ,partial:!0},uM={tokenize:eJ,partial:!0},cM={tokenize:tJ,partial:!0},fM={tokenize:nJ,partial:!0},GZ={tokenize:rJ,partial:!0},dM={name:"wwwAutolink",tokenize:XZ,previous:pM},hM={name:"protocolAutolink",tokenize:ZZ,previous:mM},Oo={name:"emailAutolink",tokenize:QZ,previous:gM},Vi={};function YZ(){return{text:Vi}}let Xa=48;for(;Xa<123;)Vi[Xa]=Oo,Xa++,Xa===58?Xa=65:Xa===91&&(Xa=97);Vi[43]=Oo;Vi[45]=Oo;Vi[46]=Oo;Vi[95]=Oo;Vi[72]=[Oo,hM];Vi[104]=[Oo,hM];Vi[87]=[Oo,dM];Vi[119]=[Oo,dM];function QZ(e,t,n){const r=this;let i,o;return a;function a(h){return!Ab(h)||!gM.call(r,r.previous)||I1(r.events)?n(h):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),s(h))}function s(h){return Ab(h)?(e.consume(h),s):h===64?(e.consume(h),u):n(h)}function u(h){return h===46?e.check(GZ,d,f)(h):h===45||h===95||En(h)?(o=!0,e.consume(h),u):d(h)}function f(h){return e.consume(h),i=!0,u}function d(h){return o&&i&&Dn(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(h)):n(h)}}function XZ(e,t,n){const r=this;return i;function i(a){return a!==87&&a!==119||!pM.call(r,r.previous)||I1(r.events)?n(a):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(KZ,e.attempt(uM,e.attempt(cM,o),n),n)(a))}function o(a){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(a)}}function ZZ(e,t,n){const r=this;let i="",o=!1;return a;function a(h){return(h===72||h===104)&&mM.call(r,r.previous)&&!I1(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),i+=String.fromCodePoint(h),e.consume(h),s):n(h)}function s(h){if(Dn(h)&&i.length<5)return i+=String.fromCodePoint(h),e.consume(h),s;if(h===58){const m=i.toLowerCase();if(m==="http"||m==="https")return e.consume(h),u}return n(h)}function u(h){return h===47?(e.consume(h),o?f:(o=!0,u)):n(h)}function f(h){return h===null||mp(h)||ht(h)||js(h)||Im(h)?n(h):e.attempt(uM,e.attempt(cM,d),n)(h)}function d(h){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(h)}}function JZ(e,t,n){let r=0;return i;function i(a){return(a===87||a===119)&&r<3?(r++,e.consume(a),i):a===46&&r===3?(e.consume(a),o):n(a)}function o(a){return a===null?n(a):t(a)}}function eJ(e,t,n){let r,i,o;return a;function a(f){return f===46||f===95?e.check(fM,u,s)(f):f===null||ht(f)||js(f)||f!==45&&Im(f)?u(f):(o=!0,e.consume(f),a)}function s(f){return f===95?r=!0:(i=r,r=void 0),e.consume(f),a}function u(f){return i||r||!o?n(f):t(f)}}function tJ(e,t){let n=0,r=0;return i;function i(a){return a===40?(n++,e.consume(a),i):a===41&&r<n?o(a):a===33||a===34||a===38||a===39||a===41||a===42||a===44||a===46||a===58||a===59||a===60||a===63||a===93||a===95||a===126?e.check(fM,t,o)(a):a===null||ht(a)||js(a)?t(a):(e.consume(a),i)}function o(a){return a===41&&r++,e.consume(a),i}}function nJ(e,t,n){return r;function r(s){return s===33||s===34||s===39||s===41||s===42||s===44||s===46||s===58||s===59||s===63||s===95||s===126?(e.consume(s),r):s===38?(e.consume(s),o):s===93?(e.consume(s),i):s===60||s===null||ht(s)||js(s)?t(s):n(s)}function i(s){return s===null||s===40||s===91||ht(s)||js(s)?t(s):r(s)}function o(s){return Dn(s)?a(s):n(s)}function a(s){return s===59?(e.consume(s),r):Dn(s)?(e.consume(s),a):n(s)}}function rJ(e,t,n){return r;function r(o){return e.consume(o),i}function i(o){return En(o)?n(o):t(o)}}function pM(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||ht(e)}function mM(e){return!Dn(e)}function gM(e){return!(e===47||Ab(e))}function Ab(e){return e===43||e===45||e===46||e===95||En(e)}function I1(e){let t=e.length,n=!1;for(;t--;){const r=e[t][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const iJ={tokenize:dJ,partial:!0};function oJ(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:uJ,continuation:{tokenize:cJ},exit:fJ}},text:{91:{name:"gfmFootnoteCall",tokenize:lJ},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:aJ,resolveTo:sJ}}}}function aJ(e,t,n){const r=this;let i=r.events.length;const o=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a;for(;i--;){const u=r.events[i][1];if(u.type==="labelImage"){a=u;break}if(u.type==="gfmFootnoteCall"||u.type==="labelLink"||u.type==="label"||u.type==="image"||u.type==="link")break}return s;function s(u){if(!a||!a._balanced)return n(u);const f=ti(r.sliceSerialize({start:a.end,end:r.now()}));return f.codePointAt(0)!==94||!o.includes(f.slice(1))?n(u):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(u),e.exit("gfmFootnoteCallLabelMarker"),t(u))}}function sJ(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;const o={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},a={type:"chunkString",contentType:"string",start:Object.assign({},o.start),end:Object.assign({},o.end)},s=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",i,t],["exit",i,t],["enter",o,t],["enter",a,t],["exit",a,t],["exit",o,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...s),e}function lJ(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o=0,a;return s;function s(h){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(h),e.exit("gfmFootnoteCallLabelMarker"),u}function u(h){return h!==94?n(h):(e.enter("gfmFootnoteCallMarker"),e.consume(h),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",f)}function f(h){if(o>999||h===93&&!a||h===null||h===91||ht(h))return n(h);if(h===93){e.exit("chunkString");const m=e.exit("gfmFootnoteCallString");return i.includes(ti(r.sliceSerialize(m)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(h),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(h)}return ht(h)||(a=!0),o++,e.consume(h),h===92?d:f}function d(h){return h===91||h===92||h===93?(e.consume(h),o++,f):f(h)}}function uJ(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o,a=0,s;return u;function u(w){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(w),e.exit("gfmFootnoteDefinitionLabelMarker"),f}function f(w){return w===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(w),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",d):n(w)}function d(w){if(a>999||w===93&&!s||w===null||w===91||ht(w))return n(w);if(w===93){e.exit("chunkString");const b=e.exit("gfmFootnoteDefinitionLabelString");return o=ti(r.sliceSerialize(b)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(w),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),m}return ht(w)||(s=!0),a++,e.consume(w),w===92?h:d}function h(w){return w===91||w===92||w===93?(e.consume(w),a++,d):d(w)}function m(w){return w===58?(e.enter("definitionMarker"),e.consume(w),e.exit("definitionMarker"),i.includes(o)||i.push(o),Ye(e,v,"gfmFootnoteDefinitionWhitespace")):n(w)}function v(w){return t(w)}}function cJ(e,t,n){return e.check(xf,t,e.attempt(iJ,t,n))}function fJ(e){e.exit("gfmFootnoteDefinition")}function dJ(e,t,n){const r=this;return Ye(e,i,"gfmFootnoteDefinitionIndent",5);function i(o){const a=r.events[r.events.length-1];return a&&a[1].type==="gfmFootnoteDefinitionIndent"&&a[2].sliceSerialize(a[1],!0).length===4?t(o):n(o)}}function hJ(e){let n=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:o,resolveAll:i};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function i(a,s){let u=-1;for(;++u<a.length;)if(a[u][0]==="enter"&&a[u][1].type==="strikethroughSequenceTemporary"&&a[u][1]._close){let f=u;for(;f--;)if(a[f][0]==="exit"&&a[f][1].type==="strikethroughSequenceTemporary"&&a[f][1]._open&&a[u][1].end.offset-a[u][1].start.offset===a[f][1].end.offset-a[f][1].start.offset){a[u][1].type="strikethroughSequence",a[f][1].type="strikethroughSequence";const d={type:"strikethrough",start:Object.assign({},a[f][1].start),end:Object.assign({},a[u][1].end)},h={type:"strikethroughText",start:Object.assign({},a[f][1].end),end:Object.assign({},a[u][1].start)},m=[["enter",d,s],["enter",a[f][1],s],["exit",a[f][1],s],["enter",h,s]],v=s.parser.constructs.insideSpan.null;v&&mr(m,m.length,0,Rm(v,a.slice(f+1,u),s)),mr(m,m.length,0,[["exit",h,s],["enter",a[u][1],s],["exit",a[u][1],s],["exit",d,s]]),mr(a,f-1,u-f+3,m),u=f+m.length-2;break}}for(u=-1;++u<a.length;)a[u][1].type==="strikethroughSequenceTemporary"&&(a[u][1].type="data");return a}function o(a,s,u){const f=this.previous,d=this.events;let h=0;return m;function m(w){return f===126&&d[d.length-1][1].type!=="characterEscape"?u(w):(a.enter("strikethroughSequenceTemporary"),v(w))}function v(w){const b=Vl(f);if(w===126)return h>1?u(w):(a.consume(w),h++,v);if(h<2&&!n)return u(w);const S=a.exit("strikethroughSequenceTemporary"),k=Vl(w);return S._open=!k||k===2&&!!b,S._close=!b||b===2&&!!k,s(w)}}}class pJ{constructor(){this.map=[]}add(t,n,r){mJ(this,t,n,r)}consume(t){if(this.map.sort(function(o,a){return o[0]-a[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];r.push(t.slice()),t.length=0;let i=r.pop();for(;i;){for(const o of i)t.push(o);i=r.pop()}this.map.length=0}}function mJ(e,t,n,r){let i=0;if(!(n===0&&r.length===0)){for(;i<e.map.length;){if(e.map[i][0]===t){e.map[i][1]+=n,e.map[i][2].push(...r);return}i+=1}e.map.push([t,n,r])}}function gJ(e,t){let n=!1;const r=[];for(;t<e.length;){const i=e[t];if(n){if(i[0]==="enter")i[1].type==="tableContent"&&r.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(i[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const o=r.length-1;r[o]=r[o]==="left"?"center":"right"}}else if(i[1].type==="tableDelimiterRow")break}else i[0]==="enter"&&i[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return r}function vJ(){return{flow:{null:{name:"table",tokenize:yJ,resolveAll:xJ}}}}function yJ(e,t,n){const r=this;let i=0,o=0,a;return s;function s(D){let U=r.events.length-1;for(;U>-1;){const W=r.events[U][1].type;if(W==="lineEnding"||W==="linePrefix")U--;else break}const L=U>-1?r.events[U][1].type:null,q=L==="tableHead"||L==="tableRow"?N:u;return q===N&&r.parser.lazy[r.now().line]?n(D):q(D)}function u(D){return e.enter("tableHead"),e.enter("tableRow"),f(D)}function f(D){return D===124||(a=!0,o+=1),d(D)}function d(D){return D===null?n(D):_e(D)?o>1?(o=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(D),e.exit("lineEnding"),v):n(D):We(D)?Ye(e,d,"whitespace")(D):(o+=1,a&&(a=!1,i+=1),D===124?(e.enter("tableCellDivider"),e.consume(D),e.exit("tableCellDivider"),a=!0,d):(e.enter("data"),h(D)))}function h(D){return D===null||D===124||ht(D)?(e.exit("data"),d(D)):(e.consume(D),D===92?m:h)}function m(D){return D===92||D===124?(e.consume(D),h):h(D)}function v(D){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(D):(e.enter("tableDelimiterRow"),a=!1,We(D)?Ye(e,w,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(D):w(D))}function w(D){return D===45||D===58?S(D):D===124?(a=!0,e.enter("tableCellDivider"),e.consume(D),e.exit("tableCellDivider"),b):A(D)}function b(D){return We(D)?Ye(e,S,"whitespace")(D):S(D)}function S(D){return D===58?(o+=1,a=!0,e.enter("tableDelimiterMarker"),e.consume(D),e.exit("tableDelimiterMarker"),k):D===45?(o+=1,k(D)):D===null||_e(D)?O(D):A(D)}function k(D){return D===45?(e.enter("tableDelimiterFiller"),C(D)):A(D)}function C(D){return D===45?(e.consume(D),C):D===58?(a=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(D),e.exit("tableDelimiterMarker"),j):(e.exit("tableDelimiterFiller"),j(D))}function j(D){return We(D)?Ye(e,O,"whitespace")(D):O(D)}function O(D){return D===124?w(D):D===null||_e(D)?!a||i!==o?A(D):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(D)):A(D)}function A(D){return n(D)}function N(D){return e.enter("tableRow"),I(D)}function I(D){return D===124?(e.enter("tableCellDivider"),e.consume(D),e.exit("tableCellDivider"),I):D===null||_e(D)?(e.exit("tableRow"),t(D)):We(D)?Ye(e,I,"whitespace")(D):(e.enter("data"),T(D))}function T(D){return D===null||D===124||ht(D)?(e.exit("data"),I(D)):(e.consume(D),D===92?$:T)}function $(D){return D===92||D===124?(e.consume(D),T):T(D)}}function xJ(e,t){let n=-1,r=!0,i=0,o=[0,0,0,0],a=[0,0,0,0],s=!1,u=0,f,d,h;const m=new pJ;for(;++n<e.length;){const v=e[n],w=v[1];v[0]==="enter"?w.type==="tableHead"?(s=!1,u!==0&&(pO(m,t,u,f,d),d=void 0,u=0),f={type:"table",start:Object.assign({},w.start),end:Object.assign({},w.end)},m.add(n,0,[["enter",f,t]])):w.type==="tableRow"||w.type==="tableDelimiterRow"?(r=!0,h=void 0,o=[0,0,0,0],a=[0,n+1,0,0],s&&(s=!1,d={type:"tableBody",start:Object.assign({},w.start),end:Object.assign({},w.end)},m.add(n,0,[["enter",d,t]])),i=w.type==="tableDelimiterRow"?2:d?3:1):i&&(w.type==="data"||w.type==="tableDelimiterMarker"||w.type==="tableDelimiterFiller")?(r=!1,a[2]===0&&(o[1]!==0&&(a[0]=a[1],h=ph(m,t,o,i,void 0,h),o=[0,0,0,0]),a[2]=n)):w.type==="tableCellDivider"&&(r?r=!1:(o[1]!==0&&(a[0]=a[1],h=ph(m,t,o,i,void 0,h)),o=a,a=[o[1],n,0,0])):w.type==="tableHead"?(s=!0,u=n):w.type==="tableRow"||w.type==="tableDelimiterRow"?(u=n,o[1]!==0?(a[0]=a[1],h=ph(m,t,o,i,n,h)):a[1]!==0&&(h=ph(m,t,a,i,n,h)),i=0):i&&(w.type==="data"||w.type==="tableDelimiterMarker"||w.type==="tableDelimiterFiller")&&(a[3]=n)}for(u!==0&&pO(m,t,u,f,d),m.consume(t.events),n=-1;++n<t.events.length;){const v=t.events[n];v[0]==="enter"&&v[1].type==="table"&&(v[1]._align=gJ(t.events,n))}return e}function ph(e,t,n,r,i,o){const a=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",s="tableContent";n[0]!==0&&(o.end=Object.assign({},Sl(t.events,n[0])),e.add(n[0],0,[["exit",o,t]]));const u=Sl(t.events,n[1]);if(o={type:a,start:Object.assign({},u),end:Object.assign({},u)},e.add(n[1],0,[["enter",o,t]]),n[2]!==0){const f=Sl(t.events,n[2]),d=Sl(t.events,n[3]),h={type:s,start:Object.assign({},f),end:Object.assign({},d)};if(e.add(n[2],0,[["enter",h,t]]),r!==2){const m=t.events[n[2]],v=t.events[n[3]];if(m[1].end=Object.assign({},v[1].end),m[1].type="chunkText",m[1].contentType="text",n[3]>n[2]+1){const w=n[2]+1,b=n[3]-n[2]-1;e.add(w,b,[])}}e.add(n[3]+1,0,[["exit",h,t]])}return i!==void 0&&(o.end=Object.assign({},Sl(t.events,i)),e.add(i,0,[["exit",o,t]]),o=void 0),o}function pO(e,t,n,r,i){const o=[],a=Sl(t.events,n);i&&(i.end=Object.assign({},a),o.push(["exit",i,t])),r.end=Object.assign({},a),o.push(["exit",r,t]),e.add(n+1,0,o)}function Sl(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const bJ={name:"tasklistCheck",tokenize:SJ};function wJ(){return{text:{91:bJ}}}function SJ(e,t,n){const r=this;return i;function i(u){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(u):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(u),e.exit("taskListCheckMarker"),o)}function o(u){return ht(u)?(e.enter("taskListCheckValueUnchecked"),e.consume(u),e.exit("taskListCheckValueUnchecked"),a):u===88||u===120?(e.enter("taskListCheckValueChecked"),e.consume(u),e.exit("taskListCheckValueChecked"),a):n(u)}function a(u){return u===93?(e.enter("taskListCheckMarker"),e.consume(u),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),s):n(u)}function s(u){return _e(u)?t(u):We(u)?e.check({tokenize:kJ},t,n)(u):n(u)}}function kJ(e,t,n){return Ye(e,r,"whitespace");function r(i){return i===null?n(i):t(i)}}function PJ(e){return jD([YZ(),oJ(),hJ(e),vJ(),wJ()])}const CJ={};function EJ(e){const t=this,n=e||CJ,r=t.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),o=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),a=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(PJ(n)),o.push(VZ()),a.push(qZ(n))}function Hh({content:e,className:t="",variant:n="default"}){const r=n==="dark";return g.jsx("div",{className:`prose prose-sm prose-stone dark:prose-invert max-w-none ${t}`,children:g.jsx(hX,{remarkPlugins:[EJ],components:{pre:({children:i})=>g.jsx("pre",{className:r?"bg-[#1a1816]/60 text-stone-100 rounded-lg p-3 overflow-x-auto my-2 text-xs border border-white/20 [&>code]:bg-transparent [&>code]:p-0 [&>code]:border-0 [&>code]:text-inherit":"bg-stone-700 dark:bg-stone-800 text-stone-100 rounded-lg p-3 overflow-x-auto my-2 text-xs [&>code]:bg-transparent [&>code]:p-0 [&>code]:border-0 [&>code]:text-inherit",children:i}),code:({children:i,className:o})=>o?g.jsx("code",{className:"text-xs font-mono",children:i}):g.jsx("code",{className:r?"bg-white/15 text-white px-1.5 py-0.5 rounded text-xs font-mono":"bg-stone-200 dark:bg-stone-700 text-stone-700 dark:text-stone-200 px-1.5 py-0.5 rounded text-xs font-mono",children:i}),p:({children:i})=>g.jsx("p",{className:"my-1.5 leading-relaxed",children:i}),ul:({children:i})=>g.jsx("ul",{className:"list-disc list-inside my-1.5 space-y-0.5",children:i}),ol:({children:i})=>g.jsx("ol",{className:"list-decimal list-inside my-1.5 space-y-0.5",children:i}),li:({children:i})=>g.jsx("li",{className:"ml-2",children:i}),h1:({children:i})=>g.jsx("h1",{className:"text-lg font-bold mt-3 mb-1.5",children:i}),h2:({children:i})=>g.jsx("h2",{className:"text-base font-bold mt-2.5 mb-1",children:i}),h3:({children:i})=>g.jsx("h3",{className:"text-sm font-bold mt-2 mb-1",children:i}),a:({children:i,href:o})=>g.jsx("a",{href:o,target:"_blank",rel:"noopener noreferrer",className:r?"text-orange-200 hover:underline":"text-[#C15F3C] dark:text-orange-400 hover:underline",children:i}),blockquote:({children:i})=>g.jsx("blockquote",{className:r?"border-l-2 border-white/30 pl-3 my-2 text-stone-200 italic":"border-l-2 border-stone-300 dark:border-stone-600 pl-3 my-2 text-stone-600 dark:text-stone-400 italic",children:i}),table:({children:i})=>g.jsx("div",{className:"overflow-x-auto my-2",children:g.jsx("table",{className:"min-w-full border-collapse text-xs",children:i})}),th:({children:i})=>g.jsx("th",{className:r?"border border-white/20 px-2 py-1 bg-white/10 font-medium text-left":"border border-stone-300 dark:border-stone-600 px-2 py-1 bg-stone-100 dark:bg-stone-800 font-medium text-left",children:i}),td:({children:i})=>g.jsx("td",{className:r?"border border-white/20 px-2 py-1":"border border-stone-300 dark:border-stone-600 px-2 py-1",children:i}),hr:()=>g.jsx("hr",{className:r?"my-3 border-white/20":"my-3 border-stone-200 dark:border-stone-700"}),strong:({children:i})=>g.jsx("strong",{className:"font-semibold",children:i}),em:({children:i})=>g.jsx("em",{className:"italic",children:i})},children:e})})}const jJ={summary:g.jsx(sR,{className:"h-4 w-4"}),plan:g.jsx(jV,{className:"h-4 w-4"}),discussions:g.jsx(MV,{className:"h-4 w-4"}),codeExamples:g.jsx(NV,{className:"h-4 w-4"}),references:g.jsx(RV,{className:"h-4 w-4"}),handoff:g.jsx(hV,{className:"h-4 w-4"}),errors:g.jsx(UV,{className:"h-4 w-4"})},OJ={summary:"border-l-blue-500",plan:"border-l-purple-500",discussions:"border-l-indigo-500",codeExamples:"border-l-green-500",references:"border-l-yellow-500",handoff:"border-l-orange-500",errors:"border-l-red-500"};function Za({sectionKey:e,label:t,children:n}){const[r,i]=y.useState(!0),o=jJ[e]||g.jsx(sR,{className:"h-4 w-4"}),a=OJ[e]||"border-l-gray-500";return g.jsxs("div",{className:`border-l-4 ${a} bg-card rounded-r-lg shadow-sm overflow-hidden`,children:[g.jsxs("button",{type:"button",className:"w-full px-4 py-3 flex items-center justify-between bg-muted/30 hover:bg-muted/50 transition-colors",onClick:()=>i(!r),children:[g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx("span",{className:"text-muted-foreground",children:o}),g.jsx("span",{className:"font-medium text-sm",children:t})]}),g.jsx("span",{className:"text-muted-foreground",children:r?g.jsx(n1,{className:"h-4 w-4"}):g.jsx(kV,{className:"h-4 w-4"})})]}),r&&g.jsx("div",{className:"px-4 py-3",children:n})]})}function NJ({summary:e,t}){return g.jsxs("div",{className:"space-y-2 text-sm",children:[e.goal&&g.jsxs("div",{children:[g.jsxs("span",{className:"text-muted-foreground",children:[t("context.fields.goal"),":"]})," ",g.jsx("span",{children:e.goal})]}),e.outcome&&g.jsxs("div",{children:[g.jsxs("span",{className:"text-muted-foreground",children:[t("context.fields.outcome"),":"]})," ",g.jsx(tt,{variant:e.outcome==="success"?"default":"secondary",className:"text-xs",children:e.outcome})]}),e.description&&g.jsxs("div",{children:[g.jsxs("span",{className:"text-muted-foreground",children:[t("context.fields.description"),":"]}),g.jsx("p",{className:"mt-1 whitespace-pre-wrap",children:e.description})]}),e.sessionType&&g.jsxs("div",{children:[g.jsxs("span",{className:"text-muted-foreground",children:[t("context.fields.type"),":"]})," ",g.jsx(tt,{variant:"outline",className:"text-xs",children:e.sessionType})]})]})}function AJ({plan:e,t}){return g.jsxs("div",{className:"space-y-3 text-sm",children:[e.goals&&e.goals.length>0&&g.jsxs("div",{children:[g.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:t("context.fields.goals")}),g.jsx("ul",{className:"list-disc list-inside space-y-1",children:e.goals.map(n=>g.jsx("li",{children:n},n))})]}),e.tasks&&e.tasks.length>0&&g.jsxs("div",{children:[g.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:t("context.fields.tasks")}),g.jsx("ul",{className:"space-y-1 font-mono text-xs",children:e.tasks.map(n=>g.jsx("li",{className:n.startsWith("[x]")?"text-green-600 dark:text-green-400":"",children:n},n))})]}),e.remaining&&e.remaining.length>0&&g.jsxs("div",{children:[g.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:t("context.fields.remaining")}),g.jsx("ul",{className:"list-disc list-inside space-y-1 text-orange-600 dark:text-orange-400",children:e.remaining.map(n=>g.jsx("li",{children:n},n))})]})]})}function TJ({discussions:e,t}){return g.jsx("div",{className:"space-y-3",children:e.map(n=>g.jsxs("div",{className:"bg-muted/30 rounded p-3 space-y-2 text-sm",children:[g.jsx("div",{className:"font-medium",children:n.topic}),g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsxs("span",{className:"text-muted-foreground",children:[t("context.fields.decision"),":"]}),g.jsx(tt,{variant:"default",className:"text-xs",children:n.decision})]}),n.reasoning&&g.jsx("div",{className:"text-muted-foreground text-xs",children:n.reasoning}),n.alternatives&&n.alternatives.length>0&&g.jsxs("div",{className:"text-xs",children:[g.jsxs("span",{className:"text-muted-foreground",children:[t("context.fields.alternatives"),":"," "]}),n.alternatives.join(", ")]})]},`${n.topic}-${n.decision}`))})}function _J({codeExamples:e,t}){return g.jsx("div",{className:"space-y-3",children:e.map(n=>g.jsxs("div",{className:"space-y-2",children:[g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx(tt,{variant:"outline",className:"text-xs font-mono",children:n.file}),n.description&&g.jsx("span",{className:"text-xs text-muted-foreground",children:n.description})]}),n.before&&g.jsxs("div",{children:[g.jsxs("div",{className:"text-xs text-muted-foreground mb-1",children:[t("context.fields.before"),":"]}),g.jsx("pre",{className:"bg-muted p-2 rounded text-xs font-mono overflow-x-auto",children:n.before})]}),n.after&&g.jsxs("div",{children:[g.jsxs("div",{className:"text-xs text-muted-foreground mb-1",children:[t("context.fields.after"),":"]}),g.jsx("pre",{className:"bg-muted p-2 rounded text-xs font-mono overflow-x-auto",children:n.after})]})]},`${n.file}-${n.description||""}`))})}function IJ({errors:e,t}){return g.jsx("div",{className:"space-y-3",children:e.map(n=>g.jsxs("div",{className:"bg-destructive/10 border border-destructive/20 rounded p-3 space-y-2 text-sm",children:[g.jsx("div",{className:"font-mono text-xs text-destructive",children:n.error}),n.context&&g.jsxs("div",{className:"text-xs",children:[g.jsxs("span",{className:"text-muted-foreground",children:[t("context.fields.context"),":"," "]}),n.context]}),n.cause&&g.jsxs("div",{className:"text-xs",children:[g.jsxs("span",{className:"text-muted-foreground",children:[t("context.fields.cause"),":"," "]}),n.cause]}),n.solution&&g.jsxs("div",{className:"text-xs text-green-600 dark:text-green-400",children:[g.jsxs("span",{className:"text-muted-foreground",children:[t("context.fields.solution"),":"," "]}),n.solution]}),n.files&&n.files.length>0&&g.jsx("div",{className:"flex flex-wrap gap-1",children:n.files.map(r=>g.jsx(tt,{variant:"secondary",className:"text-xs font-mono",children:r},r))})]},`${n.error}-${n.cause||""}`))})}function RJ({handoff:e,t}){return g.jsxs("div",{className:"space-y-2 text-sm",children:[e.stoppedReason&&g.jsxs("div",{children:[g.jsxs("span",{className:"text-muted-foreground",children:[t("context.fields.stoppedReason"),":"]})," ",g.jsx("span",{children:e.stoppedReason})]}),e.notes&&g.jsxs("div",{children:[g.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:t("context.fields.notes")}),Array.isArray(e.notes)?e.notes.length>0&&g.jsx("ul",{className:"list-disc list-inside space-y-1",children:e.notes.map(n=>g.jsx("li",{children:n},n))}):g.jsx("p",{className:"whitespace-pre-wrap",children:e.notes})]}),e.nextSteps&&e.nextSteps.length>0&&g.jsxs("div",{children:[g.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:t("context.fields.nextSteps")}),g.jsx("ul",{className:"list-disc list-inside space-y-1 text-primary",children:e.nextSteps.map(n=>g.jsx("li",{children:n},n))})]})]})}function DJ({references:e}){return g.jsx("div",{className:"space-y-2",children:e.map(t=>typeof t=="string"?g.jsx("div",{className:"flex items-start gap-2 text-sm",children:g.jsx("code",{className:"bg-muted px-1.5 py-0.5 rounded text-xs font-mono",children:t})},t):g.jsxs("div",{className:"flex items-start gap-2 text-sm",children:[t.type&&g.jsx(tt,{variant:"outline",className:"text-xs",children:t.type}),t.url?g.jsx("a",{href:t.url,target:"_blank",rel:"noreferrer",className:"text-primary hover:underline",children:t.title||t.url}):t.path?g.jsx("code",{className:"bg-muted px-1.5 py-0.5 rounded text-xs font-mono",children:t.path}):t.title,t.description&&g.jsxs("span",{className:"text-muted-foreground text-xs",children:["- ",t.description]})]},`${t.type||""}-${t.url||t.path||t.title||""}`))})}function MJ({session:e,embedded:t=!1}){var a,s,u,f,d,h,m,v;const{t:n}=Ke("sessions"),r=[e.summary&&(e.summary.goal||e.summary.description),e.plan&&(((a=e.plan.tasks)==null?void 0:a.length)||((s=e.plan.remaining)==null?void 0:s.length)),e.discussions&&e.discussions.length>0,e.codeExamples&&e.codeExamples.length>0,e.errors&&e.errors.length>0,e.handoff&&(e.handoff.stoppedReason||((u=e.handoff.notes)==null?void 0:u.length)||((f=e.handoff.nextSteps)==null?void 0:f.length)),e.references&&e.references.length>0].filter(Boolean).length;if(r===0)return null;const i=g.jsxs(g.Fragment,{children:[g.jsxs("div",{className:"text-lg flex items-center gap-2 font-semibold",children:[g.jsx(cj,{className:"h-5 w-5 text-muted-foreground"}),n("context.title"),g.jsx(tt,{variant:"secondary",className:"text-xs font-normal",children:n("context.sections",{count:r})})]}),e.summary&&g.jsxs("div",{className:"flex flex-wrap gap-2 mt-2 text-xs text-muted-foreground",children:[e.summary.outcome&&g.jsx(tt,{variant:e.summary.outcome==="success"?"default":"outline",className:"text-xs",children:e.summary.outcome}),e.summary.sessionType&&g.jsx(tt,{variant:"outline",className:"text-xs",children:e.summary.sessionType})]})]}),o=g.jsxs("div",{className:"space-y-3",children:[e.summary&&(e.summary.goal||e.summary.description)&&g.jsx(Za,{sectionKey:"summary",label:n("context.sectionLabels.summary"),children:g.jsx(NJ,{summary:e.summary,t:n})}),e.plan&&(((d=e.plan.tasks)==null?void 0:d.length)||((h=e.plan.remaining)==null?void 0:h.length))&&g.jsx(Za,{sectionKey:"plan",label:n("context.sectionLabels.plan"),children:g.jsx(AJ,{plan:e.plan,t:n})}),e.discussions&&e.discussions.length>0&&g.jsx(Za,{sectionKey:"discussions",label:n("context.sectionLabels.discussions"),children:g.jsx(TJ,{discussions:e.discussions,t:n})}),e.codeExamples&&e.codeExamples.length>0&&g.jsx(Za,{sectionKey:"codeExamples",label:n("context.sectionLabels.code_examples"),children:g.jsx(_J,{codeExamples:e.codeExamples,t:n})}),e.errors&&e.errors.length>0&&g.jsx(Za,{sectionKey:"errors",label:n("context.sectionLabels.errors"),children:g.jsx(IJ,{errors:e.errors,t:n})}),e.handoff&&(e.handoff.stoppedReason||((m=e.handoff.notes)==null?void 0:m.length)||((v=e.handoff.nextSteps)==null?void 0:v.length))&&g.jsx(Za,{sectionKey:"handoff",label:n("context.sectionLabels.handoff"),children:g.jsx(RJ,{handoff:e.handoff,t:n})}),e.references&&e.references.length>0&&g.jsx(Za,{sectionKey:"references",label:n("context.sectionLabels.references"),children:g.jsx(DJ,{references:e.references})})]});return t?g.jsxs("div",{className:"space-y-4",children:[g.jsx("div",{className:"pb-3",children:i}),o]}):g.jsxs(nt,{children:[g.jsxs(tr,{className:"pb-3",children:[g.jsxs(nr,{className:"text-lg flex items-center gap-2",children:[g.jsx(cj,{className:"h-5 w-5 text-muted-foreground"}),n("context.title"),g.jsx(tt,{variant:"secondary",className:"text-xs font-normal",children:n("context.sections",{count:r})})]}),e.summary&&g.jsxs("div",{className:"flex flex-wrap gap-2 mt-2 text-xs text-muted-foreground",children:[e.summary.outcome&&g.jsx(tt,{variant:e.summary.outcome==="success"?"default":"outline",className:"text-xs",children:e.summary.outcome}),e.summary.sessionType&&g.jsx(tt,{variant:"outline",className:"text-xs",children:e.summary.sessionType})]})]}),g.jsx(rt,{children:o})]})}var sx="rovingFocusGroup.onEntryFocus",LJ={bubbles:!1,cancelable:!0},wf="RovingFocusGroup",[Tb,vM,$J]=fR(wf),[FJ,yM]=su(wf,[$J]),[zJ,BJ]=FJ(wf),xM=y.forwardRef((e,t)=>g.jsx(Tb.Provider,{scope:e.__scopeRovingFocusGroup,children:g.jsx(Tb.Slot,{scope:e.__scopeRovingFocusGroup,children:g.jsx(UJ,{...e,ref:t})})}));xM.displayName=wf;var UJ=y.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:o,currentTabStopId:a,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:u,onEntryFocus:f,preventScrollOnEntryFocus:d=!1,...h}=e,m=y.useRef(null),v=Dt(t,m),w=o1(o),[b,S]=Fc({prop:a,defaultProp:s??null,onChange:u,caller:wf}),[k,C]=y.useState(!1),j=Ca(f),O=vM(n),A=y.useRef(!1),[N,I]=y.useState(0);return y.useEffect(()=>{const T=m.current;if(T)return T.addEventListener(sx,j),()=>T.removeEventListener(sx,j)},[j]),g.jsx(zJ,{scope:n,orientation:r,dir:w,loop:i,currentTabStopId:b,onItemFocus:y.useCallback(T=>S(T),[S]),onItemShiftTab:y.useCallback(()=>C(!0),[]),onFocusableItemAdd:y.useCallback(()=>I(T=>T+1),[]),onFocusableItemRemove:y.useCallback(()=>I(T=>T-1),[]),children:g.jsx(ot.div,{tabIndex:k||N===0?-1:0,"data-orientation":r,...h,ref:v,style:{outline:"none",...e.style},onMouseDown:Ge(e.onMouseDown,()=>{A.current=!0}),onFocus:Ge(e.onFocus,T=>{const $=!A.current;if(T.target===T.currentTarget&&$&&!k){const D=new CustomEvent(sx,LJ);if(T.currentTarget.dispatchEvent(D),!D.defaultPrevented){const U=O().filter(X=>X.focusable),L=U.find(X=>X.active),q=U.find(X=>X.id===b),H=[L,q,...U].filter(Boolean).map(X=>X.ref.current);SM(H,d)}}A.current=!1}),onBlur:Ge(e.onBlur,()=>C(!1))})})}),bM="RovingFocusGroupItem",wM=y.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:o,children:a,...s}=e,u=Sa(),f=o||u,d=BJ(bM,n),h=d.currentTabStopId===f,m=vM(n),{onFocusableItemAdd:v,onFocusableItemRemove:w,currentTabStopId:b}=d;return y.useEffect(()=>{if(r)return v(),()=>w()},[r,v,w]),g.jsx(Tb.ItemSlot,{scope:n,id:f,focusable:r,active:i,children:g.jsx(ot.span,{tabIndex:h?0:-1,"data-orientation":d.orientation,...s,ref:t,onMouseDown:Ge(e.onMouseDown,S=>{r?d.onItemFocus(f):S.preventDefault()}),onFocus:Ge(e.onFocus,()=>d.onItemFocus(f)),onKeyDown:Ge(e.onKeyDown,S=>{if(S.key==="Tab"&&S.shiftKey){d.onItemShiftTab();return}if(S.target!==S.currentTarget)return;const k=VJ(S,d.orientation,d.dir);if(k!==void 0){if(S.metaKey||S.ctrlKey||S.altKey||S.shiftKey)return;S.preventDefault();let j=m().filter(O=>O.focusable).map(O=>O.ref.current);if(k==="last")j.reverse();else if(k==="prev"||k==="next"){k==="prev"&&j.reverse();const O=j.indexOf(S.currentTarget);j=d.loop?qJ(j,O+1):j.slice(O+1)}setTimeout(()=>SM(j))}}),children:typeof a=="function"?a({isCurrentTabStop:h,hasTabStop:b!=null}):a})})});wM.displayName=bM;var WJ={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function HJ(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function VJ(e,t,n){const r=HJ(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return WJ[r]}function SM(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function qJ(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var KJ=xM,GJ=wM,$m="Tabs",[YJ]=su($m,[yM]),kM=yM(),[QJ,R1]=YJ($m),PM=y.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:i,defaultValue:o,orientation:a="horizontal",dir:s,activationMode:u="automatic",...f}=e,d=o1(s),[h,m]=Fc({prop:r,onChange:i,defaultProp:o??"",caller:$m});return g.jsx(QJ,{scope:n,baseId:Sa(),value:h,onValueChange:m,orientation:a,dir:d,activationMode:u,children:g.jsx(ot.div,{dir:d,"data-orientation":a,...f,ref:t})})});PM.displayName=$m;var CM="TabsList",EM=y.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...i}=e,o=R1(CM,n),a=kM(n);return g.jsx(KJ,{asChild:!0,...a,orientation:o.orientation,dir:o.dir,loop:r,children:g.jsx(ot.div,{role:"tablist","aria-orientation":o.orientation,...i,ref:t})})});EM.displayName=CM;var jM="TabsTrigger",OM=y.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:i=!1,...o}=e,a=R1(jM,n),s=kM(n),u=TM(a.baseId,r),f=_M(a.baseId,r),d=r===a.value;return g.jsx(GJ,{asChild:!0,...s,focusable:!i,active:d,children:g.jsx(ot.button,{type:"button",role:"tab","aria-selected":d,"aria-controls":f,"data-state":d?"active":"inactive","data-disabled":i?"":void 0,disabled:i,id:u,...o,ref:t,onMouseDown:Ge(e.onMouseDown,h=>{!i&&h.button===0&&h.ctrlKey===!1?a.onValueChange(r):h.preventDefault()}),onKeyDown:Ge(e.onKeyDown,h=>{[" ","Enter"].includes(h.key)&&a.onValueChange(r)}),onFocus:Ge(e.onFocus,()=>{const h=a.activationMode!=="manual";!d&&!i&&h&&a.onValueChange(r)})})})});OM.displayName=jM;var NM="TabsContent",AM=y.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:i,children:o,...a}=e,s=R1(NM,n),u=TM(s.baseId,r),f=_M(s.baseId,r),d=r===s.value,h=y.useRef(d);return y.useEffect(()=>{const m=requestAnimationFrame(()=>h.current=!1);return()=>cancelAnimationFrame(m)},[]),g.jsx(pf,{present:i||d,children:({present:m})=>g.jsx(ot.div,{"data-state":d?"active":"inactive","data-orientation":s.orientation,role:"tabpanel","aria-labelledby":u,hidden:!m,id:f,tabIndex:0,...a,ref:t,style:{...e.style,animationDuration:h.current?"0s":void 0},children:m&&o})})});AM.displayName=NM;function TM(e,t){return`${e}-trigger-${t}`}function _M(e,t){return`${e}-content-${t}`}var XJ=PM,ZJ=EM,JJ=OM,eee=AM;function tee({className:e,orientation:t="horizontal",...n}){return g.jsx(XJ,{"data-slot":"tabs","data-orientation":t,orientation:t,className:Qe("group/tabs flex gap-2 data-[orientation=horizontal]:flex-col",e),...n})}const nee=Kw("rounded-lg p-[3px] group-data-[orientation=horizontal]/tabs:h-9 data-[variant=line]:rounded-none group/tabs-list text-muted-foreground inline-flex w-fit items-center justify-center group-data-[orientation=vertical]/tabs:h-fit group-data-[orientation=vertical]/tabs:flex-col",{variants:{variant:{default:"bg-muted",line:"gap-1 bg-transparent"}},defaultVariants:{variant:"default"}});function ree({className:e,variant:t="default",...n}){return g.jsx(ZJ,{"data-slot":"tabs-list","data-variant":t,className:Qe(nee({variant:t}),e),...n})}function mO({className:e,...t}){return g.jsx(JJ,{"data-slot":"tabs-trigger",className:Qe("focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring text-foreground/60 hover:text-foreground dark:text-muted-foreground dark:hover:text-foreground relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap transition-all group-data-[orientation=vertical]/tabs:w-full group-data-[orientation=vertical]/tabs:justify-start focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 group-data-[variant=default]/tabs-list:data-[state=active]:shadow-sm group-data-[variant=line]/tabs-list:data-[state=active]:shadow-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4","group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-[state=active]:bg-transparent dark:group-data-[variant=line]/tabs-list:data-[state=active]:border-transparent dark:group-data-[variant=line]/tabs-list:data-[state=active]:bg-transparent","data-[state=active]:bg-background dark:data-[state=active]:text-foreground dark:data-[state=active]:border-input dark:data-[state=active]:bg-input/30 data-[state=active]:text-foreground","after:bg-foreground after:absolute after:opacity-0 after:transition-opacity group-data-[orientation=horizontal]/tabs:after:inset-x-0 group-data-[orientation=horizontal]/tabs:after:bottom-[-5px] group-data-[orientation=horizontal]/tabs:after:h-0.5 group-data-[orientation=vertical]/tabs:after:inset-y-0 group-data-[orientation=vertical]/tabs:after:-right-1 group-data-[orientation=vertical]/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-[state=active]:after:opacity-100",e),...t})}function gO({className:e,...t}){return g.jsx(eee,{"data-slot":"tabs-content",className:Qe("flex-1 outline-none",e),...t})}function IM(e){const t=new Date(e),n=t.getFullYear(),r=t.getMonth()+1,i=t.getDate(),o=String(t.getHours()).padStart(2,"0"),a=String(t.getMinutes()).padStart(2,"0"),s=String(t.getSeconds()).padStart(2,"0");return`${n}/${r}/${i} ${o}:${a}:${s}`}function iee(e){var r;const t=e.match(/<command-name>([^<]+)<\/command-name>/),n=e.match(/<command-args>([^<]*)<\/command-args>/);return t?{isCommand:!0,commandName:t[1].trim(),commandArgs:((r=n==null?void 0:n[1])==null?void 0:r.trim())||"",originalText:e}:{isCommand:!1,originalText:e}}function oee({commandName:e,commandArgs:t}){return g.jsxs("div",{className:"inline-flex items-center gap-1.5 font-mono text-sm text-stone-300",children:[g.jsx("span",{className:"text-stone-400",children:"$"}),g.jsx("span",{className:"text-white font-medium",children:e}),t&&g.jsx("span",{className:"text-stone-400",children:t})]})}function aee({interaction:e}){const{t}=Ke("sessions"),[n,r]=y.useState(!1),i=IM(e.timestamp);return g.jsxs("div",{className:"space-y-3",children:[g.jsx("div",{className:"flex justify-center",children:g.jsxs("button",{type:"button",onClick:()=>r(!n),className:"text-xs text-amber-700 dark:text-amber-400 bg-amber-100 dark:bg-amber-950/40 border border-amber-300 dark:border-amber-800 px-3 py-1.5 rounded-full flex items-center gap-2 hover:bg-amber-200 dark:hover:bg-amber-900/50 transition-colors cursor-pointer",children:[g.jsx(lR,{className:"w-3 h-3"}),g.jsx("span",{className:"font-medium",children:t("interaction.contextCompacted")}),g.jsx("span",{className:"text-amber-600 dark:text-amber-500",children:"·"}),g.jsx("span",{className:"text-amber-600 dark:text-amber-500",children:i}),g.jsx("span",{className:"ml-1",children:n?"▲":"▼"})]})}),n&&g.jsxs("div",{className:"mx-4 bg-amber-50 dark:bg-amber-950/20 border border-amber-200 dark:border-amber-800 rounded-xl p-4",children:[g.jsx("div",{className:"text-xs text-amber-700 dark:text-amber-400 font-medium mb-2",children:t("interaction.summaryFromPreviousContext")}),g.jsx("div",{className:"text-xs max-h-96 overflow-y-auto",children:g.jsx(Hh,{content:e.user,className:"text-amber-800 dark:text-amber-200 prose-headings:text-amber-800 dark:prose-headings:text-amber-200 prose-strong:text-amber-800 dark:prose-strong:text-amber-200 prose-code:text-amber-800 dark:prose-code:text-amber-200"})})]})]})}function see({interaction:e}){var v,w;const{t}=Ke("sessions"),[n,r]=y.useState(!1),[i,o]=y.useState(!1),[a,s]=y.useState(!1),u=IM(e.timestamp),f=e.thinking&&e.thinking.trim()!=="",d=e.toolDetails&&e.toolDetails.length>0,h=!!e.agentId,m=iee(e.user);return g.jsxs("div",{className:"space-y-3",children:[g.jsxs("div",{className:"flex justify-center items-center gap-2",children:[g.jsx("span",{className:"text-xs text-stone-500 dark:text-stone-400 bg-stone-100 dark:bg-stone-800 px-2 py-0.5 rounded-full",children:u}),h&&g.jsxs("span",{className:"text-xs text-cyan-700 dark:text-cyan-400 bg-cyan-100 dark:bg-cyan-950/40 border border-cyan-300 dark:border-cyan-800 px-2 py-0.5 rounded-full flex items-center gap-1",children:[g.jsx(gV,{className:"w-3 h-3"}),g.jsx("span",{className:"font-medium",children:e.agentType||"Agent"})]})]}),g.jsxs("div",{className:"flex flex-col items-end",children:[g.jsx("span",{className:"text-xs text-stone-500 dark:text-stone-400 mb-1 mr-1",children:t("interaction.user")}),m.isCommand?g.jsx("div",{className:"max-w-[85%] bg-stone-800/80 backdrop-blur rounded-lg px-3 py-1.5 shadow-sm border border-stone-700/50",children:g.jsx(oee,{commandName:m.commandName||"",commandArgs:m.commandArgs||""})}):g.jsx("div",{className:"max-w-[85%] bg-[#39414B] text-white rounded-2xl rounded-br-sm px-4 py-2 shadow-sm",children:g.jsx(Hh,{content:e.user,variant:"dark",className:"text-sm text-white prose-headings:text-white prose-strong:text-white"})})]}),e.hasPlanMode&&g.jsx("div",{className:"flex justify-center",children:g.jsxs("div",{className:"text-xs text-violet-700 dark:text-violet-400 bg-violet-100 dark:bg-violet-950/40 border border-violet-300 dark:border-violet-800 px-3 py-1.5 rounded-full flex items-center gap-2",children:[g.jsx($V,{className:"w-3 h-3"}),g.jsx("span",{className:"font-medium",children:t("interaction.planMode")}),e.planTools&&e.planTools.length>0&&g.jsxs(g.Fragment,{children:[g.jsx("span",{className:"text-violet-500",children:"·"}),g.jsxs("span",{className:"text-violet-600 dark:text-violet-500",children:[e.planTools.slice(0,3).map(b=>`${b.name}×${b.count}`).join(", "),e.planTools.length>3&&"..."]})]})]})}),!e.hasPlanMode&&e.toolsUsed&&e.toolsUsed.length>0&&g.jsx("div",{className:"flex justify-center",children:g.jsxs("div",{className:"text-xs text-stone-500 dark:text-stone-400 bg-stone-100 dark:bg-stone-800 px-2 py-0.5 rounded-full flex items-center gap-1",children:[g.jsx(HV,{className:"w-3 h-3"}),g.jsx("span",{children:e.toolsUsed.slice(0,4).join(", ")}),e.toolsUsed.length>4&&g.jsxs("span",{children:["+",e.toolsUsed.length-4]})]})}),e.assistant&&g.jsxs("div",{className:"flex flex-col items-start",children:[g.jsx("span",{className:"text-xs text-stone-500 dark:text-stone-400 mb-1 ml-1",children:t("interaction.assistant")}),g.jsxs("div",{className:"max-w-[85%] bg-[#F5F5F0] dark:bg-stone-800 text-stone-800 dark:text-stone-100 rounded-2xl rounded-bl-sm px-4 py-2 shadow-sm border border-stone-200 dark:border-stone-700",children:[g.jsx(Hh,{content:e.assistant.length>500&&!n?`${e.assistant.substring(0,500)}...`:e.assistant,className:"text-sm"}),e.assistant.length>500&&!n&&g.jsx("button",{type:"button",onClick:()=>r(!0),className:"text-xs text-[#C15F3C] hover:underline mt-2",children:t("interaction.showMore")})]})]}),f&&g.jsx("div",{className:"flex justify-start",children:g.jsxs("div",{className:"max-w-[85%]",children:[g.jsxs("button",{type:"button",onClick:()=>o(!i),className:"text-xs text-muted-foreground hover:text-foreground cursor-pointer flex items-center gap-1 mb-1",children:[g.jsx(yV,{className:"w-3 h-3 text-amber-500"}),t(i?"interaction.hideThinking":"interaction.showThinking")]}),i&&g.jsx("div",{className:"bg-amber-50 dark:bg-amber-950/30 border border-amber-200 dark:border-amber-800 rounded-xl px-4 py-2",children:g.jsx(Hh,{content:e.thinking||"",className:"text-xs text-amber-800 dark:text-amber-200 prose-headings:text-amber-800 dark:prose-headings:text-amber-200 prose-code:text-amber-700 dark:prose-code:text-amber-300"})})]})}),d&&g.jsx("div",{className:"flex justify-start",children:g.jsxs("div",{className:"max-w-[85%]",children:[g.jsxs("button",{type:"button",onClick:()=>s(!a),className:"text-xs text-muted-foreground hover:text-foreground cursor-pointer flex items-center gap-1 mb-1",children:[g.jsx(lR,{className:"w-3 h-3 text-blue-500"}),t(a?"interaction.hideToolDetails":"interaction.showToolDetails"),g.jsxs("span",{className:"text-stone-400",children:["(",(v=e.toolDetails)==null?void 0:v.length,")"]})]}),a&&g.jsx("div",{className:"bg-blue-50 dark:bg-blue-950/30 border border-blue-200 dark:border-blue-800 rounded-xl px-3 py-2",children:g.jsx("div",{className:"space-y-1 font-mono text-xs",children:(w=e.toolDetails)==null?void 0:w.map((b,S)=>g.jsxs("div",{className:"flex items-start gap-2 text-blue-800 dark:text-blue-200",children:[g.jsx("span",{className:"text-blue-600 dark:text-blue-400 font-semibold shrink-0",children:b.name}),g.jsx("span",{className:"text-blue-700 dark:text-blue-300 break-all",children:typeof b.detail=="string"?b.detail.length>80?`${b.detail.substring(0,80)}...`:b.detail:b.detail?JSON.stringify(b.detail):""})]},`${b.name}-${S}`))})})]})})]})}function lee({session:e}){var h,m;const{t}=Ke("sessions"),{t:n}=Ke("common"),[r,i]=y.useState(!1),o=new Set,a=e.files||[];for(const v of a){const w=typeof v=="string"?v:v.path;w&&o.add(w)}const s=(h=e.context)==null?void 0:h.projectDir,u=(m=e.context)==null?void 0:m.branch,f=`/mneme:resume ${e.id}`,d=()=>{navigator.clipboard.writeText(f),i(!0),setTimeout(()=>i(!1),2e3)};return!s&&!u&&o.size===0?null:g.jsxs(nt,{children:[g.jsx(tr,{children:g.jsxs(nr,{className:"text-lg flex items-center gap-2",children:[g.jsxs("svg",{className:"h-5 w-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:[g.jsx("title",{children:"Context"}),g.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})]}),t("contextRestoration.title")]})}),g.jsxs(rt,{className:"space-y-4",children:[g.jsxs("div",{children:[g.jsx("div",{className:"text-sm font-medium text-muted-foreground mb-2",children:t("contextRestoration.quickResume")}),g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx("code",{className:"flex-1 bg-muted p-2 rounded text-sm font-mono overflow-x-auto",children:f}),g.jsx(Dr,{variant:"outline",size:"sm",onClick:d,children:n(r?"copied":"copy")})]}),g.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:t("contextRestoration.quickResumeDescription")})]}),o.size>0&&g.jsxs("div",{children:[g.jsx("div",{className:"text-sm font-medium text-muted-foreground mb-2",children:t("contextRestoration.modifiedFiles",{count:o.size})}),g.jsx("div",{className:"max-h-48 overflow-y-auto",children:g.jsx("div",{className:"flex flex-wrap gap-1",children:Array.from(o).sort().map(v=>g.jsx(tt,{variant:"secondary",className:"text-xs font-mono",children:v.split("/").pop()},v))})}),g.jsxs("details",{className:"mt-2",children:[g.jsx("summary",{className:"text-xs text-muted-foreground cursor-pointer",children:t("contextRestoration.showFullPaths")}),g.jsx("div",{className:"mt-2 space-y-1",children:Array.from(o).sort().map(v=>g.jsx("div",{className:"text-xs font-mono text-muted-foreground truncate",children:v},v))})]})]})]})]})}function uee(){var D,U,L;const{t:e,i18n:t}=Ke("sessions"),{t:n}=Ke("common"),{id:r}=d6(),i=ym(),o=JK(),[a,s]=y.useState(null),[u,f]=y.useState([]),[d,h]=y.useState([]),[m,v]=y.useState(!0),[w,b]=y.useState(null),[S,k]=y.useState(!1),[C,j]=y.useState(!1),O=y.useCallback(async()=>{if(r)try{const[q,W]=await Promise.all([sW(r),E2()]);s(q),f(W.tags||[]);try{const H=await dW(r);h(H?H.interactions:[])}catch{h([])}b(null)}catch{b("Failed to load session")}finally{v(!1)}},[r]);y.useEffect(()=>{O()},[O]);const A=q=>{const W=u.find(H=>H.id===q);return(W==null?void 0:W.color)||"#6B7280"},N=async()=>{if(!(!r||!S)){j(!0);try{await lW(r),o(r),i("/")}catch(q){b(q instanceof Error?q.message:"Failed to delete session"),j(!1),k(!1)}}};if(m)return g.jsx("div",{className:"text-center py-12",children:n("loading")});if(w||!a)return g.jsxs("div",{className:"text-center py-12",children:[g.jsx("p",{className:"text-destructive",children:w||e("errors:sessionNotFound")}),g.jsx(Mi,{to:"/",className:"text-primary underline mt-4 block",children:e("errors:backToSessions")})]});const I=new Date(a.createdAt).toLocaleString(t.language==="ja"?"ja-JP":"en-US"),T=((D=a.context.user)==null?void 0:D.name)||((U=a.user)==null?void 0:U.name)||n("unknown"),$=d.length;return g.jsx("div",{className:"h-[calc(100%+32px)] flex flex-col overflow-hidden -my-4 -mx-6 px-6 py-4",children:g.jsxs("div",{className:"flex gap-6 flex-1 min-h-0",children:[g.jsxs("div",{className:"w-[30%] min-w-[300px] overflow-y-auto space-y-4",children:[g.jsxs(nt,{children:[g.jsx(tr,{className:"pb-3",children:g.jsx(nr,{className:"text-lg",children:a.title||e("untitled")})}),g.jsxs(rt,{className:"space-y-3 text-sm",children:[g.jsxs("div",{className:"space-y-1.5",children:[g.jsxs("div",{className:"flex justify-between",children:[g.jsx("span",{className:"text-muted-foreground",children:n("user")}),g.jsx("span",{children:T})]}),g.jsxs("div",{className:"flex justify-between",children:[g.jsx("span",{className:"text-muted-foreground",children:n("date")}),g.jsx("span",{children:I})]}),g.jsxs("div",{className:"flex justify-between",children:[g.jsx("span",{className:"text-muted-foreground",children:n("branch")}),g.jsx("span",{className:"font-mono text-xs",children:a.context.branch||n("na")})]}),a.context.repository&&g.jsxs("div",{className:"flex justify-between",children:[g.jsx("span",{className:"text-muted-foreground",children:n("repository")}),g.jsx("span",{className:"font-mono text-xs",children:a.context.repository})]}),a.sessionType&&g.jsxs("div",{className:"flex justify-between items-center",children:[g.jsx("span",{className:"text-muted-foreground",children:n("type")}),g.jsx(tt,{variant:"outline",className:"text-xs",children:e(`types.${a.sessionType}`)})]}),a.status&&g.jsxs("div",{className:"flex justify-between items-center",children:[g.jsx("span",{className:"text-muted-foreground",children:n("status")}),g.jsx(tt,{variant:a.status==="complete"?"default":"secondary",className:"text-xs",children:a.status})]})]}),a.relatedSessions&&a.relatedSessions.length>0&&g.jsxs("div",{className:"pt-2 border-t",children:[g.jsx("span",{className:"text-muted-foreground text-xs",children:e("detail.relatedSessions")}),g.jsx("div",{className:"flex flex-wrap gap-1 mt-1",children:a.relatedSessions.map(q=>g.jsxs(Mi,{to:`/sessions/${q}`,className:"inline-flex items-center gap-1 px-1.5 py-0.5 bg-muted hover:bg-muted/80 rounded text-xs font-mono transition-colors",children:[g.jsx(_V,{className:"h-3 w-3"}),q]},q))})]}),g.jsxs("div",{className:"pt-2 border-t",children:[g.jsx("span",{className:"text-muted-foreground text-xs",children:n("tags")}),g.jsx("div",{className:"flex flex-wrap gap-1 mt-1",children:(((L=a.tags)==null?void 0:L.length)??0)>0?a.tags.map(q=>g.jsx(tt,{variant:"secondary",className:"text-xs",style:{backgroundColor:`${A(q)}20`,color:A(q),borderColor:A(q)},children:q},q)):g.jsx("span",{className:"text-muted-foreground text-xs",children:n("noTags")})})]}),g.jsx("div",{className:"pt-2 border-t",children:S?g.jsxs("div",{className:"space-y-2",children:[g.jsx("p",{className:"text-xs text-destructive",children:e("detail.deleteConfirmMessage")}),g.jsxs("div",{className:"flex gap-2",children:[g.jsx(Dr,{variant:"destructive",size:"sm",className:"flex-1",onClick:N,disabled:C,children:n(C?"deleting":"delete")}),g.jsx(Dr,{variant:"outline",size:"sm",className:"flex-1",onClick:()=>k(!1),disabled:C,children:n("cancel")})]})]}):g.jsxs(Dr,{variant:"outline",size:"sm",className:"w-full text-destructive hover:text-destructive hover:bg-destructive/10",onClick:()=>k(!0),children:[g.jsx(zV,{className:"h-4 w-4 mr-2"}),e("detail.deleteSession")]})})]})]}),g.jsx(lee,{session:a})]}),g.jsx("div",{className:"flex-1 min-w-0 flex flex-col min-h-0",children:g.jsxs(tee,{defaultValue:"context",className:"flex flex-col flex-1 min-h-0",children:[g.jsxs("div",{className:"flex items-center justify-between flex-shrink-0 mb-2",children:[g.jsxs(ree,{children:[g.jsx(mO,{value:"context",children:e("detail.sessionContext")}),g.jsxs(mO,{value:"interactions",children:[e("detail.interactions")," (",$,")"]})]}),g.jsxs(Mi,{to:"/",className:"text-sm text-muted-foreground hover:text-foreground",children:["← ",n("back")]})]}),g.jsx(gO,{value:"context",className:"flex-1 min-h-0 data-[state=inactive]:hidden",children:g.jsx(nt,{className:"h-full flex flex-col py-0 gap-0",children:g.jsx(rt,{className:"py-4 flex-1 overflow-y-auto",children:g.jsx(MJ,{session:a,embedded:!0})})})}),g.jsx(gO,{value:"interactions",className:"flex-1 min-h-0 data-[state=inactive]:hidden",children:g.jsx(nt,{className:"h-full flex flex-col py-0 gap-0",children:g.jsx(rt,{className:"py-4 flex-1 overflow-y-auto",children:$>0?g.jsx("div",{className:"space-y-6",children:d.map(q=>q.isCompactSummary?g.jsx(aee,{interaction:q},q.id):g.jsx(see,{interaction:q},q.id))}):g.jsx("div",{className:"py-8 text-center text-muted-foreground",children:e("detail.noInteractions")})})})})]})})]})})}var cee=["dangerouslySetInnerHTML","onCopy","onCopyCapture","onCut","onCutCapture","onPaste","onPasteCapture","onCompositionEnd","onCompositionEndCapture","onCompositionStart","onCompositionStartCapture","onCompositionUpdate","onCompositionUpdateCapture","onFocus","onFocusCapture","onBlur","onBlurCapture","onChange","onChangeCapture","onBeforeInput","onBeforeInputCapture","onInput","onInputCapture","onReset","onResetCapture","onSubmit","onSubmitCapture","onInvalid","onInvalidCapture","onLoad","onLoadCapture","onError","onErrorCapture","onKeyDown","onKeyDownCapture","onKeyPress","onKeyPressCapture","onKeyUp","onKeyUpCapture","onAbort","onAbortCapture","onCanPlay","onCanPlayCapture","onCanPlayThrough","onCanPlayThroughCapture","onDurationChange","onDurationChangeCapture","onEmptied","onEmptiedCapture","onEncrypted","onEncryptedCapture","onEnded","onEndedCapture","onLoadedData","onLoadedDataCapture","onLoadedMetadata","onLoadedMetadataCapture","onLoadStart","onLoadStartCapture","onPause","onPauseCapture","onPlay","onPlayCapture","onPlaying","onPlayingCapture","onProgress","onProgressCapture","onRateChange","onRateChangeCapture","onSeeked","onSeekedCapture","onSeeking","onSeekingCapture","onStalled","onStalledCapture","onSuspend","onSuspendCapture","onTimeUpdate","onTimeUpdateCapture","onVolumeChange","onVolumeChangeCapture","onWaiting","onWaitingCapture","onAuxClick","onAuxClickCapture","onClick","onClickCapture","onContextMenu","onContextMenuCapture","onDoubleClick","onDoubleClickCapture","onDrag","onDragCapture","onDragEnd","onDragEndCapture","onDragEnter","onDragEnterCapture","onDragExit","onDragExitCapture","onDragLeave","onDragLeaveCapture","onDragOver","onDragOverCapture","onDragStart","onDragStartCapture","onDrop","onDropCapture","onMouseDown","onMouseDownCapture","onMouseEnter","onMouseLeave","onMouseMove","onMouseMoveCapture","onMouseOut","onMouseOutCapture","onMouseOver","onMouseOverCapture","onMouseUp","onMouseUpCapture","onSelect","onSelectCapture","onTouchCancel","onTouchCancelCapture","onTouchEnd","onTouchEndCapture","onTouchMove","onTouchMoveCapture","onTouchStart","onTouchStartCapture","onPointerDown","onPointerDownCapture","onPointerMove","onPointerMoveCapture","onPointerUp","onPointerUpCapture","onPointerCancel","onPointerCancelCapture","onPointerEnter","onPointerEnterCapture","onPointerLeave","onPointerLeaveCapture","onPointerOver","onPointerOverCapture","onPointerOut","onPointerOutCapture","onGotPointerCapture","onGotPointerCaptureCapture","onLostPointerCapture","onLostPointerCaptureCapture","onScroll","onScrollCapture","onWheel","onWheelCapture","onAnimationStart","onAnimationStartCapture","onAnimationEnd","onAnimationEndCapture","onAnimationIteration","onAnimationIterationCapture","onTransitionEnd","onTransitionEndCapture"];function D1(e){if(typeof e!="string")return!1;var t=cee;return t.includes(e)}var fee=["aria-activedescendant","aria-atomic","aria-autocomplete","aria-busy","aria-checked","aria-colcount","aria-colindex","aria-colspan","aria-controls","aria-current","aria-describedby","aria-details","aria-disabled","aria-errormessage","aria-expanded","aria-flowto","aria-haspopup","aria-hidden","aria-invalid","aria-keyshortcuts","aria-label","aria-labelledby","aria-level","aria-live","aria-modal","aria-multiline","aria-multiselectable","aria-orientation","aria-owns","aria-placeholder","aria-posinset","aria-pressed","aria-readonly","aria-relevant","aria-required","aria-roledescription","aria-rowcount","aria-rowindex","aria-rowspan","aria-selected","aria-setsize","aria-sort","aria-valuemax","aria-valuemin","aria-valuenow","aria-valuetext","className","color","height","id","lang","max","media","method","min","name","style","target","width","role","tabIndex","accentHeight","accumulate","additive","alignmentBaseline","allowReorder","alphabetic","amplitude","arabicForm","ascent","attributeName","attributeType","autoReverse","azimuth","baseFrequency","baselineShift","baseProfile","bbox","begin","bias","by","calcMode","capHeight","clip","clipPath","clipPathUnits","clipRule","colorInterpolation","colorInterpolationFilters","colorProfile","colorRendering","contentScriptType","contentStyleType","cursor","cx","cy","d","decelerate","descent","diffuseConstant","direction","display","divisor","dominantBaseline","dur","dx","dy","edgeMode","elevation","enableBackground","end","exponent","externalResourcesRequired","fill","fillOpacity","fillRule","filter","filterRes","filterUnits","floodColor","floodOpacity","focusable","fontFamily","fontSize","fontSizeAdjust","fontStretch","fontStyle","fontVariant","fontWeight","format","from","fx","fy","g1","g2","glyphName","glyphOrientationHorizontal","glyphOrientationVertical","glyphRef","gradientTransform","gradientUnits","hanging","horizAdvX","horizOriginX","href","ideographic","imageRendering","in2","in","intercept","k1","k2","k3","k4","k","kernelMatrix","kernelUnitLength","kerning","keyPoints","keySplines","keyTimes","lengthAdjust","letterSpacing","lightingColor","limitingConeAngle","local","markerEnd","markerHeight","markerMid","markerStart","markerUnits","markerWidth","mask","maskContentUnits","maskUnits","mathematical","mode","numOctaves","offset","opacity","operator","order","orient","orientation","origin","overflow","overlinePosition","overlineThickness","paintOrder","panose1","pathLength","patternContentUnits","patternTransform","patternUnits","pointerEvents","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","r","radius","refX","refY","renderingIntent","repeatCount","repeatDur","requiredExtensions","requiredFeatures","restart","result","rotate","rx","ry","seed","shapeRendering","slope","spacing","specularConstant","specularExponent","speed","spreadMethod","startOffset","stdDeviation","stemh","stemv","stitchTiles","stopColor","stopOpacity","strikethroughPosition","strikethroughThickness","string","stroke","strokeDasharray","strokeDashoffset","strokeLinecap","strokeLinejoin","strokeMiterlimit","strokeOpacity","strokeWidth","surfaceScale","systemLanguage","tableValues","targetX","targetY","textAnchor","textDecoration","textLength","textRendering","to","transform","u1","u2","underlinePosition","underlineThickness","unicode","unicodeBidi","unicodeRange","unitsPerEm","vAlphabetic","values","vectorEffect","version","vertAdvY","vertOriginX","vertOriginY","vHanging","vIdeographic","viewTarget","visibility","vMathematical","widths","wordSpacing","writingMode","x1","x2","x","xChannelSelector","xHeight","xlinkActuate","xlinkArcrole","xlinkHref","xlinkRole","xlinkShow","xlinkTitle","xlinkType","xmlBase","xmlLang","xmlns","xmlnsXlink","xmlSpace","y1","y2","y","yChannelSelector","z","zoomAndPan","ref","key","angle"],dee=new Set(fee);function RM(e){return typeof e!="string"?!1:dee.has(e)}function DM(e){return typeof e=="string"&&e.startsWith("data-")}function Mr(e){if(typeof e!="object"||e===null)return{};var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(RM(n)||DM(n))&&(t[n]=e[n]);return t}function Sf(e){if(e==null)return null;if(y.isValidElement(e)&&typeof e.props=="object"&&e.props!==null){var t=e.props;return Mr(t)}return typeof e=="object"&&!Array.isArray(e)?Mr(e):null}function Ln(e){var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(RM(n)||DM(n)||D1(n))&&(t[n]=e[n]);return t}function hee(e){return e==null?null:y.isValidElement(e)?Ln(e.props):typeof e=="object"&&!Array.isArray(e)?Ln(e):null}var pee=["children","width","height","viewBox","className","style","title","desc"];function _b(){return _b=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},_b.apply(null,arguments)}function mee(e,t){if(e==null)return{};var n,r,i=gee(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function gee(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var M1=y.forwardRef((e,t)=>{var{children:n,width:r,height:i,viewBox:o,className:a,style:s,title:u,desc:f}=e,d=mee(e,pee),h=o||{width:r,height:i,x:0,y:0},m=at("recharts-surface",a);return y.createElement("svg",_b({},Ln(d),{className:m,width:r,height:i,style:s,viewBox:"".concat(h.x," ").concat(h.y," ").concat(h.width," ").concat(h.height),ref:t}),y.createElement("title",null,u),y.createElement("desc",null,f),n)}),vee=["children","className"];function Ib(){return Ib=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ib.apply(null,arguments)}function yee(e,t){if(e==null)return{};var n,r,i=xee(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function xee(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var $n=y.forwardRef((e,t)=>{var{children:n,className:r}=e,i=yee(e,vee),o=at("recharts-layer",r);return y.createElement("g",Ib({className:o},Ln(i),{ref:t}),n)}),MM=y.createContext(null),bee=()=>y.useContext(MM);function gt(e){return function(){return e}}const LM=Math.cos,xp=Math.sin,di=Math.sqrt,bp=Math.PI,Fm=2*bp,Rb=Math.PI,Db=2*Rb,es=1e-6,wee=Db-es;function $M(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function See(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return $M;const n=10**t;return function(r){this._+=r[0];for(let i=1,o=r.length;i<o;++i)this._+=Math.round(arguments[i]*n)/n+r[i]}}class kee{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?$M:See(t)}moveTo(t,n){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(t,n){this._append`L${this._x1=+t},${this._y1=+n}`}quadraticCurveTo(t,n,r,i){this._append`Q${+t},${+n},${this._x1=+r},${this._y1=+i}`}bezierCurveTo(t,n,r,i,o,a){this._append`C${+t},${+n},${+r},${+i},${this._x1=+o},${this._y1=+a}`}arcTo(t,n,r,i,o){if(t=+t,n=+n,r=+r,i=+i,o=+o,o<0)throw new Error(`negative radius: ${o}`);let a=this._x1,s=this._y1,u=r-t,f=i-n,d=a-t,h=s-n,m=d*d+h*h;if(this._x1===null)this._append`M${this._x1=t},${this._y1=n}`;else if(m>es)if(!(Math.abs(h*u-f*d)>es)||!o)this._append`L${this._x1=t},${this._y1=n}`;else{let v=r-a,w=i-s,b=u*u+f*f,S=v*v+w*w,k=Math.sqrt(b),C=Math.sqrt(m),j=o*Math.tan((Rb-Math.acos((b+m-S)/(2*k*C)))/2),O=j/C,A=j/k;Math.abs(O-1)>es&&this._append`L${t+O*d},${n+O*h}`,this._append`A${o},${o},0,0,${+(h*v>d*w)},${this._x1=t+A*u},${this._y1=n+A*f}`}}arc(t,n,r,i,o,a){if(t=+t,n=+n,r=+r,a=!!a,r<0)throw new Error(`negative radius: ${r}`);let s=r*Math.cos(i),u=r*Math.sin(i),f=t+s,d=n+u,h=1^a,m=a?i-o:o-i;this._x1===null?this._append`M${f},${d}`:(Math.abs(this._x1-f)>es||Math.abs(this._y1-d)>es)&&this._append`L${f},${d}`,r&&(m<0&&(m=m%Db+Db),m>wee?this._append`A${r},${r},0,1,${h},${t-s},${n-u}A${r},${r},0,1,${h},${this._x1=f},${this._y1=d}`:m>es&&this._append`A${r},${r},0,${+(m>=Rb)},${h},${this._x1=t+r*Math.cos(o)},${this._y1=n+r*Math.sin(o)}`)}rect(t,n,r,i){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}h${r=+r}v${+i}h${-r}Z`}toString(){return this._}}function L1(e){let t=3;return e.digits=function(n){if(!arguments.length)return t;if(n==null)t=null;else{const r=Math.floor(n);if(!(r>=0))throw new RangeError(`invalid digits: ${n}`);t=r}return e},()=>new kee(t)}function $1(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function FM(e){this._context=e}FM.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}};function zm(e){return new FM(e)}function zM(e){return e[0]}function BM(e){return e[1]}function UM(e,t){var n=gt(!0),r=null,i=zm,o=null,a=L1(s);e=typeof e=="function"?e:e===void 0?zM:gt(e),t=typeof t=="function"?t:t===void 0?BM:gt(t);function s(u){var f,d=(u=$1(u)).length,h,m=!1,v;for(r==null&&(o=i(v=a())),f=0;f<=d;++f)!(f<d&&n(h=u[f],f,u))===m&&((m=!m)?o.lineStart():o.lineEnd()),m&&o.point(+e(h,f,u),+t(h,f,u));if(v)return o=null,v+""||null}return s.x=function(u){return arguments.length?(e=typeof u=="function"?u:gt(+u),s):e},s.y=function(u){return arguments.length?(t=typeof u=="function"?u:gt(+u),s):t},s.defined=function(u){return arguments.length?(n=typeof u=="function"?u:gt(!!u),s):n},s.curve=function(u){return arguments.length?(i=u,r!=null&&(o=i(r)),s):i},s.context=function(u){return arguments.length?(u==null?r=o=null:o=i(r=u),s):r},s}function mh(e,t,n){var r=null,i=gt(!0),o=null,a=zm,s=null,u=L1(f);e=typeof e=="function"?e:e===void 0?zM:gt(+e),t=typeof t=="function"?t:gt(t===void 0?0:+t),n=typeof n=="function"?n:n===void 0?BM:gt(+n);function f(h){var m,v,w,b=(h=$1(h)).length,S,k=!1,C,j=new Array(b),O=new Array(b);for(o==null&&(s=a(C=u())),m=0;m<=b;++m){if(!(m<b&&i(S=h[m],m,h))===k)if(k=!k)v=m,s.areaStart(),s.lineStart();else{for(s.lineEnd(),s.lineStart(),w=m-1;w>=v;--w)s.point(j[w],O[w]);s.lineEnd(),s.areaEnd()}k&&(j[m]=+e(S,m,h),O[m]=+t(S,m,h),s.point(r?+r(S,m,h):j[m],n?+n(S,m,h):O[m]))}if(C)return s=null,C+""||null}function d(){return UM().defined(i).curve(a).context(o)}return f.x=function(h){return arguments.length?(e=typeof h=="function"?h:gt(+h),r=null,f):e},f.x0=function(h){return arguments.length?(e=typeof h=="function"?h:gt(+h),f):e},f.x1=function(h){return arguments.length?(r=h==null?null:typeof h=="function"?h:gt(+h),f):r},f.y=function(h){return arguments.length?(t=typeof h=="function"?h:gt(+h),n=null,f):t},f.y0=function(h){return arguments.length?(t=typeof h=="function"?h:gt(+h),f):t},f.y1=function(h){return arguments.length?(n=h==null?null:typeof h=="function"?h:gt(+h),f):n},f.lineX0=f.lineY0=function(){return d().x(e).y(t)},f.lineY1=function(){return d().x(e).y(n)},f.lineX1=function(){return d().x(r).y(t)},f.defined=function(h){return arguments.length?(i=typeof h=="function"?h:gt(!!h),f):i},f.curve=function(h){return arguments.length?(a=h,o!=null&&(s=a(o)),f):a},f.context=function(h){return arguments.length?(h==null?o=s=null:s=a(o=h),f):o},f}class WM{constructor(t,n){this._context=t,this._x=n}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(t,n){switch(t=+t,n=+n,this._point){case 0:{this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,n,t,n):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+n)/2,t,this._y0,t,n);break}}this._x0=t,this._y0=n}}function Pee(e){return new WM(e,!0)}function Cee(e){return new WM(e,!1)}const F1={draw(e,t){const n=di(t/bp);e.moveTo(n,0),e.arc(0,0,n,0,Fm)}},Eee={draw(e,t){const n=di(t/5)/2;e.moveTo(-3*n,-n),e.lineTo(-n,-n),e.lineTo(-n,-3*n),e.lineTo(n,-3*n),e.lineTo(n,-n),e.lineTo(3*n,-n),e.lineTo(3*n,n),e.lineTo(n,n),e.lineTo(n,3*n),e.lineTo(-n,3*n),e.lineTo(-n,n),e.lineTo(-3*n,n),e.closePath()}},HM=di(1/3),jee=HM*2,Oee={draw(e,t){const n=di(t/jee),r=n*HM;e.moveTo(0,-n),e.lineTo(r,0),e.lineTo(0,n),e.lineTo(-r,0),e.closePath()}},Nee={draw(e,t){const n=di(t),r=-n/2;e.rect(r,r,n,n)}},Aee=.8908130915292852,VM=xp(bp/10)/xp(7*bp/10),Tee=xp(Fm/10)*VM,_ee=-LM(Fm/10)*VM,Iee={draw(e,t){const n=di(t*Aee),r=Tee*n,i=_ee*n;e.moveTo(0,-n),e.lineTo(r,i);for(let o=1;o<5;++o){const a=Fm*o/5,s=LM(a),u=xp(a);e.lineTo(u*n,-s*n),e.lineTo(s*r-u*i,u*r+s*i)}e.closePath()}},lx=di(3),Ree={draw(e,t){const n=-di(t/(lx*3));e.moveTo(0,n*2),e.lineTo(-lx*n,-n),e.lineTo(lx*n,-n),e.closePath()}},jr=-.5,Or=di(3)/2,Mb=1/di(12),Dee=(Mb/2+1)*3,Mee={draw(e,t){const n=di(t/Dee),r=n/2,i=n*Mb,o=r,a=n*Mb+n,s=-o,u=a;e.moveTo(r,i),e.lineTo(o,a),e.lineTo(s,u),e.lineTo(jr*r-Or*i,Or*r+jr*i),e.lineTo(jr*o-Or*a,Or*o+jr*a),e.lineTo(jr*s-Or*u,Or*s+jr*u),e.lineTo(jr*r+Or*i,jr*i-Or*r),e.lineTo(jr*o+Or*a,jr*a-Or*o),e.lineTo(jr*s+Or*u,jr*u-Or*s),e.closePath()}};function Lee(e,t){let n=null,r=L1(i);e=typeof e=="function"?e:gt(e||F1),t=typeof t=="function"?t:gt(t===void 0?64:+t);function i(){let o;if(n||(n=o=r()),e.apply(this,arguments).draw(n,+t.apply(this,arguments)),o)return n=null,o+""||null}return i.type=function(o){return arguments.length?(e=typeof o=="function"?o:gt(o),i):e},i.size=function(o){return arguments.length?(t=typeof o=="function"?o:gt(+o),i):t},i.context=function(o){return arguments.length?(n=o??null,i):n},i}function wp(){}function Sp(e,t,n){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+n)/6)}function qM(e){this._context=e}qM.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:Sp(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:Sp(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function $ee(e){return new qM(e)}function KM(e){this._context=e}KM.prototype={areaStart:wp,areaEnd:wp,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:Sp(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Fee(e){return new KM(e)}function GM(e){this._context=e}GM.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+e)/6,r=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:Sp(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function zee(e){return new GM(e)}function YM(e){this._context=e}YM.prototype={areaStart:wp,areaEnd:wp,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function Bee(e){return new YM(e)}function vO(e){return e<0?-1:1}function yO(e,t,n){var r=e._x1-e._x0,i=t-e._x1,o=(e._y1-e._y0)/(r||i<0&&-0),a=(n-e._y1)/(i||r<0&&-0),s=(o*i+a*r)/(r+i);return(vO(o)+vO(a))*Math.min(Math.abs(o),Math.abs(a),.5*Math.abs(s))||0}function xO(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function ux(e,t,n){var r=e._x0,i=e._y0,o=e._x1,a=e._y1,s=(o-r)/3;e._context.bezierCurveTo(r+s,i+s*t,o-s,a-s*n,o,a)}function kp(e){this._context=e}kp.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:ux(this,this._t0,xO(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var n=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,ux(this,xO(this,n=yO(this,e,t)),n);break;default:ux(this,this._t0,n=yO(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function QM(e){this._context=new XM(e)}(QM.prototype=Object.create(kp.prototype)).point=function(e,t){kp.prototype.point.call(this,t,e)};function XM(e){this._context=e}XM.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,n,r,i,o){this._context.bezierCurveTo(t,e,r,n,o,i)}};function Uee(e){return new kp(e)}function Wee(e){return new QM(e)}function ZM(e){this._context=e}ZM.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,n=e.length;if(n)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),n===2)this._context.lineTo(e[1],t[1]);else for(var r=bO(e),i=bO(t),o=0,a=1;a<n;++o,++a)this._context.bezierCurveTo(r[0][o],i[0][o],r[1][o],i[1][o],e[a],t[a]);(this._line||this._line!==0&&n===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(e,t){this._x.push(+e),this._y.push(+t)}};function bO(e){var t,n=e.length-1,r,i=new Array(n),o=new Array(n),a=new Array(n);for(i[0]=0,o[0]=2,a[0]=e[0]+2*e[1],t=1;t<n-1;++t)i[t]=1,o[t]=4,a[t]=4*e[t]+2*e[t+1];for(i[n-1]=2,o[n-1]=7,a[n-1]=8*e[n-1]+e[n],t=1;t<n;++t)r=i[t]/o[t-1],o[t]-=r,a[t]-=r*a[t-1];for(i[n-1]=a[n-1]/o[n-1],t=n-2;t>=0;--t)i[t]=(a[t]-i[t+1])/o[t];for(o[n-1]=(e[n]+i[n-1])/2,t=0;t<n-1;++t)o[t]=2*e[t+1]-i[t+1];return[i,o]}function Hee(e){return new ZM(e)}function Bm(e,t){this._context=e,this._t=t}Bm.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&this._point===2&&this._context.lineTo(this._x,this._y),(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var n=this._x*(1-this._t)+e*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,t)}break}}this._x=e,this._y=t}};function Vee(e){return new Bm(e,.5)}function qee(e){return new Bm(e,0)}function Kee(e){return new Bm(e,1)}function Os(e,t){if((a=e.length)>1)for(var n=1,r,i,o=e[t[0]],a,s=o.length;n<a;++n)for(i=o,o=e[t[n]],r=0;r<s;++r)o[r][1]+=o[r][0]=isNaN(i[r][1])?i[r][0]:i[r][1]}function Lb(e){for(var t=e.length,n=new Array(t);--t>=0;)n[t]=t;return n}function Gee(e,t){return e[t]}function Yee(e){const t=[];return t.key=e,t}function Qee(){var e=gt([]),t=Lb,n=Os,r=Gee;function i(o){var a=Array.from(e.apply(this,arguments),Yee),s,u=a.length,f=-1,d;for(const h of o)for(s=0,++f;s<u;++s)(a[s][f]=[0,+r(h,a[s].key,f,o)]).data=h;for(s=0,d=$1(t(a));s<u;++s)a[d[s]].index=s;return n(a,d),a}return i.keys=function(o){return arguments.length?(e=typeof o=="function"?o:gt(Array.from(o)),i):e},i.value=function(o){return arguments.length?(r=typeof o=="function"?o:gt(+o),i):r},i.order=function(o){return arguments.length?(t=o==null?Lb:typeof o=="function"?o:gt(Array.from(o)),i):t},i.offset=function(o){return arguments.length?(n=o??Os,i):n},i}function Xee(e,t){if((r=e.length)>0){for(var n,r,i=0,o=e[0].length,a;i<o;++i){for(a=n=0;n<r;++n)a+=e[n][i][1]||0;if(a)for(n=0;n<r;++n)e[n][i][1]/=a}Os(e,t)}}function Zee(e,t){if((i=e.length)>0){for(var n=0,r=e[t[0]],i,o=r.length;n<o;++n){for(var a=0,s=0;a<i;++a)s+=e[a][n][1]||0;r[n][1]+=r[n][0]=-s/2}Os(e,t)}}function Jee(e,t){if(!(!((a=e.length)>0)||!((o=(i=e[t[0]]).length)>0))){for(var n=0,r=1,i,o,a;r<o;++r){for(var s=0,u=0,f=0;s<a;++s){for(var d=e[t[s]],h=d[r][1]||0,m=d[r-1][1]||0,v=(h-m)/2,w=0;w<s;++w){var b=e[t[w]],S=b[r][1]||0,k=b[r-1][1]||0;v+=S-k}u+=h,f+=v*h}i[r-1][1]+=i[r-1][0]=n,u&&(n-=f/u)}i[r-1][1]+=i[r-1][0]=n,Os(e,t)}}var cx={},fx={},wO;function ete(){return wO||(wO=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return n==="__proto__"}e.isUnsafeProperty=t})(fx)),fx}var dx={},SO;function JM(){return SO||(SO=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){switch(typeof n){case"number":case"symbol":return!1;case"string":return n.includes(".")||n.includes("[")||n.includes("]")}}e.isDeepKey=t})(dx)),dx}var hx={},kO;function z1(){return kO||(kO=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){var r;return typeof n=="string"||typeof n=="symbol"?n:Object.is((r=n==null?void 0:n.valueOf)==null?void 0:r.call(n),-0)?"-0":String(n)}e.toKey=t})(hx)),hx}var px={},mx={},PO;function tte(){return PO||(PO=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){if(n==null)return"";if(typeof n=="string")return n;if(Array.isArray(n))return n.map(t).join(",");const r=String(n);return r==="0"&&Object.is(Number(n),-0)?"-0":r}e.toString=t})(mx)),mx}var CO;function B1(){return CO||(CO=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=tte(),n=z1();function r(i){if(Array.isArray(i))return i.map(n.toKey);if(typeof i=="symbol")return[i];i=t.toString(i);const o=[],a=i.length;if(a===0)return o;let s=0,u="",f="",d=!1;for(i.charCodeAt(0)===46&&(o.push(""),s++);s<a;){const h=i[s];f?h==="\\"&&s+1<a?(s++,u+=i[s]):h===f?f="":u+=h:d?h==='"'||h==="'"?f=h:h==="]"?(d=!1,o.push(u),u=""):u+=h:h==="["?(d=!0,u&&(o.push(u),u="")):h==="."?u&&(o.push(u),u=""):u+=h,s++}return u&&o.push(u),o}e.toPath=r})(px)),px}var EO;function U1(){return EO||(EO=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=ete(),n=JM(),r=z1(),i=B1();function o(s,u,f){if(s==null)return f;switch(typeof u){case"string":{if(t.isUnsafeProperty(u))return f;const d=s[u];return d===void 0?n.isDeepKey(u)?o(s,i.toPath(u),f):f:d}case"number":case"symbol":{typeof u=="number"&&(u=r.toKey(u));const d=s[u];return d===void 0?f:d}default:{if(Array.isArray(u))return a(s,u,f);if(Object.is(u==null?void 0:u.valueOf(),-0)?u="-0":u=String(u),t.isUnsafeProperty(u))return f;const d=s[u];return d===void 0?f:d}}}function a(s,u,f){if(u.length===0)return f;let d=s;for(let h=0;h<u.length;h++){if(d==null||t.isUnsafeProperty(u[h]))return f;d=d[u[h]]}return d===void 0?f:d}e.get=o})(cx)),cx}var gx,jO;function nte(){return jO||(jO=1,gx=U1().get),gx}var rte=nte();const ql=yr(rte);var ite=4;function ba(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:ite,n=10**t,r=Math.round(e*n)/n;return Object.is(r,-0)?0:r}function Rt(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return e.reduce((i,o,a)=>{var s=n[a-1];return typeof s=="string"?i+s+o:s!==void 0?i+ba(s)+o:i+o},"")}var Xn=e=>e===0?0:e>0?1:-1,si=e=>typeof e=="number"&&e!=+e,Ns=e=>typeof e=="string"&&e.indexOf("%")===e.length-1,ye=e=>(typeof e=="number"||e instanceof Number)&&!si(e),zi=e=>ye(e)||typeof e=="string",ote=0,Hc=e=>{var t=++ote;return"".concat(e||"").concat(t)},li=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!ye(t)&&typeof t!="string")return r;var o;if(Ns(t)){if(n==null)return r;var a=t.indexOf("%");o=n*parseFloat(t.slice(0,a))/100}else o=+t;return si(o)&&(o=r),i&&n!=null&&o>n&&(o=n),o},eL=e=>{if(!Array.isArray(e))return!1;for(var t=e.length,n={},r=0;r<t;r++)if(!n[String(e[r])])n[String(e[r])]=!0;else return!0;return!1};function Nt(e,t,n){return ye(e)&&ye(t)?ba(e+n*(t-e)):t}function tL(e,t,n){if(!(!e||!e.length))return e.find(r=>r&&(typeof t=="function"?t(r):ql(r,t))===n)}var Mt=e=>e===null||typeof e>"u",kf=e=>Mt(e)?e:"".concat(e.charAt(0).toUpperCase()).concat(e.slice(1));function Zn(e){return e!=null}function Ls(){}var ate=["type","size","sizeType"];function $b(){return $b=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},$b.apply(null,arguments)}function OO(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function NO(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?OO(Object(n),!0).forEach(function(r){ste(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):OO(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function ste(e,t,n){return(t=lte(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function lte(e){var t=ute(e,"string");return typeof t=="symbol"?t:t+""}function ute(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function cte(e,t){if(e==null)return{};var n,r,i=fte(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function fte(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var nL={symbolCircle:F1,symbolCross:Eee,symbolDiamond:Oee,symbolSquare:Nee,symbolStar:Iee,symbolTriangle:Ree,symbolWye:Mee},dte=Math.PI/180,hte=e=>{var t="symbol".concat(kf(e));return nL[t]||F1},pte=(e,t,n)=>{if(t==="area")return e;switch(n){case"cross":return 5*e*e/9;case"diamond":return .5*e*e/Math.sqrt(3);case"square":return e*e;case"star":{var r=18*dte;return 1.25*e*e*(Math.tan(r)-Math.tan(r*2)*Math.tan(r)**2)}case"triangle":return Math.sqrt(3)*e*e/4;case"wye":return(21-10*Math.sqrt(3))*e*e/8;default:return Math.PI*e*e/4}},mte=(e,t)=>{nL["symbol".concat(kf(e))]=t},W1=e=>{var{type:t="circle",size:n=64,sizeType:r="area"}=e,i=cte(e,ate),o=NO(NO({},i),{},{type:t,size:n,sizeType:r}),a="circle";typeof t=="string"&&(a=t);var s=()=>{var m=hte(a),v=Lee().type(m).size(pte(n,r,a)),w=v();if(w!==null)return w},{className:u,cx:f,cy:d}=o,h=Ln(o);return ye(f)&&ye(d)&&ye(n)?y.createElement("path",$b({},h,{className:at("recharts-symbols",u),transform:"translate(".concat(f,", ").concat(d,")"),d:s()})):null};W1.registerSymbol=mte;var rL=e=>"radius"in e&&"startAngle"in e&&"endAngle"in e,H1=(e,t)=>{if(!e||typeof e=="function"||typeof e=="boolean")return null;var n=e;if(y.isValidElement(e)&&(n=e.props),typeof n!="object"&&typeof n!="function")return null;var r={};return Object.keys(n).forEach(i=>{D1(i)&&(r[i]=(o=>n[i](n,o)))}),r},gte=(e,t,n)=>r=>(e(t,n,r),null),Um=(e,t,n)=>{if(e===null||typeof e!="object"&&typeof e!="function")return null;var r=null;return Object.keys(e).forEach(i=>{var o=e[i];D1(i)&&typeof o=="function"&&(r||(r={}),r[i]=gte(o,t,n))}),r};function AO(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function vte(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?AO(Object(n),!0).forEach(function(r){yte(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):AO(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function yte(e,t,n){return(t=xte(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function xte(e){var t=bte(e,"string");return typeof t=="symbol"?t:t+""}function bte(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function yn(e,t){var n=vte({},e),r=t,i=Object.keys(t),o=i.reduce((a,s)=>(a[s]===void 0&&r[s]!==void 0&&(a[s]=r[s]),a),n);return o}function Pp(){return Pp=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Pp.apply(null,arguments)}function TO(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function wte(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?TO(Object(n),!0).forEach(function(r){Ste(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):TO(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Ste(e,t,n){return(t=kte(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function kte(e){var t=Pte(e,"string");return typeof t=="symbol"?t:t+""}function Pte(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Ar=32,Cte={align:"center",iconSize:14,inactiveColor:"#ccc",layout:"horizontal",verticalAlign:"middle"};function Ete(e){var{data:t,iconType:n,inactiveColor:r}=e,i=Ar/2,o=Ar/6,a=Ar/3,s=t.inactive?r:t.color,u=n??t.type;if(u==="none")return null;if(u==="plainline"){var f;return y.createElement("line",{strokeWidth:4,fill:"none",stroke:s,strokeDasharray:(f=t.payload)===null||f===void 0?void 0:f.strokeDasharray,x1:0,y1:i,x2:Ar,y2:i,className:"recharts-legend-icon"})}if(u==="line")return y.createElement("path",{strokeWidth:4,fill:"none",stroke:s,d:"M0,".concat(i,"h").concat(a,`
|
|
272
272
|
A`).concat(o,",").concat(o,",0,1,1,").concat(2*a,",").concat(i,`
|
|
273
273
|
H`).concat(Ar,"M").concat(2*a,",").concat(i,`
|
|
274
274
|
A`).concat(o,",").concat(o,",0,1,1,").concat(a,",").concat(i),className:"recharts-legend-icon"});if(u==="rect")return y.createElement("path",{stroke:"none",fill:s,d:"M0,".concat(Ar/8,"h").concat(Ar,"v").concat(Ar*3/4,"h").concat(-Ar,"z"),className:"recharts-legend-icon"});if(y.isValidElement(t.legendIcon)){var d=wte({},t);return delete d.legendIcon,y.cloneElement(t.legendIcon,d)}return y.createElement(W1,{fill:s,cx:i,cy:i,size:Ar,sizeType:"diameter",type:u})}function jte(e){var{payload:t,iconSize:n,layout:r,formatter:i,inactiveColor:o,iconType:a}=e,s={x:0,y:0,width:Ar,height:Ar},u={display:r==="horizontal"?"inline-block":"block",marginRight:10},f={display:"inline-block",verticalAlign:"middle",marginRight:4};return t.map((d,h)=>{var m=d.formatter||i,v=at({"recharts-legend-item":!0,["legend-item-".concat(h)]:!0,inactive:d.inactive});if(d.type==="none")return null;var w=d.inactive?o:d.color,b=m?m(d.value,d,h):d.value;return y.createElement("li",Pp({className:v,style:u,key:"legend-item-".concat(h)},Um(e,d,h)),y.createElement(M1,{width:n,height:n,viewBox:s,style:f,"aria-label":"".concat(b," legend icon")},y.createElement(Ete,{data:d,iconType:a,inactiveColor:o})),y.createElement("span",{className:"recharts-legend-item-text",style:{color:w}},b))})}var Ote=e=>{var t=yn(e,Cte),{payload:n,layout:r,align:i}=t;if(!n||!n.length)return null;var o={padding:0,margin:0,textAlign:r==="horizontal"?i:"left"};return y.createElement("ul",{className:"recharts-default-legend",style:o},y.createElement(jte,Pp({},t,{payload:n})))},vx={},yx={},_O;function Nte(){return _O||(_O=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n,r){const i=new Map;for(let o=0;o<n.length;o++){const a=n[o],s=r(a,o,n);i.has(s)||i.set(s,a)}return Array.from(i.values())}e.uniqBy=t})(yx)),yx}var xx={},IO;function Ate(){return IO||(IO=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n,r){return function(...i){return n.apply(this,i.slice(0,r))}}e.ary=t})(xx)),xx}var bx={},RO;function iL(){return RO||(RO=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return n}e.identity=t})(bx)),bx}var wx={},Sx={},kx={},DO;function Tte(){return DO||(DO=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return Number.isSafeInteger(n)&&n>=0}e.isLength=t})(kx)),kx}var MO;function V1(){return MO||(MO=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Tte();function n(r){return r!=null&&typeof r!="function"&&t.isLength(r.length)}e.isArrayLike=n})(Sx)),Sx}var Px={},LO;function _te(){return LO||(LO=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return typeof n=="object"&&n!==null}e.isObjectLike=t})(Px)),Px}var $O;function Ite(){return $O||($O=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=V1(),n=_te();function r(i){return n.isObjectLike(i)&&t.isArrayLike(i)}e.isArrayLikeObject=r})(wx)),wx}var Cx={},Ex={},FO;function Rte(){return FO||(FO=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=U1();function n(r){return function(i){return t.get(i,r)}}e.property=n})(Ex)),Ex}var jx={},Ox={},Nx={},Ax={},zO;function oL(){return zO||(zO=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return n!==null&&(typeof n=="object"||typeof n=="function")}e.isObject=t})(Ax)),Ax}var Tx={},BO;function aL(){return BO||(BO=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return n==null||typeof n!="object"&&typeof n!="function"}e.isPrimitive=t})(Tx)),Tx}var _x={},UO;function sL(){return UO||(UO=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n,r){return n===r||Number.isNaN(n)&&Number.isNaN(r)}e.isEqualsSameValueZero=t})(_x)),_x}var WO;function Dte(){return WO||(WO=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=oL(),n=aL(),r=sL();function i(d,h,m){return typeof m!="function"?i(d,h,()=>{}):o(d,h,function v(w,b,S,k,C,j){const O=m(w,b,S,k,C,j);return O!==void 0?!!O:o(w,b,v,j)},new Map)}function o(d,h,m,v){if(h===d)return!0;switch(typeof h){case"object":return a(d,h,m,v);case"function":return Object.keys(h).length>0?o(d,{...h},m,v):r.isEqualsSameValueZero(d,h);default:return t.isObject(d)?typeof h=="string"?h==="":!0:r.isEqualsSameValueZero(d,h)}}function a(d,h,m,v){if(h==null)return!0;if(Array.isArray(h))return u(d,h,m,v);if(h instanceof Map)return s(d,h,m,v);if(h instanceof Set)return f(d,h,m,v);const w=Object.keys(h);if(d==null||n.isPrimitive(d))return w.length===0;if(w.length===0)return!0;if(v!=null&&v.has(h))return v.get(h)===d;v==null||v.set(h,d);try{for(let b=0;b<w.length;b++){const S=w[b];if(!n.isPrimitive(d)&&!(S in d)||h[S]===void 0&&d[S]!==void 0||h[S]===null&&d[S]!==null||!m(d[S],h[S],S,d,h,v))return!1}return!0}finally{v==null||v.delete(h)}}function s(d,h,m,v){if(h.size===0)return!0;if(!(d instanceof Map))return!1;for(const[w,b]of h.entries()){const S=d.get(w);if(m(S,b,w,d,h,v)===!1)return!1}return!0}function u(d,h,m,v){if(h.length===0)return!0;if(!Array.isArray(d))return!1;const w=new Set;for(let b=0;b<h.length;b++){const S=h[b];let k=!1;for(let C=0;C<d.length;C++){if(w.has(C))continue;const j=d[C];let O=!1;if(m(j,S,b,d,h,v)&&(O=!0),O){w.add(C),k=!0;break}}if(!k)return!1}return!0}function f(d,h,m,v){return h.size===0?!0:d instanceof Set?u([...d],[...h],m,v):!1}e.isMatchWith=i,e.isSetMatch=f})(Nx)),Nx}var HO;function lL(){return HO||(HO=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Dte();function n(r,i){return t.isMatchWith(r,i,()=>{})}e.isMatch=n})(Ox)),Ox}var Ix={},Rx={},Dx={},VO;function Mte(){return VO||(VO=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return Object.getOwnPropertySymbols(n).filter(r=>Object.prototype.propertyIsEnumerable.call(n,r))}e.getSymbols=t})(Dx)),Dx}var Mx={},qO;function q1(){return qO||(qO=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return n==null?n===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(n)}e.getTag=t})(Mx)),Mx}var Lx={},KO;function uL(){return KO||(KO=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t="[object RegExp]",n="[object String]",r="[object Number]",i="[object Boolean]",o="[object Arguments]",a="[object Symbol]",s="[object Date]",u="[object Map]",f="[object Set]",d="[object Array]",h="[object Function]",m="[object ArrayBuffer]",v="[object Object]",w="[object Error]",b="[object DataView]",S="[object Uint8Array]",k="[object Uint8ClampedArray]",C="[object Uint16Array]",j="[object Uint32Array]",O="[object BigUint64Array]",A="[object Int8Array]",N="[object Int16Array]",I="[object Int32Array]",T="[object BigInt64Array]",$="[object Float32Array]",D="[object Float64Array]";e.argumentsTag=o,e.arrayBufferTag=m,e.arrayTag=d,e.bigInt64ArrayTag=T,e.bigUint64ArrayTag=O,e.booleanTag=i,e.dataViewTag=b,e.dateTag=s,e.errorTag=w,e.float32ArrayTag=$,e.float64ArrayTag=D,e.functionTag=h,e.int16ArrayTag=N,e.int32ArrayTag=I,e.int8ArrayTag=A,e.mapTag=u,e.numberTag=r,e.objectTag=v,e.regexpTag=t,e.setTag=f,e.stringTag=n,e.symbolTag=a,e.uint16ArrayTag=C,e.uint32ArrayTag=j,e.uint8ArrayTag=S,e.uint8ClampedArrayTag=k})(Lx)),Lx}var $x={},GO;function Lte(){return GO||(GO=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return ArrayBuffer.isView(n)&&!(n instanceof DataView)}e.isTypedArray=t})($x)),$x}var YO;function cL(){return YO||(YO=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Mte(),n=q1(),r=uL(),i=aL(),o=Lte();function a(d,h){return s(d,void 0,d,new Map,h)}function s(d,h,m,v=new Map,w=void 0){const b=w==null?void 0:w(d,h,m,v);if(b!==void 0)return b;if(i.isPrimitive(d))return d;if(v.has(d))return v.get(d);if(Array.isArray(d)){const S=new Array(d.length);v.set(d,S);for(let k=0;k<d.length;k++)S[k]=s(d[k],k,m,v,w);return Object.hasOwn(d,"index")&&(S.index=d.index),Object.hasOwn(d,"input")&&(S.input=d.input),S}if(d instanceof Date)return new Date(d.getTime());if(d instanceof RegExp){const S=new RegExp(d.source,d.flags);return S.lastIndex=d.lastIndex,S}if(d instanceof Map){const S=new Map;v.set(d,S);for(const[k,C]of d)S.set(k,s(C,k,m,v,w));return S}if(d instanceof Set){const S=new Set;v.set(d,S);for(const k of d)S.add(s(k,void 0,m,v,w));return S}if(typeof Buffer<"u"&&Buffer.isBuffer(d))return d.subarray();if(o.isTypedArray(d)){const S=new(Object.getPrototypeOf(d)).constructor(d.length);v.set(d,S);for(let k=0;k<d.length;k++)S[k]=s(d[k],k,m,v,w);return S}if(d instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&d instanceof SharedArrayBuffer)return d.slice(0);if(d instanceof DataView){const S=new DataView(d.buffer.slice(0),d.byteOffset,d.byteLength);return v.set(d,S),u(S,d,m,v,w),S}if(typeof File<"u"&&d instanceof File){const S=new File([d],d.name,{type:d.type});return v.set(d,S),u(S,d,m,v,w),S}if(typeof Blob<"u"&&d instanceof Blob){const S=new Blob([d],{type:d.type});return v.set(d,S),u(S,d,m,v,w),S}if(d instanceof Error){const S=new d.constructor;return v.set(d,S),S.message=d.message,S.name=d.name,S.stack=d.stack,S.cause=d.cause,u(S,d,m,v,w),S}if(d instanceof Boolean){const S=new Boolean(d.valueOf());return v.set(d,S),u(S,d,m,v,w),S}if(d instanceof Number){const S=new Number(d.valueOf());return v.set(d,S),u(S,d,m,v,w),S}if(d instanceof String){const S=new String(d.valueOf());return v.set(d,S),u(S,d,m,v,w),S}if(typeof d=="object"&&f(d)){const S=Object.create(Object.getPrototypeOf(d));return v.set(d,S),u(S,d,m,v,w),S}return d}function u(d,h,m=d,v,w){const b=[...Object.keys(h),...t.getSymbols(h)];for(let S=0;S<b.length;S++){const k=b[S],C=Object.getOwnPropertyDescriptor(d,k);(C==null||C.writable)&&(d[k]=s(h[k],k,m,v,w))}}function f(d){switch(n.getTag(d)){case r.argumentsTag:case r.arrayTag:case r.arrayBufferTag:case r.dataViewTag:case r.booleanTag:case r.dateTag:case r.float32ArrayTag:case r.float64ArrayTag:case r.int8ArrayTag:case r.int16ArrayTag:case r.int32ArrayTag:case r.mapTag:case r.numberTag:case r.objectTag:case r.regexpTag:case r.setTag:case r.stringTag:case r.symbolTag:case r.uint8ArrayTag:case r.uint8ClampedArrayTag:case r.uint16ArrayTag:case r.uint32ArrayTag:return!0;default:return!1}}e.cloneDeepWith=a,e.cloneDeepWithImpl=s,e.copyProperties=u})(Rx)),Rx}var QO;function $te(){return QO||(QO=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=cL();function n(r){return t.cloneDeepWithImpl(r,void 0,r,new Map,void 0)}e.cloneDeep=n})(Ix)),Ix}var XO;function Fte(){return XO||(XO=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=lL(),n=$te();function r(i){return i=n.cloneDeep(i),o=>t.isMatch(o,i)}e.matches=r})(jx)),jx}var Fx={},zx={},Bx={},ZO;function zte(){return ZO||(ZO=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=cL(),n=q1(),r=uL();function i(o,a){return t.cloneDeepWith(o,(s,u,f,d)=>{const h=a==null?void 0:a(s,u,f,d);if(h!==void 0)return h;if(typeof o=="object"){if(n.getTag(o)===r.objectTag&&typeof o.constructor!="function"){const m={};return d.set(o,m),t.copyProperties(m,o,f,d),m}switch(Object.prototype.toString.call(o)){case r.numberTag:case r.stringTag:case r.booleanTag:{const m=new o.constructor(o==null?void 0:o.valueOf());return t.copyProperties(m,o),m}case r.argumentsTag:{const m={};return t.copyProperties(m,o),m.length=o.length,m[Symbol.iterator]=o[Symbol.iterator],m}default:return}}})}e.cloneDeepWith=i})(Bx)),Bx}var JO;function Bte(){return JO||(JO=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=zte();function n(r){return t.cloneDeepWith(r)}e.cloneDeep=n})(zx)),zx}var Ux={},Wx={},eN;function fL(){return eN||(eN=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=/^(?:0|[1-9]\d*)$/;function n(r,i=Number.MAX_SAFE_INTEGER){switch(typeof r){case"number":return Number.isInteger(r)&&r>=0&&r<i;case"symbol":return!1;case"string":return t.test(r)}}e.isIndex=n})(Wx)),Wx}var Hx={},tN;function Ute(){return tN||(tN=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=q1();function n(r){return r!==null&&typeof r=="object"&&t.getTag(r)==="[object Arguments]"}e.isArguments=n})(Hx)),Hx}var nN;function Wte(){return nN||(nN=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=JM(),n=fL(),r=Ute(),i=B1();function o(a,s){let u;if(Array.isArray(s)?u=s:typeof s=="string"&&t.isDeepKey(s)&&(a==null?void 0:a[s])==null?u=i.toPath(s):u=[s],u.length===0)return!1;let f=a;for(let d=0;d<u.length;d++){const h=u[d];if((f==null||!Object.hasOwn(f,h))&&!((Array.isArray(f)||r.isArguments(f))&&n.isIndex(h)&&h<f.length))return!1;f=f[h]}return!0}e.has=o})(Ux)),Ux}var rN;function Hte(){return rN||(rN=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=lL(),n=z1(),r=Bte(),i=U1(),o=Wte();function a(s,u){switch(typeof s){case"object":{Object.is(s==null?void 0:s.valueOf(),-0)&&(s="-0");break}case"number":{s=n.toKey(s);break}}return u=r.cloneDeep(u),function(f){const d=i.get(f,s);return d===void 0?o.has(f,s):u===void 0?d===void 0:t.isMatch(d,u)}}e.matchesProperty=a})(Fx)),Fx}var iN;function Vte(){return iN||(iN=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=iL(),n=Rte(),r=Fte(),i=Hte();function o(a){if(a==null)return t.identity;switch(typeof a){case"function":return a;case"object":return Array.isArray(a)&&a.length===2?i.matchesProperty(a[0],a[1]):r.matches(a);case"string":case"symbol":case"number":return n.property(a)}}e.iteratee=o})(Cx)),Cx}var oN;function qte(){return oN||(oN=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Nte(),n=Ate(),r=iL(),i=Ite(),o=Vte();function a(s,u=r.identity){return i.isArrayLikeObject(s)?t.uniqBy(Array.from(s),n.ary(o.iteratee(u),1)):[]}e.uniqBy=a})(vx)),vx}var Vx,aN;function Kte(){return aN||(aN=1,Vx=qte().uniqBy),Vx}var Gte=Kte();const sN=yr(Gte);function dL(e,t,n){return t===!0?sN(e,n):typeof t=="function"?sN(e,t):e}var qx={exports:{}},Kx={};/**
|