@crouton-kit/crouter 0.3.68 → 0.3.70
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/builtin-pi-packages/pi-crtr-extensions/extensions/__tests__/provider-rotation.test.ts +31 -31
- package/dist/builtin-pi-packages/pi-crtr-extensions/extensions/provider-rotation.ts +28 -8
- package/dist/builtin-pi-packages/pi-crtr-extensions/lib/subscription-state.ts +11 -11
- package/dist/cli.d.ts +1 -1
- package/dist/cli.js +1 -0
- package/dist/clients/attach/__tests__/attach-chrome-remote.test.js +8 -4
- package/dist/clients/attach/attach-cmd.js +667 -667
- package/dist/clients/attach/auth-pickers.d.ts +12 -0
- package/dist/clients/attach/auth-pickers.js +11 -0
- package/dist/clients/attach/pickers.js +2 -0
- package/dist/clients/attach/slash-commands.js +1 -0
- package/dist/commands/node.js +3 -3
- package/dist/commands/profile/new.js +30 -5
- package/dist/commands/sys/setup-core.js +2 -0
- package/dist/commands/sys/setup.js +132 -16
- package/dist/core/__tests__/full/broker-pane-resolution.test.js +9 -6
- package/dist/core/__tests__/full/cascade-close.test.js +5 -2
- package/dist/core/__tests__/full/dead-pane-regression.test.js +6 -3
- package/dist/core/__tests__/full/detach-focus.test.js +10 -5
- package/dist/core/__tests__/full/human-new-window-regression.test.js +6 -3
- package/dist/core/__tests__/full/review-render-pane-regression.test.js +2 -2
- package/dist/core/__tests__/helpers/harness.d.ts +1 -0
- package/dist/core/__tests__/helpers/harness.js +28 -4
- package/dist/core/__tests__/live-mutation-verbs.test.js +5 -4
- package/dist/core/__tests__/review-model-floor.test.js +1 -1
- package/dist/core/canvas/__tests__/remote-event-stream.test.js +11 -9
- package/dist/core/canvas/__tests__/render-remote.test.js +7 -4
- package/dist/core/canvas/browse/__tests__/rebuild-coalescer.test.js +30 -13
- package/dist/core/canvas/pid.d.ts +14 -10
- package/dist/core/canvas/pid.js +14 -10
- package/dist/core/runtime/broker.js +2 -0
- package/dist/core/runtime/launch.js +1 -1
- package/dist/core/runtime/revive.js +28 -18
- package/dist/core/view/__tests__/transport-remote.test.js +9 -6
- package/dist/daemon/crtrd-cli.d.ts +1 -1
- package/dist/daemon/crtrd-cli.js +1 -0
- package/dist/suppress-experimental-warnings.d.ts +1 -0
- package/dist/suppress-experimental-warnings.js +15 -0
- package/dist/types.js +10 -10
- package/dist/web-client/assets/index-BUdm9s9s.css +2 -0
- package/dist/web-client/assets/{index-CnF5r8ky.js → index-DiFuLcp6.js} +18 -17
- package/dist/web-client/index.html +3 -3
- package/dist/web-client/sw.js +1 -1
- package/package.json +10 -7
- package/scripts/postinstall.mjs +1 -1
- package/dist/web-client/assets/index-BnmSLNLa.css +0 -2
|
@@ -48,30 +48,31 @@ Please change the parent <Route path="${e}"> to <Route path="${e===`/`?`*`:`${e}
|
|
|
48
48
|
`},ra=function(){var e=parseInt(document.body.getAttribute(`data-scroll-locked`)||`0`,10);return isFinite(e)?e:0},ia=function(){v.useEffect(function(){return document.body.setAttribute(ta,(ra()+1).toString()),function(){var e=ra()-1;e<=0?document.body.removeAttribute(ta):document.body.setAttribute(ta,e.toString())}},[])},aa=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?`margin`:r;ia();var a=v.useMemo(function(){return $i(i)},[i]);return v.createElement(ea,{styles:na(a,!t,i,n?``:`!important`)})},oa=!1;if(typeof window<`u`)try{var sa=Object.defineProperty({},"passive",{get:function(){return oa=!0,!0}});window.addEventListener(`test`,sa,sa),window.removeEventListener(`test`,sa,sa)}catch{oa=!1}var ca=oa?{passive:!1}:!1,la=function(e){return e.tagName===`TEXTAREA`},ua=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!==`hidden`&&!(n.overflowY===n.overflowX&&!la(e)&&n[t]===`visible`)},da=function(e){return ua(e,`overflowY`)},fa=function(e){return ua(e,`overflowX`)},pa=function(e,t){var n=t.ownerDocument,r=t;do{if(typeof ShadowRoot<`u`&&r instanceof ShadowRoot&&(r=r.host),ga(e,r)){var i=_a(e,r);if(i[1]>i[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},ma=function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]},ha=function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]},ga=function(e,t){return e===`v`?da(t):fa(t)},_a=function(e,t){return e===`v`?ma(t):ha(t)},va=function(e,t){return e===`h`&&t===`rtl`?-1:1},ya=function(e,t,n,r,i){var a=va(e,window.getComputedStyle(t).direction),o=a*r,s=n.target,c=t.contains(s),l=!1,u=o>0,d=0,f=0;do{if(!s)break;var p=_a(e,s),m=p[0],h=p[1]-p[2]-a*m;(m||h)&&ga(e,s)&&(d+=h,f+=m);var g=s.parentNode;s=g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE?g.host:g}while(!c&&s!==document.body||c&&(t.contains(s)||t===s));return(u&&(i&&Math.abs(d)<1||!i&&o>d)||!u&&(i&&Math.abs(f)<1||!i&&-o>f))&&(l=!0),l},ba=function(e){return`changedTouches`in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},xa=function(e){return[e.deltaX,e.deltaY]},Sa=function(e){return e&&`current`in e?e.current:e},Ca=function(e,t){return e[0]===t[0]&&e[1]===t[1]},wa=function(e){return`
|
|
49
49
|
.block-interactivity-${e} {pointer-events: none;}
|
|
50
50
|
.allow-interactivity-${e} {pointer-events: all;}
|
|
51
|
-
`},Ta=0,Ea=[];function Da(e){var t=v.useRef([]),n=v.useRef([0,0]),r=v.useRef(),i=v.useState(Ta++)[0],a=v.useState(Yi)[0],o=v.useRef(e);v.useEffect(function(){o.current=e},[e]),v.useEffect(function(){if(e.inert){document.body.classList.add(`block-interactivity-${i}`);var t=Ti([e.lockRef.current],(e.shards||[]).map(Sa),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add(`allow-interactivity-${i}`)}),function(){document.body.classList.remove(`block-interactivity-${i}`),t.forEach(function(e){return e.classList.remove(`allow-interactivity-${i}`)})}}},[e.inert,e.lockRef.current,e.shards]);var s=v.useCallback(function(e,t){if(`touches`in e&&e.touches.length===2||e.type===`wheel`&&e.ctrlKey)return!o.current.allowPinchZoom;var i=ba(e),a=n.current,s=`deltaX`in e?e.deltaX:a[0]-i[0],c=`deltaY`in e?e.deltaY:a[1]-i[1],l,u=e.target,d=Math.abs(s)>Math.abs(c)?`h`:`v`;if(`touches`in e&&d===`h`&&u.type===`range`)return!1;var f=window.getSelection(),p=f&&f.anchorNode;if(p&&(p===u||p.contains(u)))return!1;var m=pa(d,u);if(!m)return!0;if(m?l=d:(l=d===`v`?`h`:`v`,m=pa(d,u)),!m)return!1;if(!r.current&&`changedTouches`in e&&(s||c)&&(r.current=l),!l)return!0;var h=r.current||l;return ya(h,t,e,h===`h`?s:c,!0)},[]),c=v.useCallback(function(e){var n=e;if(!(!Ea.length||Ea[Ea.length-1]!==a)){var r=`deltaY`in n?xa(n):ba(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&Ca(e.delta,r)})[0];if(i&&i.should){n.cancelable&&n.preventDefault();return}if(!i){var c=(o.current.shards||[]).map(Sa).filter(Boolean).filter(function(e){return e.contains(n.target)});(c.length>0?s(n,c[0]):!o.current.noIsolation)&&n.cancelable&&n.preventDefault()}}},[]),l=v.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i,shadowParent:Oa(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),u=v.useCallback(function(e){n.current=ba(e),r.current=void 0},[]),d=v.useCallback(function(t){l(t.type,xa(t),t.target,s(t,e.lockRef.current))},[]),f=v.useCallback(function(t){l(t.type,ba(t),t.target,s(t,e.lockRef.current))},[]);v.useEffect(function(){return Ea.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener(`wheel`,c,ca),document.addEventListener(`touchmove`,c,ca),document.addEventListener(`touchstart`,u,ca),function(){Ea=Ea.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,c,ca),document.removeEventListener(`touchmove`,c,ca),document.removeEventListener(`touchstart`,u,ca)}},[]);var p=e.removeScrollBar,m=e.inert;return v.createElement(v.Fragment,null,m?v.createElement(a,{styles:wa(i)}):null,p?v.createElement(aa,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Oa(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var ka=Ri(zi,Da),Aa=v.forwardRef(function(e,t){return v.createElement(Vi,Ci({},e,{ref:t,sideCar:ka}))});Aa.classNames=Vi.classNames;var ja=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},Ma=new WeakMap,Na=new WeakMap,Pa={},Fa=0,Ia=function(e){return e&&(e.host||Ia(e.parentNode))},La=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=Ia(t);return n&&e.contains(n)?n:(console.error(`aria-hidden`,t,`in not contained inside`,e,`. Doing nothing`),null)}).filter(function(e){return!!e})},Ra=function(e,t,n,r){var i=La(t,Array.isArray(e)?e:[e]);Pa[n]||(Pa[n]=new WeakMap);var a=Pa[n],o=[],s=new Set,c=new Set(i),l=function(e){!e||s.has(e)||(s.add(e),l(e.parentNode))};i.forEach(l);var u=function(e){!e||c.has(e)||Array.prototype.forEach.call(e.children,function(e){if(s.has(e))u(e);else try{var t=e.getAttribute(r),i=t!==null&&t!==`false`,c=(Ma.get(e)||0)+1,l=(a.get(e)||0)+1;Ma.set(e,c),a.set(e,l),o.push(e),c===1&&i&&Na.set(e,!0),l===1&&e.setAttribute(n,`true`),i||e.setAttribute(r,`true`)}catch(t){console.error(`aria-hidden: cannot operate on `,e,t)}})};return u(t),s.clear(),Fa++,function(){o.forEach(function(e){var t=Ma.get(e)-1,i=a.get(e)-1;Ma.set(e,t),a.set(e,i),t||(Na.has(e)||e.removeAttribute(r),Na.delete(e)),i||e.removeAttribute(n)}),Fa--,Fa||(Ma=new WeakMap,Ma=new WeakMap,Na=new WeakMap,Pa={})}},za=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||ja(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),Ra(r,i,n,`aria-hidden`)):function(){return null}},Ba=`Dialog`,[Va,Ha]=yr(Ba),[Ua,Wa]=Va(Ba),Ga=e=>{let{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!0}=e,s=v.useRef(null),c=v.useRef(null),[l,u]=wr({prop:r,defaultProp:i??!1,onChange:a,caller:Ba});return(0,B.jsx)(Ua,{scope:t,triggerRef:s,contentRef:c,contentId:Ir(),titleId:Ir(),descriptionId:Ir(),open:l,onOpenChange:u,onOpenToggle:v.useCallback(()=>u(e=>!e),[u]),modal:o,children:n})};Ga.displayName=Ba;var Ka=`DialogTrigger`,qa=v.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=Wa(Ka,n),a=Zn(t,i.triggerRef);return(0,B.jsx)(pr.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":po(i.open),...r,ref:a,onClick:V(e.onClick,i.onOpenToggle)})});qa.displayName=Ka;var Ja=`DialogPortal`,[Ya,Xa]=Va(Ja,{forceMount:void 0}),Za=e=>{let{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=Wa(Ja,t);return(0,B.jsx)(Ya,{scope:t,forceMount:n,children:v.Children.map(r,e=>(0,B.jsx)(Or,{present:n||a.open,children:(0,B.jsx)(vi,{asChild:!0,container:i,children:e})}))})};Za.displayName=Ja;var Qa=`DialogOverlay`,$a=v.forwardRef((e,t)=>{let n=Xa(Qa,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=Wa(Qa,e.__scopeDialog);return a.modal?(0,B.jsx)(Or,{present:r||a.open,children:(0,B.jsx)(to,{...i,ref:t})}):null});$a.displayName=Qa;var eo=Qn(`DialogOverlay.RemoveScroll`),to=v.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=Wa(Qa,n),a=Zn(t,Yr());return(0,B.jsx)(Aa,{as:eo,allowPinchZoom:!0,shards:[i.contentRef],children:(0,B.jsx)(pr.div,{"data-state":po(i.open),...r,ref:a,style:{pointerEvents:`auto`,...r.style}})})}),no=`DialogContent`,ro=v.forwardRef((e,t)=>{let n=Xa(no,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=Wa(no,e.__scopeDialog);return(0,B.jsx)(Or,{present:r||a.open,children:a.modal?(0,B.jsx)(io,{...i,ref:t}):(0,B.jsx)(ao,{...i,ref:t})})});ro.displayName=no;var io=v.forwardRef((e,t)=>{let n=Wa(no,e.__scopeDialog),r=v.useRef(null),i=Zn(t,n.contentRef,r);return v.useEffect(()=>{let e=r.current;if(e)return za(e)},[]),(0,B.jsx)(oo,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,onCloseAutoFocus:V(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:V(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:V(e.onFocusOutside,e=>e.preventDefault())})}),ao=v.forwardRef((e,t)=>{let n=Wa(no,e.__scopeDialog),r=v.useRef(!1),i=v.useRef(!1);return(0,B.jsx)(oo,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})}),oo=v.forwardRef((e,t)=>{let{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,...o}=e,s=Wa(no,n);return xi(),(0,B.jsx)(B.Fragment,{children:(0,B.jsx)(ai,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,B.jsx)(Kr,{role:`dialog`,id:s.contentId,"aria-describedby":s.descriptionId,"aria-labelledby":s.titleId,"data-state":po(s.open),...o,ref:t,deferPointerDownOutside:!0,onDismiss:()=>s.onOpenChange(!1)})})})}),so=`DialogTitle`,co=v.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=Wa(so,n);return(0,B.jsx)(pr.h2,{id:i.titleId,...r,ref:t})});co.displayName=so;var lo=`DialogDescription`,U=v.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=Wa(lo,n);return(0,B.jsx)(pr.p,{id:i.descriptionId,...r,ref:t})});U.displayName=lo;var uo=`DialogClose`,fo=v.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=Wa(uo,n);return(0,B.jsx)(pr.button,{type:`button`,...r,ref:t,onClick:V(e.onClick,()=>i.onOpenChange(!1))})});fo.displayName=uo;function po(e){return e?`open`:`closed`}function mo(e){let t=v.useRef({value:e,previous:e});return v.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}function ho(e){let[t,n]=v.useState(void 0);return Sr(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{if(!Array.isArray(t)||!t.length)return;let r=t[0],i,a;if(`borderBoxSize`in r){let e=r.borderBoxSize,t=Array.isArray(e)?e[0]:e;i=t.inlineSize,a=t.blockSize}else i=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return t.observe(e,{box:`border-box`}),()=>t.unobserve(e)}else n(void 0)},[e]),t}var go=[`top`,`right`,`bottom`,`left`],_o=Math.min,vo=Math.max,yo=Math.round,bo=Math.floor,xo=e=>({x:e,y:e}),So={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function Co(e,t,n){return vo(e,_o(t,n))}function wo(e,t){return typeof e==`function`?e(t):e}function To(e){return e.split(`-`)[0]}function Eo(e){return e.split(`-`)[1]}function Do(e){return e===`x`?`y`:`x`}function Oo(e){return e===`y`?`height`:`width`}function ko(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function Ao(e){return Do(ko(e))}function jo(e,t,n){n===void 0&&(n=!1);let r=Eo(e),i=Ao(e),a=Oo(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=Bo(o)),[o,Bo(o)]}function Mo(e){let t=Bo(e);return[No(e),t,No(t)]}function No(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var Po=[`left`,`right`],Fo=[`right`,`left`],Io=[`top`,`bottom`],Lo=[`bottom`,`top`];function Ro(e,t,n){switch(e){case`top`:case`bottom`:return n?t?Fo:Po:t?Po:Fo;case`left`:case`right`:return t?Io:Lo;default:return[]}}function zo(e,t,n,r){let i=Eo(e),a=Ro(To(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(No)))),a}function Bo(e){let t=To(e);return So[t]+e.slice(t.length)}function Vo(e){return{top:0,right:0,bottom:0,left:0,...e}}function Ho(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:Vo(e)}function Uo(e){let{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 Wo(e,t,n){let{reference:r,floating:i}=e,a=ko(t),o=Ao(t),s=Oo(o),c=To(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}switch(Eo(t)){case`start`:p[o]-=f*(n&&l?-1:1);break;case`end`:p[o]+=f*(n&&l?-1:1);break}return p}async function Go(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=wo(t,e),p=Ho(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=Uo(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=Uo(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var Ko=50,qo=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:Go},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=Wo(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<Ko&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=Wo(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},Jo=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=wo(e,t)||{};if(l==null)return{};let d=Ho(u),f={x:n,y:r},p=Ao(i),m=Oo(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),C=S?S[y]:0;(!C||!await(o.isElement==null?void 0:o.isElement(S)))&&(C=s.floating[y]||a.floating[m]);let w=b/2-x/2,T=C/2-h[m]/2-1,E=_o(d[_],T),D=_o(d[v],T),O=E,k=C-h[m]-D,A=C/2-h[m]/2+w,j=Co(O,A,k),M=!c.arrow&&Eo(i)!=null&&A!==j&&a.reference[m]/2-(A<O?E:D)-h[m]/2<0,N=M?A<O?A-O:A-k:0;return{[p]:f[p]+N,data:{[p]:j,centerOffset:A-j-N,...M&&{alignmentOffset:N}},reset:M}}}),Yo=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=wo(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=To(r),_=ko(o),v=To(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[Bo(o)]:Mo(o)),x=p!==`none`;!d&&x&&b.push(...zo(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=jo(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(!(u===`alignment`&&_!==ko(t))||T.every(e=>ko(e.placement)!==_||e.overflows[0]>0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=ko(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o;break}if(r!==n)return{reset:{placement:n}}}return{}}}};function Xo(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Zo(e){return go.some(t=>e[t]>=0)}var Qo=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=wo(e,t);switch(i){case`referenceHidden`:{let e=Xo(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:Zo(e)}}}case`escaped`:{let e=Xo(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:Zo(e)}}}default:return{}}}}},$o=new Set([`left`,`top`]);async function es(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=To(n),s=Eo(n),c=ko(n)===`y`,l=$o.has(o)?-1:1,u=a&&c?-1:1,d=wo(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var ts=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await es(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},ns=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=wo(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=ko(To(i)),p=Do(f),m=u[p],h=u[f];if(o){let e=p===`y`?`top`:`left`,t=p===`y`?`bottom`:`right`,n=m+d[e],r=m-d[t];m=Co(n,m,r)}if(s){let e=f===`y`?`top`:`left`,t=f===`y`?`bottom`:`right`,n=h+d[e],r=h-d[t];h=Co(n,h,r)}let g=c.fn({...t,[p]:m,[f]:h});return{...g,data:{x:g.x-n,y:g.y-r,enabled:{[p]:o,[f]:s}}}}}},rs=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=wo(e,t),u={x:n,y:r},d=ko(i),f=Do(d),p=u[f],m=u[d],h=wo(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=$o.has(To(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},is=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){var n,r;let{placement:i,rects:a,platform:o,elements:s}=t,{apply:c=()=>{},...l}=wo(e,t),u=await o.detectOverflow(t,l),d=To(i),f=Eo(i),p=ko(i)===`y`,{width:m,height:h}=a.floating,g,_;d===`top`||d===`bottom`?(g=d,_=f===(await(o.isRTL==null?void 0:o.isRTL(s.floating))?`start`:`end`)?`left`:`right`):(_=d,g=f===`end`?`top`:`bottom`);let v=h-u.top-u.bottom,y=m-u.left-u.right,b=_o(h-u[g],v),x=_o(m-u[_],y),S=!t.middlewareData.shift,C=b,w=x;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(w=y),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(C=v),S&&!f){let e=vo(u.left,0),t=vo(u.right,0),n=vo(u.top,0),r=vo(u.bottom,0);p?w=m-2*(e!==0||t!==0?e+t:vo(u.left,u.right)):C=h-2*(n!==0||r!==0?n+r:vo(u.top,u.bottom))}await c({...t,availableWidth:w,availableHeight:C});let T=await o.getDimensions(s.floating);return m!==T.width||h!==T.height?{reset:{rects:!0}}:{}}}};function as(){return typeof window<`u`}function os(e){return ls(e)?(e.nodeName||``).toLowerCase():`#document`}function ss(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function cs(e){return((ls(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function ls(e){return as()?e instanceof Node||e instanceof ss(e).Node:!1}function us(e){return as()?e instanceof Element||e instanceof ss(e).Element:!1}function ds(e){return as()?e instanceof HTMLElement||e instanceof ss(e).HTMLElement:!1}function fs(e){return!as()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof ss(e).ShadowRoot}function ps(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=ws(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function ms(e){return/^(table|td|th)$/.test(os(e))}function hs(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var gs=/transform|translate|scale|rotate|perspective|filter/,_s=/paint|layout|strict|content/,vs=e=>!!e&&e!==`none`,ys;function bs(e){let t=us(e)?ws(e):e;return vs(t.transform)||vs(t.translate)||vs(t.scale)||vs(t.rotate)||vs(t.perspective)||!Ss()&&(vs(t.backdropFilter)||vs(t.filter))||gs.test(t.willChange||``)||_s.test(t.contain||``)}function xs(e){let t=Es(e);for(;ds(t)&&!Cs(t);){if(bs(t))return t;if(hs(t))return null;t=Es(t)}return null}function Ss(){return ys??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),ys}function Cs(e){return/^(html|body|#document)$/.test(os(e))}function ws(e){return ss(e).getComputedStyle(e)}function Ts(e){return us(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Es(e){if(os(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||fs(e)&&e.host||cs(e);return fs(t)?t.host:t}function Ds(e){let t=Es(e);return Cs(t)?e.ownerDocument?e.ownerDocument.body:e.body:ds(t)&&ps(t)?t:Ds(t)}function Os(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=Ds(e),i=r===e.ownerDocument?.body,a=ss(r);if(i){let e=ks(a);return t.concat(a,a.visualViewport||[],ps(r)?r:[],e&&n?Os(e):[])}else return t.concat(r,Os(r,[],n))}function ks(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function As(e){let t=ws(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=ds(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=yo(n)!==a||yo(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function js(e){return us(e)?e:e.contextElement}function Ms(e){let t=js(e);if(!ds(t))return xo(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=As(t),o=(a?yo(n.width):n.width)/r,s=(a?yo(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var Ns=xo(0);function Ps(e){let t=ss(e);return!Ss()||!t.visualViewport?Ns:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Fs(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==ss(e)?!1:t}function Is(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=js(e),o=xo(1);t&&(r?us(r)&&(o=Ms(r)):o=Ms(e));let s=Fs(a,n,r)?Ps(a):xo(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a){let e=ss(a),t=r&&us(r)?ss(r):r,n=e,i=ks(n);for(;i&&r&&t!==n;){let e=Ms(i),t=i.getBoundingClientRect(),r=ws(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=ss(i),i=ks(n)}}return Uo({width:u,height:d,x:c,y:l})}function Ls(e,t){let n=Ts(e).scrollLeft;return t?t.left+n:Is(cs(e)).left+n}function Rs(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-Ls(e,n),y:n.top+t.scrollTop}}function zs(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=cs(r),s=t?hs(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=xo(1),u=xo(0),d=ds(r);if((d||!d&&!a)&&((os(r)!==`body`||ps(o))&&(c=Ts(r)),d)){let e=Is(r);l=Ms(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?Rs(o,c):xo(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function Bs(e){return Array.from(e.getClientRects())}function Vs(e){let t=cs(e),n=Ts(e),r=e.ownerDocument.body,i=vo(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=vo(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight),o=-n.scrollLeft+Ls(e),s=-n.scrollTop;return ws(r).direction===`rtl`&&(o+=vo(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:s}}var Hs=25;function Us(e,t){let n=ss(e),r=cs(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;let e=Ss();(!e||e&&t===`fixed`)&&(s=i.offsetLeft,c=i.offsetTop)}let l=Ls(r);if(l<=0){let e=r.ownerDocument,t=e.body,n=getComputedStyle(t),i=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,o=Math.abs(r.clientWidth-t.clientWidth-i);o<=Hs&&(a-=o)}else l<=Hs&&(a+=l);return{width:a,height:o,x:s,y:c}}function Ws(e,t){let n=Is(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=ds(e)?Ms(e):xo(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function Gs(e,t,n){let r;if(t===`viewport`)r=Us(e,n);else if(t===`document`)r=Vs(cs(e));else if(us(t))r=Ws(t,n);else{let n=Ps(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return Uo(r)}function Ks(e,t){let n=Es(e);return n===t||!us(n)||Cs(n)?!1:ws(n).position===`fixed`||Ks(n,t)}function qs(e,t){let n=t.get(e);if(n)return n;let r=Os(e,[],!1).filter(e=>us(e)&&os(e)!==`body`),i=null,a=ws(e).position===`fixed`,o=a?Es(e):e;for(;us(o)&&!Cs(o);){let t=ws(o),n=bs(o);!n&&t.position===`fixed`&&(i=null),(a?!n&&!i:!n&&t.position===`static`&&i&&(i.position===`absolute`||i.position===`fixed`)||ps(o)&&!n&&Ks(e,o))?r=r.filter(e=>e!==o):i=t,o=Es(o)}return t.set(e,r),r}function Js(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?hs(t)?[]:qs(t,this._c):[].concat(n),r],o=Gs(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=Gs(t,a[e],i);s=vo(n.top,s),c=_o(n.right,c),l=_o(n.bottom,l),u=vo(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function Ys(e){let{width:t,height:n}=As(e);return{width:t,height:n}}function Xs(e,t,n){let r=ds(t),i=cs(t),a=n===`fixed`,o=Is(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=xo(0);function l(){c.x=Ls(i)}if(r||!r&&!a)if((os(t)!==`body`||ps(i))&&(s=Ts(t)),r){let e=Is(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}else i&&l();a&&!r&&i&&l();let u=i&&!r&&!a?Rs(i,s):xo(0);return{x:o.left+s.scrollLeft-c.x-u.x,y:o.top+s.scrollTop-c.y-u.y,width:o.width,height:o.height}}function Zs(e){return ws(e).position===`static`}function Qs(e,t){if(!ds(e)||ws(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return cs(e)===n&&(n=n.ownerDocument.body),n}function $s(e,t){let n=ss(e);if(hs(e))return n;if(!ds(e)){let t=Es(e);for(;t&&!Cs(t);){if(us(t)&&!Zs(t))return t;t=Es(t)}return n}let r=Qs(e,t);for(;r&&ms(r)&&Zs(r);)r=Qs(r,t);return r&&Cs(r)&&Zs(r)&&!bs(r)?n:r||xs(e)||n}var ec=async function(e){let t=this.getOffsetParent||$s,n=this.getDimensions,r=await n(e.floating);return{reference:Xs(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function tc(e){return ws(e).direction===`rtl`}var nc={convertOffsetParentRelativeRectToViewportRelativeRect:zs,getDocumentElement:cs,getClippingRect:Js,getOffsetParent:$s,getElementRects:ec,getClientRects:Bs,getDimensions:Ys,getScale:Ms,isElement:us,isRTL:tc};function rc(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function ic(e,t){let n=null,r,i=cs(e);function a(){var e;clearTimeout(r),(e=n)==null||e.disconnect(),n=null}function o(s,c){s===void 0&&(s=!1),c===void 0&&(c=1),a();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(s||t(),!f||!p)return;let m=bo(d),h=bo(i.clientWidth-(u+f)),g=bo(i.clientHeight-(d+p)),_=bo(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:vo(0,_o(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(n!==c){if(!y)return o();n?o(!1,n):r=setTimeout(()=>{o(!1,1e-7)},1e3)}n===1&&!rc(l,e.getBoundingClientRect())&&o(),y=!1}try{n=new IntersectionObserver(b,{...v,root:i.ownerDocument})}catch{n=new IntersectionObserver(b,v)}n.observe(e)}return o(!0),a}function ac(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=js(e),u=i||a?[...l?Os(l):[],...t?Os(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n,{passive:!0}),a&&e.addEventListener(`resize`,n)});let d=l&&s?ic(l,n):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?Is(e):null;c&&g();function g(){let t=Is(e);h&&!rc(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var oc=ts,sc=ns,cc=Yo,lc=is,uc=Qo,dc=Jo,fc=rs,pc=(e,t,n)=>{let r=new Map,i={platform:nc,...n},a={...i.platform,_c:r};return qo(e,t,{...i,platform:a})},mc=typeof document<`u`?v.useLayoutEffect:function(){};function hc(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(!hc(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;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!hc(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function gc(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function _c(e,t){let n=gc(e);return Math.round(t*n)/n}function vc(e){let t=v.useRef(e);return mc(()=>{t.current=e}),t}function yc(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,d]=v.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=v.useState(r);hc(f,r)||p(r);let[m,h]=v.useState(null),[g,_]=v.useState(null),b=v.useCallback(e=>{e!==w.current&&(w.current=e,h(e))},[]),x=v.useCallback(e=>{e!==T.current&&(T.current=e,_(e))},[]),S=a||m,C=o||g,w=v.useRef(null),T=v.useRef(null),E=v.useRef(u),D=c!=null,O=vc(c),k=vc(i),A=vc(l),j=v.useCallback(()=>{if(!w.current||!T.current)return;let e={placement:t,strategy:n,middleware:f};k.current&&(e.platform=k.current),pc(w.current,T.current,e).then(e=>{let t={...e,isPositioned:A.current!==!1};M.current&&!hc(E.current,t)&&(E.current=t,y.flushSync(()=>{d(t)}))})},[f,t,n,k,A]);mc(()=>{l===!1&&E.current.isPositioned&&(E.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let M=v.useRef(!1);mc(()=>(M.current=!0,()=>{M.current=!1}),[]),mc(()=>{if(S&&(w.current=S),C&&(T.current=C),S&&C){if(O.current)return O.current(S,C,j);j()}},[S,C,j,O,D]);let N=v.useMemo(()=>({reference:w,floating:T,setReference:b,setFloating:x}),[b,x]),P=v.useMemo(()=>({reference:S,floating:C}),[S,C]),F=v.useMemo(()=>{let e={position:n,left:0,top:0};if(!P.floating)return e;let t=_c(P.floating,u.x),r=_c(P.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...gc(P.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,P.floating,u.x,u.y]);return v.useMemo(()=>({...u,update:j,refs:N,elements:P,floatingStyles:F}),[u,j,N,P,F])}var bc=e=>{function t(e){return{}.hasOwnProperty.call(e,`current`)}return{name:`arrow`,options:e,fn(n){let{element:r,padding:i}=typeof e==`function`?e(n):e;return r&&t(r)?r.current==null?{}:dc({element:r.current,padding:i}).fn(n):r?dc({element:r,padding:i}).fn(n):{}}}},xc=(e,t)=>{let n=oc(e);return{name:n.name,fn:n.fn,options:[e,t]}},Sc=(e,t)=>{let n=sc(e);return{name:n.name,fn:n.fn,options:[e,t]}},Cc=(e,t)=>({fn:fc(e).fn,options:[e,t]}),wc=(e,t)=>{let n=cc(e);return{name:n.name,fn:n.fn,options:[e,t]}},Tc=(e,t)=>{let n=lc(e);return{name:n.name,fn:n.fn,options:[e,t]}},Ec=(e,t)=>{let n=uc(e);return{name:n.name,fn:n.fn,options:[e,t]}},Dc=(e,t)=>{let n=bc(e);return{name:n.name,fn:n.fn,options:[e,t]}},Oc=`Arrow`,kc=v.forwardRef((e,t)=>{let{children:n,width:r=10,height:i=5,...a}=e;return(0,B.jsx)(pr.svg,{...a,ref:t,width:r,height:i,viewBox:`0 0 30 10`,preserveAspectRatio:`none`,children:e.asChild?n:(0,B.jsx)(`polygon`,{points:`0,0 30,0 15,10`})})});kc.displayName=Oc;var Ac=kc,jc=`Popper`,[Mc,Nc]=yr(jc),[Pc,Fc]=Mc(jc),Ic=e=>{let{__scopePopper:t,children:n}=e,[r,i]=v.useState(null),[a,o]=v.useState(void 0);return(0,B.jsx)(Pc,{scope:t,anchor:r,onAnchorChange:i,placementState:a,setPlacementState:o,children:n})};Ic.displayName=jc;var Lc=`PopperAnchor`,Rc=v.forwardRef((e,t)=>{let{__scopePopper:n,virtualRef:r,...i}=e,a=Fc(Lc,n),o=v.useRef(null),s=a.onAnchorChange,c=Zn(t,v.useCallback(e=>{o.current=e,e&&s(e)},[s])),l=v.useRef(null);v.useEffect(()=>{if(!r)return;let e=l.current;l.current=r.current,e!==l.current&&s(l.current)});let u=a.placementState&&Jc(a.placementState),d=u?.[0],f=u?.[1];return r?null:(0,B.jsx)(pr.div,{"data-radix-popper-side":d,"data-radix-popper-align":f,...i,ref:c})});Rc.displayName=Lc;var zc=`PopperContent`,[Bc,Vc]=Mc(zc),Hc=v.forwardRef((e,t)=>{let{__scopePopper:n,side:r=`bottom`,sideOffset:i=0,align:a=`center`,alignOffset:o=0,arrowPadding:s=0,avoidCollisions:c=!0,collisionBoundary:l=[],collisionPadding:u=0,sticky:d=`partial`,hideWhenDetached:f=!1,updatePositionStrategy:p=`optimized`,onPlaced:m,...h}=e,g=Fc(zc,n),[_,y]=v.useState(null),b=Zn(t,y),[x,S]=v.useState(null),C=ho(x),w=C?.width??0,T=C?.height??0,E=r+(a===`center`?``:`-`+a),D=typeof u==`number`?u:{top:0,right:0,bottom:0,left:0,...u},O=Array.isArray(l)?l:[l],k=O.length>0,A={padding:D,boundary:O.filter(Kc),altBoundary:k},{refs:j,floatingStyles:M,placement:N,isPositioned:P,middlewareData:F}=yc({strategy:`fixed`,placement:E,whileElementsMounted:(...e)=>ac(...e,{animationFrame:p===`always`}),elements:{reference:g.anchor},middleware:[xc({mainAxis:i+T,alignmentAxis:o}),c&&Sc({mainAxis:!0,crossAxis:!1,limiter:d===`partial`?Cc():void 0,...A}),c&&wc({...A}),Tc({...A,apply:({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{let{width:i,height:a}=t.reference,o=e.floating.style;o.setProperty(`--radix-popper-available-width`,`${n}px`),o.setProperty(`--radix-popper-available-height`,`${r}px`),o.setProperty(`--radix-popper-anchor-width`,`${i}px`),o.setProperty(`--radix-popper-anchor-height`,`${a}px`)}}),x&&Dc({element:x,padding:s}),qc({arrowWidth:w,arrowHeight:T}),f&&Ec({strategy:`referenceHidden`,...A,boundary:k?A.boundary:void 0})]}),I=g.setPlacementState;Sr(()=>(I(N),()=>{I(void 0)}),[N,I]);let[L,ee]=Jc(N),te=zr(m);Sr(()=>{P&&te?.()},[P,te]);let ne=F.arrow?.x,re=F.arrow?.y,ie=F.arrow?.centerOffset!==0,[R,ae]=v.useState();return Sr(()=>{_&&ae(window.getComputedStyle(_).zIndex)},[_]),(0,B.jsx)(`div`,{ref:j.setFloating,"data-radix-popper-content-wrapper":``,style:{...M,transform:P?M.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:R,"--radix-popper-transform-origin":[F.transformOrigin?.x,F.transformOrigin?.y].join(` `),...F.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:(0,B.jsx)(Bc,{scope:n,placedSide:L,placedAlign:ee,onArrowChange:S,arrowX:ne,arrowY:re,shouldHideArrow:ie,children:(0,B.jsx)(pr.div,{"data-side":L,"data-align":ee,...h,ref:b,style:{...h.style,animation:P?void 0:`none`}})})})});Hc.displayName=zc;var Uc=`PopperArrow`,Wc={top:`bottom`,right:`left`,bottom:`top`,left:`right`},Gc=v.forwardRef(function(e,t){let{__scopePopper:n,...r}=e,i=Vc(Uc,n),a=Wc[i.placedSide];return(0,B.jsx)(`span`,{ref:i.onArrowChange,style:{position:`absolute`,left:i.arrowX,top:i.arrowY,[a]:0,transformOrigin:{top:``,right:`0 0`,bottom:`center 0`,left:`100% 0`}[i.placedSide],transform:{top:`translateY(100%)`,right:`translateY(50%) rotate(90deg) translateX(-50%)`,bottom:`rotate(180deg)`,left:`translateY(50%) rotate(-90deg) translateX(50%)`}[i.placedSide],visibility:i.shouldHideArrow?`hidden`:void 0},children:(0,B.jsx)(Ac,{...r,ref:t,style:{...r.style,display:`block`}})})});Gc.displayName=Uc;function Kc(e){return e!==null}var qc=e=>({name:`transformOrigin`,options:e,fn(t){let{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,o=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[c,l]=Jc(n),u={start:`0%`,center:`50%`,end:`100%`}[l],d=(i.arrow?.x??0)+o/2,f=(i.arrow?.y??0)+s/2,p=``,m=``;return c===`bottom`?(p=a?u:`${d}px`,m=`${-s}px`):c===`top`?(p=a?u:`${d}px`,m=`${r.floating.height+s}px`):c===`right`?(p=`${-s}px`,m=a?u:`${f}px`):c===`left`&&(p=`${r.floating.width+s}px`,m=a?u:`${f}px`),{data:{x:p,y:m}}}});function Jc(e){let[t,n=`center`]=e.split(`-`);return[t,n]}var Yc=Ic,Xc=Rc,Zc=Hc,Qc=Gc,$c=`Label`,el=v.forwardRef((e,t)=>(0,B.jsx)(pr.label,{...e,ref:t,onMouseDown:t=>{t.target.closest(`button, input, select, textarea`)||(e.onMouseDown?.(t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}}));el.displayName=$c;var tl=el;function nl(e,[t,n]){return Math.min(n,Math.max(t,e))}var rl=[` `,`Enter`,`ArrowUp`,`ArrowDown`],il=[` `,`Enter`],al=`Select`,[ol,sl,cl]=xr(al),[ll,ul]=yr(al,[cl,Nc]),dl=Nc(),[fl,pl]=ll(al),[ml,hl]=ll(al),gl=`SelectProvider`;function _l(e){let{__scopeSelect:t,children:n,open:r,defaultOpen:i,onOpenChange:a,value:o,defaultValue:s,onValueChange:c,dir:l,name:u,autoComplete:d,disabled:f,required:p,form:m,internal_do_not_use_render:h}=e,g=dl(t),[_,y]=v.useState(null),[b,x]=v.useState(null),[S,C]=v.useState(!1),w=Rr(l),[T,E]=wr({prop:r,defaultProp:i??!1,onChange:a,caller:al}),[D,O]=wr({prop:o,defaultProp:s,onChange:c,caller:al}),k=v.useRef(null),A=v.useRef(D);v.useEffect(()=>{let e=m?_?.ownerDocument.getElementById(m):_?.form;if(e instanceof HTMLFormElement){let t=()=>O(A.current);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[m,_,O]);let j=!_||!!m||!!_.closest(`form`),[M,N]=v.useState(new Set),P=Ir(),F=Array.from(M).map(e=>e.props.value).join(`;`),I=v.useCallback(e=>{N(t=>new Set(t).add(e))},[]),L=v.useCallback(e=>{N(t=>{let n=new Set(t);return n.delete(e),n})},[]),ee={required:p,trigger:_,onTriggerChange:y,valueNode:b,onValueNodeChange:x,valueNodeHasChildren:S,onValueNodeHasChildrenChange:C,contentId:P,value:D,onValueChange:O,open:T,onOpenChange:E,dir:w,triggerPointerDownPosRef:k,disabled:f,name:u,autoComplete:d,form:m,nativeOptions:M,nativeSelectKey:F,isFormControl:j};return(0,B.jsx)(Yc,{...g,children:(0,B.jsx)(fl,{scope:t,...ee,children:(0,B.jsx)(ol.Provider,{scope:t,children:(0,B.jsx)(ml,{scope:t,onNativeOptionAdd:I,onNativeOptionRemove:L,children:mu(h)?h(ee):n})})})})}_l.displayName=gl;var vl=e=>{let{__scopeSelect:t,children:n,...r}=e;return(0,B.jsx)(_l,{__scopeSelect:t,...r,internal_do_not_use_render:({isFormControl:e})=>(0,B.jsxs)(B.Fragment,{children:[n,e?(0,B.jsx)(pu,{__scopeSelect:t}):null]})})};vl.displayName=al;var yl=`SelectTrigger`,bl=v.forwardRef((e,t)=>{let{__scopeSelect:n,disabled:r=!1,...i}=e,a=dl(n),o=pl(yl,n),s=o.disabled||r,c=Zn(t,o.onTriggerChange),l=sl(n),u=v.useRef(`touch`),[d,f,p]=gu(e=>{let t=l().filter(e=>!e.disabled),n=_u(t,e,t.find(e=>e.value===o.value));n!==void 0&&o.onValueChange(n.value)}),m=e=>{s||(o.onOpenChange(!0),p()),e&&(o.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)})};return(0,B.jsx)(Xc,{asChild:!0,...a,children:(0,B.jsx)(pr.button,{type:`button`,role:`combobox`,"aria-controls":o.open?o.contentId:void 0,"aria-expanded":o.open,"aria-required":o.required,"aria-autocomplete":`none`,dir:o.dir,"data-state":o.open?`open`:`closed`,disabled:s,"data-disabled":s?``:void 0,"data-placeholder":hu(o.value)?``:void 0,...i,ref:c,onClick:V(i.onClick,e=>{e.currentTarget.focus(),u.current!==`mouse`&&m(e)}),onPointerDown:V(i.onPointerDown,e=>{u.current=e.pointerType;let t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),e.button===0&&e.ctrlKey===!1&&e.pointerType===`mouse`&&(m(e),e.preventDefault())}),onKeyDown:V(i.onKeyDown,e=>{let t=d.current!==``;!(e.ctrlKey||e.altKey||e.metaKey)&&e.key.length===1&&f(e.key),!(t&&e.key===` `)&&rl.includes(e.key)&&(m(),e.preventDefault())})})})});bl.displayName=yl;var xl=`SelectValue`,Sl=v.forwardRef((e,t)=>{let{__scopeSelect:n,className:r,style:i,children:a,placeholder:o=``,...s}=e,c=pl(xl,n),{onValueNodeHasChildrenChange:l}=c,u=a!==void 0,d=Zn(t,c.onValueNodeChange);Sr(()=>{l(u)},[l,u]);let f=hu(c.value);return(0,B.jsx)(pr.span,{...s,asChild:!f&&s.asChild,ref:d,style:{pointerEvents:`none`},children:(0,B.jsx)(v.Fragment,{children:f?o:a},f?`placeholder`:`value`)})});Sl.displayName=xl;var Cl=`SelectIcon`,wl=v.forwardRef((e,t)=>{let{__scopeSelect:n,children:r,...i}=e;return(0,B.jsx)(pr.span,{"aria-hidden":!0,...i,ref:t,children:r||`▼`})});wl.displayName=Cl;var Tl=`SelectPortal`,[El,Dl]=ll(Tl,{forceMount:void 0}),Ol=e=>{let{__scopeSelect:t,forceMount:n,...r}=e;return(0,B.jsx)(El,{scope:e.__scopeSelect,forceMount:n,children:(0,B.jsx)(vi,{asChild:!0,...r})})};Ol.displayName=Tl;var kl=`SelectContent`,Al=v.forwardRef((e,t)=>{let n=Dl(kl,e.__scopeSelect),{forceMount:r=n.forceMount,...i}=e,a=pl(kl,e.__scopeSelect),[o,s]=v.useState();return Sr(()=>{s(new DocumentFragment)},[]),(0,B.jsx)(Or,{present:r||a.open,children:({present:e})=>e?(0,B.jsx)(Ll,{...i,ref:t}):(0,B.jsx)(jl,{...i,fragment:o})})});Al.displayName=kl;var jl=v.forwardRef((e,t)=>{let{__scopeSelect:n,children:r,fragment:i}=e;return i?y.createPortal((0,B.jsx)(Nl,{scope:n,children:(0,B.jsx)(ol.Slot,{scope:n,children:(0,B.jsx)(`div`,{ref:t,children:r})})}),i):null});jl.displayName=`SelectContentFragment`;var Ml=10,[Nl,Pl]=ll(kl),Fl=`SelectContentImpl`,Il=Qn(`SelectContent.RemoveScroll`),Ll=v.forwardRef((e,t)=>{let{__scopeSelect:n}=e,{position:r=`item-aligned`,onCloseAutoFocus:i,onEscapeKeyDown:a,onPointerDownOutside:o,side:s,sideOffset:c,align:l,alignOffset:u,arrowPadding:d,collisionBoundary:f,collisionPadding:p,sticky:m,hideWhenDetached:h,avoidCollisions:g,..._}=e,y=pl(kl,n),[b,x]=v.useState(null),[S,C]=v.useState(null),w=Zn(t,x),[T,E]=v.useState(null),[D,O]=v.useState(null),k=sl(n),[A,j]=v.useState(!1),M=v.useRef(!1);v.useEffect(()=>{if(b)return za(b)},[b]),xi();let N=v.useCallback(e=>{let[t,...n]=k().map(e=>e.ref.current),[r]=n.slice(-1),i=document.activeElement;for(let n of e)if(n===i||(n?.scrollIntoView({block:`nearest`}),n===t&&S&&(S.scrollTop=0),n===r&&S&&(S.scrollTop=S.scrollHeight),n?.focus(),document.activeElement!==i))return},[k,S]),P=v.useCallback(()=>N([T,b]),[N,T,b]);v.useEffect(()=>{A&&P()},[A,P]);let{onOpenChange:F,triggerPointerDownPosRef:I}=y;v.useEffect(()=>{if(b){let e={x:0,y:0},t=t=>{e={x:Math.abs(Math.round(t.pageX)-(I.current?.x??0)),y:Math.abs(Math.round(t.pageY)-(I.current?.y??0))}},n=n=>{e.x<=10&&e.y<=10?n.preventDefault():n.composedPath().includes(b)||F(!1),document.removeEventListener(`pointermove`,t),I.current=null};return I.current!==null&&(document.addEventListener(`pointermove`,t),document.addEventListener(`pointerup`,n,{capture:!0,once:!0})),()=>{document.removeEventListener(`pointermove`,t),document.removeEventListener(`pointerup`,n,{capture:!0})}}},[b,F,I]),v.useEffect(()=>{let e=()=>F(!1);return window.addEventListener(`blur`,e),window.addEventListener(`resize`,e),()=>{window.removeEventListener(`blur`,e),window.removeEventListener(`resize`,e)}},[F]);let[L,ee]=gu(e=>{let t=k().filter(e=>!e.disabled),n=_u(t,e,t.find(e=>e.ref.current===document.activeElement));n&&setTimeout(()=>n.ref.current?.focus())}),te=v.useCallback((e,t,n)=>{let r=!M.current&&!n;(y.value!==void 0&&y.value===t||r)&&(E(e),r&&(M.current=!0))},[y.value]),ne=v.useCallback(()=>b?.focus(),[b]),re=v.useCallback((e,t,n)=>{let r=!M.current&&!n;(y.value!==void 0&&y.value===t||r)&&O(e)},[y.value]),ie=r===`popper`?W:zl,R=ie===W?{side:s,sideOffset:c,align:l,alignOffset:u,arrowPadding:d,collisionBoundary:f,collisionPadding:p,sticky:m,hideWhenDetached:h,avoidCollisions:g}:{};return(0,B.jsx)(Nl,{scope:n,content:b,viewport:S,onViewportChange:C,itemRefCallback:te,selectedItem:T,onItemLeave:ne,itemTextRefCallback:re,focusSelectedItem:P,selectedItemText:D,position:r,isPositioned:A,searchRef:L,children:(0,B.jsx)(Aa,{as:Il,allowPinchZoom:!0,children:(0,B.jsx)(ai,{asChild:!0,trapped:y.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:V(i,e=>{y.trigger?.focus({preventScroll:!0}),e.preventDefault()}),children:(0,B.jsx)(Kr,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>y.onOpenChange(!1),children:(0,B.jsx)(ie,{role:`listbox`,id:y.contentId,"data-state":y.open?`open`:`closed`,dir:y.dir,onContextMenu:e=>e.preventDefault(),..._,...R,onPlaced:()=>j(!0),ref:w,style:{display:`flex`,flexDirection:`column`,outline:`none`,..._.style},onKeyDown:V(_.onKeyDown,e=>{let t=e.ctrlKey||e.altKey||e.metaKey;if(e.key===`Tab`&&e.preventDefault(),!t&&e.key.length===1&&ee(e.key),[`ArrowUp`,`ArrowDown`,`Home`,`End`].includes(e.key)){let t=k().filter(e=>!e.disabled).map(e=>e.ref.current);if([`ArrowUp`,`End`].includes(e.key)&&(t=t.slice().reverse()),[`ArrowUp`,`ArrowDown`].includes(e.key)){let n=e.target,r=t.indexOf(n);t=t.slice(r+1)}setTimeout(()=>N(t)),e.preventDefault()}})})})})})})});Ll.displayName=Fl;var Rl=`SelectItemAlignedPosition`,zl=v.forwardRef((e,t)=>{let{__scopeSelect:n,onPlaced:r,...i}=e,a=pl(kl,n),o=Pl(kl,n),[s,c]=v.useState(null),[l,u]=v.useState(null),d=Zn(t,u),f=sl(n),p=v.useRef(!1),m=v.useRef(!0),{viewport:h,selectedItem:g,selectedItemText:_,focusSelectedItem:y}=o,b=v.useCallback(()=>{if(a.trigger&&a.valueNode&&s&&l&&h&&g&&_){let e=a.trigger.getBoundingClientRect(),t=l.getBoundingClientRect(),n=a.valueNode.getBoundingClientRect(),i=_.getBoundingClientRect();if(a.dir!==`rtl`){let r=i.left-t.left,a=n.left-r,o=e.left-a,c=e.width+o,l=Math.max(c,t.width),u=window.innerWidth-Ml,d=nl(a,[Ml,Math.max(Ml,u-l)]);s.style.minWidth=c+`px`,s.style.left=d+`px`}else{let r=t.right-i.right,a=window.innerWidth-n.right-r,o=window.innerWidth-e.right-a,c=e.width+o,l=Math.max(c,t.width),u=window.innerWidth-Ml,d=nl(a,[Ml,Math.max(Ml,u-l)]);s.style.minWidth=c+`px`,s.style.right=d+`px`}let o=f(),c=window.innerHeight-Ml*2,u=h.scrollHeight,d=window.getComputedStyle(l),m=parseInt(d.borderTopWidth,10),v=parseInt(d.paddingTop,10),y=parseInt(d.borderBottomWidth,10),b=parseInt(d.paddingBottom,10),x=m+v+u+b+y,S=Math.min(g.offsetHeight*5,x),C=window.getComputedStyle(h),w=parseInt(C.paddingTop,10),T=parseInt(C.paddingBottom,10),E=e.top+e.height/2-Ml,D=c-E,O=g.offsetHeight/2,k=g.offsetTop+O,A=m+v+k,j=x-A;if(A<=E){let e=o.length>0&&g===o[o.length-1].ref.current;s.style.bottom=`0px`;let t=l.clientHeight-h.offsetTop-h.offsetHeight,n=A+Math.max(D,O+(e?T:0)+t+y);s.style.height=n+`px`}else{let e=o.length>0&&g===o[0].ref.current;s.style.top=`0px`;let t=Math.max(E,m+h.offsetTop+(e?w:0)+O)+j;s.style.height=t+`px`,h.scrollTop=A-E+h.offsetTop}s.style.margin=`${Ml}px 0`,s.style.minHeight=S+`px`,s.style.maxHeight=c+`px`,r?.(),requestAnimationFrame(()=>p.current=!0)}},[f,a.trigger,a.valueNode,s,l,h,g,_,a.dir,r]);Sr(()=>b(),[b]);let[x,S]=v.useState();return Sr(()=>{l&&S(window.getComputedStyle(l).zIndex)},[l]),(0,B.jsx)(Vl,{scope:n,contentWrapper:s,shouldExpandOnScrollRef:p,onScrollButtonChange:v.useCallback(e=>{e&&m.current===!0&&(b(),y?.(),m.current=!1)},[b,y]),children:(0,B.jsx)(`div`,{ref:c,style:{display:`flex`,flexDirection:`column`,position:`fixed`,zIndex:x},children:(0,B.jsx)(pr.div,{...i,ref:d,style:{boxSizing:`border-box`,maxHeight:`100%`,...i.style}})})})});zl.displayName=Rl;var Bl=`SelectPopperPosition`,W=v.forwardRef((e,t)=>{let{__scopeSelect:n,align:r=`start`,collisionPadding:i=Ml,...a}=e,o=dl(n);return(0,B.jsx)(Zc,{...o,...a,ref:t,align:r,collisionPadding:i,style:{boxSizing:`border-box`,...a.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)`}})});W.displayName=Bl;var[Vl,G]=ll(kl,{}),K=`SelectViewport`,Hl=v.forwardRef((e,t)=>{let{__scopeSelect:n,nonce:r,...i}=e,a=Pl(K,n),o=G(K,n),s=Zn(t,a.onViewportChange),c=v.useRef(0);return(0,B.jsxs)(B.Fragment,{children:[(0,B.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}),(0,B.jsx)(ol.Slot,{scope:n,children:(0,B.jsx)(pr.div,{"data-radix-select-viewport":``,role:`presentation`,...i,ref:s,style:{position:`relative`,flex:1,overflow:`hidden auto`,...i.style},onScroll:V(i.onScroll,e=>{let t=e.currentTarget,{contentWrapper:n,shouldExpandOnScrollRef:r}=o;if(r?.current&&n){let e=Math.abs(c.current-t.scrollTop);if(e>0){let r=window.innerHeight-Ml*2,i=parseFloat(n.style.minHeight),a=parseFloat(n.style.height),o=Math.max(i,a);if(o<r){let i=o+e,a=Math.min(r,i),s=i-a;n.style.height=a+`px`,n.style.bottom===`0px`&&(t.scrollTop=s>0?s:0,n.style.justifyContent=`flex-end`)}}}c.current=t.scrollTop})})})]})});Hl.displayName=K;var Ul=`SelectGroup`,[Wl,Gl]=ll(Ul),Kl=v.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,i=Ir();return(0,B.jsx)(Wl,{scope:n,id:i,children:(0,B.jsx)(pr.div,{role:`group`,"aria-labelledby":i,...r,ref:t})})});Kl.displayName=Ul;var ql=`SelectLabel`,Jl=v.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,i=Gl(ql,n);return(0,B.jsx)(pr.div,{id:i.id,...r,ref:t})});Jl.displayName=ql;var Yl=`SelectItem`,[Xl,Zl]=ll(Yl),Ql=v.forwardRef((e,t)=>{let{__scopeSelect:n,value:r,disabled:i=!1,textValue:a,...o}=e,s=pl(Yl,n),c=Pl(Yl,n),l=s.value===r,[u,d]=v.useState(a??``),[f,p]=v.useState(!1),m=Zn(t,zr(e=>c.itemRefCallback?.(e,r,i))),h=Ir(),g=v.useRef(`touch`),_=()=>{i||(s.onValueChange(r),s.onOpenChange(!1))};return(0,B.jsx)(Xl,{scope:n,value:r,disabled:i,textId:h,isSelected:l,onItemTextChange:v.useCallback(e=>{d(t=>t||(e?.textContent??``).trim())},[]),children:(0,B.jsx)(ol.ItemSlot,{scope:n,value:r,disabled:i,textValue:u,children:(0,B.jsx)(pr.div,{role:`option`,"aria-labelledby":h,"data-highlighted":f?``:void 0,"aria-selected":l&&f,"data-state":l?`checked`:`unchecked`,"aria-disabled":i||void 0,"data-disabled":i?``:void 0,tabIndex:i?void 0:-1,...o,ref:m,onFocus:V(o.onFocus,()=>p(!0)),onBlur:V(o.onBlur,()=>p(!1)),onClick:V(o.onClick,()=>{g.current!==`mouse`&&_()}),onPointerUp:V(o.onPointerUp,()=>{g.current===`mouse`&&_()}),onPointerDown:V(o.onPointerDown,e=>{g.current=e.pointerType}),onPointerMove:V(o.onPointerMove,e=>{g.current=e.pointerType,i?c.onItemLeave?.():g.current===`mouse`&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:V(o.onPointerLeave,e=>{e.currentTarget===document.activeElement&&c.onItemLeave?.()}),onKeyDown:V(o.onKeyDown,e=>{i||e.target!==e.currentTarget||c.searchRef?.current!==``&&e.key===` `||(il.includes(e.key)&&_(),e.key===` `&&e.preventDefault())})})})})});Ql.displayName=Yl;var $l=`SelectItemText`,eu=v.forwardRef((e,t)=>{let{__scopeSelect:n,className:r,style:i,...a}=e,o=pl($l,n),s=Pl($l,n),c=Zl($l,n),l=hl($l,n),[u,d]=v.useState(null),f=zr(e=>s.itemTextRefCallback?.(e,c.value,c.disabled)),p=Zn(t,d,c.onItemTextChange,f),m=u?.textContent,h=v.useMemo(()=>(0,B.jsx)(`option`,{value:c.value,disabled:c.disabled,children:m},c.value),[c.disabled,c.value,m]),{onNativeOptionAdd:g,onNativeOptionRemove:_}=l;return Sr(()=>(g(h),()=>_(h)),[g,_,h]),(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(pr.span,{id:c.textId,...a,ref:p}),c.isSelected&&o.valueNode&&!o.valueNodeHasChildren&&!hu(o.value)?y.createPortal(a.children,o.valueNode):null]})});eu.displayName=$l;var tu=`SelectItemIndicator`,nu=v.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e;return Zl(tu,n).isSelected?(0,B.jsx)(pr.span,{"aria-hidden":!0,...r,ref:t}):null});nu.displayName=tu;var ru=`SelectScrollUpButton`,iu=v.forwardRef((e,t)=>{let n=Pl(ru,e.__scopeSelect),r=G(ru,e.__scopeSelect),[i,a]=v.useState(!1),o=Zn(t,r.onScrollButtonChange);return Sr(()=>{if(n.viewport&&n.isPositioned){let e=function(){let e=t.scrollTop>0;a(e)},t=n.viewport;return e(),t.addEventListener(`scroll`,e),()=>t.removeEventListener(`scroll`,e)}},[n.viewport,n.isPositioned]),i?(0,B.jsx)(su,{...e,ref:o,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop-=t.offsetHeight)}}):null});iu.displayName=ru;var au=`SelectScrollDownButton`,ou=v.forwardRef((e,t)=>{let n=Pl(au,e.__scopeSelect),r=G(au,e.__scopeSelect),[i,a]=v.useState(!1),o=Zn(t,r.onScrollButtonChange);return Sr(()=>{if(n.viewport&&n.isPositioned){let e=function(){let e=t.scrollHeight-t.clientHeight,n=Math.ceil(t.scrollTop)<e;a(n)},t=n.viewport;return e(),t.addEventListener(`scroll`,e),()=>t.removeEventListener(`scroll`,e)}},[n.viewport,n.isPositioned]),i?(0,B.jsx)(su,{...e,ref:o,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop+=t.offsetHeight)}}):null});ou.displayName=au;var su=v.forwardRef((e,t)=>{let{__scopeSelect:n,onAutoScroll:r,...i}=e,a=Pl(`SelectScrollButton`,n),o=v.useRef(null),s=sl(n),c=v.useCallback(()=>{o.current!==null&&(window.clearInterval(o.current),o.current=null)},[]);return v.useEffect(()=>()=>c(),[c]),Sr(()=>{s().find(e=>e.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:`nearest`})},[s]),(0,B.jsx)(pr.div,{"aria-hidden":!0,...i,ref:t,style:{flexShrink:0,...i.style},onPointerDown:V(i.onPointerDown,()=>{o.current===null&&(o.current=window.setInterval(r,50))}),onPointerMove:V(i.onPointerMove,()=>{a.onItemLeave?.(),o.current===null&&(o.current=window.setInterval(r,50))}),onPointerLeave:V(i.onPointerLeave,()=>{c()})})}),cu=`SelectSeparator`,lu=v.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e;return(0,B.jsx)(pr.div,{"aria-hidden":!0,...r,ref:t})});lu.displayName=cu;var uu=`SelectArrow`,du=v.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,i=dl(n);return Pl(uu,n).position===`popper`?(0,B.jsx)(Qc,{...i,...r,ref:t}):null});du.displayName=uu;var fu=`SelectBubbleInput`,pu=v.forwardRef(({__scopeSelect:e,...t},n)=>{let r=pl(fu,e),{value:i,onValueChange:a,required:o,disabled:s,name:c,autoComplete:l,form:u}=r,{nativeOptions:d,nativeSelectKey:f}=r,p=v.useRef(null),m=Zn(n,p),h=i??``,g=mo(h),_=Array.from(d).some(e=>(e.props.value??``)===``);return v.useEffect(()=>{let e=p.current;if(!e)return;let t=window.HTMLSelectElement.prototype,n=Object.getOwnPropertyDescriptor(t,`value`).set;if(g!==h&&n){let t=new Event(`change`,{bubbles:!0});n.call(e,h),e.dispatchEvent(t)}},[g,h]),(0,B.jsxs)(pr.select,{"aria-hidden":!0,required:o,tabIndex:-1,name:c,autoComplete:l,disabled:s,form:u,onChange:e=>a(e.target.value),...t,style:{...hr,...t.style},ref:m,defaultValue:h,children:[hu(i)&&!_?(0,B.jsx)(`option`,{value:``}):null,Array.from(d)]},f)});pu.displayName=fu;function mu(e){return typeof e==`function`}function hu(e){return e===``||e===void 0}function gu(e){let t=zr(e),n=v.useRef(``),r=v.useRef(0),i=v.useCallback(e=>{let i=n.current+e;t(i),(function e(t){n.current=t,window.clearTimeout(r.current),t!==``&&(r.current=window.setTimeout(()=>e(``),1e3))})(i)},[t]),a=v.useCallback(()=>{n.current=``,window.clearTimeout(r.current)},[]);return v.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,a]}function _u(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=vu(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.textValue.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}function vu(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var[yu,bu]=yr(`Tooltip`,[Nc]),xu=Nc(),Su=`TooltipProvider`,Cu=700,wu=`tooltip.open`,[Tu,Eu]=yu(Su),Du=e=>{let{__scopeTooltip:t,delayDuration:n=Cu,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:a}=e,o=v.useRef(!0),s=v.useRef(!1),c=v.useRef(0);return v.useEffect(()=>{let e=c.current;return()=>window.clearTimeout(e)},[]),(0,B.jsx)(Tu,{scope:t,isOpenDelayedRef:o,delayDuration:n,onOpen:v.useCallback(()=>{r<=0||(window.clearTimeout(c.current),o.current=!1)},[r]),onClose:v.useCallback(()=>{r<=0||(window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.current=!0,r))},[r]),isPointerInTransitRef:s,onPointerInTransitChange:v.useCallback(e=>{s.current=e},[]),disableHoverableContent:i,children:a})};Du.displayName=Su;var Ou=`Tooltip`,[ku,Au]=yu(Ou),ju=e=>{let{__scopeTooltip:t,children:n,open:r,defaultOpen:i,onOpenChange:a,disableHoverableContent:o,delayDuration:s}=e,c=Eu(Ou,e.__scopeTooltip),l=xu(t),[u,d]=v.useState(null),f=Ir(),p=v.useRef(0),m=o??c.disableHoverableContent,h=s??c.delayDuration,g=v.useRef(!1),[_,y]=wr({prop:r,defaultProp:i??!1,onChange:e=>{e?(c.onOpen(),document.dispatchEvent(new CustomEvent(wu))):c.onClose(),a?.(e)},caller:Ou}),b=v.useMemo(()=>_?g.current?`delayed-open`:`instant-open`:`closed`,[_]),x=v.useCallback(()=>{window.clearTimeout(p.current),p.current=0,g.current=!1,y(!0)},[y]),S=v.useCallback(()=>{window.clearTimeout(p.current),p.current=0,y(!1)},[y]),C=v.useCallback(()=>{window.clearTimeout(p.current),p.current=window.setTimeout(()=>{g.current=!0,y(!0),p.current=0},h)},[h,y]);return v.useEffect(()=>()=>{p.current&&=(window.clearTimeout(p.current),0)},[]),(0,B.jsx)(Yc,{...l,children:(0,B.jsx)(ku,{scope:t,contentId:f,open:_,stateAttribute:b,trigger:u,onTriggerChange:d,onTriggerEnter:v.useCallback(()=>{c.isOpenDelayedRef.current?C():x()},[c.isOpenDelayedRef,C,x]),onTriggerLeave:v.useCallback(()=>{m?S():(window.clearTimeout(p.current),p.current=0)},[S,m]),onOpen:x,onClose:S,disableHoverableContent:m,children:n})})};ju.displayName=Ou;var Mu=`TooltipTrigger`,Nu=v.forwardRef((e,t)=>{let{__scopeTooltip:n,...r}=e,i=Au(Mu,n),a=Eu(Mu,n),o=xu(n),s=Zn(t,v.useRef(null),i.onTriggerChange),c=v.useRef(!1),l=v.useRef(!1),u=v.useCallback(()=>c.current=!1,[]);return v.useEffect(()=>()=>document.removeEventListener(`pointerup`,u),[u]),(0,B.jsx)(Xc,{asChild:!0,...o,children:(0,B.jsx)(pr.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...r,ref:s,onPointerMove:V(e.onPointerMove,e=>{e.pointerType!==`touch`&&!l.current&&!a.isPointerInTransitRef.current&&(i.onTriggerEnter(),l.current=!0)}),onPointerLeave:V(e.onPointerLeave,()=>{i.onTriggerLeave(),l.current=!1}),onPointerDown:V(e.onPointerDown,()=>{i.open&&i.onClose(),c.current=!0,document.addEventListener(`pointerup`,u,{once:!0})}),onFocus:V(e.onFocus,()=>{c.current||i.onOpen()}),onBlur:V(e.onBlur,i.onClose),onClick:V(e.onClick,i.onClose)})})});Nu.displayName=Mu;var Pu=`TooltipPortal`,[Fu,Iu]=yu(Pu,{forceMount:void 0}),Lu=e=>{let{__scopeTooltip:t,forceMount:n,children:r,container:i}=e,a=Au(Pu,t);return(0,B.jsx)(Fu,{scope:t,forceMount:n,children:(0,B.jsx)(Or,{present:n||a.open,children:(0,B.jsx)(vi,{asChild:!0,container:i,children:r})})})};Lu.displayName=Pu;var Ru=`TooltipContent`,zu=v.forwardRef((e,t)=>{let n=Iu(Ru,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i=`top`,...a}=e,o=Au(Ru,e.__scopeTooltip);return(0,B.jsx)(Or,{present:r||o.open,children:o.disableHoverableContent?(0,B.jsx)(Wu,{side:i,...a,ref:t}):(0,B.jsx)(Bu,{side:i,...a,ref:t})})}),Bu=v.forwardRef((e,t)=>{let n=Au(Ru,e.__scopeTooltip),r=Eu(Ru,e.__scopeTooltip),i=v.useRef(null),a=Zn(t,i),[o,s]=v.useState(null),{trigger:c,onClose:l}=n,u=i.current,{onPointerInTransitChange:d}=r,f=v.useCallback(()=>{s(null),d(!1)},[d]),p=v.useCallback((e,t)=>{let n=e.currentTarget,r={x:e.clientX,y:e.clientY},i=Ju(r,qu(r,n.getBoundingClientRect())),a=Yu(t.getBoundingClientRect()),o=Zu([...i,...a]);s(o),d(!0)},[d]);return v.useEffect(()=>()=>f(),[f]),v.useEffect(()=>{if(c&&u){let e=e=>p(e,u),t=e=>p(e,c);return c.addEventListener(`pointerleave`,e),u.addEventListener(`pointerleave`,t),()=>{c.removeEventListener(`pointerleave`,e),u.removeEventListener(`pointerleave`,t)}}},[c,u,p,f]),v.useEffect(()=>{if(o){let e=e=>{let t=e.target,n={x:e.clientX,y:e.clientY},r=c?.contains(t)||u?.contains(t),i=!Xu(n,o);r?f():i&&(f(),l())};return document.addEventListener(`pointermove`,e),()=>document.removeEventListener(`pointermove`,e)}},[c,u,o,l,f]),(0,B.jsx)(Wu,{...e,ref:a})}),[Vu,Hu]=yu(Ou,{isInside:!1}),Uu=tr(`TooltipContent`),Wu=v.forwardRef((e,t)=>{let{__scopeTooltip:n,children:r,"aria-label":i,onEscapeKeyDown:a,onPointerDownOutside:o,...s}=e,c=Au(Ru,n),l=xu(n),{onClose:u}=c;return v.useEffect(()=>(document.addEventListener(wu,u),()=>document.removeEventListener(wu,u)),[u]),v.useEffect(()=>{if(c.trigger){let e=e=>{e.target instanceof Node&&e.target.contains(c.trigger)&&u()};return window.addEventListener(`scroll`,e,{capture:!0}),()=>window.removeEventListener(`scroll`,e,{capture:!0})}},[c.trigger,u]),(0,B.jsx)(Kr,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:e=>e.preventDefault(),onDismiss:u,children:(0,B.jsxs)(Zc,{"data-state":c.stateAttribute,...l,...s,ref:t,style:{...s.style,"--radix-tooltip-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-tooltip-content-available-width":`var(--radix-popper-available-width)`,"--radix-tooltip-content-available-height":`var(--radix-popper-available-height)`,"--radix-tooltip-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-tooltip-trigger-height":`var(--radix-popper-anchor-height)`},children:[(0,B.jsx)(Uu,{children:r}),(0,B.jsx)(Vu,{scope:n,isInside:!0,children:(0,B.jsx)(vr,{id:c.contentId,role:`tooltip`,children:i||r})})]})})});zu.displayName=Ru;var Gu=`TooltipArrow`,Ku=v.forwardRef((e,t)=>{let{__scopeTooltip:n,...r}=e,i=xu(n);return Hu(Gu,n).isInside?null:(0,B.jsx)(Qc,{...i,...r,ref:t})});Ku.displayName=Gu;function qu(e,t){let n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(n,r,i,a)){case a:return`left`;case i:return`right`;case n:return`top`;case r:return`bottom`;default:throw Error(`unreachable`)}}function Ju(e,t,n=5){let r=[];switch(t){case`top`:r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case`bottom`:r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case`left`:r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case`right`:r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function Yu(e){let{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}function Xu(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}function Zu(e){let t=e.slice();return t.sort((e,t)=>e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:+(e.y>t.y)),Qu(t)}function Qu(e){if(e.length<=1)return e.slice();let t=[];for(let n=0;n<e.length;n++){let r=e[n];for(;t.length>=2;){let e=t[t.length-1],n=t[t.length-2];if((e.x-n.x)*(r.y-n.y)>=(e.y-n.y)*(r.x-n.x))t.pop();else break}t.push(r)}t.pop();let n=[];for(let t=e.length-1;t>=0;t--){let r=e[t];for(;n.length>=2;){let e=n[n.length-1],t=n[n.length-2];if((e.x-t.x)*(r.y-t.y)>=(e.y-t.y)*(r.x-t.x))n.pop();else break}n.push(r)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var $u=Du;function ed(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`)if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=ed(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n);return r}function td(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=ed(e))&&(r&&(r+=` `),r+=t);return r}var nd=`-`,rd=e=>{let t=sd(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{let n=e.split(nd);return n[0]===``&&n.length!==1&&n.shift(),id(n,t)||od(e)},getConflictingClassGroupIds:(e,t)=>{let i=n[e]||[];return t&&r[e]?[...i,...r[e]]:i}}},id=(e,t)=>{if(e.length===0)return t.classGroupId;let n=e[0],r=t.nextPart.get(n),i=r?id(e.slice(1),r):void 0;if(i)return i;if(t.validators.length===0)return;let a=e.join(nd);return t.validators.find(({validator:e})=>e(a))?.classGroupId},ad=/^\[(.+)\]$/,od=e=>{if(ad.test(e)){let t=ad.exec(e)[1],n=t?.substring(0,t.indexOf(`:`));if(n)return`arbitrary..`+n}},sd=e=>{let{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return dd(Object.entries(e.classGroups),n).forEach(([e,n])=>{cd(n,r,e,t)}),r},cd=(e,t,n,r)=>{e.forEach(e=>{if(typeof e==`string`){let r=e===``?t:ld(t,e);r.classGroupId=n;return}if(typeof e==`function`){if(ud(e)){cd(e(r),t,n,r);return}t.validators.push({validator:e,classGroupId:n});return}Object.entries(e).forEach(([e,i])=>{cd(i,ld(t,e),n,r)})})},ld=(e,t)=>{let n=e;return t.split(nd).forEach(e=>{n.nextPart.has(e)||n.nextPart.set(e,{nextPart:new Map,validators:[]}),n=n.nextPart.get(e)}),n},ud=e=>e.isThemeGetter,dd=(e,t)=>t?e.map(([e,n])=>[e,n.map(e=>typeof e==`string`?t+e:typeof e==`object`?Object.fromEntries(Object.entries(e).map(([e,n])=>[t+e,n])):e)]):e,fd=e=>{if(e<1)return{get:()=>void 0,set:()=>{}};let t=0,n=new Map,r=new Map,i=(i,a)=>{n.set(i,a),t++,t>e&&(t=0,r=n,n=new Map)};return{get(e){let t=n.get(e);if(t!==void 0)return t;if((t=r.get(e))!==void 0)return i(e,t),t},set(e,t){n.has(e)?n.set(e,t):i(e,t)}}},pd=`!`,md=e=>{let{separator:t,experimentalParseClassName:n}=e,r=t.length===1,i=t[0],a=t.length,o=e=>{let n=[],o=0,s=0,c;for(let l=0;l<e.length;l++){let u=e[l];if(o===0){if(u===i&&(r||e.slice(l,l+a)===t)){n.push(e.slice(s,l)),s=l+a;continue}if(u===`/`){c=l;continue}}u===`[`?o++:u===`]`&&o--}let l=n.length===0?e:e.substring(s),u=l.startsWith(pd);return{modifiers:n,hasImportantModifier:u,baseClassName:u?l.substring(1):l,maybePostfixModifierPosition:c&&c>s?c-s:void 0}};return n?e=>n({className:e,parseClassName:o}):o},hd=e=>{if(e.length<=1)return e;let t=[],n=[];return e.forEach(e=>{e[0]===`[`?(t.push(...n.sort(),e),n=[]):n.push(e)}),t.push(...n.sort()),t},gd=e=>({cache:fd(e.cacheSize),parseClassName:md(e),...rd(e)}),_d=/\s+/,vd=(e,t)=>{let{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i}=t,a=[],o=e.trim().split(_d),s=``;for(let e=o.length-1;e>=0;--e){let t=o[e],{modifiers:c,hasImportantModifier:l,baseClassName:u,maybePostfixModifierPosition:d}=n(t),f=!!d,p=r(f?u.substring(0,d):u);if(!p){if(!f){s=t+(s.length>0?` `+s:s);continue}if(p=r(u),!p){s=t+(s.length>0?` `+s:s);continue}f=!1}let m=hd(c).join(`:`),h=l?m+pd:m,g=h+p;if(a.includes(g))continue;a.push(g);let _=i(p,f);for(let e=0;e<_.length;++e){let t=_[e];a.push(h+t)}s=t+(s.length>0?` `+s:s)}return s};function yd(){let e=0,t,n,r=``;for(;e<arguments.length;)(t=arguments[e++])&&(n=bd(t))&&(r&&(r+=` `),r+=n);return r}var bd=e=>{if(typeof e==`string`)return e;let t,n=``;for(let r=0;r<e.length;r++)e[r]&&(t=bd(e[r]))&&(n&&(n+=` `),n+=t);return n};function xd(e,...t){let n,r,i,a=o;function o(o){return n=gd(t.reduce((e,t)=>t(e),e())),r=n.cache.get,i=n.cache.set,a=s,s(o)}function s(e){let t=r(e);if(t)return t;let a=vd(e,n);return i(e,a),a}return function(){return a(yd.apply(null,arguments))}}var Sd=e=>{let t=t=>t[e]||[];return t.isThemeGetter=!0,t},Cd=/^\[(?:([a-z-]+):)?(.+)\]$/i,wd=/^\d+\/\d+$/,q=new Set([`px`,`full`,`screen`]),Td=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Ed=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Dd=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Od=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,kd=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Ad=e=>Md(e)||q.has(e)||wd.test(e),jd=e=>Wd(e,`length`,Gd),Md=e=>!!e&&!Number.isNaN(Number(e)),Nd=e=>Wd(e,`number`,Md),Pd=e=>!!e&&Number.isInteger(Number(e)),Fd=e=>e.endsWith(`%`)&&Md(e.slice(0,-1)),J=e=>Cd.test(e),Id=e=>Td.test(e),Ld=new Set([`length`,`size`,`percentage`]),Rd=e=>Wd(e,Ld,Kd),zd=e=>Wd(e,`position`,Kd),Bd=new Set([`image`,`url`]),Vd=e=>Wd(e,Bd,Jd),Hd=e=>Wd(e,``,qd),Ud=()=>!0,Wd=(e,t,n)=>{let r=Cd.exec(e);return r?r[1]?typeof t==`string`?r[1]===t:t.has(r[1]):n(r[2]):!1},Gd=e=>Ed.test(e)&&!Dd.test(e),Kd=()=>!1,qd=e=>Od.test(e),Jd=e=>kd.test(e),Yd=xd(()=>{let e=Sd(`colors`),t=Sd(`spacing`),n=Sd(`blur`),r=Sd(`brightness`),i=Sd(`borderColor`),a=Sd(`borderRadius`),o=Sd(`borderSpacing`),s=Sd(`borderWidth`),c=Sd(`contrast`),l=Sd(`grayscale`),u=Sd(`hueRotate`),d=Sd(`invert`),f=Sd(`gap`),p=Sd(`gradientColorStops`),m=Sd(`gradientColorStopPositions`),h=Sd(`inset`),g=Sd(`margin`),_=Sd(`opacity`),v=Sd(`padding`),y=Sd(`saturate`),b=Sd(`scale`),x=Sd(`sepia`),S=Sd(`skew`),C=Sd(`space`),w=Sd(`translate`),T=()=>[`auto`,`contain`,`none`],E=()=>[`auto`,`hidden`,`clip`,`visible`,`scroll`],D=()=>[`auto`,J,t],O=()=>[J,t],k=()=>[``,Ad,jd],A=()=>[`auto`,Md,J],j=()=>[`bottom`,`center`,`left`,`left-bottom`,`left-top`,`right`,`right-bottom`,`right-top`,`top`],M=()=>[`solid`,`dashed`,`dotted`,`double`,`none`],N=()=>[`normal`,`multiply`,`screen`,`overlay`,`darken`,`lighten`,`color-dodge`,`color-burn`,`hard-light`,`soft-light`,`difference`,`exclusion`,`hue`,`saturation`,`color`,`luminosity`],P=()=>[`start`,`end`,`center`,`between`,`around`,`evenly`,`stretch`],F=()=>[``,`0`,J],I=()=>[`auto`,`avoid`,`all`,`avoid-page`,`page`,`left`,`right`,`column`],L=()=>[Md,J];return{cacheSize:500,separator:`:`,theme:{colors:[Ud],spacing:[Ad,jd],blur:[`none`,``,Id,J],brightness:L(),borderColor:[e],borderRadius:[`none`,``,`full`,Id,J],borderSpacing:O(),borderWidth:k(),contrast:L(),grayscale:F(),hueRotate:L(),invert:F(),gap:O(),gradientColorStops:[e],gradientColorStopPositions:[Fd,jd],inset:D(),margin:D(),opacity:L(),padding:O(),saturate:L(),scale:L(),sepia:F(),skew:L(),space:O(),translate:O()},classGroups:{aspect:[{aspect:[`auto`,`square`,`video`,J]}],container:[`container`],columns:[{columns:[Id]}],"break-after":[{"break-after":I()}],"break-before":[{"break-before":I()}],"break-inside":[{"break-inside":[`auto`,`avoid`,`avoid-page`,`avoid-column`]}],"box-decoration":[{"box-decoration":[`slice`,`clone`]}],box:[{box:[`border`,`content`]}],display:[`block`,`inline-block`,`inline`,`flex`,`inline-flex`,`table`,`inline-table`,`table-caption`,`table-cell`,`table-column`,`table-column-group`,`table-footer-group`,`table-header-group`,`table-row-group`,`table-row`,`flow-root`,`grid`,`inline-grid`,`contents`,`list-item`,`hidden`],float:[{float:[`right`,`left`,`none`,`start`,`end`]}],clear:[{clear:[`left`,`right`,`both`,`none`,`start`,`end`]}],isolation:[`isolate`,`isolation-auto`],"object-fit":[{object:[`contain`,`cover`,`fill`,`none`,`scale-down`]}],"object-position":[{object:[...j(),J]}],overflow:[{overflow:E()}],"overflow-x":[{"overflow-x":E()}],"overflow-y":[{"overflow-y":E()}],overscroll:[{overscroll:T()}],"overscroll-x":[{"overscroll-x":T()}],"overscroll-y":[{"overscroll-y":T()}],position:[`static`,`fixed`,`absolute`,`relative`,`sticky`],inset:[{inset:[h]}],"inset-x":[{"inset-x":[h]}],"inset-y":[{"inset-y":[h]}],start:[{start:[h]}],end:[{end:[h]}],top:[{top:[h]}],right:[{right:[h]}],bottom:[{bottom:[h]}],left:[{left:[h]}],visibility:[`visible`,`invisible`,`collapse`],z:[{z:[`auto`,Pd,J]}],basis:[{basis:D()}],"flex-direction":[{flex:[`row`,`row-reverse`,`col`,`col-reverse`]}],"flex-wrap":[{flex:[`wrap`,`wrap-reverse`,`nowrap`]}],flex:[{flex:[`1`,`auto`,`initial`,`none`,J]}],grow:[{grow:F()}],shrink:[{shrink:F()}],order:[{order:[`first`,`last`,`none`,Pd,J]}],"grid-cols":[{"grid-cols":[Ud]}],"col-start-end":[{col:[`auto`,{span:[`full`,Pd,J]},J]}],"col-start":[{"col-start":A()}],"col-end":[{"col-end":A()}],"grid-rows":[{"grid-rows":[Ud]}],"row-start-end":[{row:[`auto`,{span:[Pd,J]},J]}],"row-start":[{"row-start":A()}],"row-end":[{"row-end":A()}],"grid-flow":[{"grid-flow":[`row`,`col`,`dense`,`row-dense`,`col-dense`]}],"auto-cols":[{"auto-cols":[`auto`,`min`,`max`,`fr`,J]}],"auto-rows":[{"auto-rows":[`auto`,`min`,`max`,`fr`,J]}],gap:[{gap:[f]}],"gap-x":[{"gap-x":[f]}],"gap-y":[{"gap-y":[f]}],"justify-content":[{justify:[`normal`,...P()]}],"justify-items":[{"justify-items":[`start`,`end`,`center`,`stretch`]}],"justify-self":[{"justify-self":[`auto`,`start`,`end`,`center`,`stretch`]}],"align-content":[{content:[`normal`,...P(),`baseline`]}],"align-items":[{items:[`start`,`end`,`center`,`baseline`,`stretch`]}],"align-self":[{self:[`auto`,`start`,`end`,`center`,`stretch`,`baseline`]}],"place-content":[{"place-content":[...P(),`baseline`]}],"place-items":[{"place-items":[`start`,`end`,`center`,`baseline`,`stretch`]}],"place-self":[{"place-self":[`auto`,`start`,`end`,`center`,`stretch`]}],p:[{p:[v]}],px:[{px:[v]}],py:[{py:[v]}],ps:[{ps:[v]}],pe:[{pe:[v]}],pt:[{pt:[v]}],pr:[{pr:[v]}],pb:[{pb:[v]}],pl:[{pl:[v]}],m:[{m:[g]}],mx:[{mx:[g]}],my:[{my:[g]}],ms:[{ms:[g]}],me:[{me:[g]}],mt:[{mt:[g]}],mr:[{mr:[g]}],mb:[{mb:[g]}],ml:[{ml:[g]}],"space-x":[{"space-x":[C]}],"space-x-reverse":[`space-x-reverse`],"space-y":[{"space-y":[C]}],"space-y-reverse":[`space-y-reverse`],w:[{w:[`auto`,`min`,`max`,`fit`,`svw`,`lvw`,`dvw`,J,t]}],"min-w":[{"min-w":[J,t,`min`,`max`,`fit`]}],"max-w":[{"max-w":[J,t,`none`,`full`,`min`,`max`,`fit`,`prose`,{screen:[Id]},Id]}],h:[{h:[J,t,`auto`,`min`,`max`,`fit`,`svh`,`lvh`,`dvh`]}],"min-h":[{"min-h":[J,t,`min`,`max`,`fit`,`svh`,`lvh`,`dvh`]}],"max-h":[{"max-h":[J,t,`min`,`max`,`fit`,`svh`,`lvh`,`dvh`]}],size:[{size:[J,t,`auto`,`min`,`max`,`fit`]}],"font-size":[{text:[`base`,Id,jd]}],"font-smoothing":[`antialiased`,`subpixel-antialiased`],"font-style":[`italic`,`not-italic`],"font-weight":[{font:[`thin`,`extralight`,`light`,`normal`,`medium`,`semibold`,`bold`,`extrabold`,`black`,Nd]}],"font-family":[{font:[Ud]}],"fvn-normal":[`normal-nums`],"fvn-ordinal":[`ordinal`],"fvn-slashed-zero":[`slashed-zero`],"fvn-figure":[`lining-nums`,`oldstyle-nums`],"fvn-spacing":[`proportional-nums`,`tabular-nums`],"fvn-fraction":[`diagonal-fractions`,`stacked-fractions`],tracking:[{tracking:[`tighter`,`tight`,`normal`,`wide`,`wider`,`widest`,J]}],"line-clamp":[{"line-clamp":[`none`,Md,Nd]}],leading:[{leading:[`none`,`tight`,`snug`,`normal`,`relaxed`,`loose`,Ad,J]}],"list-image":[{"list-image":[`none`,J]}],"list-style-type":[{list:[`none`,`disc`,`decimal`,J]}],"list-style-position":[{list:[`inside`,`outside`]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[_]}],"text-alignment":[{text:[`left`,`center`,`right`,`justify`,`start`,`end`]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[_]}],"text-decoration":[`underline`,`overline`,`line-through`,`no-underline`],"text-decoration-style":[{decoration:[...M(),`wavy`]}],"text-decoration-thickness":[{decoration:[`auto`,`from-font`,Ad,jd]}],"underline-offset":[{"underline-offset":[`auto`,Ad,J]}],"text-decoration-color":[{decoration:[e]}],"text-transform":[`uppercase`,`lowercase`,`capitalize`,`normal-case`],"text-overflow":[`truncate`,`text-ellipsis`,`text-clip`],"text-wrap":[{text:[`wrap`,`nowrap`,`balance`,`pretty`]}],indent:[{indent:O()}],"vertical-align":[{align:[`baseline`,`top`,`middle`,`bottom`,`text-top`,`text-bottom`,`sub`,`super`,J]}],whitespace:[{whitespace:[`normal`,`nowrap`,`pre`,`pre-line`,`pre-wrap`,`break-spaces`]}],break:[{break:[`normal`,`words`,`all`,`keep`]}],hyphens:[{hyphens:[`none`,`manual`,`auto`]}],content:[{content:[`none`,J]}],"bg-attachment":[{bg:[`fixed`,`local`,`scroll`]}],"bg-clip":[{"bg-clip":[`border`,`padding`,`content`,`text`]}],"bg-opacity":[{"bg-opacity":[_]}],"bg-origin":[{"bg-origin":[`border`,`padding`,`content`]}],"bg-position":[{bg:[...j(),zd]}],"bg-repeat":[{bg:[`no-repeat`,{repeat:[``,`x`,`y`,`round`,`space`]}]}],"bg-size":[{bg:[`auto`,`cover`,`contain`,Rd]}],"bg-image":[{bg:[`none`,{"gradient-to":[`t`,`tr`,`r`,`br`,`b`,`bl`,`l`,`tl`]},Vd]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[m]}],"gradient-via-pos":[{via:[m]}],"gradient-to-pos":[{to:[m]}],"gradient-from":[{from:[p]}],"gradient-via":[{via:[p]}],"gradient-to":[{to:[p]}],rounded:[{rounded:[a]}],"rounded-s":[{"rounded-s":[a]}],"rounded-e":[{"rounded-e":[a]}],"rounded-t":[{"rounded-t":[a]}],"rounded-r":[{"rounded-r":[a]}],"rounded-b":[{"rounded-b":[a]}],"rounded-l":[{"rounded-l":[a]}],"rounded-ss":[{"rounded-ss":[a]}],"rounded-se":[{"rounded-se":[a]}],"rounded-ee":[{"rounded-ee":[a]}],"rounded-es":[{"rounded-es":[a]}],"rounded-tl":[{"rounded-tl":[a]}],"rounded-tr":[{"rounded-tr":[a]}],"rounded-br":[{"rounded-br":[a]}],"rounded-bl":[{"rounded-bl":[a]}],"border-w":[{border:[s]}],"border-w-x":[{"border-x":[s]}],"border-w-y":[{"border-y":[s]}],"border-w-s":[{"border-s":[s]}],"border-w-e":[{"border-e":[s]}],"border-w-t":[{"border-t":[s]}],"border-w-r":[{"border-r":[s]}],"border-w-b":[{"border-b":[s]}],"border-w-l":[{"border-l":[s]}],"border-opacity":[{"border-opacity":[_]}],"border-style":[{border:[...M(),`hidden`]}],"divide-x":[{"divide-x":[s]}],"divide-x-reverse":[`divide-x-reverse`],"divide-y":[{"divide-y":[s]}],"divide-y-reverse":[`divide-y-reverse`],"divide-opacity":[{"divide-opacity":[_]}],"divide-style":[{divide:M()}],"border-color":[{border:[i]}],"border-color-x":[{"border-x":[i]}],"border-color-y":[{"border-y":[i]}],"border-color-s":[{"border-s":[i]}],"border-color-e":[{"border-e":[i]}],"border-color-t":[{"border-t":[i]}],"border-color-r":[{"border-r":[i]}],"border-color-b":[{"border-b":[i]}],"border-color-l":[{"border-l":[i]}],"divide-color":[{divide:[i]}],"outline-style":[{outline:[``,...M()]}],"outline-offset":[{"outline-offset":[Ad,J]}],"outline-w":[{outline:[Ad,jd]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:k()}],"ring-w-inset":[`ring-inset`],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[_]}],"ring-offset-w":[{"ring-offset":[Ad,jd]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:[``,`inner`,`none`,Id,Hd]}],"shadow-color":[{shadow:[Ud]}],opacity:[{opacity:[_]}],"mix-blend":[{"mix-blend":[...N(),`plus-lighter`,`plus-darker`]}],"bg-blend":[{"bg-blend":N()}],filter:[{filter:[``,`none`]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[c]}],"drop-shadow":[{"drop-shadow":[``,`none`,Id,J]}],grayscale:[{grayscale:[l]}],"hue-rotate":[{"hue-rotate":[u]}],invert:[{invert:[d]}],saturate:[{saturate:[y]}],sepia:[{sepia:[x]}],"backdrop-filter":[{"backdrop-filter":[``,`none`]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[c]}],"backdrop-grayscale":[{"backdrop-grayscale":[l]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[u]}],"backdrop-invert":[{"backdrop-invert":[d]}],"backdrop-opacity":[{"backdrop-opacity":[_]}],"backdrop-saturate":[{"backdrop-saturate":[y]}],"backdrop-sepia":[{"backdrop-sepia":[x]}],"border-collapse":[{border:[`collapse`,`separate`]}],"border-spacing":[{"border-spacing":[o]}],"border-spacing-x":[{"border-spacing-x":[o]}],"border-spacing-y":[{"border-spacing-y":[o]}],"table-layout":[{table:[`auto`,`fixed`]}],caption:[{caption:[`top`,`bottom`]}],transition:[{transition:[`none`,`all`,``,`colors`,`opacity`,`shadow`,`transform`,J]}],duration:[{duration:L()}],ease:[{ease:[`linear`,`in`,`out`,`in-out`,J]}],delay:[{delay:L()}],animate:[{animate:[`none`,`spin`,`ping`,`pulse`,`bounce`,J]}],transform:[{transform:[``,`gpu`,`none`]}],scale:[{scale:[b]}],"scale-x":[{"scale-x":[b]}],"scale-y":[{"scale-y":[b]}],rotate:[{rotate:[Pd,J]}],"translate-x":[{"translate-x":[w]}],"translate-y":[{"translate-y":[w]}],"skew-x":[{"skew-x":[S]}],"skew-y":[{"skew-y":[S]}],"transform-origin":[{origin:[`center`,`top`,`top-right`,`right`,`bottom-right`,`bottom`,`bottom-left`,`left`,`top-left`,J]}],accent:[{accent:[`auto`,e]}],appearance:[{appearance:[`none`,`auto`]}],cursor:[{cursor:[`auto`,`default`,`pointer`,`wait`,`text`,`move`,`help`,`not-allowed`,`none`,`context-menu`,`progress`,`cell`,`crosshair`,`vertical-text`,`alias`,`copy`,`no-drop`,`grab`,`grabbing`,`all-scroll`,`col-resize`,`row-resize`,`n-resize`,`e-resize`,`s-resize`,`w-resize`,`ne-resize`,`nw-resize`,`se-resize`,`sw-resize`,`ew-resize`,`ns-resize`,`nesw-resize`,`nwse-resize`,`zoom-in`,`zoom-out`,J]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":[`none`,`auto`]}],resize:[{resize:[`none`,`y`,`x`,``]}],"scroll-behavior":[{scroll:[`auto`,`smooth`]}],"scroll-m":[{"scroll-m":O()}],"scroll-mx":[{"scroll-mx":O()}],"scroll-my":[{"scroll-my":O()}],"scroll-ms":[{"scroll-ms":O()}],"scroll-me":[{"scroll-me":O()}],"scroll-mt":[{"scroll-mt":O()}],"scroll-mr":[{"scroll-mr":O()}],"scroll-mb":[{"scroll-mb":O()}],"scroll-ml":[{"scroll-ml":O()}],"scroll-p":[{"scroll-p":O()}],"scroll-px":[{"scroll-px":O()}],"scroll-py":[{"scroll-py":O()}],"scroll-ps":[{"scroll-ps":O()}],"scroll-pe":[{"scroll-pe":O()}],"scroll-pt":[{"scroll-pt":O()}],"scroll-pr":[{"scroll-pr":O()}],"scroll-pb":[{"scroll-pb":O()}],"scroll-pl":[{"scroll-pl":O()}],"snap-align":[{snap:[`start`,`end`,`center`,`align-none`]}],"snap-stop":[{snap:[`normal`,`always`]}],"snap-type":[{snap:[`none`,`x`,`y`,`both`]}],"snap-strictness":[{snap:[`mandatory`,`proximity`]}],touch:[{touch:[`auto`,`none`,`manipulation`]}],"touch-x":[{"touch-pan":[`x`,`left`,`right`]}],"touch-y":[{"touch-pan":[`y`,`up`,`down`]}],"touch-pz":[`touch-pinch-zoom`],select:[{select:[`none`,`text`,`all`,`auto`]}],"will-change":[{"will-change":[`auto`,`scroll`,`contents`,`transform`,J]}],fill:[{fill:[e,`none`]}],"stroke-w":[{stroke:[Ad,jd,Nd]}],stroke:[{stroke:[e,`none`]}],sr:[`sr-only`,`not-sr-only`],"forced-color-adjust":[{"forced-color-adjust":[`auto`,`none`]}]},conflictingClassGroups:{overflow:[`overflow-x`,`overflow-y`],overscroll:[`overscroll-x`,`overscroll-y`],inset:[`inset-x`,`inset-y`,`start`,`end`,`top`,`right`,`bottom`,`left`],"inset-x":[`right`,`left`],"inset-y":[`top`,`bottom`],flex:[`basis`,`grow`,`shrink`],gap:[`gap-x`,`gap-y`],p:[`px`,`py`,`ps`,`pe`,`pt`,`pr`,`pb`,`pl`],px:[`pr`,`pl`],py:[`pt`,`pb`],m:[`mx`,`my`,`ms`,`me`,`mt`,`mr`,`mb`,`ml`],mx:[`mr`,`ml`],my:[`mt`,`mb`],size:[`w`,`h`],"font-size":[`leading`],"fvn-normal":[`fvn-ordinal`,`fvn-slashed-zero`,`fvn-figure`,`fvn-spacing`,`fvn-fraction`],"fvn-ordinal":[`fvn-normal`],"fvn-slashed-zero":[`fvn-normal`],"fvn-figure":[`fvn-normal`],"fvn-spacing":[`fvn-normal`],"fvn-fraction":[`fvn-normal`],"line-clamp":[`display`,`overflow`],rounded:[`rounded-s`,`rounded-e`,`rounded-t`,`rounded-r`,`rounded-b`,`rounded-l`,`rounded-ss`,`rounded-se`,`rounded-ee`,`rounded-es`,`rounded-tl`,`rounded-tr`,`rounded-br`,`rounded-bl`],"rounded-s":[`rounded-ss`,`rounded-es`],"rounded-e":[`rounded-se`,`rounded-ee`],"rounded-t":[`rounded-tl`,`rounded-tr`],"rounded-r":[`rounded-tr`,`rounded-br`],"rounded-b":[`rounded-br`,`rounded-bl`],"rounded-l":[`rounded-tl`,`rounded-bl`],"border-spacing":[`border-spacing-x`,`border-spacing-y`],"border-w":[`border-w-s`,`border-w-e`,`border-w-t`,`border-w-r`,`border-w-b`,`border-w-l`],"border-w-x":[`border-w-r`,`border-w-l`],"border-w-y":[`border-w-t`,`border-w-b`],"border-color":[`border-color-s`,`border-color-e`,`border-color-t`,`border-color-r`,`border-color-b`,`border-color-l`],"border-color-x":[`border-color-r`,`border-color-l`],"border-color-y":[`border-color-t`,`border-color-b`],"scroll-m":[`scroll-mx`,`scroll-my`,`scroll-ms`,`scroll-me`,`scroll-mt`,`scroll-mr`,`scroll-mb`,`scroll-ml`],"scroll-mx":[`scroll-mr`,`scroll-ml`],"scroll-my":[`scroll-mt`,`scroll-mb`],"scroll-p":[`scroll-px`,`scroll-py`,`scroll-ps`,`scroll-pe`,`scroll-pt`,`scroll-pr`,`scroll-pb`,`scroll-pl`],"scroll-px":[`scroll-pr`,`scroll-pl`],"scroll-py":[`scroll-pt`,`scroll-pb`],touch:[`touch-x`,`touch-y`,`touch-pz`],"touch-x":[`touch`],"touch-y":[`touch`],"touch-pz":[`touch`]},conflictingClassGroupModifiers:{"font-size":[`leading`]}}});function Y(...e){return Yd(td(e))}function Xd({delayDuration:e=0,...t}){return(0,B.jsx)($u,{"data-slot":`tooltip-provider`,delayDuration:e,...t})}var Zd=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),Qd=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),$d={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`},ef=(0,v.forwardRef)(({color:e=`currentColor`,size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i=``,children:a,iconNode:o,...s},c)=>(0,v.createElement)(`svg`,{ref:c,...$d,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:Qd(`lucide`,i),...s},[...o.map(([e,t])=>(0,v.createElement)(e,t)),...Array.isArray(a)?a:[a]])),X=(e,t)=>{let n=(0,v.forwardRef)(({className:n,...r},i)=>(0,v.createElement)(ef,{ref:i,iconNode:t,className:Qd(`lucide-${Zd(e)}`,n),...r}));return n.displayName=`${e}`,n},tf=X(`ArrowLeft`,[[`path`,{d:`m12 19-7-7 7-7`,key:`1l729n`}],[`path`,{d:`M19 12H5`,key:`x3x0zl`}]]),nf=X(`ArrowRight`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`m12 5 7 7-7 7`,key:`xquz4c`}]]),rf=X(`Bell`,[[`path`,{d:`M10.268 21a2 2 0 0 0 3.464 0`,key:`vwvbt9`}],[`path`,{d:`M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326`,key:`11g9vi`}]]),af=X(`Check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),of=X(`ChevronDown`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),sf=X(`ChevronLeft`,[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]),cf=X(`ChevronRight`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),lf=X(`ChevronUp`,[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]),uf=X(`CircleAlert`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`12`,x2:`12`,y1:`8`,y2:`12`,key:`1pkeuh`}],[`line`,{x1:`12`,x2:`12.01`,y1:`16`,y2:`16`,key:`4dfq90`}]]),df=X(`CircleCheck`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),ff=X(`CircleHelp`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3`,key:`1u773s`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),pf=X(`CircleSlash`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`9`,x2:`15`,y1:`15`,y2:`9`,key:`1dfufj`}]]),mf=X(`CircleX`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m15 9-6 6`,key:`1uzhvr`}],[`path`,{d:`m9 9 6 6`,key:`z0biqf`}]]),hf=X(`Circle`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]),gf=X(`Download`,[[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}],[`polyline`,{points:`7 10 12 15 17 10`,key:`2ggqvy`}],[`line`,{x1:`12`,x2:`12`,y1:`15`,y2:`3`,key:`1vk2je`}]]),_f=X(`EllipsisVertical`,[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`12`,cy:`5`,r:`1`,key:`gxeob9`}],[`circle`,{cx:`12`,cy:`19`,r:`1`,key:`lyex9k`}]]),vf=X(`Flag`,[[`path`,{d:`M4 15s1-1 4-1 5 2 8 2 4-1 4-1V3s-1 1-4 1-5-2-8-2-4 1-4 1z`,key:`i9b6wo`}],[`line`,{x1:`4`,x2:`4`,y1:`22`,y2:`15`,key:`1cm3nv`}]]),yf=X(`GitBranch`,[[`line`,{x1:`6`,x2:`6`,y1:`3`,y2:`15`,key:`17qcm7`}],[`circle`,{cx:`18`,cy:`6`,r:`3`,key:`1h7g24`}],[`circle`,{cx:`6`,cy:`18`,r:`3`,key:`fqmcym`}],[`path`,{d:`M18 9a9 9 0 0 1-9 9`,key:`n2h4wq`}]]),bf=X(`House`,[[`path`,{d:`M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8`,key:`5wwlr5`}],[`path`,{d:`M3 10a2 2 0 0 1 .709-1.528l7-5.999a2 2 0 0 1 2.582 0l7 5.999A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z`,key:`1d0kgt`}]]),xf=X(`Inbox`,[[`polyline`,{points:`22 12 16 12 14 15 10 15 8 12 2 12`,key:`o97t9d`}],[`path`,{d:`M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z`,key:`oot6mr`}]]),Sf=X(`Keyboard`,[[`path`,{d:`M10 8h.01`,key:`1r9ogq`}],[`path`,{d:`M12 12h.01`,key:`1mp3jc`}],[`path`,{d:`M14 8h.01`,key:`1primd`}],[`path`,{d:`M16 12h.01`,key:`1l6xoz`}],[`path`,{d:`M18 8h.01`,key:`emo2bl`}],[`path`,{d:`M6 8h.01`,key:`x9i8wu`}],[`path`,{d:`M7 16h10`,key:`wp8him`}],[`path`,{d:`M8 12h.01`,key:`czm47f`}],[`rect`,{width:`20`,height:`16`,x:`2`,y:`4`,rx:`2`,key:`18n3k1`}]]),Cf=X(`LayoutGrid`,[[`rect`,{width:`7`,height:`7`,x:`3`,y:`3`,rx:`1`,key:`1g98yp`}],[`rect`,{width:`7`,height:`7`,x:`14`,y:`3`,rx:`1`,key:`6d4xhi`}],[`rect`,{width:`7`,height:`7`,x:`14`,y:`14`,rx:`1`,key:`nxv5o0`}],[`rect`,{width:`7`,height:`7`,x:`3`,y:`14`,rx:`1`,key:`1bb6yr`}]]),wf=X(`LoaderCircle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),Tf=X(`Loader`,[[`path`,{d:`M12 2v4`,key:`3427ic`}],[`path`,{d:`m16.2 7.8 2.9-2.9`,key:`r700ao`}],[`path`,{d:`M18 12h4`,key:`wj9ykh`}],[`path`,{d:`m16.2 16.2 2.9 2.9`,key:`1bxg5t`}],[`path`,{d:`M12 18v4`,key:`jadmvz`}],[`path`,{d:`m4.9 19.1 2.9-2.9`,key:`bwix9q`}],[`path`,{d:`M2 12h4`,key:`j09sii`}],[`path`,{d:`m4.9 4.9 2.9 2.9`,key:`giyufr`}]]),Ef=X(`MessagesSquare`,[[`path`,{d:`M14 9a2 2 0 0 1-2 2H6l-4 4V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2z`,key:`p1xzt8`}],[`path`,{d:`M18 9h2a2 2 0 0 1 2 2v11l-4-4h-6a2 2 0 0 1-2-2v-1`,key:`1cx29u`}]]),Df=X(`Network`,[[`rect`,{x:`16`,y:`16`,width:`6`,height:`6`,rx:`1`,key:`4q2zg0`}],[`rect`,{x:`2`,y:`16`,width:`6`,height:`6`,rx:`1`,key:`8cvhb9`}],[`rect`,{x:`9`,y:`2`,width:`6`,height:`6`,rx:`1`,key:`1egb70`}],[`path`,{d:`M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3`,key:`1jsf9p`}],[`path`,{d:`M12 12V8`,key:`2874zd`}]]),Of=X(`Plus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]),kf=X(`RefreshCw`,[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]),Af=X(`Search`,[[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}],[`path`,{d:`m21 21-4.3-4.3`,key:`1qie3q`}]]),jf=X(`Settings`,[[`path`,{d:`M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z`,key:`1qme2f`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),Mf=X(`ShieldCheck`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),Nf=X(`TriangleAlert`,[[`path`,{d:`m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3`,key:`wmoenq`}],[`path`,{d:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),Pf=X(`X`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]);function Ff(){let e=new Map;return{run(t,n){let r=e.get(t);if(r!==void 0)return r;let i=n().finally(()=>{e.get(t)===i&&e.delete(t)});return e.set(t,i),i},get pending(){return e.size}}}var If=Ff(),Lf=`crtr:relay-token`;function Rf(){try{let e=window.localStorage.getItem(Lf);return e!==null&&e!==``?e:void 0}catch{return}}function zf(){let e;try{let t=new URLSearchParams(window.location.search).get(`token`);e=t!==null&&t!==``?t:void 0}catch{e=void 0}if(e!==void 0){try{window.localStorage.setItem(Lf,e)}catch{}return e}return Rf()}var Bf=zf();async function Vf(e,t){try{let n={"content-type":`application/json`};Bf!==void 0&&(n.authorization=`Bearer ${Bf}`);let r=await fetch(`/__crtr/source`,{method:`POST`,headers:n,body:JSON.stringify(e),...t===void 0?{}:{signal:t}});return r.ok?await r.json():{ok:!1,stdout:``,stderr:`bridge ${r.status} ${r.statusText}`}}catch(e){return t?.aborted===!0||e instanceof DOMException&&e.name===`AbortError`?{ok:!1,stdout:``,stderr:`aborted`}:{ok:!1,stdout:``,stderr:e instanceof Error?e.message:String(e)}}}async function Hf(e,t,n){return Vf({kind:`exec`,bin:`crtr`,args:e,...t===void 0?{}:{stdin:t}},n)}var Uf=class extends Error{code;constructor(e,t){super(t),this.name=`CommandError`,this.code=e}};function Wf(e){let t=e.stdout.trim();if(t===``)return null;try{let e=JSON.parse(t);if(e&&typeof e==`object`&&typeof e.error==`string`&&typeof e.message==`string`)return{code:e.error,message:e.message}}catch{}return null}async function Gf(e,t,n){let r=await Hf(e,t,n);if(!r.ok)throw new Uf(`bridge`,r.stderr||`bridge request failed`);let i=Wf(r);if(i!==null)throw new Uf(i.code,i.message);if(r.exitCode!==void 0&&r.exitCode!==0){let t=r.stderr.trim()===``?r.stdout.trim():r.stderr;throw new Uf(`bridge`,t===``?`crtr ${e.join(` `)} failed (${r.exitCode})`:t)}if(r.stdout.trim()!==``)try{return JSON.parse(r.stdout)}catch(e){throw new Uf(`bridge`,e instanceof Error?e.message:String(e))}}function Kf(){return If.run(`canvas:snapshot`,()=>Gf([`canvas`,`snapshot`,`--json`]))}function qf(e){return If.run(`node:inspect:${e}`,()=>Gf([`node`,`inspect`,`show`,e,`--json`]).then(e=>e.node))}function Jf(e){return If.run(`node:snapshot:${e}`,()=>Gf([`node`,`inspect`,`snapshot`,e,`--json`]))}function Yf(e){let t=[`node`,`new`,`--kind`,e.kind];return e.mode&&t.push(`--mode`,e.mode),e.root&&t.push(`--root`),e.cwd?.trim()&&t.push(`--cwd`,e.cwd.trim()),e.name?.trim()&&t.push(`--name`,e.name.trim()),e.model?.trim()&&t.push(`--model`,e.model.trim()),e.parent?.trim()&&t.push(`--parent`,e.parent.trim()),t.push(`--json`),Gf(t,e.prompt)}function Xf(e,t){let n=[`node`,`msg`,`--to`,e];return t.tier?.trim()&&n.push(`--tier`,t.tier.trim()),n.push(`--json`),Gf(n,t.body)}function Zf(e,t={}){let n=[`node`,`lifecycle`,`revive`,e];return t.fresh&&n.push(`--fresh`),n.push(`--json`),Gf(n)}function Qf(e){return Gf([`node`,`lifecycle`,`close`,`--node`,e,`--json`])}async function $f(e,t){let n=await Vf({kind:`file`,path:t});if(!n.ok)throw new Uf(`bridge`,n.stderr||`failed to read ${t}`);return{path:t,content:n.stdout,truncated:!1}}var ep=new Set,tp=!1;function np(){if(tp)return;tp=!0;let e;try{let t=new URL(`/__crtr/events`,window.location.href);Bf!==void 0&&t.searchParams.set(`token`,Bf),e=new EventSource(t.toString())}catch{tp=!1;return}e.onmessage=e=>{let t;try{t=JSON.parse(e.data).kind}catch{return}if(t!==void 0)for(let e of ep)e.kinds.includes(t)&&e.refresh()}}function rp(e,t){let n=(0,v.useRef)(t);n.current=t,(0,v.useEffect)(()=>{np();let t={kinds:e,refresh:()=>n.current()};return ep.add(t),()=>{ep.delete(t)}},[e.join(`,`)])}var ip=e=>{let t,n=new Set,r=(e,r)=>{let i=typeof e==`function`?e(t):e;if(!Object.is(i,t)){let e=t;t=r??(typeof i!=`object`||!i)?i:Object.assign({},t,i),n.forEach(n=>n(t,e))}},i=()=>t,a={setState:r,getState:i,getInitialState:()=>o,subscribe:e=>(n.add(e),()=>n.delete(e))},o=t=e(r,i,a);return a},ap=(e=>e?ip(e):ip),op=e=>e;function sp(e,t=op){let n=v.useSyncExternalStore(e.subscribe,v.useCallback(()=>t(e.getState()),[e,t]),v.useCallback(()=>t(e.getInitialState()),[e,t]));return v.useDebugValue(n),n}var cp=e=>{let t=ap(e),n=e=>sp(t,e);return Object.assign(n,t),n},lp=(e=>e?cp(e):cp),up=lp(e=>({reachable:!0,setReachable:t=>e({reachable:t})})),dp=1,fp=`crtr.web.roster.v1`;function pp(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function mp(e){return typeof e==`string`}function hp(e){return typeof e==`number`}function gp(e){return pp(e)?mp(e.node_id)&&mp(e.name)&&mp(e.kind)&&(e.mode===`base`||e.mode===`orchestrator`)&&(e.lifecycle===`terminal`||e.lifecycle===`resident`)&&(e.status===`active`||e.status===`idle`||e.status===`done`||e.status===`dead`||e.status===`canceled`)&&mp(e.cwd)&&(e.parent===null||mp(e.parent))&&mp(e.created)&&(e.host_kind===`broker`||e.host_kind===`tmux`)&&typeof e.enterable==`boolean`&&hp(e.attention_count)&&(e.cycles===void 0||hp(e.cycles))&&(e.last_activity===void 0||mp(e.last_activity)):!1}function _p(e){return pp(e)?e.schemaVersion===dp&&mp(e.generatedAt)&&hp(e.cachedAt)&&Array.isArray(e.nodes)&&e.nodes.every(gp):!1}function vp(){try{let e=globalThis.localStorage?.getItem(fp);if(e==null)return null;let t=JSON.parse(e);return _p(t)?t:null}catch{return null}}function yp(e,t){let n={schemaVersion:dp,nodes:e,generatedAt:t,cachedAt:Date.now()};try{globalThis.localStorage?.setItem(fp,JSON.stringify(n))}catch{}}var bp=3e4,xp=new class{state;listeners=new Set;started=!1;timer=null;constructor(){let e=vp();this.state=e?{nodes:e.nodes,generatedAt:e.generatedAt,loading:!1}:{nodes:[],generatedAt:null,loading:!0}}subscribe=e=>(this.ensureStarted(),this.listeners.add(e),()=>{this.listeners.delete(e)});getState=()=>this.state;refetch=()=>{this.load()};ensureStarted(){if(this.started)return;this.started=!0,this.load(),this.timer=setInterval(()=>void this.load(),bp);let e=()=>{document.visibilityState===`visible`&&this.load()};document.addEventListener(`visibilitychange`,e),window.addEventListener(`focus`,e)}setState(e){this.state=e;for(let e of this.listeners)e()}async load(){try{let e=await Kf();this.setState({nodes:e.nodes,generatedAt:e.generated_at,loading:!1}),yp(e.nodes,e.generated_at),up.getState().setReachable(!0)}catch{this.state.loading&&this.setState({...this.state,loading:!1}),up.getState().setReachable(!1)}}};function Sp(){let e=(0,v.useSyncExternalStore)(xp.subscribe,xp.getState);return rp([`nodes`,`inbox`],xp.refetch),e}var Cp=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,wp=td,Tp=(e,t)=>n=>{if(t?.variants==null)return wp(e,n?.class,n?.className);let{variants:r,defaultVariants:i}=t,a=Object.keys(r).map(e=>{let t=n?.[e],a=i?.[e];if(t===null)return null;let o=Cp(t)||Cp(a);return r[e][o]}),o=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return r===void 0||(e[n]=r),e},{});return wp(e,a,t?.compoundVariants?.reduce((e,t)=>{let{class:n,className:r,...a}=t;return Object.entries(a).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...i,...o}[t]):{...i,...o}[t]===n})?[...e,n,r]:e},[]),n?.class,n?.className)},Ep=Tp(`btn justify-center transition-all outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,{variants:{variant:{default:`primary`,destructive:`danger`,outline:``,secondary:``,ghost:`border-transparent`,link:`border-transparent bg-transparent text-primary underline-offset-4 hover:underline hover:bg-transparent`},size:{default:``,xs:`sm gap-1 text-xs [&_svg:not([class*='size-'])]:size-3`,sm:`sm`,lg:`px-6 py-2.5`,icon:`p-0 size-9`,"icon-xs":`p-0 size-6 [&_svg:not([class*='size-'])]:size-3`,"icon-sm":`p-0 size-8`,"icon-lg":`p-0 size-10`}},defaultVariants:{variant:`default`,size:`default`}});function Z({className:e,variant:t=`default`,size:n=`default`,asChild:r=!1,...i}){return(0,B.jsx)(r?$n:`button`,{"data-slot":`button`,"data-variant":t,"data-size":n,className:Y(Ep({variant:t,size:n,className:e})),...i})}function Dp({...e}){return(0,B.jsx)(Ga,{"data-slot":`dialog`,...e})}function Op({...e}){return(0,B.jsx)(Za,{"data-slot":`dialog-portal`,...e})}function kp({className:e,...t}){return(0,B.jsx)($a,{"data-slot":`dialog-overlay`,className:Y(`fixed inset-0 z-50 bg-black/50 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0`,e),...t})}function Ap({className:e,children:t,showCloseButton:n=!0,...r}){return(0,B.jsxs)(Op,{"data-slot":`dialog-portal`,children:[(0,B.jsx)(kp,{}),(0,B.jsxs)(ro,{"data-slot":`dialog-content`,className:Y(`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 bg-background p-6 duration-200 outline-none data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 sm:max-w-lg`,e),...r,children:[t,n&&(0,B.jsxs)(fo,{"data-slot":`dialog-close`,className:`absolute top-4 right-4 rounded-xs opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:ring-2 focus:ring-ring focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,children:[(0,B.jsx)(Pf,{}),(0,B.jsx)(`span`,{className:`sr-only`,children:`Close`})]})]})]})}function jp({className:e,...t}){return(0,B.jsx)(`div`,{"data-slot":`dialog-header`,className:Y(`flex flex-col gap-2 text-center sm:text-left`,e),...t})}function Mp({className:e,showCloseButton:t=!1,children:n,...r}){return(0,B.jsxs)(`div`,{"data-slot":`dialog-footer`,className:Y(`flex flex-col-reverse gap-2 sm:flex-row sm:justify-end`,e),...r,children:[n,t&&(0,B.jsx)(fo,{asChild:!0,children:(0,B.jsx)(Z,{variant:`outline`,children:`Close`})})]})}function Np({className:e,...t}){return(0,B.jsx)(co,{"data-slot":`dialog-title`,className:Y(`text-lg leading-none font-semibold`,e),...t})}function Pp({className:e,...t}){return(0,B.jsx)(U,{"data-slot":`dialog-description`,className:Y(`text-sm text-muted-foreground`,e),...t})}function Fp({className:e,type:t,...n}){return(0,B.jsx)(`input`,{type:t,"data-slot":`input`,className:Y(`h-9 w-full min-w-0 rounded-md border border-[var(--line)] bg-[oklch(0_0_0/0.25)] px-3 py-1 text-sm text-[var(--ink)] transition-[color,box-shadow] outline-none selection:bg-primary selection:text-primary-foreground file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-[var(--dim)] disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50`,`focus-visible:border-[var(--line2)] focus-visible:ring-[3px] focus-visible:ring-ring/40`,`aria-invalid:border-destructive aria-invalid:ring-destructive/20`,e),...n})}function Ip({className:e,...t}){return(0,B.jsx)(tl,{"data-slot":`label`,className:Y(`flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50`,e),...t})}function Lp({...e}){return(0,B.jsx)(vl,{"data-slot":`select`,...e})}function Rp({...e}){return(0,B.jsx)(Sl,{"data-slot":`select-value`,...e})}function zp({className:e,size:t=`default`,children:n,...r}){return(0,B.jsxs)(bl,{"data-slot":`select-trigger`,"data-size":t,className:Y(`flex w-fit items-center justify-between gap-2 rounded-md border border-[var(--line)] bg-[oklch(0.92_0.008_80/0.02)] px-3 py-2 font-mono text-sm text-[var(--ink2)] whitespace-nowrap transition-[color,box-shadow] outline-none cursor-pointer focus-visible:border-[var(--line2)] focus-visible:ring-[3px] focus-visible:ring-ring/40 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-[placeholder]:text-[var(--mut)] 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 [&_svg:not([class*='text-'])]:text-[var(--mut)]`,e),...r,children:[n,(0,B.jsx)(wl,{asChild:!0,children:(0,B.jsx)(of,{className:`size-4 opacity-50`})})]})}function Bp({className:e,children:t,position:n=`item-aligned`,align:r=`center`,...i}){return(0,B.jsx)(Ol,{children:(0,B.jsxs)(Al,{"data-slot":`select-content`,className:Y(`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 bg-popover text-popover-foreground 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 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95`,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:[(0,B.jsx)(Hp,{}),(0,B.jsx)(Hl,{className:Y(`p-1`,n===`popper`&&`h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1`),children:t}),(0,B.jsx)(Up,{})]})})}function Vp({className:e,children:t,...n}){return(0,B.jsxs)(Ql,{"data-slot":`select-item`,className:Y(`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 focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2`,e),...n,children:[(0,B.jsx)(`span`,{"data-slot":`select-item-indicator`,className:`absolute right-2 flex size-3.5 items-center justify-center`,children:(0,B.jsx)(nu,{children:(0,B.jsx)(af,{className:`size-4`})})}),(0,B.jsx)(eu,{children:t})]})}function Hp({className:e,...t}){return(0,B.jsx)(iu,{"data-slot":`select-scroll-up-button`,className:Y(`flex cursor-default items-center justify-center py-1`,e),...t,children:(0,B.jsx)(lf,{className:`size-4`})})}function Up({className:e,...t}){return(0,B.jsx)(ou,{"data-slot":`select-scroll-down-button`,className:Y(`flex cursor-default items-center justify-center py-1`,e),...t,children:(0,B.jsx)(of,{className:`size-4`})})}function Wp({className:e,...t}){return(0,B.jsx)(`textarea`,{"data-slot":`textarea`,className:Y(`flex field-sizing-content min-h-16 w-full rounded-md border border-[var(--line)] bg-[oklch(0_0_0/0.3)] px-3 py-2 text-sm text-[var(--ink)] transition-[color,box-shadow] outline-none placeholder:text-[var(--dim)] focus-visible:border-[var(--line2)] focus-visible:ring-[3px] focus-visible:ring-ring/40 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20`,e),...t})}var Gp=Tp(`badge w-fit max-w-full overflow-hidden text-[var(--ink2)] whitespace-nowrap [&>svg]:pointer-events-none [&>svg]:size-3`,{variants:{variant:{default:``,secondary:`dead`,destructive:`blocked`,outline:``,ghost:`border-transparent`,link:`border-transparent underline-offset-4 [a&]:hover:underline`}},defaultVariants:{variant:`default`}});function Kp({className:e,variant:t=`default`,asChild:n=!1,...r}){return(0,B.jsx)(n?$n:`span`,{"data-slot":`badge`,"data-variant":t,className:Y(Gp({variant:t}),e),...r})}function qp(e){return e instanceof Uf&&(e.code===`not_found`||e.code===`already_resolved`||e.code===`claimed`)}function Jp(e){let t=e.indexOf(`/.crouter/interactions/`);return t>=0?e.slice(0,t):e}function Yp(e){if(e.trim()===``)return{title:``};let t=e.match(/^\s*#{1,6}\s+(.+?)\s*(?:\n|$)/);return t?{title:t[1],body:e.slice(t[0].length).trim()||void 0}:{title:e.trim(),body:e.trim()}}function Xp(e){switch(e){case`notify`:case`validation`:case`decision`:case`context`:case`error`:return e}throw Error(`Unknown deck kind: ${e}`)}function Zp(e){let{title:t,body:n}=Yp(e.prompt);return{id:e.id,title:t||e.id,body:n,kind:Xp(e.kind),options:e.options.map(e=>({id:e.id,label:e.label,...e.description===void 0?{}:{description:e.description}})),multiSelect:e.multiSelect,allowFreetext:e.allow_freetext}}function Qp(e){return{id:e.id,job_id:e.job_id,kind:Xp(e.kind),title:e.title,blocked_since:e.blocked_since,conversation_id:e.conversation_id,conversation_title:e.conversation_title,asking_node_id:e.asking_node_id,asking_node_name:e.asking_node_name,cwd:Jp(e.dir),interaction_count:e.interaction_count}}function $p(e,t){return{id:e.id,job_id:e.job_id??e.id,kind:Xp(e.kind),title:e.title,blocked_since:e.blocked_since,conversation_id:e.conversation_id,conversation_title:e.conversation_title,asking_node_id:e.asking_node_id,asking_node_name:e.asking_node_name,cwd:t,interaction_count:e.interaction_count,interactions:e.interactions.map(Zp)}}function em(){return If.run(`human:list`,async()=>(await Gf([`human`,`list`,`--json`])).items.map(Qp))}async function tm(e){let t=await Gf([`human`,`deck`,e,`--json`]),n=(await qf(t.asking_node_id)).cwd;return $p(t,n)}async function nm(e,t){let n=JSON.stringify({responses:t.responses}),r=await Gf([`human`,`resolve`,e,`--json`],n);if(r.resolved!==!0)throw new Uf(r.reason===`claimed`?`claimed`:`already_resolved`,r.reason===`claimed`?`That request is already being handled.`:`That request was already handled.`);return{resolved:!0,job_id:r.job_id??e,delivered:r.delivered??!0}}function rm(e){let t=0;for(let n of e)t+=Math.max(0,n.attention_count);return t}function im(){let{nodes:e}=Sp();return rm(e)}function am(){let[e,t]=(0,v.useState)([]),[n,r]=(0,v.useState)(!0),[i,a]=(0,v.useState)(0),o=(0,v.useCallback)(()=>a(e=>e+1),[]);return rp([`inbox`,`nodes`],o),(0,v.useEffect)(()=>{let e=!1;return em().then(n=>{e||(t(n),r(!1))}).catch(()=>{e||r(!1)}),()=>{e=!0}},[i]),{decks:e,loading:n,refetch:o}}function om(e){let{decks:t}=am();return t.filter(t=>t.conversation_id===e)}var sm={notify:{icon:rf,label:`Update`},validation:{icon:Mf,label:`Approval`},decision:{icon:yf,label:`Decision`},context:{icon:ff,label:`Question`},error:{icon:Nf,label:`Problem`}};function cm(e){switch(e){case`notify`:return sm.notify;case`validation`:return sm.validation;case`decision`:return sm.decision;case`context`:return sm.context;case`error`:return sm.error;default:return sm.context}}function lm(e,t=Date.now()){let n=new Date(e).getTime();if(Number.isNaN(n))return``;let r=Math.max(0,Math.round((t-n)/1e3));if(r<60)return`${r}s`;let i=Math.round(r/60);if(i<60)return`${i}m`;let a=Math.round(i/60);return a<24?`${a}h`:`${Math.round(a/24)}d`}var um=1,dm=lp(e=>({toasts:[],push:(t,n=`info`)=>{let r=um++;e(e=>({toasts:[...e.toasts,{id:r,message:t,tone:n}]})),setTimeout(()=>e(e=>({toasts:e.toasts.filter(e=>e.id!==r)})),4e3)},dismiss:t=>e(e=>({toasts:e.toasts.filter(e=>e.id!==t)}))}));function fm(e,t=`info`){dm.getState().push(e,t)}var pm=e=>({"--i":e});async function mm(e,t){let n=(await tm(e)).interactions[0];await nm(e,{responses:[t===`ack`?{id:n.id}:{id:n.id,selectedOptionIds:[(t===`yes`?n.options.find(e=>e.id===`yes`)?.id??n.options[0]?.id:n.options.find(e=>e.id===`no`)?.id??n.options[1]?.id)??t]}]})}function hm(){let{decks:e,loading:t}=am(),n=(0,v.useMemo)(()=>[...e].sort((e,t)=>new Date(t.blocked_since).getTime()-new Date(e.blocked_since).getTime()),[e]);return t||n.length===0?null:(0,B.jsxs)(`section`,{className:`needs rv`,style:pm(3),children:[(0,B.jsxs)(`div`,{className:`needs-head`,children:[(0,B.jsx)(vf,{size:14,className:`flag`,"aria-hidden":!0}),(0,B.jsxs)(`span`,{className:`instlabel`,children:[`Needs you — `,n.length,` blocked`]}),(0,B.jsx)(`div`,{className:`rule`})]}),(0,B.jsx)(`div`,{className:`needs-grid`,children:n.map(e=>(0,B.jsx)(gm,{deck:e},e.id))})]})}function gm({deck:e}){let t=ut(),{refetch:n}=am(),[r,i]=(0,v.useState)(!1),[a,o]=(0,v.useState)(null),[s,c]=(0,v.useState)(!1),l=cm(e.kind).label,u=lm(e.blocked_since);e.kind===`decision`&&a===null&&!s&&(async()=>{if(!(e.kind!==`decision`||s||a!==null)){c(!0);try{let t=(await tm(e.job_id)).interactions[0]?.options??[];o(t.length<=3?t:[])}catch(e){qp(e)?(o([]),n()):(console.error(`[needs-you] failed to load decision options:`,e),o([]))}finally{c(!1)}}})();let d=async t=>{if(!r){i(!0);try{await mm(e.job_id,t),fm(`Done — thanks!`,`success`),n()}catch(e){if(qp(e)){fm(e instanceof Error?e.message:`That request was already handled.`),n();return}console.error(`[needs-you] resolve failed:`,e),fm(`Something went wrong — try again.`)}finally{i(!1)}}},f=async t=>{if(!r){i(!0);try{let r=(await tm(e.job_id)).interactions[0];await nm(e.job_id,{responses:[{id:r.id,selectedOptionIds:[t]}]}),fm(`Done — thanks!`,`success`),n()}catch(e){if(qp(e)){fm(e instanceof Error?e.message:`That request was already handled.`),n();return}console.error(`[needs-you] decision option resolve failed:`,e),fm(`Something went wrong — try again.`)}finally{i(!1)}}},p=e.kind===`decision`&&a!==null&&a.length>0;return(0,B.jsxs)(`div`,{className:`deck`,children:[(0,B.jsxs)(`div`,{className:`deck-meta`,children:[(0,B.jsx)(`span`,{className:`deck-kind`,children:l}),(0,B.jsx)(`span`,{className:`from`,children:e.asking_node_name}),(0,B.jsxs)(`span`,{className:`age`,children:[`blocked `,u]})]}),(0,B.jsx)(`p`,{className:`deck-q line-clamp-2`,children:e.title}),(0,B.jsxs)(`div`,{className:`deck-actions`,children:[e.kind===`notify`&&(0,B.jsx)(Z,{type:`button`,variant:`outline`,size:`sm`,disabled:r,onClick:()=>void d(`ack`),children:`Got it`}),e.kind===`validation`&&(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(Z,{type:`button`,size:`sm`,disabled:r,onClick:()=>void d(`yes`),children:`Approve`}),(0,B.jsx)(Z,{type:`button`,variant:`outline`,size:`sm`,disabled:r,onClick:()=>void d(`no`),children:`Reject`})]}),p&&a.map(e=>(0,B.jsx)(Z,{type:`button`,variant:`outline`,size:`sm`,disabled:r,onClick:()=>void f(e.id),children:e.label},e.id)),(0,B.jsxs)(Z,{type:`button`,variant:`ghost`,size:`sm`,disabled:r,onClick:()=>t(`/inbox/${encodeURIComponent(e.job_id)}`),style:{marginLeft:`auto`,color:`var(--dim)`},children:[`open thread `,(0,B.jsx)(nf,{"aria-hidden":!0})]})]})]})}var _m=e=>({"--i":e}),vm=`hosted in a tmux pane — open it in your terminal`;function ym(e){let t=new Map;for(let n of e)t.set(n.node_id,{node:n,children:[]});let n=[];for(let e of t.values()){let r=e.node.parent,i=r?t.get(r):void 0;i?i.children.push(e):n.push(e)}return n}var bm=[`active`,`idle`,`done`,`dead`,`canceled`],xm={query:``,status:`all`,blockedOnly:!1};function Sm(e){return e.query.trim()!==``||e.status!==`all`||e.blockedOnly}function Cm(e,t){if(t.status!==`all`&&e.status!==t.status||t.blockedOnly&&e.attention_count<=0)return!1;let n=t.query.trim().toLowerCase();return!(n&&!`${e.name} ${e.kind} ${e.mode} ${e.cwd} ${e.node_id} ${e.status}`.toLowerCase().includes(n))}function wm(e,t){if(!Sm(t))return e;let n=new Map(e.map(e=>[e.node_id,e])),r=new Set;for(let i of e){if(!Cm(i,t))continue;let e=i;for(;e&&!r.has(e.node_id);)r.add(e.node_id),e=e.parent?n.get(e.parent):void 0}return e.filter(e=>r.has(e.node_id))}var Tm=new Set([`dead`,`canceled`]);function Em(e){return Tm.has(e.node.status)&&e.children.every(Em)}function Dm(e){return 1+e.children.reduce((e,t)=>e+Dm(t),0)}var Om=3,km={active:hf,idle:hf,done:df,dead:pf,canceled:mf};function Am(e,t){return t?uf:km[e]??hf}function jm(e){return e.toLocaleTimeString(`en-GB`,{hour12:!1})}function Mm(){let[e,t]=(0,v.useState)(()=>jm(new Date));return(0,v.useEffect)(()=>{let e=setInterval(()=>t(jm(new Date)),1e3);return()=>clearInterval(e)},[]),e}function Nm(){let{nodes:e}=Sp(),[t,n]=(0,v.useState)(!1),[r,i]=(0,v.useState)(0),[a,o]=(0,v.useState)(xm),s=(0,v.useRef)(null),c=Mm(),l=e.filter(e=>e.status===`active`).length,u=(0,v.useMemo)(()=>ym(wm(e,a)),[e,a]);return(0,v.useEffect)(()=>{let e=e=>{if(e.key!==`/`||e.metaKey||e.ctrlKey||e.altKey)return;let t=document.activeElement;t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement||t instanceof HTMLElement&&t.isContentEditable||(e.preventDefault(),s.current?.focus())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[]),(0,B.jsxs)(`div`,{className:`in relative z-[1] h-full min-h-0 overflow-auto`,style:{padding:`34px 44px 44px`},children:[(0,B.jsxs)(`div`,{className:`rv flex items-baseline gap-4`,style:_m(1),children:[(0,B.jsx)(`h1`,{className:`text-2xl`,style:{fontWeight:420,letterSpacing:`-0.01em`,fontVariationSettings:`"opsz" 60`,color:`var(--ink)`},children:`Canvas`}),(0,B.jsxs)(`span`,{className:`text-sm`,style:{color:`var(--mut)`},children:[e.length,` `,e.length===1?`node`:`nodes`,l>0&&` · ${l} active`]}),(0,B.jsxs)(`div`,{className:`font-inst text-xs flex items-center gap-2`,style:{marginLeft:`auto`,color:`var(--ink2)`,letterSpacing:`0.1em`},children:[(0,B.jsx)(`span`,{style:{width:`8px`,height:`8px`,borderRadius:`50%`,background:`var(--act)`,animation:`pulse 2.4s ease-out infinite`}}),(0,B.jsx)(`span`,{children:c})]})]}),(0,B.jsxs)(`div`,{className:`rv flex items-center gap-2.5`,style:{margin:`20px 0 22px`,..._m(2)},children:[(0,B.jsxs)(`div`,{className:`search`,children:[(0,B.jsx)(Af,{size:14,className:`opacity-70`,"aria-hidden":!0}),(0,B.jsx)(`input`,{ref:s,value:a.query,onChange:e=>o(t=>({...t,query:e.currentTarget.value})),onKeyDown:e=>{e.key===`Escape`&&(o(e=>({...e,query:``})),e.currentTarget.blur())},placeholder:`Search name, kind, mode, cwd, id…`,"aria-label":`Search nodes`,className:`min-w-0 flex-1 border-0 bg-transparent p-0 text-sm outline-none`,style:{color:`var(--ink)`}}),(0,B.jsx)(`span`,{className:`kbd`,children:`/`})]}),(0,B.jsxs)(`label`,{className:`selectish`,children:[(0,B.jsxs)(`select`,{value:a.status,onChange:e=>o(t=>({...t,status:e.currentTarget.value})),"aria-label":`Filter by status`,className:`cursor-pointer appearance-none border-0 bg-transparent text-sm outline-none`,style:{color:`var(--ink2)`},children:[(0,B.jsx)(`option`,{value:`all`,children:`all statuses`}),bm.map(e=>(0,B.jsx)(`option`,{value:e,children:e},e))]}),(0,B.jsx)(`span`,{className:`car`,children:`▾`})]}),(0,B.jsxs)(`label`,{className:`checkish select-none`,children:[(0,B.jsx)(`span`,{className:`box`,style:a.blockedOnly?{background:`var(--blk)`,borderColor:`var(--blk)`}:void 0}),`blocked`,(0,B.jsx)(`input`,{type:`checkbox`,checked:a.blockedOnly,onChange:e=>o(t=>({...t,blockedOnly:e.currentTarget.checked})),className:`sr-only`})]}),(0,B.jsx)(`button`,{type:`button`,className:`btn primary`,style:{marginLeft:`auto`},onClick:()=>{i(e=>e+1),n(!0)},children:`+ Spawn a node`})]}),(0,B.jsx)(hm,{}),(0,B.jsxs)(`div`,{className:`panel rv`,style:{padding:`6px 0`,..._m(4)},children:[(0,B.jsxs)(`div`,{className:`flex items-center`,style:{padding:`10px 18px 9px`,borderBottom:`1px solid var(--line)`},children:[(0,B.jsx)(`span`,{className:`instlabel`,style:{color:`var(--dim)`},children:`Node forest`}),(0,B.jsx)(`span`,{className:`font-inst text-xs`,style:{marginLeft:`auto`,color:`var(--dim)`,letterSpacing:`0.1em`},children:`sorted · activity`})]}),(0,B.jsx)(`div`,{className:`tree`,children:e.length===0?(0,B.jsx)(`p`,{className:`px-3 py-2 text-sm italic`,style:{color:`var(--mut)`},children:`No nodes on the canvas yet.`}):u.length===0?(0,B.jsx)(`p`,{className:`px-3 py-2 text-sm italic`,style:{color:`var(--mut)`},children:`No matching nodes.`}):u.map(e=>(0,B.jsx)(Pm,{node:e},e.node.node_id))})]}),(0,B.jsx)(Im,{open:t,onClose:()=>n(!1)},r)]})}function Pm({node:e}){let t=ut(),[n,r]=(0,v.useState)(!1),i=e.node,a=i.attention_count>0,o=Tm.has(i.status),s=a?`blocked`:i.status,c=e.children.filter(e=>!Em(e)),l=e.children.filter(e=>Em(e)),u=l.reduce((e,t)=>e+Dm(t),0),d=u>=Om,f=d?c:e.children,p=()=>{i.enterable&&t(`/nodes/${encodeURIComponent(i.node_id)}`)};return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`div`,{className:Y(`node-row s-${s}`,o&&`dimmed`),onClick:p,role:i.enterable?`button`:void 0,tabIndex:i.enterable?0:void 0,style:i.enterable?void 0:{cursor:`default`},onKeyDown:e=>{i.enterable&&(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),p())},children:[(0,B.jsxs)(`div`,{className:`node-id`,children:[(0,B.jsxs)(`div`,{className:`node-l1`,children:[(0,B.jsx)(`span`,{className:`node-name`,children:i.name}),(0,B.jsxs)(`span`,{className:`node-kind`,children:[i.kind,` · `,i.mode]})]}),(0,B.jsxs)(`div`,{className:`node-l2`,children:[(0,B.jsx)(`span`,{className:`node-cwd`,title:i.cwd,children:i.cwd}),i.lifecycle&&(0,B.jsx)(`span`,{className:`node-life`,children:i.lifecycle}),!i.enterable&&(0,B.jsx)(`span`,{className:`node-note`,children:vm})]})]}),(0,B.jsxs)(`div`,{className:`node-right`,children:[a&&(0,B.jsxs)(`span`,{className:`waitflag`,children:[(0,B.jsx)(vf,{size:14,"aria-hidden":!0}),` `,i.attention_count,` waiting on human`]}),(0,B.jsx)(Fm,{status:i.status,blocked:a})]})]}),(f.length>0||d&&u>0)&&(0,B.jsxs)(`div`,{className:`kids`,children:[f.map(e=>(0,B.jsx)(Pm,{node:e},e.node.node_id)),d&&(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`button`,{type:`button`,onClick:()=>r(e=>!e),className:`flex items-center gap-1.5 px-4 py-2 text-xs transition-colors`,style:{color:`var(--dim)`},children:[(0,B.jsx)(cf,{size:14,"aria-hidden":!0,style:{transform:n?`rotate(90deg)`:`none`,transition:`transform 0.15s ease`}}),n?`Hide ${u} closed`:`Show ${u} closed`]}),n&&l.map(e=>(0,B.jsx)(Pm,{node:e},e.node.node_id))]})]})]})}function Fm({status:e,blocked:t}){let n=Am(e,t);return(0,B.jsxs)(Kp,{variant:`outline`,className:t?`blocked`:e,children:[(0,B.jsx)(n,{"aria-hidden":!0}),e]})}function Im({open:e,onClose:t}){let[n,r]=(0,v.useState)(``),[i,a]=(0,v.useState)(`developer`),[o,s]=(0,v.useState)(``),[c,l]=(0,v.useState)(!1),[u,d]=(0,v.useState)(``),[f,p]=(0,v.useState)(``),[m,h]=(0,v.useState)(``),[g,_]=(0,v.useState)(``),[y,b]=(0,v.useState)(!1),[x,S]=(0,v.useState)(null);return(0,B.jsx)(Dp,{open:e,onOpenChange:e=>!e&&t(),children:(0,B.jsxs)(Ap,{className:`max-w-md overflow-y-auto max-h-[90dvh]`,children:[(0,B.jsx)(jp,{children:(0,B.jsx)(Np,{children:`Spawn a node`})}),(0,B.jsxs)(`form`,{id:`spawn-form`,onSubmit:async e=>{if(e.preventDefault(),!n.trim()||!i.trim()){S(`prompt and kind are required`);return}b(!0),S(null);let r={prompt:n.trim(),kind:i.trim(),...o?{mode:o}:{},...c?{root:!0}:{},...u.trim()?{cwd:u.trim()}:{},...f.trim()?{name:f.trim()}:{},...m.trim()?{model:m.trim()}:{},...g.trim()?{parent:g.trim()}:{}};try{await Yf(r),t()}catch(e){console.error(`[spawn] failed:`,e),S(e instanceof Uf?`${e.code}: ${e.message}`:String(e))}finally{b(!1)}},className:`flex flex-col gap-3.5`,children:[(0,B.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,B.jsx)(Ip,{htmlFor:`spawn-prompt`,children:`Prompt`}),(0,B.jsx)(Wp,{id:`spawn-prompt`,value:n,onChange:e=>r(e.currentTarget.value),rows:4,required:!0,className:`resize-none`})]}),(0,B.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,B.jsx)(Ip,{htmlFor:`spawn-kind`,children:`Kind`}),(0,B.jsx)(Fp,{id:`spawn-kind`,value:i,onChange:e=>a(e.currentTarget.value),required:!0})]}),(0,B.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,B.jsx)(Ip,{htmlFor:`spawn-mode`,children:`Mode`}),(0,B.jsxs)(Lp,{value:o===``?`__none__`:o,onValueChange:e=>s(e===`__none__`?``:e),children:[(0,B.jsx)(zp,{id:`spawn-mode`,className:`w-full`,children:(0,B.jsx)(Rp,{})}),(0,B.jsxs)(Bp,{children:[(0,B.jsx)(Vp,{value:`__none__`,children:`(default)`}),(0,B.jsx)(Vp,{value:`base`,children:`base`}),(0,B.jsx)(Vp,{value:`orchestrator`,children:`orchestrator`})]})]})]}),(0,B.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,B.jsx)(`input`,{type:`checkbox`,id:`spawn-root`,checked:c,onChange:e=>l(e.currentTarget.checked),className:`size-4 rounded-none border border-input accent-primary`}),(0,B.jsx)(Ip,{htmlFor:`spawn-root`,className:`cursor-pointer`,children:`Resident root node`})]}),(0,B.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,B.jsx)(Ip,{htmlFor:`spawn-cwd`,children:`cwd`}),(0,B.jsx)(Fp,{id:`spawn-cwd`,value:u,onChange:e=>d(e.currentTarget.value),placeholder:`(inherit)`,className:`font-mono text-sm`})]}),(0,B.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,B.jsx)(Ip,{htmlFor:`spawn-name`,children:`Name`}),(0,B.jsx)(Fp,{id:`spawn-name`,value:f,onChange:e=>p(e.currentTarget.value),placeholder:`(auto)`})]}),(0,B.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,B.jsx)(Ip,{htmlFor:`spawn-model`,children:`Model`}),(0,B.jsx)(Fp,{id:`spawn-model`,value:m,onChange:e=>h(e.currentTarget.value),placeholder:`(default)`})]}),(0,B.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,B.jsx)(Ip,{htmlFor:`spawn-parent`,children:`Parent node id`}),(0,B.jsx)(Fp,{id:`spawn-parent`,value:g,onChange:e=>_(e.currentTarget.value),placeholder:`(this canvas root)`,className:`font-mono text-sm`})]}),x&&(0,B.jsx)(`p`,{className:`text-sm text-destructive`,children:x})]}),(0,B.jsxs)(Mp,{children:[(0,B.jsx)(Z,{type:`button`,variant:`outline`,onClick:t,disabled:y,children:`Cancel`}),(0,B.jsx)(Z,{type:`submit`,form:`spawn-form`,disabled:y,children:y?`Spawning…`:`Spawn`})]})]})})}function Lm(e){if(!e)return``;let t=e.replace(/\/+$/,``).split(`/`);return t[t.length-1]??``}function Rm(e){let t=e.name?.trim();if(t&&t!==e.kind)return t;let n=Lm(e.cwd);return n?`${e.kind} · ${n}`:e.kind}function zm(e){return e.parent===null&&e.host_kind===`broker`}function Bm(e){let t=new Map;for(let n of e){if(n.parent===null)continue;let e=t.get(n.parent);e?e.push(n):t.set(n.parent,[n])}return t}function Vm(e,t){let n=[],r=new Set,i=[e];for(;i.length>0;){let e=i.pop();if(r.has(e.node_id))continue;r.add(e.node_id),n.push(e);let a=t.get(e.node_id);if(a)for(let e of a)i.push(e)}return n}function Hm(e){return e===`done`||e===`dead`||e===`canceled`}function Um(e){return e.attention_count>0?`blocked`:e.status}function Wm(e,t,n){return t>0?`needs-you`:e.status===`active`||n>0?`active`:Hm(e.status)?`done`:`idle`}function Gm(e){switch(e){case`needs-you`:return 0;case`active`:return 1;case`idle`:return 2;case`done`:return 3}}function Km(e){let t=Bm(e),n=[];for(let r of e){if(!zm(r))continue;let e=Vm(r,t),i=0,a=0;for(let t of e)i+=Math.max(0,t.attention_count),t.node_id!==r.node_id&&t.status===`active`&&(a+=1);n.push({id:r.node_id,title:Rm(r),state:Wm(r,i,a),attention:i,activeChildren:a,nodeCount:e.length,...r.cycles===void 0?{}:{cycles:r.cycles},lastActivity:r.last_activity??r.created})}return n.sort((e,t)=>{let n=Gm(e.state)-Gm(t.state);return n===0?t.lastActivity.localeCompare(e.lastActivity):n}),n}function qm(e){switch(e.state){case`needs-you`:return e.attention>1?`${e.attention} things need your input`:`Needs your input`;case`active`:return e.activeChildren>0?`Working — ${e.activeChildren} ${e.activeChildren===1?`task`:`tasks`} in progress`:`Working…`;case`done`:return`Finished`;case`idle`:return`Idle`}}function Jm(e,t,n){if(e.key===`Enter`&&!e.shiftKey){if(e.altKey){e.preventDefault();let n=e.currentTarget,r=n.selectionStart??n.value.length,i=n.selectionEnd??r,a=`${n.value.slice(0,r)}\n${n.value.slice(i)}`,o=r+1;t(a),requestAnimationFrame(()=>{n.selectionStart=o,n.selectionEnd=o});return}e.metaKey||e.ctrlKey||(e.preventDefault(),n())}}var Ym=[`Research a topic for me`,`Help me write something`,`Review my code`,`Plan a project`];function Xm(){let{nodes:e,loading:t}=Sp(),n=up(e=>e.reachable),r=(0,v.useMemo)(()=>Km(e),[e]),[i,a]=(0,v.useState)(!1),[o]=Rn();(0,v.useEffect)(()=>{o.get(`new`)!==null&&a(!0)},[o]);let s=!t&&r.length===0;return(0,B.jsxs)(`div`,{className:`mx-auto flex h-full min-h-0 max-w-3xl flex-col px-6 py-8`,children:[(0,B.jsxs)(`div`,{className:`mb-6 flex items-center justify-between gap-3`,children:[(0,B.jsx)(`h1`,{className:`text-3xl`,style:{fontWeight:460,letterSpacing:`-0.01em`,color:`var(--ink)`},children:`Conversations`}),!s&&!i&&(0,B.jsx)(Z,{size:`lg`,onClick:()=>a(!0),children:`+ New chat`})]}),!n&&(0,B.jsx)(`div`,{className:`mb-4 rounded-lg border px-4 py-2.5 text-sm`,style:{borderColor:`rgba(255,94,54,.3)`,background:`var(--blk-dim)`,color:`var(--ink2)`},children:`Couldn't reach your agents — retrying…`}),(i||s)&&(0,B.jsx)(Zm,{firstRun:s,onCancel:s?void 0:()=>a(!1)}),(0,B.jsx)(`div`,{className:`min-h-0 flex-1 overflow-auto`,children:t?(0,B.jsx)(th,{}):(0,B.jsx)(`ul`,{className:`flex flex-col gap-2.5`,children:r.map(e=>(0,B.jsx)(Qm,{conversation:e},e.id))})})]})}function Zm({firstRun:e,onCancel:t}){let n=ut(),[r,i]=(0,v.useState)(``),[a,o]=(0,v.useState)(!1),[s,c]=(0,v.useState)(null),l=async()=>{let e=r.trim();if(!(!e||a)){o(!0),c(null);try{let t=await Yf({prompt:e,kind:`general`,mode:`base`,root:!0});n(`/c/${encodeURIComponent(t.node_id)}`)}catch(e){c(e instanceof Uf?e.message:String(e)),o(!1)}}};return(0,B.jsxs)(`div`,{className:`panel mb-6 p-5`,children:[e&&(0,B.jsx)(`p`,{className:`mb-3 text-base`,style:{fontStyle:`italic`,color:`var(--ink2)`},children:`Start a conversation with an agent.`}),(0,B.jsx)(Wp,{autoFocus:!0,value:r,onChange:e=>i(e.currentTarget.value),onKeyDown:e=>{Jm(e,i,()=>void l())},rows:3,disabled:a,placeholder:`What do you want help with?`,className:`resize-none border-0 bg-transparent px-0 text-base shadow-none focus-visible:ring-0`}),(0,B.jsx)(`div`,{className:`mt-2 flex flex-wrap gap-2`,children:Ym.map(e=>(0,B.jsx)(`button`,{type:`button`,disabled:a,onClick:()=>i(e),className:`rounded-full border border-border px-3 py-1 text-xs text-muted-foreground transition-colors hover:border-[color:var(--line2)] hover:text-foreground`,children:e},e))}),s&&(0,B.jsx)(`p`,{className:`mt-3 text-sm text-destructive`,children:s}),(0,B.jsxs)(`div`,{className:`mt-4 flex items-center justify-end gap-2`,children:[t&&(0,B.jsx)(Z,{variant:`ghost`,onClick:t,disabled:a,children:`Cancel`}),(0,B.jsx)(Z,{onClick:()=>void l(),disabled:a||!r.trim(),children:a?`Starting…`:`Start chat`})]})]})}function Qm({conversation:e}){let t=ut();return(0,B.jsx)(`li`,{className:`list-none`,children:(0,B.jsxs)(`button`,{type:`button`,onClick:()=>t(`/c/${encodeURIComponent(e.id)}`),className:`panel flex w-full items-center gap-4 px-4 py-3.5 text-left transition-colors hover:bg-[color-mix(in_oklch,var(--ink)_3%,transparent)] focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring`,children:[(0,B.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,B.jsx)(eh,{state:e.state}),(0,B.jsx)(`span`,{className:`truncate text-sm`,style:{fontWeight:500,color:`var(--ink)`},children:e.title})]}),(0,B.jsx)(`p`,{className:`mt-0.5 truncate text-sm`,style:{color:`var(--mut)`},children:qm(e)})]}),(0,B.jsxs)(`div`,{className:`font-inst flex shrink-0 items-center gap-3 text-xs`,style:{letterSpacing:`0.04em`,color:`var(--mut)`},children:[e.cycles!==void 0&&(0,B.jsxs)(`span`,{title:`cycles`,children:[`⟳ `,e.cycles]}),(0,B.jsxs)(`span`,{title:`nodes in this conversation`,children:[`◦ `,e.nodeCount,` `,e.nodeCount===1?`node`:`nodes`]}),(0,B.jsx)(`span`,{title:`time since last work`,children:nh(e.lastActivity)})]})]})})}var $m={"needs-you":`needs you`,active:`active`,idle:`idle`,done:`done`};function eh({state:e}){let t=e===`needs-you`?`blocked`:e,n=$m[e];return(0,B.jsx)(`span`,{className:Y(`dot shrink-0`,t),title:n,"aria-label":n})}function th(){return(0,B.jsx)(`ul`,{className:`flex flex-col gap-2.5`,children:[0,1,2,3].map(e=>(0,B.jsxs)(`li`,{className:`panel flex items-center gap-4 px-4 py-3.5`,children:[(0,B.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-2`,children:[(0,B.jsx)(`div`,{className:`h-4 w-1/3 animate-pulse rounded bg-muted`}),(0,B.jsx)(`div`,{className:`h-3 w-2/3 animate-pulse rounded bg-muted/70`})]}),(0,B.jsx)(`div`,{className:`h-6 w-16 animate-pulse rounded-full bg-muted`})]},e))})}function nh(e){let t=new Date(e).getTime();if(Number.isNaN(t))return``;let n=Math.max(0,Math.round((Date.now()-t)/1e3));if(n<60)return`just now`;let r=Math.round(n/60);if(r<60)return`${r}m ago`;let i=Math.round(r/60);return i<24?`${i}h ago`:`${Math.round(i/24)}d ago`}var rh={active:Tf,idle:hf,done:df,dead:pf,canceled:mf,blocked:uf};function ih({status:e}){return(0,B.jsx)(rh[e]??hf,{className:Y(`!size-3.5`,e===`active`&&`animate-spin`)})}function ah(e,t,n,r){return t===`static`?e.status:n===`down`?`dead`:n===`reconnecting`?`idle`:r?`active`:`idle`}function oh(e){let t=e.store.source===`static`,n=e.store.state?.isStreaming??!1,r=e.detail,i=r?ah(r,e.store.source,e.store.brokerStatus,n):null;return r?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`h2`,{className:Y(sh,`min-w-0 truncate`),title:r.name,children:r.name}),i&&(0,B.jsxs)(Kp,{className:Y(`gap-1.5`,i),children:[(0,B.jsx)(ih,{status:i}),i]}),t&&(0,B.jsx)(`span`,{className:`font-mono text-xs`,style:{color:`var(--idle)`},title:`dormant node — last-known values, not live`,children:`last-known`})]}):(0,B.jsx)(`h2`,{className:sh,children:`…`})}var sh=`con-title text-xl font-medium`;function ch(e){let t=e.store.chrome,n=e.store.source===`static`,r=e.store.state?.isStreaming??!1,i=t.context,a=t.stats,o=t.tokens,s=i&&!n?i.percent:null,c=!n&&a?.cost!==void 0?a.cost:null;return!i&&c===null&&!a&&!o?null:(0,B.jsxs)(`div`,{className:`cluster`,children:[i&&(0,B.jsxs)(`div`,{className:`gauge`,children:[(0,B.jsxs)(`div`,{className:`glabel`,children:[(0,B.jsx)(`span`,{className:`instlabel`,children:`Context`}),(0,B.jsxs)(`span`,{className:`gval`,children:[s===null?`—`:dh(s),s!==null&&(0,B.jsx)(`span`,{className:`u`,children:`%`})]})]}),(0,B.jsx)(`div`,{className:`gbar`,children:(0,B.jsx)(`i`,{style:{width:s===null?`0%`:`${Math.min(100,s)}%`}})}),(0,B.jsxs)(`div`,{className:`gsub`,children:[i.tokens.toLocaleString(),!n&&(0,B.jsxs)(B.Fragment,{children:[` / `,i.window.toLocaleString()]})]})]}),c!==null&&(0,B.jsxs)(`div`,{className:`gauge`,children:[(0,B.jsxs)(`div`,{className:`glabel`,children:[(0,B.jsx)(`span`,{className:`instlabel`,children:`Cost`}),(0,B.jsxs)(`span`,{className:`gval`,children:[(0,B.jsx)(`span`,{className:`u`,style:{marginLeft:0,marginRight:2},children:`$`}),c.toFixed(2)]})]}),(0,B.jsx)(`div`,{className:`gbar`,children:(0,B.jsx)(`i`,{style:{width:`${Math.min(100,c/5*100)}%`}})}),a&&(0,B.jsxs)(`div`,{className:`gsub`,children:[a.turns,` turns`]})]}),(0,B.jsxs)(`div`,{className:`dials`,children:[!n&&a&&c===null&&(0,B.jsx)(lh,{value:String(a.turns),unit:`turns`}),!n&&a&&(0,B.jsx)(lh,{value:`${a.user_messages}/${a.assistant_messages}`,unit:`msgs`}),o&&(0,B.jsx)(lh,{value:`${uh(o.input)} → ${uh(o.output)}`,unit:`tokens`}),!n&&t.tool_calls!==null&&(0,B.jsx)(lh,{value:String(t.tool_calls),unit:`tools`,hot:r})]})]})}function lh({value:e,unit:t,hot:n}){return(0,B.jsx)(`div`,{className:`dial`,children:(0,B.jsxs)(`span`,{className:`dval`,style:n?{color:`var(--act)`}:void 0,children:[e,` `,(0,B.jsx)(`em`,{children:t})]})})}function uh(e){return e>=1e6?`${Math.round(e/1e5)/10}M`:e>=1e3?`${Math.round(e/1e3)}k`:String(e)}function dh(e){return(Math.round(e*10)/10).toFixed(1)}function fh({store:e,detail:t}){let n=e.chrome,r=[],i=n.branch??t?.branch??null;if(i!==null){let e=n.git_status??t?.git_status??null,a=e?.added??0,o=e?.modified??0;r.push((0,B.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,B.jsx)(yf,{className:`size-3.5 shrink-0 opacity-70`}),(0,B.jsx)(`b`,{style:ph,children:i}),a>0&&(0,B.jsxs)(`span`,{style:{color:`var(--act)`,opacity:.8},children:[` +`,a]}),o>0&&(0,B.jsxs)(`span`,{style:{color:`var(--idle)`,opacity:.8},children:[` ~`,o]})]},`branch`))}let a=t?.cwd??null;a!==null&&r.push((0,B.jsx)(`span`,{children:mh(a)},`cwd`));let o=n.model??t?.model??null;o!==null&&r.push((0,B.jsx)(`span`,{children:(0,B.jsx)(`b`,{style:ph,children:o})},`model`));let s=n.context??null;return s!==null&&r.push((0,B.jsxs)(`span`,{children:[`ctx `,(0,B.jsx)(`b`,{style:ph,children:hh(s.tokens)}),` / `,hh(s.window)]},`ctx`)),r.length===0?null:(0,B.jsx)(`div`,{className:`flex min-w-0 items-center gap-5 whitespace-nowrap border-b px-6 py-2 text-xs`,style:{borderColor:`var(--line)`,background:`rgba(0,0,0,.18)`,color:`var(--mut)`},children:r.map((e,t)=>(0,B.jsxs)(v.Fragment,{children:[t>0&&(0,B.jsx)(`span`,{style:{color:`var(--dim)`,opacity:.5},className:`select-none`,children:`·`}),e]},t))})}var ph={color:`var(--ink2)`,fontWeight:400};function mh(e){let t=e.match(/^\/(?:Users|home)\/[^/]+(\/.*)$/);if(t)return`~${t[1]}`;let n=e.split(`/`).filter(Boolean);return n.length<=2?e:`…/${n.slice(-2).join(`/`)}`}function hh(e){return e>=1e6?`${Math.round(e/1e6)}M`:e>=1e3?`${Math.round(e/1e3)}k`:String(e)}function gh(e){let[t,n]=(0,v.useState)(!1),r=(0,v.useRef)(null);return(0,v.useEffect)(()=>{let e=e=>{if(e.key===`Escape`){n(!1);return}if(e.altKey&&e.code===`KeyI`){if(document.activeElement instanceof HTMLTextAreaElement)return;e.preventDefault(),n(e=>!e)}};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[]),t?(0,B.jsx)(`div`,{className:`in fixed inset-0 z-50 flex items-start justify-center pt-22`,style:{background:`rgba(0,0,0,.42)`,backdropFilter:`blur(2px)`},onMouseDown:e=>{r.current?.contains(e.target)||n(!1)},children:(0,B.jsxs)(`div`,{ref:r,className:`panel rv`,style:_h,children:[(0,B.jsxs)(`div`,{style:vh,children:[(0,B.jsx)(`span`,{className:`instlabel`,children:`Instruments`}),(0,B.jsx)(`div`,{style:{flex:1}}),(0,B.jsx)(`span`,{className:`kbd`,children:`⌥i`}),(0,B.jsx)(`button`,{type:`button`,onClick:()=>n(!1),className:`transition-colors`,style:{color:`var(--mut)`},"aria-label":`Close instruments`,children:(0,B.jsx)(Pf,{className:`size-3.5`})})]}),(0,B.jsx)(ch,{store:e.store,detail:e.detail})]})}):null}var _h={minWidth:`min(680px, 92vw)`,overflow:`hidden`,"--i":0},vh={display:`flex`,alignItems:`center`,gap:`10px`,padding:`11px 30px`,borderBottom:`1px solid var(--line)`};function yh(e){let t=new Map;for(let n of e){if(n.parent===null)continue;let e=t.get(n.parent);e?e.push(n):t.set(n.parent,[n])}return t}function bh(e,t){let n=[],r=new Set,i=[{node:e,depth:0}];for(;i.length>0;){let e=i.pop();if(r.has(e.node.node_id))continue;r.add(e.node.node_id),n.push({node:e.node,depth:e.depth});let a=t.get(e.node.node_id)??[];for(let t=a.length-1;t>=0;t--)i.push({node:a[t],depth:e.depth+1})}return n}function xh(e,t){let n=t.get(e),r=new Set;for(;n&&n.parent!==null;){if(r.has(n.node_id))return null;r.add(n.node_id),n=t.get(n.parent)}return n??null}function Sh(e,t){let n=new Map(e.map(e=>[e.node_id,e])),r=yh(e),i=xh(t,n),a=i?.node_id??null;return{thisGraph:i===null?[]:bh(i,r),otherGraphs:e.filter(e=>e.parent===null&&e.host_kind===`broker`&&e.node_id!==a&&(e.status===`active`||e.attention_count>0))}}var Ch=new Set([`done`,`dead`,`canceled`]),wh=`crtr:graphrail-collapsed`;function Th(e){return e.attention_count>0||e.status===`active`}function Eh(e,t){let n=new Map(e.map(e=>[e.node.node_id,e.node])),r=new Map;for(let{node:t}of e){if(t.parent===null||!n.has(t.parent))continue;let e=r.get(t.parent);e?e.push(t.node_id):r.set(t.parent,[t.node_id])}let i=new Map,a=e=>{let o=i.get(e);if(o!==void 0)return o;i.set(e,!1);let s=n.get(e),c=e===t||s!==void 0&&Th(s);if(!c){for(let t of r.get(e)??[])if(a(t)){c=!0;break}}return i.set(e,c),c},o=new Set;for(let{node:t}of e)(r.get(t.node_id)?.length??0)>0&&!a(t.node_id)&&o.add(t.node_id);return{children:r,collapsedByDefault:o}}function Dh({currentId:e,onNavigate:t}){let{nodes:n}=Sp(),[r,i]=(0,v.useState)(!1),[a,o]=(0,v.useState)(()=>{try{return localStorage.getItem(wh)===`1`}catch{return!1}}),[s,c]=(0,v.useState)({}),{thisGraph:l}=Sh(n,e),u=l[0]?.node.node_id??null,{children:d,collapsedByDefault:f}=(0,v.useMemo)(()=>Eh(l,e),[l,e]),p=e=>s[e]===void 0?f.has(e):!s[e],m=e=>c(t=>({...t,[e]:p(e)})),h=()=>{o(e=>{let t=!e;try{localStorage.setItem(wh,t?`1`:`0`)}catch{}return t})},{liveRoots:g,deadRoots:_}=(0,v.useMemo)(()=>{let e=n.filter(e=>e.parent===null&&e.host_kind===`broker`&&e.node_id!==u),t=[],r=[];for(let n of e)(Ch.has(n.status)&&n.attention_count===0?r:t).push(n);let i=(e,t)=>Date.parse(t.created)-Date.parse(e.created),a=e=>e.attention_count>0?0:e.status===`active`?1:2;return t.sort((e,t)=>a(e)-a(t)||i(e,t)),r.sort(i),{liveRoots:t,deadRoots:r}},[n,u]);if((0,v.useEffect)(()=>{let n=n=>{if(!n.altKey||n.key!==`ArrowUp`&&n.key!==`ArrowDown`)return;let r=l.findIndex(t=>t.node.node_id===e);if(r===-1)return;n.preventDefault();let i=n.key===`ArrowUp`?l[r-1]:l[r+1];i&&t(i.node.node_id)};return window.addEventListener(`keydown`,n),()=>window.removeEventListener(`keydown`,n)},[l,e,t]),a)return(0,B.jsx)(`aside`,{className:`graphrail rv`,style:kh,children:(0,B.jsx)(`button`,{type:`button`,onClick:h,title:`Expand graph sidebar`,"aria-label":`Expand graph sidebar`,className:`flex size-6 items-center justify-center rounded-md text-[var(--dim)] transition-colors hover:text-[var(--ink2)]`,children:(0,B.jsx)(cf,{className:`size-4`})})});let y=[],b=null;for(let{node:n,depth:r}of l){if(b!==null){if(r>b)continue;b=null}let i=d.get(n.node_id)??[],a=i.length>0&&p(n.node_id);y.push((0,B.jsx)(Ih,{node:n,depth:r,current:n.node_id===e,hasChildren:i.length>0,collapsed:a,onToggleCollapse:()=>m(n.node_id),onClick:()=>t(n.node_id)},n.node_id)),a&&(b=r)}return(0,B.jsxs)(`aside`,{className:`graphrail rv`,style:Oh,children:[(0,B.jsx)(`div`,{className:`flex items-center justify-end pb-1`,children:(0,B.jsx)(`button`,{type:`button`,onClick:h,title:`Collapse graph sidebar`,"aria-label":`Collapse graph sidebar`,className:`flex size-6 items-center justify-center rounded-md text-[var(--dim)] transition-colors hover:text-[var(--ink2)]`,children:(0,B.jsx)(cf,{className:`size-4 rotate-180`})})}),(0,B.jsx)(Ah,{label:`This graph`,chord:`⌥↑↓ to cycle`}),y,l.length===0&&(0,B.jsx)(jh,{}),(g.length>0||_.length>0)&&(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`div`,{className:`gr-gap`}),(0,B.jsx)(Ah,{label:`Elsewhere`}),g.map(e=>(0,B.jsx)(Ih,{node:e,depth:0,current:!1,elsewhere:!0,onClick:()=>t(e.node_id)},e.node_id)),_.length>0&&(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`button`,{type:`button`,onClick:()=>i(e=>!e),className:`mt-1 flex items-center gap-1.5 rounded-md px-3 py-2 text-left text-xs text-[var(--dim)] transition-colors hover:text-[var(--ink2)]`,children:[(0,B.jsx)(cf,{className:Y(`size-3.5 transition-transform`,r&&`rotate-90`)}),r?`Hide`:`Show`,` `,_.length,` finished`]}),r&&_.map(e=>(0,B.jsx)(Ih,{node:e,depth:0,current:!1,elsewhere:!0,onClick:()=>t(e.node_id)},e.node_id))]})]})]})}var Oh={width:`228px`,flex:`none`,display:`flex`,flexDirection:`column`,borderRight:`1px solid var(--line)`,background:`rgba(0,0,0,.16)`,padding:`14px 9px`,overflowY:`auto`,zIndex:1,"--i":2},kh={width:`36px`,flex:`none`,display:`flex`,flexDirection:`column`,alignItems:`center`,borderRight:`1px solid var(--line)`,background:`rgba(0,0,0,.16)`,padding:`14px 6px`,zIndex:1,"--i":2};function Ah({label:e,chord:t}){return(0,B.jsxs)(`div`,{className:`gr-sec`,children:[(0,B.jsx)(`span`,{className:`instlabel`,children:e}),(0,B.jsx)(`div`,{className:`rule`}),t&&(0,B.jsx)(`span`,{title:t,"aria-label":t,className:`flex items-center text-[var(--dim)]`,children:(0,B.jsx)(Sf,{className:`size-3.5`})})]})}function jh(){return(0,B.jsx)(`span`,{className:`px-3 py-1 font-mono text-xs`,style:{color:`var(--dim)`},children:`—`})}function Mh(e){let t=Date.now()-Date.parse(e);if(!Number.isFinite(t)||t<0)return``;let n=Math.floor(t/1e3);if(n<60)return`${n}s`;let r=Math.floor(n/60);if(r<60)return`${r}m`;let i=Math.floor(r/60);return i<24?`${i}h`:`${Math.floor(i/24)}d`}function Nh(e){return e.split(`/`).filter(Boolean).at(-1)??e}function Ph(e){let t=e.match(/^\/(?:Users|home)\/[^/]+(\/.*)$/);if(t)return`~${t[1]}`;let n=e.split(`/`).filter(Boolean);return n.length<=2?e:`…/${n.slice(-2).join(`/`)}`}var Fh={active:`s-active`,idle:`s-idle`,done:`s-done`,dead:`s-dead`,canceled:`s-canceled`};function Ih({node:e,depth:t,current:n,elsewhere:r=!1,hasChildren:i=!1,collapsed:a=!1,onToggleCollapse:o,onClick:s}){let c=Ch.has(e.status),l=e.attention_count>0,u=l?`blocked`:e.status,d=Mh(e.created),f=t>0?{marginLeft:`${t*12}px`}:void 0,p=(0,B.jsx)(`button`,{type:`button`,onClick:s,className:Y(`node-row text-left`,r?`w-full`:`min-w-0 flex-1`,l?`s-blocked`:Fh[e.status],c&&!l&&`dimmed`,n&&`rounded-md border border-[var(--line2)] bg-[oklch(0.92_0.013_80_/_8%)] shadow-[inset_0_1px_0_var(--raise)]`),children:(0,B.jsxs)(`span`,{className:`node-id`,children:[(0,B.jsxs)(`span`,{className:`node-l1`,children:[(0,B.jsx)(`span`,{className:Y(`node-name truncate`,n&&`font-semibold`),children:r?Nh(e.cwd):e.name}),r?(0,B.jsxs)(`span`,{className:`node-kind truncate`,children:[e.name,` · `,e.kind]}):(0,B.jsx)(`span`,{className:`node-kind`,children:e.kind}),l&&(0,B.jsxs)(Kp,{variant:`destructive`,className:`ml-auto gap-1 text-xs`,children:[(0,B.jsx)(vf,{className:`size-3.5`}),e.attention_count]})]}),(0,B.jsxs)(`span`,{className:`node-l2`,children:[r&&(0,B.jsx)(`span`,{className:`node-cwd`,children:Ph(e.cwd)}),(0,B.jsx)(`span`,{className:Y(`dot`,u),title:u,"aria-label":u}),d&&(0,B.jsx)(`span`,{className:`text-[var(--dim)]`,children:d})]})]})});return r?(0,B.jsx)(`div`,{style:f,children:p}):(0,B.jsxs)(`div`,{className:`flex items-center gap-1`,style:f,children:[i?(0,B.jsx)(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),o?.()},title:a?`Expand branch`:`Collapse branch`,"aria-label":a?`Expand branch`:`Collapse branch`,className:`flex size-4 flex-none items-center justify-center rounded-sm text-[var(--dim)] transition-colors hover:text-[var(--ink2)]`,children:(0,B.jsx)(cf,{className:Y(`size-3.5 transition-transform`,!a&&`rotate-90`)})}):(0,B.jsx)(`span`,{className:`size-4 flex-none`,"aria-hidden":`true`}),p]})}function Lh(e){let t=e.store.presence,n=e.store.role===`controller`;return(0,B.jsxs)(v.Fragment,{children:[(0,B.jsxs)(`div`,{className:`ctl-state flex shrink-0 items-center gap-1.5 text-xs`,style:{color:`var(--mut)`},children:[`control:`,` `,(0,B.jsx)(`span`,{style:{color:`var(--ink2)`,fontStyle:`italic`},children:n?`you`:t.controller?`another client`:`no one`})]}),n?(0,B.jsx)(`button`,{type:`button`,className:`btn sm shrink-0`,onClick:()=>e.store.releaseControl(),children:`Release control`}):(0,B.jsx)(`button`,{type:`button`,className:`btn primary sm shrink-0`,disabled:!e.store.socketReady,title:e.store.socketReady?void 0:`connecting…`,onClick:()=>e.store.requestControl(),children:`Request control`})]})}function Rh(e){return typeof e==`object`&&!!e}function zh(e){return typeof e==`string`?e:``}function Bh(e){let t=e??``;return/rate.?limit|\b429\b|too many requests|quota/i.test(t)?`rate-limit`:/overloaded|\b529\b|\b503\b|capacity|server.{0,3}busy|temporarily unavailable/i.test(t)?`overloaded`:/invalid_grant|refresh token|unauthori[sz]ed|invalid.?api.?key|authentication failed|\b401\b|\b403\b/i.test(t)?`auth`:/connection|econnreset|etimedout|enotfound|econnrefused|network|fetch failed|socket hang|timed? out|timeout/i.test(t)?`connection`:`other`}function Vh(e){let t=zh(e.code)||zh(e.errno);return t===``?null:/^(ECONNREFUSED|ECONNRESET|ETIMEDOUT|ENOENT|ENOTFOUND|EAI_AGAIN|EPIPE|EHOSTUNREACH|ENETUNREACH)$/i.test(t)?`connection`:null}function Hh(e){let t=typeof e.status==`number`?e.status:null;return t===null?null:t===401||t===403?`auth`:t===429?`rate-limit`:t===503||t===529||t>=500&&t<=599?`overloaded`:t>=400&&t<=499?`protocol`:null}function Uh(e){let t=typeof e.code==`number`?e.code:null;if(t===null)return null;if(t===1008)return`protocol`;if(t===1006)return`connection`;if(t===1011){let t=zh(e.reason);return/no running broker/i.test(t)||Bh(t)===`connection`?`connection`:`other`}return null}function Wh(e,t){return t===`auth`||t===`protocol`?`fatal`:e===`pi→provider`?t===`connection`||t===`rate-limit`||t===`overloaded`?`auto`:`fatal`:`manual`}function Gh(e){if(typeof e==`string`)return e;if(!Rh(e))return``;let t=[e.message,e.errorMessage,e.reason,e.body,e.statusText];for(let e of t)if(typeof e==`string`&&e!==``)return e;let n=e.error;if(Rh(n)){let e=n.message;if(typeof e==`string`&&e!==``)return e;let t=n.reason;if(typeof t==`string`&&t!==``)return t}return``}function Kh(e,t){if(Rh(t)){let n=Vh(t);if(n!==null)return{kind:n,disposition:Wh(e,n)};let r=Hh(t);if(r!==null)return{kind:r,disposition:Wh(e,r)};let i=Uh(t);if(i!==null)return{kind:i,disposition:Wh(e,i)}}let n=Bh(Gh(t));return{kind:n,disposition:Wh(e,n)}}var qh=class{nodeId;handlers;ws;closedReported=!1;constructor(e,t){this.nodeId=e,this.handlers=t}get url(){let e=location.protocol===`https:`?`wss:`:`ws:`,t=new URL(`/node/${encodeURIComponent(this.nodeId)}`,window.location.href);return t.protocol=e,Bf!==void 0&&t.searchParams.set(`token`,Bf),t.toString()}connect(){let e;try{e=new WebSocket(this.url)}catch(e){this.reportClose(`transient`,`failed to open ws: ${String(e)}`);return}this.ws=e,e.onopen=()=>this.handlers.onOpen?.(),e.onmessage=e=>this.onMessage(e),e.onclose=e=>{let t=Kh(`browser↔relay`,{code:e.code,reason:e.reason}),n=e.code===1008||t.kind===`protocol`?`invalid`:e.code===1011&&/^no node /.test(e.reason)?`no-node`:e.code===1011&&/^no running broker/.test(e.reason)?`no-broker`:`transient`;this.reportClose(n,e.reason||`closed (${e.code})`)},e.onerror=()=>{}}onMessage(e){if(typeof e.data!=`string`)return;let t;try{t=JSON.parse(e.data)}catch{return}this.handlers.onFrame?.(t)}send(e){let t=this.ws;if(!(t===void 0||t.readyState!==WebSocket.OPEN))try{t.send(JSON.stringify(e))}catch{}}close(){let e=this.ws;if(e!==void 0&&e.readyState<=WebSocket.OPEN)try{e.close()}catch{}}reportClose(e,t){this.closedReported||(this.closedReported=!0,this.ws=void 0,this.handlers.onClose?.(e,t))}},Jh=/^From (?:[a-z0-9]+-[a-f0-9]+|system|human) — \d+ update/;function Yh(e){return Jh.test(e)}function Xh(e){let t=/^From ([a-z0-9]+-[a-f0-9]+|system|human) — /.exec(e);if(!t)return null;let n=t[1];return typeof n==`string`?n:null}function Zh(){return{messages:[],streamingIndex:null,executingToolIds:new Set,partialToolResults:new Map,isStreaming:!1,activity:null,queued:[]}}function Qh(e){let t=e.content;return typeof t==`string`?t:Array.isArray(t)?t.filter(e=>!!e&&e.type===`text`).map(e=>typeof e.text==`string`?e.text:``).join(``):``}function $h(e){return ng(e)!==`user`||e.origin||!Yh(Qh(e))?e:{...e,origin:`inbox`}}function eg(){return{role:`assistant`,content:[]}}function tg(e,t){let n=e.messages.map($h);if(e.state?.isStreaming!==!0)return{messages:n,streamingIndex:null,executingToolIds:new Set,partialToolResults:new Map,isStreaming:!1,activity:null,queued:[]};let r=n.length-1;if(r>=0&&ng(n[r])===`assistant`)return{messages:n,streamingIndex:r,executingToolIds:new Set,partialToolResults:new Map,isStreaming:!0,activity:`Working…`,queued:[]};let i=t&&t.streamingIndex!==null?t.messages[t.streamingIndex]:void 0,a=i&&ng(i)===`assistant`?i:eg(),o=[...n,a];return{messages:o,streamingIndex:o.length-1,executingToolIds:new Set,partialToolResults:new Map,isStreaming:!0,activity:`Working…`,queued:[]}}function ng(e){return e.role??``}function rg(e){for(let t=e.messages.length-1;t>=0;t--)if(ng(e.messages[t])===`bashExecution`)return t;return null}function ig(e,t,n){let r={role:`bashExecution`,command:t,output:``,exitCode:void 0,cancelled:!1,truncated:!1,excludeFromContext:n,timestamp:Date.now()};return{...e,messages:[...e.messages,r]}}function ag(e,t){let n=rg(e);if(n===null)return e;let r=[...e.messages],i=r[n];return r[n]={...i,output:`${i.output??``}${t}`},{...e,messages:r}}function og(e,t){let n=rg(e);if(n===null)return e;let r=[...e.messages];return r[n]={...r[n],exitCode:t.exitCode,cancelled:t.cancelled,truncated:t.truncated,fullOutputPath:t.fullOutputPath},{...e,messages:r}}function sg(e,t){switch(t.type){case`agent_start`:return{...e,isStreaming:!0,activity:`Working…`};case`agent_end`:return{...e,isStreaming:!1,activity:null,streamingIndex:null,executingToolIds:e.executingToolIds.size?new Set:e.executingToolIds};case`message_start`:{let n=$h(t.message),r=[...e.messages,n],i=ng(n)===`assistant`,a=e.partialToolResults;if(ng(n)===`toolResult`){let e=n.toolCallId;if(typeof e==`string`&&a.has(e)){let t=new Map(a);t.delete(e),a=t}}return{...e,messages:r,partialToolResults:a,streamingIndex:i?r.length-1:e.streamingIndex}}case`message_update`:{let n=e.streamingIndex;if(n===null){let t=e.messages.length-1;t>=0&&ng(e.messages[t])===`assistant`&&(n=t)}if(n===null)return e;let r=[...e.messages];return r[n]=t.message,{...e,messages:r,streamingIndex:n}}case`message_end`:{if(e.streamingIndex===null)return e;let n=[...e.messages];return n[e.streamingIndex]=t.message,{...e,messages:n,streamingIndex:null}}case`tool_execution_start`:{let n=new Set(e.executingToolIds);return n.add(t.toolCallId),{...e,executingToolIds:n}}case`tool_execution_update`:{let n=new Map(e.partialToolResults);return n.set(t.toolCallId,cg(t.toolCallId,t.toolName,t.partialResult,!1)),{...e,partialToolResults:n}}case`tool_execution_end`:{let n=new Set(e.executingToolIds);n.delete(t.toolCallId);let r=new Map(e.partialToolResults);return r.set(t.toolCallId,cg(t.toolCallId,t.toolName,t.result,t.isError)),{...e,executingToolIds:n,partialToolResults:r}}case`compaction_start`:return{...e,activity:`Compacting context…`};case`compaction_end`:return{...e,activity:e.isStreaming?`Working…`:null};case`auto_retry_start`:return{...e,activity:`Retrying (${t.attempt}/${t.maxAttempts}) in ${Math.ceil(t.delayMs/1e3)}s…`};case`auto_retry_end`:return{...e,activity:e.isStreaming?`Working…`:null};case`queue_update`:return{...e,queued:[...t.steering,...t.followUp]};default:return e}}function cg(e,t,n,r){let i=typeof n==`object`&&n?n:{};return{role:`toolResult`,toolCallId:e,toolName:t,...i,content:Array.isArray(i.content)?i.content:[],isError:r}}var lg=1,ug=new Set([`stop`,`length`,`toolUse`,`error`,`aborted`]),dg=new Set([`off`,`minimal`,`low`,`medium`,`high`,`xhigh`]),fg=200,pg=256*1024,mg=20,hg=8*1024*1024;function gg(e){return{schemaVersion:lg,...e}}function _g(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Q(e){return typeof e==`string`}function vg(e){return typeof e==`number`}function yg(e){return typeof e==`boolean`}function bg(e){return!_g(e)||e.type!==`text`||!Q(e.text)?!1:e.textSignature===void 0||Q(e.textSignature)}function xg(e){return _g(e)&&e.type===`image`&&Q(e.data)&&Q(e.mimeType)}function Sg(e){return _g(e)&&e.type===`toolCall`&&Q(e.id)&&Q(e.name)&&_g(e.arguments)&&(e.thoughtSignature===void 0||Q(e.thoughtSignature))}function Cg(e){return _g(e)&&vg(e.input)&&vg(e.output)&&vg(e.cacheRead)&&vg(e.cacheWrite)&&vg(e.total)}function wg(e){return _g(e)&&vg(e.input)&&vg(e.output)&&vg(e.cacheRead)&&vg(e.cacheWrite)&&(e.cacheWrite1h===void 0||vg(e.cacheWrite1h))&&(e.reasoning===void 0||vg(e.reasoning))&&vg(e.totalTokens)&&Cg(e.cost)}function Tg(e){return typeof e==`string`&&ug.has(e)}function Eg(e){return typeof e==`string`&&dg.has(e)}function Dg(e){return!_g(e)||!Q(e.message)?!1:(e.name===void 0||Q(e.name))&&(e.stack===void 0||Q(e.stack))&&(e.code===void 0||Q(e.code)||vg(e.code))}function Og(e){return!_g(e)||!Q(e.type)||!vg(e.timestamp)?!1:(e.error===void 0||Dg(e.error))&&(e.details===void 0||_g(e.details))}function kg(e){return!_g(e)||e.role!==`user`||!vg(e.timestamp)?!1:typeof e.content==`string`||Array.isArray(e.content)&&e.content.every(e=>bg(e)||xg(e))}function Ag(e){return!_g(e)||e.role!==`assistant`||!vg(e.timestamp)||!Array.isArray(e.content)||!e.content.every(e=>bg(e)||_g(e)&&e.type===`thinking`&&Q(e.thinking)&&(e.thinkingSignature===void 0||Q(e.thinkingSignature))&&(e.redacted===void 0||yg(e.redacted))||Sg(e))?!1:Q(e.api)&&Q(e.provider)&&Q(e.model)&&(e.responseModel===void 0||Q(e.responseModel))&&(e.responseId===void 0||Q(e.responseId))&&(e.diagnostics===void 0||Array.isArray(e.diagnostics)&&e.diagnostics.every(Og))&&wg(e.usage)&&Tg(e.stopReason)&&(e.errorMessage===void 0||Q(e.errorMessage))}function jg(e){return!_g(e)||e.role!==`toolResult`||!vg(e.timestamp)?!1:Q(e.toolCallId)&&Q(e.toolName)&&Array.isArray(e.content)&&e.content.every(e=>bg(e)||xg(e))&&yg(e.isError)}function Mg(e){return _g(e)&&e.role===`bashExecution`&&Q(e.command)&&Q(e.output)&&vg(e.timestamp)&&(e.exitCode===void 0||vg(e.exitCode))&&yg(e.cancelled)&&yg(e.truncated)&&(e.fullOutputPath===void 0||Q(e.fullOutputPath))&&(e.excludeFromContext===void 0||yg(e.excludeFromContext))}function Ng(e){return kg(e)||Ag(e)||jg(e)||Mg(e)}function Pg(e){return!_g(e)||!Q(e.role)?!1:e.role!==`user`&&e.role!==`assistant`&&e.role!==`toolResult`&&e.role!==`bashExecution`}function Fg(e){return Ng(e)||Pg(e)}function Ig(e){return!_g(e)||!Q(e.name)||!Q(e.description)||e.source!==`builtin`&&e.source!==`command`&&e.source!==`template`?!1:(e.location===void 0||e.location===`user`||e.location===`project`||e.location===`path`)&&(e.path===void 0||Q(e.path))&&(e.argument_hint===void 0||Q(e.argument_hint))}function Lg(e){return e===null?!0:_g(e)?Q(e.sessionId)&&(e.sessionFile===null||Q(e.sessionFile))&&(e.model===null||Q(e.model))&&yg(e.isStreaming)&&Eg(e.thinkingLevel)&&(e.steeringMode===`all`||e.steeringMode===`one-at-a-time`)&&(e.followUpMode===`all`||e.followUpMode===`one-at-a-time`)&&(e.sessionName===null||Q(e.sessionName))&&yg(e.autoCompactionEnabled)&&vg(e.pendingMessageCount):!1}function Rg(e,t){return _g(t)?t.schemaVersion===lg&&t.nodeId===e&&Array.isArray(t.messages)&&t.messages.every(Fg)&&Lg(t.sessionState)&&Array.isArray(t.commands)&&t.commands.every(Ig)&&yg(t.isStreaming)&&(t.activity===null||Q(t.activity))&&vg(t.updatedAt)&&(t.source===`broker`||t.source===`static`):!1}function zg(e){return new TextEncoder().encode(JSON.stringify(e)).length}function Bg(e,t,n){let r=e.messages.slice(-t),i={...e,messages:r};for(;r.length>1&&zg(i)>n;)r=r.slice(1),i={...e,messages:r};return i}function Vg(e){return`crtr.web.transcript.tail.${e}`}function Hg(e){try{let t=globalThis.localStorage?.getItem(Vg(e));if(t==null)return null;let n=JSON.parse(t);return Rg(e,n)?n:null}catch{return null}}function Ug(e){let t=Bg(e,mg,pg);try{globalThis.localStorage?.setItem(Vg(e.nodeId),JSON.stringify(t))}catch{}}var Wg=`crtr-web-transcript-cache`,Gg=1,Kg=`entries`;function qg(){return new Promise((e,t)=>{if(typeof indexedDB>`u`){t(Error(`indexedDB unavailable`));return}let n=indexedDB.open(Wg,Gg);n.onupgradeneeded=()=>{let e=n.result;e.objectStoreNames.contains(Kg)||e.createObjectStore(Kg,{keyPath:`nodeId`}).createIndex(`updatedAt`,`updatedAt`)},n.onsuccess=()=>e(n.result),n.onerror=()=>t(n.error??Error(`indexedDB open failed`))})}async function Jg(e){try{let t=await qg(),n=await new Promise((n,r)=>{let i=t.transaction(Kg,`readonly`).objectStore(Kg).get(e);i.onsuccess=()=>n(i.result),i.onerror=()=>r(i.error??Error(`indexedDB read failed`))});return t.close(),Rg(e,n)?n:null}catch{return null}}async function Yg(e){let t=[];await new Promise((n,r)=>{let i=e.transaction(Kg,`readonly`).objectStore(Kg).index(`updatedAt`).openCursor();i.onsuccess=()=>{let e=i.result;if(!e){n();return}let r=e.value;t.push({nodeId:r.nodeId,updatedAt:r.updatedAt,size:zg(r)}),e.continue()},i.onerror=()=>r(i.error??Error(`indexedDB cursor failed`))});let n=t.reduce((e,t)=>e+t.size,0);n<=hg||await new Promise((r,i)=>{let a=e.transaction(Kg,`readwrite`),o=a.objectStore(Kg),s=0;for(;n>hg&&s<t.length;){let e=t[s];o.delete(e.nodeId),n-=e.size,s+=1}a.oncomplete=()=>r(),a.onerror=()=>i(a.error??Error(`indexedDB prune failed`))})}async function Xg(e){let t=Bg(e,fg,pg);try{let e=await qg();await new Promise((n,r)=>{let i=e.transaction(Kg,`readwrite`);i.objectStore(Kg).put(t),i.oncomplete=()=>n(),i.onerror=()=>r(i.error??Error(`indexedDB write failed`))}),await Yg(e),e.close()}catch{}}function Zg(e){return{clientId:e,conn:`connecting`,conv:Zh(),role:`observer`,controllerId:null,session:null,model:void 0,sessionName:void 0,contextTokens:void 0,dialog:null,commands:[],statuses:{},widgets:{},title:void 0,notice:null}}var Qg={"no-broker":`no-broker`,"no-node":`no-node`,invalid:`invalid`,transient:`closed`};function $g(e){return e===`welcome`||e===`control_changed`||e===`model_changed`||e===`error`||e===`ack`||e===`data`||e===`display_status`||e===`display_widget`||e===`display_title`||e===`bash_start`||e===`bash_output`||e===`bash_end`||e===`extension_ui_request`}function e_(e,t){switch(t.kind){case`connecting`:return e.conn===`connecting`?e:{...e,conn:`connecting`};case`closed`:{let n=Qg[t.closeKind];return e.conn===n?e:{...e,conn:n}}case`notice`:return e.notice===t.text?e:{...e,notice:t.text};case`dismiss-dialog`:return e.dialog===null?e:{...e,dialog:null};case`frame`:return s_(e,t.frame)}}function t_(e,t){return e.name===t.name&&e.description===t.description&&e.source===t.source&&e.location===t.location&&e.path===t.path&&e.argument_hint===t.argument_hint}function n_(e,t){return e.length===t.length&&e.every((e,n)=>t_(e,t[n]))}function r_(e,t){return e===t?!0:e===void 0||t===void 0?!1:e.placement===t.placement&&e.lines.length===t.lines.length&&e.lines.every((e,n)=>e===t.lines[n])}function i_(e){if(e===void 0||e.trim()===``)return[];try{let t=JSON.parse(e);return Array.isArray(t)?t.filter(e=>{if(typeof e!=`object`||!e)return!1;let t=e;return typeof t.name==`string`&&typeof t.description==`string`&&(t.source===`builtin`||t.source===`command`||t.source===`template`)}):[]}catch{return[]}}function a_(e){return{sessionId:e.sessionId,sessionFile:e.sessionFile??null,model:e.model??null,isStreaming:e.isStreaming,thinkingLevel:e.thinkingLevel,steeringMode:e.steeringMode,followUpMode:e.followUpMode,sessionName:e.sessionName??null,autoCompactionEnabled:e.autoCompactionEnabled,pendingMessageCount:e.pendingMessageCount}}function o_(e){let t=e.messages.length-1,n=e.isStreaming&&t>=0?t:null;return{messages:e.messages,streamingIndex:n,executingToolIds:new Set,partialToolResults:new Map,isStreaming:e.isStreaming,activity:e.activity,queued:[]}}function s_(e,t){if(!$g(t.type))return{...e,conv:sg(e.conv,t)};switch(t.type){case`welcome`:{let n=tg(t.snapshot,e.conv),r=t.controller_id,i=a_(t.snapshot.state);return{...e,conn:`open`,conv:n,controllerId:r,role:r===e.clientId?`controller`:`observer`,session:i,model:i.model??void 0,sessionName:i.sessionName??void 0,contextTokens:t.snapshot.stats?.tokens?.total,dialog:t.pending_dialog??null,commands:[]}}case`control_changed`:return e.controllerId===t.controller_id?e:{...e,controllerId:t.controller_id,role:t.controller_id===e.clientId?`controller`:`observer`};case`model_changed`:{let n=t.model??null;return e.model===t.model&&(e.session===null||e.session.model===n)?e:{...e,model:t.model,session:e.session?{...e.session,model:n}:e.session}}case`error`:{let n=t.code===`not_controller`?`read-only — another viewer is the controller`:t.message||`error: ${t.code}`;return e.notice===n?e:{...e,notice:n}}case`extension_ui_request`:return{...e,dialog:t};case`display_status`:{let n=e.statuses[t.key];if(t.text===void 0?n===void 0:n===t.text)return e;let r={...e.statuses};return t.text===void 0?delete r[t.key]:r[t.key]=t.text,{...e,statuses:r}}case`display_widget`:{let n=e.widgets[t.key],r=t.lines===void 0?void 0:{lines:t.lines,placement:t.placement};if(r_(n,r))return e;let i={...e.widgets};return r===void 0?delete i[t.key]:i[t.key]=r,{...e,widgets:i}}case`display_title`:return e.title===t.title?e:{...e,title:t.title};case`ack`:{if(t.for!==`get_commands`)return e;let n=t.ok?i_(t.detail):[];return n_(e.commands,n)?e:{...e,commands:n}}case`bash_start`:return{...e,conv:ig(e.conv,t.command,t.excludeFromContext)};case`bash_output`:return{...e,conv:ag(e.conv,t.chunk)};case`bash_end`:return{...e,conv:og(e.conv,t)};default:return e}}var c_=1500,l_=800,u_=5e3,d_=10;function f_(e){return Math.min(u_,l_*2**e)}var p_=class e{nodeId;static CACHE_WRITE_DEBOUNCE_MS=500;clientId;actions;pinned=!1;state;listeners=new Set;client=null;gen=0;timer=null;cacheWriteTimer=null;role=`observer`;streaming=!1;cachedUpdatedAt=0;liveAttached=!1;started=!1;noBrokerAttempts=0;constructor(e){this.nodeId=e,this.clientId=crypto.randomUUID(),this.state=Zg(this.clientId);let t=Hg(e);t&&(this.state={...this.state,conv:o_(t),session:t.sessionState,commands:t.commands,model:t.sessionState?.model??void 0,sessionName:t.sessionState?.sessionName??void 0},this.cachedUpdatedAt=t.updatedAt),this.actions=this.buildActions()}subscribe=e=>(this.ensureStarted(),this.listeners.add(e),()=>{this.listeners.delete(e)});getState=()=>this.state;ensureStarted(){this.started||(this.started=!0,this.hydrateFromFullMirror(),this.dial())}hydrateFromFullMirror(){let e=this.gen;Jg(this.nodeId).then(t=>{if(e===this.gen&&!this.liveAttached&&!(t===null||t.updatedAt<=this.cachedUpdatedAt)){this.state={...this.state,conv:o_(t),session:t.sessionState,commands:t.commands,model:t.sessionState?.model??void 0,sessionName:t.sessionState?.sessionName??void 0},this.cachedUpdatedAt=t.updatedAt;for(let e of this.listeners)e()}})}focus(){this.ensureStarted(),this.pinned=!0,this.state.conn===`open`&&this.send({type:`request_control`})}background(){this.pinned=!1,this.send({type:`release_control`})}dispose(){this.gen+=1,this.timer&&clearTimeout(this.timer),this.cacheWriteTimer&&(clearTimeout(this.cacheWriteTimer),this.cacheWriteTimer=null,this.flushCacheWrite()),this.client?.close(),this.client=null}dispatch(e){let t=this.state,n=e_(t,e);if(n!==t){this.state=n,this.role=n.role,this.streaming=n.conv.isStreaming,e.kind===`frame`&&e.frame.type===`welcome`&&(this.liveAttached=!0),n.conv!==t.conv&&this.scheduleCacheWrite();for(let e of this.listeners)e()}}scheduleCacheWrite(){this.cacheWriteTimer&&clearTimeout(this.cacheWriteTimer),this.cacheWriteTimer=setTimeout(()=>{this.cacheWriteTimer=null,this.flushCacheWrite()},e.CACHE_WRITE_DEBOUNCE_MS)}flushCacheWrite(){let e=gg({nodeId:this.nodeId,messages:this.state.conv.messages,sessionState:this.state.session,commands:this.state.commands,isStreaming:this.state.conv.isStreaming,activity:this.state.conv.activity,updatedAt:Date.now(),source:`broker`});Ug(e),Xg(e),this.cachedUpdatedAt=e.updatedAt}send(e){this.client?.send(e)}dial(){let e=this.gen,t=new qh(this.nodeId,{onOpen:()=>{e===this.gen&&t.send({type:`hello`,role:`observer`,client_id:this.clientId})},onFrame:n=>{e===this.gen&&(this.dispatch({kind:`frame`,frame:n}),n.type===`welcome`&&(t.send({type:`get_commands`}),this.pinned&&t.send({type:`request_control`}),this.noBrokerAttempts=0))},onClose:t=>{if(e===this.gen){if(this.dispatch({kind:`closed`,closeKind:t}),t===`transient`)this.timer=setTimeout(()=>{e===this.gen&&(this.dispatch({kind:`connecting`}),this.dial())},c_);else if(t===`no-broker`&&this.noBrokerAttempts<d_){let t=this.noBrokerAttempts;this.noBrokerAttempts+=1,this.timer=setTimeout(()=>{e===this.gen&&this.dial()},f_(t))}}}});this.client=t,t.connect()}buildActions(){return{sendText:e=>{let t=e.trim();if(t!==``){if(this.role!==`controller`){this.dispatch({kind:`notice`,text:`take control before sending`});return}if(t.startsWith(`!`)){let e=t.startsWith(`!!`),n=t.slice(e?2:1).trim();if(n===``)return;this.send({type:`bash`,command:n,excludeFromContext:e});return}this.send(this.streaming?{type:`steer`,text:t}:{type:`prompt`,text:t})}},abort:()=>{this.role===`controller`&&this.send({type:`abort`})},takeControl:()=>this.send({type:`request_control`}),releaseControl:()=>this.send({type:`release_control`}),setModel:e=>this.send({type:`set_model`,model:e}),cycleModel:()=>this.send({type:`cycle_model`}),setThinkingLevel:e=>this.send({type:`set_thinking_level`,level:e}),compact:e=>this.send({type:`compact`,...e?{instructions:e}:{}}),answerDialog:e=>{this.send(e),this.dispatch({kind:`dismiss-dialog`})},cancelDialog:()=>{let e=this.state.dialog?.id;e!==void 0&&this.send({type:`extension_ui_response`,id:e,cancelled:!0}),this.dispatch({kind:`dismiss-dialog`})},reconnect:()=>{this.timer&&clearTimeout(this.timer),this.gen+=1,this.noBrokerAttempts=0,this.client?.close(),this.dispatch({kind:`connecting`}),this.dial()},clearNotice:()=>this.dispatch({kind:`notice`,text:null})}}},m_=4,h_=new class{handles=new Map;mru=[];poolListeners=new Set;warmIdsSnapshot=[];acquire(e){let t=this.handles.get(e);return t||(t=new p_(e),this.handles.set(e,t)),this.touch(e),this.notifyPool(),this.evictExcess(),t}focus(e){this.handles.get(e)?.focus()}background(e){this.handles.get(e)?.background()}subscribe=e=>(this.poolListeners.add(e),()=>{this.poolListeners.delete(e)});getWarmIds=()=>this.warmIdsSnapshot;evict(e){let t=this.handles.get(e);if(!t)return;t.pinned=!1,t.dispose(),this.handles.delete(e);let n=this.mru.indexOf(e);n!==-1&&this.mru.splice(n,1),this.notifyPool()}touch(e){let t=this.mru.indexOf(e);t!==-1&&this.mru.splice(t,1),this.mru.push(e)}evictExcess(){for(let e=0;e<this.mru.length&&this.mru.length>m_;){let t=this.mru[e],n=this.handles.get(t);if(n?.pinned){e+=1;continue}n?.dispose(),this.handles.delete(t),this.mru.splice(e,1),this.notifyPool()}}notifyPool(){this.warmIdsSnapshot=[...this.mru];for(let e of this.poolListeners)e()}};function g_(e){let t=h_.acquire(e);return{state:(0,v.useSyncExternalStore)(t.subscribe,t.getState),actions:t.actions}}var __={branch:null,model:null,tokens:null,context:null,tool_calls:null,stats:null,git_status:null};function v_(e,t){return{sessionId:t.state?.sessionId??e,sessionFile:t.state?.sessionFile??null,model:t.state?.model??null,isStreaming:!1,thinkingLevel:t.state?.thinkingLevel??`off`,steeringMode:t.state?.steeringMode??`all`,followUpMode:t.state?.followUpMode??`all`,sessionName:t.state?.sessionName??null,autoCompactionEnabled:t.state?.autoCompactionEnabled??!1,pendingMessageCount:t.state?.pendingMessageCount??0}}function y_(e){let{state:t,actions:n}=g_(e),r=up(e=>e.reachable),[i,a]=(0,v.useState)(null);(0,v.useEffect)(()=>{let n=!1;if(t.conn!==`no-broker`){a(null);return}return Jf(e).then(t=>{if(n)return;a(t);let r=gg({nodeId:e,messages:tg(t.snapshot).messages,sessionState:v_(e,t.snapshot),commands:t.commands,isStreaming:!1,activity:null,updatedAt:Date.now(),source:`static`});Ug(r),Xg(r)}).catch(()=>{n||a(null)}),()=>{n=!0}},[e,t.conn]);let o=t.conn===`no-broker`&&i?.node_id===e?i:null,s=(0,v.useMemo)(()=>o===null?null:tg(o.snapshot),[o]),c=(0,v.useMemo)(()=>t.session===null?null:{...t.session,isStreaming:t.conv.isStreaming},[t.session,t.conv.isStreaming]),l=(0,v.useMemo)(()=>t.conn===`connecting`||t.conn===`closed`?null:o===null?c:v_(e,o.snapshot),[e,o,t.conn,c]),u=(0,v.useMemo)(()=>o===null?{...__,model:t.model??null}:{...__,model:o.snapshot.state?.model??null},[o,t.model]),d=s?.messages??t.conv.messages,f=s?.partialToolResults??t.conv.partialToolResults,p=s?.executingToolIds??t.conv.executingToolIds,m=s?.queued??t.conv.queued,h=o?.commands??t.commands;return{messages:d,partialToolResults:f,executingToolIds:p,queued:m,state:l,role:t.role,chrome:u,dialog:t.dialog,commands:h,presence:{viewers:0,controller:t.controllerId},brokerStatus:t.conn===`open`?`connected`:t.conn===`closed`||t.conn===`connecting`?`reconnecting`:`down`,source:t.conn===`no-broker`?`static`:`broker`,serverConnected:r,socketReady:t.conn===`open`,error:t.notice?{code:`broker_unavailable`,message:t.notice}:null,reconnect:n.reconnect,prompt:e=>n.sendText(e),steer:e=>n.sendText(e),abort:n.abort,setModel:n.setModel,cycleModel:n.cycleModel,setThinkingLevel:n.setThinkingLevel,compact:n.compact,requestControl:n.takeControl,releaseControl:n.releaseControl,dialogResponse:(e,t)=>n.answerDialog({type:`extension_ui_response`,id:e,...t})}}var b_=400,x_=4e3;function S_(e){return e.dormant&&e.status===`active`&&e.socketReady&&e.attempt<8}function C_(e){return Math.min(x_,b_*2**Math.max(0,e))}var w_=1,T_=400;function E_(e){return`crtr.web.draft.${e}`}function D_(e,t){if(typeof t!=`object`||!t)return!1;let n=t;return n.schemaVersion===w_&&n.nodeId===e&&typeof n.text==`string`&&typeof n.updatedAt==`number`}function O_(e){try{let t=globalThis.localStorage?.getItem(E_(e));if(t==null)return``;let n=JSON.parse(t);return D_(e,n)?n.text:``}catch{return``}}function k_(e,t){let n={schemaVersion:w_,nodeId:e,text:t,updatedAt:Date.now()};try{globalThis.localStorage?.setItem(E_(e),JSON.stringify(n))}catch{}}function A_(e){try{globalThis.localStorage?.removeItem(E_(e))}catch{}}var j_=new Map;function M_(e,t){let n=j_.get(e);n&&clearTimeout(n);let r=setTimeout(()=>{j_.delete(e),t===``?A_(e):k_(e,t)},T_);j_.set(e,r)}function N_(e){let t=j_.get(e);t&&(clearTimeout(t),j_.delete(e))}function P_(e){let t=y_(e),[n,r]=(0,v.useState)(null);(0,v.useEffect)(()=>(h_.focus(e),()=>{h_.background(e)}),[e]);let[i,a]=(0,v.useState)(``);(0,v.useEffect)(()=>{a(O_(e))},[e]),(0,v.useEffect)(()=>{M_(e,i)},[e,i]);let[o,s]=(0,v.useState)(!1),[c,l]=(0,v.useState)(null),[u,d]=(0,v.useState)(null),f=t.source===`static`,p=t.brokerStatus===`connected`,m=t.role===`controller`,h=t.state?.isStreaming??!1,g=m&&!f&&p&&t.serverConnected,_=t.commands;(0,v.useEffect)(()=>{let t=!1;return qf(e).then(e=>{t||r(e)}).catch(e=>{t||l(F_(e))}),()=>{t=!0}},[e]);let y=(0,v.useRef)(0);(0,v.useEffect)(()=>{y.current=0},[e]),(0,v.useEffect)(()=>{if(!S_({dormant:f,status:n?.status,socketReady:t.socketReady,attempt:y.current}))return;let e=y.current;y.current+=1;let r=setTimeout(()=>t.reconnect(),C_(e));return()=>clearTimeout(r)},[f,n?.status,t.socketReady,t.reconnect]);let b=()=>{let n=i.trim();!n||!g||(h?t.steer(n):t.prompt(n),N_(e),A_(e),a(``))};return{store:t,detail:n,input:i,setInput:a,reviving:o,actionError:c,peekedPath:u,setPeekedPath:d,dormant:f,brokerUp:p,isController:m,streaming:h,canDrive:g,commands:_,sendPrimary:b,onInputKeyDown:e=>{Jm(e,a,b)},selectCommand:e=>{a(`/${e.name} `)},doRevive:async()=>{s(!0),l(null);try{await Zf(e),t.reconnect()}catch(e){l(F_(e))}finally{s(!1)}},doClose:async()=>{l(null);try{await Qf(e)}catch(e){l(F_(e))}}}}function F_(e){return e instanceof Uf?`${e.code}: ${e.message}`:String(e)}function I_(e){let t=(0,v.useMemo)(()=>{let t=e.query;return t.startsWith(`/`)?t.slice(1).trimStart().toLowerCase():``},[e.query]),n=(0,v.useMemo)(()=>{let n=e.commands;return t?n.filter(e=>e.name.toLowerCase().includes(t)||e.description.toLowerCase().includes(t)||e.source.toLowerCase().includes(t)):n},[t,e.commands]);return e.visible?(0,B.jsx)(`div`,{className:`absolute bottom-full left-0 right-0 z-20 mb-1 max-h-72 overflow-auto border border-border bg-popover`,children:n.length>0?(0,B.jsx)(`ul`,{className:`flex flex-col divide-y divide-border/40`,children:n.map(t=>(0,B.jsxs)(`li`,{className:`flex cursor-pointer flex-wrap items-baseline gap-x-2 gap-y-0.5 px-3 py-2 hover:bg-accent/50`,onClick:()=>e.onSelect(t),children:[(0,B.jsxs)(`span`,{className:`font-mono text-sm font-semibold text-primary`,children:[`/`,t.name]}),t.argument_hint&&(0,B.jsx)(`span`,{className:`font-mono text-xs text-muted-foreground/70`,children:t.argument_hint}),(0,B.jsxs)(`span`,{className:`ml-auto font-mono text-xs text-muted-foreground/50`,children:[t.source,t.location&&(0,B.jsxs)(B.Fragment,{children:[` · `,t.location]})]}),(0,B.jsx)(`span`,{className:`basis-full text-xs text-muted-foreground`,children:t.description})]},t.name))}):(0,B.jsx)(`div`,{className:`px-3 py-2 text-xs italic text-muted-foreground`,children:`no matching commands`})}):null}var L_=new Set([`select`,`confirm`,`input`,`editor`,`notify`]);function R_(e){return L_.has(e.method)}function z_(e){let t=e.store.dialog,n=t&&R_(t)?t:null,r=e.store.role===`controller`;return(0,B.jsx)(Dp,{open:n!==null,children:(0,B.jsx)(Ap,{showCloseButton:!1,className:n&&!r?`opacity-90`:void 0,children:n&&(r?(0,B.jsx)(U_,{req:n,store:e.store},n.id):(0,B.jsx)(B_,{req:n},n.id))})})}function B_(e){return(0,B.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,B.jsx)(`p`,{className:`text-sm font-semibold`,children:`The controller is being prompted`}),(0,B.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:H_(e.req)})]})}function V_(e){switch(e){case`error`:return`border-destructive/40 text-destructive`;case`warning`:return`border-warning/40 text-warning`;case`success`:return`border-success/40 text-success`;default:return`border-border text-foreground`}}function H_(e){switch(e.method){case`select`:return`${e.title} — ${e.options.length} options`;case`confirm`:return`${e.title}: ${e.message}`;case`input`:return e.title;case`editor`:return e.title;case`notify`:return e.message}}function U_(e){let t=()=>e.store.dialogResponse(e.req.id,{cancelled:!0});return e.req.method===`select`?(0,B.jsx)(W_,{req:e.req,store:e.store,cancel:t}):(0,B.jsx)(G_,{req:e.req,store:e.store,cancel:t})}function W_(e){return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(jp,{children:(0,B.jsx)(Np,{children:e.req.title})}),(0,B.jsx)(`ul`,{className:`flex flex-col gap-2`,children:e.req.options.map(t=>(0,B.jsx)(`li`,{children:(0,B.jsx)(Z,{variant:`secondary`,className:`w-full justify-start`,onClick:()=>e.store.dialogResponse(e.req.id,{value:t}),children:t})},t))}),(0,B.jsx)(Mp,{children:(0,B.jsx)(Z,{type:`button`,variant:`secondary`,onClick:e.cancel,children:`Cancel`})})]})}function G_(e){let[t,n]=(0,v.useState)(e.req.method===`editor`?e.req.prefill??``:``);if(e.req.method===`confirm`){let t=e.req;return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(jp,{children:(0,B.jsx)(Np,{children:t.title})}),(0,B.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:t.message}),(0,B.jsxs)(Mp,{children:[(0,B.jsx)(Z,{variant:`secondary`,onClick:()=>e.store.dialogResponse(t.id,{confirmed:!1}),children:`No`}),(0,B.jsx)(Z,{onClick:()=>e.store.dialogResponse(t.id,{confirmed:!0}),children:`Yes`})]})]})}if(e.req.method===`input`||e.req.method===`editor`){let r=e.req;return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(jp,{children:(0,B.jsx)(Np,{children:r.title})}),r.method===`editor`?(0,B.jsx)(Wp,{className:`resize-none font-mono text-sm`,rows:8,value:t,onChange:e=>n(e.currentTarget.value),autoFocus:!0}):(0,B.jsx)(Fp,{placeholder:r.placeholder??``,value:t,onChange:e=>n(e.currentTarget.value),autoFocus:!0}),(0,B.jsxs)(Mp,{children:[(0,B.jsx)(Z,{type:`button`,variant:`secondary`,onClick:e.cancel,children:`Cancel`}),(0,B.jsx)(Z,{onClick:()=>e.store.dialogResponse(r.id,{value:t}),children:`Submit`})]})]})}if(e.req.method===`notify`){let t=e.req;return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`p`,{className:Y(`rounded-none border px-3 py-2 text-sm`,V_(t.notifyType)),children:t.message}),(0,B.jsx)(Mp,{children:(0,B.jsx)(Z,{onClick:()=>e.store.dialogResponse(t.id,{confirmed:!0}),children:`OK`})})]})}return null}function K_(e,t,n){let r=Array(e);return new Proxy(r,{get(r,i,a){if(typeof i==`string`){let a=i.charCodeAt(0);if(a>=48&&a<=57){let a=+i;if(Number.isInteger(a)&&a>=0&&a<e){let e=r[a];if(!e){let i=t[a*2];e=r[a]={index:a,key:n(a),start:i,size:t[a*2+1],end:i+t[a*2+1],lane:0}}return e}}if(i===`length`)return e}return Reflect.get(r,i,a)}})}function q_(e,t,n){let r=n.initialDeps??[],i,a=!0;function o(){let o=e();return o.length!==r.length||o.some((e,t)=>r[t]!==e)?(r=o,i=t(...o),n?.onChange&&!(a&&n.skipInitialOnChange)&&n.onChange(i),a=!1,i):i}return o.updateDeps=e=>{r=e},o}function J_(e,t){if(e===void 0)throw Error(`Unexpected undefined${t?`: ${t}`:``}`);return e}var Y_=(e,t)=>Math.abs(e-t)<1.01,X_=(e,t,n)=>{let r;return function(...i){e.clearTimeout(r),r=e.setTimeout(()=>t.apply(this,i),n)}},Z_,Q_=()=>{if(Z_!==void 0)return Z_;if(typeof navigator>`u`)return Z_=!1;if(/iP(hone|od|ad)/.test(navigator.userAgent))return Z_=!0;let e=navigator.maxTouchPoints;return Z_=navigator.platform===`MacIntel`&&e!==void 0&&e>0},$_=e=>{let{offsetWidth:t,offsetHeight:n}=e;return{width:t,height:n}},ev=e=>e,tv=e=>{let t=Math.max(e.startIndex-e.overscan,0),n=Math.min(e.endIndex+e.overscan,e.count-1)-t+1,r=Array(n);for(let e=0;e<n;e++)r[e]=t+e;return r},nv=(e,t)=>{let n=e.scrollElement;if(!n)return;let r=e.targetWindow;if(!r)return;let i=e=>{let{width:n,height:r}=e;t({width:Math.round(n),height:Math.round(r)})};if(i($_(n)),!r.ResizeObserver)return()=>{};let a=new r.ResizeObserver(t=>{let r=()=>{let e=t[0];if(e?.borderBoxSize){let t=e.borderBoxSize[0];if(t){i({width:t.inlineSize,height:t.blockSize});return}}i($_(n))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(r):r()});return a.observe(n,{box:`border-box`}),()=>{a.unobserve(n)}},rv={passive:!0},iv=typeof window>`u`||`onscrollend`in window,av=(e,t,n)=>{let r=e.scrollElement;if(!r)return;let i=e.targetWindow;if(!i)return;let a=e.options.useScrollendEvent&&iv,o=0,s=a?null:X_(i,()=>t(o,!1),e.options.isScrollingResetDelay),c=e=>()=>{o=n(r),s?.(),t(o,e)},l=c(!0),u=c(!1);return r.addEventListener(`scroll`,l,rv),a&&r.addEventListener(`scrollend`,u,rv),()=>{r.removeEventListener(`scroll`,l),a&&r.removeEventListener(`scrollend`,u)}},ov=(e,t)=>av(e,t,t=>{let{horizontal:n,isRtl:r}=e.options;return n?t.scrollLeft*(r&&-1||1):t.scrollTop}),sv=(e,t,n)=>{if(n.options.useCachedMeasurements){let t=n.indexFromElement(e),r=n.options.getItemKey(t);return n.itemSizeCache.get(r)??n.options.estimateSize(t)}if(t?.borderBoxSize){let e=t.borderBoxSize[0];if(e)return Math.round(e[n.options.horizontal?`inlineSize`:`blockSize`])}if(!t){let t=n.indexFromElement(e),r=n.options.getItemKey(t),i=n.itemSizeCache.get(r);if(i!==void 0)return i}return e[n.options.horizontal?`offsetWidth`:`offsetHeight`]},cv=(e,{adjustments:t=0,behavior:n},r)=>{var i,a;(a=(i=r.scrollElement)?.scrollTo)==null||a.call(i,{[r.options.horizontal?`left`:`top`]:e+t,behavior:n})},lv=class{constructor(e){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this._flatMeasurements=null,this.itemSizeCache=new Map,this.itemSizeCacheVersion=0,this.laneAssignments=new Map,this.pendingMin=null,this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.pendingScrollAnchor=null,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._intendedScrollOffset=null,this.elementsCache=new Map,this.now=()=>{var e;return((e=this.targetWindow?.performance)?.now)?.call(e)??Date.now()},this.observer=(()=>{let e=null,t=()=>e||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:e=new this.targetWindow.ResizeObserver(e=>{e.forEach(e=>{let t=()=>{let t=e.target,n=this.indexFromElement(t);if(!t.isConnected){this.observer.unobserve(t);for(let[e,n]of this.elementsCache)if(n===t){this.elementsCache.delete(e);break}return}this.shouldMeasureDuringScroll(n)&&this.resizeItem(n,this.options.measureElement(t,e,this))};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(t):t()})}));return{disconnect:()=>{var n;(n=t())==null||n.disconnect(),e=null},observe:e=>t()?.observe(e,{box:`border-box`}),unobserve:e=>t()?.unobserve(e)}})(),this.range=null,this.setOptions=e=>{let t={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:ev,rangeExtractor:tv,onChange:()=>{},measureElement:sv,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:`data-index`,initialMeasurementsCache:[],lanes:1,anchorTo:`start`,followOnAppend:!1,scrollEndThreshold:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,laneAssignmentMode:`estimate`,useCachedMeasurements:!1};for(let n in e){let r=e[n];r!==void 0&&(t[n]=r)}let n=this.options,r=null,i=null,a=!1;if(n!==void 0&&n.enabled&&t.enabled&&t.anchorTo===`end`&&this.scrollElement!==null){let e=n.count,o=t.count,s=this.getMeasurements(),c=e>0?s[0]?.key??n.getItemKey(0):null,l=e>0?s[e-1]?.key??n.getItemKey(e-1):null;if(o!==e||e>0&&o>0&&(t.getItemKey(0)!==c||t.getItemKey(o-1)!==l)){a=!0;let c=e>0?this.getVirtualItemForOffset(this.getScrollOffset())??s[0]:null;c&&(r=[c.key,this.getScrollOffset()-c.start]);let u=t.followOnAppend===!0?`auto`:t.followOnAppend||null;u&&o>e&&this.isAtEnd(n.scrollEndThreshold)&&(e===0||t.getItemKey(o-1)!==l)&&(i=u)}}this.options=t,a&&(this.pendingMin=0,this.itemSizeCacheVersion++);let o=!1,s=0;if(r&&this.scrollOffset!==null){let[e,t]=r,n=this.getMeasurements(),{count:i,getItemKey:a}=this.options,c=0;for(;c<i&&a(c)!==e;)c++;if(c<i){let e=n[c];if(e){let n=e.start+t;n!==this.scrollOffset&&(s=n-this.scrollOffset,this.scrollOffset=n,o=!0)}}}(o||i)&&(this.pendingScrollAnchor=[o?r[0]:null,o?r[1]:0,i,s])},this.notify=e=>{var t,n;(n=(t=this.options).onChange)==null||n.call(t,this,e)},this.maybeNotify=q_(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),e=>{this.notify(e)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(e=>e()),this.unsubs=[],this.observer.disconnect(),this.rafId!=null&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null,this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{let e=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==e){if(this.cleanup(),!e){this.maybeNotify();return}if(this.scrollElement=e,this.scrollElement&&`ownerDocument`in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=this.scrollElement?.window??null,this.elementsCache.forEach(e=>{this.observer.observe(e)}),this.unsubs.push(this.options.observeElementRect(this,e=>{this.scrollRect=e,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(e,t)=>{if(t&&this._intendedScrollOffset===null&&e===this.scrollOffset)return;this._intendedScrollOffset!==null&&Math.abs(e-this._intendedScrollOffset)<1.5&&(e=this._intendedScrollOffset),this._intendedScrollOffset=null,this.scrollAdjustments=0;let n=this.getScrollOffset();this.scrollDirection=t?n===e?this.scrollDirection:n<e?`forward`:`backward`:null,this.scrollOffset=e,this.isScrolling=t,this._flushIosDeferredIfReady(),this.scrollState&&this.scheduleScrollReconcile(),this.maybeNotify()})),`addEventListener`in this.scrollElement){let e=this.scrollElement,t=()=>{this._iosTouching=!0,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)},n=()=>{this._iosTouching=!1,!(!Q_()||this.targetWindow==null)&&(this._iosJustTouchEnded=!0,this._iosTouchEndTimerId=this.targetWindow.setTimeout(()=>{this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._flushIosDeferredIfReady()},150))};e.addEventListener(`touchstart`,t,rv),e.addEventListener(`touchend`,n,rv),this.unsubs.push(()=>{e.removeEventListener(`touchstart`,t),e.removeEventListener(`touchend`,n),this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)})}this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}let t=this.pendingScrollAnchor;if(this.pendingScrollAnchor=null,t&&this.scrollElement&&this.options.enabled){let[e,n,r,i]=t;e!==null&&!r&&(Q_()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?i!==0&&(this._iosDeferredAdjustment+=i):this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})),r&&this.scrollToEnd({behavior:r})}},this._flushIosDeferredIfReady=()=>{if(this._iosDeferredAdjustment===0||this.isScrolling||this._iosTouching||this._iosJustTouchEnded)return;let e=this.getScrollOffset(),t=this.getMaxScrollOffset();if(e<0||e>t)return;let n=this._iosDeferredAdjustment;this._iosDeferredAdjustment=0,this._scrollToOffset(e,{adjustments:this.scrollAdjustments+=n,behavior:void 0})},this.rafId=null,this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?`width`:`height`]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset==`function`?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(e,t)=>{let n=new Map,r=new Map;for(let i=t-1;i>=0;i--){let t=e[i];if(n.has(t.lane))continue;let a=r.get(t.lane);if(a==null||t.end>a.end?r.set(t.lane,t):t.end<a.end&&n.set(t.lane,!0),n.size===this.options.lanes)break}return r.size===this.options.lanes?Array.from(r.values()).sort((e,t)=>e.end===t.end?e.index-t.index:e.end-t.end)[0]:void 0},this.getMeasurementOptions=q_(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes,this.options.laneAssignmentMode],(e,t,n,r,i,a,o)=>(this.prevLanes!==void 0&&this.prevLanes!==a&&(this.lanesChangedFlag=!0),this.prevLanes=a,this.pendingMin=null,{count:e,paddingStart:t,scrollMargin:n,getItemKey:r,enabled:i,lanes:a,laneAssignmentMode:o}),{key:!1}),this.getMeasurements=q_(()=>[this.getMeasurementOptions(),this.itemSizeCacheVersion],({count:e,paddingStart:t,scrollMargin:n,getItemKey:r,enabled:i,lanes:a,laneAssignmentMode:o},s)=>{let c=this.itemSizeCache;if(!i)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>e)for(let t of this.laneAssignments.keys())t>=e&&this.laneAssignments.delete(t);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMin=null),this.measurementsCache.length===0&&!this.lanesSettling&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(e=>{this.itemSizeCache.set(e.key,e.size)}));let l=this.lanesSettling?0:this.pendingMin??0;if(this.pendingMin=null,this.lanesSettling&&this.measurementsCache.length===e&&(this.lanesSettling=!1),a===1){let i=this.options.gap,a=e*2,o=this._flatMeasurements;if(!o||o.length<a){let e=new Float64Array(a);o&&l>0&&e.set(o.subarray(0,l*2)),o=e,this._flatMeasurements=o}let s;if(l===0)s=t+n;else{let e=l-1;s=o[e*2]+o[e*2+1]+i}for(let t=l;t<e;t++){let e=r(t),n=c.get(e),a=typeof n==`number`?n:this.options.estimateSize(t);o[t*2]=s,o[t*2+1]=a,s+=a+i}let u=K_(e,o,r);return this.measurementsCache=u,u}let u=this.measurementsCache.slice(0,l),d=Array(a).fill(void 0);for(let e=0;e<l;e++){let t=u[e];t&&(d[t.lane]=e)}for(let i=l;i<e;i++){let e=r(i),a=this.laneAssignments.get(i),s,l,f=o===`estimate`||c.has(e);if(a!==void 0&&this.options.lanes>1){s=a;let e=d[s],r=e===void 0?void 0:u[e];l=r?r.end+this.options.gap:t+n}else{let e=this.options.lanes===1?u[i-1]:this.getFurthestMeasurement(u,i);l=e?e.end+this.options.gap:t+n,s=e?e.lane:i%this.options.lanes,this.options.lanes>1&&f&&this.laneAssignments.set(i,s)}let p=c.get(e),m=typeof p==`number`?p:this.options.estimateSize(i),h=l+m;u[i]={index:i,start:l,size:m,end:h,key:e,lane:s},d[s]=i}return this.measurementsCache=u,u},{key:!1,debug:()=>this.options.debug}),this.calculateRange=q_(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(e,t,n,r)=>e.length===0||t===0?(this.range=null,null):(this.range=fv(e,t,n,r,r===1&&this._flatMeasurements!=null?this._flatMeasurements:null),this.range),{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=q_(()=>{let e=null,t=null,n=this.calculateRange();return n&&(e=n.startIndex,t=n.endIndex),this.maybeNotify.updateDeps([this.isScrolling,e,t]),[this.options.rangeExtractor,this.options.overscan,this.options.count,e,t]},(e,t,n,r,i)=>r===null||i===null?[]:e({startIndex:r,endIndex:i,overscan:t,count:n}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=e=>{let t=this.options.indexAttribute,n=e.getAttribute(t);return n?parseInt(n,10):(console.warn(`Missing attribute name '${t}={index}' on measured element.`),-1)},this.shouldMeasureDuringScroll=e=>{if(!this.scrollState||this.scrollState.behavior!==`smooth`)return!0;let t=this.scrollState.index??this.getVirtualItemForOffset(this.scrollState.lastTargetOffset)?.index;if(t!==void 0&&this.range){let n=Math.max(this.options.overscan,Math.ceil((this.range.endIndex-this.range.startIndex)/2)),r=Math.max(0,t-n),i=Math.min(this.options.count-1,t+n);return e>=r&&e<=i}return!0},this.measureElement=e=>{if(!e){this.elementsCache.forEach((e,t)=>{e.isConnected||(this.observer.unobserve(e),this.elementsCache.delete(t))});return}let t=this.indexFromElement(e),n=this.options.getItemKey(t),r=this.elementsCache.get(n);r!==e&&(r&&this.observer.unobserve(r),this.observer.observe(e),this.elementsCache.set(n,e)),(!this.isScrolling||this.scrollState)&&this.shouldMeasureDuringScroll(t)&&this.resizeItem(t,this.options.measureElement(e,void 0,this))},this.resizeItem=(e,t)=>{if(e<0||e>=this.options.count)return;let n,r,i,a=this._flatMeasurements;if(this.options.lanes===1&&a!==null)i=this.options.getItemKey(e),r=a[e*2],n=a[e*2+1];else{let t=this.measurementsCache[e];if(!t)return;i=t.key,r=t.start,n=t.size}let o=t-(this.itemSizeCache.get(i)??n);if(o!==0){let a=this.options.anchorTo===`end`&&this.scrollState?.behavior!==`smooth`&&this.getVirtualDistanceFromEnd()<=this.options.scrollEndThreshold,s=a?this.getTotalSize():0,c=this.scrollState?.behavior!==`smooth`&&(this.shouldAdjustScrollPositionOnItemSizeChange===void 0?r<this.getScrollOffset()+this.scrollAdjustments&&(!this.itemSizeCache.has(i)||this.scrollDirection!==`backward`):this.shouldAdjustScrollPositionOnItemSizeChange(this.measurementsCache[e]??{index:e,key:i,start:r,size:n,end:r+n,lane:0},o,this));(this.pendingMin===null||e<this.pendingMin)&&(this.pendingMin=e),this.itemSizeCache.set(i,t),this.itemSizeCacheVersion++,a?this.applyScrollAdjustment(this.getTotalSize()-s):c&&this.applyScrollAdjustment(o),this.notify(!1)}},this.getVirtualItems=q_(()=>[this.getVirtualIndexes(),this.getMeasurements()],(e,t)=>{let n=[];for(let r=0,i=e.length;r<i;r++){let i=t[e[r]];n.push(i)}return n},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=e=>{let t=this.getMeasurements();if(t.length===0)return;let n=this._flatMeasurements,r=this.options.lanes===1&&n!=null;return J_(t[uv(0,t.length-1,r?e=>n[e*2]:e=>J_(t[e]).start,e)])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if(`scrollHeight`in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{let e=this.scrollElement.document.documentElement;return this.options.horizontal?e.scrollWidth-this.scrollElement.innerWidth:e.scrollHeight-this.scrollElement.innerHeight}},this.getVirtualDistanceFromEnd=()=>Math.max(this.getTotalSize()-this.getSize()-this.getScrollOffset(),0),this.getDistanceFromEnd=()=>Math.max(this.getMaxScrollOffset()-this.getScrollOffset(),0),this.isAtEnd=(e=this.options.scrollEndThreshold)=>this.getDistanceFromEnd()<=e,this.getOffsetForAlignment=(e,t,n=0)=>{if(!this.scrollElement)return 0;let r=this.getSize(),i=this.getScrollOffset();t===`auto`&&(t=e>=i+r?`end`:`start`),t===`center`?e+=(n-r)/2:t===`end`&&(e-=r);let a=this.getMaxScrollOffset();return Math.max(Math.min(a,e),0)},this.getOffsetForIndex=(e,t=`auto`)=>{e=Math.max(0,Math.min(e,this.options.count-1));let n=this.getSize(),r=this.getScrollOffset(),i=this.measurementsCache[e];if(!i)return;if(t===`auto`)if(i.end>=r+n-this.options.scrollPaddingEnd)t=`end`;else if(i.start<=r+this.options.scrollPaddingStart)t=`start`;else return[r,t];if(t===`end`&&e===this.options.count-1)return[this.getMaxScrollOffset(),t];let a=t===`end`?i.end+this.options.scrollPaddingEnd:i.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(a,t,i.size),t]},this.scrollToOffset=(e,{align:t=`start`,behavior:n=`auto`}={})=>{let r=this.getOffsetForAlignment(e,t),i=this.now();this.scrollState={index:null,align:t,behavior:n,startedAt:i,lastTargetOffset:r,stableFrames:0},this._scrollToOffset(r,{adjustments:void 0,behavior:n}),this.scheduleScrollReconcile()},this.scrollToIndex=(e,{align:t=`auto`,behavior:n=`auto`}={})=>{e=Math.max(0,Math.min(e,this.options.count-1));let r=this.getOffsetForIndex(e,t);if(!r)return;let[i,a]=r,o=this.now();this.scrollState={index:e,align:a,behavior:n,startedAt:o,lastTargetOffset:i,stableFrames:0},this._scrollToOffset(i,{adjustments:void 0,behavior:n}),this.scheduleScrollReconcile()},this.scrollBy=(e,{behavior:t=`auto`}={})=>{let n=this.getScrollOffset()+e,r=this.now();this.scrollState={index:null,align:`start`,behavior:t,startedAt:r,lastTargetOffset:n,stableFrames:0},this._scrollToOffset(n,{adjustments:void 0,behavior:t}),this.scheduleScrollReconcile()},this.scrollToEnd=({behavior:e=`auto`}={})=>{if(this.options.count>0){this.scrollToIndex(this.options.count-1,{align:`end`,behavior:e});return}this.scrollToOffset(Math.max(this.getTotalSize()-this.getSize(),0),{behavior:e})},this.getTotalSize=()=>{let e=this.getMeasurements(),t;if(e.length===0)t=this.options.paddingStart;else if(this.options.lanes===1){let n=e.length-1,r=this._flatMeasurements;t=r==null?e[n]?.end??0:r[n*2]+r[n*2+1]}else{let n=Array(this.options.lanes).fill(null),r=e.length-1;for(;r>=0&&n.some(e=>e===null);){let t=e[r];n[t.lane]===null&&(n[t.lane]=t.end),r--}t=Math.max(...n.filter(e=>e!==null))}return Math.max(t-this.options.scrollMargin+this.options.paddingEnd,0)},this.takeSnapshot=()=>{let e=[];if(this.itemSizeCache.size===0)return e;let t=this.getMeasurements();for(let n of t)n&&this.itemSizeCache.has(n.key)&&e.push({index:n.index,key:n.key,start:n.start,size:n.size,end:n.end,lane:n.lane});return e},this._scrollToOffset=(e,{adjustments:t,behavior:n})=>{this._intendedScrollOffset=e+(t??0),this.options.scrollToFn(e,{behavior:n,adjustments:t},this)},this.measure=()=>{this.pendingMin=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),this.itemSizeCacheVersion++,this.notify(!1)},this.setOptions(e)}applyScrollAdjustment(e,t){e!==0&&(Q_()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?this._iosDeferredAdjustment+=e:(this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=e,behavior:t}),this.scrollOffset!==null&&(this.scrollOffset+=this.scrollAdjustments,this.scrollAdjustments=0)))}scheduleScrollReconcile(){if(!this.targetWindow){this.scrollState=null;return}this.rafId??=this.targetWindow.requestAnimationFrame(()=>{this.rafId=null,this.reconcileScroll()})}reconcileScroll(){if(!this.scrollState||!this.scrollElement)return;if(this.now()-this.scrollState.startedAt>5e3){this.scrollState=null;return}let e=this.scrollState.index==null?void 0:this.getOffsetForIndex(this.scrollState.index,this.scrollState.align),t=e?e[0]:this.scrollState.lastTargetOffset,n=t!==this.scrollState.lastTargetOffset;if(!n&&Y_(t,this.getScrollOffset())){if(this.scrollState.stableFrames++,this.scrollState.stableFrames>=1){this.getScrollOffset()!==t&&this._scrollToOffset(t,{adjustments:void 0,behavior:`auto`}),this.scrollState=null;return}}else if(this.scrollState.stableFrames=0,n){let e=this.getSize()||600,n=Math.abs(t-this.getScrollOffset()),r=this.scrollState.behavior===`smooth`&&n>e;this.scrollState.lastTargetOffset=t,r||(this.scrollState.behavior=`auto`),this._scrollToOffset(t,{adjustments:void 0,behavior:r?`smooth`:`auto`})}this.scheduleScrollReconcile()}},uv=(e,t,n,r)=>{for(;e<=t;){let i=(e+t)/2|0,a=n(i);if(a<r)e=i+1;else if(a>r)t=i-1;else return i}return e>0?e-1:0};function dv(e,t,n){let r=0;for(;r<=t;){let i=(r+t)/2|0,a=e[i*2];if(a<n)r=i+1;else if(a>n)t=i-1;else return i}return r>0?r-1:0}function fv(e,t,n,r,i){let a=e.length-1;if(e.length<=r)return{startIndex:0,endIndex:a};if(r===1&&i!==null){let e=dv(i,a,n),r=e,o=n+t;for(;r<a&&i[r*2]+i[r*2+1]<o;)r++;return{startIndex:e,endIndex:r}}let o=uv(0,a,t=>e[t].start,n),s=o;if(r===1)for(;s<a&&e[s].end<n+t;)s++;else if(r>1){let i=Array(r).fill(0);for(;s<a&&i.some(e=>e<n+t);){let t=e[s];i[t.lane]=t.end,s++}let c=Array(r).fill(n+t);for(;o>=0&&c.some(e=>e>=n);){let t=e[o];c[t.lane]=t.start,o--}o=Math.max(0,o-o%r),s=Math.min(a,s+(r-1-s%r))}return{startIndex:o,endIndex:s}}var pv=typeof document<`u`?v.useLayoutEffect:v.useEffect;function mv({useFlushSync:e=!0,directDomUpdates:t=!1,directDomUpdatesMode:n=`transform`,...r}){let i=v.useReducer(e=>e+1,0)[1],a=v.useRef({enabled:t,mode:n,container:null,lastSize:null,lastPositions:new WeakMap,prevRange:null});a.current.enabled=t,a.current.mode=n;let o=e=>{let t=a.current;if(!t.enabled||!t.container)return;let n=e.getTotalSize();if(n!==t.lastSize){t.lastSize=n;let r=e.options.horizontal?`width`:`height`;t.container.style[r]=`${n}px`}let r=!!e.options.horizontal,i=t.mode===`transform`,o=r?`left`:`top`,s=e.options.scrollMargin,c=e.getVirtualItems();for(let n of c){let a=n.start-s,c=e.elementsCache.get(n.key);c&&t.lastPositions.get(c)!==a&&(t.lastPositions.set(c,a),i?c.style.transform=r?`translate3d(${a}px, 0, 0)`:`translate3d(0, ${a}px, 0)`:c.style[o]=`${a}px`)}},s={...r,onChange:(t,n)=>{var s;let c=a.current,l=!0;if(c.enabled){o(t);let e=t.range,n=c.prevRange;l=!n||n.isScrolling!==t.isScrolling||n.startIndex!==e?.startIndex||n.endIndex!==e?.endIndex,l&&(c.prevRange=e?{startIndex:e.startIndex,endIndex:e.endIndex,isScrolling:t.isScrolling}:null)}l&&(e&&n?(0,y.flushSync)(i):i()),(s=r.onChange)==null||s.call(r,t,n)}},[c]=v.useState(()=>{let e=new lv(s);return Object.assign(e,{containerRef:t=>{let n=a.current;if(n.container=t,n.lastSize=null,t&&n.enabled){let r=e.getTotalSize();n.lastSize=r;let i=e.options.horizontal?`width`:`height`;t.style[i]=`${r}px`}}})});return c.setOptions(s),pv(()=>c._didMount(),[]),pv(()=>c._willUpdate()),pv(()=>{o(c)}),c}function hv(e){return mv({observeElementRect:nv,observeElementOffset:ov,scrollToFn:cv,...e})}var gv={};function _v(e){let t=gv[e];if(t)return t;t=gv[e]=[];for(let e=0;e<128;e++){let n=String.fromCharCode(e);t.push(n)}for(let n=0;n<e.length;n++){let r=e.charCodeAt(n);t[r]=`%`+(`0`+r.toString(16).toUpperCase()).slice(-2)}return t}function vv(e,t){typeof t!=`string`&&(t=vv.defaultChars);let n=_v(t);return e.replace(/(%[a-f0-9]{2})+/gi,function(e){let t=``;for(let r=0,i=e.length;r<i;r+=3){let a=parseInt(e.slice(r+1,r+3),16);if(a<128){t+=n[a];continue}if((a&224)==192&&r+3<i){let n=parseInt(e.slice(r+4,r+6),16);if((n&192)==128){let e=a<<6&1984|n&63;e<128?t+=`��`:t+=String.fromCharCode(e),r+=3;continue}}if((a&240)==224&&r+6<i){let n=parseInt(e.slice(r+4,r+6),16),i=parseInt(e.slice(r+7,r+9),16);if((n&192)==128&&(i&192)==128){let e=a<<12&61440|n<<6&4032|i&63;e<2048||e>=55296&&e<=57343?t+=`���`:t+=String.fromCharCode(e),r+=6;continue}}if((a&248)==240&&r+9<i){let n=parseInt(e.slice(r+4,r+6),16),i=parseInt(e.slice(r+7,r+9),16),o=parseInt(e.slice(r+10,r+12),16);if((n&192)==128&&(i&192)==128&&(o&192)==128){let e=a<<18&1835008|n<<12&258048|i<<6&4032|o&63;e<65536||e>1114111?t+=`����`:(e-=65536,t+=String.fromCharCode(55296+(e>>10),56320+(e&1023))),r+=9;continue}}t+=`�`}return t})}vv.defaultChars=`;/?:@&=+$,#`,vv.componentChars=``;var yv={};function bv(e){let t=yv[e];if(t)return t;t=yv[e]=[];for(let e=0;e<128;e++){let n=String.fromCharCode(e);/^[0-9a-z]$/i.test(n)?t.push(n):t.push(`%`+(`0`+e.toString(16).toUpperCase()).slice(-2))}for(let n=0;n<e.length;n++)t[e.charCodeAt(n)]=e[n];return t}function xv(e,t,n){typeof t!=`string`&&(n=t,t=xv.defaultChars),n===void 0&&(n=!0);let r=bv(t),i=``;for(let t=0,a=e.length;t<a;t++){let o=e.charCodeAt(t);if(n&&o===37&&t+2<a&&/^[0-9a-f]{2}$/i.test(e.slice(t+1,t+3))){i+=e.slice(t,t+3),t+=2;continue}if(o<128){i+=r[o];continue}if(o>=55296&&o<=57343){if(o>=55296&&o<=56319&&t+1<a){let n=e.charCodeAt(t+1);if(n>=56320&&n<=57343){i+=encodeURIComponent(e[t]+e[t+1]),t++;continue}}i+=`%EF%BF%BD`;continue}i+=encodeURIComponent(e[t])}return i}xv.defaultChars=`;/?:@&=+$,-_.!~*'()#`,xv.componentChars=`-_.!~*'()`;function Sv(e){let t=``;return t+=e.protocol||``,t+=e.slashes?`//`:``,t+=e.auth?e.auth+`@`:``,e.hostname&&e.hostname.indexOf(`:`)!==-1?t+=`[`+e.hostname+`]`:t+=e.hostname||``,t+=e.port?`:`+e.port:``,t+=e.pathname||``,t+=e.search||``,t+=e.hash||``,t}function Cv(){this.protocol=null,this.slashes=null,this.auth=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.pathname=null}var wv=/^([a-z0-9.+-]+:)/i,Tv=/:[0-9]*$/,Ev=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,Dv=[`%`,`/`,`?`,`;`,`#`,`'`,`{`,`}`,`|`,`\\`,`^`,"`",`<`,`>`,`"`,"`",` `,`\r`,`
|
|
52
|
-
`,` `],Ov=[`/`,`?`,`#`],kv=255,Av=/^[+a-z0-9A-Z_-]{0,63}$/,jv=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,Mv={javascript:!0,"javascript:":!0},Nv={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function Pv(e,t){if(e&&e instanceof Cv)return e;let n=new Cv;return n.parse(e,t),n}Cv.prototype.parse=function(e,t){let n,r,i,a=e;if(a=a.trim(),!t&&e.split(`#`).length===1){let e=Ev.exec(a);if(e)return this.pathname=e[1],e[2]&&(this.search=e[2]),this}let o=wv.exec(a);if(o&&(o=o[0],n=o.toLowerCase(),this.protocol=o,a=a.substr(o.length)),(t||o||a.match(/^\/\/[^@\/]+@[^@\/]+/))&&(i=a.substr(0,2)===`//`,i&&!(o&&Mv[o])&&(a=a.substr(2),this.slashes=!0)),!Mv[o]&&(i||o&&!Nv[o])){let e=-1;for(let t=0;t<Ov.length;t++)r=a.indexOf(Ov[t]),r!==-1&&(e===-1||r<e)&&(e=r);let t,n;n=e===-1?a.lastIndexOf(`@`):a.lastIndexOf(`@`,e),n!==-1&&(t=a.slice(0,n),a=a.slice(n+1),this.auth=t),e=-1;for(let t=0;t<Dv.length;t++)r=a.indexOf(Dv[t]),r!==-1&&(e===-1||r<e)&&(e=r);e===-1&&(e=a.length),a[e-1]===`:`&&e--;let i=a.slice(0,e);a=a.slice(e),this.parseHost(i),this.hostname=this.hostname||``;let o=this.hostname[0]===`[`&&this.hostname[this.hostname.length-1]===`]`;if(!o){let e=this.hostname.split(/\./);for(let t=0,n=e.length;t<n;t++){let n=e[t];if(n&&!n.match(Av)){let r=``;for(let e=0,t=n.length;e<t;e++)n.charCodeAt(e)>127?r+=`x`:r+=n[e];if(!r.match(Av)){let r=e.slice(0,t),i=e.slice(t+1),o=n.match(jv);o&&(r.push(o[1]),i.unshift(o[2])),i.length&&(a=i.join(`.`)+a),this.hostname=r.join(`.`);break}}}}this.hostname.length>kv&&(this.hostname=``),o&&(this.hostname=this.hostname.substr(1,this.hostname.length-2))}let s=a.indexOf(`#`);s!==-1&&(this.hash=a.substr(s),a=a.slice(0,s));let c=a.indexOf(`?`);return c!==-1&&(this.search=a.substr(c),a=a.slice(0,c)),a&&(this.pathname=a),Nv[n]&&this.hostname&&!this.pathname&&(this.pathname=``),this},Cv.prototype.parseHost=function(e){let t=Tv.exec(e);t&&(t=t[0],t!==`:`&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)};var Fv=s({decode:()=>vv,encode:()=>xv,format:()=>Sv,parse:()=>Pv}),Iv=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,Lv=/[\0-\x1F\x7F-\x9F]/,Rv=/[\xAD\u0600-\u0605\u061C\u06DD\u070F\u0890\u0891\u08E2\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB]|\uD804[\uDCBD\uDCCD]|\uD80D[\uDC30-\uDC3F]|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]/,zv=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061D-\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1B7D\u1B7E\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52-\u2E5D\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDEAD\uDF55-\uDF59\uDF86-\uDF89]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5A\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDEB9\uDF3C-\uDF3E]|\uD806[\uDC3B\uDD44-\uDD46\uDDE2\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2\uDF00-\uDF09]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8\uDF43-\uDF4F\uDFFF]|\uD809[\uDC70-\uDC74]|\uD80B[\uDFF1\uDFF2]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A\uDFE2]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]/,Bv=/[\$\+<->\^`\|~\xA2-\xA6\xA8\xA9\xAC\xAE-\xB1\xB4\xB8\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0384\u0385\u03F6\u0482\u058D-\u058F\u0606-\u0608\u060B\u060E\u060F\u06DE\u06E9\u06FD\u06FE\u07F6\u07FE\u07FF\u0888\u09F2\u09F3\u09FA\u09FB\u0AF1\u0B70\u0BF3-\u0BFA\u0C7F\u0D4F\u0D79\u0E3F\u0F01-\u0F03\u0F13\u0F15-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE\u0FCF\u0FD5-\u0FD8\u109E\u109F\u1390-\u1399\u166D\u17DB\u1940\u19DE-\u19FF\u1B61-\u1B6A\u1B74-\u1B7C\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2044\u2052\u207A-\u207C\u208A-\u208C\u20A0-\u20C0\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F\u218A\u218B\u2190-\u2307\u230C-\u2328\u232B-\u2426\u2440-\u244A\u249C-\u24E9\u2500-\u2767\u2794-\u27C4\u27C7-\u27E5\u27F0-\u2982\u2999-\u29D7\u29DC-\u29FB\u29FE-\u2B73\u2B76-\u2B95\u2B97-\u2BFF\u2CE5-\u2CEA\u2E50\u2E51\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFF\u3004\u3012\u3013\u3020\u3036\u3037\u303E\u303F\u309B\u309C\u3190\u3191\u3196-\u319F\u31C0-\u31E3\u31EF\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA700-\uA716\uA720\uA721\uA789\uA78A\uA828-\uA82B\uA836-\uA839\uAA77-\uAA79\uAB5B\uAB6A\uAB6B\uFB29\uFBB2-\uFBC2\uFD40-\uFD4F\uFDCF\uFDFC-\uFDFF\uFE62\uFE64-\uFE66\uFE69\uFF04\uFF0B\uFF1C-\uFF1E\uFF3E\uFF40\uFF5C\uFF5E\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFFC\uFFFD]|\uD800[\uDD37-\uDD3F\uDD79-\uDD89\uDD8C-\uDD8E\uDD90-\uDD9C\uDDA0\uDDD0-\uDDFC]|\uD802[\uDC77\uDC78\uDEC8]|\uD805\uDF3F|\uD807[\uDFD5-\uDFF1]|\uD81A[\uDF3C-\uDF3F\uDF45]|\uD82F\uDC9C|\uD833[\uDF50-\uDFC3]|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDEA\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85\uDE86]|\uD838[\uDD4F\uDEFF]|\uD83B[\uDCAC\uDCB0\uDD2E\uDEF0\uDEF1]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD0D-\uDDAD\uDDE6-\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDE60-\uDE65\uDF00-\uDFFF]|\uD83D[\uDC00-\uDED7\uDEDC-\uDEEC\uDEF0-\uDEFC\uDF00-\uDF76\uDF7B-\uDFD9\uDFE0-\uDFEB\uDFF0]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDCB0\uDCB1\uDD00-\uDE53\uDE60-\uDE6D\uDE70-\uDE7C\uDE80-\uDE88\uDE90-\uDEBD\uDEBF-\uDEC5\uDECE-\uDEDB\uDEE0-\uDEE8\uDEF0-\uDEF8\uDF00-\uDF92\uDF94-\uDFCA]/,Vv=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/,Hv=s({Any:()=>Iv,Cc:()=>Lv,Cf:()=>Rv,P:()=>zv,S:()=>Bv,Z:()=>Vv}),Uv=new Uint16Array(`ᵁ<Õıʊҝջאٵ۞ޢߖࠏઑඡ༉༦ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTLJNjǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲϏϢϸontourIntegraìȹoɴ\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲy;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱còJTabcdfgorstרׯؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ߂ߐĀiyޱrc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣসে্ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४ĀnrࢃgleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpwਖਛgȀLRlr৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼અઋp;椅y;䐜Ādl੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑඞcy;䐊cute;䅃ƀaeyહાron;䅇dil;䅅;䐝ƀgswે૰ativeƀMTV૨ediumSpace;怋hiĀcn૦ëeryThiîtedĀGLଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷreak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪௫ఄ಄ದൡඅ櫬Āoungruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater;EFGLSTஶஷ扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨setĀ;Eೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂෛ෧ขภยา฿ไlig;䅒cute耻Ó䃓Āiyීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲcr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬืde耻Õ䃕es;樷ml耻Ö䃖erĀBP๋Āar๐๓r;怾acĀek๚;揞et;掴arenthesis;揜ҀacfhilorsງຊຏຒດຝະrtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ檻cedesȀ;EST່້扺qual;檯lantEqual;扼ilde;找me;怳Ādpuct;戏ortionĀ;aȥl;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL憒ar;懥eftArrow;懄eiling;按oǵ\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄቕቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHcቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗ĀeiቻDzኀ\0ኇefore;戴a;䎘ĀcnኘkSpace;쀀 Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻Dzᕔ\0ᕛoWidtèa;䎖r;愨pf;愤cr;쀀𝒵ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒;Eaeiopᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;eᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;eᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰᝃᝈ០៦ᠹᡐᜍ᥈ᥰot;櫭ĀcrᛶkȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;tbrk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯᝳ;䎲;愶een;扬r;쀀𝔟gcostuvwឍឝឳេ៕៛ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀakoᠦᠵĀcn៲ᠣkƀlst֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ;敛;敘;攘;攔;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģbar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;elƀ;bhᥨᥩᥫ䁜;槅sub;柈ŬᥴlĀ;e怢t»pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭒\0᯽\0ᰌƀcprᦲute;䄇̀;abcdsᦿᧀᧄ᧕᧙戩nd;橄rcup;橉Āau᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r;Ecefms᩠ᩢᩫ᪤᪪旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ\0\0aĀ;t䀬;䁀ƀ;fl戁îᅠeĀmxent»eóɍǧ\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯delprvw᭠᭬᭷ᮂᮬᯔarrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;pᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰻᰿ᱝᱩᱵᲞᲬᲷᴍᵻᶑᶫᶻ᷆᷍ròar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂᳖᳜᳠mƀ;oș᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄĀDoḆᴴoôĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤijạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»ṺƀaeiἒἚls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ffiɩᾹ\0\0᾽g;耀ffig;耀ffl;쀀𝔣lig;耀filig;쀀fjƀaltῙῡt;晭ig;耀flns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao⁕Ācs‑⁒ႉ‸⁅⁈\0⁐β•‥‧\0耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₥₰₴⃰℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽ƀ;qsؾٌlanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqrⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0proør;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼ròòΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonóquigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roøurĀ;a⧓⧔普lĀ;s⧓ସdz⧟\0⧣p肻\xA0ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨íistĀ;sடr;쀀𝔫ȀEest⩦⩹⩼ƀ;qs⩭ƀ;qs⩴lanôií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast⭕⭚⭟lleìl;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖchimpqu⮽⯍⯙⬄⯤⯯Ȁ;cerല⯆ഷ⯉uå;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭ååഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñĀ;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;cⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗLjⵚlac;䅑v;樸old;榼lig;䅓Ācrir;榿;쀀𝔬ͯ\0\0\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕⶥⶨrò᪀Āirⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔǒr;榷rp;榹;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ\0\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ脀¶;l䂶leìЃɩ\0\0m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳ᤈ⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t⾴ïrel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⋢⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔ABHabcdefhilmnoprstuxけさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstwガクシスゼゾダッデナp;極Ā;fゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ìâヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘rrowĀ;tㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowóarpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓ròaòՑ;怏oustĀ;a㈞掱che»mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì耻䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;qኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫwar;椪lig耻ß䃟㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rëƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼Dz㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproøim»ኬsðኞĀas㚺㚮ðrn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈadempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xôheadĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roðtré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜtré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌`.split(``).map(e=>e.charCodeAt(0))),Wv=new Uint16Array(`Ȁaglq \x1Bɭ\0\0p;䀦os;䀧t;䀾t;䀼uot;䀢`.split(``).map(e=>e.charCodeAt(0))),Gv=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]),Kv=String.fromCodePoint??function(e){let t=``;return e>65535&&(e-=65536,t+=String.fromCharCode(e>>>10&1023|55296),e=56320|e&1023),t+=String.fromCharCode(e),t};function qv(e){return e>=55296&&e<=57343||e>1114111?65533:Gv.get(e)??e}var Jv;(function(e){e[e.NUM=35]=`NUM`,e[e.SEMI=59]=`SEMI`,e[e.EQUALS=61]=`EQUALS`,e[e.ZERO=48]=`ZERO`,e[e.NINE=57]=`NINE`,e[e.LOWER_A=97]=`LOWER_A`,e[e.LOWER_F=102]=`LOWER_F`,e[e.LOWER_X=120]=`LOWER_X`,e[e.LOWER_Z=122]=`LOWER_Z`,e[e.UPPER_A=65]=`UPPER_A`,e[e.UPPER_F=70]=`UPPER_F`,e[e.UPPER_Z=90]=`UPPER_Z`})(Jv||={});var Yv=32,Xv;(function(e){e[e.VALUE_LENGTH=49152]=`VALUE_LENGTH`,e[e.BRANCH_LENGTH=16256]=`BRANCH_LENGTH`,e[e.JUMP_TABLE=127]=`JUMP_TABLE`})(Xv||={});function Zv(e){return e>=Jv.ZERO&&e<=Jv.NINE}function Qv(e){return e>=Jv.UPPER_A&&e<=Jv.UPPER_F||e>=Jv.LOWER_A&&e<=Jv.LOWER_F}function $v(e){return e>=Jv.UPPER_A&&e<=Jv.UPPER_Z||e>=Jv.LOWER_A&&e<=Jv.LOWER_Z||Zv(e)}function ey(e){return e===Jv.EQUALS||$v(e)}var ty;(function(e){e[e.EntityStart=0]=`EntityStart`,e[e.NumericStart=1]=`NumericStart`,e[e.NumericDecimal=2]=`NumericDecimal`,e[e.NumericHex=3]=`NumericHex`,e[e.NamedEntity=4]=`NamedEntity`})(ty||={});var ny;(function(e){e[e.Legacy=0]=`Legacy`,e[e.Strict=1]=`Strict`,e[e.Attribute=2]=`Attribute`})(ny||={});var ry=class{constructor(e,t,n){this.decodeTree=e,this.emitCodePoint=t,this.errors=n,this.state=ty.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=ny.Strict}startEntity(e){this.decodeMode=e,this.state=ty.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(e,t){switch(this.state){case ty.EntityStart:return e.charCodeAt(t)===Jv.NUM?(this.state=ty.NumericStart,this.consumed+=1,this.stateNumericStart(e,t+1)):(this.state=ty.NamedEntity,this.stateNamedEntity(e,t));case ty.NumericStart:return this.stateNumericStart(e,t);case ty.NumericDecimal:return this.stateNumericDecimal(e,t);case ty.NumericHex:return this.stateNumericHex(e,t);case ty.NamedEntity:return this.stateNamedEntity(e,t)}}stateNumericStart(e,t){return t>=e.length?-1:(e.charCodeAt(t)|Yv)===Jv.LOWER_X?(this.state=ty.NumericHex,this.consumed+=1,this.stateNumericHex(e,t+1)):(this.state=ty.NumericDecimal,this.stateNumericDecimal(e,t))}addToNumericResult(e,t,n,r){if(t!==n){let i=n-t;this.result=this.result*r**+i+parseInt(e.substr(t,i),r),this.consumed+=i}}stateNumericHex(e,t){let n=t;for(;t<e.length;){let r=e.charCodeAt(t);if(Zv(r)||Qv(r))t+=1;else return this.addToNumericResult(e,n,t,16),this.emitNumericEntity(r,3)}return this.addToNumericResult(e,n,t,16),-1}stateNumericDecimal(e,t){let n=t;for(;t<e.length;){let r=e.charCodeAt(t);if(Zv(r))t+=1;else return this.addToNumericResult(e,n,t,10),this.emitNumericEntity(r,2)}return this.addToNumericResult(e,n,t,10),-1}emitNumericEntity(e,t){var n;if(this.consumed<=t)return(n=this.errors)==null||n.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(e===Jv.SEMI)this.consumed+=1;else if(this.decodeMode===ny.Strict)return 0;return this.emitCodePoint(qv(this.result),this.consumed),this.errors&&(e!==Jv.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(e,t){let{decodeTree:n}=this,r=n[this.treeIndex],i=(r&Xv.VALUE_LENGTH)>>14;for(;t<e.length;t++,this.excess++){let a=e.charCodeAt(t);if(this.treeIndex=ay(n,r,this.treeIndex+Math.max(1,i),a),this.treeIndex<0)return this.result===0||this.decodeMode===ny.Attribute&&(i===0||ey(a))?0:this.emitNotTerminatedNamedEntity();if(r=n[this.treeIndex],i=(r&Xv.VALUE_LENGTH)>>14,i!==0){if(a===Jv.SEMI)return this.emitNamedEntityData(this.treeIndex,i,this.consumed+this.excess);this.decodeMode!==ny.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var e;let{result:t,decodeTree:n}=this,r=(n[t]&Xv.VALUE_LENGTH)>>14;return this.emitNamedEntityData(t,r,this.consumed),(e=this.errors)==null||e.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(e,t,n){let{decodeTree:r}=this;return this.emitCodePoint(t===1?r[e]&~Xv.VALUE_LENGTH:r[e+1],n),t===3&&this.emitCodePoint(r[e+2],n),n}end(){var e;switch(this.state){case ty.NamedEntity:return this.result!==0&&(this.decodeMode!==ny.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case ty.NumericDecimal:return this.emitNumericEntity(0,2);case ty.NumericHex:return this.emitNumericEntity(0,3);case ty.NumericStart:return(e=this.errors)==null||e.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case ty.EntityStart:return 0}}};function iy(e){let t=``,n=new ry(e,e=>t+=Kv(e));return function(e,r){let i=0,a=0;for(;(a=e.indexOf(`&`,a))>=0;){t+=e.slice(i,a),n.startEntity(r);let o=n.write(e,a+1);if(o<0){i=a+n.end();break}i=a+o,a=o===0?i+1:i}let o=t+e.slice(i);return t=``,o}}function ay(e,t,n,r){let i=(t&Xv.BRANCH_LENGTH)>>7,a=t&Xv.JUMP_TABLE;if(i===0)return a!==0&&r===a?n:-1;if(a){let t=r-a;return t<0||t>=i?-1:e[n+t]-1}let o=n,s=o+i-1;for(;o<=s;){let t=o+s>>>1,n=e[t];if(n<r)o=t+1;else if(n>r)s=t-1;else return e[t+i]}return-1}var oy=iy(Uv);iy(Wv);function sy(e,t=ny.Legacy){return oy(e,t)}function cy(e){return oy(e,ny.Strict)}var ly=s({arrayReplaceAt:()=>hy,asciiTrim:()=>Ry,assign:()=>my,escapeHtml:()=>Oy,escapeRE:()=>Ay,fromCodePoint:()=>_y,has:()=>py,isMdAsciiPunct:()=>Fy,isPunctChar:()=>Ny,isPunctCharCode:()=>Py,isSpace:()=>jy,isString:()=>dy,isValidEntityCode:()=>gy,isWhiteSpace:()=>My,lib:()=>zy,normalizeReference:()=>Iy,unescapeAll:()=>Cy,unescapeMd:()=>Sy});function uy(e){return Object.prototype.toString.call(e)}function dy(e){return uy(e)===`[object String]`}var fy=Object.prototype.hasOwnProperty;function py(e,t){return fy.call(e,t)}function my(e){return Array.prototype.slice.call(arguments,1).forEach(function(t){if(t){if(typeof t!=`object`)throw TypeError(t+`must be object`);Object.keys(t).forEach(function(n){e[n]=t[n]})}}),e}function hy(e,t,n){return[].concat(e.slice(0,t),n,e.slice(t+1))}function gy(e){return!(e>=55296&&e<=57343||e>=64976&&e<=65007||(e&65535)==65535||(e&65535)==65534||e>=0&&e<=8||e===11||e>=14&&e<=31||e>=127&&e<=159||e>1114111)}function _y(e){if(e>65535){e-=65536;let t=55296+(e>>10),n=56320+(e&1023);return String.fromCharCode(t,n)}return String.fromCharCode(e)}var vy=/\\([!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~])/g,yy=RegExp(vy.source+`|&([a-z#][a-z0-9]{1,31});`,`gi`),by=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))$/i;function xy(e,t){if(t.charCodeAt(0)===35&&by.test(t)){let n=t[1].toLowerCase()===`x`?parseInt(t.slice(2),16):parseInt(t.slice(1),10);return gy(n)?_y(n):e}let n=sy(e);return n===e?e:n}function Sy(e){return e.indexOf(`\\`)<0?e:e.replace(vy,`$1`)}function Cy(e){return e.indexOf(`\\`)<0&&e.indexOf(`&`)<0?e:e.replace(yy,function(e,t,n){return t||xy(e,n)})}var wy=/[&<>"]/,Ty=/[&<>"]/g,Ey={"&":`&`,"<":`<`,">":`>`,'"':`"`};function Dy(e){return Ey[e]}function Oy(e){return wy.test(e)?e.replace(Ty,Dy):e}var ky=/[.?*+^$[\]\\(){}|-]/g;function Ay(e){return e.replace(ky,`\\$&`)}function jy(e){switch(e){case 9:case 32:return!0}return!1}function My(e){if(e>=8192&&e<=8202)return!0;switch(e){case 9:case 10:case 11:case 12:case 13:case 32:case 160:case 5760:case 8239:case 8287:case 12288:return!0}return!1}function Ny(e){return zv.test(e)||Bv.test(e)}function Py(e){return Ny(_y(e))}function Fy(e){switch(e){case 33:case 34:case 35:case 36:case 37:case 38:case 39:case 40:case 41:case 42:case 43:case 44:case 45:case 46:case 47:case 58:case 59:case 60:case 61:case 62:case 63:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 124:case 125:case 126:return!0;default:return!1}}function Iy(e){return e=e.trim().replace(/\s+/g,` `),e.toLowerCase().toUpperCase()}function Ly(e){return e===32||e===9||e===10||e===13}function Ry(e){let t=0;for(;t<e.length&&Ly(e.charCodeAt(t));t++);let n=e.length-1;for(;n>=t&&Ly(e.charCodeAt(n));n--);return e.slice(t,n+1)}var zy={mdurl:Fv,ucmicro:Hv};function By(e,t,n){let r,i,a,o,s=e.posMax,c=e.pos;for(e.pos=t+1,r=1;e.pos<s;){if(a=e.src.charCodeAt(e.pos),a===93&&(r--,r===0)){i=!0;break}if(o=e.pos,e.md.inline.skipToken(e),a===91){if(o===e.pos-1)r++;else if(n)return e.pos=c,-1}}let l=-1;return i&&(l=e.pos),e.pos=c,l}function Vy(e,t,n){let r,i=t,a={ok:!1,pos:0,str:``};if(e.charCodeAt(i)===60){for(i++;i<n;){if(r=e.charCodeAt(i),r===10||r===60)return a;if(r===62)return a.pos=i+1,a.str=Cy(e.slice(t+1,i)),a.ok=!0,a;if(r===92&&i+1<n){i+=2;continue}i++}return a}let o=0;for(;i<n&&(r=e.charCodeAt(i),!(r===32||r<32||r===127));){if(r===92&&i+1<n){if(e.charCodeAt(i+1)===32)break;i+=2;continue}if(r===40&&(o++,o>32))return a;if(r===41){if(o===0)break;o--}i++}return t===i||o!==0?a:(a.str=Cy(e.slice(t,i)),a.pos=i,a.ok=!0,a)}function Hy(e,t,n,r){let i,a=t,o={ok:!1,can_continue:!1,pos:0,str:``,marker:0};if(r)o.str=r.str,o.marker=r.marker;else{if(a>=n)return o;let r=e.charCodeAt(a);if(r!==34&&r!==39&&r!==40)return o;t++,a++,r===40&&(r=41),o.marker=r}for(;a<n;){if(i=e.charCodeAt(a),i===o.marker)return o.pos=a+1,o.str+=Cy(e.slice(t,a)),o.ok=!0,o;if(i===40&&o.marker===41)return o;i===92&&a+1<n&&a++,a++}return o.can_continue=!0,o.str+=Cy(e.slice(t,a)),o}var Uy=s({parseLinkDestination:()=>Vy,parseLinkLabel:()=>By,parseLinkTitle:()=>Hy}),Wy={};Wy.code_inline=function(e,t,n,r,i){let a=e[t];return`<code`+i.renderAttrs(a)+`>`+Oy(a.content)+`</code>`},Wy.code_block=function(e,t,n,r,i){let a=e[t];return`<pre`+i.renderAttrs(a)+`><code>`+Oy(e[t].content)+`</code></pre>
|
|
53
|
-
`},Wy.fence=function(e,t,n,r,i){let a=e[t],o=a.info?Cy(a.info).trim():``,s=``,c=``;if(o){let e=o.split(/(\s+)/g);s=e[0],c=e.slice(2).join(``)}let l;if(l=n.highlight&&n.highlight(a.content,s,c)||Oy(a.content),l.indexOf(`<pre`)===0)return l+`
|
|
54
|
-
|
|
51
|
+
`},Ta=0,Ea=[];function Da(e){var t=v.useRef([]),n=v.useRef([0,0]),r=v.useRef(),i=v.useState(Ta++)[0],a=v.useState(Yi)[0],o=v.useRef(e);v.useEffect(function(){o.current=e},[e]),v.useEffect(function(){if(e.inert){document.body.classList.add(`block-interactivity-${i}`);var t=Ti([e.lockRef.current],(e.shards||[]).map(Sa),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add(`allow-interactivity-${i}`)}),function(){document.body.classList.remove(`block-interactivity-${i}`),t.forEach(function(e){return e.classList.remove(`allow-interactivity-${i}`)})}}},[e.inert,e.lockRef.current,e.shards]);var s=v.useCallback(function(e,t){if(`touches`in e&&e.touches.length===2||e.type===`wheel`&&e.ctrlKey)return!o.current.allowPinchZoom;var i=ba(e),a=n.current,s=`deltaX`in e?e.deltaX:a[0]-i[0],c=`deltaY`in e?e.deltaY:a[1]-i[1],l,u=e.target,d=Math.abs(s)>Math.abs(c)?`h`:`v`;if(`touches`in e&&d===`h`&&u.type===`range`)return!1;var f=window.getSelection(),p=f&&f.anchorNode;if(p&&(p===u||p.contains(u)))return!1;var m=pa(d,u);if(!m)return!0;if(m?l=d:(l=d===`v`?`h`:`v`,m=pa(d,u)),!m)return!1;if(!r.current&&`changedTouches`in e&&(s||c)&&(r.current=l),!l)return!0;var h=r.current||l;return ya(h,t,e,h===`h`?s:c,!0)},[]),c=v.useCallback(function(e){var n=e;if(!(!Ea.length||Ea[Ea.length-1]!==a)){var r=`deltaY`in n?xa(n):ba(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&Ca(e.delta,r)})[0];if(i&&i.should){n.cancelable&&n.preventDefault();return}if(!i){var c=(o.current.shards||[]).map(Sa).filter(Boolean).filter(function(e){return e.contains(n.target)});(c.length>0?s(n,c[0]):!o.current.noIsolation)&&n.cancelable&&n.preventDefault()}}},[]),l=v.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i,shadowParent:Oa(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),u=v.useCallback(function(e){n.current=ba(e),r.current=void 0},[]),d=v.useCallback(function(t){l(t.type,xa(t),t.target,s(t,e.lockRef.current))},[]),f=v.useCallback(function(t){l(t.type,ba(t),t.target,s(t,e.lockRef.current))},[]);v.useEffect(function(){return Ea.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener(`wheel`,c,ca),document.addEventListener(`touchmove`,c,ca),document.addEventListener(`touchstart`,u,ca),function(){Ea=Ea.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,c,ca),document.removeEventListener(`touchmove`,c,ca),document.removeEventListener(`touchstart`,u,ca)}},[]);var p=e.removeScrollBar,m=e.inert;return v.createElement(v.Fragment,null,m?v.createElement(a,{styles:wa(i)}):null,p?v.createElement(aa,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Oa(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var ka=Ri(zi,Da),Aa=v.forwardRef(function(e,t){return v.createElement(Vi,Ci({},e,{ref:t,sideCar:ka}))});Aa.classNames=Vi.classNames;var ja=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},Ma=new WeakMap,Na=new WeakMap,Pa={},Fa=0,Ia=function(e){return e&&(e.host||Ia(e.parentNode))},La=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=Ia(t);return n&&e.contains(n)?n:(console.error(`aria-hidden`,t,`in not contained inside`,e,`. Doing nothing`),null)}).filter(function(e){return!!e})},Ra=function(e,t,n,r){var i=La(t,Array.isArray(e)?e:[e]);Pa[n]||(Pa[n]=new WeakMap);var a=Pa[n],o=[],s=new Set,c=new Set(i),l=function(e){!e||s.has(e)||(s.add(e),l(e.parentNode))};i.forEach(l);var u=function(e){!e||c.has(e)||Array.prototype.forEach.call(e.children,function(e){if(s.has(e))u(e);else try{var t=e.getAttribute(r),i=t!==null&&t!==`false`,c=(Ma.get(e)||0)+1,l=(a.get(e)||0)+1;Ma.set(e,c),a.set(e,l),o.push(e),c===1&&i&&Na.set(e,!0),l===1&&e.setAttribute(n,`true`),i||e.setAttribute(r,`true`)}catch(t){console.error(`aria-hidden: cannot operate on `,e,t)}})};return u(t),s.clear(),Fa++,function(){o.forEach(function(e){var t=Ma.get(e)-1,i=a.get(e)-1;Ma.set(e,t),a.set(e,i),t||(Na.has(e)||e.removeAttribute(r),Na.delete(e)),i||e.removeAttribute(n)}),Fa--,Fa||(Ma=new WeakMap,Ma=new WeakMap,Na=new WeakMap,Pa={})}},za=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||ja(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),Ra(r,i,n,`aria-hidden`)):function(){return null}},Ba=`Dialog`,[Va,Ha]=yr(Ba),[Ua,Wa]=Va(Ba),Ga=e=>{let{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!0}=e,s=v.useRef(null),c=v.useRef(null),[l,u]=wr({prop:r,defaultProp:i??!1,onChange:a,caller:Ba});return(0,B.jsx)(Ua,{scope:t,triggerRef:s,contentRef:c,contentId:Ir(),titleId:Ir(),descriptionId:Ir(),open:l,onOpenChange:u,onOpenToggle:v.useCallback(()=>u(e=>!e),[u]),modal:o,children:n})};Ga.displayName=Ba;var Ka=`DialogTrigger`,qa=v.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=Wa(Ka,n),a=Zn(t,i.triggerRef);return(0,B.jsx)(pr.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":po(i.open),...r,ref:a,onClick:V(e.onClick,i.onOpenToggle)})});qa.displayName=Ka;var Ja=`DialogPortal`,[Ya,Xa]=Va(Ja,{forceMount:void 0}),Za=e=>{let{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=Wa(Ja,t);return(0,B.jsx)(Ya,{scope:t,forceMount:n,children:v.Children.map(r,e=>(0,B.jsx)(Or,{present:n||a.open,children:(0,B.jsx)(vi,{asChild:!0,container:i,children:e})}))})};Za.displayName=Ja;var Qa=`DialogOverlay`,$a=v.forwardRef((e,t)=>{let n=Xa(Qa,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=Wa(Qa,e.__scopeDialog);return a.modal?(0,B.jsx)(Or,{present:r||a.open,children:(0,B.jsx)(to,{...i,ref:t})}):null});$a.displayName=Qa;var eo=Qn(`DialogOverlay.RemoveScroll`),to=v.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=Wa(Qa,n),a=Zn(t,Yr());return(0,B.jsx)(Aa,{as:eo,allowPinchZoom:!0,shards:[i.contentRef],children:(0,B.jsx)(pr.div,{"data-state":po(i.open),...r,ref:a,style:{pointerEvents:`auto`,...r.style}})})}),no=`DialogContent`,ro=v.forwardRef((e,t)=>{let n=Xa(no,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=Wa(no,e.__scopeDialog);return(0,B.jsx)(Or,{present:r||a.open,children:a.modal?(0,B.jsx)(io,{...i,ref:t}):(0,B.jsx)(ao,{...i,ref:t})})});ro.displayName=no;var io=v.forwardRef((e,t)=>{let n=Wa(no,e.__scopeDialog),r=v.useRef(null),i=Zn(t,n.contentRef,r);return v.useEffect(()=>{let e=r.current;if(e)return za(e)},[]),(0,B.jsx)(oo,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,onCloseAutoFocus:V(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:V(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:V(e.onFocusOutside,e=>e.preventDefault())})}),ao=v.forwardRef((e,t)=>{let n=Wa(no,e.__scopeDialog),r=v.useRef(!1),i=v.useRef(!1);return(0,B.jsx)(oo,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})}),oo=v.forwardRef((e,t)=>{let{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,...o}=e,s=Wa(no,n);return xi(),(0,B.jsx)(B.Fragment,{children:(0,B.jsx)(ai,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,B.jsx)(Kr,{role:`dialog`,id:s.contentId,"aria-describedby":s.descriptionId,"aria-labelledby":s.titleId,"data-state":po(s.open),...o,ref:t,deferPointerDownOutside:!0,onDismiss:()=>s.onOpenChange(!1)})})})}),so=`DialogTitle`,co=v.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=Wa(so,n);return(0,B.jsx)(pr.h2,{id:i.titleId,...r,ref:t})});co.displayName=so;var lo=`DialogDescription`,U=v.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=Wa(lo,n);return(0,B.jsx)(pr.p,{id:i.descriptionId,...r,ref:t})});U.displayName=lo;var uo=`DialogClose`,fo=v.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=Wa(uo,n);return(0,B.jsx)(pr.button,{type:`button`,...r,ref:t,onClick:V(e.onClick,()=>i.onOpenChange(!1))})});fo.displayName=uo;function po(e){return e?`open`:`closed`}function mo(e){let t=v.useRef({value:e,previous:e});return v.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}function ho(e){let[t,n]=v.useState(void 0);return Sr(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{if(!Array.isArray(t)||!t.length)return;let r=t[0],i,a;if(`borderBoxSize`in r){let e=r.borderBoxSize,t=Array.isArray(e)?e[0]:e;i=t.inlineSize,a=t.blockSize}else i=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return t.observe(e,{box:`border-box`}),()=>t.unobserve(e)}else n(void 0)},[e]),t}var go=[`top`,`right`,`bottom`,`left`],_o=Math.min,vo=Math.max,yo=Math.round,bo=Math.floor,xo=e=>({x:e,y:e}),So={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function Co(e,t,n){return vo(e,_o(t,n))}function wo(e,t){return typeof e==`function`?e(t):e}function To(e){return e.split(`-`)[0]}function Eo(e){return e.split(`-`)[1]}function Do(e){return e===`x`?`y`:`x`}function Oo(e){return e===`y`?`height`:`width`}function ko(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function Ao(e){return Do(ko(e))}function jo(e,t,n){n===void 0&&(n=!1);let r=Eo(e),i=Ao(e),a=Oo(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=Bo(o)),[o,Bo(o)]}function Mo(e){let t=Bo(e);return[No(e),t,No(t)]}function No(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var Po=[`left`,`right`],Fo=[`right`,`left`],Io=[`top`,`bottom`],Lo=[`bottom`,`top`];function Ro(e,t,n){switch(e){case`top`:case`bottom`:return n?t?Fo:Po:t?Po:Fo;case`left`:case`right`:return t?Io:Lo;default:return[]}}function zo(e,t,n,r){let i=Eo(e),a=Ro(To(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(No)))),a}function Bo(e){let t=To(e);return So[t]+e.slice(t.length)}function Vo(e){return{top:0,right:0,bottom:0,left:0,...e}}function Ho(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:Vo(e)}function Uo(e){let{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 Wo(e,t,n){let{reference:r,floating:i}=e,a=ko(t),o=Ao(t),s=Oo(o),c=To(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}switch(Eo(t)){case`start`:p[o]-=f*(n&&l?-1:1);break;case`end`:p[o]+=f*(n&&l?-1:1);break}return p}async function Go(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=wo(t,e),p=Ho(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=Uo(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=Uo(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var Ko=50,qo=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:Go},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=Wo(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<Ko&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=Wo(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},Jo=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=wo(e,t)||{};if(l==null)return{};let d=Ho(u),f={x:n,y:r},p=Ao(i),m=Oo(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),C=S?S[y]:0;(!C||!await(o.isElement==null?void 0:o.isElement(S)))&&(C=s.floating[y]||a.floating[m]);let w=b/2-x/2,T=C/2-h[m]/2-1,E=_o(d[_],T),D=_o(d[v],T),O=E,k=C-h[m]-D,A=C/2-h[m]/2+w,j=Co(O,A,k),M=!c.arrow&&Eo(i)!=null&&A!==j&&a.reference[m]/2-(A<O?E:D)-h[m]/2<0,N=M?A<O?A-O:A-k:0;return{[p]:f[p]+N,data:{[p]:j,centerOffset:A-j-N,...M&&{alignmentOffset:N}},reset:M}}}),Yo=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=wo(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=To(r),_=ko(o),v=To(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[Bo(o)]:Mo(o)),x=p!==`none`;!d&&x&&b.push(...zo(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=jo(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(!(u===`alignment`&&_!==ko(t))||T.every(e=>ko(e.placement)!==_||e.overflows[0]>0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=ko(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o;break}if(r!==n)return{reset:{placement:n}}}return{}}}};function Xo(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Zo(e){return go.some(t=>e[t]>=0)}var Qo=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=wo(e,t);switch(i){case`referenceHidden`:{let e=Xo(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:Zo(e)}}}case`escaped`:{let e=Xo(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:Zo(e)}}}default:return{}}}}},$o=new Set([`left`,`top`]);async function es(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=To(n),s=Eo(n),c=ko(n)===`y`,l=$o.has(o)?-1:1,u=a&&c?-1:1,d=wo(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var ts=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await es(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},ns=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=wo(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=ko(To(i)),p=Do(f),m=u[p],h=u[f];if(o){let e=p===`y`?`top`:`left`,t=p===`y`?`bottom`:`right`,n=m+d[e],r=m-d[t];m=Co(n,m,r)}if(s){let e=f===`y`?`top`:`left`,t=f===`y`?`bottom`:`right`,n=h+d[e],r=h-d[t];h=Co(n,h,r)}let g=c.fn({...t,[p]:m,[f]:h});return{...g,data:{x:g.x-n,y:g.y-r,enabled:{[p]:o,[f]:s}}}}}},rs=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=wo(e,t),u={x:n,y:r},d=ko(i),f=Do(d),p=u[f],m=u[d],h=wo(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=$o.has(To(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},is=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){var n,r;let{placement:i,rects:a,platform:o,elements:s}=t,{apply:c=()=>{},...l}=wo(e,t),u=await o.detectOverflow(t,l),d=To(i),f=Eo(i),p=ko(i)===`y`,{width:m,height:h}=a.floating,g,_;d===`top`||d===`bottom`?(g=d,_=f===(await(o.isRTL==null?void 0:o.isRTL(s.floating))?`start`:`end`)?`left`:`right`):(_=d,g=f===`end`?`top`:`bottom`);let v=h-u.top-u.bottom,y=m-u.left-u.right,b=_o(h-u[g],v),x=_o(m-u[_],y),S=!t.middlewareData.shift,C=b,w=x;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(w=y),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(C=v),S&&!f){let e=vo(u.left,0),t=vo(u.right,0),n=vo(u.top,0),r=vo(u.bottom,0);p?w=m-2*(e!==0||t!==0?e+t:vo(u.left,u.right)):C=h-2*(n!==0||r!==0?n+r:vo(u.top,u.bottom))}await c({...t,availableWidth:w,availableHeight:C});let T=await o.getDimensions(s.floating);return m!==T.width||h!==T.height?{reset:{rects:!0}}:{}}}};function as(){return typeof window<`u`}function os(e){return ls(e)?(e.nodeName||``).toLowerCase():`#document`}function ss(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function cs(e){return((ls(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function ls(e){return as()?e instanceof Node||e instanceof ss(e).Node:!1}function us(e){return as()?e instanceof Element||e instanceof ss(e).Element:!1}function ds(e){return as()?e instanceof HTMLElement||e instanceof ss(e).HTMLElement:!1}function fs(e){return!as()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof ss(e).ShadowRoot}function ps(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=ws(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function ms(e){return/^(table|td|th)$/.test(os(e))}function hs(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var gs=/transform|translate|scale|rotate|perspective|filter/,_s=/paint|layout|strict|content/,vs=e=>!!e&&e!==`none`,ys;function bs(e){let t=us(e)?ws(e):e;return vs(t.transform)||vs(t.translate)||vs(t.scale)||vs(t.rotate)||vs(t.perspective)||!Ss()&&(vs(t.backdropFilter)||vs(t.filter))||gs.test(t.willChange||``)||_s.test(t.contain||``)}function xs(e){let t=Es(e);for(;ds(t)&&!Cs(t);){if(bs(t))return t;if(hs(t))return null;t=Es(t)}return null}function Ss(){return ys??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),ys}function Cs(e){return/^(html|body|#document)$/.test(os(e))}function ws(e){return ss(e).getComputedStyle(e)}function Ts(e){return us(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Es(e){if(os(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||fs(e)&&e.host||cs(e);return fs(t)?t.host:t}function Ds(e){let t=Es(e);return Cs(t)?e.ownerDocument?e.ownerDocument.body:e.body:ds(t)&&ps(t)?t:Ds(t)}function Os(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=Ds(e),i=r===e.ownerDocument?.body,a=ss(r);if(i){let e=ks(a);return t.concat(a,a.visualViewport||[],ps(r)?r:[],e&&n?Os(e):[])}else return t.concat(r,Os(r,[],n))}function ks(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function As(e){let t=ws(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=ds(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=yo(n)!==a||yo(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function js(e){return us(e)?e:e.contextElement}function Ms(e){let t=js(e);if(!ds(t))return xo(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=As(t),o=(a?yo(n.width):n.width)/r,s=(a?yo(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var Ns=xo(0);function Ps(e){let t=ss(e);return!Ss()||!t.visualViewport?Ns:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Fs(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==ss(e)?!1:t}function Is(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=js(e),o=xo(1);t&&(r?us(r)&&(o=Ms(r)):o=Ms(e));let s=Fs(a,n,r)?Ps(a):xo(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a){let e=ss(a),t=r&&us(r)?ss(r):r,n=e,i=ks(n);for(;i&&r&&t!==n;){let e=Ms(i),t=i.getBoundingClientRect(),r=ws(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=ss(i),i=ks(n)}}return Uo({width:u,height:d,x:c,y:l})}function Ls(e,t){let n=Ts(e).scrollLeft;return t?t.left+n:Is(cs(e)).left+n}function Rs(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-Ls(e,n),y:n.top+t.scrollTop}}function zs(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=cs(r),s=t?hs(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=xo(1),u=xo(0),d=ds(r);if((d||!d&&!a)&&((os(r)!==`body`||ps(o))&&(c=Ts(r)),d)){let e=Is(r);l=Ms(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?Rs(o,c):xo(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function Bs(e){return Array.from(e.getClientRects())}function Vs(e){let t=cs(e),n=Ts(e),r=e.ownerDocument.body,i=vo(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=vo(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight),o=-n.scrollLeft+Ls(e),s=-n.scrollTop;return ws(r).direction===`rtl`&&(o+=vo(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:s}}var Hs=25;function Us(e,t){let n=ss(e),r=cs(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;let e=Ss();(!e||e&&t===`fixed`)&&(s=i.offsetLeft,c=i.offsetTop)}let l=Ls(r);if(l<=0){let e=r.ownerDocument,t=e.body,n=getComputedStyle(t),i=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,o=Math.abs(r.clientWidth-t.clientWidth-i);o<=Hs&&(a-=o)}else l<=Hs&&(a+=l);return{width:a,height:o,x:s,y:c}}function Ws(e,t){let n=Is(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=ds(e)?Ms(e):xo(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function Gs(e,t,n){let r;if(t===`viewport`)r=Us(e,n);else if(t===`document`)r=Vs(cs(e));else if(us(t))r=Ws(t,n);else{let n=Ps(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return Uo(r)}function Ks(e,t){let n=Es(e);return n===t||!us(n)||Cs(n)?!1:ws(n).position===`fixed`||Ks(n,t)}function qs(e,t){let n=t.get(e);if(n)return n;let r=Os(e,[],!1).filter(e=>us(e)&&os(e)!==`body`),i=null,a=ws(e).position===`fixed`,o=a?Es(e):e;for(;us(o)&&!Cs(o);){let t=ws(o),n=bs(o);!n&&t.position===`fixed`&&(i=null),(a?!n&&!i:!n&&t.position===`static`&&i&&(i.position===`absolute`||i.position===`fixed`)||ps(o)&&!n&&Ks(e,o))?r=r.filter(e=>e!==o):i=t,o=Es(o)}return t.set(e,r),r}function Js(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?hs(t)?[]:qs(t,this._c):[].concat(n),r],o=Gs(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=Gs(t,a[e],i);s=vo(n.top,s),c=_o(n.right,c),l=_o(n.bottom,l),u=vo(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function Ys(e){let{width:t,height:n}=As(e);return{width:t,height:n}}function Xs(e,t,n){let r=ds(t),i=cs(t),a=n===`fixed`,o=Is(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=xo(0);function l(){c.x=Ls(i)}if(r||!r&&!a)if((os(t)!==`body`||ps(i))&&(s=Ts(t)),r){let e=Is(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}else i&&l();a&&!r&&i&&l();let u=i&&!r&&!a?Rs(i,s):xo(0);return{x:o.left+s.scrollLeft-c.x-u.x,y:o.top+s.scrollTop-c.y-u.y,width:o.width,height:o.height}}function Zs(e){return ws(e).position===`static`}function Qs(e,t){if(!ds(e)||ws(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return cs(e)===n&&(n=n.ownerDocument.body),n}function $s(e,t){let n=ss(e);if(hs(e))return n;if(!ds(e)){let t=Es(e);for(;t&&!Cs(t);){if(us(t)&&!Zs(t))return t;t=Es(t)}return n}let r=Qs(e,t);for(;r&&ms(r)&&Zs(r);)r=Qs(r,t);return r&&Cs(r)&&Zs(r)&&!bs(r)?n:r||xs(e)||n}var ec=async function(e){let t=this.getOffsetParent||$s,n=this.getDimensions,r=await n(e.floating);return{reference:Xs(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function tc(e){return ws(e).direction===`rtl`}var nc={convertOffsetParentRelativeRectToViewportRelativeRect:zs,getDocumentElement:cs,getClippingRect:Js,getOffsetParent:$s,getElementRects:ec,getClientRects:Bs,getDimensions:Ys,getScale:Ms,isElement:us,isRTL:tc};function rc(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function ic(e,t){let n=null,r,i=cs(e);function a(){var e;clearTimeout(r),(e=n)==null||e.disconnect(),n=null}function o(s,c){s===void 0&&(s=!1),c===void 0&&(c=1),a();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(s||t(),!f||!p)return;let m=bo(d),h=bo(i.clientWidth-(u+f)),g=bo(i.clientHeight-(d+p)),_=bo(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:vo(0,_o(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(n!==c){if(!y)return o();n?o(!1,n):r=setTimeout(()=>{o(!1,1e-7)},1e3)}n===1&&!rc(l,e.getBoundingClientRect())&&o(),y=!1}try{n=new IntersectionObserver(b,{...v,root:i.ownerDocument})}catch{n=new IntersectionObserver(b,v)}n.observe(e)}return o(!0),a}function ac(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=js(e),u=i||a?[...l?Os(l):[],...t?Os(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n,{passive:!0}),a&&e.addEventListener(`resize`,n)});let d=l&&s?ic(l,n):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?Is(e):null;c&&g();function g(){let t=Is(e);h&&!rc(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var oc=ts,sc=ns,cc=Yo,lc=is,uc=Qo,dc=Jo,fc=rs,pc=(e,t,n)=>{let r=new Map,i={platform:nc,...n},a={...i.platform,_c:r};return qo(e,t,{...i,platform:a})},mc=typeof document<`u`?v.useLayoutEffect:function(){};function hc(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(!hc(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;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!hc(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function gc(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function _c(e,t){let n=gc(e);return Math.round(t*n)/n}function vc(e){let t=v.useRef(e);return mc(()=>{t.current=e}),t}function yc(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,d]=v.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=v.useState(r);hc(f,r)||p(r);let[m,h]=v.useState(null),[g,_]=v.useState(null),b=v.useCallback(e=>{e!==w.current&&(w.current=e,h(e))},[]),x=v.useCallback(e=>{e!==T.current&&(T.current=e,_(e))},[]),S=a||m,C=o||g,w=v.useRef(null),T=v.useRef(null),E=v.useRef(u),D=c!=null,O=vc(c),k=vc(i),A=vc(l),j=v.useCallback(()=>{if(!w.current||!T.current)return;let e={placement:t,strategy:n,middleware:f};k.current&&(e.platform=k.current),pc(w.current,T.current,e).then(e=>{let t={...e,isPositioned:A.current!==!1};M.current&&!hc(E.current,t)&&(E.current=t,y.flushSync(()=>{d(t)}))})},[f,t,n,k,A]);mc(()=>{l===!1&&E.current.isPositioned&&(E.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let M=v.useRef(!1);mc(()=>(M.current=!0,()=>{M.current=!1}),[]),mc(()=>{if(S&&(w.current=S),C&&(T.current=C),S&&C){if(O.current)return O.current(S,C,j);j()}},[S,C,j,O,D]);let N=v.useMemo(()=>({reference:w,floating:T,setReference:b,setFloating:x}),[b,x]),P=v.useMemo(()=>({reference:S,floating:C}),[S,C]),F=v.useMemo(()=>{let e={position:n,left:0,top:0};if(!P.floating)return e;let t=_c(P.floating,u.x),r=_c(P.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...gc(P.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,P.floating,u.x,u.y]);return v.useMemo(()=>({...u,update:j,refs:N,elements:P,floatingStyles:F}),[u,j,N,P,F])}var bc=e=>{function t(e){return{}.hasOwnProperty.call(e,`current`)}return{name:`arrow`,options:e,fn(n){let{element:r,padding:i}=typeof e==`function`?e(n):e;return r&&t(r)?r.current==null?{}:dc({element:r.current,padding:i}).fn(n):r?dc({element:r,padding:i}).fn(n):{}}}},xc=(e,t)=>{let n=oc(e);return{name:n.name,fn:n.fn,options:[e,t]}},Sc=(e,t)=>{let n=sc(e);return{name:n.name,fn:n.fn,options:[e,t]}},Cc=(e,t)=>({fn:fc(e).fn,options:[e,t]}),wc=(e,t)=>{let n=cc(e);return{name:n.name,fn:n.fn,options:[e,t]}},Tc=(e,t)=>{let n=lc(e);return{name:n.name,fn:n.fn,options:[e,t]}},Ec=(e,t)=>{let n=uc(e);return{name:n.name,fn:n.fn,options:[e,t]}},Dc=(e,t)=>{let n=bc(e);return{name:n.name,fn:n.fn,options:[e,t]}},Oc=`Arrow`,kc=v.forwardRef((e,t)=>{let{children:n,width:r=10,height:i=5,...a}=e;return(0,B.jsx)(pr.svg,{...a,ref:t,width:r,height:i,viewBox:`0 0 30 10`,preserveAspectRatio:`none`,children:e.asChild?n:(0,B.jsx)(`polygon`,{points:`0,0 30,0 15,10`})})});kc.displayName=Oc;var Ac=kc,jc=`Popper`,[Mc,Nc]=yr(jc),[Pc,Fc]=Mc(jc),Ic=e=>{let{__scopePopper:t,children:n}=e,[r,i]=v.useState(null),[a,o]=v.useState(void 0);return(0,B.jsx)(Pc,{scope:t,anchor:r,onAnchorChange:i,placementState:a,setPlacementState:o,children:n})};Ic.displayName=jc;var Lc=`PopperAnchor`,Rc=v.forwardRef((e,t)=>{let{__scopePopper:n,virtualRef:r,...i}=e,a=Fc(Lc,n),o=v.useRef(null),s=a.onAnchorChange,c=Zn(t,v.useCallback(e=>{o.current=e,e&&s(e)},[s])),l=v.useRef(null);v.useEffect(()=>{if(!r)return;let e=l.current;l.current=r.current,e!==l.current&&s(l.current)});let u=a.placementState&&Jc(a.placementState),d=u?.[0],f=u?.[1];return r?null:(0,B.jsx)(pr.div,{"data-radix-popper-side":d,"data-radix-popper-align":f,...i,ref:c})});Rc.displayName=Lc;var zc=`PopperContent`,[Bc,Vc]=Mc(zc),Hc=v.forwardRef((e,t)=>{let{__scopePopper:n,side:r=`bottom`,sideOffset:i=0,align:a=`center`,alignOffset:o=0,arrowPadding:s=0,avoidCollisions:c=!0,collisionBoundary:l=[],collisionPadding:u=0,sticky:d=`partial`,hideWhenDetached:f=!1,updatePositionStrategy:p=`optimized`,onPlaced:m,...h}=e,g=Fc(zc,n),[_,y]=v.useState(null),b=Zn(t,y),[x,S]=v.useState(null),C=ho(x),w=C?.width??0,T=C?.height??0,E=r+(a===`center`?``:`-`+a),D=typeof u==`number`?u:{top:0,right:0,bottom:0,left:0,...u},O=Array.isArray(l)?l:[l],k=O.length>0,A={padding:D,boundary:O.filter(Kc),altBoundary:k},{refs:j,floatingStyles:M,placement:N,isPositioned:P,middlewareData:F}=yc({strategy:`fixed`,placement:E,whileElementsMounted:(...e)=>ac(...e,{animationFrame:p===`always`}),elements:{reference:g.anchor},middleware:[xc({mainAxis:i+T,alignmentAxis:o}),c&&Sc({mainAxis:!0,crossAxis:!1,limiter:d===`partial`?Cc():void 0,...A}),c&&wc({...A}),Tc({...A,apply:({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{let{width:i,height:a}=t.reference,o=e.floating.style;o.setProperty(`--radix-popper-available-width`,`${n}px`),o.setProperty(`--radix-popper-available-height`,`${r}px`),o.setProperty(`--radix-popper-anchor-width`,`${i}px`),o.setProperty(`--radix-popper-anchor-height`,`${a}px`)}}),x&&Dc({element:x,padding:s}),qc({arrowWidth:w,arrowHeight:T}),f&&Ec({strategy:`referenceHidden`,...A,boundary:k?A.boundary:void 0})]}),I=g.setPlacementState;Sr(()=>(I(N),()=>{I(void 0)}),[N,I]);let[L,ee]=Jc(N),te=zr(m);Sr(()=>{P&&te?.()},[P,te]);let ne=F.arrow?.x,re=F.arrow?.y,ie=F.arrow?.centerOffset!==0,[R,ae]=v.useState();return Sr(()=>{_&&ae(window.getComputedStyle(_).zIndex)},[_]),(0,B.jsx)(`div`,{ref:j.setFloating,"data-radix-popper-content-wrapper":``,style:{...M,transform:P?M.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:R,"--radix-popper-transform-origin":[F.transformOrigin?.x,F.transformOrigin?.y].join(` `),...F.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:(0,B.jsx)(Bc,{scope:n,placedSide:L,placedAlign:ee,onArrowChange:S,arrowX:ne,arrowY:re,shouldHideArrow:ie,children:(0,B.jsx)(pr.div,{"data-side":L,"data-align":ee,...h,ref:b,style:{...h.style,animation:P?void 0:`none`}})})})});Hc.displayName=zc;var Uc=`PopperArrow`,Wc={top:`bottom`,right:`left`,bottom:`top`,left:`right`},Gc=v.forwardRef(function(e,t){let{__scopePopper:n,...r}=e,i=Vc(Uc,n),a=Wc[i.placedSide];return(0,B.jsx)(`span`,{ref:i.onArrowChange,style:{position:`absolute`,left:i.arrowX,top:i.arrowY,[a]:0,transformOrigin:{top:``,right:`0 0`,bottom:`center 0`,left:`100% 0`}[i.placedSide],transform:{top:`translateY(100%)`,right:`translateY(50%) rotate(90deg) translateX(-50%)`,bottom:`rotate(180deg)`,left:`translateY(50%) rotate(-90deg) translateX(50%)`}[i.placedSide],visibility:i.shouldHideArrow?`hidden`:void 0},children:(0,B.jsx)(Ac,{...r,ref:t,style:{...r.style,display:`block`}})})});Gc.displayName=Uc;function Kc(e){return e!==null}var qc=e=>({name:`transformOrigin`,options:e,fn(t){let{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,o=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[c,l]=Jc(n),u={start:`0%`,center:`50%`,end:`100%`}[l],d=(i.arrow?.x??0)+o/2,f=(i.arrow?.y??0)+s/2,p=``,m=``;return c===`bottom`?(p=a?u:`${d}px`,m=`${-s}px`):c===`top`?(p=a?u:`${d}px`,m=`${r.floating.height+s}px`):c===`right`?(p=`${-s}px`,m=a?u:`${f}px`):c===`left`&&(p=`${r.floating.width+s}px`,m=a?u:`${f}px`),{data:{x:p,y:m}}}});function Jc(e){let[t,n=`center`]=e.split(`-`);return[t,n]}var Yc=Ic,Xc=Rc,Zc=Hc,Qc=Gc,$c=`Label`,el=v.forwardRef((e,t)=>(0,B.jsx)(pr.label,{...e,ref:t,onMouseDown:t=>{t.target.closest(`button, input, select, textarea`)||(e.onMouseDown?.(t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}}));el.displayName=$c;var tl=el;function nl(e,[t,n]){return Math.min(n,Math.max(t,e))}var rl=[` `,`Enter`,`ArrowUp`,`ArrowDown`],il=[` `,`Enter`],al=`Select`,[ol,sl,cl]=xr(al),[ll,ul]=yr(al,[cl,Nc]),dl=Nc(),[fl,pl]=ll(al),[ml,hl]=ll(al),gl=`SelectProvider`;function _l(e){let{__scopeSelect:t,children:n,open:r,defaultOpen:i,onOpenChange:a,value:o,defaultValue:s,onValueChange:c,dir:l,name:u,autoComplete:d,disabled:f,required:p,form:m,internal_do_not_use_render:h}=e,g=dl(t),[_,y]=v.useState(null),[b,x]=v.useState(null),[S,C]=v.useState(!1),w=Rr(l),[T,E]=wr({prop:r,defaultProp:i??!1,onChange:a,caller:al}),[D,O]=wr({prop:o,defaultProp:s,onChange:c,caller:al}),k=v.useRef(null),A=v.useRef(D);v.useEffect(()=>{let e=m?_?.ownerDocument.getElementById(m):_?.form;if(e instanceof HTMLFormElement){let t=()=>O(A.current);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[m,_,O]);let j=!_||!!m||!!_.closest(`form`),[M,N]=v.useState(new Set),P=Ir(),F=Array.from(M).map(e=>e.props.value).join(`;`),I=v.useCallback(e=>{N(t=>new Set(t).add(e))},[]),L=v.useCallback(e=>{N(t=>{let n=new Set(t);return n.delete(e),n})},[]),ee={required:p,trigger:_,onTriggerChange:y,valueNode:b,onValueNodeChange:x,valueNodeHasChildren:S,onValueNodeHasChildrenChange:C,contentId:P,value:D,onValueChange:O,open:T,onOpenChange:E,dir:w,triggerPointerDownPosRef:k,disabled:f,name:u,autoComplete:d,form:m,nativeOptions:M,nativeSelectKey:F,isFormControl:j};return(0,B.jsx)(Yc,{...g,children:(0,B.jsx)(fl,{scope:t,...ee,children:(0,B.jsx)(ol.Provider,{scope:t,children:(0,B.jsx)(ml,{scope:t,onNativeOptionAdd:I,onNativeOptionRemove:L,children:mu(h)?h(ee):n})})})})}_l.displayName=gl;var vl=e=>{let{__scopeSelect:t,children:n,...r}=e;return(0,B.jsx)(_l,{__scopeSelect:t,...r,internal_do_not_use_render:({isFormControl:e})=>(0,B.jsxs)(B.Fragment,{children:[n,e?(0,B.jsx)(pu,{__scopeSelect:t}):null]})})};vl.displayName=al;var yl=`SelectTrigger`,bl=v.forwardRef((e,t)=>{let{__scopeSelect:n,disabled:r=!1,...i}=e,a=dl(n),o=pl(yl,n),s=o.disabled||r,c=Zn(t,o.onTriggerChange),l=sl(n),u=v.useRef(`touch`),[d,f,p]=gu(e=>{let t=l().filter(e=>!e.disabled),n=_u(t,e,t.find(e=>e.value===o.value));n!==void 0&&o.onValueChange(n.value)}),m=e=>{s||(o.onOpenChange(!0),p()),e&&(o.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)})};return(0,B.jsx)(Xc,{asChild:!0,...a,children:(0,B.jsx)(pr.button,{type:`button`,role:`combobox`,"aria-controls":o.open?o.contentId:void 0,"aria-expanded":o.open,"aria-required":o.required,"aria-autocomplete":`none`,dir:o.dir,"data-state":o.open?`open`:`closed`,disabled:s,"data-disabled":s?``:void 0,"data-placeholder":hu(o.value)?``:void 0,...i,ref:c,onClick:V(i.onClick,e=>{e.currentTarget.focus(),u.current!==`mouse`&&m(e)}),onPointerDown:V(i.onPointerDown,e=>{u.current=e.pointerType;let t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),e.button===0&&e.ctrlKey===!1&&e.pointerType===`mouse`&&(m(e),e.preventDefault())}),onKeyDown:V(i.onKeyDown,e=>{let t=d.current!==``;!(e.ctrlKey||e.altKey||e.metaKey)&&e.key.length===1&&f(e.key),!(t&&e.key===` `)&&rl.includes(e.key)&&(m(),e.preventDefault())})})})});bl.displayName=yl;var xl=`SelectValue`,Sl=v.forwardRef((e,t)=>{let{__scopeSelect:n,className:r,style:i,children:a,placeholder:o=``,...s}=e,c=pl(xl,n),{onValueNodeHasChildrenChange:l}=c,u=a!==void 0,d=Zn(t,c.onValueNodeChange);Sr(()=>{l(u)},[l,u]);let f=hu(c.value);return(0,B.jsx)(pr.span,{...s,asChild:!f&&s.asChild,ref:d,style:{pointerEvents:`none`},children:(0,B.jsx)(v.Fragment,{children:f?o:a},f?`placeholder`:`value`)})});Sl.displayName=xl;var Cl=`SelectIcon`,wl=v.forwardRef((e,t)=>{let{__scopeSelect:n,children:r,...i}=e;return(0,B.jsx)(pr.span,{"aria-hidden":!0,...i,ref:t,children:r||`▼`})});wl.displayName=Cl;var Tl=`SelectPortal`,[El,Dl]=ll(Tl,{forceMount:void 0}),Ol=e=>{let{__scopeSelect:t,forceMount:n,...r}=e;return(0,B.jsx)(El,{scope:e.__scopeSelect,forceMount:n,children:(0,B.jsx)(vi,{asChild:!0,...r})})};Ol.displayName=Tl;var kl=`SelectContent`,Al=v.forwardRef((e,t)=>{let n=Dl(kl,e.__scopeSelect),{forceMount:r=n.forceMount,...i}=e,a=pl(kl,e.__scopeSelect),[o,s]=v.useState();return Sr(()=>{s(new DocumentFragment)},[]),(0,B.jsx)(Or,{present:r||a.open,children:({present:e})=>e?(0,B.jsx)(Ll,{...i,ref:t}):(0,B.jsx)(jl,{...i,fragment:o})})});Al.displayName=kl;var jl=v.forwardRef((e,t)=>{let{__scopeSelect:n,children:r,fragment:i}=e;return i?y.createPortal((0,B.jsx)(Nl,{scope:n,children:(0,B.jsx)(ol.Slot,{scope:n,children:(0,B.jsx)(`div`,{ref:t,children:r})})}),i):null});jl.displayName=`SelectContentFragment`;var Ml=10,[Nl,Pl]=ll(kl),Fl=`SelectContentImpl`,Il=Qn(`SelectContent.RemoveScroll`),Ll=v.forwardRef((e,t)=>{let{__scopeSelect:n}=e,{position:r=`item-aligned`,onCloseAutoFocus:i,onEscapeKeyDown:a,onPointerDownOutside:o,side:s,sideOffset:c,align:l,alignOffset:u,arrowPadding:d,collisionBoundary:f,collisionPadding:p,sticky:m,hideWhenDetached:h,avoidCollisions:g,..._}=e,y=pl(kl,n),[b,x]=v.useState(null),[S,C]=v.useState(null),w=Zn(t,x),[T,E]=v.useState(null),[D,O]=v.useState(null),k=sl(n),[A,j]=v.useState(!1),M=v.useRef(!1);v.useEffect(()=>{if(b)return za(b)},[b]),xi();let N=v.useCallback(e=>{let[t,...n]=k().map(e=>e.ref.current),[r]=n.slice(-1),i=document.activeElement;for(let n of e)if(n===i||(n?.scrollIntoView({block:`nearest`}),n===t&&S&&(S.scrollTop=0),n===r&&S&&(S.scrollTop=S.scrollHeight),n?.focus(),document.activeElement!==i))return},[k,S]),P=v.useCallback(()=>N([T,b]),[N,T,b]);v.useEffect(()=>{A&&P()},[A,P]);let{onOpenChange:F,triggerPointerDownPosRef:I}=y;v.useEffect(()=>{if(b){let e={x:0,y:0},t=t=>{e={x:Math.abs(Math.round(t.pageX)-(I.current?.x??0)),y:Math.abs(Math.round(t.pageY)-(I.current?.y??0))}},n=n=>{e.x<=10&&e.y<=10?n.preventDefault():n.composedPath().includes(b)||F(!1),document.removeEventListener(`pointermove`,t),I.current=null};return I.current!==null&&(document.addEventListener(`pointermove`,t),document.addEventListener(`pointerup`,n,{capture:!0,once:!0})),()=>{document.removeEventListener(`pointermove`,t),document.removeEventListener(`pointerup`,n,{capture:!0})}}},[b,F,I]),v.useEffect(()=>{let e=()=>F(!1);return window.addEventListener(`blur`,e),window.addEventListener(`resize`,e),()=>{window.removeEventListener(`blur`,e),window.removeEventListener(`resize`,e)}},[F]);let[L,ee]=gu(e=>{let t=k().filter(e=>!e.disabled),n=_u(t,e,t.find(e=>e.ref.current===document.activeElement));n&&setTimeout(()=>n.ref.current?.focus())}),te=v.useCallback((e,t,n)=>{let r=!M.current&&!n;(y.value!==void 0&&y.value===t||r)&&(E(e),r&&(M.current=!0))},[y.value]),ne=v.useCallback(()=>b?.focus(),[b]),re=v.useCallback((e,t,n)=>{let r=!M.current&&!n;(y.value!==void 0&&y.value===t||r)&&O(e)},[y.value]),ie=r===`popper`?W:zl,R=ie===W?{side:s,sideOffset:c,align:l,alignOffset:u,arrowPadding:d,collisionBoundary:f,collisionPadding:p,sticky:m,hideWhenDetached:h,avoidCollisions:g}:{};return(0,B.jsx)(Nl,{scope:n,content:b,viewport:S,onViewportChange:C,itemRefCallback:te,selectedItem:T,onItemLeave:ne,itemTextRefCallback:re,focusSelectedItem:P,selectedItemText:D,position:r,isPositioned:A,searchRef:L,children:(0,B.jsx)(Aa,{as:Il,allowPinchZoom:!0,children:(0,B.jsx)(ai,{asChild:!0,trapped:y.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:V(i,e=>{y.trigger?.focus({preventScroll:!0}),e.preventDefault()}),children:(0,B.jsx)(Kr,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>y.onOpenChange(!1),children:(0,B.jsx)(ie,{role:`listbox`,id:y.contentId,"data-state":y.open?`open`:`closed`,dir:y.dir,onContextMenu:e=>e.preventDefault(),..._,...R,onPlaced:()=>j(!0),ref:w,style:{display:`flex`,flexDirection:`column`,outline:`none`,..._.style},onKeyDown:V(_.onKeyDown,e=>{let t=e.ctrlKey||e.altKey||e.metaKey;if(e.key===`Tab`&&e.preventDefault(),!t&&e.key.length===1&&ee(e.key),[`ArrowUp`,`ArrowDown`,`Home`,`End`].includes(e.key)){let t=k().filter(e=>!e.disabled).map(e=>e.ref.current);if([`ArrowUp`,`End`].includes(e.key)&&(t=t.slice().reverse()),[`ArrowUp`,`ArrowDown`].includes(e.key)){let n=e.target,r=t.indexOf(n);t=t.slice(r+1)}setTimeout(()=>N(t)),e.preventDefault()}})})})})})})});Ll.displayName=Fl;var Rl=`SelectItemAlignedPosition`,zl=v.forwardRef((e,t)=>{let{__scopeSelect:n,onPlaced:r,...i}=e,a=pl(kl,n),o=Pl(kl,n),[s,c]=v.useState(null),[l,u]=v.useState(null),d=Zn(t,u),f=sl(n),p=v.useRef(!1),m=v.useRef(!0),{viewport:h,selectedItem:g,selectedItemText:_,focusSelectedItem:y}=o,b=v.useCallback(()=>{if(a.trigger&&a.valueNode&&s&&l&&h&&g&&_){let e=a.trigger.getBoundingClientRect(),t=l.getBoundingClientRect(),n=a.valueNode.getBoundingClientRect(),i=_.getBoundingClientRect();if(a.dir!==`rtl`){let r=i.left-t.left,a=n.left-r,o=e.left-a,c=e.width+o,l=Math.max(c,t.width),u=window.innerWidth-Ml,d=nl(a,[Ml,Math.max(Ml,u-l)]);s.style.minWidth=c+`px`,s.style.left=d+`px`}else{let r=t.right-i.right,a=window.innerWidth-n.right-r,o=window.innerWidth-e.right-a,c=e.width+o,l=Math.max(c,t.width),u=window.innerWidth-Ml,d=nl(a,[Ml,Math.max(Ml,u-l)]);s.style.minWidth=c+`px`,s.style.right=d+`px`}let o=f(),c=window.innerHeight-Ml*2,u=h.scrollHeight,d=window.getComputedStyle(l),m=parseInt(d.borderTopWidth,10),v=parseInt(d.paddingTop,10),y=parseInt(d.borderBottomWidth,10),b=parseInt(d.paddingBottom,10),x=m+v+u+b+y,S=Math.min(g.offsetHeight*5,x),C=window.getComputedStyle(h),w=parseInt(C.paddingTop,10),T=parseInt(C.paddingBottom,10),E=e.top+e.height/2-Ml,D=c-E,O=g.offsetHeight/2,k=g.offsetTop+O,A=m+v+k,j=x-A;if(A<=E){let e=o.length>0&&g===o[o.length-1].ref.current;s.style.bottom=`0px`;let t=l.clientHeight-h.offsetTop-h.offsetHeight,n=A+Math.max(D,O+(e?T:0)+t+y);s.style.height=n+`px`}else{let e=o.length>0&&g===o[0].ref.current;s.style.top=`0px`;let t=Math.max(E,m+h.offsetTop+(e?w:0)+O)+j;s.style.height=t+`px`,h.scrollTop=A-E+h.offsetTop}s.style.margin=`${Ml}px 0`,s.style.minHeight=S+`px`,s.style.maxHeight=c+`px`,r?.(),requestAnimationFrame(()=>p.current=!0)}},[f,a.trigger,a.valueNode,s,l,h,g,_,a.dir,r]);Sr(()=>b(),[b]);let[x,S]=v.useState();return Sr(()=>{l&&S(window.getComputedStyle(l).zIndex)},[l]),(0,B.jsx)(Vl,{scope:n,contentWrapper:s,shouldExpandOnScrollRef:p,onScrollButtonChange:v.useCallback(e=>{e&&m.current===!0&&(b(),y?.(),m.current=!1)},[b,y]),children:(0,B.jsx)(`div`,{ref:c,style:{display:`flex`,flexDirection:`column`,position:`fixed`,zIndex:x},children:(0,B.jsx)(pr.div,{...i,ref:d,style:{boxSizing:`border-box`,maxHeight:`100%`,...i.style}})})})});zl.displayName=Rl;var Bl=`SelectPopperPosition`,W=v.forwardRef((e,t)=>{let{__scopeSelect:n,align:r=`start`,collisionPadding:i=Ml,...a}=e,o=dl(n);return(0,B.jsx)(Zc,{...o,...a,ref:t,align:r,collisionPadding:i,style:{boxSizing:`border-box`,...a.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)`}})});W.displayName=Bl;var[Vl,G]=ll(kl,{}),K=`SelectViewport`,Hl=v.forwardRef((e,t)=>{let{__scopeSelect:n,nonce:r,...i}=e,a=Pl(K,n),o=G(K,n),s=Zn(t,a.onViewportChange),c=v.useRef(0);return(0,B.jsxs)(B.Fragment,{children:[(0,B.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}),(0,B.jsx)(ol.Slot,{scope:n,children:(0,B.jsx)(pr.div,{"data-radix-select-viewport":``,role:`presentation`,...i,ref:s,style:{position:`relative`,flex:1,overflow:`hidden auto`,...i.style},onScroll:V(i.onScroll,e=>{let t=e.currentTarget,{contentWrapper:n,shouldExpandOnScrollRef:r}=o;if(r?.current&&n){let e=Math.abs(c.current-t.scrollTop);if(e>0){let r=window.innerHeight-Ml*2,i=parseFloat(n.style.minHeight),a=parseFloat(n.style.height),o=Math.max(i,a);if(o<r){let i=o+e,a=Math.min(r,i),s=i-a;n.style.height=a+`px`,n.style.bottom===`0px`&&(t.scrollTop=s>0?s:0,n.style.justifyContent=`flex-end`)}}}c.current=t.scrollTop})})})]})});Hl.displayName=K;var Ul=`SelectGroup`,[Wl,Gl]=ll(Ul),Kl=v.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,i=Ir();return(0,B.jsx)(Wl,{scope:n,id:i,children:(0,B.jsx)(pr.div,{role:`group`,"aria-labelledby":i,...r,ref:t})})});Kl.displayName=Ul;var ql=`SelectLabel`,Jl=v.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,i=Gl(ql,n);return(0,B.jsx)(pr.div,{id:i.id,...r,ref:t})});Jl.displayName=ql;var Yl=`SelectItem`,[Xl,Zl]=ll(Yl),Ql=v.forwardRef((e,t)=>{let{__scopeSelect:n,value:r,disabled:i=!1,textValue:a,...o}=e,s=pl(Yl,n),c=Pl(Yl,n),l=s.value===r,[u,d]=v.useState(a??``),[f,p]=v.useState(!1),m=Zn(t,zr(e=>c.itemRefCallback?.(e,r,i))),h=Ir(),g=v.useRef(`touch`),_=()=>{i||(s.onValueChange(r),s.onOpenChange(!1))};return(0,B.jsx)(Xl,{scope:n,value:r,disabled:i,textId:h,isSelected:l,onItemTextChange:v.useCallback(e=>{d(t=>t||(e?.textContent??``).trim())},[]),children:(0,B.jsx)(ol.ItemSlot,{scope:n,value:r,disabled:i,textValue:u,children:(0,B.jsx)(pr.div,{role:`option`,"aria-labelledby":h,"data-highlighted":f?``:void 0,"aria-selected":l&&f,"data-state":l?`checked`:`unchecked`,"aria-disabled":i||void 0,"data-disabled":i?``:void 0,tabIndex:i?void 0:-1,...o,ref:m,onFocus:V(o.onFocus,()=>p(!0)),onBlur:V(o.onBlur,()=>p(!1)),onClick:V(o.onClick,()=>{g.current!==`mouse`&&_()}),onPointerUp:V(o.onPointerUp,()=>{g.current===`mouse`&&_()}),onPointerDown:V(o.onPointerDown,e=>{g.current=e.pointerType}),onPointerMove:V(o.onPointerMove,e=>{g.current=e.pointerType,i?c.onItemLeave?.():g.current===`mouse`&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:V(o.onPointerLeave,e=>{e.currentTarget===document.activeElement&&c.onItemLeave?.()}),onKeyDown:V(o.onKeyDown,e=>{i||e.target!==e.currentTarget||c.searchRef?.current!==``&&e.key===` `||(il.includes(e.key)&&_(),e.key===` `&&e.preventDefault())})})})})});Ql.displayName=Yl;var $l=`SelectItemText`,eu=v.forwardRef((e,t)=>{let{__scopeSelect:n,className:r,style:i,...a}=e,o=pl($l,n),s=Pl($l,n),c=Zl($l,n),l=hl($l,n),[u,d]=v.useState(null),f=zr(e=>s.itemTextRefCallback?.(e,c.value,c.disabled)),p=Zn(t,d,c.onItemTextChange,f),m=u?.textContent,h=v.useMemo(()=>(0,B.jsx)(`option`,{value:c.value,disabled:c.disabled,children:m},c.value),[c.disabled,c.value,m]),{onNativeOptionAdd:g,onNativeOptionRemove:_}=l;return Sr(()=>(g(h),()=>_(h)),[g,_,h]),(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(pr.span,{id:c.textId,...a,ref:p}),c.isSelected&&o.valueNode&&!o.valueNodeHasChildren&&!hu(o.value)?y.createPortal(a.children,o.valueNode):null]})});eu.displayName=$l;var tu=`SelectItemIndicator`,nu=v.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e;return Zl(tu,n).isSelected?(0,B.jsx)(pr.span,{"aria-hidden":!0,...r,ref:t}):null});nu.displayName=tu;var ru=`SelectScrollUpButton`,iu=v.forwardRef((e,t)=>{let n=Pl(ru,e.__scopeSelect),r=G(ru,e.__scopeSelect),[i,a]=v.useState(!1),o=Zn(t,r.onScrollButtonChange);return Sr(()=>{if(n.viewport&&n.isPositioned){let e=function(){let e=t.scrollTop>0;a(e)},t=n.viewport;return e(),t.addEventListener(`scroll`,e),()=>t.removeEventListener(`scroll`,e)}},[n.viewport,n.isPositioned]),i?(0,B.jsx)(su,{...e,ref:o,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop-=t.offsetHeight)}}):null});iu.displayName=ru;var au=`SelectScrollDownButton`,ou=v.forwardRef((e,t)=>{let n=Pl(au,e.__scopeSelect),r=G(au,e.__scopeSelect),[i,a]=v.useState(!1),o=Zn(t,r.onScrollButtonChange);return Sr(()=>{if(n.viewport&&n.isPositioned){let e=function(){let e=t.scrollHeight-t.clientHeight,n=Math.ceil(t.scrollTop)<e;a(n)},t=n.viewport;return e(),t.addEventListener(`scroll`,e),()=>t.removeEventListener(`scroll`,e)}},[n.viewport,n.isPositioned]),i?(0,B.jsx)(su,{...e,ref:o,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop+=t.offsetHeight)}}):null});ou.displayName=au;var su=v.forwardRef((e,t)=>{let{__scopeSelect:n,onAutoScroll:r,...i}=e,a=Pl(`SelectScrollButton`,n),o=v.useRef(null),s=sl(n),c=v.useCallback(()=>{o.current!==null&&(window.clearInterval(o.current),o.current=null)},[]);return v.useEffect(()=>()=>c(),[c]),Sr(()=>{s().find(e=>e.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:`nearest`})},[s]),(0,B.jsx)(pr.div,{"aria-hidden":!0,...i,ref:t,style:{flexShrink:0,...i.style},onPointerDown:V(i.onPointerDown,()=>{o.current===null&&(o.current=window.setInterval(r,50))}),onPointerMove:V(i.onPointerMove,()=>{a.onItemLeave?.(),o.current===null&&(o.current=window.setInterval(r,50))}),onPointerLeave:V(i.onPointerLeave,()=>{c()})})}),cu=`SelectSeparator`,lu=v.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e;return(0,B.jsx)(pr.div,{"aria-hidden":!0,...r,ref:t})});lu.displayName=cu;var uu=`SelectArrow`,du=v.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,i=dl(n);return Pl(uu,n).position===`popper`?(0,B.jsx)(Qc,{...i,...r,ref:t}):null});du.displayName=uu;var fu=`SelectBubbleInput`,pu=v.forwardRef(({__scopeSelect:e,...t},n)=>{let r=pl(fu,e),{value:i,onValueChange:a,required:o,disabled:s,name:c,autoComplete:l,form:u}=r,{nativeOptions:d,nativeSelectKey:f}=r,p=v.useRef(null),m=Zn(n,p),h=i??``,g=mo(h),_=Array.from(d).some(e=>(e.props.value??``)===``);return v.useEffect(()=>{let e=p.current;if(!e)return;let t=window.HTMLSelectElement.prototype,n=Object.getOwnPropertyDescriptor(t,`value`).set;if(g!==h&&n){let t=new Event(`change`,{bubbles:!0});n.call(e,h),e.dispatchEvent(t)}},[g,h]),(0,B.jsxs)(pr.select,{"aria-hidden":!0,required:o,tabIndex:-1,name:c,autoComplete:l,disabled:s,form:u,onChange:e=>a(e.target.value),...t,style:{...hr,...t.style},ref:m,defaultValue:h,children:[hu(i)&&!_?(0,B.jsx)(`option`,{value:``}):null,Array.from(d)]},f)});pu.displayName=fu;function mu(e){return typeof e==`function`}function hu(e){return e===``||e===void 0}function gu(e){let t=zr(e),n=v.useRef(``),r=v.useRef(0),i=v.useCallback(e=>{let i=n.current+e;t(i),(function e(t){n.current=t,window.clearTimeout(r.current),t!==``&&(r.current=window.setTimeout(()=>e(``),1e3))})(i)},[t]),a=v.useCallback(()=>{n.current=``,window.clearTimeout(r.current)},[]);return v.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,a]}function _u(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=vu(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.textValue.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}function vu(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var[yu,bu]=yr(`Tooltip`,[Nc]),xu=Nc(),Su=`TooltipProvider`,Cu=700,wu=`tooltip.open`,[Tu,Eu]=yu(Su),Du=e=>{let{__scopeTooltip:t,delayDuration:n=Cu,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:a}=e,o=v.useRef(!0),s=v.useRef(!1),c=v.useRef(0);return v.useEffect(()=>{let e=c.current;return()=>window.clearTimeout(e)},[]),(0,B.jsx)(Tu,{scope:t,isOpenDelayedRef:o,delayDuration:n,onOpen:v.useCallback(()=>{r<=0||(window.clearTimeout(c.current),o.current=!1)},[r]),onClose:v.useCallback(()=>{r<=0||(window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.current=!0,r))},[r]),isPointerInTransitRef:s,onPointerInTransitChange:v.useCallback(e=>{s.current=e},[]),disableHoverableContent:i,children:a})};Du.displayName=Su;var Ou=`Tooltip`,[ku,Au]=yu(Ou),ju=e=>{let{__scopeTooltip:t,children:n,open:r,defaultOpen:i,onOpenChange:a,disableHoverableContent:o,delayDuration:s}=e,c=Eu(Ou,e.__scopeTooltip),l=xu(t),[u,d]=v.useState(null),f=Ir(),p=v.useRef(0),m=o??c.disableHoverableContent,h=s??c.delayDuration,g=v.useRef(!1),[_,y]=wr({prop:r,defaultProp:i??!1,onChange:e=>{e?(c.onOpen(),document.dispatchEvent(new CustomEvent(wu))):c.onClose(),a?.(e)},caller:Ou}),b=v.useMemo(()=>_?g.current?`delayed-open`:`instant-open`:`closed`,[_]),x=v.useCallback(()=>{window.clearTimeout(p.current),p.current=0,g.current=!1,y(!0)},[y]),S=v.useCallback(()=>{window.clearTimeout(p.current),p.current=0,y(!1)},[y]),C=v.useCallback(()=>{window.clearTimeout(p.current),p.current=window.setTimeout(()=>{g.current=!0,y(!0),p.current=0},h)},[h,y]);return v.useEffect(()=>()=>{p.current&&=(window.clearTimeout(p.current),0)},[]),(0,B.jsx)(Yc,{...l,children:(0,B.jsx)(ku,{scope:t,contentId:f,open:_,stateAttribute:b,trigger:u,onTriggerChange:d,onTriggerEnter:v.useCallback(()=>{c.isOpenDelayedRef.current?C():x()},[c.isOpenDelayedRef,C,x]),onTriggerLeave:v.useCallback(()=>{m?S():(window.clearTimeout(p.current),p.current=0)},[S,m]),onOpen:x,onClose:S,disableHoverableContent:m,children:n})})};ju.displayName=Ou;var Mu=`TooltipTrigger`,Nu=v.forwardRef((e,t)=>{let{__scopeTooltip:n,...r}=e,i=Au(Mu,n),a=Eu(Mu,n),o=xu(n),s=Zn(t,v.useRef(null),i.onTriggerChange),c=v.useRef(!1),l=v.useRef(!1),u=v.useCallback(()=>c.current=!1,[]);return v.useEffect(()=>()=>document.removeEventListener(`pointerup`,u),[u]),(0,B.jsx)(Xc,{asChild:!0,...o,children:(0,B.jsx)(pr.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...r,ref:s,onPointerMove:V(e.onPointerMove,e=>{e.pointerType!==`touch`&&!l.current&&!a.isPointerInTransitRef.current&&(i.onTriggerEnter(),l.current=!0)}),onPointerLeave:V(e.onPointerLeave,()=>{i.onTriggerLeave(),l.current=!1}),onPointerDown:V(e.onPointerDown,()=>{i.open&&i.onClose(),c.current=!0,document.addEventListener(`pointerup`,u,{once:!0})}),onFocus:V(e.onFocus,()=>{c.current||i.onOpen()}),onBlur:V(e.onBlur,i.onClose),onClick:V(e.onClick,i.onClose)})})});Nu.displayName=Mu;var Pu=`TooltipPortal`,[Fu,Iu]=yu(Pu,{forceMount:void 0}),Lu=e=>{let{__scopeTooltip:t,forceMount:n,children:r,container:i}=e,a=Au(Pu,t);return(0,B.jsx)(Fu,{scope:t,forceMount:n,children:(0,B.jsx)(Or,{present:n||a.open,children:(0,B.jsx)(vi,{asChild:!0,container:i,children:r})})})};Lu.displayName=Pu;var Ru=`TooltipContent`,zu=v.forwardRef((e,t)=>{let n=Iu(Ru,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i=`top`,...a}=e,o=Au(Ru,e.__scopeTooltip);return(0,B.jsx)(Or,{present:r||o.open,children:o.disableHoverableContent?(0,B.jsx)(Wu,{side:i,...a,ref:t}):(0,B.jsx)(Bu,{side:i,...a,ref:t})})}),Bu=v.forwardRef((e,t)=>{let n=Au(Ru,e.__scopeTooltip),r=Eu(Ru,e.__scopeTooltip),i=v.useRef(null),a=Zn(t,i),[o,s]=v.useState(null),{trigger:c,onClose:l}=n,u=i.current,{onPointerInTransitChange:d}=r,f=v.useCallback(()=>{s(null),d(!1)},[d]),p=v.useCallback((e,t)=>{let n=e.currentTarget,r={x:e.clientX,y:e.clientY},i=Ju(r,qu(r,n.getBoundingClientRect())),a=Yu(t.getBoundingClientRect()),o=Zu([...i,...a]);s(o),d(!0)},[d]);return v.useEffect(()=>()=>f(),[f]),v.useEffect(()=>{if(c&&u){let e=e=>p(e,u),t=e=>p(e,c);return c.addEventListener(`pointerleave`,e),u.addEventListener(`pointerleave`,t),()=>{c.removeEventListener(`pointerleave`,e),u.removeEventListener(`pointerleave`,t)}}},[c,u,p,f]),v.useEffect(()=>{if(o){let e=e=>{let t=e.target,n={x:e.clientX,y:e.clientY},r=c?.contains(t)||u?.contains(t),i=!Xu(n,o);r?f():i&&(f(),l())};return document.addEventListener(`pointermove`,e),()=>document.removeEventListener(`pointermove`,e)}},[c,u,o,l,f]),(0,B.jsx)(Wu,{...e,ref:a})}),[Vu,Hu]=yu(Ou,{isInside:!1}),Uu=tr(`TooltipContent`),Wu=v.forwardRef((e,t)=>{let{__scopeTooltip:n,children:r,"aria-label":i,onEscapeKeyDown:a,onPointerDownOutside:o,...s}=e,c=Au(Ru,n),l=xu(n),{onClose:u}=c;return v.useEffect(()=>(document.addEventListener(wu,u),()=>document.removeEventListener(wu,u)),[u]),v.useEffect(()=>{if(c.trigger){let e=e=>{e.target instanceof Node&&e.target.contains(c.trigger)&&u()};return window.addEventListener(`scroll`,e,{capture:!0}),()=>window.removeEventListener(`scroll`,e,{capture:!0})}},[c.trigger,u]),(0,B.jsx)(Kr,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:e=>e.preventDefault(),onDismiss:u,children:(0,B.jsxs)(Zc,{"data-state":c.stateAttribute,...l,...s,ref:t,style:{...s.style,"--radix-tooltip-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-tooltip-content-available-width":`var(--radix-popper-available-width)`,"--radix-tooltip-content-available-height":`var(--radix-popper-available-height)`,"--radix-tooltip-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-tooltip-trigger-height":`var(--radix-popper-anchor-height)`},children:[(0,B.jsx)(Uu,{children:r}),(0,B.jsx)(Vu,{scope:n,isInside:!0,children:(0,B.jsx)(vr,{id:c.contentId,role:`tooltip`,children:i||r})})]})})});zu.displayName=Ru;var Gu=`TooltipArrow`,Ku=v.forwardRef((e,t)=>{let{__scopeTooltip:n,...r}=e,i=xu(n);return Hu(Gu,n).isInside?null:(0,B.jsx)(Qc,{...i,...r,ref:t})});Ku.displayName=Gu;function qu(e,t){let n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(n,r,i,a)){case a:return`left`;case i:return`right`;case n:return`top`;case r:return`bottom`;default:throw Error(`unreachable`)}}function Ju(e,t,n=5){let r=[];switch(t){case`top`:r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case`bottom`:r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case`left`:r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case`right`:r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function Yu(e){let{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}function Xu(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}function Zu(e){let t=e.slice();return t.sort((e,t)=>e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:+(e.y>t.y)),Qu(t)}function Qu(e){if(e.length<=1)return e.slice();let t=[];for(let n=0;n<e.length;n++){let r=e[n];for(;t.length>=2;){let e=t[t.length-1],n=t[t.length-2];if((e.x-n.x)*(r.y-n.y)>=(e.y-n.y)*(r.x-n.x))t.pop();else break}t.push(r)}t.pop();let n=[];for(let t=e.length-1;t>=0;t--){let r=e[t];for(;n.length>=2;){let e=n[n.length-1],t=n[n.length-2];if((e.x-t.x)*(r.y-t.y)>=(e.y-t.y)*(r.x-t.x))n.pop();else break}n.push(r)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var $u=Du;function ed(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`)if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=ed(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n);return r}function td(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=ed(e))&&(r&&(r+=` `),r+=t);return r}var nd=`-`,rd=e=>{let t=sd(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{let n=e.split(nd);return n[0]===``&&n.length!==1&&n.shift(),id(n,t)||od(e)},getConflictingClassGroupIds:(e,t)=>{let i=n[e]||[];return t&&r[e]?[...i,...r[e]]:i}}},id=(e,t)=>{if(e.length===0)return t.classGroupId;let n=e[0],r=t.nextPart.get(n),i=r?id(e.slice(1),r):void 0;if(i)return i;if(t.validators.length===0)return;let a=e.join(nd);return t.validators.find(({validator:e})=>e(a))?.classGroupId},ad=/^\[(.+)\]$/,od=e=>{if(ad.test(e)){let t=ad.exec(e)[1],n=t?.substring(0,t.indexOf(`:`));if(n)return`arbitrary..`+n}},sd=e=>{let{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return dd(Object.entries(e.classGroups),n).forEach(([e,n])=>{cd(n,r,e,t)}),r},cd=(e,t,n,r)=>{e.forEach(e=>{if(typeof e==`string`){let r=e===``?t:ld(t,e);r.classGroupId=n;return}if(typeof e==`function`){if(ud(e)){cd(e(r),t,n,r);return}t.validators.push({validator:e,classGroupId:n});return}Object.entries(e).forEach(([e,i])=>{cd(i,ld(t,e),n,r)})})},ld=(e,t)=>{let n=e;return t.split(nd).forEach(e=>{n.nextPart.has(e)||n.nextPart.set(e,{nextPart:new Map,validators:[]}),n=n.nextPart.get(e)}),n},ud=e=>e.isThemeGetter,dd=(e,t)=>t?e.map(([e,n])=>[e,n.map(e=>typeof e==`string`?t+e:typeof e==`object`?Object.fromEntries(Object.entries(e).map(([e,n])=>[t+e,n])):e)]):e,fd=e=>{if(e<1)return{get:()=>void 0,set:()=>{}};let t=0,n=new Map,r=new Map,i=(i,a)=>{n.set(i,a),t++,t>e&&(t=0,r=n,n=new Map)};return{get(e){let t=n.get(e);if(t!==void 0)return t;if((t=r.get(e))!==void 0)return i(e,t),t},set(e,t){n.has(e)?n.set(e,t):i(e,t)}}},pd=`!`,md=e=>{let{separator:t,experimentalParseClassName:n}=e,r=t.length===1,i=t[0],a=t.length,o=e=>{let n=[],o=0,s=0,c;for(let l=0;l<e.length;l++){let u=e[l];if(o===0){if(u===i&&(r||e.slice(l,l+a)===t)){n.push(e.slice(s,l)),s=l+a;continue}if(u===`/`){c=l;continue}}u===`[`?o++:u===`]`&&o--}let l=n.length===0?e:e.substring(s),u=l.startsWith(pd);return{modifiers:n,hasImportantModifier:u,baseClassName:u?l.substring(1):l,maybePostfixModifierPosition:c&&c>s?c-s:void 0}};return n?e=>n({className:e,parseClassName:o}):o},hd=e=>{if(e.length<=1)return e;let t=[],n=[];return e.forEach(e=>{e[0]===`[`?(t.push(...n.sort(),e),n=[]):n.push(e)}),t.push(...n.sort()),t},gd=e=>({cache:fd(e.cacheSize),parseClassName:md(e),...rd(e)}),_d=/\s+/,vd=(e,t)=>{let{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i}=t,a=[],o=e.trim().split(_d),s=``;for(let e=o.length-1;e>=0;--e){let t=o[e],{modifiers:c,hasImportantModifier:l,baseClassName:u,maybePostfixModifierPosition:d}=n(t),f=!!d,p=r(f?u.substring(0,d):u);if(!p){if(!f){s=t+(s.length>0?` `+s:s);continue}if(p=r(u),!p){s=t+(s.length>0?` `+s:s);continue}f=!1}let m=hd(c).join(`:`),h=l?m+pd:m,g=h+p;if(a.includes(g))continue;a.push(g);let _=i(p,f);for(let e=0;e<_.length;++e){let t=_[e];a.push(h+t)}s=t+(s.length>0?` `+s:s)}return s};function yd(){let e=0,t,n,r=``;for(;e<arguments.length;)(t=arguments[e++])&&(n=bd(t))&&(r&&(r+=` `),r+=n);return r}var bd=e=>{if(typeof e==`string`)return e;let t,n=``;for(let r=0;r<e.length;r++)e[r]&&(t=bd(e[r]))&&(n&&(n+=` `),n+=t);return n};function xd(e,...t){let n,r,i,a=o;function o(o){return n=gd(t.reduce((e,t)=>t(e),e())),r=n.cache.get,i=n.cache.set,a=s,s(o)}function s(e){let t=r(e);if(t)return t;let a=vd(e,n);return i(e,a),a}return function(){return a(yd.apply(null,arguments))}}var Sd=e=>{let t=t=>t[e]||[];return t.isThemeGetter=!0,t},Cd=/^\[(?:([a-z-]+):)?(.+)\]$/i,wd=/^\d+\/\d+$/,q=new Set([`px`,`full`,`screen`]),Td=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Ed=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Dd=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Od=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,kd=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Ad=e=>Md(e)||q.has(e)||wd.test(e),jd=e=>Wd(e,`length`,Gd),Md=e=>!!e&&!Number.isNaN(Number(e)),Nd=e=>Wd(e,`number`,Md),Pd=e=>!!e&&Number.isInteger(Number(e)),Fd=e=>e.endsWith(`%`)&&Md(e.slice(0,-1)),J=e=>Cd.test(e),Id=e=>Td.test(e),Ld=new Set([`length`,`size`,`percentage`]),Rd=e=>Wd(e,Ld,Kd),zd=e=>Wd(e,`position`,Kd),Bd=new Set([`image`,`url`]),Vd=e=>Wd(e,Bd,Jd),Hd=e=>Wd(e,``,qd),Ud=()=>!0,Wd=(e,t,n)=>{let r=Cd.exec(e);return r?r[1]?typeof t==`string`?r[1]===t:t.has(r[1]):n(r[2]):!1},Gd=e=>Ed.test(e)&&!Dd.test(e),Kd=()=>!1,qd=e=>Od.test(e),Jd=e=>kd.test(e),Yd=xd(()=>{let e=Sd(`colors`),t=Sd(`spacing`),n=Sd(`blur`),r=Sd(`brightness`),i=Sd(`borderColor`),a=Sd(`borderRadius`),o=Sd(`borderSpacing`),s=Sd(`borderWidth`),c=Sd(`contrast`),l=Sd(`grayscale`),u=Sd(`hueRotate`),d=Sd(`invert`),f=Sd(`gap`),p=Sd(`gradientColorStops`),m=Sd(`gradientColorStopPositions`),h=Sd(`inset`),g=Sd(`margin`),_=Sd(`opacity`),v=Sd(`padding`),y=Sd(`saturate`),b=Sd(`scale`),x=Sd(`sepia`),S=Sd(`skew`),C=Sd(`space`),w=Sd(`translate`),T=()=>[`auto`,`contain`,`none`],E=()=>[`auto`,`hidden`,`clip`,`visible`,`scroll`],D=()=>[`auto`,J,t],O=()=>[J,t],k=()=>[``,Ad,jd],A=()=>[`auto`,Md,J],j=()=>[`bottom`,`center`,`left`,`left-bottom`,`left-top`,`right`,`right-bottom`,`right-top`,`top`],M=()=>[`solid`,`dashed`,`dotted`,`double`,`none`],N=()=>[`normal`,`multiply`,`screen`,`overlay`,`darken`,`lighten`,`color-dodge`,`color-burn`,`hard-light`,`soft-light`,`difference`,`exclusion`,`hue`,`saturation`,`color`,`luminosity`],P=()=>[`start`,`end`,`center`,`between`,`around`,`evenly`,`stretch`],F=()=>[``,`0`,J],I=()=>[`auto`,`avoid`,`all`,`avoid-page`,`page`,`left`,`right`,`column`],L=()=>[Md,J];return{cacheSize:500,separator:`:`,theme:{colors:[Ud],spacing:[Ad,jd],blur:[`none`,``,Id,J],brightness:L(),borderColor:[e],borderRadius:[`none`,``,`full`,Id,J],borderSpacing:O(),borderWidth:k(),contrast:L(),grayscale:F(),hueRotate:L(),invert:F(),gap:O(),gradientColorStops:[e],gradientColorStopPositions:[Fd,jd],inset:D(),margin:D(),opacity:L(),padding:O(),saturate:L(),scale:L(),sepia:F(),skew:L(),space:O(),translate:O()},classGroups:{aspect:[{aspect:[`auto`,`square`,`video`,J]}],container:[`container`],columns:[{columns:[Id]}],"break-after":[{"break-after":I()}],"break-before":[{"break-before":I()}],"break-inside":[{"break-inside":[`auto`,`avoid`,`avoid-page`,`avoid-column`]}],"box-decoration":[{"box-decoration":[`slice`,`clone`]}],box:[{box:[`border`,`content`]}],display:[`block`,`inline-block`,`inline`,`flex`,`inline-flex`,`table`,`inline-table`,`table-caption`,`table-cell`,`table-column`,`table-column-group`,`table-footer-group`,`table-header-group`,`table-row-group`,`table-row`,`flow-root`,`grid`,`inline-grid`,`contents`,`list-item`,`hidden`],float:[{float:[`right`,`left`,`none`,`start`,`end`]}],clear:[{clear:[`left`,`right`,`both`,`none`,`start`,`end`]}],isolation:[`isolate`,`isolation-auto`],"object-fit":[{object:[`contain`,`cover`,`fill`,`none`,`scale-down`]}],"object-position":[{object:[...j(),J]}],overflow:[{overflow:E()}],"overflow-x":[{"overflow-x":E()}],"overflow-y":[{"overflow-y":E()}],overscroll:[{overscroll:T()}],"overscroll-x":[{"overscroll-x":T()}],"overscroll-y":[{"overscroll-y":T()}],position:[`static`,`fixed`,`absolute`,`relative`,`sticky`],inset:[{inset:[h]}],"inset-x":[{"inset-x":[h]}],"inset-y":[{"inset-y":[h]}],start:[{start:[h]}],end:[{end:[h]}],top:[{top:[h]}],right:[{right:[h]}],bottom:[{bottom:[h]}],left:[{left:[h]}],visibility:[`visible`,`invisible`,`collapse`],z:[{z:[`auto`,Pd,J]}],basis:[{basis:D()}],"flex-direction":[{flex:[`row`,`row-reverse`,`col`,`col-reverse`]}],"flex-wrap":[{flex:[`wrap`,`wrap-reverse`,`nowrap`]}],flex:[{flex:[`1`,`auto`,`initial`,`none`,J]}],grow:[{grow:F()}],shrink:[{shrink:F()}],order:[{order:[`first`,`last`,`none`,Pd,J]}],"grid-cols":[{"grid-cols":[Ud]}],"col-start-end":[{col:[`auto`,{span:[`full`,Pd,J]},J]}],"col-start":[{"col-start":A()}],"col-end":[{"col-end":A()}],"grid-rows":[{"grid-rows":[Ud]}],"row-start-end":[{row:[`auto`,{span:[Pd,J]},J]}],"row-start":[{"row-start":A()}],"row-end":[{"row-end":A()}],"grid-flow":[{"grid-flow":[`row`,`col`,`dense`,`row-dense`,`col-dense`]}],"auto-cols":[{"auto-cols":[`auto`,`min`,`max`,`fr`,J]}],"auto-rows":[{"auto-rows":[`auto`,`min`,`max`,`fr`,J]}],gap:[{gap:[f]}],"gap-x":[{"gap-x":[f]}],"gap-y":[{"gap-y":[f]}],"justify-content":[{justify:[`normal`,...P()]}],"justify-items":[{"justify-items":[`start`,`end`,`center`,`stretch`]}],"justify-self":[{"justify-self":[`auto`,`start`,`end`,`center`,`stretch`]}],"align-content":[{content:[`normal`,...P(),`baseline`]}],"align-items":[{items:[`start`,`end`,`center`,`baseline`,`stretch`]}],"align-self":[{self:[`auto`,`start`,`end`,`center`,`stretch`,`baseline`]}],"place-content":[{"place-content":[...P(),`baseline`]}],"place-items":[{"place-items":[`start`,`end`,`center`,`baseline`,`stretch`]}],"place-self":[{"place-self":[`auto`,`start`,`end`,`center`,`stretch`]}],p:[{p:[v]}],px:[{px:[v]}],py:[{py:[v]}],ps:[{ps:[v]}],pe:[{pe:[v]}],pt:[{pt:[v]}],pr:[{pr:[v]}],pb:[{pb:[v]}],pl:[{pl:[v]}],m:[{m:[g]}],mx:[{mx:[g]}],my:[{my:[g]}],ms:[{ms:[g]}],me:[{me:[g]}],mt:[{mt:[g]}],mr:[{mr:[g]}],mb:[{mb:[g]}],ml:[{ml:[g]}],"space-x":[{"space-x":[C]}],"space-x-reverse":[`space-x-reverse`],"space-y":[{"space-y":[C]}],"space-y-reverse":[`space-y-reverse`],w:[{w:[`auto`,`min`,`max`,`fit`,`svw`,`lvw`,`dvw`,J,t]}],"min-w":[{"min-w":[J,t,`min`,`max`,`fit`]}],"max-w":[{"max-w":[J,t,`none`,`full`,`min`,`max`,`fit`,`prose`,{screen:[Id]},Id]}],h:[{h:[J,t,`auto`,`min`,`max`,`fit`,`svh`,`lvh`,`dvh`]}],"min-h":[{"min-h":[J,t,`min`,`max`,`fit`,`svh`,`lvh`,`dvh`]}],"max-h":[{"max-h":[J,t,`min`,`max`,`fit`,`svh`,`lvh`,`dvh`]}],size:[{size:[J,t,`auto`,`min`,`max`,`fit`]}],"font-size":[{text:[`base`,Id,jd]}],"font-smoothing":[`antialiased`,`subpixel-antialiased`],"font-style":[`italic`,`not-italic`],"font-weight":[{font:[`thin`,`extralight`,`light`,`normal`,`medium`,`semibold`,`bold`,`extrabold`,`black`,Nd]}],"font-family":[{font:[Ud]}],"fvn-normal":[`normal-nums`],"fvn-ordinal":[`ordinal`],"fvn-slashed-zero":[`slashed-zero`],"fvn-figure":[`lining-nums`,`oldstyle-nums`],"fvn-spacing":[`proportional-nums`,`tabular-nums`],"fvn-fraction":[`diagonal-fractions`,`stacked-fractions`],tracking:[{tracking:[`tighter`,`tight`,`normal`,`wide`,`wider`,`widest`,J]}],"line-clamp":[{"line-clamp":[`none`,Md,Nd]}],leading:[{leading:[`none`,`tight`,`snug`,`normal`,`relaxed`,`loose`,Ad,J]}],"list-image":[{"list-image":[`none`,J]}],"list-style-type":[{list:[`none`,`disc`,`decimal`,J]}],"list-style-position":[{list:[`inside`,`outside`]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[_]}],"text-alignment":[{text:[`left`,`center`,`right`,`justify`,`start`,`end`]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[_]}],"text-decoration":[`underline`,`overline`,`line-through`,`no-underline`],"text-decoration-style":[{decoration:[...M(),`wavy`]}],"text-decoration-thickness":[{decoration:[`auto`,`from-font`,Ad,jd]}],"underline-offset":[{"underline-offset":[`auto`,Ad,J]}],"text-decoration-color":[{decoration:[e]}],"text-transform":[`uppercase`,`lowercase`,`capitalize`,`normal-case`],"text-overflow":[`truncate`,`text-ellipsis`,`text-clip`],"text-wrap":[{text:[`wrap`,`nowrap`,`balance`,`pretty`]}],indent:[{indent:O()}],"vertical-align":[{align:[`baseline`,`top`,`middle`,`bottom`,`text-top`,`text-bottom`,`sub`,`super`,J]}],whitespace:[{whitespace:[`normal`,`nowrap`,`pre`,`pre-line`,`pre-wrap`,`break-spaces`]}],break:[{break:[`normal`,`words`,`all`,`keep`]}],hyphens:[{hyphens:[`none`,`manual`,`auto`]}],content:[{content:[`none`,J]}],"bg-attachment":[{bg:[`fixed`,`local`,`scroll`]}],"bg-clip":[{"bg-clip":[`border`,`padding`,`content`,`text`]}],"bg-opacity":[{"bg-opacity":[_]}],"bg-origin":[{"bg-origin":[`border`,`padding`,`content`]}],"bg-position":[{bg:[...j(),zd]}],"bg-repeat":[{bg:[`no-repeat`,{repeat:[``,`x`,`y`,`round`,`space`]}]}],"bg-size":[{bg:[`auto`,`cover`,`contain`,Rd]}],"bg-image":[{bg:[`none`,{"gradient-to":[`t`,`tr`,`r`,`br`,`b`,`bl`,`l`,`tl`]},Vd]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[m]}],"gradient-via-pos":[{via:[m]}],"gradient-to-pos":[{to:[m]}],"gradient-from":[{from:[p]}],"gradient-via":[{via:[p]}],"gradient-to":[{to:[p]}],rounded:[{rounded:[a]}],"rounded-s":[{"rounded-s":[a]}],"rounded-e":[{"rounded-e":[a]}],"rounded-t":[{"rounded-t":[a]}],"rounded-r":[{"rounded-r":[a]}],"rounded-b":[{"rounded-b":[a]}],"rounded-l":[{"rounded-l":[a]}],"rounded-ss":[{"rounded-ss":[a]}],"rounded-se":[{"rounded-se":[a]}],"rounded-ee":[{"rounded-ee":[a]}],"rounded-es":[{"rounded-es":[a]}],"rounded-tl":[{"rounded-tl":[a]}],"rounded-tr":[{"rounded-tr":[a]}],"rounded-br":[{"rounded-br":[a]}],"rounded-bl":[{"rounded-bl":[a]}],"border-w":[{border:[s]}],"border-w-x":[{"border-x":[s]}],"border-w-y":[{"border-y":[s]}],"border-w-s":[{"border-s":[s]}],"border-w-e":[{"border-e":[s]}],"border-w-t":[{"border-t":[s]}],"border-w-r":[{"border-r":[s]}],"border-w-b":[{"border-b":[s]}],"border-w-l":[{"border-l":[s]}],"border-opacity":[{"border-opacity":[_]}],"border-style":[{border:[...M(),`hidden`]}],"divide-x":[{"divide-x":[s]}],"divide-x-reverse":[`divide-x-reverse`],"divide-y":[{"divide-y":[s]}],"divide-y-reverse":[`divide-y-reverse`],"divide-opacity":[{"divide-opacity":[_]}],"divide-style":[{divide:M()}],"border-color":[{border:[i]}],"border-color-x":[{"border-x":[i]}],"border-color-y":[{"border-y":[i]}],"border-color-s":[{"border-s":[i]}],"border-color-e":[{"border-e":[i]}],"border-color-t":[{"border-t":[i]}],"border-color-r":[{"border-r":[i]}],"border-color-b":[{"border-b":[i]}],"border-color-l":[{"border-l":[i]}],"divide-color":[{divide:[i]}],"outline-style":[{outline:[``,...M()]}],"outline-offset":[{"outline-offset":[Ad,J]}],"outline-w":[{outline:[Ad,jd]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:k()}],"ring-w-inset":[`ring-inset`],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[_]}],"ring-offset-w":[{"ring-offset":[Ad,jd]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:[``,`inner`,`none`,Id,Hd]}],"shadow-color":[{shadow:[Ud]}],opacity:[{opacity:[_]}],"mix-blend":[{"mix-blend":[...N(),`plus-lighter`,`plus-darker`]}],"bg-blend":[{"bg-blend":N()}],filter:[{filter:[``,`none`]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[c]}],"drop-shadow":[{"drop-shadow":[``,`none`,Id,J]}],grayscale:[{grayscale:[l]}],"hue-rotate":[{"hue-rotate":[u]}],invert:[{invert:[d]}],saturate:[{saturate:[y]}],sepia:[{sepia:[x]}],"backdrop-filter":[{"backdrop-filter":[``,`none`]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[c]}],"backdrop-grayscale":[{"backdrop-grayscale":[l]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[u]}],"backdrop-invert":[{"backdrop-invert":[d]}],"backdrop-opacity":[{"backdrop-opacity":[_]}],"backdrop-saturate":[{"backdrop-saturate":[y]}],"backdrop-sepia":[{"backdrop-sepia":[x]}],"border-collapse":[{border:[`collapse`,`separate`]}],"border-spacing":[{"border-spacing":[o]}],"border-spacing-x":[{"border-spacing-x":[o]}],"border-spacing-y":[{"border-spacing-y":[o]}],"table-layout":[{table:[`auto`,`fixed`]}],caption:[{caption:[`top`,`bottom`]}],transition:[{transition:[`none`,`all`,``,`colors`,`opacity`,`shadow`,`transform`,J]}],duration:[{duration:L()}],ease:[{ease:[`linear`,`in`,`out`,`in-out`,J]}],delay:[{delay:L()}],animate:[{animate:[`none`,`spin`,`ping`,`pulse`,`bounce`,J]}],transform:[{transform:[``,`gpu`,`none`]}],scale:[{scale:[b]}],"scale-x":[{"scale-x":[b]}],"scale-y":[{"scale-y":[b]}],rotate:[{rotate:[Pd,J]}],"translate-x":[{"translate-x":[w]}],"translate-y":[{"translate-y":[w]}],"skew-x":[{"skew-x":[S]}],"skew-y":[{"skew-y":[S]}],"transform-origin":[{origin:[`center`,`top`,`top-right`,`right`,`bottom-right`,`bottom`,`bottom-left`,`left`,`top-left`,J]}],accent:[{accent:[`auto`,e]}],appearance:[{appearance:[`none`,`auto`]}],cursor:[{cursor:[`auto`,`default`,`pointer`,`wait`,`text`,`move`,`help`,`not-allowed`,`none`,`context-menu`,`progress`,`cell`,`crosshair`,`vertical-text`,`alias`,`copy`,`no-drop`,`grab`,`grabbing`,`all-scroll`,`col-resize`,`row-resize`,`n-resize`,`e-resize`,`s-resize`,`w-resize`,`ne-resize`,`nw-resize`,`se-resize`,`sw-resize`,`ew-resize`,`ns-resize`,`nesw-resize`,`nwse-resize`,`zoom-in`,`zoom-out`,J]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":[`none`,`auto`]}],resize:[{resize:[`none`,`y`,`x`,``]}],"scroll-behavior":[{scroll:[`auto`,`smooth`]}],"scroll-m":[{"scroll-m":O()}],"scroll-mx":[{"scroll-mx":O()}],"scroll-my":[{"scroll-my":O()}],"scroll-ms":[{"scroll-ms":O()}],"scroll-me":[{"scroll-me":O()}],"scroll-mt":[{"scroll-mt":O()}],"scroll-mr":[{"scroll-mr":O()}],"scroll-mb":[{"scroll-mb":O()}],"scroll-ml":[{"scroll-ml":O()}],"scroll-p":[{"scroll-p":O()}],"scroll-px":[{"scroll-px":O()}],"scroll-py":[{"scroll-py":O()}],"scroll-ps":[{"scroll-ps":O()}],"scroll-pe":[{"scroll-pe":O()}],"scroll-pt":[{"scroll-pt":O()}],"scroll-pr":[{"scroll-pr":O()}],"scroll-pb":[{"scroll-pb":O()}],"scroll-pl":[{"scroll-pl":O()}],"snap-align":[{snap:[`start`,`end`,`center`,`align-none`]}],"snap-stop":[{snap:[`normal`,`always`]}],"snap-type":[{snap:[`none`,`x`,`y`,`both`]}],"snap-strictness":[{snap:[`mandatory`,`proximity`]}],touch:[{touch:[`auto`,`none`,`manipulation`]}],"touch-x":[{"touch-pan":[`x`,`left`,`right`]}],"touch-y":[{"touch-pan":[`y`,`up`,`down`]}],"touch-pz":[`touch-pinch-zoom`],select:[{select:[`none`,`text`,`all`,`auto`]}],"will-change":[{"will-change":[`auto`,`scroll`,`contents`,`transform`,J]}],fill:[{fill:[e,`none`]}],"stroke-w":[{stroke:[Ad,jd,Nd]}],stroke:[{stroke:[e,`none`]}],sr:[`sr-only`,`not-sr-only`],"forced-color-adjust":[{"forced-color-adjust":[`auto`,`none`]}]},conflictingClassGroups:{overflow:[`overflow-x`,`overflow-y`],overscroll:[`overscroll-x`,`overscroll-y`],inset:[`inset-x`,`inset-y`,`start`,`end`,`top`,`right`,`bottom`,`left`],"inset-x":[`right`,`left`],"inset-y":[`top`,`bottom`],flex:[`basis`,`grow`,`shrink`],gap:[`gap-x`,`gap-y`],p:[`px`,`py`,`ps`,`pe`,`pt`,`pr`,`pb`,`pl`],px:[`pr`,`pl`],py:[`pt`,`pb`],m:[`mx`,`my`,`ms`,`me`,`mt`,`mr`,`mb`,`ml`],mx:[`mr`,`ml`],my:[`mt`,`mb`],size:[`w`,`h`],"font-size":[`leading`],"fvn-normal":[`fvn-ordinal`,`fvn-slashed-zero`,`fvn-figure`,`fvn-spacing`,`fvn-fraction`],"fvn-ordinal":[`fvn-normal`],"fvn-slashed-zero":[`fvn-normal`],"fvn-figure":[`fvn-normal`],"fvn-spacing":[`fvn-normal`],"fvn-fraction":[`fvn-normal`],"line-clamp":[`display`,`overflow`],rounded:[`rounded-s`,`rounded-e`,`rounded-t`,`rounded-r`,`rounded-b`,`rounded-l`,`rounded-ss`,`rounded-se`,`rounded-ee`,`rounded-es`,`rounded-tl`,`rounded-tr`,`rounded-br`,`rounded-bl`],"rounded-s":[`rounded-ss`,`rounded-es`],"rounded-e":[`rounded-se`,`rounded-ee`],"rounded-t":[`rounded-tl`,`rounded-tr`],"rounded-r":[`rounded-tr`,`rounded-br`],"rounded-b":[`rounded-br`,`rounded-bl`],"rounded-l":[`rounded-tl`,`rounded-bl`],"border-spacing":[`border-spacing-x`,`border-spacing-y`],"border-w":[`border-w-s`,`border-w-e`,`border-w-t`,`border-w-r`,`border-w-b`,`border-w-l`],"border-w-x":[`border-w-r`,`border-w-l`],"border-w-y":[`border-w-t`,`border-w-b`],"border-color":[`border-color-s`,`border-color-e`,`border-color-t`,`border-color-r`,`border-color-b`,`border-color-l`],"border-color-x":[`border-color-r`,`border-color-l`],"border-color-y":[`border-color-t`,`border-color-b`],"scroll-m":[`scroll-mx`,`scroll-my`,`scroll-ms`,`scroll-me`,`scroll-mt`,`scroll-mr`,`scroll-mb`,`scroll-ml`],"scroll-mx":[`scroll-mr`,`scroll-ml`],"scroll-my":[`scroll-mt`,`scroll-mb`],"scroll-p":[`scroll-px`,`scroll-py`,`scroll-ps`,`scroll-pe`,`scroll-pt`,`scroll-pr`,`scroll-pb`,`scroll-pl`],"scroll-px":[`scroll-pr`,`scroll-pl`],"scroll-py":[`scroll-pt`,`scroll-pb`],touch:[`touch-x`,`touch-y`,`touch-pz`],"touch-x":[`touch`],"touch-y":[`touch`],"touch-pz":[`touch`]},conflictingClassGroupModifiers:{"font-size":[`leading`]}}});function Y(...e){return Yd(td(e))}function Xd({delayDuration:e=0,...t}){return(0,B.jsx)($u,{"data-slot":`tooltip-provider`,delayDuration:e,...t})}var Zd=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),Qd=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),$d={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`},ef=(0,v.forwardRef)(({color:e=`currentColor`,size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i=``,children:a,iconNode:o,...s},c)=>(0,v.createElement)(`svg`,{ref:c,...$d,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:Qd(`lucide`,i),...s},[...o.map(([e,t])=>(0,v.createElement)(e,t)),...Array.isArray(a)?a:[a]])),X=(e,t)=>{let n=(0,v.forwardRef)(({className:n,...r},i)=>(0,v.createElement)(ef,{ref:i,iconNode:t,className:Qd(`lucide-${Zd(e)}`,n),...r}));return n.displayName=`${e}`,n},tf=X(`ArrowLeft`,[[`path`,{d:`m12 19-7-7 7-7`,key:`1l729n`}],[`path`,{d:`M19 12H5`,key:`x3x0zl`}]]),nf=X(`ArrowRight`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`m12 5 7 7-7 7`,key:`xquz4c`}]]),rf=X(`Bell`,[[`path`,{d:`M10.268 21a2 2 0 0 0 3.464 0`,key:`vwvbt9`}],[`path`,{d:`M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326`,key:`11g9vi`}]]),af=X(`Check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),of=X(`ChevronDown`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),sf=X(`ChevronLeft`,[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]),cf=X(`ChevronRight`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),lf=X(`ChevronUp`,[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]),uf=X(`CircleAlert`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`12`,x2:`12`,y1:`8`,y2:`12`,key:`1pkeuh`}],[`line`,{x1:`12`,x2:`12.01`,y1:`16`,y2:`16`,key:`4dfq90`}]]),df=X(`CircleCheck`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),ff=X(`CircleHelp`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3`,key:`1u773s`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),pf=X(`CircleSlash`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`9`,x2:`15`,y1:`15`,y2:`9`,key:`1dfufj`}]]),mf=X(`CircleX`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m15 9-6 6`,key:`1uzhvr`}],[`path`,{d:`m9 9 6 6`,key:`z0biqf`}]]),hf=X(`Circle`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]),gf=X(`Download`,[[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}],[`polyline`,{points:`7 10 12 15 17 10`,key:`2ggqvy`}],[`line`,{x1:`12`,x2:`12`,y1:`15`,y2:`3`,key:`1vk2je`}]]),_f=X(`EllipsisVertical`,[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`12`,cy:`5`,r:`1`,key:`gxeob9`}],[`circle`,{cx:`12`,cy:`19`,r:`1`,key:`lyex9k`}]]),vf=X(`Flag`,[[`path`,{d:`M4 15s1-1 4-1 5 2 8 2 4-1 4-1V3s-1 1-4 1-5-2-8-2-4 1-4 1z`,key:`i9b6wo`}],[`line`,{x1:`4`,x2:`4`,y1:`22`,y2:`15`,key:`1cm3nv`}]]),yf=X(`GitBranch`,[[`line`,{x1:`6`,x2:`6`,y1:`3`,y2:`15`,key:`17qcm7`}],[`circle`,{cx:`18`,cy:`6`,r:`3`,key:`1h7g24`}],[`circle`,{cx:`6`,cy:`18`,r:`3`,key:`fqmcym`}],[`path`,{d:`M18 9a9 9 0 0 1-9 9`,key:`n2h4wq`}]]),bf=X(`House`,[[`path`,{d:`M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8`,key:`5wwlr5`}],[`path`,{d:`M3 10a2 2 0 0 1 .709-1.528l7-5.999a2 2 0 0 1 2.582 0l7 5.999A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z`,key:`1d0kgt`}]]),xf=X(`Inbox`,[[`polyline`,{points:`22 12 16 12 14 15 10 15 8 12 2 12`,key:`o97t9d`}],[`path`,{d:`M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z`,key:`oot6mr`}]]),Sf=X(`Keyboard`,[[`path`,{d:`M10 8h.01`,key:`1r9ogq`}],[`path`,{d:`M12 12h.01`,key:`1mp3jc`}],[`path`,{d:`M14 8h.01`,key:`1primd`}],[`path`,{d:`M16 12h.01`,key:`1l6xoz`}],[`path`,{d:`M18 8h.01`,key:`emo2bl`}],[`path`,{d:`M6 8h.01`,key:`x9i8wu`}],[`path`,{d:`M7 16h10`,key:`wp8him`}],[`path`,{d:`M8 12h.01`,key:`czm47f`}],[`rect`,{width:`20`,height:`16`,x:`2`,y:`4`,rx:`2`,key:`18n3k1`}]]),Cf=X(`LayoutGrid`,[[`rect`,{width:`7`,height:`7`,x:`3`,y:`3`,rx:`1`,key:`1g98yp`}],[`rect`,{width:`7`,height:`7`,x:`14`,y:`3`,rx:`1`,key:`6d4xhi`}],[`rect`,{width:`7`,height:`7`,x:`14`,y:`14`,rx:`1`,key:`nxv5o0`}],[`rect`,{width:`7`,height:`7`,x:`3`,y:`14`,rx:`1`,key:`1bb6yr`}]]),wf=X(`LoaderCircle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),Tf=X(`Loader`,[[`path`,{d:`M12 2v4`,key:`3427ic`}],[`path`,{d:`m16.2 7.8 2.9-2.9`,key:`r700ao`}],[`path`,{d:`M18 12h4`,key:`wj9ykh`}],[`path`,{d:`m16.2 16.2 2.9 2.9`,key:`1bxg5t`}],[`path`,{d:`M12 18v4`,key:`jadmvz`}],[`path`,{d:`m4.9 19.1 2.9-2.9`,key:`bwix9q`}],[`path`,{d:`M2 12h4`,key:`j09sii`}],[`path`,{d:`m4.9 4.9 2.9 2.9`,key:`giyufr`}]]),Ef=X(`MessagesSquare`,[[`path`,{d:`M14 9a2 2 0 0 1-2 2H6l-4 4V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2z`,key:`p1xzt8`}],[`path`,{d:`M18 9h2a2 2 0 0 1 2 2v11l-4-4h-6a2 2 0 0 1-2-2v-1`,key:`1cx29u`}]]),Df=X(`Network`,[[`rect`,{x:`16`,y:`16`,width:`6`,height:`6`,rx:`1`,key:`4q2zg0`}],[`rect`,{x:`2`,y:`16`,width:`6`,height:`6`,rx:`1`,key:`8cvhb9`}],[`rect`,{x:`9`,y:`2`,width:`6`,height:`6`,rx:`1`,key:`1egb70`}],[`path`,{d:`M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3`,key:`1jsf9p`}],[`path`,{d:`M12 12V8`,key:`2874zd`}]]),Of=X(`Plus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]),kf=X(`RefreshCw`,[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]),Af=X(`Search`,[[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}],[`path`,{d:`m21 21-4.3-4.3`,key:`1qie3q`}]]),jf=X(`Settings`,[[`path`,{d:`M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z`,key:`1qme2f`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),Mf=X(`ShieldCheck`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),Nf=X(`TriangleAlert`,[[`path`,{d:`m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3`,key:`wmoenq`}],[`path`,{d:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),Pf=X(`X`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]);function Ff(){let e=new Map;return{run(t,n){let r=e.get(t);if(r!==void 0)return r;let i=n().finally(()=>{e.get(t)===i&&e.delete(t)});return e.set(t,i),i},get pending(){return e.size}}}var If=Ff(),Lf=`crtr:relay-token`;function Rf(){try{let e=window.localStorage.getItem(Lf);return e!==null&&e!==``?e:void 0}catch{return}}function zf(){let e;try{let t=new URLSearchParams(window.location.search).get(`token`);e=t!==null&&t!==``?t:void 0}catch{e=void 0}if(e!==void 0){try{window.localStorage.setItem(Lf,e)}catch{}return e}return Rf()}var Bf=zf();async function Vf(e,t){try{let n={"content-type":`application/json`};Bf!==void 0&&(n.authorization=`Bearer ${Bf}`);let r=await fetch(`/__crtr/source`,{method:`POST`,headers:n,body:JSON.stringify(e),...t===void 0?{}:{signal:t}});return r.ok?await r.json():{ok:!1,stdout:``,stderr:`bridge ${r.status} ${r.statusText}`}}catch(e){return t?.aborted===!0||e instanceof DOMException&&e.name===`AbortError`?{ok:!1,stdout:``,stderr:`aborted`}:{ok:!1,stdout:``,stderr:e instanceof Error?e.message:String(e)}}}async function Hf(e,t,n){return Vf({kind:`exec`,bin:`crtr`,args:e,...t===void 0?{}:{stdin:t}},n)}var Uf=class extends Error{code;constructor(e,t){super(t),this.name=`CommandError`,this.code=e}};function Wf(e){let t=e.stdout.trim();if(t===``)return null;try{let e=JSON.parse(t);if(e&&typeof e==`object`&&typeof e.error==`string`&&typeof e.message==`string`)return{code:e.error,message:e.message}}catch{}return null}async function Gf(e,t,n){let r=await Hf(e,t,n);if(!r.ok)throw new Uf(`bridge`,r.stderr||`bridge request failed`);let i=Wf(r);if(i!==null)throw new Uf(i.code,i.message);if(r.exitCode!==void 0&&r.exitCode!==0){let t=r.stderr.trim()===``?r.stdout.trim():r.stderr;throw new Uf(`bridge`,t===``?`crtr ${e.join(` `)} failed (${r.exitCode})`:t)}if(r.stdout.trim()!==``)try{return JSON.parse(r.stdout)}catch(e){throw new Uf(`bridge`,e instanceof Error?e.message:String(e))}}function Kf(){return If.run(`canvas:snapshot`,()=>Gf([`canvas`,`snapshot`,`--json`]))}function qf(e){return If.run(`node:inspect:${e}`,()=>Gf([`node`,`inspect`,`show`,e,`--json`]).then(e=>e.node))}function Jf(e){return If.run(`node:snapshot:${e}`,()=>Gf([`node`,`inspect`,`snapshot`,e,`--json`]))}function Yf(e){let t=[`node`,`new`,`--kind`,e.kind];return e.mode&&t.push(`--mode`,e.mode),e.root&&t.push(`--root`),e.cwd?.trim()&&t.push(`--cwd`,e.cwd.trim()),e.name?.trim()&&t.push(`--name`,e.name.trim()),e.model?.trim()&&t.push(`--model`,e.model.trim()),e.parent?.trim()&&t.push(`--parent`,e.parent.trim()),t.push(`--json`),Gf(t,e.prompt)}function Xf(e,t){let n=[`node`,`msg`,`--to`,e];return t.tier?.trim()&&n.push(`--tier`,t.tier.trim()),n.push(`--json`),Gf(n,t.body)}function Zf(e,t={}){let n=[`node`,`lifecycle`,`revive`,e];return t.fresh&&n.push(`--fresh`),n.push(`--json`),Gf(n)}function Qf(e){return Gf([`node`,`lifecycle`,`close`,`--node`,e,`--json`])}async function $f(e,t){let n=await Vf({kind:`file`,path:t});if(!n.ok)throw new Uf(`bridge`,n.stderr||`failed to read ${t}`);return{path:t,content:n.stdout,truncated:!1}}var ep=new Set,tp=!1;function np(){if(tp)return;tp=!0;let e;try{let t=new URL(`/__crtr/events`,window.location.href);Bf!==void 0&&t.searchParams.set(`token`,Bf),e=new EventSource(t.toString())}catch{tp=!1;return}e.onmessage=e=>{let t;try{t=JSON.parse(e.data).kind}catch{return}if(t!==void 0)for(let e of ep)e.kinds.includes(t)&&e.refresh()}}function rp(e,t){let n=(0,v.useRef)(t);n.current=t,(0,v.useEffect)(()=>{np();let t={kinds:e,refresh:()=>n.current()};return ep.add(t),()=>{ep.delete(t)}},[e.join(`,`)])}var ip=e=>{let t,n=new Set,r=(e,r)=>{let i=typeof e==`function`?e(t):e;if(!Object.is(i,t)){let e=t;t=r??(typeof i!=`object`||!i)?i:Object.assign({},t,i),n.forEach(n=>n(t,e))}},i=()=>t,a={setState:r,getState:i,getInitialState:()=>o,subscribe:e=>(n.add(e),()=>n.delete(e))},o=t=e(r,i,a);return a},ap=(e=>e?ip(e):ip),op=e=>e;function sp(e,t=op){let n=v.useSyncExternalStore(e.subscribe,v.useCallback(()=>t(e.getState()),[e,t]),v.useCallback(()=>t(e.getInitialState()),[e,t]));return v.useDebugValue(n),n}var cp=e=>{let t=ap(e),n=e=>sp(t,e);return Object.assign(n,t),n},lp=(e=>e?cp(e):cp),up=lp(e=>({reachable:!0,setReachable:t=>e({reachable:t})})),dp=1,fp=`crtr.web.roster.v1`;function pp(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function mp(e){return typeof e==`string`}function hp(e){return typeof e==`number`}function gp(e){return pp(e)?mp(e.node_id)&&mp(e.name)&&mp(e.kind)&&(e.mode===`base`||e.mode===`orchestrator`)&&(e.lifecycle===`terminal`||e.lifecycle===`resident`)&&(e.status===`active`||e.status===`idle`||e.status===`done`||e.status===`dead`||e.status===`canceled`)&&mp(e.cwd)&&(e.parent===null||mp(e.parent))&&mp(e.created)&&(e.host_kind===`broker`||e.host_kind===`tmux`)&&typeof e.enterable==`boolean`&&hp(e.attention_count)&&(e.cycles===void 0||hp(e.cycles))&&(e.last_activity===void 0||mp(e.last_activity)):!1}function _p(e){return pp(e)?e.schemaVersion===dp&&mp(e.generatedAt)&&hp(e.cachedAt)&&Array.isArray(e.nodes)&&e.nodes.every(gp):!1}function vp(){try{let e=globalThis.localStorage?.getItem(fp);if(e==null)return null;let t=JSON.parse(e);return _p(t)?t:null}catch{return null}}function yp(e,t){let n={schemaVersion:dp,nodes:e,generatedAt:t,cachedAt:Date.now()};try{globalThis.localStorage?.setItem(fp,JSON.stringify(n))}catch{}}var bp=3e4,xp=new class{state;listeners=new Set;started=!1;timer=null;constructor(){let e=vp();this.state=e?{nodes:e.nodes,generatedAt:e.generatedAt,loading:!1}:{nodes:[],generatedAt:null,loading:!0}}subscribe=e=>(this.ensureStarted(),this.listeners.add(e),()=>{this.listeners.delete(e)});getState=()=>this.state;refetch=()=>{this.load()};ensureStarted(){if(this.started)return;this.started=!0,this.load(),this.timer=setInterval(()=>void this.load(),bp);let e=()=>{document.visibilityState===`visible`&&this.load()};document.addEventListener(`visibilitychange`,e),window.addEventListener(`focus`,e)}setState(e){this.state=e;for(let e of this.listeners)e()}async load(){try{let e=await Kf();this.setState({nodes:e.nodes,generatedAt:e.generated_at,loading:!1}),yp(e.nodes,e.generated_at),up.getState().setReachable(!0)}catch{this.state.loading&&this.setState({...this.state,loading:!1}),up.getState().setReachable(!1)}}};function Sp(){let e=(0,v.useSyncExternalStore)(xp.subscribe,xp.getState);return rp([`nodes`,`inbox`],xp.refetch),e}var Cp=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,wp=td,Tp=(e,t)=>n=>{if(t?.variants==null)return wp(e,n?.class,n?.className);let{variants:r,defaultVariants:i}=t,a=Object.keys(r).map(e=>{let t=n?.[e],a=i?.[e];if(t===null)return null;let o=Cp(t)||Cp(a);return r[e][o]}),o=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return r===void 0||(e[n]=r),e},{});return wp(e,a,t?.compoundVariants?.reduce((e,t)=>{let{class:n,className:r,...a}=t;return Object.entries(a).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...i,...o}[t]):{...i,...o}[t]===n})?[...e,n,r]:e},[]),n?.class,n?.className)},Ep=Tp(`btn justify-center transition-all outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,{variants:{variant:{default:`primary`,destructive:`danger`,outline:``,secondary:``,ghost:`border-transparent`,link:`border-transparent bg-transparent text-primary underline-offset-4 hover:underline hover:bg-transparent`},size:{default:``,xs:`sm gap-1 text-xs [&_svg:not([class*='size-'])]:size-3`,sm:`sm`,lg:`px-6 py-2.5`,icon:`p-0 size-9`,"icon-xs":`p-0 size-6 [&_svg:not([class*='size-'])]:size-3`,"icon-sm":`p-0 size-8`,"icon-lg":`p-0 size-10`}},defaultVariants:{variant:`default`,size:`default`}});function Z({className:e,variant:t=`default`,size:n=`default`,asChild:r=!1,...i}){return(0,B.jsx)(r?$n:`button`,{"data-slot":`button`,"data-variant":t,"data-size":n,className:Y(Ep({variant:t,size:n,className:e})),...i})}function Dp({...e}){return(0,B.jsx)(Ga,{"data-slot":`dialog`,...e})}function Op({...e}){return(0,B.jsx)(Za,{"data-slot":`dialog-portal`,...e})}function kp({className:e,...t}){return(0,B.jsx)($a,{"data-slot":`dialog-overlay`,className:Y(`fixed inset-0 z-50 bg-black/50 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0`,e),...t})}function Ap({className:e,children:t,showCloseButton:n=!0,...r}){return(0,B.jsxs)(Op,{"data-slot":`dialog-portal`,children:[(0,B.jsx)(kp,{}),(0,B.jsxs)(ro,{"data-slot":`dialog-content`,className:Y(`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 bg-background p-6 duration-200 outline-none data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 sm:max-w-lg`,e),...r,children:[t,n&&(0,B.jsxs)(fo,{"data-slot":`dialog-close`,className:`absolute top-4 right-4 rounded-xs opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:ring-2 focus:ring-ring focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,children:[(0,B.jsx)(Pf,{}),(0,B.jsx)(`span`,{className:`sr-only`,children:`Close`})]})]})]})}function jp({className:e,...t}){return(0,B.jsx)(`div`,{"data-slot":`dialog-header`,className:Y(`flex flex-col gap-2 text-center sm:text-left`,e),...t})}function Mp({className:e,showCloseButton:t=!1,children:n,...r}){return(0,B.jsxs)(`div`,{"data-slot":`dialog-footer`,className:Y(`flex flex-col-reverse gap-2 sm:flex-row sm:justify-end`,e),...r,children:[n,t&&(0,B.jsx)(fo,{asChild:!0,children:(0,B.jsx)(Z,{variant:`outline`,children:`Close`})})]})}function Np({className:e,...t}){return(0,B.jsx)(co,{"data-slot":`dialog-title`,className:Y(`text-lg leading-none font-semibold`,e),...t})}function Pp({className:e,...t}){return(0,B.jsx)(U,{"data-slot":`dialog-description`,className:Y(`text-sm text-muted-foreground`,e),...t})}function Fp({className:e,type:t,...n}){return(0,B.jsx)(`input`,{type:t,"data-slot":`input`,className:Y(`h-9 w-full min-w-0 rounded-md border border-[var(--line)] bg-[oklch(0_0_0/0.25)] px-3 py-1 text-sm text-[var(--ink)] transition-[color,box-shadow] outline-none selection:bg-primary selection:text-primary-foreground file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-[var(--dim)] disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50`,`focus-visible:border-[var(--line2)] focus-visible:ring-[3px] focus-visible:ring-ring/40`,`aria-invalid:border-destructive aria-invalid:ring-destructive/20`,e),...n})}function Ip({className:e,...t}){return(0,B.jsx)(tl,{"data-slot":`label`,className:Y(`flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50`,e),...t})}function Lp({...e}){return(0,B.jsx)(vl,{"data-slot":`select`,...e})}function Rp({...e}){return(0,B.jsx)(Sl,{"data-slot":`select-value`,...e})}function zp({className:e,size:t=`default`,children:n,...r}){return(0,B.jsxs)(bl,{"data-slot":`select-trigger`,"data-size":t,className:Y(`flex w-fit items-center justify-between gap-2 rounded-md border border-[var(--line)] bg-[oklch(0.92_0.008_80/0.02)] px-3 py-2 font-mono text-sm text-[var(--ink2)] whitespace-nowrap transition-[color,box-shadow] outline-none cursor-pointer focus-visible:border-[var(--line2)] focus-visible:ring-[3px] focus-visible:ring-ring/40 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-[placeholder]:text-[var(--mut)] 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 [&_svg:not([class*='text-'])]:text-[var(--mut)]`,e),...r,children:[n,(0,B.jsx)(wl,{asChild:!0,children:(0,B.jsx)(of,{className:`size-4 opacity-50`})})]})}function Bp({className:e,children:t,position:n=`item-aligned`,align:r=`center`,...i}){return(0,B.jsx)(Ol,{children:(0,B.jsxs)(Al,{"data-slot":`select-content`,className:Y(`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 bg-popover text-popover-foreground 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 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95`,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:[(0,B.jsx)(Hp,{}),(0,B.jsx)(Hl,{className:Y(`p-1`,n===`popper`&&`h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1`),children:t}),(0,B.jsx)(Up,{})]})})}function Vp({className:e,children:t,...n}){return(0,B.jsxs)(Ql,{"data-slot":`select-item`,className:Y(`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 focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2`,e),...n,children:[(0,B.jsx)(`span`,{"data-slot":`select-item-indicator`,className:`absolute right-2 flex size-3.5 items-center justify-center`,children:(0,B.jsx)(nu,{children:(0,B.jsx)(af,{className:`size-4`})})}),(0,B.jsx)(eu,{children:t})]})}function Hp({className:e,...t}){return(0,B.jsx)(iu,{"data-slot":`select-scroll-up-button`,className:Y(`flex cursor-default items-center justify-center py-1`,e),...t,children:(0,B.jsx)(lf,{className:`size-4`})})}function Up({className:e,...t}){return(0,B.jsx)(ou,{"data-slot":`select-scroll-down-button`,className:Y(`flex cursor-default items-center justify-center py-1`,e),...t,children:(0,B.jsx)(of,{className:`size-4`})})}function Wp({className:e,...t}){return(0,B.jsx)(`textarea`,{"data-slot":`textarea`,className:Y(`flex field-sizing-content min-h-16 w-full rounded-md border border-[var(--line)] bg-[oklch(0_0_0/0.3)] px-3 py-2 text-sm text-[var(--ink)] transition-[color,box-shadow] outline-none placeholder:text-[var(--dim)] focus-visible:border-[var(--line2)] focus-visible:ring-[3px] focus-visible:ring-ring/40 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20`,e),...t})}var Gp=Tp(`badge w-fit max-w-full overflow-hidden text-[var(--ink2)] whitespace-nowrap [&>svg]:pointer-events-none [&>svg]:size-3`,{variants:{variant:{default:``,secondary:`dead`,destructive:`blocked`,outline:``,ghost:`border-transparent`,link:`border-transparent underline-offset-4 [a&]:hover:underline`}},defaultVariants:{variant:`default`}});function Kp({className:e,variant:t=`default`,asChild:n=!1,...r}){return(0,B.jsx)(n?$n:`span`,{"data-slot":`badge`,"data-variant":t,className:Y(Gp({variant:t}),e),...r})}function qp(e){return e instanceof Uf&&(e.code===`not_found`||e.code===`already_resolved`||e.code===`claimed`)}function Jp(e){let t=e.indexOf(`/.crouter/interactions/`);return t>=0?e.slice(0,t):e}function Yp(e){if(e.trim()===``)return{title:``};let t=e.match(/^\s*#{1,6}\s+(.+?)\s*(?:\n|$)/);return t?{title:t[1],body:e.slice(t[0].length).trim()||void 0}:{title:e.trim(),body:e.trim()}}function Xp(e){switch(e){case`notify`:case`validation`:case`decision`:case`context`:case`error`:return e}throw Error(`Unknown deck kind: ${e}`)}function Zp(e){let{title:t,body:n}=Yp(e.prompt);return{id:e.id,title:t||e.id,body:n,kind:Xp(e.kind),options:e.options.map(e=>({id:e.id,label:e.label,...e.description===void 0?{}:{description:e.description}})),multiSelect:e.multiSelect,allowFreetext:e.allow_freetext}}function Qp(e){return{id:e.id,job_id:e.job_id,kind:Xp(e.kind),title:e.title,blocked_since:e.blocked_since,conversation_id:e.conversation_id,conversation_title:e.conversation_title,asking_node_id:e.asking_node_id,asking_node_name:e.asking_node_name,cwd:Jp(e.dir),interaction_count:e.interaction_count}}function $p(e,t){return{id:e.id,job_id:e.job_id??e.id,kind:Xp(e.kind),title:e.title,blocked_since:e.blocked_since,conversation_id:e.conversation_id,conversation_title:e.conversation_title,asking_node_id:e.asking_node_id,asking_node_name:e.asking_node_name,cwd:t,interaction_count:e.interaction_count,interactions:e.interactions.map(Zp)}}function em(){return If.run(`human:list`,async()=>(await Gf([`human`,`list`,`--json`])).items.map(Qp))}async function tm(e){let t=await Gf([`human`,`deck`,e,`--json`]),n=(await qf(t.asking_node_id)).cwd;return $p(t,n)}async function nm(e,t){let n=JSON.stringify({responses:t.responses}),r=await Gf([`human`,`resolve`,e,`--json`],n);if(r.resolved!==!0)throw new Uf(r.reason===`claimed`?`claimed`:`already_resolved`,r.reason===`claimed`?`That request is already being handled.`:`That request was already handled.`);return{resolved:!0,job_id:r.job_id??e,delivered:r.delivered??!0}}function rm(e){let t=0;for(let n of e)t+=Math.max(0,n.attention_count);return t}function im(){let{nodes:e}=Sp();return rm(e)}function am(){let[e,t]=(0,v.useState)([]),[n,r]=(0,v.useState)(!0),[i,a]=(0,v.useState)(0),o=(0,v.useCallback)(()=>a(e=>e+1),[]);return rp([`inbox`,`nodes`],o),(0,v.useEffect)(()=>{let e=!1;return em().then(n=>{e||(t(n),r(!1))}).catch(()=>{e||r(!1)}),()=>{e=!0}},[i]),{decks:e,loading:n,refetch:o}}function om(e){let{decks:t}=am();return t.filter(t=>t.conversation_id===e)}var sm={notify:{icon:rf,label:`Update`},validation:{icon:Mf,label:`Approval`},decision:{icon:yf,label:`Decision`},context:{icon:ff,label:`Question`},error:{icon:Nf,label:`Problem`}};function cm(e){switch(e){case`notify`:return sm.notify;case`validation`:return sm.validation;case`decision`:return sm.decision;case`context`:return sm.context;case`error`:return sm.error;default:return sm.context}}function lm(e,t=Date.now()){let n=new Date(e).getTime();if(Number.isNaN(n))return``;let r=Math.max(0,Math.round((t-n)/1e3));if(r<60)return`${r}s`;let i=Math.round(r/60);if(i<60)return`${i}m`;let a=Math.round(i/60);return a<24?`${a}h`:`${Math.round(a/24)}d`}var um=1,dm=lp(e=>({toasts:[],push:(t,n=`info`)=>{let r=um++;e(e=>({toasts:[...e.toasts,{id:r,message:t,tone:n}]})),setTimeout(()=>e(e=>({toasts:e.toasts.filter(e=>e.id!==r)})),4e3)},dismiss:t=>e(e=>({toasts:e.toasts.filter(e=>e.id!==t)}))}));function fm(e,t=`info`){dm.getState().push(e,t)}var pm=e=>({"--i":e});async function mm(e,t){let n=(await tm(e)).interactions[0];await nm(e,{responses:[t===`ack`?{id:n.id}:{id:n.id,selectedOptionIds:[(t===`yes`?n.options.find(e=>e.id===`yes`)?.id??n.options[0]?.id:n.options.find(e=>e.id===`no`)?.id??n.options[1]?.id)??t]}]})}function hm(){let{decks:e,loading:t}=am(),n=(0,v.useMemo)(()=>[...e].sort((e,t)=>new Date(t.blocked_since).getTime()-new Date(e.blocked_since).getTime()),[e]);return t||n.length===0?null:(0,B.jsxs)(`section`,{className:`needs rv`,style:pm(3),children:[(0,B.jsxs)(`div`,{className:`needs-head`,children:[(0,B.jsx)(vf,{size:14,className:`flag`,"aria-hidden":!0}),(0,B.jsxs)(`span`,{className:`instlabel`,children:[`Needs you — `,n.length,` blocked`]}),(0,B.jsx)(`div`,{className:`rule`})]}),(0,B.jsx)(`div`,{className:`needs-grid`,children:n.map(e=>(0,B.jsx)(gm,{deck:e},e.id))})]})}function gm({deck:e}){let t=ut(),{refetch:n}=am(),[r,i]=(0,v.useState)(!1),[a,o]=(0,v.useState)(null),[s,c]=(0,v.useState)(!1),l=cm(e.kind).label,u=lm(e.blocked_since);e.kind===`decision`&&a===null&&!s&&(async()=>{if(!(e.kind!==`decision`||s||a!==null)){c(!0);try{let t=(await tm(e.job_id)).interactions[0]?.options??[];o(t.length<=3?t:[])}catch(e){qp(e)?(o([]),n()):(console.error(`[needs-you] failed to load decision options:`,e),o([]))}finally{c(!1)}}})();let d=async t=>{if(!r){i(!0);try{await mm(e.job_id,t),fm(`Done — thanks!`,`success`),n()}catch(e){if(qp(e)){fm(e instanceof Error?e.message:`That request was already handled.`),n();return}console.error(`[needs-you] resolve failed:`,e),fm(`Something went wrong — try again.`)}finally{i(!1)}}},f=async t=>{if(!r){i(!0);try{let r=(await tm(e.job_id)).interactions[0];await nm(e.job_id,{responses:[{id:r.id,selectedOptionIds:[t]}]}),fm(`Done — thanks!`,`success`),n()}catch(e){if(qp(e)){fm(e instanceof Error?e.message:`That request was already handled.`),n();return}console.error(`[needs-you] decision option resolve failed:`,e),fm(`Something went wrong — try again.`)}finally{i(!1)}}},p=e.kind===`decision`&&a!==null&&a.length>0;return(0,B.jsxs)(`div`,{className:`deck`,children:[(0,B.jsxs)(`div`,{className:`deck-meta`,children:[(0,B.jsx)(`span`,{className:`deck-kind`,children:l}),(0,B.jsx)(`span`,{className:`from`,children:e.asking_node_name}),(0,B.jsxs)(`span`,{className:`age`,children:[`blocked `,u]})]}),(0,B.jsx)(`p`,{className:`deck-q line-clamp-2`,children:e.title}),(0,B.jsxs)(`div`,{className:`deck-actions`,children:[e.kind===`notify`&&(0,B.jsx)(Z,{type:`button`,variant:`outline`,size:`sm`,disabled:r,onClick:()=>void d(`ack`),children:`Got it`}),e.kind===`validation`&&(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(Z,{type:`button`,size:`sm`,disabled:r,onClick:()=>void d(`yes`),children:`Approve`}),(0,B.jsx)(Z,{type:`button`,variant:`outline`,size:`sm`,disabled:r,onClick:()=>void d(`no`),children:`Reject`})]}),p&&a.map(e=>(0,B.jsx)(Z,{type:`button`,variant:`outline`,size:`sm`,disabled:r,onClick:()=>void f(e.id),children:e.label},e.id)),(0,B.jsxs)(Z,{type:`button`,variant:`ghost`,size:`sm`,disabled:r,onClick:()=>t(`/inbox/${encodeURIComponent(e.job_id)}`),style:{marginLeft:`auto`,color:`var(--dim)`},children:[`open thread `,(0,B.jsx)(nf,{"aria-hidden":!0})]})]})]})}var _m=e=>({"--i":e}),vm=`hosted in a tmux pane — open it in your terminal`;function ym(e){let t=new Map;for(let n of e)t.set(n.node_id,{node:n,children:[]});let n=[];for(let e of t.values()){let r=e.node.parent,i=r?t.get(r):void 0;i?i.children.push(e):n.push(e)}return n}var bm=[`active`,`idle`,`done`,`dead`,`canceled`],xm={query:``,status:`all`,blockedOnly:!1};function Sm(e){return e.query.trim()!==``||e.status!==`all`||e.blockedOnly}function Cm(e,t){if(t.status!==`all`&&e.status!==t.status||t.blockedOnly&&e.attention_count<=0)return!1;let n=t.query.trim().toLowerCase();return!(n&&!`${e.name} ${e.kind} ${e.mode} ${e.cwd} ${e.node_id} ${e.status}`.toLowerCase().includes(n))}function wm(e,t){if(!Sm(t))return e;let n=new Map(e.map(e=>[e.node_id,e])),r=new Set;for(let i of e){if(!Cm(i,t))continue;let e=i;for(;e&&!r.has(e.node_id);)r.add(e.node_id),e=e.parent?n.get(e.parent):void 0}return e.filter(e=>r.has(e.node_id))}var Tm=new Set([`dead`,`canceled`]);function Em(e){return Tm.has(e.node.status)&&e.children.every(Em)}function Dm(e){return 1+e.children.reduce((e,t)=>e+Dm(t),0)}var Om=3,km={active:hf,idle:hf,done:df,dead:pf,canceled:mf};function Am(e,t){return t?uf:km[e]??hf}function jm(e){return e.toLocaleTimeString(`en-GB`,{hour12:!1})}function Mm(){let[e,t]=(0,v.useState)(()=>jm(new Date));return(0,v.useEffect)(()=>{let e=setInterval(()=>t(jm(new Date)),1e3);return()=>clearInterval(e)},[]),e}function Nm(){let{nodes:e}=Sp(),[t,n]=(0,v.useState)(!1),[r,i]=(0,v.useState)(0),[a,o]=(0,v.useState)(xm),s=(0,v.useRef)(null),c=Mm(),l=e.filter(e=>e.status===`active`).length,u=(0,v.useMemo)(()=>ym(wm(e,a)),[e,a]);return(0,v.useEffect)(()=>{let e=e=>{if(e.key!==`/`||e.metaKey||e.ctrlKey||e.altKey)return;let t=document.activeElement;t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement||t instanceof HTMLElement&&t.isContentEditable||(e.preventDefault(),s.current?.focus())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[]),(0,B.jsxs)(`div`,{className:`in relative z-[1] h-full min-h-0 overflow-auto`,style:{padding:`34px 44px 44px`},children:[(0,B.jsxs)(`div`,{className:`rv flex items-baseline gap-4`,style:_m(1),children:[(0,B.jsx)(`h1`,{className:`text-2xl`,style:{fontWeight:420,letterSpacing:`-0.01em`,fontVariationSettings:`"opsz" 60`,color:`var(--ink)`},children:`Canvas`}),(0,B.jsxs)(`span`,{className:`text-sm`,style:{color:`var(--mut)`},children:[e.length,` `,e.length===1?`node`:`nodes`,l>0&&` · ${l} active`]}),(0,B.jsxs)(`div`,{className:`font-inst text-xs flex items-center gap-2`,style:{marginLeft:`auto`,color:`var(--ink2)`,letterSpacing:`0.1em`},children:[(0,B.jsx)(`span`,{style:{width:`8px`,height:`8px`,borderRadius:`50%`,background:`var(--act)`,animation:`pulse 2.4s ease-out infinite`}}),(0,B.jsx)(`span`,{children:c})]})]}),(0,B.jsxs)(`div`,{className:`rv flex items-center gap-2.5`,style:{margin:`20px 0 22px`,..._m(2)},children:[(0,B.jsxs)(`div`,{className:`search`,children:[(0,B.jsx)(Af,{size:14,className:`opacity-70`,"aria-hidden":!0}),(0,B.jsx)(`input`,{ref:s,value:a.query,onChange:e=>o(t=>({...t,query:e.currentTarget.value})),onKeyDown:e=>{e.key===`Escape`&&(o(e=>({...e,query:``})),e.currentTarget.blur())},placeholder:`Search name, kind, mode, cwd, id…`,"aria-label":`Search nodes`,className:`min-w-0 flex-1 border-0 bg-transparent p-0 text-sm outline-none`,style:{color:`var(--ink)`}}),(0,B.jsx)(`span`,{className:`kbd`,children:`/`})]}),(0,B.jsxs)(`label`,{className:`selectish`,children:[(0,B.jsxs)(`select`,{value:a.status,onChange:e=>o(t=>({...t,status:e.currentTarget.value})),"aria-label":`Filter by status`,className:`cursor-pointer appearance-none border-0 bg-transparent text-sm outline-none`,style:{color:`var(--ink2)`},children:[(0,B.jsx)(`option`,{value:`all`,children:`all statuses`}),bm.map(e=>(0,B.jsx)(`option`,{value:e,children:e},e))]}),(0,B.jsx)(`span`,{className:`car`,children:`▾`})]}),(0,B.jsxs)(`label`,{className:`checkish select-none`,children:[(0,B.jsx)(`span`,{className:`box`,style:a.blockedOnly?{background:`var(--blk)`,borderColor:`var(--blk)`}:void 0}),`blocked`,(0,B.jsx)(`input`,{type:`checkbox`,checked:a.blockedOnly,onChange:e=>o(t=>({...t,blockedOnly:e.currentTarget.checked})),className:`sr-only`})]}),(0,B.jsx)(`button`,{type:`button`,className:`btn primary`,style:{marginLeft:`auto`},onClick:()=>{i(e=>e+1),n(!0)},children:`+ Spawn a node`})]}),(0,B.jsx)(hm,{}),(0,B.jsxs)(`div`,{className:`panel rv`,style:{padding:`6px 0`,..._m(4)},children:[(0,B.jsxs)(`div`,{className:`flex items-center`,style:{padding:`10px 18px 9px`,borderBottom:`1px solid var(--line)`},children:[(0,B.jsx)(`span`,{className:`instlabel`,style:{color:`var(--dim)`},children:`Node forest`}),(0,B.jsx)(`span`,{className:`font-inst text-xs`,style:{marginLeft:`auto`,color:`var(--dim)`,letterSpacing:`0.1em`},children:`sorted · activity`})]}),(0,B.jsx)(`div`,{className:`tree`,children:e.length===0?(0,B.jsx)(`p`,{className:`px-3 py-2 text-sm italic`,style:{color:`var(--mut)`},children:`No nodes on the canvas yet.`}):u.length===0?(0,B.jsx)(`p`,{className:`px-3 py-2 text-sm italic`,style:{color:`var(--mut)`},children:`No matching nodes.`}):u.map(e=>(0,B.jsx)(Pm,{node:e},e.node.node_id))})]}),(0,B.jsx)(Im,{open:t,onClose:()=>n(!1)},r)]})}function Pm({node:e}){let t=ut(),[n,r]=(0,v.useState)(!1),i=e.node,a=i.attention_count>0,o=Tm.has(i.status),s=a?`blocked`:i.status,c=e.children.filter(e=>!Em(e)),l=e.children.filter(e=>Em(e)),u=l.reduce((e,t)=>e+Dm(t),0),d=u>=Om,f=d?c:e.children,p=()=>{i.enterable&&t(`/nodes/${encodeURIComponent(i.node_id)}`)};return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`div`,{className:Y(`node-row s-${s}`,o&&`dimmed`),onClick:p,role:i.enterable?`button`:void 0,tabIndex:i.enterable?0:void 0,style:i.enterable?void 0:{cursor:`default`},onKeyDown:e=>{i.enterable&&(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),p())},children:[(0,B.jsxs)(`div`,{className:`node-id`,children:[(0,B.jsxs)(`div`,{className:`node-l1`,children:[(0,B.jsx)(`span`,{className:`node-name`,children:i.name}),(0,B.jsxs)(`span`,{className:`node-kind`,children:[i.kind,` · `,i.mode]})]}),(0,B.jsxs)(`div`,{className:`node-l2`,children:[(0,B.jsx)(`span`,{className:`node-cwd`,title:i.cwd,children:i.cwd}),i.lifecycle&&(0,B.jsx)(`span`,{className:`node-life`,children:i.lifecycle}),!i.enterable&&(0,B.jsx)(`span`,{className:`node-note`,children:vm})]})]}),(0,B.jsxs)(`div`,{className:`node-right`,children:[a&&(0,B.jsxs)(`span`,{className:`waitflag`,children:[(0,B.jsx)(vf,{size:14,"aria-hidden":!0}),` `,i.attention_count,` waiting on human`]}),(0,B.jsx)(Fm,{status:i.status,blocked:a})]})]}),(f.length>0||d&&u>0)&&(0,B.jsxs)(`div`,{className:`kids`,children:[f.map(e=>(0,B.jsx)(Pm,{node:e},e.node.node_id)),d&&(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`button`,{type:`button`,onClick:()=>r(e=>!e),className:`flex items-center gap-1.5 px-4 py-2 text-xs transition-colors`,style:{color:`var(--dim)`},children:[(0,B.jsx)(cf,{size:14,"aria-hidden":!0,style:{transform:n?`rotate(90deg)`:`none`,transition:`transform 0.15s ease`}}),n?`Hide ${u} closed`:`Show ${u} closed`]}),n&&l.map(e=>(0,B.jsx)(Pm,{node:e},e.node.node_id))]})]})]})}function Fm({status:e,blocked:t}){let n=Am(e,t);return(0,B.jsxs)(Kp,{variant:`outline`,className:t?`blocked`:e,children:[(0,B.jsx)(n,{"aria-hidden":!0}),e]})}function Im({open:e,onClose:t}){let[n,r]=(0,v.useState)(``),[i,a]=(0,v.useState)(`developer`),[o,s]=(0,v.useState)(``),[c,l]=(0,v.useState)(!1),[u,d]=(0,v.useState)(``),[f,p]=(0,v.useState)(``),[m,h]=(0,v.useState)(``),[g,_]=(0,v.useState)(``),[y,b]=(0,v.useState)(!1),[x,S]=(0,v.useState)(null);return(0,B.jsx)(Dp,{open:e,onOpenChange:e=>!e&&t(),children:(0,B.jsxs)(Ap,{className:`max-w-md overflow-y-auto max-h-[90dvh]`,children:[(0,B.jsx)(jp,{children:(0,B.jsx)(Np,{children:`Spawn a node`})}),(0,B.jsxs)(`form`,{id:`spawn-form`,onSubmit:async e=>{if(e.preventDefault(),!n.trim()||!i.trim()){S(`prompt and kind are required`);return}b(!0),S(null);let r={prompt:n.trim(),kind:i.trim(),...o?{mode:o}:{},...c?{root:!0}:{},...u.trim()?{cwd:u.trim()}:{},...f.trim()?{name:f.trim()}:{},...m.trim()?{model:m.trim()}:{},...g.trim()?{parent:g.trim()}:{}};try{await Yf(r),t()}catch(e){console.error(`[spawn] failed:`,e),S(e instanceof Uf?`${e.code}: ${e.message}`:String(e))}finally{b(!1)}},className:`flex flex-col gap-3.5`,children:[(0,B.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,B.jsx)(Ip,{htmlFor:`spawn-prompt`,children:`Prompt`}),(0,B.jsx)(Wp,{id:`spawn-prompt`,value:n,onChange:e=>r(e.currentTarget.value),rows:4,required:!0,className:`resize-none`})]}),(0,B.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,B.jsx)(Ip,{htmlFor:`spawn-kind`,children:`Kind`}),(0,B.jsx)(Fp,{id:`spawn-kind`,value:i,onChange:e=>a(e.currentTarget.value),required:!0})]}),(0,B.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,B.jsx)(Ip,{htmlFor:`spawn-mode`,children:`Mode`}),(0,B.jsxs)(Lp,{value:o===``?`__none__`:o,onValueChange:e=>s(e===`__none__`?``:e),children:[(0,B.jsx)(zp,{id:`spawn-mode`,className:`w-full`,children:(0,B.jsx)(Rp,{})}),(0,B.jsxs)(Bp,{children:[(0,B.jsx)(Vp,{value:`__none__`,children:`(default)`}),(0,B.jsx)(Vp,{value:`base`,children:`base`}),(0,B.jsx)(Vp,{value:`orchestrator`,children:`orchestrator`})]})]})]}),(0,B.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,B.jsx)(`input`,{type:`checkbox`,id:`spawn-root`,checked:c,onChange:e=>l(e.currentTarget.checked),className:`size-4 rounded-none border border-input accent-primary`}),(0,B.jsx)(Ip,{htmlFor:`spawn-root`,className:`cursor-pointer`,children:`Resident root node`})]}),(0,B.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,B.jsx)(Ip,{htmlFor:`spawn-cwd`,children:`cwd`}),(0,B.jsx)(Fp,{id:`spawn-cwd`,value:u,onChange:e=>d(e.currentTarget.value),placeholder:`(inherit)`,className:`font-mono text-sm`})]}),(0,B.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,B.jsx)(Ip,{htmlFor:`spawn-name`,children:`Name`}),(0,B.jsx)(Fp,{id:`spawn-name`,value:f,onChange:e=>p(e.currentTarget.value),placeholder:`(auto)`})]}),(0,B.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,B.jsx)(Ip,{htmlFor:`spawn-model`,children:`Model`}),(0,B.jsx)(Fp,{id:`spawn-model`,value:m,onChange:e=>h(e.currentTarget.value),placeholder:`(default)`})]}),(0,B.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,B.jsx)(Ip,{htmlFor:`spawn-parent`,children:`Parent node id`}),(0,B.jsx)(Fp,{id:`spawn-parent`,value:g,onChange:e=>_(e.currentTarget.value),placeholder:`(this canvas root)`,className:`font-mono text-sm`})]}),x&&(0,B.jsx)(`p`,{className:`text-sm text-destructive`,children:x})]}),(0,B.jsxs)(Mp,{children:[(0,B.jsx)(Z,{type:`button`,variant:`outline`,onClick:t,disabled:y,children:`Cancel`}),(0,B.jsx)(Z,{type:`submit`,form:`spawn-form`,disabled:y,children:y?`Spawning…`:`Spawn`})]})]})})}function Lm(e){if(!e)return``;let t=e.replace(/\/+$/,``).split(`/`);return t[t.length-1]??``}function Rm(e){let t=e.name?.trim();if(t&&t!==e.kind)return t;let n=Lm(e.cwd);return n?`${e.kind} · ${n}`:e.kind}function zm(e){return e.parent===null&&e.host_kind===`broker`}function Bm(e){let t=new Map;for(let n of e){if(n.parent===null)continue;let e=t.get(n.parent);e?e.push(n):t.set(n.parent,[n])}return t}function Vm(e,t){let n=[],r=new Set,i=[e];for(;i.length>0;){let e=i.pop();if(r.has(e.node_id))continue;r.add(e.node_id),n.push(e);let a=t.get(e.node_id);if(a)for(let e of a)i.push(e)}return n}function Hm(e){return e===`done`||e===`dead`||e===`canceled`}function Um(e){return e.attention_count>0?`blocked`:e.status}function Wm(e,t,n){return t>0?`needs-you`:e.status===`active`||n>0?`active`:Hm(e.status)?`done`:`idle`}function Gm(e){switch(e){case`needs-you`:return 0;case`active`:return 1;case`idle`:return 2;case`done`:return 3}}function Km(e){let t=Bm(e),n=[];for(let r of e){if(!zm(r))continue;let e=Vm(r,t),i=0,a=0;for(let t of e)i+=Math.max(0,t.attention_count),t.node_id!==r.node_id&&t.status===`active`&&(a+=1);n.push({id:r.node_id,title:Rm(r),state:Wm(r,i,a),attention:i,activeChildren:a,nodeCount:e.length,...r.cycles===void 0?{}:{cycles:r.cycles},lastActivity:r.last_activity??r.created})}return n.sort((e,t)=>{let n=Gm(e.state)-Gm(t.state);return n===0?t.lastActivity.localeCompare(e.lastActivity):n}),n}function qm(e){switch(e.state){case`needs-you`:return e.attention>1?`${e.attention} things need your input`:`Needs your input`;case`active`:return e.activeChildren>0?`Working — ${e.activeChildren} ${e.activeChildren===1?`task`:`tasks`} in progress`:`Working…`;case`done`:return`Finished`;case`idle`:return`Idle`}}function Jm(e,t,n){if(e.key===`Enter`&&!e.shiftKey){if(e.altKey){e.preventDefault();let n=e.currentTarget,r=n.selectionStart??n.value.length,i=n.selectionEnd??r,a=`${n.value.slice(0,r)}\n${n.value.slice(i)}`,o=r+1;t(a),requestAnimationFrame(()=>{n.selectionStart=o,n.selectionEnd=o});return}e.metaKey||e.ctrlKey||(e.preventDefault(),n())}}var Ym=[`Research a topic for me`,`Help me write something`,`Review my code`,`Plan a project`];function Xm(){let{nodes:e,loading:t}=Sp(),n=up(e=>e.reachable),r=(0,v.useMemo)(()=>Km(e),[e]),[i,a]=(0,v.useState)(!1),[o]=Rn();(0,v.useEffect)(()=>{o.get(`new`)!==null&&a(!0)},[o]);let s=!t&&r.length===0;return(0,B.jsxs)(`div`,{className:`mx-auto flex h-full min-h-0 max-w-3xl flex-col px-6 py-8`,children:[(0,B.jsxs)(`div`,{className:`mb-6 flex items-center justify-between gap-3`,children:[(0,B.jsx)(`h1`,{className:`text-3xl`,style:{fontWeight:460,letterSpacing:`-0.01em`,color:`var(--ink)`},children:`Conversations`}),!s&&!i&&(0,B.jsx)(Z,{size:`lg`,onClick:()=>a(!0),children:`+ New chat`})]}),!n&&(0,B.jsx)(`div`,{className:`mb-4 rounded-lg border px-4 py-2.5 text-sm`,style:{borderColor:`rgba(255,94,54,.3)`,background:`var(--blk-dim)`,color:`var(--ink2)`},children:`Couldn't reach your agents — retrying…`}),(i||s)&&(0,B.jsx)(Zm,{firstRun:s,onCancel:s?void 0:()=>a(!1)}),(0,B.jsx)(`div`,{className:`min-h-0 flex-1 overflow-auto`,children:t?(0,B.jsx)(th,{}):(0,B.jsx)(`ul`,{className:`flex flex-col gap-2.5`,children:r.map(e=>(0,B.jsx)(Qm,{conversation:e},e.id))})})]})}function Zm({firstRun:e,onCancel:t}){let n=ut(),[r,i]=(0,v.useState)(``),[a,o]=(0,v.useState)(!1),[s,c]=(0,v.useState)(null),l=async()=>{let e=r.trim();if(!(!e||a)){o(!0),c(null);try{let t=await Yf({prompt:e,kind:`general`,mode:`base`,root:!0});n(`/c/${encodeURIComponent(t.node_id)}`)}catch(e){c(e instanceof Uf?e.message:String(e)),o(!1)}}};return(0,B.jsxs)(`div`,{className:`panel mb-6 p-5`,children:[e&&(0,B.jsx)(`p`,{className:`mb-3 text-base`,style:{fontStyle:`italic`,color:`var(--ink2)`},children:`Start a conversation with an agent.`}),(0,B.jsx)(Wp,{autoFocus:!0,value:r,onChange:e=>i(e.currentTarget.value),onKeyDown:e=>{Jm(e,i,()=>void l())},rows:3,disabled:a,placeholder:`What do you want help with?`,className:`resize-none border-0 bg-transparent px-0 text-base shadow-none focus-visible:ring-0`}),(0,B.jsx)(`div`,{className:`mt-2 flex flex-wrap gap-2`,children:Ym.map(e=>(0,B.jsx)(`button`,{type:`button`,disabled:a,onClick:()=>i(e),className:`rounded-full border border-border px-3 py-1 text-xs text-muted-foreground transition-colors hover:border-[color:var(--line2)] hover:text-foreground`,children:e},e))}),s&&(0,B.jsx)(`p`,{className:`mt-3 text-sm text-destructive`,children:s}),(0,B.jsxs)(`div`,{className:`mt-4 flex items-center justify-end gap-2`,children:[t&&(0,B.jsx)(Z,{variant:`ghost`,onClick:t,disabled:a,children:`Cancel`}),(0,B.jsx)(Z,{onClick:()=>void l(),disabled:a||!r.trim(),children:a?`Starting…`:`Start chat`})]})]})}function Qm({conversation:e}){let t=ut();return(0,B.jsx)(`li`,{className:`list-none`,children:(0,B.jsxs)(`button`,{type:`button`,onClick:()=>t(`/c/${encodeURIComponent(e.id)}`),className:`panel flex w-full items-center gap-4 px-4 py-3.5 text-left transition-colors hover:bg-[color-mix(in_oklch,var(--ink)_3%,transparent)] focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring`,children:[(0,B.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,B.jsx)(eh,{state:e.state}),(0,B.jsx)(`span`,{className:`truncate text-sm`,style:{fontWeight:500,color:`var(--ink)`},children:e.title})]}),(0,B.jsx)(`p`,{className:`mt-0.5 truncate text-sm`,style:{color:`var(--mut)`},children:qm(e)})]}),(0,B.jsxs)(`div`,{className:`font-inst flex shrink-0 items-center gap-3 text-xs`,style:{letterSpacing:`0.04em`,color:`var(--mut)`},children:[e.cycles!==void 0&&(0,B.jsxs)(`span`,{title:`cycles`,children:[`⟳ `,e.cycles]}),(0,B.jsxs)(`span`,{title:`nodes in this conversation`,children:[`◦ `,e.nodeCount,` `,e.nodeCount===1?`node`:`nodes`]}),(0,B.jsx)(`span`,{title:`time since last work`,children:nh(e.lastActivity)})]})]})})}var $m={"needs-you":`needs you`,active:`active`,idle:`idle`,done:`done`};function eh({state:e}){let t=e===`needs-you`?`blocked`:e,n=$m[e];return(0,B.jsx)(`span`,{className:Y(`dot shrink-0`,t),title:n,"aria-label":n})}function th(){return(0,B.jsx)(`ul`,{className:`flex flex-col gap-2.5`,children:[0,1,2,3].map(e=>(0,B.jsxs)(`li`,{className:`panel flex items-center gap-4 px-4 py-3.5`,children:[(0,B.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-2`,children:[(0,B.jsx)(`div`,{className:`h-4 w-1/3 animate-pulse rounded bg-muted`}),(0,B.jsx)(`div`,{className:`h-3 w-2/3 animate-pulse rounded bg-muted/70`})]}),(0,B.jsx)(`div`,{className:`h-6 w-16 animate-pulse rounded-full bg-muted`})]},e))})}function nh(e){let t=new Date(e).getTime();if(Number.isNaN(t))return``;let n=Math.max(0,Math.round((Date.now()-t)/1e3));if(n<60)return`just now`;let r=Math.round(n/60);if(r<60)return`${r}m ago`;let i=Math.round(r/60);return i<24?`${i}h ago`:`${Math.round(i/24)}d ago`}var rh={active:Tf,idle:hf,done:df,dead:pf,canceled:mf,blocked:uf};function ih({status:e}){return(0,B.jsx)(rh[e]??hf,{className:Y(`!size-3.5`,e===`active`&&`animate-spin`)})}function ah(e,t,n,r){return t===`static`?e.status:n===`down`?`dead`:n===`reconnecting`?`idle`:r?`active`:`idle`}function oh(e){let t=e.store.source===`static`,n=e.store.state?.isStreaming??!1,r=e.detail,i=r?ah(r,e.store.source,e.store.brokerStatus,n):null;return r?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`h2`,{className:Y(sh,`min-w-0 truncate`),title:r.name,children:r.name}),i&&(0,B.jsxs)(Kp,{className:Y(`gap-1.5`,i),children:[(0,B.jsx)(ih,{status:i}),i]}),t&&(0,B.jsx)(`span`,{className:`font-mono text-xs`,style:{color:`var(--idle)`},title:`dormant node — last-known values, not live`,children:`last-known`})]}):(0,B.jsx)(`h2`,{className:sh,children:`…`})}var sh=`con-title text-xl font-medium`;function ch(e){let t=e.store.chrome,n=e.store.source===`static`,r=e.store.state?.isStreaming??!1,i=t.context,a=t.stats,o=t.tokens,s=i&&!n?i.percent:null,c=!n&&a?.cost!==void 0?a.cost:null;return!i&&c===null&&!a&&!o?null:(0,B.jsxs)(`div`,{className:`cluster`,children:[i&&(0,B.jsxs)(`div`,{className:`gauge`,children:[(0,B.jsxs)(`div`,{className:`glabel`,children:[(0,B.jsx)(`span`,{className:`instlabel`,children:`Context`}),(0,B.jsxs)(`span`,{className:`gval`,children:[s===null?`—`:dh(s),s!==null&&(0,B.jsx)(`span`,{className:`u`,children:`%`})]})]}),(0,B.jsx)(`div`,{className:`gbar`,children:(0,B.jsx)(`i`,{style:{width:s===null?`0%`:`${Math.min(100,s)}%`}})}),(0,B.jsxs)(`div`,{className:`gsub`,children:[i.tokens.toLocaleString(),!n&&(0,B.jsxs)(B.Fragment,{children:[` / `,i.window.toLocaleString()]})]})]}),c!==null&&(0,B.jsxs)(`div`,{className:`gauge`,children:[(0,B.jsxs)(`div`,{className:`glabel`,children:[(0,B.jsx)(`span`,{className:`instlabel`,children:`Cost`}),(0,B.jsxs)(`span`,{className:`gval`,children:[(0,B.jsx)(`span`,{className:`u`,style:{marginLeft:0,marginRight:2},children:`$`}),c.toFixed(2)]})]}),(0,B.jsx)(`div`,{className:`gbar`,children:(0,B.jsx)(`i`,{style:{width:`${Math.min(100,c/5*100)}%`}})}),a&&(0,B.jsxs)(`div`,{className:`gsub`,children:[a.turns,` turns`]})]}),(0,B.jsxs)(`div`,{className:`dials`,children:[!n&&a&&c===null&&(0,B.jsx)(lh,{value:String(a.turns),unit:`turns`}),!n&&a&&(0,B.jsx)(lh,{value:`${a.user_messages}/${a.assistant_messages}`,unit:`msgs`}),o&&(0,B.jsx)(lh,{value:`${uh(o.input)} → ${uh(o.output)}`,unit:`tokens`}),!n&&t.tool_calls!==null&&(0,B.jsx)(lh,{value:String(t.tool_calls),unit:`tools`,hot:r})]})]})}function lh({value:e,unit:t,hot:n}){return(0,B.jsx)(`div`,{className:`dial`,children:(0,B.jsxs)(`span`,{className:`dval`,style:n?{color:`var(--act)`}:void 0,children:[e,` `,(0,B.jsx)(`em`,{children:t})]})})}function uh(e){return e>=1e6?`${Math.round(e/1e5)/10}M`:e>=1e3?`${Math.round(e/1e3)}k`:String(e)}function dh(e){return(Math.round(e*10)/10).toFixed(1)}function fh({store:e,detail:t}){let n=e.chrome,r=[],i=n.branch??t?.branch??null;if(i!==null){let e=n.git_status??t?.git_status??null,a=e?.added??0,o=e?.modified??0;r.push((0,B.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,B.jsx)(yf,{className:`size-3.5 shrink-0 opacity-70`}),(0,B.jsx)(`b`,{style:ph,children:i}),a>0&&(0,B.jsxs)(`span`,{style:{color:`var(--act)`,opacity:.8},children:[` +`,a]}),o>0&&(0,B.jsxs)(`span`,{style:{color:`var(--idle)`,opacity:.8},children:[` ~`,o]})]},`branch`))}let a=t?.cwd??null;a!==null&&r.push((0,B.jsx)(`span`,{children:mh(a)},`cwd`));let o=n.model??t?.model??null;o!==null&&r.push((0,B.jsx)(`span`,{children:(0,B.jsx)(`b`,{style:ph,children:o})},`model`));let s=n.context??null;return s!==null&&r.push((0,B.jsxs)(`span`,{children:[`ctx `,(0,B.jsx)(`b`,{style:ph,children:hh(s.tokens)}),` / `,hh(s.window)]},`ctx`)),r.length===0?null:(0,B.jsx)(`div`,{className:`flex min-w-0 items-center gap-5 whitespace-nowrap border-b px-6 py-2 text-xs`,style:{borderColor:`var(--line)`,background:`rgba(0,0,0,.18)`,color:`var(--mut)`},children:r.map((e,t)=>(0,B.jsxs)(v.Fragment,{children:[t>0&&(0,B.jsx)(`span`,{style:{color:`var(--dim)`,opacity:.5},className:`select-none`,children:`·`}),e]},t))})}var ph={color:`var(--ink2)`,fontWeight:400};function mh(e){let t=e.match(/^\/(?:Users|home)\/[^/]+(\/.*)$/);if(t)return`~${t[1]}`;let n=e.split(`/`).filter(Boolean);return n.length<=2?e:`…/${n.slice(-2).join(`/`)}`}function hh(e){return e>=1e6?`${Math.round(e/1e6)}M`:e>=1e3?`${Math.round(e/1e3)}k`:String(e)}function gh(e){let[t,n]=(0,v.useState)(!1),r=(0,v.useRef)(null);return(0,v.useEffect)(()=>{let e=e=>{if(e.key===`Escape`){n(!1);return}if(e.altKey&&e.code===`KeyI`){if(document.activeElement instanceof HTMLTextAreaElement)return;e.preventDefault(),n(e=>!e)}};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[]),t?(0,B.jsx)(`div`,{className:`in fixed inset-0 z-50 flex items-start justify-center pt-22`,style:{background:`rgba(0,0,0,.42)`,backdropFilter:`blur(2px)`},onMouseDown:e=>{r.current?.contains(e.target)||n(!1)},children:(0,B.jsxs)(`div`,{ref:r,className:`panel rv`,style:_h,children:[(0,B.jsxs)(`div`,{style:vh,children:[(0,B.jsx)(`span`,{className:`instlabel`,children:`Instruments`}),(0,B.jsx)(`div`,{style:{flex:1}}),(0,B.jsx)(`span`,{className:`kbd`,children:`⌥i`}),(0,B.jsx)(`button`,{type:`button`,onClick:()=>n(!1),className:`transition-colors`,style:{color:`var(--mut)`},"aria-label":`Close instruments`,children:(0,B.jsx)(Pf,{className:`size-3.5`})})]}),(0,B.jsx)(ch,{store:e.store,detail:e.detail})]})}):null}var _h={minWidth:`min(680px, 92vw)`,overflow:`hidden`,"--i":0},vh={display:`flex`,alignItems:`center`,gap:`10px`,padding:`11px 30px`,borderBottom:`1px solid var(--line)`};function yh(e){let t=new Map;for(let n of e){if(n.parent===null)continue;let e=t.get(n.parent);e?e.push(n):t.set(n.parent,[n])}return t}function bh(e,t){let n=[],r=new Set,i=[{node:e,depth:0}];for(;i.length>0;){let e=i.pop();if(r.has(e.node.node_id))continue;r.add(e.node.node_id),n.push({node:e.node,depth:e.depth});let a=t.get(e.node.node_id)??[];for(let t=a.length-1;t>=0;t--)i.push({node:a[t],depth:e.depth+1})}return n}function xh(e,t){let n=t.get(e),r=new Set;for(;n&&n.parent!==null;){if(r.has(n.node_id))return null;r.add(n.node_id),n=t.get(n.parent)}return n??null}function Sh(e,t){let n=new Map(e.map(e=>[e.node_id,e])),r=yh(e),i=xh(t,n),a=i?.node_id??null;return{thisGraph:i===null?[]:bh(i,r),otherGraphs:e.filter(e=>e.parent===null&&e.host_kind===`broker`&&e.node_id!==a&&(e.status===`active`||e.attention_count>0))}}var Ch=new Set([`done`,`dead`,`canceled`]),wh=`crtr:graphrail-collapsed`;function Th(e){return e.attention_count>0||e.status===`active`}function Eh(e,t){let n=new Map(e.map(e=>[e.node.node_id,e.node])),r=new Map;for(let{node:t}of e){if(t.parent===null||!n.has(t.parent))continue;let e=r.get(t.parent);e?e.push(t.node_id):r.set(t.parent,[t.node_id])}let i=new Map,a=e=>{let o=i.get(e);if(o!==void 0)return o;i.set(e,!1);let s=n.get(e),c=e===t||s!==void 0&&Th(s);if(!c){for(let t of r.get(e)??[])if(a(t)){c=!0;break}}return i.set(e,c),c},o=new Set;for(let{node:t}of e)(r.get(t.node_id)?.length??0)>0&&!a(t.node_id)&&o.add(t.node_id);return{children:r,collapsedByDefault:o}}function Dh({currentId:e,onNavigate:t}){let{nodes:n}=Sp(),[r,i]=(0,v.useState)(!1),[a,o]=(0,v.useState)(()=>{try{return localStorage.getItem(wh)===`1`}catch{return!1}}),[s,c]=(0,v.useState)({}),{thisGraph:l}=Sh(n,e),u=l[0]?.node.node_id??null,{children:d,collapsedByDefault:f}=(0,v.useMemo)(()=>Eh(l,e),[l,e]),p=e=>s[e]===void 0?f.has(e):!s[e],m=e=>c(t=>({...t,[e]:p(e)})),h=()=>{o(e=>{let t=!e;try{localStorage.setItem(wh,t?`1`:`0`)}catch{}return t})},{liveRoots:g,deadRoots:_}=(0,v.useMemo)(()=>{let e=n.filter(e=>e.parent===null&&e.host_kind===`broker`&&e.node_id!==u),t=[],r=[];for(let n of e)(Ch.has(n.status)&&n.attention_count===0?r:t).push(n);let i=(e,t)=>Date.parse(t.created)-Date.parse(e.created),a=e=>e.attention_count>0?0:e.status===`active`?1:2;return t.sort((e,t)=>a(e)-a(t)||i(e,t)),r.sort(i),{liveRoots:t,deadRoots:r}},[n,u]);if((0,v.useEffect)(()=>{let n=n=>{if(!n.altKey||n.key!==`ArrowUp`&&n.key!==`ArrowDown`)return;let r=l.findIndex(t=>t.node.node_id===e);if(r===-1)return;n.preventDefault();let i=n.key===`ArrowUp`?l[r-1]:l[r+1];i&&t(i.node.node_id)};return window.addEventListener(`keydown`,n),()=>window.removeEventListener(`keydown`,n)},[l,e,t]),a)return(0,B.jsx)(`aside`,{className:`graphrail rv`,style:kh,children:(0,B.jsx)(`button`,{type:`button`,onClick:h,title:`Expand graph sidebar`,"aria-label":`Expand graph sidebar`,className:`flex size-6 items-center justify-center rounded-md text-[var(--dim)] transition-colors hover:text-[var(--ink2)]`,children:(0,B.jsx)(cf,{className:`size-4`})})});let y=[],b=null;for(let{node:n,depth:r}of l){if(b!==null){if(r>b)continue;b=null}let i=d.get(n.node_id)??[],a=i.length>0&&p(n.node_id);y.push((0,B.jsx)(Ih,{node:n,depth:r,current:n.node_id===e,hasChildren:i.length>0,collapsed:a,onToggleCollapse:()=>m(n.node_id),onClick:()=>t(n.node_id)},n.node_id)),a&&(b=r)}return(0,B.jsxs)(`aside`,{className:`graphrail rv`,style:Oh,children:[(0,B.jsx)(`div`,{className:`flex items-center justify-end pb-1`,children:(0,B.jsx)(`button`,{type:`button`,onClick:h,title:`Collapse graph sidebar`,"aria-label":`Collapse graph sidebar`,className:`flex size-6 items-center justify-center rounded-md text-[var(--dim)] transition-colors hover:text-[var(--ink2)]`,children:(0,B.jsx)(cf,{className:`size-4 rotate-180`})})}),(0,B.jsx)(Ah,{label:`This graph`,chord:`⌥↑↓ to cycle`}),y,l.length===0&&(0,B.jsx)(jh,{}),(g.length>0||_.length>0)&&(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`div`,{className:`gr-gap`}),(0,B.jsx)(Ah,{label:`Elsewhere`}),g.map(e=>(0,B.jsx)(Ih,{node:e,depth:0,current:!1,elsewhere:!0,onClick:()=>t(e.node_id)},e.node_id)),_.length>0&&(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`button`,{type:`button`,onClick:()=>i(e=>!e),className:`mt-1 flex items-center gap-1.5 rounded-md px-3 py-2 text-left text-xs text-[var(--dim)] transition-colors hover:text-[var(--ink2)]`,children:[(0,B.jsx)(cf,{className:Y(`size-3.5 transition-transform`,r&&`rotate-90`)}),r?`Hide`:`Show`,` `,_.length,` finished`]}),r&&_.map(e=>(0,B.jsx)(Ih,{node:e,depth:0,current:!1,elsewhere:!0,onClick:()=>t(e.node_id)},e.node_id))]})]})]})}var Oh={width:`228px`,flex:`none`,display:`flex`,flexDirection:`column`,borderRight:`1px solid var(--line)`,background:`rgba(0,0,0,.16)`,padding:`14px 9px`,overflowY:`auto`,zIndex:1,"--i":2},kh={width:`36px`,flex:`none`,display:`flex`,flexDirection:`column`,alignItems:`center`,borderRight:`1px solid var(--line)`,background:`rgba(0,0,0,.16)`,padding:`14px 6px`,zIndex:1,"--i":2};function Ah({label:e,chord:t}){return(0,B.jsxs)(`div`,{className:`gr-sec`,children:[(0,B.jsx)(`span`,{className:`instlabel`,children:e}),(0,B.jsx)(`div`,{className:`rule`}),t&&(0,B.jsx)(`span`,{title:t,"aria-label":t,className:`flex items-center text-[var(--dim)]`,children:(0,B.jsx)(Sf,{className:`size-3.5`})})]})}function jh(){return(0,B.jsx)(`span`,{className:`px-3 py-1 font-mono text-xs`,style:{color:`var(--dim)`},children:`—`})}function Mh(e){let t=Date.now()-Date.parse(e);if(!Number.isFinite(t)||t<0)return``;let n=Math.floor(t/1e3);if(n<60)return`${n}s`;let r=Math.floor(n/60);if(r<60)return`${r}m`;let i=Math.floor(r/60);return i<24?`${i}h`:`${Math.floor(i/24)}d`}function Nh(e){return e.split(`/`).filter(Boolean).at(-1)??e}function Ph(e){let t=e.match(/^\/(?:Users|home)\/[^/]+(\/.*)$/);if(t)return`~${t[1]}`;let n=e.split(`/`).filter(Boolean);return n.length<=2?e:`…/${n.slice(-2).join(`/`)}`}var Fh={active:`s-active`,idle:`s-idle`,done:`s-done`,dead:`s-dead`,canceled:`s-canceled`};function Ih({node:e,depth:t,current:n,elsewhere:r=!1,hasChildren:i=!1,collapsed:a=!1,onToggleCollapse:o,onClick:s}){let c=Ch.has(e.status),l=e.attention_count>0,u=l?`blocked`:e.status,d=Mh(e.created),f=t>0?{marginLeft:`${t*12}px`}:void 0,p=(0,B.jsx)(`button`,{type:`button`,onClick:s,className:Y(`node-row text-left`,r?`w-full`:`min-w-0 flex-1`,l?`s-blocked`:Fh[e.status],c&&!l&&`dimmed`,n&&`rounded-md border border-[var(--line2)] bg-[oklch(0.92_0.013_80_/_8%)] shadow-[inset_0_1px_0_var(--raise)]`),children:(0,B.jsxs)(`span`,{className:`node-id`,children:[(0,B.jsxs)(`span`,{className:`node-l1`,children:[(0,B.jsx)(`span`,{className:Y(`node-name truncate`,n&&`font-semibold`),children:r?Nh(e.cwd):e.name}),r?(0,B.jsxs)(`span`,{className:`node-kind truncate`,children:[e.name,` · `,e.kind]}):(0,B.jsx)(`span`,{className:`node-kind`,children:e.kind}),l&&(0,B.jsxs)(Kp,{variant:`destructive`,className:`ml-auto gap-1 text-xs`,children:[(0,B.jsx)(vf,{className:`size-3.5`}),e.attention_count]})]}),(0,B.jsxs)(`span`,{className:`node-l2`,children:[r&&(0,B.jsx)(`span`,{className:`node-cwd`,children:Ph(e.cwd)}),(0,B.jsx)(`span`,{className:Y(`dot`,u),title:u,"aria-label":u}),d&&(0,B.jsx)(`span`,{className:`text-[var(--dim)]`,children:d})]})]})});return r?(0,B.jsx)(`div`,{style:f,children:p}):(0,B.jsxs)(`div`,{className:`flex items-center gap-1`,style:f,children:[i?(0,B.jsx)(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),o?.()},title:a?`Expand branch`:`Collapse branch`,"aria-label":a?`Expand branch`:`Collapse branch`,className:`flex size-4 flex-none items-center justify-center rounded-sm text-[var(--dim)] transition-colors hover:text-[var(--ink2)]`,children:(0,B.jsx)(cf,{className:Y(`size-3.5 transition-transform`,!a&&`rotate-90`)})}):(0,B.jsx)(`span`,{className:`size-4 flex-none`,"aria-hidden":`true`}),p]})}function Lh(e){let t=e.store.presence,n=e.store.role===`controller`;return(0,B.jsxs)(v.Fragment,{children:[(0,B.jsxs)(`div`,{className:`ctl-state flex shrink-0 items-center gap-1.5 text-xs`,style:{color:`var(--mut)`},children:[`control:`,` `,(0,B.jsx)(`span`,{style:{color:`var(--ink2)`,fontStyle:`italic`},children:n?`you`:t.controller?`another client`:`no one`})]}),n?(0,B.jsx)(`button`,{type:`button`,className:`btn sm shrink-0`,onClick:()=>e.store.releaseControl(),children:`Release control`}):(0,B.jsx)(`button`,{type:`button`,className:`btn primary sm shrink-0`,disabled:!e.store.socketReady,title:e.store.socketReady?void 0:`connecting…`,onClick:()=>e.store.requestControl(),children:`Request control`})]})}function Rh(e){return typeof e==`object`&&!!e}function zh(e){return typeof e==`string`?e:``}function Bh(e){let t=e??``;return/rate.?limit|\b429\b|too many requests|quota/i.test(t)?`rate-limit`:/overloaded|\b529\b|\b503\b|capacity|server.{0,3}busy|temporarily unavailable/i.test(t)?`overloaded`:/invalid_grant|refresh token|unauthori[sz]ed|invalid.?api.?key|authentication failed|\b401\b|\b403\b/i.test(t)?`auth`:/connection|econnreset|etimedout|enotfound|econnrefused|network|fetch failed|socket hang|timed? out|timeout/i.test(t)?`connection`:`other`}function Vh(e){let t=zh(e.code)||zh(e.errno);return t===``?null:/^(ECONNREFUSED|ECONNRESET|ETIMEDOUT|ENOENT|ENOTFOUND|EAI_AGAIN|EPIPE|EHOSTUNREACH|ENETUNREACH)$/i.test(t)?`connection`:null}function Hh(e){let t=typeof e.status==`number`?e.status:null;return t===null?null:t===401||t===403?`auth`:t===429?`rate-limit`:t===503||t===529||t>=500&&t<=599?`overloaded`:t>=400&&t<=499?`protocol`:null}function Uh(e){let t=typeof e.code==`number`?e.code:null;if(t===null)return null;if(t===1008)return`protocol`;if(t===1006)return`connection`;if(t===1011){let t=zh(e.reason);return/no running broker/i.test(t)||Bh(t)===`connection`?`connection`:`other`}return null}function Wh(e,t){return t===`auth`||t===`protocol`?`fatal`:e===`pi→provider`?t===`connection`||t===`rate-limit`||t===`overloaded`?`auto`:`fatal`:`manual`}function Gh(e){if(typeof e==`string`)return e;if(!Rh(e))return``;let t=[e.message,e.errorMessage,e.reason,e.body,e.statusText];for(let e of t)if(typeof e==`string`&&e!==``)return e;let n=e.error;if(Rh(n)){let e=n.message;if(typeof e==`string`&&e!==``)return e;let t=n.reason;if(typeof t==`string`&&t!==``)return t}return``}function Kh(e,t){if(Rh(t)){let n=Vh(t);if(n!==null)return{kind:n,disposition:Wh(e,n)};let r=Hh(t);if(r!==null)return{kind:r,disposition:Wh(e,r)};let i=Uh(t);if(i!==null)return{kind:i,disposition:Wh(e,i)}}let n=Bh(Gh(t));return{kind:n,disposition:Wh(e,n)}}var qh=class{nodeId;handlers;ws;closedReported=!1;constructor(e,t){this.nodeId=e,this.handlers=t}get url(){let e=location.protocol===`https:`?`wss:`:`ws:`,t=new URL(`/node/${encodeURIComponent(this.nodeId)}`,window.location.href);return t.protocol=e,Bf!==void 0&&t.searchParams.set(`token`,Bf),t.toString()}connect(){let e;try{e=new WebSocket(this.url)}catch(e){this.reportClose(`transient`,`failed to open ws: ${String(e)}`);return}this.ws=e,e.onopen=()=>this.handlers.onOpen?.(),e.onmessage=e=>this.onMessage(e),e.onclose=e=>{let t=Kh(`browser↔relay`,{code:e.code,reason:e.reason}),n=e.code===1008||t.kind===`protocol`?`invalid`:e.code===1011&&/^no node /.test(e.reason)?`no-node`:e.code===1011&&/^no running broker/.test(e.reason)?`no-broker`:`transient`;this.reportClose(n,e.reason||`closed (${e.code})`)},e.onerror=()=>{}}onMessage(e){if(typeof e.data!=`string`)return;let t;try{t=JSON.parse(e.data)}catch{return}this.handlers.onFrame?.(t)}send(e){let t=this.ws;if(!(t===void 0||t.readyState!==WebSocket.OPEN))try{t.send(JSON.stringify(e))}catch{}}close(){let e=this.ws;if(e!==void 0&&e.readyState<=WebSocket.OPEN)try{e.close()}catch{}}reportClose(e,t){this.closedReported||(this.closedReported=!0,this.ws=void 0,this.handlers.onClose?.(e,t))}},Jh=/^From (?:[a-z0-9]+-[a-f0-9]+|system|human) — \d+ update/;function Yh(e){return Jh.test(e)}function Xh(e){let t=/^From ([a-z0-9]+-[a-f0-9]+|system|human) — /.exec(e);if(!t)return null;let n=t[1];return typeof n==`string`?n:null}function Zh(){return{messages:[],streamingIndex:null,executingToolIds:new Set,partialToolResults:new Map,isStreaming:!1,activity:null,queued:[]}}function Qh(e){let t=e.content;return typeof t==`string`?t:Array.isArray(t)?t.filter(e=>!!e&&e.type===`text`).map(e=>typeof e.text==`string`?e.text:``).join(``):``}function $h(e){return ng(e)!==`user`||e.origin||!Yh(Qh(e))?e:{...e,origin:`inbox`}}function eg(){return{role:`assistant`,content:[]}}function tg(e,t){let n=e.messages.map($h);if(e.state?.isStreaming!==!0)return{messages:n,streamingIndex:null,executingToolIds:new Set,partialToolResults:new Map,isStreaming:!1,activity:null,queued:[]};let r=n.length-1;if(r>=0&&ng(n[r])===`assistant`)return{messages:n,streamingIndex:r,executingToolIds:new Set,partialToolResults:new Map,isStreaming:!0,activity:`Working…`,queued:[]};let i=t&&t.streamingIndex!==null?t.messages[t.streamingIndex]:void 0,a=i&&ng(i)===`assistant`?i:eg(),o=[...n,a];return{messages:o,streamingIndex:o.length-1,executingToolIds:new Set,partialToolResults:new Map,isStreaming:!0,activity:`Working…`,queued:[]}}function ng(e){return e.role??``}function rg(e){for(let t=e.messages.length-1;t>=0;t--)if(ng(e.messages[t])===`bashExecution`)return t;return null}function ig(e,t,n){let r={role:`bashExecution`,command:t,output:``,exitCode:void 0,cancelled:!1,truncated:!1,excludeFromContext:n,timestamp:Date.now()};return{...e,messages:[...e.messages,r]}}function ag(e,t){let n=rg(e);if(n===null)return e;let r=[...e.messages],i=r[n];return r[n]={...i,output:`${i.output??``}${t}`},{...e,messages:r}}function og(e,t){let n=rg(e);if(n===null)return e;let r=[...e.messages];return r[n]={...r[n],exitCode:t.exitCode,cancelled:t.cancelled,truncated:t.truncated,fullOutputPath:t.fullOutputPath},{...e,messages:r}}function sg(e,t){switch(t.type){case`agent_start`:return{...e,isStreaming:!0,activity:`Working…`};case`agent_end`:return{...e,isStreaming:!1,activity:null,streamingIndex:null,executingToolIds:e.executingToolIds.size?new Set:e.executingToolIds};case`message_start`:{let n=$h(t.message),r=[...e.messages,n],i=ng(n)===`assistant`,a=e.partialToolResults;if(ng(n)===`toolResult`){let e=n.toolCallId;if(typeof e==`string`&&a.has(e)){let t=new Map(a);t.delete(e),a=t}}return{...e,messages:r,partialToolResults:a,streamingIndex:i?r.length-1:e.streamingIndex}}case`message_update`:{let n=e.streamingIndex;if(n===null){let t=e.messages.length-1;t>=0&&ng(e.messages[t])===`assistant`&&(n=t)}if(n===null)return e;let r=[...e.messages];return r[n]=t.message,{...e,messages:r,streamingIndex:n}}case`message_end`:{if(e.streamingIndex===null)return e;let n=[...e.messages];return n[e.streamingIndex]=t.message,{...e,messages:n,streamingIndex:null}}case`tool_execution_start`:{let n=new Set(e.executingToolIds);return n.add(t.toolCallId),{...e,executingToolIds:n}}case`tool_execution_update`:{let n=new Map(e.partialToolResults);return n.set(t.toolCallId,cg(t.toolCallId,t.toolName,t.partialResult,!1)),{...e,partialToolResults:n}}case`tool_execution_end`:{let n=new Set(e.executingToolIds);n.delete(t.toolCallId);let r=new Map(e.partialToolResults);return r.set(t.toolCallId,cg(t.toolCallId,t.toolName,t.result,t.isError)),{...e,executingToolIds:n,partialToolResults:r}}case`compaction_start`:return{...e,activity:`Compacting context…`};case`compaction_end`:return{...e,activity:e.isStreaming?`Working…`:null};case`auto_retry_start`:return{...e,activity:`Retrying (${t.attempt}/${t.maxAttempts}) in ${Math.ceil(t.delayMs/1e3)}s…`};case`auto_retry_end`:return{...e,activity:e.isStreaming?`Working…`:null};case`queue_update`:return{...e,queued:[...t.steering,...t.followUp]};default:return e}}function cg(e,t,n,r){let i=typeof n==`object`&&n?n:{};return{role:`toolResult`,toolCallId:e,toolName:t,...i,content:Array.isArray(i.content)?i.content:[],isError:r}}var lg=1,ug=new Set([`stop`,`length`,`toolUse`,`error`,`aborted`]),dg=new Set([`off`,`minimal`,`low`,`medium`,`high`,`xhigh`]),fg=200,pg=256*1024,mg=20,hg=8*1024*1024;function gg(e){return{schemaVersion:lg,...e}}function _g(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Q(e){return typeof e==`string`}function vg(e){return typeof e==`number`}function yg(e){return typeof e==`boolean`}function bg(e){return!_g(e)||e.type!==`text`||!Q(e.text)?!1:e.textSignature===void 0||Q(e.textSignature)}function xg(e){return _g(e)&&e.type===`image`&&Q(e.data)&&Q(e.mimeType)}function Sg(e){return _g(e)&&e.type===`toolCall`&&Q(e.id)&&Q(e.name)&&_g(e.arguments)&&(e.thoughtSignature===void 0||Q(e.thoughtSignature))}function Cg(e){return _g(e)&&vg(e.input)&&vg(e.output)&&vg(e.cacheRead)&&vg(e.cacheWrite)&&vg(e.total)}function wg(e){return _g(e)&&vg(e.input)&&vg(e.output)&&vg(e.cacheRead)&&vg(e.cacheWrite)&&(e.cacheWrite1h===void 0||vg(e.cacheWrite1h))&&(e.reasoning===void 0||vg(e.reasoning))&&vg(e.totalTokens)&&Cg(e.cost)}function Tg(e){return typeof e==`string`&&ug.has(e)}function Eg(e){return typeof e==`string`&&dg.has(e)}function Dg(e){return!_g(e)||!Q(e.message)?!1:(e.name===void 0||Q(e.name))&&(e.stack===void 0||Q(e.stack))&&(e.code===void 0||Q(e.code)||vg(e.code))}function Og(e){return!_g(e)||!Q(e.type)||!vg(e.timestamp)?!1:(e.error===void 0||Dg(e.error))&&(e.details===void 0||_g(e.details))}function kg(e){return!_g(e)||e.role!==`user`||!vg(e.timestamp)?!1:typeof e.content==`string`||Array.isArray(e.content)&&e.content.every(e=>bg(e)||xg(e))}function Ag(e){return!_g(e)||e.role!==`assistant`||!vg(e.timestamp)||!Array.isArray(e.content)||!e.content.every(e=>bg(e)||_g(e)&&e.type===`thinking`&&Q(e.thinking)&&(e.thinkingSignature===void 0||Q(e.thinkingSignature))&&(e.redacted===void 0||yg(e.redacted))||Sg(e))?!1:Q(e.api)&&Q(e.provider)&&Q(e.model)&&(e.responseModel===void 0||Q(e.responseModel))&&(e.responseId===void 0||Q(e.responseId))&&(e.diagnostics===void 0||Array.isArray(e.diagnostics)&&e.diagnostics.every(Og))&&wg(e.usage)&&Tg(e.stopReason)&&(e.errorMessage===void 0||Q(e.errorMessage))}function jg(e){return!_g(e)||e.role!==`toolResult`||!vg(e.timestamp)?!1:Q(e.toolCallId)&&Q(e.toolName)&&Array.isArray(e.content)&&e.content.every(e=>bg(e)||xg(e))&&yg(e.isError)}function Mg(e){return _g(e)&&e.role===`bashExecution`&&Q(e.command)&&Q(e.output)&&vg(e.timestamp)&&(e.exitCode===void 0||vg(e.exitCode))&&yg(e.cancelled)&&yg(e.truncated)&&(e.fullOutputPath===void 0||Q(e.fullOutputPath))&&(e.excludeFromContext===void 0||yg(e.excludeFromContext))}function Ng(e){return kg(e)||Ag(e)||jg(e)||Mg(e)}function Pg(e){return!_g(e)||!Q(e.role)?!1:e.role!==`user`&&e.role!==`assistant`&&e.role!==`toolResult`&&e.role!==`bashExecution`}function Fg(e){return Ng(e)||Pg(e)}function Ig(e){return!_g(e)||!Q(e.name)||!Q(e.description)||e.source!==`builtin`&&e.source!==`command`&&e.source!==`template`?!1:(e.location===void 0||e.location===`user`||e.location===`project`||e.location===`path`)&&(e.path===void 0||Q(e.path))&&(e.argument_hint===void 0||Q(e.argument_hint))}function Lg(e){return e===null?!0:_g(e)?Q(e.sessionId)&&(e.sessionFile===null||Q(e.sessionFile))&&(e.model===null||Q(e.model))&&yg(e.isStreaming)&&Eg(e.thinkingLevel)&&(e.steeringMode===`all`||e.steeringMode===`one-at-a-time`)&&(e.followUpMode===`all`||e.followUpMode===`one-at-a-time`)&&(e.sessionName===null||Q(e.sessionName))&&yg(e.autoCompactionEnabled)&&vg(e.pendingMessageCount):!1}function Rg(e,t){return _g(t)?t.schemaVersion===lg&&t.nodeId===e&&Array.isArray(t.messages)&&t.messages.every(Fg)&&Lg(t.sessionState)&&Array.isArray(t.commands)&&t.commands.every(Ig)&&yg(t.isStreaming)&&(t.activity===null||Q(t.activity))&&vg(t.updatedAt)&&(t.source===`broker`||t.source===`static`):!1}function zg(e){return new TextEncoder().encode(JSON.stringify(e)).length}function Bg(e,t,n){let r=e.messages.slice(-t),i={...e,messages:r};for(;r.length>1&&zg(i)>n;)r=r.slice(1),i={...e,messages:r};return i}function Vg(e){return`crtr.web.transcript.tail.${e}`}function Hg(e){try{let t=globalThis.localStorage?.getItem(Vg(e));if(t==null)return null;let n=JSON.parse(t);return Rg(e,n)?n:null}catch{return null}}function Ug(e){let t=Bg(e,mg,pg);try{globalThis.localStorage?.setItem(Vg(e.nodeId),JSON.stringify(t))}catch{}}var Wg=`crtr-web-transcript-cache`,Gg=1,Kg=`entries`;function qg(){return new Promise((e,t)=>{if(typeof indexedDB>`u`){t(Error(`indexedDB unavailable`));return}let n=indexedDB.open(Wg,Gg);n.onupgradeneeded=()=>{let e=n.result;e.objectStoreNames.contains(Kg)||e.createObjectStore(Kg,{keyPath:`nodeId`}).createIndex(`updatedAt`,`updatedAt`)},n.onsuccess=()=>e(n.result),n.onerror=()=>t(n.error??Error(`indexedDB open failed`))})}async function Jg(e){try{let t=await qg(),n=await new Promise((n,r)=>{let i=t.transaction(Kg,`readonly`).objectStore(Kg).get(e);i.onsuccess=()=>n(i.result),i.onerror=()=>r(i.error??Error(`indexedDB read failed`))});return t.close(),Rg(e,n)?n:null}catch{return null}}async function Yg(e){let t=[];await new Promise((n,r)=>{let i=e.transaction(Kg,`readonly`).objectStore(Kg).index(`updatedAt`).openCursor();i.onsuccess=()=>{let e=i.result;if(!e){n();return}let r=e.value;t.push({nodeId:r.nodeId,updatedAt:r.updatedAt,size:zg(r)}),e.continue()},i.onerror=()=>r(i.error??Error(`indexedDB cursor failed`))});let n=t.reduce((e,t)=>e+t.size,0);n<=hg||await new Promise((r,i)=>{let a=e.transaction(Kg,`readwrite`),o=a.objectStore(Kg),s=0;for(;n>hg&&s<t.length;){let e=t[s];o.delete(e.nodeId),n-=e.size,s+=1}a.oncomplete=()=>r(),a.onerror=()=>i(a.error??Error(`indexedDB prune failed`))})}async function Xg(e){let t=Bg(e,fg,pg);try{let e=await qg();await new Promise((n,r)=>{let i=e.transaction(Kg,`readwrite`);i.objectStore(Kg).put(t),i.oncomplete=()=>n(),i.onerror=()=>r(i.error??Error(`indexedDB write failed`))}),await Yg(e),e.close()}catch{}}function Zg(e){return{clientId:e,conn:`connecting`,conv:Zh(),role:`observer`,controllerId:null,session:null,model:void 0,sessionName:void 0,contextTokens:void 0,dialog:null,commands:[],statuses:{},widgets:{},title:void 0,notice:null}}var Qg={"no-broker":`no-broker`,"no-node":`no-node`,invalid:`invalid`,transient:`closed`};function $g(e){return e===`welcome`||e===`control_changed`||e===`model_changed`||e===`error`||e===`ack`||e===`data`||e===`display_status`||e===`display_widget`||e===`display_title`||e===`bash_start`||e===`bash_output`||e===`bash_end`||e===`extension_ui_request`}function e_(e,t){switch(t.kind){case`connecting`:return e.conn===`connecting`?e:{...e,conn:`connecting`};case`closed`:{let n=Qg[t.closeKind];return e.conn===n?e:{...e,conn:n}}case`notice`:return e.notice===t.text?e:{...e,notice:t.text};case`dismiss-dialog`:return e.dialog===null?e:{...e,dialog:null};case`frame`:return s_(e,t.frame)}}function t_(e,t){return e.name===t.name&&e.description===t.description&&e.source===t.source&&e.location===t.location&&e.path===t.path&&e.argument_hint===t.argument_hint}function n_(e,t){return e.length===t.length&&e.every((e,n)=>t_(e,t[n]))}function r_(e,t){return e===t?!0:e===void 0||t===void 0?!1:e.placement===t.placement&&e.lines.length===t.lines.length&&e.lines.every((e,n)=>e===t.lines[n])}function i_(e){if(e===void 0||e.trim()===``)return[];try{let t=JSON.parse(e);return Array.isArray(t)?t.filter(e=>{if(typeof e!=`object`||!e)return!1;let t=e;return typeof t.name==`string`&&typeof t.description==`string`&&(t.source===`builtin`||t.source===`command`||t.source===`template`)}):[]}catch{return[]}}function a_(e){return{sessionId:e.sessionId,sessionFile:e.sessionFile??null,model:e.model??null,isStreaming:e.isStreaming,thinkingLevel:e.thinkingLevel,steeringMode:e.steeringMode,followUpMode:e.followUpMode,sessionName:e.sessionName??null,autoCompactionEnabled:e.autoCompactionEnabled,pendingMessageCount:e.pendingMessageCount}}function o_(e){let t=e.messages.length-1,n=e.isStreaming&&t>=0?t:null;return{messages:e.messages,streamingIndex:n,executingToolIds:new Set,partialToolResults:new Map,isStreaming:e.isStreaming,activity:e.activity,queued:[]}}function s_(e,t){if(!$g(t.type))return{...e,conv:sg(e.conv,t)};switch(t.type){case`welcome`:{let n=tg(t.snapshot,e.conv),r=t.controller_id,i=a_(t.snapshot.state);return{...e,conn:`open`,conv:n,controllerId:r,role:r===e.clientId?`controller`:`observer`,session:i,model:i.model??void 0,sessionName:i.sessionName??void 0,contextTokens:t.snapshot.stats?.tokens?.total,dialog:t.pending_dialog??null,commands:[]}}case`control_changed`:return e.controllerId===t.controller_id?e:{...e,controllerId:t.controller_id,role:t.controller_id===e.clientId?`controller`:`observer`};case`model_changed`:{let n=t.model??null;return e.model===t.model&&(e.session===null||e.session.model===n)?e:{...e,model:t.model,session:e.session?{...e.session,model:n}:e.session}}case`error`:{let n=t.code===`not_controller`?`read-only — another viewer is the controller`:t.message||`error: ${t.code}`;return e.notice===n?e:{...e,notice:n}}case`extension_ui_request`:return{...e,dialog:t};case`display_status`:{let n=e.statuses[t.key];if(t.text===void 0?n===void 0:n===t.text)return e;let r={...e.statuses};return t.text===void 0?delete r[t.key]:r[t.key]=t.text,{...e,statuses:r}}case`display_widget`:{let n=e.widgets[t.key],r=t.lines===void 0?void 0:{lines:t.lines,placement:t.placement};if(r_(n,r))return e;let i={...e.widgets};return r===void 0?delete i[t.key]:i[t.key]=r,{...e,widgets:i}}case`display_title`:return e.title===t.title?e:{...e,title:t.title};case`ack`:{if(t.for!==`get_commands`)return e;let n=t.ok?i_(t.detail):[];return n_(e.commands,n)?e:{...e,commands:n}}case`bash_start`:return{...e,conv:ig(e.conv,t.command,t.excludeFromContext)};case`bash_output`:return{...e,conv:ag(e.conv,t.chunk)};case`bash_end`:return{...e,conv:og(e.conv,t)};default:return e}}var c_=1500,l_=800,u_=5e3,d_=10;function f_(e){return Math.min(u_,l_*2**e)}var p_=class e{nodeId;static CACHE_WRITE_DEBOUNCE_MS=500;clientId;actions;pinned=!1;state;listeners=new Set;client=null;gen=0;timer=null;cacheWriteTimer=null;role=`observer`;streaming=!1;cachedUpdatedAt=0;liveAttached=!1;started=!1;noBrokerAttempts=0;constructor(e){this.nodeId=e,this.clientId=crypto.randomUUID(),this.state=Zg(this.clientId);let t=Hg(e);t&&(this.state={...this.state,conv:o_(t),session:t.sessionState,commands:t.commands,model:t.sessionState?.model??void 0,sessionName:t.sessionState?.sessionName??void 0},this.cachedUpdatedAt=t.updatedAt),this.actions=this.buildActions()}subscribe=e=>(this.ensureStarted(),this.listeners.add(e),()=>{this.listeners.delete(e)});getState=()=>this.state;ensureStarted(){this.started||(this.started=!0,this.hydrateFromFullMirror(),this.dial())}hydrateFromFullMirror(){let e=this.gen;Jg(this.nodeId).then(t=>{if(e===this.gen&&!this.liveAttached&&!(t===null||t.updatedAt<=this.cachedUpdatedAt)){this.state={...this.state,conv:o_(t),session:t.sessionState,commands:t.commands,model:t.sessionState?.model??void 0,sessionName:t.sessionState?.sessionName??void 0},this.cachedUpdatedAt=t.updatedAt;for(let e of this.listeners)e()}})}focus(){this.ensureStarted(),this.pinned=!0,this.state.conn===`open`&&this.send({type:`request_control`})}background(){this.pinned=!1,this.send({type:`release_control`})}dispose(){this.gen+=1,this.timer&&clearTimeout(this.timer),this.cacheWriteTimer&&(clearTimeout(this.cacheWriteTimer),this.cacheWriteTimer=null,this.flushCacheWrite()),this.client?.close(),this.client=null}dispatch(e){let t=this.state,n=e_(t,e);if(n!==t){this.state=n,this.role=n.role,this.streaming=n.conv.isStreaming,e.kind===`frame`&&e.frame.type===`welcome`&&(this.liveAttached=!0),n.conv!==t.conv&&this.scheduleCacheWrite();for(let e of this.listeners)e()}}scheduleCacheWrite(){this.cacheWriteTimer&&clearTimeout(this.cacheWriteTimer),this.cacheWriteTimer=setTimeout(()=>{this.cacheWriteTimer=null,this.flushCacheWrite()},e.CACHE_WRITE_DEBOUNCE_MS)}flushCacheWrite(){let e=gg({nodeId:this.nodeId,messages:this.state.conv.messages,sessionState:this.state.session,commands:this.state.commands,isStreaming:this.state.conv.isStreaming,activity:this.state.conv.activity,updatedAt:Date.now(),source:`broker`});Ug(e),Xg(e),this.cachedUpdatedAt=e.updatedAt}send(e){this.client?.send(e)}dial(){let e=this.gen,t=new qh(this.nodeId,{onOpen:()=>{e===this.gen&&t.send({type:`hello`,role:`observer`,client_id:this.clientId})},onFrame:n=>{e===this.gen&&(this.dispatch({kind:`frame`,frame:n}),n.type===`welcome`&&(t.send({type:`get_commands`}),this.pinned&&t.send({type:`request_control`}),this.noBrokerAttempts=0))},onClose:t=>{if(e===this.gen){if(this.dispatch({kind:`closed`,closeKind:t}),t===`transient`)this.timer=setTimeout(()=>{e===this.gen&&(this.dispatch({kind:`connecting`}),this.dial())},c_);else if(t===`no-broker`&&this.noBrokerAttempts<d_){let t=this.noBrokerAttempts;this.noBrokerAttempts+=1,this.timer=setTimeout(()=>{e===this.gen&&this.dial()},f_(t))}}}});this.client=t,t.connect()}buildActions(){return{sendText:e=>{let t=e.trim();if(t!==``){if(this.role!==`controller`){this.dispatch({kind:`notice`,text:`take control before sending`});return}if(t.startsWith(`!`)){let e=t.startsWith(`!!`),n=t.slice(e?2:1).trim();if(n===``)return;this.send({type:`bash`,command:n,excludeFromContext:e});return}this.send(this.streaming?{type:`steer`,text:t}:{type:`prompt`,text:t})}},abort:()=>{this.role===`controller`&&this.send({type:`abort`})},takeControl:()=>this.send({type:`request_control`}),releaseControl:()=>this.send({type:`release_control`}),setModel:e=>this.send({type:`set_model`,model:e}),cycleModel:()=>this.send({type:`cycle_model`}),setThinkingLevel:e=>this.send({type:`set_thinking_level`,level:e}),compact:e=>this.send({type:`compact`,...e?{instructions:e}:{}}),answerDialog:e=>{this.send(e),this.dispatch({kind:`dismiss-dialog`})},cancelDialog:()=>{let e=this.state.dialog?.id;e!==void 0&&this.send({type:`extension_ui_response`,id:e,cancelled:!0}),this.dispatch({kind:`dismiss-dialog`})},reconnect:()=>{this.timer&&clearTimeout(this.timer),this.gen+=1,this.noBrokerAttempts=0,this.client?.close(),this.dispatch({kind:`connecting`}),this.dial()},clearNotice:()=>this.dispatch({kind:`notice`,text:null})}}},m_=4,h_=new class{handles=new Map;mru=[];poolListeners=new Set;warmIdsSnapshot=[];acquire(e){let t=this.handles.get(e);return t||(t=new p_(e),this.handles.set(e,t)),this.touch(e),this.notifyPool(),this.evictExcess(),t}focus(e){this.handles.get(e)?.focus()}background(e){this.handles.get(e)?.background()}subscribe=e=>(this.poolListeners.add(e),()=>{this.poolListeners.delete(e)});getWarmIds=()=>this.warmIdsSnapshot;evict(e){let t=this.handles.get(e);if(!t)return;t.pinned=!1,t.dispose(),this.handles.delete(e);let n=this.mru.indexOf(e);n!==-1&&this.mru.splice(n,1),this.notifyPool()}touch(e){let t=this.mru.indexOf(e);t!==-1&&this.mru.splice(t,1),this.mru.push(e)}evictExcess(){for(let e=0;e<this.mru.length&&this.mru.length>m_;){let t=this.mru[e],n=this.handles.get(t);if(n?.pinned){e+=1;continue}n?.dispose(),this.handles.delete(t),this.mru.splice(e,1),this.notifyPool()}}notifyPool(){this.warmIdsSnapshot=[...this.mru];for(let e of this.poolListeners)e()}};function g_(e){let t=h_.acquire(e);return{state:(0,v.useSyncExternalStore)(t.subscribe,t.getState),actions:t.actions}}var __={branch:null,model:null,tokens:null,context:null,tool_calls:null,stats:null,git_status:null};function v_(e,t){return{sessionId:t.state?.sessionId??e,sessionFile:t.state?.sessionFile??null,model:t.state?.model??null,isStreaming:!1,thinkingLevel:t.state?.thinkingLevel??`off`,steeringMode:t.state?.steeringMode??`all`,followUpMode:t.state?.followUpMode??`all`,sessionName:t.state?.sessionName??null,autoCompactionEnabled:t.state?.autoCompactionEnabled??!1,pendingMessageCount:t.state?.pendingMessageCount??0}}function y_(e){let{state:t,actions:n}=g_(e),r=up(e=>e.reachable),[i,a]=(0,v.useState)(null);(0,v.useEffect)(()=>{let n=!1;if(t.conn!==`no-broker`){a(null);return}return Jf(e).then(t=>{if(n)return;a(t);let r=gg({nodeId:e,messages:tg(t.snapshot).messages,sessionState:v_(e,t.snapshot),commands:t.commands,isStreaming:!1,activity:null,updatedAt:Date.now(),source:`static`});Ug(r),Xg(r)}).catch(()=>{n||a(null)}),()=>{n=!0}},[e,t.conn]);let o=t.conn===`no-broker`&&i?.node_id===e?i:null,s=(0,v.useMemo)(()=>o===null?null:tg(o.snapshot),[o]),c=(0,v.useMemo)(()=>t.session===null?null:{...t.session,isStreaming:t.conv.isStreaming},[t.session,t.conv.isStreaming]),l=(0,v.useMemo)(()=>t.conn===`connecting`||t.conn===`closed`?null:o===null?c:v_(e,o.snapshot),[e,o,t.conn,c]),u=(0,v.useMemo)(()=>o===null?{...__,model:t.model??null}:{...__,model:o.snapshot.state?.model??null},[o,t.model]),d=s?.messages??t.conv.messages,f=s?.partialToolResults??t.conv.partialToolResults,p=s?.executingToolIds??t.conv.executingToolIds,m=s?.queued??t.conv.queued,h=o?.commands??t.commands;return{messages:d,partialToolResults:f,executingToolIds:p,queued:m,state:l,role:t.role,chrome:u,dialog:t.dialog,commands:h,presence:{viewers:0,controller:t.controllerId},brokerStatus:t.conn===`open`?`connected`:t.conn===`closed`||t.conn===`connecting`?`reconnecting`:`down`,source:t.conn===`no-broker`?`static`:`broker`,serverConnected:r,socketReady:t.conn===`open`,error:t.notice?{code:`broker_unavailable`,message:t.notice}:null,reconnect:n.reconnect,prompt:e=>n.sendText(e),steer:e=>n.sendText(e),abort:n.abort,setModel:n.setModel,cycleModel:n.cycleModel,setThinkingLevel:n.setThinkingLevel,compact:n.compact,requestControl:n.takeControl,releaseControl:n.releaseControl,dialogResponse:(e,t)=>n.answerDialog({type:`extension_ui_response`,id:e,...t})}}var b_=400,x_=4e3;function S_(e){return e.dormant&&e.status===`active`&&e.socketReady&&e.attempt<8}function C_(e){return Math.min(x_,b_*2**Math.max(0,e))}var w_=1,T_=400;function E_(e){return`crtr.web.draft.${e}`}function D_(e,t){if(typeof t!=`object`||!t)return!1;let n=t;return n.schemaVersion===w_&&n.nodeId===e&&typeof n.text==`string`&&typeof n.updatedAt==`number`}function O_(e){try{let t=globalThis.localStorage?.getItem(E_(e));if(t==null)return``;let n=JSON.parse(t);return D_(e,n)?n.text:``}catch{return``}}function k_(e,t){let n={schemaVersion:w_,nodeId:e,text:t,updatedAt:Date.now()};try{globalThis.localStorage?.setItem(E_(e),JSON.stringify(n))}catch{}}function A_(e){try{globalThis.localStorage?.removeItem(E_(e))}catch{}}var j_=new Map;function M_(e,t){let n=j_.get(e);n&&clearTimeout(n);let r=setTimeout(()=>{j_.delete(e),t===``?A_(e):k_(e,t)},T_);j_.set(e,r)}function N_(e){let t=j_.get(e);t&&(clearTimeout(t),j_.delete(e))}function P_(e){let t=y_(e),[n,r]=(0,v.useState)(null);(0,v.useEffect)(()=>(h_.focus(e),()=>{h_.background(e)}),[e]);let[i,a]=(0,v.useState)(``);(0,v.useEffect)(()=>{a(O_(e))},[e]),(0,v.useEffect)(()=>{M_(e,i)},[e,i]);let[o,s]=(0,v.useState)(!1),[c,l]=(0,v.useState)(null),[u,d]=(0,v.useState)(null),f=t.source===`static`,p=t.brokerStatus===`connected`,m=t.role===`controller`,h=t.state?.isStreaming??!1,g=m&&!f&&p&&t.serverConnected,_=t.commands;(0,v.useEffect)(()=>{let t=!1;return qf(e).then(e=>{t||r(e)}).catch(e=>{t||l(F_(e))}),()=>{t=!0}},[e]);let y=(0,v.useRef)(0);(0,v.useEffect)(()=>{y.current=0},[e]),(0,v.useEffect)(()=>{if(!S_({dormant:f,status:n?.status,socketReady:t.socketReady,attempt:y.current}))return;let e=y.current;y.current+=1;let r=setTimeout(()=>t.reconnect(),C_(e));return()=>clearTimeout(r)},[f,n?.status,t.socketReady,t.reconnect]);let b=()=>{let n=i.trim();!n||!g||(h?t.steer(n):t.prompt(n),N_(e),A_(e),a(``))};return{store:t,detail:n,input:i,setInput:a,reviving:o,actionError:c,peekedPath:u,setPeekedPath:d,dormant:f,brokerUp:p,isController:m,streaming:h,canDrive:g,commands:_,sendPrimary:b,onInputKeyDown:e=>{Jm(e,a,b)},selectCommand:e=>{a(`/${e.name} `)},doRevive:async()=>{s(!0),l(null);try{await Zf(e),t.reconnect()}catch(e){l(F_(e))}finally{s(!1)}},doClose:async()=>{l(null);try{await Qf(e)}catch(e){l(F_(e))}}}}function F_(e){return e instanceof Uf?`${e.code}: ${e.message}`:String(e)}function I_(e){let t=(0,v.useMemo)(()=>{let t=e.query;return t.startsWith(`/`)?t.slice(1).trimStart().toLowerCase():``},[e.query]),n=(0,v.useMemo)(()=>{let n=e.commands;return t?n.filter(e=>e.name.toLowerCase().includes(t)||e.description.toLowerCase().includes(t)||e.source.toLowerCase().includes(t)):n},[t,e.commands]);return e.visible?(0,B.jsx)(`div`,{className:`absolute bottom-full left-0 right-0 z-20 mb-1 max-h-72 overflow-auto border border-border bg-popover`,children:n.length>0?(0,B.jsx)(`ul`,{className:`flex flex-col divide-y divide-border/40`,children:n.map(t=>(0,B.jsxs)(`li`,{className:`flex cursor-pointer flex-wrap items-baseline gap-x-2 gap-y-0.5 px-3 py-2 hover:bg-accent/50`,onClick:()=>e.onSelect(t),children:[(0,B.jsxs)(`span`,{className:`font-mono text-sm font-semibold text-primary`,children:[`/`,t.name]}),t.argument_hint&&(0,B.jsx)(`span`,{className:`font-mono text-xs text-muted-foreground/70`,children:t.argument_hint}),(0,B.jsxs)(`span`,{className:`ml-auto font-mono text-xs text-muted-foreground/50`,children:[t.source,t.location&&(0,B.jsxs)(B.Fragment,{children:[` · `,t.location]})]}),(0,B.jsx)(`span`,{className:`basis-full text-xs text-muted-foreground`,children:t.description})]},t.name))}):(0,B.jsx)(`div`,{className:`px-3 py-2 text-xs italic text-muted-foreground`,children:`no matching commands`})}):null}var L_=new Set([`select`,`confirm`,`input`,`editor`,`notify`]);function R_(e){return L_.has(e.method)}function z_(e){let t=e.store.dialog,n=t&&R_(t)?t:null,r=e.store.role===`controller`;return(0,B.jsx)(Dp,{open:n!==null,children:(0,B.jsx)(Ap,{showCloseButton:!1,className:n&&!r?`opacity-90`:void 0,children:n&&(r?(0,B.jsx)(W_,{req:n,store:e.store},n.id):(0,B.jsx)(B_,{req:n},n.id))})})}function B_(e){return(0,B.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,B.jsx)(`p`,{className:`text-sm font-semibold`,children:`The controller is being prompted`}),(0,B.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:U_(e.req)})]})}function V_(e){switch(e){case`error`:return`border-destructive/40 text-destructive`;case`warning`:return`border-warning/40 text-warning`;case`success`:return`border-success/40 text-success`;default:return`border-border text-foreground`}}function H_(e){let t=/https?:\/\/[^\s]+/g;return e.split(`
|
|
52
|
+
`).map((e,n)=>{let r=[],i=0,a;for(;a=t.exec(e);)a.index>i&&r.push(e.slice(i,a.index)),r.push((0,B.jsx)(`a`,{href:a[0],target:`_blank`,rel:`noopener noreferrer`,className:`underline break-all`,children:a[0]},a.index)),i=a.index+a[0].length;return i<e.length&&r.push(e.slice(i)),(0,B.jsxs)(`span`,{children:[n>0&&(0,B.jsx)(`br`,{}),r]},n)})}function U_(e){switch(e.method){case`select`:return`${e.title} — ${e.options.length} options`;case`confirm`:return`${e.title}: ${e.message}`;case`input`:return e.title;case`editor`:return e.title;case`notify`:return e.message}}function W_(e){let t=()=>e.store.dialogResponse(e.req.id,{cancelled:!0});return e.req.method===`select`?(0,B.jsx)(G_,{req:e.req,store:e.store,cancel:t}):(0,B.jsx)(K_,{req:e.req,store:e.store,cancel:t})}function G_(e){return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(jp,{children:(0,B.jsx)(Np,{children:e.req.title})}),(0,B.jsx)(`ul`,{className:`flex flex-col gap-2`,children:e.req.options.map(t=>(0,B.jsx)(`li`,{children:(0,B.jsx)(Z,{variant:`secondary`,className:`w-full justify-start`,onClick:()=>e.store.dialogResponse(e.req.id,{value:t}),children:t})},t))}),(0,B.jsx)(Mp,{children:(0,B.jsx)(Z,{type:`button`,variant:`secondary`,onClick:e.cancel,children:`Cancel`})})]})}function K_(e){let[t,n]=(0,v.useState)(e.req.method===`editor`?e.req.prefill??``:``);if(e.req.method===`confirm`){let t=e.req;return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(jp,{children:(0,B.jsx)(Np,{children:t.title})}),(0,B.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:t.message}),(0,B.jsxs)(Mp,{children:[(0,B.jsx)(Z,{variant:`secondary`,onClick:()=>e.store.dialogResponse(t.id,{confirmed:!1}),children:`No`}),(0,B.jsx)(Z,{onClick:()=>e.store.dialogResponse(t.id,{confirmed:!0}),children:`Yes`})]})]})}if(e.req.method===`input`||e.req.method===`editor`){let r=e.req;return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(jp,{children:(0,B.jsx)(Np,{children:H_(r.title)})}),r.method===`editor`?(0,B.jsx)(Wp,{className:`resize-none font-mono text-sm`,rows:8,value:t,onChange:e=>n(e.currentTarget.value),autoFocus:!0}):(0,B.jsx)(Fp,{placeholder:r.placeholder??``,value:t,onChange:e=>n(e.currentTarget.value),autoFocus:!0}),(0,B.jsxs)(Mp,{children:[(0,B.jsx)(Z,{type:`button`,variant:`secondary`,onClick:e.cancel,children:`Cancel`}),(0,B.jsx)(Z,{onClick:()=>e.store.dialogResponse(r.id,{value:t}),children:`Submit`})]})]})}if(e.req.method===`notify`){let t=e.req;return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`p`,{className:Y(`rounded-none border px-3 py-2 text-sm`,V_(t.notifyType)),children:H_(t.message)}),(0,B.jsx)(Mp,{children:(0,B.jsx)(Z,{onClick:()=>e.store.dialogResponse(t.id,{confirmed:!0}),children:`OK`})})]})}return null}function q_(e,t,n){let r=Array(e);return new Proxy(r,{get(r,i,a){if(typeof i==`string`){let a=i.charCodeAt(0);if(a>=48&&a<=57){let a=+i;if(Number.isInteger(a)&&a>=0&&a<e){let e=r[a];if(!e){let i=t[a*2];e=r[a]={index:a,key:n(a),start:i,size:t[a*2+1],end:i+t[a*2+1],lane:0}}return e}}if(i===`length`)return e}return Reflect.get(r,i,a)}})}function J_(e,t,n){let r=n.initialDeps??[],i,a=!0;function o(){let o=e();return o.length!==r.length||o.some((e,t)=>r[t]!==e)?(r=o,i=t(...o),n?.onChange&&!(a&&n.skipInitialOnChange)&&n.onChange(i),a=!1,i):i}return o.updateDeps=e=>{r=e},o}function Y_(e,t){if(e===void 0)throw Error(`Unexpected undefined${t?`: ${t}`:``}`);return e}var X_=(e,t)=>Math.abs(e-t)<1.01,Z_=(e,t,n)=>{let r;return function(...i){e.clearTimeout(r),r=e.setTimeout(()=>t.apply(this,i),n)}},Q_,$_=()=>{if(Q_!==void 0)return Q_;if(typeof navigator>`u`)return Q_=!1;if(/iP(hone|od|ad)/.test(navigator.userAgent))return Q_=!0;let e=navigator.maxTouchPoints;return Q_=navigator.platform===`MacIntel`&&e!==void 0&&e>0},ev=e=>{let{offsetWidth:t,offsetHeight:n}=e;return{width:t,height:n}},tv=e=>e,nv=e=>{let t=Math.max(e.startIndex-e.overscan,0),n=Math.min(e.endIndex+e.overscan,e.count-1)-t+1,r=Array(n);for(let e=0;e<n;e++)r[e]=t+e;return r},rv=(e,t)=>{let n=e.scrollElement;if(!n)return;let r=e.targetWindow;if(!r)return;let i=e=>{let{width:n,height:r}=e;t({width:Math.round(n),height:Math.round(r)})};if(i(ev(n)),!r.ResizeObserver)return()=>{};let a=new r.ResizeObserver(t=>{let r=()=>{let e=t[0];if(e?.borderBoxSize){let t=e.borderBoxSize[0];if(t){i({width:t.inlineSize,height:t.blockSize});return}}i(ev(n))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(r):r()});return a.observe(n,{box:`border-box`}),()=>{a.unobserve(n)}},iv={passive:!0},av=typeof window>`u`||`onscrollend`in window,ov=(e,t,n)=>{let r=e.scrollElement;if(!r)return;let i=e.targetWindow;if(!i)return;let a=e.options.useScrollendEvent&&av,o=0,s=a?null:Z_(i,()=>t(o,!1),e.options.isScrollingResetDelay),c=e=>()=>{o=n(r),s?.(),t(o,e)},l=c(!0),u=c(!1);return r.addEventListener(`scroll`,l,iv),a&&r.addEventListener(`scrollend`,u,iv),()=>{r.removeEventListener(`scroll`,l),a&&r.removeEventListener(`scrollend`,u)}},sv=(e,t)=>ov(e,t,t=>{let{horizontal:n,isRtl:r}=e.options;return n?t.scrollLeft*(r&&-1||1):t.scrollTop}),cv=(e,t,n)=>{if(n.options.useCachedMeasurements){let t=n.indexFromElement(e),r=n.options.getItemKey(t);return n.itemSizeCache.get(r)??n.options.estimateSize(t)}if(t?.borderBoxSize){let e=t.borderBoxSize[0];if(e)return Math.round(e[n.options.horizontal?`inlineSize`:`blockSize`])}if(!t){let t=n.indexFromElement(e),r=n.options.getItemKey(t),i=n.itemSizeCache.get(r);if(i!==void 0)return i}return e[n.options.horizontal?`offsetWidth`:`offsetHeight`]},lv=(e,{adjustments:t=0,behavior:n},r)=>{var i,a;(a=(i=r.scrollElement)?.scrollTo)==null||a.call(i,{[r.options.horizontal?`left`:`top`]:e+t,behavior:n})},uv=class{constructor(e){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this._flatMeasurements=null,this.itemSizeCache=new Map,this.itemSizeCacheVersion=0,this.laneAssignments=new Map,this.pendingMin=null,this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.pendingScrollAnchor=null,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._intendedScrollOffset=null,this.elementsCache=new Map,this.now=()=>{var e;return((e=this.targetWindow?.performance)?.now)?.call(e)??Date.now()},this.observer=(()=>{let e=null,t=()=>e||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:e=new this.targetWindow.ResizeObserver(e=>{e.forEach(e=>{let t=()=>{let t=e.target,n=this.indexFromElement(t);if(!t.isConnected){this.observer.unobserve(t);for(let[e,n]of this.elementsCache)if(n===t){this.elementsCache.delete(e);break}return}this.shouldMeasureDuringScroll(n)&&this.resizeItem(n,this.options.measureElement(t,e,this))};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(t):t()})}));return{disconnect:()=>{var n;(n=t())==null||n.disconnect(),e=null},observe:e=>t()?.observe(e,{box:`border-box`}),unobserve:e=>t()?.unobserve(e)}})(),this.range=null,this.setOptions=e=>{let t={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:tv,rangeExtractor:nv,onChange:()=>{},measureElement:cv,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:`data-index`,initialMeasurementsCache:[],lanes:1,anchorTo:`start`,followOnAppend:!1,scrollEndThreshold:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,laneAssignmentMode:`estimate`,useCachedMeasurements:!1};for(let n in e){let r=e[n];r!==void 0&&(t[n]=r)}let n=this.options,r=null,i=null,a=!1;if(n!==void 0&&n.enabled&&t.enabled&&t.anchorTo===`end`&&this.scrollElement!==null){let e=n.count,o=t.count,s=this.getMeasurements(),c=e>0?s[0]?.key??n.getItemKey(0):null,l=e>0?s[e-1]?.key??n.getItemKey(e-1):null;if(o!==e||e>0&&o>0&&(t.getItemKey(0)!==c||t.getItemKey(o-1)!==l)){a=!0;let c=e>0?this.getVirtualItemForOffset(this.getScrollOffset())??s[0]:null;c&&(r=[c.key,this.getScrollOffset()-c.start]);let u=t.followOnAppend===!0?`auto`:t.followOnAppend||null;u&&o>e&&this.isAtEnd(n.scrollEndThreshold)&&(e===0||t.getItemKey(o-1)!==l)&&(i=u)}}this.options=t,a&&(this.pendingMin=0,this.itemSizeCacheVersion++);let o=!1,s=0;if(r&&this.scrollOffset!==null){let[e,t]=r,n=this.getMeasurements(),{count:i,getItemKey:a}=this.options,c=0;for(;c<i&&a(c)!==e;)c++;if(c<i){let e=n[c];if(e){let n=e.start+t;n!==this.scrollOffset&&(s=n-this.scrollOffset,this.scrollOffset=n,o=!0)}}}(o||i)&&(this.pendingScrollAnchor=[o?r[0]:null,o?r[1]:0,i,s])},this.notify=e=>{var t,n;(n=(t=this.options).onChange)==null||n.call(t,this,e)},this.maybeNotify=J_(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),e=>{this.notify(e)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(e=>e()),this.unsubs=[],this.observer.disconnect(),this.rafId!=null&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null,this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{let e=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==e){if(this.cleanup(),!e){this.maybeNotify();return}if(this.scrollElement=e,this.scrollElement&&`ownerDocument`in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=this.scrollElement?.window??null,this.elementsCache.forEach(e=>{this.observer.observe(e)}),this.unsubs.push(this.options.observeElementRect(this,e=>{this.scrollRect=e,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(e,t)=>{if(t&&this._intendedScrollOffset===null&&e===this.scrollOffset)return;this._intendedScrollOffset!==null&&Math.abs(e-this._intendedScrollOffset)<1.5&&(e=this._intendedScrollOffset),this._intendedScrollOffset=null,this.scrollAdjustments=0;let n=this.getScrollOffset();this.scrollDirection=t?n===e?this.scrollDirection:n<e?`forward`:`backward`:null,this.scrollOffset=e,this.isScrolling=t,this._flushIosDeferredIfReady(),this.scrollState&&this.scheduleScrollReconcile(),this.maybeNotify()})),`addEventListener`in this.scrollElement){let e=this.scrollElement,t=()=>{this._iosTouching=!0,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)},n=()=>{this._iosTouching=!1,!(!$_()||this.targetWindow==null)&&(this._iosJustTouchEnded=!0,this._iosTouchEndTimerId=this.targetWindow.setTimeout(()=>{this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._flushIosDeferredIfReady()},150))};e.addEventListener(`touchstart`,t,iv),e.addEventListener(`touchend`,n,iv),this.unsubs.push(()=>{e.removeEventListener(`touchstart`,t),e.removeEventListener(`touchend`,n),this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)})}this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}let t=this.pendingScrollAnchor;if(this.pendingScrollAnchor=null,t&&this.scrollElement&&this.options.enabled){let[e,n,r,i]=t;e!==null&&!r&&($_()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?i!==0&&(this._iosDeferredAdjustment+=i):this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})),r&&this.scrollToEnd({behavior:r})}},this._flushIosDeferredIfReady=()=>{if(this._iosDeferredAdjustment===0||this.isScrolling||this._iosTouching||this._iosJustTouchEnded)return;let e=this.getScrollOffset(),t=this.getMaxScrollOffset();if(e<0||e>t)return;let n=this._iosDeferredAdjustment;this._iosDeferredAdjustment=0,this._scrollToOffset(e,{adjustments:this.scrollAdjustments+=n,behavior:void 0})},this.rafId=null,this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?`width`:`height`]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset==`function`?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(e,t)=>{let n=new Map,r=new Map;for(let i=t-1;i>=0;i--){let t=e[i];if(n.has(t.lane))continue;let a=r.get(t.lane);if(a==null||t.end>a.end?r.set(t.lane,t):t.end<a.end&&n.set(t.lane,!0),n.size===this.options.lanes)break}return r.size===this.options.lanes?Array.from(r.values()).sort((e,t)=>e.end===t.end?e.index-t.index:e.end-t.end)[0]:void 0},this.getMeasurementOptions=J_(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes,this.options.laneAssignmentMode],(e,t,n,r,i,a,o)=>(this.prevLanes!==void 0&&this.prevLanes!==a&&(this.lanesChangedFlag=!0),this.prevLanes=a,this.pendingMin=null,{count:e,paddingStart:t,scrollMargin:n,getItemKey:r,enabled:i,lanes:a,laneAssignmentMode:o}),{key:!1}),this.getMeasurements=J_(()=>[this.getMeasurementOptions(),this.itemSizeCacheVersion],({count:e,paddingStart:t,scrollMargin:n,getItemKey:r,enabled:i,lanes:a,laneAssignmentMode:o},s)=>{let c=this.itemSizeCache;if(!i)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>e)for(let t of this.laneAssignments.keys())t>=e&&this.laneAssignments.delete(t);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMin=null),this.measurementsCache.length===0&&!this.lanesSettling&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(e=>{this.itemSizeCache.set(e.key,e.size)}));let l=this.lanesSettling?0:this.pendingMin??0;if(this.pendingMin=null,this.lanesSettling&&this.measurementsCache.length===e&&(this.lanesSettling=!1),a===1){let i=this.options.gap,a=e*2,o=this._flatMeasurements;if(!o||o.length<a){let e=new Float64Array(a);o&&l>0&&e.set(o.subarray(0,l*2)),o=e,this._flatMeasurements=o}let s;if(l===0)s=t+n;else{let e=l-1;s=o[e*2]+o[e*2+1]+i}for(let t=l;t<e;t++){let e=r(t),n=c.get(e),a=typeof n==`number`?n:this.options.estimateSize(t);o[t*2]=s,o[t*2+1]=a,s+=a+i}let u=q_(e,o,r);return this.measurementsCache=u,u}let u=this.measurementsCache.slice(0,l),d=Array(a).fill(void 0);for(let e=0;e<l;e++){let t=u[e];t&&(d[t.lane]=e)}for(let i=l;i<e;i++){let e=r(i),a=this.laneAssignments.get(i),s,l,f=o===`estimate`||c.has(e);if(a!==void 0&&this.options.lanes>1){s=a;let e=d[s],r=e===void 0?void 0:u[e];l=r?r.end+this.options.gap:t+n}else{let e=this.options.lanes===1?u[i-1]:this.getFurthestMeasurement(u,i);l=e?e.end+this.options.gap:t+n,s=e?e.lane:i%this.options.lanes,this.options.lanes>1&&f&&this.laneAssignments.set(i,s)}let p=c.get(e),m=typeof p==`number`?p:this.options.estimateSize(i),h=l+m;u[i]={index:i,start:l,size:m,end:h,key:e,lane:s},d[s]=i}return this.measurementsCache=u,u},{key:!1,debug:()=>this.options.debug}),this.calculateRange=J_(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(e,t,n,r)=>e.length===0||t===0?(this.range=null,null):(this.range=pv(e,t,n,r,r===1&&this._flatMeasurements!=null?this._flatMeasurements:null),this.range),{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=J_(()=>{let e=null,t=null,n=this.calculateRange();return n&&(e=n.startIndex,t=n.endIndex),this.maybeNotify.updateDeps([this.isScrolling,e,t]),[this.options.rangeExtractor,this.options.overscan,this.options.count,e,t]},(e,t,n,r,i)=>r===null||i===null?[]:e({startIndex:r,endIndex:i,overscan:t,count:n}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=e=>{let t=this.options.indexAttribute,n=e.getAttribute(t);return n?parseInt(n,10):(console.warn(`Missing attribute name '${t}={index}' on measured element.`),-1)},this.shouldMeasureDuringScroll=e=>{if(!this.scrollState||this.scrollState.behavior!==`smooth`)return!0;let t=this.scrollState.index??this.getVirtualItemForOffset(this.scrollState.lastTargetOffset)?.index;if(t!==void 0&&this.range){let n=Math.max(this.options.overscan,Math.ceil((this.range.endIndex-this.range.startIndex)/2)),r=Math.max(0,t-n),i=Math.min(this.options.count-1,t+n);return e>=r&&e<=i}return!0},this.measureElement=e=>{if(!e){this.elementsCache.forEach((e,t)=>{e.isConnected||(this.observer.unobserve(e),this.elementsCache.delete(t))});return}let t=this.indexFromElement(e),n=this.options.getItemKey(t),r=this.elementsCache.get(n);r!==e&&(r&&this.observer.unobserve(r),this.observer.observe(e),this.elementsCache.set(n,e)),(!this.isScrolling||this.scrollState)&&this.shouldMeasureDuringScroll(t)&&this.resizeItem(t,this.options.measureElement(e,void 0,this))},this.resizeItem=(e,t)=>{if(e<0||e>=this.options.count)return;let n,r,i,a=this._flatMeasurements;if(this.options.lanes===1&&a!==null)i=this.options.getItemKey(e),r=a[e*2],n=a[e*2+1];else{let t=this.measurementsCache[e];if(!t)return;i=t.key,r=t.start,n=t.size}let o=t-(this.itemSizeCache.get(i)??n);if(o!==0){let a=this.options.anchorTo===`end`&&this.scrollState?.behavior!==`smooth`&&this.getVirtualDistanceFromEnd()<=this.options.scrollEndThreshold,s=a?this.getTotalSize():0,c=this.scrollState?.behavior!==`smooth`&&(this.shouldAdjustScrollPositionOnItemSizeChange===void 0?r<this.getScrollOffset()+this.scrollAdjustments&&(!this.itemSizeCache.has(i)||this.scrollDirection!==`backward`):this.shouldAdjustScrollPositionOnItemSizeChange(this.measurementsCache[e]??{index:e,key:i,start:r,size:n,end:r+n,lane:0},o,this));(this.pendingMin===null||e<this.pendingMin)&&(this.pendingMin=e),this.itemSizeCache.set(i,t),this.itemSizeCacheVersion++,a?this.applyScrollAdjustment(this.getTotalSize()-s):c&&this.applyScrollAdjustment(o),this.notify(!1)}},this.getVirtualItems=J_(()=>[this.getVirtualIndexes(),this.getMeasurements()],(e,t)=>{let n=[];for(let r=0,i=e.length;r<i;r++){let i=t[e[r]];n.push(i)}return n},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=e=>{let t=this.getMeasurements();if(t.length===0)return;let n=this._flatMeasurements,r=this.options.lanes===1&&n!=null;return Y_(t[dv(0,t.length-1,r?e=>n[e*2]:e=>Y_(t[e]).start,e)])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if(`scrollHeight`in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{let e=this.scrollElement.document.documentElement;return this.options.horizontal?e.scrollWidth-this.scrollElement.innerWidth:e.scrollHeight-this.scrollElement.innerHeight}},this.getVirtualDistanceFromEnd=()=>Math.max(this.getTotalSize()-this.getSize()-this.getScrollOffset(),0),this.getDistanceFromEnd=()=>Math.max(this.getMaxScrollOffset()-this.getScrollOffset(),0),this.isAtEnd=(e=this.options.scrollEndThreshold)=>this.getDistanceFromEnd()<=e,this.getOffsetForAlignment=(e,t,n=0)=>{if(!this.scrollElement)return 0;let r=this.getSize(),i=this.getScrollOffset();t===`auto`&&(t=e>=i+r?`end`:`start`),t===`center`?e+=(n-r)/2:t===`end`&&(e-=r);let a=this.getMaxScrollOffset();return Math.max(Math.min(a,e),0)},this.getOffsetForIndex=(e,t=`auto`)=>{e=Math.max(0,Math.min(e,this.options.count-1));let n=this.getSize(),r=this.getScrollOffset(),i=this.measurementsCache[e];if(!i)return;if(t===`auto`)if(i.end>=r+n-this.options.scrollPaddingEnd)t=`end`;else if(i.start<=r+this.options.scrollPaddingStart)t=`start`;else return[r,t];if(t===`end`&&e===this.options.count-1)return[this.getMaxScrollOffset(),t];let a=t===`end`?i.end+this.options.scrollPaddingEnd:i.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(a,t,i.size),t]},this.scrollToOffset=(e,{align:t=`start`,behavior:n=`auto`}={})=>{let r=this.getOffsetForAlignment(e,t),i=this.now();this.scrollState={index:null,align:t,behavior:n,startedAt:i,lastTargetOffset:r,stableFrames:0},this._scrollToOffset(r,{adjustments:void 0,behavior:n}),this.scheduleScrollReconcile()},this.scrollToIndex=(e,{align:t=`auto`,behavior:n=`auto`}={})=>{e=Math.max(0,Math.min(e,this.options.count-1));let r=this.getOffsetForIndex(e,t);if(!r)return;let[i,a]=r,o=this.now();this.scrollState={index:e,align:a,behavior:n,startedAt:o,lastTargetOffset:i,stableFrames:0},this._scrollToOffset(i,{adjustments:void 0,behavior:n}),this.scheduleScrollReconcile()},this.scrollBy=(e,{behavior:t=`auto`}={})=>{let n=this.getScrollOffset()+e,r=this.now();this.scrollState={index:null,align:`start`,behavior:t,startedAt:r,lastTargetOffset:n,stableFrames:0},this._scrollToOffset(n,{adjustments:void 0,behavior:t}),this.scheduleScrollReconcile()},this.scrollToEnd=({behavior:e=`auto`}={})=>{if(this.options.count>0){this.scrollToIndex(this.options.count-1,{align:`end`,behavior:e});return}this.scrollToOffset(Math.max(this.getTotalSize()-this.getSize(),0),{behavior:e})},this.getTotalSize=()=>{let e=this.getMeasurements(),t;if(e.length===0)t=this.options.paddingStart;else if(this.options.lanes===1){let n=e.length-1,r=this._flatMeasurements;t=r==null?e[n]?.end??0:r[n*2]+r[n*2+1]}else{let n=Array(this.options.lanes).fill(null),r=e.length-1;for(;r>=0&&n.some(e=>e===null);){let t=e[r];n[t.lane]===null&&(n[t.lane]=t.end),r--}t=Math.max(...n.filter(e=>e!==null))}return Math.max(t-this.options.scrollMargin+this.options.paddingEnd,0)},this.takeSnapshot=()=>{let e=[];if(this.itemSizeCache.size===0)return e;let t=this.getMeasurements();for(let n of t)n&&this.itemSizeCache.has(n.key)&&e.push({index:n.index,key:n.key,start:n.start,size:n.size,end:n.end,lane:n.lane});return e},this._scrollToOffset=(e,{adjustments:t,behavior:n})=>{this._intendedScrollOffset=e+(t??0),this.options.scrollToFn(e,{behavior:n,adjustments:t},this)},this.measure=()=>{this.pendingMin=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),this.itemSizeCacheVersion++,this.notify(!1)},this.setOptions(e)}applyScrollAdjustment(e,t){e!==0&&($_()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?this._iosDeferredAdjustment+=e:(this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=e,behavior:t}),this.scrollOffset!==null&&(this.scrollOffset+=this.scrollAdjustments,this.scrollAdjustments=0)))}scheduleScrollReconcile(){if(!this.targetWindow){this.scrollState=null;return}this.rafId??=this.targetWindow.requestAnimationFrame(()=>{this.rafId=null,this.reconcileScroll()})}reconcileScroll(){if(!this.scrollState||!this.scrollElement)return;if(this.now()-this.scrollState.startedAt>5e3){this.scrollState=null;return}let e=this.scrollState.index==null?void 0:this.getOffsetForIndex(this.scrollState.index,this.scrollState.align),t=e?e[0]:this.scrollState.lastTargetOffset,n=t!==this.scrollState.lastTargetOffset;if(!n&&X_(t,this.getScrollOffset())){if(this.scrollState.stableFrames++,this.scrollState.stableFrames>=1){this.getScrollOffset()!==t&&this._scrollToOffset(t,{adjustments:void 0,behavior:`auto`}),this.scrollState=null;return}}else if(this.scrollState.stableFrames=0,n){let e=this.getSize()||600,n=Math.abs(t-this.getScrollOffset()),r=this.scrollState.behavior===`smooth`&&n>e;this.scrollState.lastTargetOffset=t,r||(this.scrollState.behavior=`auto`),this._scrollToOffset(t,{adjustments:void 0,behavior:r?`smooth`:`auto`})}this.scheduleScrollReconcile()}},dv=(e,t,n,r)=>{for(;e<=t;){let i=(e+t)/2|0,a=n(i);if(a<r)e=i+1;else if(a>r)t=i-1;else return i}return e>0?e-1:0};function fv(e,t,n){let r=0;for(;r<=t;){let i=(r+t)/2|0,a=e[i*2];if(a<n)r=i+1;else if(a>n)t=i-1;else return i}return r>0?r-1:0}function pv(e,t,n,r,i){let a=e.length-1;if(e.length<=r)return{startIndex:0,endIndex:a};if(r===1&&i!==null){let e=fv(i,a,n),r=e,o=n+t;for(;r<a&&i[r*2]+i[r*2+1]<o;)r++;return{startIndex:e,endIndex:r}}let o=dv(0,a,t=>e[t].start,n),s=o;if(r===1)for(;s<a&&e[s].end<n+t;)s++;else if(r>1){let i=Array(r).fill(0);for(;s<a&&i.some(e=>e<n+t);){let t=e[s];i[t.lane]=t.end,s++}let c=Array(r).fill(n+t);for(;o>=0&&c.some(e=>e>=n);){let t=e[o];c[t.lane]=t.start,o--}o=Math.max(0,o-o%r),s=Math.min(a,s+(r-1-s%r))}return{startIndex:o,endIndex:s}}var mv=typeof document<`u`?v.useLayoutEffect:v.useEffect;function hv({useFlushSync:e=!0,directDomUpdates:t=!1,directDomUpdatesMode:n=`transform`,...r}){let i=v.useReducer(e=>e+1,0)[1],a=v.useRef({enabled:t,mode:n,container:null,lastSize:null,lastPositions:new WeakMap,prevRange:null});a.current.enabled=t,a.current.mode=n;let o=e=>{let t=a.current;if(!t.enabled||!t.container)return;let n=e.getTotalSize();if(n!==t.lastSize){t.lastSize=n;let r=e.options.horizontal?`width`:`height`;t.container.style[r]=`${n}px`}let r=!!e.options.horizontal,i=t.mode===`transform`,o=r?`left`:`top`,s=e.options.scrollMargin,c=e.getVirtualItems();for(let n of c){let a=n.start-s,c=e.elementsCache.get(n.key);c&&t.lastPositions.get(c)!==a&&(t.lastPositions.set(c,a),i?c.style.transform=r?`translate3d(${a}px, 0, 0)`:`translate3d(0, ${a}px, 0)`:c.style[o]=`${a}px`)}},s={...r,onChange:(t,n)=>{var s;let c=a.current,l=!0;if(c.enabled){o(t);let e=t.range,n=c.prevRange;l=!n||n.isScrolling!==t.isScrolling||n.startIndex!==e?.startIndex||n.endIndex!==e?.endIndex,l&&(c.prevRange=e?{startIndex:e.startIndex,endIndex:e.endIndex,isScrolling:t.isScrolling}:null)}l&&(e&&n?(0,y.flushSync)(i):i()),(s=r.onChange)==null||s.call(r,t,n)}},[c]=v.useState(()=>{let e=new uv(s);return Object.assign(e,{containerRef:t=>{let n=a.current;if(n.container=t,n.lastSize=null,t&&n.enabled){let r=e.getTotalSize();n.lastSize=r;let i=e.options.horizontal?`width`:`height`;t.style[i]=`${r}px`}}})});return c.setOptions(s),mv(()=>c._didMount(),[]),mv(()=>c._willUpdate()),mv(()=>{o(c)}),c}function gv(e){return hv({observeElementRect:rv,observeElementOffset:sv,scrollToFn:lv,...e})}var _v={};function vv(e){let t=_v[e];if(t)return t;t=_v[e]=[];for(let e=0;e<128;e++){let n=String.fromCharCode(e);t.push(n)}for(let n=0;n<e.length;n++){let r=e.charCodeAt(n);t[r]=`%`+(`0`+r.toString(16).toUpperCase()).slice(-2)}return t}function yv(e,t){typeof t!=`string`&&(t=yv.defaultChars);let n=vv(t);return e.replace(/(%[a-f0-9]{2})+/gi,function(e){let t=``;for(let r=0,i=e.length;r<i;r+=3){let a=parseInt(e.slice(r+1,r+3),16);if(a<128){t+=n[a];continue}if((a&224)==192&&r+3<i){let n=parseInt(e.slice(r+4,r+6),16);if((n&192)==128){let e=a<<6&1984|n&63;e<128?t+=`��`:t+=String.fromCharCode(e),r+=3;continue}}if((a&240)==224&&r+6<i){let n=parseInt(e.slice(r+4,r+6),16),i=parseInt(e.slice(r+7,r+9),16);if((n&192)==128&&(i&192)==128){let e=a<<12&61440|n<<6&4032|i&63;e<2048||e>=55296&&e<=57343?t+=`���`:t+=String.fromCharCode(e),r+=6;continue}}if((a&248)==240&&r+9<i){let n=parseInt(e.slice(r+4,r+6),16),i=parseInt(e.slice(r+7,r+9),16),o=parseInt(e.slice(r+10,r+12),16);if((n&192)==128&&(i&192)==128&&(o&192)==128){let e=a<<18&1835008|n<<12&258048|i<<6&4032|o&63;e<65536||e>1114111?t+=`����`:(e-=65536,t+=String.fromCharCode(55296+(e>>10),56320+(e&1023))),r+=9;continue}}t+=`�`}return t})}yv.defaultChars=`;/?:@&=+$,#`,yv.componentChars=``;var bv={};function xv(e){let t=bv[e];if(t)return t;t=bv[e]=[];for(let e=0;e<128;e++){let n=String.fromCharCode(e);/^[0-9a-z]$/i.test(n)?t.push(n):t.push(`%`+(`0`+e.toString(16).toUpperCase()).slice(-2))}for(let n=0;n<e.length;n++)t[e.charCodeAt(n)]=e[n];return t}function Sv(e,t,n){typeof t!=`string`&&(n=t,t=Sv.defaultChars),n===void 0&&(n=!0);let r=xv(t),i=``;for(let t=0,a=e.length;t<a;t++){let o=e.charCodeAt(t);if(n&&o===37&&t+2<a&&/^[0-9a-f]{2}$/i.test(e.slice(t+1,t+3))){i+=e.slice(t,t+3),t+=2;continue}if(o<128){i+=r[o];continue}if(o>=55296&&o<=57343){if(o>=55296&&o<=56319&&t+1<a){let n=e.charCodeAt(t+1);if(n>=56320&&n<=57343){i+=encodeURIComponent(e[t]+e[t+1]),t++;continue}}i+=`%EF%BF%BD`;continue}i+=encodeURIComponent(e[t])}return i}Sv.defaultChars=`;/?:@&=+$,-_.!~*'()#`,Sv.componentChars=`-_.!~*'()`;function Cv(e){let t=``;return t+=e.protocol||``,t+=e.slashes?`//`:``,t+=e.auth?e.auth+`@`:``,e.hostname&&e.hostname.indexOf(`:`)!==-1?t+=`[`+e.hostname+`]`:t+=e.hostname||``,t+=e.port?`:`+e.port:``,t+=e.pathname||``,t+=e.search||``,t+=e.hash||``,t}function wv(){this.protocol=null,this.slashes=null,this.auth=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.pathname=null}var Tv=/^([a-z0-9.+-]+:)/i,Ev=/:[0-9]*$/,Dv=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,Ov=[`%`,`/`,`?`,`;`,`#`,`'`,`{`,`}`,`|`,`\\`,`^`,"`",`<`,`>`,`"`,"`",` `,`\r`,`
|
|
53
|
+
`,` `],kv=[`/`,`?`,`#`],Av=255,jv=/^[+a-z0-9A-Z_-]{0,63}$/,Mv=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,Nv={javascript:!0,"javascript:":!0},Pv={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function Fv(e,t){if(e&&e instanceof wv)return e;let n=new wv;return n.parse(e,t),n}wv.prototype.parse=function(e,t){let n,r,i,a=e;if(a=a.trim(),!t&&e.split(`#`).length===1){let e=Dv.exec(a);if(e)return this.pathname=e[1],e[2]&&(this.search=e[2]),this}let o=Tv.exec(a);if(o&&(o=o[0],n=o.toLowerCase(),this.protocol=o,a=a.substr(o.length)),(t||o||a.match(/^\/\/[^@\/]+@[^@\/]+/))&&(i=a.substr(0,2)===`//`,i&&!(o&&Nv[o])&&(a=a.substr(2),this.slashes=!0)),!Nv[o]&&(i||o&&!Pv[o])){let e=-1;for(let t=0;t<kv.length;t++)r=a.indexOf(kv[t]),r!==-1&&(e===-1||r<e)&&(e=r);let t,n;n=e===-1?a.lastIndexOf(`@`):a.lastIndexOf(`@`,e),n!==-1&&(t=a.slice(0,n),a=a.slice(n+1),this.auth=t),e=-1;for(let t=0;t<Ov.length;t++)r=a.indexOf(Ov[t]),r!==-1&&(e===-1||r<e)&&(e=r);e===-1&&(e=a.length),a[e-1]===`:`&&e--;let i=a.slice(0,e);a=a.slice(e),this.parseHost(i),this.hostname=this.hostname||``;let o=this.hostname[0]===`[`&&this.hostname[this.hostname.length-1]===`]`;if(!o){let e=this.hostname.split(/\./);for(let t=0,n=e.length;t<n;t++){let n=e[t];if(n&&!n.match(jv)){let r=``;for(let e=0,t=n.length;e<t;e++)n.charCodeAt(e)>127?r+=`x`:r+=n[e];if(!r.match(jv)){let r=e.slice(0,t),i=e.slice(t+1),o=n.match(Mv);o&&(r.push(o[1]),i.unshift(o[2])),i.length&&(a=i.join(`.`)+a),this.hostname=r.join(`.`);break}}}}this.hostname.length>Av&&(this.hostname=``),o&&(this.hostname=this.hostname.substr(1,this.hostname.length-2))}let s=a.indexOf(`#`);s!==-1&&(this.hash=a.substr(s),a=a.slice(0,s));let c=a.indexOf(`?`);return c!==-1&&(this.search=a.substr(c),a=a.slice(0,c)),a&&(this.pathname=a),Pv[n]&&this.hostname&&!this.pathname&&(this.pathname=``),this},wv.prototype.parseHost=function(e){let t=Ev.exec(e);t&&(t=t[0],t!==`:`&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)};var Iv=s({decode:()=>yv,encode:()=>Sv,format:()=>Cv,parse:()=>Fv}),Lv=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,Rv=/[\0-\x1F\x7F-\x9F]/,zv=/[\xAD\u0600-\u0605\u061C\u06DD\u070F\u0890\u0891\u08E2\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB]|\uD804[\uDCBD\uDCCD]|\uD80D[\uDC30-\uDC3F]|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]/,Bv=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061D-\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1B7D\u1B7E\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52-\u2E5D\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDEAD\uDF55-\uDF59\uDF86-\uDF89]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5A\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDEB9\uDF3C-\uDF3E]|\uD806[\uDC3B\uDD44-\uDD46\uDDE2\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2\uDF00-\uDF09]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8\uDF43-\uDF4F\uDFFF]|\uD809[\uDC70-\uDC74]|\uD80B[\uDFF1\uDFF2]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A\uDFE2]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]/,Vv=/[\$\+<->\^`\|~\xA2-\xA6\xA8\xA9\xAC\xAE-\xB1\xB4\xB8\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0384\u0385\u03F6\u0482\u058D-\u058F\u0606-\u0608\u060B\u060E\u060F\u06DE\u06E9\u06FD\u06FE\u07F6\u07FE\u07FF\u0888\u09F2\u09F3\u09FA\u09FB\u0AF1\u0B70\u0BF3-\u0BFA\u0C7F\u0D4F\u0D79\u0E3F\u0F01-\u0F03\u0F13\u0F15-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE\u0FCF\u0FD5-\u0FD8\u109E\u109F\u1390-\u1399\u166D\u17DB\u1940\u19DE-\u19FF\u1B61-\u1B6A\u1B74-\u1B7C\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2044\u2052\u207A-\u207C\u208A-\u208C\u20A0-\u20C0\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F\u218A\u218B\u2190-\u2307\u230C-\u2328\u232B-\u2426\u2440-\u244A\u249C-\u24E9\u2500-\u2767\u2794-\u27C4\u27C7-\u27E5\u27F0-\u2982\u2999-\u29D7\u29DC-\u29FB\u29FE-\u2B73\u2B76-\u2B95\u2B97-\u2BFF\u2CE5-\u2CEA\u2E50\u2E51\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFF\u3004\u3012\u3013\u3020\u3036\u3037\u303E\u303F\u309B\u309C\u3190\u3191\u3196-\u319F\u31C0-\u31E3\u31EF\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA700-\uA716\uA720\uA721\uA789\uA78A\uA828-\uA82B\uA836-\uA839\uAA77-\uAA79\uAB5B\uAB6A\uAB6B\uFB29\uFBB2-\uFBC2\uFD40-\uFD4F\uFDCF\uFDFC-\uFDFF\uFE62\uFE64-\uFE66\uFE69\uFF04\uFF0B\uFF1C-\uFF1E\uFF3E\uFF40\uFF5C\uFF5E\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFFC\uFFFD]|\uD800[\uDD37-\uDD3F\uDD79-\uDD89\uDD8C-\uDD8E\uDD90-\uDD9C\uDDA0\uDDD0-\uDDFC]|\uD802[\uDC77\uDC78\uDEC8]|\uD805\uDF3F|\uD807[\uDFD5-\uDFF1]|\uD81A[\uDF3C-\uDF3F\uDF45]|\uD82F\uDC9C|\uD833[\uDF50-\uDFC3]|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDEA\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85\uDE86]|\uD838[\uDD4F\uDEFF]|\uD83B[\uDCAC\uDCB0\uDD2E\uDEF0\uDEF1]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD0D-\uDDAD\uDDE6-\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDE60-\uDE65\uDF00-\uDFFF]|\uD83D[\uDC00-\uDED7\uDEDC-\uDEEC\uDEF0-\uDEFC\uDF00-\uDF76\uDF7B-\uDFD9\uDFE0-\uDFEB\uDFF0]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDCB0\uDCB1\uDD00-\uDE53\uDE60-\uDE6D\uDE70-\uDE7C\uDE80-\uDE88\uDE90-\uDEBD\uDEBF-\uDEC5\uDECE-\uDEDB\uDEE0-\uDEE8\uDEF0-\uDEF8\uDF00-\uDF92\uDF94-\uDFCA]/,Hv=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/,Uv=s({Any:()=>Lv,Cc:()=>Rv,Cf:()=>zv,P:()=>Bv,S:()=>Vv,Z:()=>Hv}),Wv=new Uint16Array(`ᵁ<Õıʊҝջאٵ۞ޢߖࠏઑඡ༉༦ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTLJNjǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲϏϢϸontourIntegraìȹoɴ\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲy;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱còJTabcdfgorstרׯؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ߂ߐĀiyޱrc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣসে্ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४ĀnrࢃgleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpwਖਛgȀLRlr৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼અઋp;椅y;䐜Ādl੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑඞcy;䐊cute;䅃ƀaeyહાron;䅇dil;䅅;䐝ƀgswે૰ativeƀMTV૨ediumSpace;怋hiĀcn૦ëeryThiîtedĀGLଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷreak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪௫ఄ಄ದൡඅ櫬Āoungruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater;EFGLSTஶஷ扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨setĀ;Eೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂෛ෧ขภยา฿ไlig;䅒cute耻Ó䃓Āiyීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲcr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬืde耻Õ䃕es;樷ml耻Ö䃖erĀBP๋Āar๐๓r;怾acĀek๚;揞et;掴arenthesis;揜ҀacfhilorsງຊຏຒດຝະrtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ檻cedesȀ;EST່້扺qual;檯lantEqual;扼ilde;找me;怳Ādpuct;戏ortionĀ;aȥl;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL憒ar;懥eftArrow;懄eiling;按oǵ\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄቕቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHcቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗ĀeiቻDzኀ\0ኇefore;戴a;䎘ĀcnኘkSpace;쀀 Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻Dzᕔ\0ᕛoWidtèa;䎖r;愨pf;愤cr;쀀𝒵ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒;Eaeiopᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;eᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;eᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰᝃᝈ០៦ᠹᡐᜍ᥈ᥰot;櫭ĀcrᛶkȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;tbrk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯᝳ;䎲;愶een;扬r;쀀𝔟gcostuvwឍឝឳេ៕៛ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀakoᠦᠵĀcn៲ᠣkƀlst֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ;敛;敘;攘;攔;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģbar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;elƀ;bhᥨᥩᥫ䁜;槅sub;柈ŬᥴlĀ;e怢t»pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭒\0᯽\0ᰌƀcprᦲute;䄇̀;abcdsᦿᧀᧄ᧕᧙戩nd;橄rcup;橉Āau᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r;Ecefms᩠ᩢᩫ᪤᪪旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ\0\0aĀ;t䀬;䁀ƀ;fl戁îᅠeĀmxent»eóɍǧ\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯delprvw᭠᭬᭷ᮂᮬᯔarrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;pᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰻᰿ᱝᱩᱵᲞᲬᲷᴍᵻᶑᶫᶻ᷆᷍ròar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂᳖᳜᳠mƀ;oș᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄĀDoḆᴴoôĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤijạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»ṺƀaeiἒἚls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ffiɩᾹ\0\0᾽g;耀ffig;耀ffl;쀀𝔣lig;耀filig;쀀fjƀaltῙῡt;晭ig;耀flns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao⁕Ācs‑⁒ႉ‸⁅⁈\0⁐β•‥‧\0耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₥₰₴⃰℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽ƀ;qsؾٌlanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqrⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0proør;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼ròòΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonóquigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roøurĀ;a⧓⧔普lĀ;s⧓ସdz⧟\0⧣p肻\xA0ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨íistĀ;sடr;쀀𝔫ȀEest⩦⩹⩼ƀ;qs⩭ƀ;qs⩴lanôií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast⭕⭚⭟lleìl;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖchimpqu⮽⯍⯙⬄⯤⯯Ȁ;cerല⯆ഷ⯉uå;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭ååഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñĀ;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;cⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗLjⵚlac;䅑v;樸old;榼lig;䅓Ācrir;榿;쀀𝔬ͯ\0\0\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕⶥⶨrò᪀Āirⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔǒr;榷rp;榹;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ\0\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ脀¶;l䂶leìЃɩ\0\0m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳ᤈ⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t⾴ïrel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⋢⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔ABHabcdefhilmnoprstuxけさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstwガクシスゼゾダッデナp;極Ā;fゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ìâヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘rrowĀ;tㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowóarpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓ròaòՑ;怏oustĀ;a㈞掱che»mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì耻䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;qኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫwar;椪lig耻ß䃟㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rëƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼Dz㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproøim»ኬsðኞĀas㚺㚮ðrn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈadempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xôheadĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roðtré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜtré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌`.split(``).map(e=>e.charCodeAt(0))),Gv=new Uint16Array(`Ȁaglq \x1Bɭ\0\0p;䀦os;䀧t;䀾t;䀼uot;䀢`.split(``).map(e=>e.charCodeAt(0))),Kv=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]),qv=String.fromCodePoint??function(e){let t=``;return e>65535&&(e-=65536,t+=String.fromCharCode(e>>>10&1023|55296),e=56320|e&1023),t+=String.fromCharCode(e),t};function Jv(e){return e>=55296&&e<=57343||e>1114111?65533:Kv.get(e)??e}var Yv;(function(e){e[e.NUM=35]=`NUM`,e[e.SEMI=59]=`SEMI`,e[e.EQUALS=61]=`EQUALS`,e[e.ZERO=48]=`ZERO`,e[e.NINE=57]=`NINE`,e[e.LOWER_A=97]=`LOWER_A`,e[e.LOWER_F=102]=`LOWER_F`,e[e.LOWER_X=120]=`LOWER_X`,e[e.LOWER_Z=122]=`LOWER_Z`,e[e.UPPER_A=65]=`UPPER_A`,e[e.UPPER_F=70]=`UPPER_F`,e[e.UPPER_Z=90]=`UPPER_Z`})(Yv||={});var Xv=32,Zv;(function(e){e[e.VALUE_LENGTH=49152]=`VALUE_LENGTH`,e[e.BRANCH_LENGTH=16256]=`BRANCH_LENGTH`,e[e.JUMP_TABLE=127]=`JUMP_TABLE`})(Zv||={});function Qv(e){return e>=Yv.ZERO&&e<=Yv.NINE}function $v(e){return e>=Yv.UPPER_A&&e<=Yv.UPPER_F||e>=Yv.LOWER_A&&e<=Yv.LOWER_F}function ey(e){return e>=Yv.UPPER_A&&e<=Yv.UPPER_Z||e>=Yv.LOWER_A&&e<=Yv.LOWER_Z||Qv(e)}function ty(e){return e===Yv.EQUALS||ey(e)}var ny;(function(e){e[e.EntityStart=0]=`EntityStart`,e[e.NumericStart=1]=`NumericStart`,e[e.NumericDecimal=2]=`NumericDecimal`,e[e.NumericHex=3]=`NumericHex`,e[e.NamedEntity=4]=`NamedEntity`})(ny||={});var ry;(function(e){e[e.Legacy=0]=`Legacy`,e[e.Strict=1]=`Strict`,e[e.Attribute=2]=`Attribute`})(ry||={});var iy=class{constructor(e,t,n){this.decodeTree=e,this.emitCodePoint=t,this.errors=n,this.state=ny.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=ry.Strict}startEntity(e){this.decodeMode=e,this.state=ny.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(e,t){switch(this.state){case ny.EntityStart:return e.charCodeAt(t)===Yv.NUM?(this.state=ny.NumericStart,this.consumed+=1,this.stateNumericStart(e,t+1)):(this.state=ny.NamedEntity,this.stateNamedEntity(e,t));case ny.NumericStart:return this.stateNumericStart(e,t);case ny.NumericDecimal:return this.stateNumericDecimal(e,t);case ny.NumericHex:return this.stateNumericHex(e,t);case ny.NamedEntity:return this.stateNamedEntity(e,t)}}stateNumericStart(e,t){return t>=e.length?-1:(e.charCodeAt(t)|Xv)===Yv.LOWER_X?(this.state=ny.NumericHex,this.consumed+=1,this.stateNumericHex(e,t+1)):(this.state=ny.NumericDecimal,this.stateNumericDecimal(e,t))}addToNumericResult(e,t,n,r){if(t!==n){let i=n-t;this.result=this.result*r**+i+parseInt(e.substr(t,i),r),this.consumed+=i}}stateNumericHex(e,t){let n=t;for(;t<e.length;){let r=e.charCodeAt(t);if(Qv(r)||$v(r))t+=1;else return this.addToNumericResult(e,n,t,16),this.emitNumericEntity(r,3)}return this.addToNumericResult(e,n,t,16),-1}stateNumericDecimal(e,t){let n=t;for(;t<e.length;){let r=e.charCodeAt(t);if(Qv(r))t+=1;else return this.addToNumericResult(e,n,t,10),this.emitNumericEntity(r,2)}return this.addToNumericResult(e,n,t,10),-1}emitNumericEntity(e,t){var n;if(this.consumed<=t)return(n=this.errors)==null||n.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(e===Yv.SEMI)this.consumed+=1;else if(this.decodeMode===ry.Strict)return 0;return this.emitCodePoint(Jv(this.result),this.consumed),this.errors&&(e!==Yv.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(e,t){let{decodeTree:n}=this,r=n[this.treeIndex],i=(r&Zv.VALUE_LENGTH)>>14;for(;t<e.length;t++,this.excess++){let a=e.charCodeAt(t);if(this.treeIndex=oy(n,r,this.treeIndex+Math.max(1,i),a),this.treeIndex<0)return this.result===0||this.decodeMode===ry.Attribute&&(i===0||ty(a))?0:this.emitNotTerminatedNamedEntity();if(r=n[this.treeIndex],i=(r&Zv.VALUE_LENGTH)>>14,i!==0){if(a===Yv.SEMI)return this.emitNamedEntityData(this.treeIndex,i,this.consumed+this.excess);this.decodeMode!==ry.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var e;let{result:t,decodeTree:n}=this,r=(n[t]&Zv.VALUE_LENGTH)>>14;return this.emitNamedEntityData(t,r,this.consumed),(e=this.errors)==null||e.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(e,t,n){let{decodeTree:r}=this;return this.emitCodePoint(t===1?r[e]&~Zv.VALUE_LENGTH:r[e+1],n),t===3&&this.emitCodePoint(r[e+2],n),n}end(){var e;switch(this.state){case ny.NamedEntity:return this.result!==0&&(this.decodeMode!==ry.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case ny.NumericDecimal:return this.emitNumericEntity(0,2);case ny.NumericHex:return this.emitNumericEntity(0,3);case ny.NumericStart:return(e=this.errors)==null||e.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case ny.EntityStart:return 0}}};function ay(e){let t=``,n=new iy(e,e=>t+=qv(e));return function(e,r){let i=0,a=0;for(;(a=e.indexOf(`&`,a))>=0;){t+=e.slice(i,a),n.startEntity(r);let o=n.write(e,a+1);if(o<0){i=a+n.end();break}i=a+o,a=o===0?i+1:i}let o=t+e.slice(i);return t=``,o}}function oy(e,t,n,r){let i=(t&Zv.BRANCH_LENGTH)>>7,a=t&Zv.JUMP_TABLE;if(i===0)return a!==0&&r===a?n:-1;if(a){let t=r-a;return t<0||t>=i?-1:e[n+t]-1}let o=n,s=o+i-1;for(;o<=s;){let t=o+s>>>1,n=e[t];if(n<r)o=t+1;else if(n>r)s=t-1;else return e[t+i]}return-1}var sy=ay(Wv);ay(Gv);function cy(e,t=ry.Legacy){return sy(e,t)}function ly(e){return sy(e,ry.Strict)}var uy=s({arrayReplaceAt:()=>gy,asciiTrim:()=>zy,assign:()=>hy,escapeHtml:()=>ky,escapeRE:()=>jy,fromCodePoint:()=>vy,has:()=>my,isMdAsciiPunct:()=>Iy,isPunctChar:()=>Py,isPunctCharCode:()=>Fy,isSpace:()=>My,isString:()=>fy,isValidEntityCode:()=>_y,isWhiteSpace:()=>Ny,lib:()=>By,normalizeReference:()=>Ly,unescapeAll:()=>wy,unescapeMd:()=>Cy});function dy(e){return Object.prototype.toString.call(e)}function fy(e){return dy(e)===`[object String]`}var py=Object.prototype.hasOwnProperty;function my(e,t){return py.call(e,t)}function hy(e){return Array.prototype.slice.call(arguments,1).forEach(function(t){if(t){if(typeof t!=`object`)throw TypeError(t+`must be object`);Object.keys(t).forEach(function(n){e[n]=t[n]})}}),e}function gy(e,t,n){return[].concat(e.slice(0,t),n,e.slice(t+1))}function _y(e){return!(e>=55296&&e<=57343||e>=64976&&e<=65007||(e&65535)==65535||(e&65535)==65534||e>=0&&e<=8||e===11||e>=14&&e<=31||e>=127&&e<=159||e>1114111)}function vy(e){if(e>65535){e-=65536;let t=55296+(e>>10),n=56320+(e&1023);return String.fromCharCode(t,n)}return String.fromCharCode(e)}var yy=/\\([!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~])/g,by=RegExp(yy.source+`|&([a-z#][a-z0-9]{1,31});`,`gi`),xy=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))$/i;function Sy(e,t){if(t.charCodeAt(0)===35&&xy.test(t)){let n=t[1].toLowerCase()===`x`?parseInt(t.slice(2),16):parseInt(t.slice(1),10);return _y(n)?vy(n):e}let n=cy(e);return n===e?e:n}function Cy(e){return e.indexOf(`\\`)<0?e:e.replace(yy,`$1`)}function wy(e){return e.indexOf(`\\`)<0&&e.indexOf(`&`)<0?e:e.replace(by,function(e,t,n){return t||Sy(e,n)})}var Ty=/[&<>"]/,Ey=/[&<>"]/g,Dy={"&":`&`,"<":`<`,">":`>`,'"':`"`};function Oy(e){return Dy[e]}function ky(e){return Ty.test(e)?e.replace(Ey,Oy):e}var Ay=/[.?*+^$[\]\\(){}|-]/g;function jy(e){return e.replace(Ay,`\\$&`)}function My(e){switch(e){case 9:case 32:return!0}return!1}function Ny(e){if(e>=8192&&e<=8202)return!0;switch(e){case 9:case 10:case 11:case 12:case 13:case 32:case 160:case 5760:case 8239:case 8287:case 12288:return!0}return!1}function Py(e){return Bv.test(e)||Vv.test(e)}function Fy(e){return Py(vy(e))}function Iy(e){switch(e){case 33:case 34:case 35:case 36:case 37:case 38:case 39:case 40:case 41:case 42:case 43:case 44:case 45:case 46:case 47:case 58:case 59:case 60:case 61:case 62:case 63:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 124:case 125:case 126:return!0;default:return!1}}function Ly(e){return e=e.trim().replace(/\s+/g,` `),e.toLowerCase().toUpperCase()}function Ry(e){return e===32||e===9||e===10||e===13}function zy(e){let t=0;for(;t<e.length&&Ry(e.charCodeAt(t));t++);let n=e.length-1;for(;n>=t&&Ry(e.charCodeAt(n));n--);return e.slice(t,n+1)}var By={mdurl:Iv,ucmicro:Uv};function Vy(e,t,n){let r,i,a,o,s=e.posMax,c=e.pos;for(e.pos=t+1,r=1;e.pos<s;){if(a=e.src.charCodeAt(e.pos),a===93&&(r--,r===0)){i=!0;break}if(o=e.pos,e.md.inline.skipToken(e),a===91){if(o===e.pos-1)r++;else if(n)return e.pos=c,-1}}let l=-1;return i&&(l=e.pos),e.pos=c,l}function Hy(e,t,n){let r,i=t,a={ok:!1,pos:0,str:``};if(e.charCodeAt(i)===60){for(i++;i<n;){if(r=e.charCodeAt(i),r===10||r===60)return a;if(r===62)return a.pos=i+1,a.str=wy(e.slice(t+1,i)),a.ok=!0,a;if(r===92&&i+1<n){i+=2;continue}i++}return a}let o=0;for(;i<n&&(r=e.charCodeAt(i),!(r===32||r<32||r===127));){if(r===92&&i+1<n){if(e.charCodeAt(i+1)===32)break;i+=2;continue}if(r===40&&(o++,o>32))return a;if(r===41){if(o===0)break;o--}i++}return t===i||o!==0?a:(a.str=wy(e.slice(t,i)),a.pos=i,a.ok=!0,a)}function Uy(e,t,n,r){let i,a=t,o={ok:!1,can_continue:!1,pos:0,str:``,marker:0};if(r)o.str=r.str,o.marker=r.marker;else{if(a>=n)return o;let r=e.charCodeAt(a);if(r!==34&&r!==39&&r!==40)return o;t++,a++,r===40&&(r=41),o.marker=r}for(;a<n;){if(i=e.charCodeAt(a),i===o.marker)return o.pos=a+1,o.str+=wy(e.slice(t,a)),o.ok=!0,o;if(i===40&&o.marker===41)return o;i===92&&a+1<n&&a++,a++}return o.can_continue=!0,o.str+=wy(e.slice(t,a)),o}var Wy=s({parseLinkDestination:()=>Hy,parseLinkLabel:()=>Vy,parseLinkTitle:()=>Uy}),Gy={};Gy.code_inline=function(e,t,n,r,i){let a=e[t];return`<code`+i.renderAttrs(a)+`>`+ky(a.content)+`</code>`},Gy.code_block=function(e,t,n,r,i){let a=e[t];return`<pre`+i.renderAttrs(a)+`><code>`+ky(e[t].content)+`</code></pre>
|
|
54
|
+
`},Gy.fence=function(e,t,n,r,i){let a=e[t],o=a.info?wy(a.info).trim():``,s=``,c=``;if(o){let e=o.split(/(\s+)/g);s=e[0],c=e.slice(2).join(``)}let l;if(l=n.highlight&&n.highlight(a.content,s,c)||ky(a.content),l.indexOf(`<pre`)===0)return l+`
|
|
55
|
+
`;if(o){let e=a.attrIndex(`class`),t=a.attrs?a.attrs.slice():[];e<0?t.push([`class`,n.langPrefix+s]):(t[e]=t[e].slice(),t[e][1]+=` `+n.langPrefix+s);let r={attrs:t};return`<pre><code${i.renderAttrs(r)}>${l}</code></pre>\n`}return`<pre><code${i.renderAttrs(a)}>${l}</code></pre>\n`},Gy.image=function(e,t,n,r,i){let a=e[t];return a.attrs[a.attrIndex(`alt`)][1]=i.renderInlineAsText(a.children,n,r),i.renderToken(e,t,n)},Gy.hardbreak=function(e,t,n){return n.xhtmlOut?`<br />
|
|
55
56
|
`:`<br>
|
|
56
|
-
`},
|
|
57
|
+
`},Gy.softbreak=function(e,t,n){return n.breaks?n.xhtmlOut?`<br />
|
|
57
58
|
`:`<br>
|
|
58
59
|
`:`
|
|
59
|
-
`},
|
|
60
|
+
`},Gy.text=function(e,t){return ky(e[t].content)},Gy.html_block=function(e,t){return e[t].content},Gy.html_inline=function(e,t){return e[t].content};function Ky(){this.rules=hy({},Gy)}Ky.prototype.renderAttrs=function(e){let t,n,r;if(!e.attrs)return``;for(r=``,t=0,n=e.attrs.length;t<n;t++)r+=` `+ky(e.attrs[t][0])+`="`+ky(e.attrs[t][1])+`"`;return r},Ky.prototype.renderToken=function(e,t,n){let r=e[t],i=``;if(r.hidden)return``;r.block&&r.nesting!==-1&&t&&e[t-1].hidden&&(i+=`
|
|
60
61
|
`),i+=(r.nesting===-1?`</`:`<`)+r.tag,i+=this.renderAttrs(r),r.nesting===0&&n.xhtmlOut&&(i+=` /`);let a=!1;if(r.block&&(a=!0,r.nesting===1&&t+1<e.length)){let n=e[t+1];(n.type===`inline`||n.hidden||n.nesting===-1&&n.tag===r.tag)&&(a=!1)}return i+=a?`>
|
|
61
|
-
`:`>`,i},
|
|
62
|
-
`;break;default:}return r},
|
|
63
|
-
`),t=t.replace(Xy,`�`),e.src=t}function Qy(e){let t;e.inlineMode?(t=new e.Token(`inline`,``,0),t.content=e.src,t.map=[0,1],t.children=[],e.tokens.push(t)):e.md.block.parse(e.src,e.md,e.env,e.tokens)}function $y(e){let t=e.tokens;for(let n=0,r=t.length;n<r;n++){let r=t[n];r.type===`inline`&&e.md.inline.parse(r.content,e.md,e.env,r.children)}}function eb(e){return/^<a[>\s]/i.test(e)}function tb(e){return/^<\/a\s*>/i.test(e)}function nb(e){let t=e.tokens;if(e.md.options.linkify)for(let n=0,r=t.length;n<r;n++){if(t[n].type!==`inline`||!e.md.linkify.pretest(t[n].content))continue;let r=t[n].children,i=0;for(let a=r.length-1;a>=0;a--){let o=r[a];if(o.type===`link_close`){for(a--;r[a].level!==o.level&&r[a].type!==`link_open`;)a--;continue}if(o.type===`html_inline`&&(eb(o.content)&&i>0&&i--,tb(o.content)&&i++),!(i>0)&&o.type===`text`&&e.md.linkify.test(o.content)){let i=o.content,s=e.md.linkify.match(i),c=[],l=o.level,u=0;s.length>0&&s[0].index===0&&a>0&&r[a-1].type===`text_special`&&(s=s.slice(1));for(let t=0;t<s.length;t++){let n=s[t].url,r=e.md.normalizeLink(n);if(!e.md.validateLink(r))continue;let a=s[t].text;a=s[t].schema?s[t].schema===`mailto:`&&!/^mailto:/i.test(a)?e.md.normalizeLinkText(`mailto:`+a).replace(/^mailto:/,``):e.md.normalizeLinkText(a):e.md.normalizeLinkText(`http://`+a).replace(/^http:\/\//,``);let o=s[t].index;if(o>u){let t=new e.Token(`text`,``,0);t.content=i.slice(u,o),t.level=l,c.push(t)}let d=new e.Token(`link_open`,`a`,1);d.attrs=[[`href`,r]],d.level=l++,d.markup=`linkify`,d.info=`auto`,c.push(d);let f=new e.Token(`text`,``,0);f.content=a,f.level=l,c.push(f);let p=new e.Token(`link_close`,`a`,-1);p.level=--l,p.markup=`linkify`,p.info=`auto`,c.push(p),u=s[t].lastIndex}if(u<i.length){let t=new e.Token(`text`,``,0);t.content=i.slice(u),t.level=l,c.push(t)}t[n].children=r=hy(r,a,c)}}}}var rb=/\+-|\.\.|\?\?\?\?|!!!!|,,|--/,ib=/\((c|tm|r)\)/i,ab=/\((c|tm|r)\)/gi,ob={c:`©`,r:`®`,tm:`™`};function sb(e,t){return ob[t.toLowerCase()]}function cb(e){let t=0;for(let n=e.length-1;n>=0;n--){let r=e[n];r.type===`text`&&!t&&(r.content=r.content.replace(ab,sb)),r.type===`link_open`&&r.info===`auto`&&t--,r.type===`link_close`&&r.info===`auto`&&t++}}function lb(e){let t=0;for(let n=e.length-1;n>=0;n--){let r=e[n];r.type===`text`&&!t&&rb.test(r.content)&&(r.content=r.content.replace(/\+-/g,`±`).replace(/\.{2,}/g,`…`).replace(/([?!])…/g,`$1..`).replace(/([?!]){4,}/g,`$1$1$1`).replace(/,{2,}/g,`,`).replace(/(^|[^-])---(?=[^-]|$)/gm,`$1—`).replace(/(^|\s)--(?=\s|$)/gm,`$1–`).replace(/(^|[^-\s])--(?=[^-\s]|$)/gm,`$1–`)),r.type===`link_open`&&r.info===`auto`&&t--,r.type===`link_close`&&r.info===`auto`&&t++}}function ub(e){let t;if(e.md.options.typographer)for(t=e.tokens.length-1;t>=0;t--)e.tokens[t].type===`inline`&&(ib.test(e.tokens[t].content)&&cb(e.tokens[t].children),rb.test(e.tokens[t].content)&&lb(e.tokens[t].children))}var db=/['"]/,fb=/['"]/g,pb=`’`;function mb(e,t,n,r){e[t]||(e[t]=[]),e[t].push({pos:n,ch:r})}function hb(e,t){let n=``,r=0;t.sort((e,t)=>e.pos-t.pos);for(let i=0;i<t.length;i++){let a=t[i];n+=e.slice(r,a.pos)+a.ch,r=a.pos+1}return n+e.slice(r)}function gb(e,t){let n,r=[],i={};for(let a=0;a<e.length;a++){let o=e[a],s=e[a].level;for(n=r.length-1;n>=0&&!(r[n].level<=s);n--);if(r.length=n+1,o.type!==`text`)continue;let c=o.content,l=0,u=c.length;OUTER:for(;l<u;){fb.lastIndex=l;let o=fb.exec(c);if(!o)break;let d=!0,f=!0;l=o.index+1;let p=o[0]===`'`,m=32;if(o.index-1>=0)m=c.charCodeAt(o.index-1);else for(n=a-1;n>=0&&!(e[n].type===`softbreak`||e[n].type===`hardbreak`);n--)if(e[n].content){m=e[n].content.charCodeAt(e[n].content.length-1);break}let h=32;if(l<u)h=c.charCodeAt(l);else for(n=a+1;n<e.length&&!(e[n].type===`softbreak`||e[n].type===`hardbreak`);n++)if(e[n].content){h=e[n].content.charCodeAt(0);break}let g=Fy(m)||Py(m),_=Fy(h)||Py(h),v=My(m),y=My(h);if(y?d=!1:_&&(v||g||(d=!1)),v?f=!1:g&&(y||_||(f=!1)),h===34&&o[0]===`"`&&m>=48&&m<=57&&(f=d=!1),d&&f&&(d=g,f=_),!d&&!f){p&&mb(i,a,o.index,pb);continue}if(f)for(n=r.length-1;n>=0;n--){let e=r[n];if(r[n].level<s)break;if(e.single===p&&r[n].level===s){e=r[n];let s,c;p?(s=t.md.options.quotes[2],c=t.md.options.quotes[3]):(s=t.md.options.quotes[0],c=t.md.options.quotes[1]),mb(i,a,o.index,c),mb(i,e.token,e.pos,s),r.length=n;continue OUTER}}d?r.push({token:a,pos:o.index,single:p,level:s}):f&&p&&mb(i,a,o.index,pb)}}Object.keys(i).forEach(function(t){e[t].content=hb(e[t].content,i[t])})}function _b(e){if(e.md.options.typographer)for(let t=e.tokens.length-1;t>=0;t--)e.tokens[t].type!==`inline`||!db.test(e.tokens[t].content)||gb(e.tokens[t].children,e)}function vb(e){let t,n,r=e.tokens,i=r.length;for(let e=0;e<i;e++){if(r[e].type!==`inline`)continue;let i=r[e].children,a=i.length;for(t=0;t<a;t++)i[t].type===`text_special`&&(i[t].type=`text`);for(t=n=0;t<a;t++)i[t].type===`text`&&t+1<a&&i[t+1].type===`text`?i[t+1].content=i[t].content+i[t+1].content:(t!==n&&(i[n]=i[t]),n++);t!==n&&(i.length=n)}}var yb=[[`normalize`,Zy],[`block`,Qy],[`inline`,$y],[`linkify`,nb],[`replacements`,ub],[`smartquotes`,_b],[`text_join`,vb]];function bb(){this.ruler=new Ky;for(let e=0;e<yb.length;e++)this.ruler.push(yb[e][0],yb[e][1])}bb.prototype.process=function(e){let t=this.ruler.getRules(``);for(let n=0,r=t.length;n<r;n++)t[n](e)},bb.prototype.State=Jy;function xb(e,t,n,r){this.src=e,this.md=t,this.env=n,this.tokens=r,this.bMarks=[],this.eMarks=[],this.tShift=[],this.sCount=[],this.bsCount=[],this.blkIndent=0,this.line=0,this.lineMax=0,this.tight=!1,this.ddIndent=-1,this.listIndent=-1,this.parentType=`root`,this.level=0;let i=this.src;for(let e=0,t=0,n=0,r=0,a=i.length,o=!1;t<a;t++){let s=i.charCodeAt(t);if(!o)if(jy(s)){n++,s===9?r+=4-r%4:r++;continue}else o=!0;(s===10||t===a-1)&&(s!==10&&t++,this.bMarks.push(e),this.eMarks.push(t),this.tShift.push(n),this.sCount.push(r),this.bsCount.push(0),o=!1,n=0,r=0,e=t+1)}this.bMarks.push(i.length),this.eMarks.push(i.length),this.tShift.push(0),this.sCount.push(0),this.bsCount.push(0),this.lineMax=this.bMarks.length-1}xb.prototype.push=function(e,t,n){let r=new qy(e,t,n);return r.block=!0,n<0&&this.level--,r.level=this.level,n>0&&this.level++,this.tokens.push(r),r},xb.prototype.isEmpty=function(e){return this.bMarks[e]+this.tShift[e]>=this.eMarks[e]},xb.prototype.skipEmptyLines=function(e){for(let t=this.lineMax;e<t&&!(this.bMarks[e]+this.tShift[e]<this.eMarks[e]);e++);return e},xb.prototype.skipSpaces=function(e){for(let t=this.src.length;e<t&&jy(this.src.charCodeAt(e));e++);return e},xb.prototype.skipSpacesBack=function(e,t){if(e<=t)return e;for(;e>t;)if(!jy(this.src.charCodeAt(--e)))return e+1;return e},xb.prototype.skipChars=function(e,t){for(let n=this.src.length;e<n&&this.src.charCodeAt(e)===t;e++);return e},xb.prototype.skipCharsBack=function(e,t,n){if(e<=n)return e;for(;e>n;)if(t!==this.src.charCodeAt(--e))return e+1;return e},xb.prototype.getLines=function(e,t,n,r){if(e>=t)return``;let i=Array(t-e);for(let a=0,o=e;o<t;o++,a++){let e=0,s=this.bMarks[o],c=s,l;for(l=o+1<t||r?this.eMarks[o]+1:this.eMarks[o];c<l&&e<n;){let t=this.src.charCodeAt(c);if(jy(t))t===9?e+=4-(e+this.bsCount[o])%4:e++;else if(c-s<this.tShift[o])e++;else break;c++}e>n?i[a]=Array(e-n+1).join(` `)+this.src.slice(c,l):i[a]=this.src.slice(c,l)}return i.join(``)},xb.prototype.Token=qy;var Sb=65536;function Cb(e,t){let n=e.bMarks[t]+e.tShift[t],r=e.eMarks[t];return e.src.slice(n,r)}function wb(e){let t=[],n=e.length,r=0,i=e.charCodeAt(r),a=!1,o=0,s=``;for(;r<n;)i===124&&(a?(s+=e.substring(o,r-1),o=r):(t.push(s+e.substring(o,r)),s=``,o=r+1)),a=i===92,r++,i=e.charCodeAt(r);return t.push(s+e.substring(o)),t}function Tb(e,t,n,r){if(t+2>n)return!1;let i=t+1;if(e.sCount[i]<e.blkIndent||e.sCount[i]-e.blkIndent>=4)return!1;let a=e.bMarks[i]+e.tShift[i];if(a>=e.eMarks[i])return!1;let o=e.src.charCodeAt(a++);if(o!==124&&o!==45&&o!==58||a>=e.eMarks[i])return!1;let s=e.src.charCodeAt(a++);if(s!==124&&s!==45&&s!==58&&!jy(s)||o===45&&jy(s))return!1;for(;a<e.eMarks[i];){let t=e.src.charCodeAt(a);if(t!==124&&t!==45&&t!==58&&!jy(t))return!1;a++}let c=Cb(e,t+1),l=c.split(`|`),u=[];for(let e=0;e<l.length;e++){let t=l[e].trim();if(!t){if(e===0||e===l.length-1)continue;return!1}if(!/^:?-+:?$/.test(t))return!1;t.charCodeAt(t.length-1)===58?u.push(t.charCodeAt(0)===58?`center`:`right`):t.charCodeAt(0)===58?u.push(`left`):u.push(``)}if(c=Cb(e,t).trim(),c.indexOf(`|`)===-1||e.sCount[t]-e.blkIndent>=4)return!1;l=wb(c),l.length&&l[0]===``&&l.shift(),l.length&&l[l.length-1]===``&&l.pop();let d=l.length;if(d===0||d!==u.length)return!1;if(r)return!0;let f=e.parentType;e.parentType=`table`;let p=e.md.block.ruler.getRules(`blockquote`),m=e.push(`table_open`,`table`,1),h=[t,0];m.map=h;let g=e.push(`thead_open`,`thead`,1);g.map=[t,t+1];let _=e.push(`tr_open`,`tr`,1);_.map=[t,t+1];for(let t=0;t<l.length;t++){let n=e.push(`th_open`,`th`,1);u[t]&&(n.attrs=[[`style`,`text-align:`+u[t]]]);let r=e.push(`inline`,``,0);r.content=l[t].trim(),r.children=[],e.push(`th_close`,`th`,-1)}e.push(`tr_close`,`tr`,-1),e.push(`thead_close`,`thead`,-1);let v,y=0;for(i=t+2;i<n&&!(e.sCount[i]<e.blkIndent);i++){let r=!1;for(let t=0,a=p.length;t<a;t++)if(p[t](e,i,n,!0)){r=!0;break}if(r||(c=Cb(e,i).trim(),!c)||e.sCount[i]-e.blkIndent>=4||(l=wb(c),l.length&&l[0]===``&&l.shift(),l.length&&l[l.length-1]===``&&l.pop(),y+=d-l.length,y>Sb))break;if(i===t+2){let n=e.push(`tbody_open`,`tbody`,1);n.map=v=[t+2,0]}let a=e.push(`tr_open`,`tr`,1);a.map=[i,i+1];for(let t=0;t<d;t++){let n=e.push(`td_open`,`td`,1);u[t]&&(n.attrs=[[`style`,`text-align:`+u[t]]]);let r=e.push(`inline`,``,0);r.content=l[t]?l[t].trim():``,r.children=[],e.push(`td_close`,`td`,-1)}e.push(`tr_close`,`tr`,-1)}return v&&(e.push(`tbody_close`,`tbody`,-1),v[1]=i),e.push(`table_close`,`table`,-1),h[1]=i,e.parentType=f,e.line=i,!0}function Eb(e,t,n){if(e.sCount[t]-e.blkIndent<4)return!1;let r=t+1,i=r;for(;r<n;){if(e.isEmpty(r)){r++;continue}if(e.sCount[r]-e.blkIndent>=4){r++,i=r;continue}break}e.line=i;let a=e.push(`code_block`,`code`,0);return a.content=e.getLines(t,i,4+e.blkIndent,!1)+`
|
|
64
|
-
`,a.map=[t,e.line],!0}function Db(e,t,n,r){let i=e.bMarks[t]+e.tShift[t],a=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||i+3>a)return!1;let o=e.src.charCodeAt(i);if(o!==126&&o!==96)return!1;let s=i;i=e.skipChars(i,o);let c=i-s;if(c<3)return!1;let l=e.src.slice(s,i),u=e.src.slice(i,a);if(o===96&&u.indexOf(String.fromCharCode(o))>=0)return!1;if(r)return!0;let d=t,f=!1;for(;d++,!(d>=n||(i=s=e.bMarks[d]+e.tShift[d],a=e.eMarks[d],i<a&&e.sCount[d]<e.blkIndent));)if(e.src.charCodeAt(i)===o&&!(e.sCount[d]-e.blkIndent>=4)&&(i=e.skipChars(i,o),!(i-s<c)&&(i=e.skipSpaces(i),!(i<a)))){f=!0;break}c=e.sCount[t],e.line=d+ +!!f;let p=e.push(`fence`,`code`,0);return p.info=u,p.content=e.getLines(t+1,d,c,!0),p.markup=l,p.map=[t,e.line],!0}function Ob(e,t,n,r){let i=e.bMarks[t]+e.tShift[t],a=e.eMarks[t],o=e.lineMax;if(e.sCount[t]-e.blkIndent>=4||e.src.charCodeAt(i)!==62)return!1;if(r)return!0;let s=[],c=[],l=[],u=[],d=e.md.block.ruler.getRules(`blockquote`),f=e.parentType;e.parentType=`blockquote`;let p=!1,m;for(m=t;m<n;m++){let t=e.sCount[m]<e.blkIndent;if(i=e.bMarks[m]+e.tShift[m],a=e.eMarks[m],i>=a)break;if(e.src.charCodeAt(i++)===62&&!t){let t=e.sCount[m]+1,n,r;e.src.charCodeAt(i)===32?(i++,t++,r=!1,n=!0):e.src.charCodeAt(i)===9?(n=!0,(e.bsCount[m]+t)%4==3?(i++,t++,r=!1):r=!0):n=!1;let o=t;for(s.push(e.bMarks[m]),e.bMarks[m]=i;i<a;){let t=e.src.charCodeAt(i);if(jy(t))t===9?o+=4-(o+e.bsCount[m]+ +!!r)%4:o++;else break;i++}p=i>=a,c.push(e.bsCount[m]),e.bsCount[m]=e.sCount[m]+1+ +!!n,l.push(e.sCount[m]),e.sCount[m]=o-t,u.push(e.tShift[m]),e.tShift[m]=i-e.bMarks[m];continue}if(p)break;let r=!1;for(let t=0,i=d.length;t<i;t++)if(d[t](e,m,n,!0)){r=!0;break}if(r){e.lineMax=m,e.blkIndent!==0&&(s.push(e.bMarks[m]),c.push(e.bsCount[m]),u.push(e.tShift[m]),l.push(e.sCount[m]),e.sCount[m]-=e.blkIndent);break}s.push(e.bMarks[m]),c.push(e.bsCount[m]),u.push(e.tShift[m]),l.push(e.sCount[m]),e.sCount[m]=-1}let h=e.blkIndent;e.blkIndent=0;let g=e.push(`blockquote_open`,`blockquote`,1);g.markup=`>`;let _=[t,0];g.map=_,e.md.block.tokenize(e,t,m);let v=e.push(`blockquote_close`,`blockquote`,-1);v.markup=`>`,e.lineMax=o,e.parentType=f,_[1]=e.line;for(let n=0;n<u.length;n++)e.bMarks[n+t]=s[n],e.tShift[n+t]=u[n],e.sCount[n+t]=l[n],e.bsCount[n+t]=c[n];return e.blkIndent=h,!0}function kb(e,t,n,r){let i=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4)return!1;let a=e.bMarks[t]+e.tShift[t],o=e.src.charCodeAt(a++);if(o!==42&&o!==45&&o!==95)return!1;let s=1;for(;a<i;){let t=e.src.charCodeAt(a++);if(t!==o&&!jy(t))return!1;t===o&&s++}if(s<3)return!1;if(r)return!0;e.line=t+1;let c=e.push(`hr`,`hr`,0);return c.map=[t,e.line],c.markup=Array(s+1).join(String.fromCharCode(o)),!0}function Ab(e,t){let n=e.eMarks[t],r=e.bMarks[t]+e.tShift[t],i=e.src.charCodeAt(r++);return i!==42&&i!==45&&i!==43||r<n&&!jy(e.src.charCodeAt(r))?-1:r}function jb(e,t){let n=e.bMarks[t]+e.tShift[t],r=e.eMarks[t],i=n;if(i+1>=r)return-1;let a=e.src.charCodeAt(i++);if(a<48||a>57)return-1;for(;;){if(i>=r)return-1;if(a=e.src.charCodeAt(i++),a>=48&&a<=57){if(i-n>=10)return-1;continue}if(a===41||a===46)break;return-1}return i<r&&(a=e.src.charCodeAt(i),!jy(a))?-1:i}function Mb(e,t){let n=e.level+2;for(let r=t+2,i=e.tokens.length-2;r<i;r++)e.tokens[r].level===n&&e.tokens[r].type===`paragraph_open`&&(e.tokens[r+2].hidden=!0,e.tokens[r].hidden=!0,r+=2)}function Nb(e,t,n,r){let i,a,o,s,c=t,l=!0;if(e.sCount[c]-e.blkIndent>=4||e.listIndent>=0&&e.sCount[c]-e.listIndent>=4&&e.sCount[c]<e.blkIndent)return!1;let u=!1;r&&e.parentType===`paragraph`&&e.sCount[c]>=e.blkIndent&&(u=!0);let d,f,p;if((p=jb(e,c))>=0){if(d=!0,o=e.bMarks[c]+e.tShift[c],f=Number(e.src.slice(o,p-1)),u&&f!==1)return!1}else if((p=Ab(e,c))>=0)d=!1;else return!1;if(u&&e.skipSpaces(p)>=e.eMarks[c])return!1;if(r)return!0;let m=e.src.charCodeAt(p-1),h=e.tokens.length;d?(s=e.push(`ordered_list_open`,`ol`,1),f!==1&&(s.attrs=[[`start`,f]])):s=e.push(`bullet_list_open`,`ul`,1);let g=[c,0];s.map=g,s.markup=String.fromCharCode(m);let _=!1,v=e.md.block.ruler.getRules(`list`),y=e.parentType;for(e.parentType=`list`;c<n;){a=p,i=e.eMarks[c];let t=e.sCount[c]+p-(e.bMarks[c]+e.tShift[c]),r=t;for(;a<i;){let t=e.src.charCodeAt(a);if(t===9)r+=4-(r+e.bsCount[c])%4;else if(t===32)r++;else break;a++}let u=a,f;f=u>=i?1:r-t,f>4&&(f=1);let h=t+f;s=e.push(`list_item_open`,`li`,1),s.markup=String.fromCharCode(m);let g=[c,0];s.map=g,d&&(s.info=e.src.slice(o,p-1));let y=e.tight,b=e.tShift[c],x=e.sCount[c],S=e.listIndent;if(e.listIndent=e.blkIndent,e.blkIndent=h,e.tight=!0,e.tShift[c]=u-e.bMarks[c],e.sCount[c]=r,u>=i&&e.isEmpty(c+1)?e.line=Math.min(e.line+2,n):e.md.block.tokenize(e,c,n,!0),(!e.tight||_)&&(l=!1),_=e.line-c>1&&e.isEmpty(e.line-1),e.blkIndent=e.listIndent,e.listIndent=S,e.tShift[c]=b,e.sCount[c]=x,e.tight=y,s=e.push(`list_item_close`,`li`,-1),s.markup=String.fromCharCode(m),c=e.line,g[1]=c,c>=n||e.sCount[c]<e.blkIndent||e.sCount[c]-e.blkIndent>=4)break;let C=!1;for(let t=0,r=v.length;t<r;t++)if(v[t](e,c,n,!0)){C=!0;break}if(C)break;if(d){if(p=jb(e,c),p<0)break;o=e.bMarks[c]+e.tShift[c]}else if(p=Ab(e,c),p<0)break;if(m!==e.src.charCodeAt(p-1))break}return s=d?e.push(`ordered_list_close`,`ol`,-1):e.push(`bullet_list_close`,`ul`,-1),s.markup=String.fromCharCode(m),g[1]=c,e.line=c,e.parentType=y,l&&Mb(e,h),!0}function Pb(e,t,n,r){let i=e.bMarks[t]+e.tShift[t],a=e.eMarks[t],o=t+1;if(e.sCount[t]-e.blkIndent>=4||e.src.charCodeAt(i)!==91)return!1;function s(t){let n=e.lineMax;if(t>=n||e.isEmpty(t))return null;let r=!1;if(e.sCount[t]-e.blkIndent>3&&(r=!0),e.sCount[t]<0&&(r=!0),!r){let r=e.md.block.ruler.getRules(`reference`),i=e.parentType;e.parentType=`reference`;let a=!1;for(let i=0,o=r.length;i<o;i++)if(r[i](e,t,n,!0)){a=!0;break}if(e.parentType=i,a)return null}let i=e.bMarks[t]+e.tShift[t],a=e.eMarks[t];return e.src.slice(i,a+1)}let c=e.src.slice(i,a+1);a=c.length;let l=-1;for(i=1;i<a;i++){let e=c.charCodeAt(i);if(e===91)return!1;if(e===93){l=i;break}else if(e===10){let e=s(o);e!==null&&(c+=e,a=c.length,o++)}else if(e===92&&(i++,i<a&&c.charCodeAt(i)===10)){let e=s(o);e!==null&&(c+=e,a=c.length,o++)}}if(l<0||c.charCodeAt(l+1)!==58)return!1;for(i=l+2;i<a;i++){let e=c.charCodeAt(i);if(e===10){let e=s(o);e!==null&&(c+=e,a=c.length,o++)}else if(!jy(e))break}let u=e.md.helpers.parseLinkDestination(c,i,a);if(!u.ok)return!1;let d=e.md.normalizeLink(u.str);if(!e.md.validateLink(d))return!1;i=u.pos;let f=i,p=o,m=i;for(;i<a;i++){let e=c.charCodeAt(i);if(e===10){let e=s(o);e!==null&&(c+=e,a=c.length,o++)}else if(!jy(e))break}let h=e.md.helpers.parseLinkTitle(c,i,a);for(;h.can_continue;){let t=s(o);if(t===null)break;c+=t,i=a,a=c.length,o++,h=e.md.helpers.parseLinkTitle(c,i,a,h)}let g;for(i<a&&m!==i&&h.ok?(g=h.str,i=h.pos):(g=``,i=f,o=p);i<a&&jy(c.charCodeAt(i));)i++;if(i<a&&c.charCodeAt(i)!==10&&g)for(g=``,i=f,o=p;i<a&&jy(c.charCodeAt(i));)i++;if(i<a&&c.charCodeAt(i)!==10)return!1;let _=Iy(c.slice(1,l));return _?r?!0:(e.env.references===void 0&&(e.env.references={}),e.env.references[_]===void 0&&(e.env.references[_]={title:g,href:d}),e.line=o,!0):!1}var Fb=`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`.split(`.`),Ib=RegExp(`^(?:<[A-Za-z][A-Za-z0-9\\-]*(?:\\s+[a-zA-Z_:][a-zA-Z0-9:._-]*(?:\\s*=\\s*(?:[^"'=<>\`\\x00-\\x20]+|'[^']*'|"[^"]*"))?)*\\s*\\/?>|<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>|<!---?>|<!--(?:[^-]|-[^-]|--[^>])*-->|<[?][\\s\\S]*?[?]>|<![A-Za-z][^>]*>|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>)`),Lb=RegExp(`^(?:<[A-Za-z][A-Za-z0-9\\-]*(?:\\s+[a-zA-Z_:][a-zA-Z0-9:._-]*(?:\\s*=\\s*(?:[^"'=<>\`\\x00-\\x20]+|'[^']*'|"[^"]*"))?)*\\s*\\/?>|<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>)`),Rb=[[/^<(script|pre|style|textarea)(?=(\s|>|$))/i,/<\/(script|pre|style|textarea)>/i,!0],[/^<!--/,/-->/,!0],[/^<\?/,/\?>/,!0],[/^<![A-Z]/,/>/,!0],[/^<!\[CDATA\[/,/\]\]>/,!0],[RegExp(`^</?(`+Fb.join(`|`)+`)(?=(\\s|/?>|$))`,`i`),/^$/,!0],[RegExp(Lb.source+`\\s*$`),/^$/,!1]];function zb(e,t,n,r){let i=e.bMarks[t]+e.tShift[t],a=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||!e.md.options.html||e.src.charCodeAt(i)!==60)return!1;let o=e.src.slice(i,a),s=0;for(;s<Rb.length&&!Rb[s][0].test(o);s++);if(s===Rb.length)return!1;if(r)return Rb[s][2];let c=t+1,l=Rb[s][1].test(``);if(!Rb[s][1].test(o)){for(;c<n&&!(e.sCount[c]<e.blkIndent&&(l||!e.isEmpty(c)));c++)if(i=e.bMarks[c]+e.tShift[c],a=e.eMarks[c],o=e.src.slice(i,a),Rb[s][1].test(o)){o.length!==0&&c++;break}}e.line=c;let u=e.push(`html_block`,``,0);return u.map=[t,c],u.content=e.getLines(t,c,e.blkIndent,!0),!0}function Bb(e,t,n,r){let i=e.bMarks[t]+e.tShift[t],a=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4)return!1;let o=e.src.charCodeAt(i);if(o!==35||i>=a)return!1;let s=1;for(o=e.src.charCodeAt(++i);o===35&&i<a&&s<=6;)s++,o=e.src.charCodeAt(++i);if(s>6||i<a&&!jy(o))return!1;if(r)return!0;a=e.skipSpacesBack(a,i);let c=e.skipCharsBack(a,35,i);c>i&&jy(e.src.charCodeAt(c-1))&&(a=c),e.line=t+1;let l=e.push(`heading_open`,`h`+String(s),1);l.markup=`########`.slice(0,s),l.map=[t,e.line];let u=e.push(`inline`,``,0);u.content=Ry(e.src.slice(i,a)),u.map=[t,e.line],u.children=[];let d=e.push(`heading_close`,`h`+String(s),-1);return d.markup=`########`.slice(0,s),!0}function Vb(e,t,n){let r=e.md.block.ruler.getRules(`paragraph`);if(e.sCount[t]-e.blkIndent>=4)return!1;let i=e.parentType;e.parentType=`paragraph`;let a=0,o,s=t+1;for(;s<n&&!e.isEmpty(s);s++){if(e.sCount[s]-e.blkIndent>3)continue;if(e.sCount[s]>=e.blkIndent){let t=e.bMarks[s]+e.tShift[s],n=e.eMarks[s];if(t<n&&(o=e.src.charCodeAt(t),(o===45||o===61)&&(t=e.skipChars(t,o),t=e.skipSpaces(t),t>=n))){a=o===61?1:2;break}}if(e.sCount[s]<0)continue;let t=!1;for(let i=0,a=r.length;i<a;i++)if(r[i](e,s,n,!0)){t=!0;break}if(t)break}if(!a)return e.parentType=i,!1;let c=Ry(e.getLines(t,s,e.blkIndent,!1));e.line=s+1;let l=e.push(`heading_open`,`h`+String(a),1);l.markup=String.fromCharCode(o),l.map=[t,e.line];let u=e.push(`inline`,``,0);u.content=c,u.map=[t,e.line-1],u.children=[];let d=e.push(`heading_close`,`h`+String(a),-1);return d.markup=String.fromCharCode(o),e.parentType=i,!0}function Hb(e,t,n){let r=e.md.block.ruler.getRules(`paragraph`),i=e.parentType,a=t+1;for(e.parentType=`paragraph`;a<n&&!e.isEmpty(a);a++){if(e.sCount[a]-e.blkIndent>3||e.sCount[a]<0)continue;let t=!1;for(let i=0,o=r.length;i<o;i++)if(r[i](e,a,n,!0)){t=!0;break}if(t)break}let o=Ry(e.getLines(t,a,e.blkIndent,!1));e.line=a;let s=e.push(`paragraph_open`,`p`,1);s.map=[t,e.line];let c=e.push(`inline`,``,0);return c.content=o,c.map=[t,e.line],c.children=[],e.push(`paragraph_close`,`p`,-1),e.parentType=i,!0}var Ub=[[`table`,Tb,[`paragraph`,`reference`]],[`code`,Eb],[`fence`,Db,[`paragraph`,`reference`,`blockquote`,`list`]],[`blockquote`,Ob,[`paragraph`,`reference`,`blockquote`,`list`]],[`hr`,kb,[`paragraph`,`reference`,`blockquote`,`list`]],[`list`,Nb,[`paragraph`,`reference`,`blockquote`]],[`reference`,Pb],[`html_block`,zb,[`paragraph`,`reference`,`blockquote`]],[`heading`,Bb,[`paragraph`,`reference`,`blockquote`]],[`lheading`,Vb],[`paragraph`,Hb]];function Wb(){this.ruler=new Ky;for(let e=0;e<Ub.length;e++)this.ruler.push(Ub[e][0],Ub[e][1],{alt:(Ub[e][2]||[]).slice()})}Wb.prototype.tokenize=function(e,t,n){let r=this.ruler.getRules(``),i=r.length,a=e.md.options.maxNesting,o=t,s=!1;for(;o<n&&(e.line=o=e.skipEmptyLines(o),!(o>=n||e.sCount[o]<e.blkIndent));){if(e.level>=a){e.line=n;break}let t=e.line,c=!1;for(let a=0;a<i;a++)if(c=r[a](e,o,n,!1),c){if(t>=e.line)throw Error(`block rule didn't increment state.line`);break}if(!c)throw Error(`none of the block rules matched`);e.tight=!s,e.isEmpty(e.line-1)&&(s=!0),o=e.line,o<n&&e.isEmpty(o)&&(s=!0,o++,e.line=o)}},Wb.prototype.parse=function(e,t,n,r){if(!e)return;let i=new this.State(e,t,n,r);this.tokenize(i,i.line,i.lineMax)},Wb.prototype.State=xb;function Gb(e,t,n,r){this.src=e,this.env=n,this.md=t,this.tokens=r,this.tokens_meta=Array(r.length),this.pos=0,this.posMax=this.src.length,this.level=0,this.pending=``,this.pendingLevel=0,this.cache={},this.delimiters=[],this._prev_delimiters=[],this.backticks={},this.backticksScanned=!1,this.linkLevel=0}Gb.prototype.pushPending=function(){let e=new qy(`text`,``,0);return e.content=this.pending,e.level=this.pendingLevel,this.tokens.push(e),this.pending=``,e},Gb.prototype.push=function(e,t,n){this.pending&&this.pushPending();let r=new qy(e,t,n),i=null;return n<0&&(this.level--,this.delimiters=this._prev_delimiters.pop()),r.level=this.level,n>0&&(this.level++,this._prev_delimiters.push(this.delimiters),this.delimiters=[],i={delimiters:this.delimiters}),this.pendingLevel=this.level,this.tokens.push(r),this.tokens_meta.push(i),r},Gb.prototype.scanDelims=function(e,t){let n=this.posMax,r=this.src.charCodeAt(e),i;if(e===0)i=32;else if(e===1)i=this.src.charCodeAt(0),(i&63488)==55296&&(i=65533);else if(i=this.src.charCodeAt(e-1),(i&64512)==56320){let t=this.src.charCodeAt(e-2);i=(t&64512)==55296?65536+(t-55296<<10)+(i-56320):65533}else(i&64512)==55296&&(i=65533);let a=e;for(;a<n&&this.src.charCodeAt(a)===r;)a++;let o=a-e,s=a<n?this.src.charCodeAt(a):32;if((s&64512)==55296){let e=this.src.charCodeAt(a+1);s=(e&64512)==56320?65536+(s-55296<<10)+(e-56320):65533}else(s&64512)==56320&&(s=65533);let c=Fy(i)||Py(i),l=Fy(s)||Py(s),u=My(i),d=My(s),f=!d&&(!l||u||c),p=!u&&(!c||d||l);return{can_open:f&&(t||!p||c),can_close:p&&(t||!f||l),length:o}},Gb.prototype.Token=qy;function Kb(e){switch(e){case 10:case 33:case 35:case 36:case 37:case 38:case 42:case 43:case 45:case 58:case 60:case 61:case 62:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 125:case 126:return!0;default:return!1}}function qb(e,t){let n=e.pos;for(;n<e.posMax&&!Kb(e.src.charCodeAt(n));)n++;return n===e.pos?!1:(t||(e.pending+=e.src.slice(e.pos,n)),e.pos=n,!0)}var Jb=/(?:^|[^a-z0-9.+-])([a-z][a-z0-9.+-]*)$/i;function Yb(e,t){if(!e.md.options.linkify||e.linkLevel>0)return!1;let n=e.pos,r=e.posMax;if(n+3>r||e.src.charCodeAt(n)!==58||e.src.charCodeAt(n+1)!==47||e.src.charCodeAt(n+2)!==47)return!1;let i=e.pending.match(Jb);if(!i)return!1;let a=i[1],o=e.md.linkify.matchAtStart(e.src.slice(n-a.length));if(!o)return!1;let s=o.url;if(s.length<=a.length)return!1;let c=s.length;for(;c>0&&s.charCodeAt(c-1)===42;)c--;c!==s.length&&(s=s.slice(0,c));let l=e.md.normalizeLink(s);if(!e.md.validateLink(l))return!1;if(!t){e.pending=e.pending.slice(0,-a.length);let t=e.push(`link_open`,`a`,1);t.attrs=[[`href`,l]],t.markup=`linkify`,t.info=`auto`;let n=e.push(`text`,``,0);n.content=e.md.normalizeLinkText(s);let r=e.push(`link_close`,`a`,-1);r.markup=`linkify`,r.info=`auto`}return e.pos+=s.length-a.length,!0}function Xb(e,t){let n=e.pos;if(e.src.charCodeAt(n)!==10)return!1;let r=e.pending.length-1,i=e.posMax;if(!t)if(r>=0&&e.pending.charCodeAt(r)===32)if(r>=1&&e.pending.charCodeAt(r-1)===32){let t=r-1;for(;t>=1&&e.pending.charCodeAt(t-1)===32;)t--;e.pending=e.pending.slice(0,t),e.push(`hardbreak`,`br`,0)}else e.pending=e.pending.slice(0,-1),e.push(`softbreak`,`br`,0);else e.push(`softbreak`,`br`,0);for(n++;n<i&&jy(e.src.charCodeAt(n));)n++;return e.pos=n,!0}var Zb=[];for(let e=0;e<256;e++)Zb.push(0);`\\!"#$%&'()*+,./:;<=>?@[]^_\`{|}~-`.split(``).forEach(function(e){Zb[e.charCodeAt(0)]=1});function Qb(e,t){let n=e.pos,r=e.posMax;if(e.src.charCodeAt(n)!==92||(n++,n>=r))return!1;let i=e.src.charCodeAt(n);if(i===10){for(t||e.push(`hardbreak`,`br`,0),n++;n<r&&(i=e.src.charCodeAt(n),jy(i));)n++;return e.pos=n,!0}if(i===32){if(!t){let t=e.push(`text_special`,``,0);t.content=`\\`,t.markup=`\\`,t.info=`escape`}return e.pos=n,!0}let a=e.src[n];if(i>=55296&&i<=56319&&n+1<r){let t=e.src.charCodeAt(n+1);t>=56320&&t<=57343&&(a+=e.src[n+1],n++)}let o=`\\`+a;if(!t){let t=e.push(`text_special`,``,0);i<256&&Zb[i]!==0?t.content=a:t.content=o,t.markup=o,t.info=`escape`}return e.pos=n+1,!0}function $b(e,t){let n=e.pos;if(e.src.charCodeAt(n)!==96)return!1;let r=n;n++;let i=e.posMax;for(;n<i&&e.src.charCodeAt(n)===96;)n++;let a=e.src.slice(r,n),o=a.length;if(e.backticksScanned&&(e.backticks[o]||0)<=r)return t||(e.pending+=a),e.pos+=o,!0;let s=n,c;for(;(c=e.src.indexOf("`",s))!==-1;){for(s=c+1;s<i&&e.src.charCodeAt(s)===96;)s++;let r=s-c;if(r===o){if(!t){let t=e.push(`code_inline`,`code`,0);t.markup=a,t.content=e.src.slice(n,c).replace(/\n/g,` `).replace(/^ (.+) $/,`$1`)}return e.pos=s,!0}e.backticks[r]=c}return e.backticksScanned=!0,t||(e.pending+=a),e.pos+=o,!0}function ex(e,t){let n=e.pos,r=e.src.charCodeAt(n);if(t||r!==126)return!1;let i=e.scanDelims(e.pos,!0),a=i.length,o=String.fromCharCode(r);if(a<2)return!1;let s;a%2&&(s=e.push(`text`,``,0),s.content=o,a--);for(let t=0;t<a;t+=2)s=e.push(`text`,``,0),s.content=o+o,e.delimiters.push({marker:r,length:0,token:e.tokens.length-1,end:-1,open:i.can_open,close:i.can_close});return e.pos+=i.length,!0}function tx(e,t){let n,r=[],i=t.length;for(let a=0;a<i;a++){let i=t[a];if(i.marker!==126||i.end===-1)continue;let o=t[i.end];n=e.tokens[i.token],n.type=`s_open`,n.tag=`s`,n.nesting=1,n.markup=`~~`,n.content=``,n=e.tokens[o.token],n.type=`s_close`,n.tag=`s`,n.nesting=-1,n.markup=`~~`,n.content=``,e.tokens[o.token-1].type===`text`&&e.tokens[o.token-1].content===`~`&&r.push(o.token-1)}for(;r.length;){let t=r.pop(),i=t+1;for(;i<e.tokens.length&&e.tokens[i].type===`s_close`;)i++;i--,t!==i&&(n=e.tokens[i],e.tokens[i]=e.tokens[t],e.tokens[t]=n)}}function nx(e){let t=e.tokens_meta,n=e.tokens_meta.length;tx(e,e.delimiters);for(let r=0;r<n;r++)t[r]&&t[r].delimiters&&tx(e,t[r].delimiters)}var rx={tokenize:ex,postProcess:nx};function ix(e,t){let n=e.pos,r=e.src.charCodeAt(n);if(t||r!==95&&r!==42)return!1;let i=e.scanDelims(e.pos,r===42);for(let t=0;t<i.length;t++){let t=e.push(`text`,``,0);t.content=String.fromCharCode(r),e.delimiters.push({marker:r,length:i.length,token:e.tokens.length-1,end:-1,open:i.can_open,close:i.can_close})}return e.pos+=i.length,!0}function ax(e,t){let n=t.length;for(let r=n-1;r>=0;r--){let n=t[r];if(n.marker!==95&&n.marker!==42||n.end===-1)continue;let i=t[n.end],a=r>0&&t[r-1].end===n.end+1&&t[r-1].marker===n.marker&&t[r-1].token===n.token-1&&t[n.end+1].token===i.token+1,o=String.fromCharCode(n.marker),s=e.tokens[n.token];s.type=a?`strong_open`:`em_open`,s.tag=a?`strong`:`em`,s.nesting=1,s.markup=a?o+o:o,s.content=``;let c=e.tokens[i.token];c.type=a?`strong_close`:`em_close`,c.tag=a?`strong`:`em`,c.nesting=-1,c.markup=a?o+o:o,c.content=``,a&&(e.tokens[t[r-1].token].content=``,e.tokens[t[n.end+1].token].content=``,r--)}}function ox(e){let t=e.tokens_meta,n=e.tokens_meta.length;ax(e,e.delimiters);for(let r=0;r<n;r++)t[r]&&t[r].delimiters&&ax(e,t[r].delimiters)}var sx={tokenize:ix,postProcess:ox};function cx(e,t){let n,r,i,a,o=``,s=``,c=e.pos,l=!0;if(e.src.charCodeAt(e.pos)!==91)return!1;let u=e.pos,d=e.posMax,f=e.pos+1,p=e.md.helpers.parseLinkLabel(e,e.pos,!0);if(p<0)return!1;let m=p+1;if(m<d&&e.src.charCodeAt(m)===40){for(l=!1,m++;m<d&&(n=e.src.charCodeAt(m),!(!jy(n)&&n!==10));m++);if(m>=d)return!1;if(c=m,i=e.md.helpers.parseLinkDestination(e.src,m,e.posMax),i.ok){for(o=e.md.normalizeLink(i.str),e.md.validateLink(o)?m=i.pos:o=``,c=m;m<d&&(n=e.src.charCodeAt(m),!(!jy(n)&&n!==10));m++);if(i=e.md.helpers.parseLinkTitle(e.src,m,e.posMax),m<d&&c!==m&&i.ok)for(s=i.str,m=i.pos;m<d&&(n=e.src.charCodeAt(m),!(!jy(n)&&n!==10));m++);}(m>=d||e.src.charCodeAt(m)!==41)&&(l=!0),m++}if(l){if(e.env.references===void 0)return!1;if(m<d&&e.src.charCodeAt(m)===91?(c=m+1,m=e.md.helpers.parseLinkLabel(e,m),m>=0?r=e.src.slice(c,m++):m=p+1):m=p+1,r||=e.src.slice(f,p),a=e.env.references[Iy(r)],!a)return e.pos=u,!1;o=a.href,s=a.title}if(!t){e.pos=f,e.posMax=p;let t=e.push(`link_open`,`a`,1),n=[[`href`,o]];t.attrs=n,s&&n.push([`title`,s]),e.linkLevel++,e.md.inline.tokenize(e),e.linkLevel--,e.push(`link_close`,`a`,-1)}return e.pos=m,e.posMax=d,!0}function lx(e,t){let n,r,i,a,o,s,c,l,u=``,d=e.pos,f=e.posMax;if(e.src.charCodeAt(e.pos)!==33||e.src.charCodeAt(e.pos+1)!==91)return!1;let p=e.pos+2,m=e.md.helpers.parseLinkLabel(e,e.pos+1,!1);if(m<0)return!1;if(a=m+1,a<f&&e.src.charCodeAt(a)===40){for(a++;a<f&&(n=e.src.charCodeAt(a),!(!jy(n)&&n!==10));a++);if(a>=f)return!1;for(l=a,s=e.md.helpers.parseLinkDestination(e.src,a,e.posMax),s.ok&&(u=e.md.normalizeLink(s.str),e.md.validateLink(u)?a=s.pos:u=``),l=a;a<f&&(n=e.src.charCodeAt(a),!(!jy(n)&&n!==10));a++);if(s=e.md.helpers.parseLinkTitle(e.src,a,e.posMax),a<f&&l!==a&&s.ok)for(c=s.str,a=s.pos;a<f&&(n=e.src.charCodeAt(a),!(!jy(n)&&n!==10));a++);else c=``;if(a>=f||e.src.charCodeAt(a)!==41)return e.pos=d,!1;a++}else{if(e.env.references===void 0)return!1;if(a<f&&e.src.charCodeAt(a)===91?(l=a+1,a=e.md.helpers.parseLinkLabel(e,a),a>=0?i=e.src.slice(l,a++):a=m+1):a=m+1,i||=e.src.slice(p,m),o=e.env.references[Iy(i)],!o)return e.pos=d,!1;u=o.href,c=o.title}if(!t){r=e.src.slice(p,m);let t=[];e.md.inline.parse(r,e.md,e.env,t);let n=e.push(`image`,`img`,0),i=[[`src`,u],[`alt`,``]];n.attrs=i,n.children=t,n.content=r,c&&i.push([`title`,c])}return e.pos=a,e.posMax=f,!0}var ux=/^([a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)$/,dx=/^([a-zA-Z][a-zA-Z0-9+.-]{1,31}):([^<>\x00-\x20]*)$/;function fx(e,t){let n=e.pos;if(e.src.charCodeAt(n)!==60)return!1;let r=e.pos,i=e.posMax;for(;;){if(++n>=i)return!1;let t=e.src.charCodeAt(n);if(t===60)return!1;if(t===62)break}let a=e.src.slice(r+1,n);if(dx.test(a)){let n=e.md.normalizeLink(a);if(!e.md.validateLink(n))return!1;if(!t){let t=e.push(`link_open`,`a`,1);t.attrs=[[`href`,n]],t.markup=`autolink`,t.info=`auto`;let r=e.push(`text`,``,0);r.content=e.md.normalizeLinkText(a);let i=e.push(`link_close`,`a`,-1);i.markup=`autolink`,i.info=`auto`}return e.pos+=a.length+2,!0}if(ux.test(a)){let n=e.md.normalizeLink(`mailto:`+a);if(!e.md.validateLink(n))return!1;if(!t){let t=e.push(`link_open`,`a`,1);t.attrs=[[`href`,n]],t.markup=`autolink`,t.info=`auto`;let r=e.push(`text`,``,0);r.content=e.md.normalizeLinkText(a);let i=e.push(`link_close`,`a`,-1);i.markup=`autolink`,i.info=`auto`}return e.pos+=a.length+2,!0}return!1}function px(e){return/^<a[>\s]/i.test(e)}function mx(e){return/^<\/a\s*>/i.test(e)}function hx(e){let t=e|32;return t>=97&&t<=122}function gx(e,t){if(!e.md.options.html)return!1;let n=e.posMax,r=e.pos;if(e.src.charCodeAt(r)!==60||r+2>=n)return!1;let i=e.src.charCodeAt(r+1);if(i!==33&&i!==63&&i!==47&&!hx(i))return!1;let a=e.src.slice(r).match(Ib);if(!a)return!1;if(!t){let t=e.push(`html_inline`,``,0);t.content=a[0],px(t.content)&&e.linkLevel++,mx(t.content)&&e.linkLevel--}return e.pos+=a[0].length,!0}var _x=/^&#((?:x[a-f0-9]{1,6}|[0-9]{1,7}));/i,vx=/^&([a-z][a-z0-9]{1,31});/i;function yx(e,t){let n=e.pos,r=e.posMax;if(e.src.charCodeAt(n)!==38||n+1>=r)return!1;if(e.src.charCodeAt(n+1)===35){let r=e.src.slice(n).match(_x);if(r){if(!t){let t=r[1][0].toLowerCase()===`x`?parseInt(r[1].slice(1),16):parseInt(r[1],10),n=e.push(`text_special`,``,0);n.content=gy(t)?_y(t):_y(65533),n.markup=r[0],n.info=`entity`}return e.pos+=r[0].length,!0}}else{let r=e.src.slice(n).match(vx);if(r){let n=cy(r[0]);if(n!==r[0]){if(!t){let t=e.push(`text_special`,``,0);t.content=n,t.markup=r[0],t.info=`entity`}return e.pos+=r[0].length,!0}}}return!1}function bx(e){let t={},n=e.length;if(!n)return;let r=0,i=-2,a=[];for(let o=0;o<n;o++){let n=e[o];if(a.push(0),(e[r].marker!==n.marker||i!==n.token-1)&&(r=o),i=n.token,n.length=n.length||0,!n.close)continue;t.hasOwnProperty(n.marker)||(t[n.marker]=[-1,-1,-1,-1,-1,-1]);let s=t[n.marker][(n.open?3:0)+n.length%3],c=r-a[r]-1,l=c;for(;c>s;c-=a[c]+1){let t=e[c];if(t.marker===n.marker&&t.open&&t.end<0){let r=!1;if((t.close||n.open)&&(t.length+n.length)%3==0&&(t.length%3!=0||n.length%3!=0)&&(r=!0),!r){let r=c>0&&!e[c-1].open?a[c-1]+1:0;a[o]=o-c+r,a[c]=r,n.open=!1,t.end=o,t.close=!1,l=-1,i=-2;break}}}l!==-1&&(t[n.marker][(n.open?3:0)+(n.length||0)%3]=l)}}function xx(e){let t=e.tokens_meta,n=e.tokens_meta.length;bx(e.delimiters);for(let e=0;e<n;e++)t[e]&&t[e].delimiters&&bx(t[e].delimiters)}function Sx(e){let t,n,r=0,i=e.tokens,a=e.tokens.length;for(t=n=0;t<a;t++)i[t].nesting<0&&r--,i[t].level=r,i[t].nesting>0&&r++,i[t].type===`text`&&t+1<a&&i[t+1].type===`text`?i[t+1].content=i[t].content+i[t+1].content:(t!==n&&(i[n]=i[t]),n++);t!==n&&(i.length=n)}var Cx=[[`text`,qb],[`linkify`,Yb],[`newline`,Xb],[`escape`,Qb],[`backticks`,$b],[`strikethrough`,rx.tokenize],[`emphasis`,sx.tokenize],[`link`,cx],[`image`,lx],[`autolink`,fx],[`html_inline`,gx],[`entity`,yx]],wx=[[`balance_pairs`,xx],[`strikethrough`,rx.postProcess],[`emphasis`,sx.postProcess],[`fragments_join`,Sx]];function Tx(){this.ruler=new Ky;for(let e=0;e<Cx.length;e++)this.ruler.push(Cx[e][0],Cx[e][1]);this.ruler2=new Ky;for(let e=0;e<wx.length;e++)this.ruler2.push(wx[e][0],wx[e][1])}Tx.prototype.skipToken=function(e){let t=e.pos,n=this.ruler.getRules(``),r=n.length,i=e.md.options.maxNesting,a=e.cache;if(a[t]!==void 0){e.pos=a[t];return}let o=!1;if(e.level<i){for(let i=0;i<r;i++)if(e.level++,o=n[i](e,!0),e.level--,o){if(t>=e.pos)throw Error(`inline rule didn't increment state.pos`);break}}else e.pos=e.posMax;o||e.pos++,a[t]=e.pos},Tx.prototype.tokenize=function(e){let t=this.ruler.getRules(``),n=t.length,r=e.posMax,i=e.md.options.maxNesting;for(;e.pos<r;){let a=e.pos,o=!1;if(e.level<i){for(let r=0;r<n;r++)if(o=t[r](e,!1),o){if(a>=e.pos)throw Error(`inline rule didn't increment state.pos`);break}}if(o){if(e.pos>=r)break;continue}e.pending+=e.src[e.pos++]}e.pending&&e.pushPending()},Tx.prototype.parse=function(e,t,n,r){let i=new this.State(e,t,n,r);this.tokenize(i);let a=this.ruler2.getRules(``),o=a.length;for(let e=0;e<o;e++)a[e](i)},Tx.prototype.State=Gb;function Ex(e){let t={};e||={},t.src_Any=Iv.source,t.src_Cc=Lv.source,t.src_Z=Vv.source,t.src_P=zv.source,t.src_ZPCc=[t.src_Z,t.src_P,t.src_Cc].join(`|`),t.src_ZCc=[t.src_Z,t.src_Cc].join(`|`);let n=`[><|]`;return t.src_pseudo_letter=`(?:(?!${n}|${t.src_ZPCc})${t.src_Any})`,t.src_ip4=`(?:(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)`,t.src_auth=`(?:(?:(?!${t.src_ZCc}|[@/\\[\\]()]).){1,50}@)?`,t.src_port=`(?::(?:6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))|[1-5]?\\d{1,4}))?`,t.src_host_terminator=`(?=$|${n}|${t.src_ZPCc})(?!${e[`---`]?`-(?!--)|`:`-|`}_|:\\d|\\.-|\\.(?!$|${t.src_ZPCc}))`,t.src_path=`(?:[/?#](?:(?!${t.src_ZCc}|${n}|[()[\\]{}.,"'?!\\-;]).|\\[(?:(?!${t.src_ZCc}|\\]).)*\\]|\\((?:(?!${t.src_ZCc}|[)]).)*\\)|\\{(?:(?!${t.src_ZCc}|[}]).)*\\}|\\"(?:(?!${t.src_ZCc}|["]).)+\\"|\\'(?:(?!${t.src_ZCc}|[']).)+\\'|\\'(?=${t.src_pseudo_letter}|[-])|\\.{2,}[a-zA-Z0-9%/&]|\\.(?!${t.src_ZCc}|[.]|$)|`+(e[`---`]?`\\-(?!--(?:[^-]|$))(?:-*)|`:`\\-+|`)+`,(?!${t.src_ZCc}|$)|;(?!${t.src_ZCc}|$)|\\!+(?!${t.src_ZCc}|[!]|$)|\\?(?!${t.src_ZCc}|[?]|$))+|\\/)?`,t.src_email_name=`[\\-;:&=\\+\\$,\\.a-zA-Z0-9_][\\-;:&=\\+\\$,\\"\\.a-zA-Z0-9_]{0,63}`,t.src_xn=`xn--[a-z0-9\\-]{1,59}`,t.src_domain_root=`(?:`+t.src_xn+`|${t.src_pseudo_letter}{1,63})`,t.src_domain=`(?:`+t.src_xn+`|(?:${t.src_pseudo_letter})|(?:${t.src_pseudo_letter}(?:-|${t.src_pseudo_letter}){0,61}${t.src_pseudo_letter}))`,t.src_host=`(?:(?:(?:(?:${t.src_domain})\\.)*${t.src_domain}))`,t.tpl_host_fuzzy=`(?:`+t.src_ip4+`|(?:(?:(?:${t.src_domain})\\.)+(?:%TLDS%)))`,t.tpl_host_no_ip_fuzzy=`(?:(?:(?:${t.src_domain})\\.)+(?:%TLDS%))`,t.src_host_strict=t.src_host+t.src_host_terminator,t.tpl_host_fuzzy_strict=t.tpl_host_fuzzy+t.src_host_terminator,t.src_host_port_strict=t.src_host+t.src_port+t.src_host_terminator,t.tpl_host_port_fuzzy_strict=t.tpl_host_fuzzy+t.src_port+t.src_host_terminator,t.tpl_host_port_no_ip_fuzzy_strict=t.tpl_host_no_ip_fuzzy+t.src_port+t.src_host_terminator,t.tpl_host_fuzzy_test=`localhost|www\\.|\\.\\d{1,3}\\.|(?:\\.(?:%TLDS%)(?:${t.src_ZPCc}|>|$))`,t.tpl_email_fuzzy=`(^|${n}|"|\\(|${t.src_ZCc})(${t.src_email_name}@${t.tpl_host_fuzzy_strict})`,t.tpl_link_fuzzy=`(^|(?![.:/\\-_@])(?:[$+<=>^\`|\uff5c]|${t.src_ZPCc}))((?![$+<=>^\`|\uff5c])${t.tpl_host_port_fuzzy_strict}${t.src_path})`,t.tpl_link_no_ip_fuzzy=`(^|(?![.:/\\-_@])(?:[$+<=>^\`|\uff5c]|${t.src_ZPCc}))((?![$+<=>^\`|\uff5c])${t.tpl_host_port_no_ip_fuzzy_strict}${t.src_path})`,t}function Dx(e){return Array.prototype.slice.call(arguments,1).forEach(function(t){t&&Object.keys(t).forEach(function(n){e[n]=t[n]})}),e}function Ox(e){return Object.prototype.toString.call(e)}function kx(e){return Ox(e)===`[object String]`}function Ax(e){return Ox(e)===`[object Object]`}function jx(e){return Ox(e)===`[object RegExp]`}function Mx(e){return Ox(e)===`[object Function]`}function Nx(e){return e.replace(/[.?*+^$[\]\\(){}|-]/g,`\\$&`)}var Px={fuzzyLink:!0,fuzzyEmail:!0,fuzzyIP:!1};function Fx(e){return Object.keys(e||{}).reduce(function(e,t){return e||Px.hasOwnProperty(t)},!1)}var Ix={"http:":{validate:function(e,t,n){let r=e.slice(t);return n.re.http||(n.re.http=RegExp(`^\\/\\/${n.re.src_auth}${n.re.src_host_port_strict}${n.re.src_path}`,`i`)),n.re.http.test(r)?r.match(n.re.http)[0].length:0}},"https:":`http:`,"ftp:":`http:`,"//":{validate:function(e,t,n){let r=e.slice(t);return n.re.no_http||(n.re.no_http=RegExp(`^`+n.re.src_auth+`(?:localhost|(?:(?:${n.re.src_domain})\\.)+${n.re.src_domain_root})`+n.re.src_port+n.re.src_host_terminator+n.re.src_path,`i`)),n.re.no_http.test(r)?t>=3&&e[t-3]===`:`||t>=3&&e[t-3]===`/`?0:r.match(n.re.no_http)[0].length:0}},"mailto:":{validate:function(e,t,n){let r=e.slice(t);return n.re.mailto||(n.re.mailto=RegExp(`^${n.re.src_email_name}@${n.re.src_host_strict}`,`i`)),n.re.mailto.test(r)?r.match(n.re.mailto)[0].length:0}}},Lx=`a[cdefgilmnoqrstuwxz]|b[abdefghijmnorstvwyz]|c[acdfghiklmnoruvwxyz]|d[ejkmoz]|e[cegrstu]|f[ijkmor]|g[abdefghilmnpqrstuwy]|h[kmnrtu]|i[delmnoqrst]|j[emop]|k[eghimnprwyz]|l[abcikrstuvy]|m[acdeghklmnopqrstuvwxyz]|n[acefgilopruz]|om|p[aefghklmnrstwy]|qa|r[eosuw]|s[abcdeghijklmnortuvxyz]|t[cdfghjklmnortvwz]|u[agksyz]|v[aceginu]|w[fs]|y[et]|z[amw]`,Rx=`biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф`.split(`|`);function zx(e){return function(t,n){let r=t.slice(n);return e.test(r)?r.match(e)[0].length:0}}function Bx(){return function(e,t){t.normalize(e)}}function Vx(e){let t=e.re=Ex(e.__opts__),n=e.__tlds__.slice();e.onCompile(),e.__tlds_replaced__||n.push(Lx),n.push(t.src_xn),t.src_tlds=n.join(`|`);function r(e){return e.replace(`%TLDS%`,t.src_tlds)}t.email_fuzzy=RegExp(r(t.tpl_email_fuzzy),`i`),t.email_fuzzy_global=RegExp(r(t.tpl_email_fuzzy),`ig`),t.link_fuzzy=RegExp(r(t.tpl_link_fuzzy),`i`),t.link_fuzzy_global=RegExp(r(t.tpl_link_fuzzy),`ig`),t.link_no_ip_fuzzy=RegExp(r(t.tpl_link_no_ip_fuzzy),`i`),t.link_no_ip_fuzzy_global=RegExp(r(t.tpl_link_no_ip_fuzzy),`ig`),t.host_fuzzy_test=RegExp(r(t.tpl_host_fuzzy_test),`i`);let i=[];e.__compiled__={};function a(e,t){throw Error(`(LinkifyIt) Invalid schema "${e}": ${t}`)}Object.keys(e.__schemas__).forEach(function(t){let n=e.__schemas__[t];if(n===null)return;let r={validate:null,link:null};if(e.__compiled__[t]=r,Ax(n)){jx(n.validate)?r.validate=zx(n.validate):Mx(n.validate)?r.validate=n.validate:a(t,n),Mx(n.normalize)?r.normalize=n.normalize:n.normalize?a(t,n):r.normalize=Bx();return}if(kx(n)){i.push(t);return}a(t,n)}),i.forEach(function(t){e.__compiled__[e.__schemas__[t]]&&(e.__compiled__[t].validate=e.__compiled__[e.__schemas__[t]].validate,e.__compiled__[t].normalize=e.__compiled__[e.__schemas__[t]].normalize)}),e.__compiled__[``]={validate:null,normalize:Bx()};let o=Object.keys(e.__compiled__).filter(function(t){return t.length>0&&e.__compiled__[t]}).map(Nx).join(`|`);e.re.schema_test=RegExp(`(^|(?!_)(?:[><\uff5c]|${t.src_ZPCc}))(${o})`,`i`),e.re.schema_search=RegExp(`(^|(?!_)(?:[><\uff5c]|${t.src_ZPCc}))(${o})`,`ig`),e.re.schema_at_start=RegExp(`^${e.re.schema_search.source}`,`i`),e.re.pretest=RegExp(`(${e.re.schema_test.source})|(${e.re.host_fuzzy_test.source})|@`,`i`)}function Hx(e,t,n,r){let i=e.slice(n,r);this.schema=t.toLowerCase(),this.index=n,this.lastIndex=r,this.raw=i,this.text=i,this.url=i}function Ux(e,t){if(!(this instanceof Ux))return new Ux(e,t);t||Fx(e)&&(t=e,e={}),this.__opts__=Dx({},Px,t),this.__schemas__=Dx({},Ix,e),this.__compiled__={},this.__tlds__=Rx,this.__tlds_replaced__=!1,this.re={},Vx(this)}Ux.prototype.add=function(e,t){return this.__schemas__[e]=t,Vx(this),this},Ux.prototype.set=function(e){return this.__opts__=Dx(this.__opts__,e),this},Ux.prototype.test=function(e){if(!e.length)return!1;let t,n;if(this.re.schema_test.test(e)){for(n=this.re.schema_search,n.lastIndex=0;(t=n.exec(e))!==null;)if(this.testSchemaAt(e,t[2],n.lastIndex))return!0}return!!(this.__opts__.fuzzyLink&&this.__compiled__[`http:`]&&e.search(this.re.host_fuzzy_test)>=0&&e.match(this.__opts__.fuzzyIP?this.re.link_fuzzy:this.re.link_no_ip_fuzzy)!==null||this.__opts__.fuzzyEmail&&this.__compiled__[`mailto:`]&&e.indexOf(`@`)>=0&&e.match(this.re.email_fuzzy)!==null)},Ux.prototype.pretest=function(e){return this.re.pretest.test(e)},Ux.prototype.testSchemaAt=function(e,t,n){return this.__compiled__[t.toLowerCase()]?this.__compiled__[t.toLowerCase()].validate(e,n,this):0},Ux.prototype.match=function(e){let t=[],n=[],r=[],i=[],a,o,s;function c(e,t){return e?t?e.index===t.index?e.lastIndex>=t.lastIndex?e:t:e.index<t.index?e:t:e:t}if(!e.length)return null;if(this.re.schema_test.test(e))for(s=this.re.schema_search,s.lastIndex=0;(a=s.exec(e))!==null;)o=this.testSchemaAt(e,a[2],s.lastIndex),o&&n.push({schema:a[2],index:a.index+a[1].length,lastIndex:a.index+a[0].length+o});if(this.__opts__.fuzzyLink&&this.__compiled__[`http:`])for(s=this.__opts__.fuzzyIP?this.re.link_fuzzy_global:this.re.link_no_ip_fuzzy_global,s.lastIndex=0;(a=s.exec(e))!==null;)r.push({schema:``,index:a.index+a[1].length,lastIndex:a.index+a[0].length});if(this.__opts__.fuzzyEmail&&this.__compiled__[`mailto:`])for(s=this.re.email_fuzzy_global,s.lastIndex=0;(a=s.exec(e))!==null;)i.push({schema:`mailto:`,index:a.index+a[1].length,lastIndex:a.index+a[0].length});let l=[0,0,0],u=0;for(;;){let a=[n[l[0]],i[l[1]],r[l[2]]],o=c(c(a[0],a[1]),a[2]);if(!o)break;if(o===a[0]?l[0]++:o===a[1]?l[1]++:l[2]++,o.index<u)continue;let s=new Hx(e,o.schema,o.index,o.lastIndex);this.__compiled__[s.schema].normalize(s,this),t.push(s),u=o.lastIndex}return t.length?t:null},Ux.prototype.matchAtStart=function(e){if(!e.length)return null;let t=this.re.schema_at_start.exec(e);if(!t)return null;let n=this.testSchemaAt(e,t[2],t[0].length);if(!n)return null;let r=new Hx(e,t[2],t.index+t[1].length,t.index+t[0].length+n);return this.__compiled__[r.schema].normalize(r,this),r},Ux.prototype.tlds=function(e,t){return e=Array.isArray(e)?e:[e],t?(this.__tlds__=this.__tlds__.concat(e).sort().filter(function(e,t,n){return e!==n[t-1]}).reverse(),Vx(this),this):(this.__tlds__=e.slice(),this.__tlds_replaced__=!0,Vx(this),this)},Ux.prototype.normalize=function(e){e.schema||(e.url=`http://${e.url}`),e.schema===`mailto:`&&!/^mailto:/i.test(e.url)&&(e.url=`mailto:${e.url}`)},Ux.prototype.onCompile=function(){};var Wx=2147483647,Gx=36,Kx=1,qx=26,Jx=38,Yx=700,Xx=72,Zx=128,Qx=`-`,$x=/^xn--/,eS=/[^\0-\x7F]/,tS=/[\x2E\u3002\uFF0E\uFF61]/g,nS={overflow:`Overflow: input needs wider integers to process`,"not-basic":`Illegal input >= 0x80 (not a basic code point)`,"invalid-input":`Invalid input`},rS=Gx-Kx,iS=Math.floor,aS=String.fromCharCode;function oS(e){throw RangeError(nS[e])}function sS(e,t){let n=[],r=e.length;for(;r--;)n[r]=t(e[r]);return n}function cS(e,t){let n=e.split(`@`),r=``;n.length>1&&(r=n[0]+`@`,e=n[1]),e=e.replace(tS,`.`);let i=sS(e.split(`.`),t).join(`.`);return r+i}function lS(e){let t=[],n=0,r=e.length;for(;n<r;){let i=e.charCodeAt(n++);if(i>=55296&&i<=56319&&n<r){let r=e.charCodeAt(n++);(r&64512)==56320?t.push(((i&1023)<<10)+(r&1023)+65536):(t.push(i),n--)}else t.push(i)}return t}var uS=e=>String.fromCodePoint(...e),dS=function(e){return e>=48&&e<58?26+(e-48):e>=65&&e<91?e-65:e>=97&&e<123?e-97:Gx},fS=function(e,t){return e+22+75*(e<26)-((t!=0)<<5)},pS=function(e,t,n){let r=0;for(e=n?iS(e/Yx):e>>1,e+=iS(e/t);e>455;r+=Gx)e=iS(e/rS);return iS(r+36*e/(e+Jx))},mS=function(e){let t=[],n=e.length,r=0,i=Zx,a=Xx,o=e.lastIndexOf(Qx);o<0&&(o=0);for(let n=0;n<o;++n)e.charCodeAt(n)>=128&&oS(`not-basic`),t.push(e.charCodeAt(n));for(let s=o>0?o+1:0;s<n;){let o=r;for(let t=1,i=Gx;;i+=Gx){s>=n&&oS(`invalid-input`);let o=dS(e.charCodeAt(s++));o>=Gx&&oS(`invalid-input`),o>iS((Wx-r)/t)&&oS(`overflow`),r+=o*t;let c=i<=a?Kx:i>=a+qx?qx:i-a;if(o<c)break;let l=Gx-c;t>iS(Wx/l)&&oS(`overflow`),t*=l}let c=t.length+1;a=pS(r-o,c,o==0),iS(r/c)>Wx-i&&oS(`overflow`),i+=iS(r/c),r%=c,t.splice(r++,0,i)}return String.fromCodePoint(...t)},hS=function(e){let t=[];e=lS(e);let n=e.length,r=Zx,i=0,a=Xx;for(let n of e)n<128&&t.push(aS(n));let o=t.length,s=o;for(o&&t.push(Qx);s<n;){let n=Wx;for(let t of e)t>=r&&t<n&&(n=t);let c=s+1;n-r>iS((Wx-i)/c)&&oS(`overflow`),i+=(n-r)*c,r=n;for(let n of e)if(n<r&&++i>Wx&&oS(`overflow`),n===r){let e=i;for(let n=Gx;;n+=Gx){let r=n<=a?Kx:n>=a+qx?qx:n-a;if(e<r)break;let i=e-r,o=Gx-r;t.push(aS(fS(r+i%o,0))),e=iS(i/o)}t.push(aS(fS(e,0))),a=pS(i,c,s===o),i=0,++s}++i,++r}return t.join(``)},gS={version:`2.3.1`,ucs2:{decode:lS,encode:uS},decode:mS,encode:hS,toASCII:function(e){return cS(e,function(e){return eS.test(e)?`xn--`+hS(e):e})},toUnicode:function(e){return cS(e,function(e){return $x.test(e)?mS(e.slice(4).toLowerCase()):e})}},_S={default:{options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:`language-`,linkify:!1,typographer:!1,quotes:`“”‘’`,highlight:null,maxNesting:100},components:{core:{},block:{},inline:{}}},zero:{options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:`language-`,linkify:!1,typographer:!1,quotes:`“”‘’`,highlight:null,maxNesting:20},components:{core:{rules:[`normalize`,`block`,`inline`,`text_join`]},block:{rules:[`paragraph`]},inline:{rules:[`text`],rules2:[`balance_pairs`,`fragments_join`]}}},commonmark:{options:{html:!0,xhtmlOut:!0,breaks:!1,langPrefix:`language-`,linkify:!1,typographer:!1,quotes:`“”‘’`,highlight:null,maxNesting:20},components:{core:{rules:[`normalize`,`block`,`inline`,`text_join`]},block:{rules:[`blockquote`,`code`,`fence`,`heading`,`hr`,`html_block`,`lheading`,`list`,`reference`,`paragraph`]},inline:{rules:[`autolink`,`backticks`,`emphasis`,`entity`,`escape`,`html_inline`,`image`,`link`,`newline`,`text`],rules2:[`balance_pairs`,`emphasis`,`fragments_join`]}}}},vS=/^(vbscript|javascript|file|data):/,yS=/^data:image\/(gif|png|jpeg|webp);/;function bS(e){let t=e.trim().toLowerCase();return!vS.test(t)||yS.test(t)}var xS=[`http:`,`https:`,`mailto:`];function SS(e){let t=Pv(e,!0);if(t.hostname&&(!t.protocol||xS.indexOf(t.protocol)>=0))try{t.hostname=gS.toASCII(t.hostname)}catch{}return xv(Sv(t))}function CS(e){let t=Pv(e,!0);if(t.hostname&&(!t.protocol||xS.indexOf(t.protocol)>=0))try{t.hostname=gS.toUnicode(t.hostname)}catch{}return vv(Sv(t),vv.defaultChars+`%`)}function wS(e,t){if(!(this instanceof wS))return new wS(e,t);t||dy(e)||(t=e||{},e=`default`),this.inline=new Tx,this.block=new Wb,this.core=new bb,this.renderer=new Gy,this.linkify=new Ux,this.validateLink=bS,this.normalizeLink=SS,this.normalizeLinkText=CS,this.utils=ly,this.helpers=my({},Uy),this.options={},this.configure(e),t&&this.set(t)}wS.prototype.set=function(e){return my(this.options,e),this},wS.prototype.configure=function(e){let t=this;if(dy(e)){let t=e;if(e=_S[t],!e)throw Error('Wrong `markdown-it` preset "'+t+`", check name`)}if(!e)throw Error("Wrong `markdown-it` preset, can't be empty");return e.options&&t.set(e.options),e.components&&Object.keys(e.components).forEach(function(n){e.components[n].rules&&t[n].ruler.enableOnly(e.components[n].rules),e.components[n].rules2&&t[n].ruler2.enableOnly(e.components[n].rules2)}),this},wS.prototype.enable=function(e,t){let n=[];Array.isArray(e)||(e=[e]),[`core`,`block`,`inline`].forEach(function(t){n=n.concat(this[t].ruler.enable(e,!0))},this),n=n.concat(this.inline.ruler2.enable(e,!0));let r=e.filter(function(e){return n.indexOf(e)<0});if(r.length&&!t)throw Error(`MarkdownIt. Failed to enable unknown rule(s): `+r);return this},wS.prototype.disable=function(e,t){let n=[];Array.isArray(e)||(e=[e]),[`core`,`block`,`inline`].forEach(function(t){n=n.concat(this[t].ruler.disable(e,!0))},this),n=n.concat(this.inline.ruler2.disable(e,!0));let r=e.filter(function(e){return n.indexOf(e)<0});if(r.length&&!t)throw Error(`MarkdownIt. Failed to disable unknown rule(s): `+r);return this},wS.prototype.use=function(e){let t=[this].concat(Array.prototype.slice.call(arguments,1));return e.apply(e,t),this},wS.prototype.parse=function(e,t){if(typeof e!=`string`)throw Error(`Input data should be a String`);let n=new this.core.State(e,this,t);return this.core.process(n),n.tokens},wS.prototype.render=function(e,t){return t||={},this.renderer.render(this.parse(e,t),this.options,t)},wS.prototype.parseInline=function(e,t){let n=new this.core.State(e,this,t);return n.inlineMode=!0,this.core.process(n),n.tokens},wS.prototype.renderInline=function(e,t){return t||={},this.renderer.render(this.parseInline(e,t),this.options,t)};var TS=l(o(((e,t)=>{function n(e){return e instanceof Map?e.clear=e.delete=e.set=function(){throw Error(`map is read-only`)}:e instanceof Set&&(e.add=e.clear=e.delete=function(){throw Error(`set is read-only`)}),Object.freeze(e),Object.getOwnPropertyNames(e).forEach(t=>{let r=e[t],i=typeof r;(i===`object`||i===`function`)&&!Object.isFrozen(r)&&n(r)}),e}var r=class{constructor(e){e.data===void 0&&(e.data={}),this.data=e.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}};function i(e){return e.replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`).replace(/"/g,`"`).replace(/'/g,`'`)}function a(e,...t){let n=Object.create(null);for(let t in e)n[t]=e[t];return t.forEach(function(e){for(let t in e)n[t]=e[t]}),n}var o=`</span>`,s=e=>!!e.scope,c=(e,{prefix:t})=>{if(e.startsWith(`language:`))return e.replace(`language:`,`language-`);if(e.includes(`.`)){let n=e.split(`.`);return[`${t}${n.shift()}`,...n.map((e,t)=>`${e}${`_`.repeat(t+1)}`)].join(` `)}return`${t}${e}`},l=class{constructor(e,t){this.buffer=``,this.classPrefix=t.classPrefix,e.walk(this)}addText(e){this.buffer+=i(e)}openNode(e){if(!s(e))return;let t=c(e.scope,{prefix:this.classPrefix});this.span(t)}closeNode(e){s(e)&&(this.buffer+=o)}value(){return this.buffer}span(e){this.buffer+=`<span class="${e}">`}},u=(e={})=>{let t={children:[]};return Object.assign(t,e),t},d=class e{constructor(){this.rootNode=u(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(e){this.top.children.push(e)}openNode(e){let t=u({scope:e});this.add(t),this.stack.push(t)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(e){return this.constructor._walk(e,this.rootNode)}static _walk(e,t){return typeof t==`string`?e.addText(t):t.children&&(e.openNode(t),t.children.forEach(t=>this._walk(e,t)),e.closeNode(t)),e}static _collapse(t){typeof t!=`string`&&t.children&&(t.children.every(e=>typeof e==`string`)?t.children=[t.children.join(``)]:t.children.forEach(t=>{e._collapse(t)}))}},f=class extends d{constructor(e){super(),this.options=e}addText(e){e!==``&&this.add(e)}startScope(e){this.openNode(e)}endScope(){this.closeNode()}__addSublanguage(e,t){let n=e.root;t&&(n.scope=`language:${t}`),this.add(n)}toHTML(){return new l(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}};function p(e){return e?typeof e==`string`?e:e.source:null}function m(e){return _(`(?=`,e,`)`)}function h(e){return _(`(?:`,e,`)*`)}function g(e){return _(`(?:`,e,`)?`)}function _(...e){return e.map(e=>p(e)).join(``)}function v(e){let t=e[e.length-1];return typeof t==`object`&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function y(...e){return`(`+(v(e).capture?``:`?:`)+e.map(e=>p(e)).join(`|`)+`)`}function b(e){return RegExp(e.toString()+`|`).exec(``).length-1}function x(e,t){let n=e&&e.exec(t);return n&&n.index===0}var S=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function C(e,{joinWith:t}){let n=0;return e.map(e=>{n+=1;let t=n,r=p(e),i=``;for(;r.length>0;){let e=S.exec(r);if(!e){i+=r;break}i+=r.substring(0,e.index),r=r.substring(e.index+e[0].length),e[0][0]===`\\`&&e[1]?i+=`\\`+String(Number(e[1])+t):(i+=e[0],e[0]===`(`&&n++)}return i}).map(e=>`(${e})`).join(t)}var w=/\b\B/,T=`[a-zA-Z]\\w*`,E=`[a-zA-Z_]\\w*`,D=`\\b\\d+(\\.\\d+)?`,O=`(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)`,k=`\\b(0b[01]+)`,A=`!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~`,j=(e={})=>{let t=/^#![ ]*\//;return e.binary&&(e.begin=_(t,/.*\b/,e.binary,/\b.*/)),a({scope:`meta`,begin:t,end:/$/,relevance:0,"on:begin":(e,t)=>{e.index!==0&&t.ignoreMatch()}},e)},M={begin:`\\\\[\\s\\S]`,relevance:0},N={scope:`string`,begin:`'`,end:`'`,illegal:`\\n`,contains:[M]},P={scope:`string`,begin:`"`,end:`"`,illegal:`\\n`,contains:[M]},F={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},I=function(e,t,n={}){let r=a({scope:`comment`,begin:e,end:t,contains:[]},n);r.contains.push({scope:`doctag`,begin:`[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)`,end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});let i=y(`I`,`a`,`is`,`so`,`us`,`to`,`at`,`if`,`in`,`it`,`on`,/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return r.contains.push({begin:_(/[ ]+/,`(`,i,/[.]?[:]?([.][ ]|[ ])/,`){3}`)}),r},L=I(`//`,`$`),ee=I(`/\\*`,`\\*/`),te=I(`#`,`$`),ne=Object.freeze({__proto__:null,APOS_STRING_MODE:N,BACKSLASH_ESCAPE:M,BINARY_NUMBER_MODE:{scope:`number`,begin:k,relevance:0},BINARY_NUMBER_RE:k,COMMENT:I,C_BLOCK_COMMENT_MODE:ee,C_LINE_COMMENT_MODE:L,C_NUMBER_MODE:{scope:`number`,begin:O,relevance:0},C_NUMBER_RE:O,END_SAME_AS_BEGIN:function(e){return Object.assign(e,{"on:begin":(e,t)=>{t.data._beginMatch=e[1]},"on:end":(e,t)=>{t.data._beginMatch!==e[1]&&t.ignoreMatch()}})},HASH_COMMENT_MODE:te,IDENT_RE:T,MATCH_NOTHING_RE:w,METHOD_GUARD:{begin:`\\.\\s*[a-zA-Z_]\\w*`,relevance:0},NUMBER_MODE:{scope:`number`,begin:D,relevance:0},NUMBER_RE:D,PHRASAL_WORDS_MODE:F,QUOTE_STRING_MODE:P,REGEXP_MODE:{scope:`regexp`,begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[M,{begin:/\[/,end:/\]/,relevance:0,contains:[M]}]},RE_STARTERS_RE:A,SHEBANG:j,TITLE_MODE:{scope:`title`,begin:T,relevance:0},UNDERSCORE_IDENT_RE:E,UNDERSCORE_TITLE_MODE:{scope:`title`,begin:E,relevance:0}});function re(e,t){e.input[e.index-1]===`.`&&t.ignoreMatch()}function ie(e,t){e.className!==void 0&&(e.scope=e.className,delete e.className)}function R(e,t){t&&e.beginKeywords&&(e.begin=`\\b(`+e.beginKeywords.split(` `).join(`|`)+`)(?!\\.)(?=\\b|\\s)`,e.__beforeBegin=re,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,e.relevance===void 0&&(e.relevance=0))}function ae(e,t){Array.isArray(e.illegal)&&(e.illegal=y(...e.illegal))}function oe(e,t){if(e.match){if(e.begin||e.end)throw Error(`begin & end are not supported with match`);e.begin=e.match,delete e.match}}function z(e,t){e.relevance===void 0&&(e.relevance=1)}var se=(e,t)=>{if(!e.beforeMatch)return;if(e.starts)throw Error(`beforeMatch cannot be used with starts`);let n=Object.assign({},e);Object.keys(e).forEach(t=>{delete e[t]}),e.keywords=n.keywords,e.begin=_(n.beforeMatch,m(n.begin)),e.starts={relevance:0,contains:[Object.assign(n,{endsParent:!0})]},e.relevance=0,delete n.beforeMatch},ce=[`of`,`and`,`for`,`in`,`not`,`or`,`if`,`then`,`parent`,`list`,`value`],le=`keyword`;function ue(e,t,n=le){let r=Object.create(null);return typeof e==`string`?i(n,e.split(` `)):Array.isArray(e)?i(n,e):Object.keys(e).forEach(function(n){Object.assign(r,ue(e[n],t,n))}),r;function i(e,n){t&&(n=n.map(e=>e.toLowerCase())),n.forEach(function(t){let n=t.split(`|`);r[n[0]]=[e,de(n[0],n[1])]})}}function de(e,t){return t?Number(t):+!fe(e)}function fe(e){return ce.includes(e.toLowerCase())}var pe={},me=e=>{console.error(e)},he=(e,...t)=>{console.log(`WARN: ${e}`,...t)},ge=(e,t)=>{pe[`${e}/${t}`]||(console.log(`Deprecated as of ${e}. ${t}`),pe[`${e}/${t}`]=!0)},_e=Error();function ve(e,t,{key:n}){let r=0,i=e[n],a={},o={};for(let e=1;e<=t.length;e++)o[e+r]=i[e],a[e+r]=!0,r+=b(t[e-1]);e[n]=o,e[n]._emit=a,e[n]._multi=!0}function ye(e){if(Array.isArray(e.begin)){if(e.skip||e.excludeBegin||e.returnBegin)throw me(`skip, excludeBegin, returnBegin not compatible with beginScope: {}`),_e;if(typeof e.beginScope!=`object`||e.beginScope===null)throw me(`beginScope must be object`),_e;ve(e,e.begin,{key:`beginScope`}),e.begin=C(e.begin,{joinWith:``})}}function be(e){if(Array.isArray(e.end)){if(e.skip||e.excludeEnd||e.returnEnd)throw me(`skip, excludeEnd, returnEnd not compatible with endScope: {}`),_e;if(typeof e.endScope!=`object`||e.endScope===null)throw me(`endScope must be object`),_e;ve(e,e.end,{key:`endScope`}),e.end=C(e.end,{joinWith:``})}}function xe(e){e.scope&&typeof e.scope==`object`&&e.scope!==null&&(e.beginScope=e.scope,delete e.scope)}function Se(e){xe(e),typeof e.beginScope==`string`&&(e.beginScope={_wrap:e.beginScope}),typeof e.endScope==`string`&&(e.endScope={_wrap:e.endScope}),ye(e),be(e)}function Ce(e){function t(t,n){return new RegExp(p(t),`m`+(e.case_insensitive?`i`:``)+(e.unicodeRegex?`u`:``)+(n?`g`:``))}class n{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(e,t){t.position=this.position++,this.matchIndexes[this.matchAt]=t,this.regexes.push([t,e]),this.matchAt+=b(e)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);let e=this.regexes.map(e=>e[1]);this.matcherRe=t(C(e,{joinWith:`|`}),!0),this.lastIndex=0}exec(e){this.matcherRe.lastIndex=this.lastIndex;let t=this.matcherRe.exec(e);if(!t)return null;let n=t.findIndex((e,t)=>t>0&&e!==void 0),r=this.matchIndexes[n];return t.splice(0,n),Object.assign(t,r)}}class r{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(e){if(this.multiRegexes[e])return this.multiRegexes[e];let t=new n;return this.rules.slice(e).forEach(([e,n])=>t.addRule(e,n)),t.compile(),this.multiRegexes[e]=t,t}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(e,t){this.rules.push([e,t]),t.type===`begin`&&this.count++}exec(e){let t=this.getMatcher(this.regexIndex);t.lastIndex=this.lastIndex;let n=t.exec(e);if(this.resumingScanAtSamePosition()&&!(n&&n.index===this.lastIndex)){let t=this.getMatcher(0);t.lastIndex=this.lastIndex+1,n=t.exec(e)}return n&&(this.regexIndex+=n.position+1,this.regexIndex===this.count&&this.considerAll()),n}}function i(e){let t=new r;return e.contains.forEach(e=>t.addRule(e.begin,{rule:e,type:`begin`})),e.terminatorEnd&&t.addRule(e.terminatorEnd,{type:`end`}),e.illegal&&t.addRule(e.illegal,{type:`illegal`}),t}function o(n,r){let a=n;if(n.isCompiled)return a;[ie,oe,Se,se].forEach(e=>e(n,r)),e.compilerExtensions.forEach(e=>e(n,r)),n.__beforeBegin=null,[R,ae,z].forEach(e=>e(n,r)),n.isCompiled=!0;let s=null;return typeof n.keywords==`object`&&n.keywords.$pattern&&(n.keywords=Object.assign({},n.keywords),s=n.keywords.$pattern,delete n.keywords.$pattern),s||=/\w+/,n.keywords&&=ue(n.keywords,e.case_insensitive),a.keywordPatternRe=t(s,!0),r&&(n.begin||=/\B|\b/,a.beginRe=t(a.begin),!n.end&&!n.endsWithParent&&(n.end=/\B|\b/),n.end&&(a.endRe=t(a.end)),a.terminatorEnd=p(a.end)||``,n.endsWithParent&&r.terminatorEnd&&(a.terminatorEnd+=(n.end?`|`:``)+r.terminatorEnd)),n.illegal&&(a.illegalRe=t(n.illegal)),n.contains||=[],n.contains=[].concat(...n.contains.map(function(e){return Te(e===`self`?n:e)})),n.contains.forEach(function(e){o(e,a)}),n.starts&&o(n.starts,r),a.matcher=i(a),a}if(e.compilerExtensions||=[],e.contains&&e.contains.includes(`self`))throw Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return e.classNameAliases=a(e.classNameAliases||{}),o(e)}function we(e){return e?e.endsWithParent||we(e.starts):!1}function Te(e){return e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map(function(t){return a(e,{variants:null},t)})),e.cachedVariants?e.cachedVariants:we(e)?a(e,{starts:e.starts?a(e.starts):null}):Object.isFrozen(e)?a(e):e}var Ee=`11.11.1`,De=class extends Error{constructor(e,t){super(e),this.name=`HTMLInjectionError`,this.html=t}},Oe=i,ke=a,Ae=Symbol(`nomatch`),je=7,Me=function(e){let t=Object.create(null),i=Object.create(null),a=[],o=!0,s=`Could not find the language '{}', did you forget to load/include a language module?`,c={disableAutodetect:!0,name:`Plain text`,contains:[]},l={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:`hljs-`,cssSelector:`pre code`,languages:null,__emitter:f};function u(e){return l.noHighlightRe.test(e)}function d(e){let t=e.className+` `;t+=e.parentNode?e.parentNode.className:``;let n=l.languageDetectRe.exec(t);if(n){let t=N(n[1]);return t||(he(s.replace(`{}`,n[1])),he(`Falling back to no-highlight mode for this block.`,e)),t?n[1]:`no-highlight`}return t.split(/\s+/).find(e=>u(e)||N(e))}function p(e,t,n){let r=``,i=``;typeof t==`object`?(r=e,n=t.ignoreIllegals,i=t.language):(ge(`10.7.0`,`highlight(lang, code, ...args) has been deprecated.`),ge(`10.7.0`,`Please use highlight(code, options) instead.
|
|
62
|
+
`:`>`,i},Ky.prototype.renderInline=function(e,t,n){let r=``,i=this.rules;for(let a=0,o=e.length;a<o;a++){let o=e[a].type;i[o]===void 0?r+=this.renderToken(e,a,t):r+=i[o](e,a,t,n,this)}return r},Ky.prototype.renderInlineAsText=function(e,t,n){let r=``;for(let i=0,a=e.length;i<a;i++)switch(e[i].type){case`text`:r+=e[i].content;break;case`image`:r+=this.renderInlineAsText(e[i].children,t,n);break;case`html_inline`:case`html_block`:r+=e[i].content;break;case`softbreak`:case`hardbreak`:r+=`
|
|
63
|
+
`;break;default:}return r},Ky.prototype.render=function(e,t,n){let r=``,i=this.rules;for(let a=0,o=e.length;a<o;a++){let o=e[a].type;o===`inline`?r+=this.renderInline(e[a].children,t,n):i[o]===void 0?r+=this.renderToken(e,a,t,n):r+=i[o](e,a,t,n,this)}return r};function qy(){this.__rules__=[],this.__cache__=null}qy.prototype.__find__=function(e){for(let t=0;t<this.__rules__.length;t++)if(this.__rules__[t].name===e)return t;return-1},qy.prototype.__compile__=function(){let e=this,t=[``];e.__rules__.forEach(function(e){e.enabled&&e.alt.forEach(function(e){t.indexOf(e)<0&&t.push(e)})}),e.__cache__={},t.forEach(function(t){e.__cache__[t]=[],e.__rules__.forEach(function(n){n.enabled&&(t&&n.alt.indexOf(t)<0||e.__cache__[t].push(n.fn))})})},qy.prototype.at=function(e,t,n){let r=this.__find__(e),i=n||{};if(r===-1)throw Error(`Parser rule not found: `+e);this.__rules__[r].fn=t,this.__rules__[r].alt=i.alt||[],this.__cache__=null},qy.prototype.before=function(e,t,n,r){let i=this.__find__(e),a=r||{};if(i===-1)throw Error(`Parser rule not found: `+e);this.__rules__.splice(i,0,{name:t,enabled:!0,fn:n,alt:a.alt||[]}),this.__cache__=null},qy.prototype.after=function(e,t,n,r){let i=this.__find__(e),a=r||{};if(i===-1)throw Error(`Parser rule not found: `+e);this.__rules__.splice(i+1,0,{name:t,enabled:!0,fn:n,alt:a.alt||[]}),this.__cache__=null},qy.prototype.push=function(e,t,n){let r=n||{};this.__rules__.push({name:e,enabled:!0,fn:t,alt:r.alt||[]}),this.__cache__=null},qy.prototype.enable=function(e,t){Array.isArray(e)||(e=[e]);let n=[];return e.forEach(function(e){let r=this.__find__(e);if(r<0){if(t)return;throw Error(`Rules manager: invalid rule name `+e)}this.__rules__[r].enabled=!0,n.push(e)},this),this.__cache__=null,n},qy.prototype.enableOnly=function(e,t){Array.isArray(e)||(e=[e]),this.__rules__.forEach(function(e){e.enabled=!1}),this.enable(e,t)},qy.prototype.disable=function(e,t){Array.isArray(e)||(e=[e]);let n=[];return e.forEach(function(e){let r=this.__find__(e);if(r<0){if(t)return;throw Error(`Rules manager: invalid rule name `+e)}this.__rules__[r].enabled=!1,n.push(e)},this),this.__cache__=null,n},qy.prototype.getRules=function(e){return this.__cache__===null&&this.__compile__(),this.__cache__[e]||[]};function Jy(e,t,n){this.type=e,this.tag=t,this.attrs=null,this.map=null,this.nesting=n,this.level=0,this.children=null,this.content=``,this.markup=``,this.info=``,this.meta=null,this.block=!1,this.hidden=!1}Jy.prototype.attrIndex=function(e){if(!this.attrs)return-1;let t=this.attrs;for(let n=0,r=t.length;n<r;n++)if(t[n][0]===e)return n;return-1},Jy.prototype.attrPush=function(e){this.attrs?this.attrs.push(e):this.attrs=[e]},Jy.prototype.attrSet=function(e,t){let n=this.attrIndex(e),r=[e,t];n<0?this.attrPush(r):this.attrs[n]=r},Jy.prototype.attrGet=function(e){let t=this.attrIndex(e),n=null;return t>=0&&(n=this.attrs[t][1]),n},Jy.prototype.attrJoin=function(e,t){let n=this.attrIndex(e);n<0?this.attrPush([e,t]):this.attrs[n][1]=this.attrs[n][1]+` `+t};function Yy(e,t,n){this.src=e,this.env=n,this.tokens=[],this.inlineMode=!1,this.md=t}Yy.prototype.Token=Jy;var Xy=/\r\n?|\n/g,Zy=/\0/g;function Qy(e){let t;t=e.src.replace(Xy,`
|
|
64
|
+
`),t=t.replace(Zy,`�`),e.src=t}function $y(e){let t;e.inlineMode?(t=new e.Token(`inline`,``,0),t.content=e.src,t.map=[0,1],t.children=[],e.tokens.push(t)):e.md.block.parse(e.src,e.md,e.env,e.tokens)}function eb(e){let t=e.tokens;for(let n=0,r=t.length;n<r;n++){let r=t[n];r.type===`inline`&&e.md.inline.parse(r.content,e.md,e.env,r.children)}}function tb(e){return/^<a[>\s]/i.test(e)}function nb(e){return/^<\/a\s*>/i.test(e)}function rb(e){let t=e.tokens;if(e.md.options.linkify)for(let n=0,r=t.length;n<r;n++){if(t[n].type!==`inline`||!e.md.linkify.pretest(t[n].content))continue;let r=t[n].children,i=0;for(let a=r.length-1;a>=0;a--){let o=r[a];if(o.type===`link_close`){for(a--;r[a].level!==o.level&&r[a].type!==`link_open`;)a--;continue}if(o.type===`html_inline`&&(tb(o.content)&&i>0&&i--,nb(o.content)&&i++),!(i>0)&&o.type===`text`&&e.md.linkify.test(o.content)){let i=o.content,s=e.md.linkify.match(i),c=[],l=o.level,u=0;s.length>0&&s[0].index===0&&a>0&&r[a-1].type===`text_special`&&(s=s.slice(1));for(let t=0;t<s.length;t++){let n=s[t].url,r=e.md.normalizeLink(n);if(!e.md.validateLink(r))continue;let a=s[t].text;a=s[t].schema?s[t].schema===`mailto:`&&!/^mailto:/i.test(a)?e.md.normalizeLinkText(`mailto:`+a).replace(/^mailto:/,``):e.md.normalizeLinkText(a):e.md.normalizeLinkText(`http://`+a).replace(/^http:\/\//,``);let o=s[t].index;if(o>u){let t=new e.Token(`text`,``,0);t.content=i.slice(u,o),t.level=l,c.push(t)}let d=new e.Token(`link_open`,`a`,1);d.attrs=[[`href`,r]],d.level=l++,d.markup=`linkify`,d.info=`auto`,c.push(d);let f=new e.Token(`text`,``,0);f.content=a,f.level=l,c.push(f);let p=new e.Token(`link_close`,`a`,-1);p.level=--l,p.markup=`linkify`,p.info=`auto`,c.push(p),u=s[t].lastIndex}if(u<i.length){let t=new e.Token(`text`,``,0);t.content=i.slice(u),t.level=l,c.push(t)}t[n].children=r=gy(r,a,c)}}}}var ib=/\+-|\.\.|\?\?\?\?|!!!!|,,|--/,ab=/\((c|tm|r)\)/i,ob=/\((c|tm|r)\)/gi,sb={c:`©`,r:`®`,tm:`™`};function cb(e,t){return sb[t.toLowerCase()]}function lb(e){let t=0;for(let n=e.length-1;n>=0;n--){let r=e[n];r.type===`text`&&!t&&(r.content=r.content.replace(ob,cb)),r.type===`link_open`&&r.info===`auto`&&t--,r.type===`link_close`&&r.info===`auto`&&t++}}function ub(e){let t=0;for(let n=e.length-1;n>=0;n--){let r=e[n];r.type===`text`&&!t&&ib.test(r.content)&&(r.content=r.content.replace(/\+-/g,`±`).replace(/\.{2,}/g,`…`).replace(/([?!])…/g,`$1..`).replace(/([?!]){4,}/g,`$1$1$1`).replace(/,{2,}/g,`,`).replace(/(^|[^-])---(?=[^-]|$)/gm,`$1—`).replace(/(^|\s)--(?=\s|$)/gm,`$1–`).replace(/(^|[^-\s])--(?=[^-\s]|$)/gm,`$1–`)),r.type===`link_open`&&r.info===`auto`&&t--,r.type===`link_close`&&r.info===`auto`&&t++}}function db(e){let t;if(e.md.options.typographer)for(t=e.tokens.length-1;t>=0;t--)e.tokens[t].type===`inline`&&(ab.test(e.tokens[t].content)&&lb(e.tokens[t].children),ib.test(e.tokens[t].content)&&ub(e.tokens[t].children))}var fb=/['"]/,pb=/['"]/g,mb=`’`;function hb(e,t,n,r){e[t]||(e[t]=[]),e[t].push({pos:n,ch:r})}function gb(e,t){let n=``,r=0;t.sort((e,t)=>e.pos-t.pos);for(let i=0;i<t.length;i++){let a=t[i];n+=e.slice(r,a.pos)+a.ch,r=a.pos+1}return n+e.slice(r)}function _b(e,t){let n,r=[],i={};for(let a=0;a<e.length;a++){let o=e[a],s=e[a].level;for(n=r.length-1;n>=0&&!(r[n].level<=s);n--);if(r.length=n+1,o.type!==`text`)continue;let c=o.content,l=0,u=c.length;OUTER:for(;l<u;){pb.lastIndex=l;let o=pb.exec(c);if(!o)break;let d=!0,f=!0;l=o.index+1;let p=o[0]===`'`,m=32;if(o.index-1>=0)m=c.charCodeAt(o.index-1);else for(n=a-1;n>=0&&!(e[n].type===`softbreak`||e[n].type===`hardbreak`);n--)if(e[n].content){m=e[n].content.charCodeAt(e[n].content.length-1);break}let h=32;if(l<u)h=c.charCodeAt(l);else for(n=a+1;n<e.length&&!(e[n].type===`softbreak`||e[n].type===`hardbreak`);n++)if(e[n].content){h=e[n].content.charCodeAt(0);break}let g=Iy(m)||Fy(m),_=Iy(h)||Fy(h),v=Ny(m),y=Ny(h);if(y?d=!1:_&&(v||g||(d=!1)),v?f=!1:g&&(y||_||(f=!1)),h===34&&o[0]===`"`&&m>=48&&m<=57&&(f=d=!1),d&&f&&(d=g,f=_),!d&&!f){p&&hb(i,a,o.index,mb);continue}if(f)for(n=r.length-1;n>=0;n--){let e=r[n];if(r[n].level<s)break;if(e.single===p&&r[n].level===s){e=r[n];let s,c;p?(s=t.md.options.quotes[2],c=t.md.options.quotes[3]):(s=t.md.options.quotes[0],c=t.md.options.quotes[1]),hb(i,a,o.index,c),hb(i,e.token,e.pos,s),r.length=n;continue OUTER}}d?r.push({token:a,pos:o.index,single:p,level:s}):f&&p&&hb(i,a,o.index,mb)}}Object.keys(i).forEach(function(t){e[t].content=gb(e[t].content,i[t])})}function vb(e){if(e.md.options.typographer)for(let t=e.tokens.length-1;t>=0;t--)e.tokens[t].type!==`inline`||!fb.test(e.tokens[t].content)||_b(e.tokens[t].children,e)}function yb(e){let t,n,r=e.tokens,i=r.length;for(let e=0;e<i;e++){if(r[e].type!==`inline`)continue;let i=r[e].children,a=i.length;for(t=0;t<a;t++)i[t].type===`text_special`&&(i[t].type=`text`);for(t=n=0;t<a;t++)i[t].type===`text`&&t+1<a&&i[t+1].type===`text`?i[t+1].content=i[t].content+i[t+1].content:(t!==n&&(i[n]=i[t]),n++);t!==n&&(i.length=n)}}var bb=[[`normalize`,Qy],[`block`,$y],[`inline`,eb],[`linkify`,rb],[`replacements`,db],[`smartquotes`,vb],[`text_join`,yb]];function xb(){this.ruler=new qy;for(let e=0;e<bb.length;e++)this.ruler.push(bb[e][0],bb[e][1])}xb.prototype.process=function(e){let t=this.ruler.getRules(``);for(let n=0,r=t.length;n<r;n++)t[n](e)},xb.prototype.State=Yy;function Sb(e,t,n,r){this.src=e,this.md=t,this.env=n,this.tokens=r,this.bMarks=[],this.eMarks=[],this.tShift=[],this.sCount=[],this.bsCount=[],this.blkIndent=0,this.line=0,this.lineMax=0,this.tight=!1,this.ddIndent=-1,this.listIndent=-1,this.parentType=`root`,this.level=0;let i=this.src;for(let e=0,t=0,n=0,r=0,a=i.length,o=!1;t<a;t++){let s=i.charCodeAt(t);if(!o)if(My(s)){n++,s===9?r+=4-r%4:r++;continue}else o=!0;(s===10||t===a-1)&&(s!==10&&t++,this.bMarks.push(e),this.eMarks.push(t),this.tShift.push(n),this.sCount.push(r),this.bsCount.push(0),o=!1,n=0,r=0,e=t+1)}this.bMarks.push(i.length),this.eMarks.push(i.length),this.tShift.push(0),this.sCount.push(0),this.bsCount.push(0),this.lineMax=this.bMarks.length-1}Sb.prototype.push=function(e,t,n){let r=new Jy(e,t,n);return r.block=!0,n<0&&this.level--,r.level=this.level,n>0&&this.level++,this.tokens.push(r),r},Sb.prototype.isEmpty=function(e){return this.bMarks[e]+this.tShift[e]>=this.eMarks[e]},Sb.prototype.skipEmptyLines=function(e){for(let t=this.lineMax;e<t&&!(this.bMarks[e]+this.tShift[e]<this.eMarks[e]);e++);return e},Sb.prototype.skipSpaces=function(e){for(let t=this.src.length;e<t&&My(this.src.charCodeAt(e));e++);return e},Sb.prototype.skipSpacesBack=function(e,t){if(e<=t)return e;for(;e>t;)if(!My(this.src.charCodeAt(--e)))return e+1;return e},Sb.prototype.skipChars=function(e,t){for(let n=this.src.length;e<n&&this.src.charCodeAt(e)===t;e++);return e},Sb.prototype.skipCharsBack=function(e,t,n){if(e<=n)return e;for(;e>n;)if(t!==this.src.charCodeAt(--e))return e+1;return e},Sb.prototype.getLines=function(e,t,n,r){if(e>=t)return``;let i=Array(t-e);for(let a=0,o=e;o<t;o++,a++){let e=0,s=this.bMarks[o],c=s,l;for(l=o+1<t||r?this.eMarks[o]+1:this.eMarks[o];c<l&&e<n;){let t=this.src.charCodeAt(c);if(My(t))t===9?e+=4-(e+this.bsCount[o])%4:e++;else if(c-s<this.tShift[o])e++;else break;c++}e>n?i[a]=Array(e-n+1).join(` `)+this.src.slice(c,l):i[a]=this.src.slice(c,l)}return i.join(``)},Sb.prototype.Token=Jy;var Cb=65536;function wb(e,t){let n=e.bMarks[t]+e.tShift[t],r=e.eMarks[t];return e.src.slice(n,r)}function Tb(e){let t=[],n=e.length,r=0,i=e.charCodeAt(r),a=!1,o=0,s=``;for(;r<n;)i===124&&(a?(s+=e.substring(o,r-1),o=r):(t.push(s+e.substring(o,r)),s=``,o=r+1)),a=i===92,r++,i=e.charCodeAt(r);return t.push(s+e.substring(o)),t}function Eb(e,t,n,r){if(t+2>n)return!1;let i=t+1;if(e.sCount[i]<e.blkIndent||e.sCount[i]-e.blkIndent>=4)return!1;let a=e.bMarks[i]+e.tShift[i];if(a>=e.eMarks[i])return!1;let o=e.src.charCodeAt(a++);if(o!==124&&o!==45&&o!==58||a>=e.eMarks[i])return!1;let s=e.src.charCodeAt(a++);if(s!==124&&s!==45&&s!==58&&!My(s)||o===45&&My(s))return!1;for(;a<e.eMarks[i];){let t=e.src.charCodeAt(a);if(t!==124&&t!==45&&t!==58&&!My(t))return!1;a++}let c=wb(e,t+1),l=c.split(`|`),u=[];for(let e=0;e<l.length;e++){let t=l[e].trim();if(!t){if(e===0||e===l.length-1)continue;return!1}if(!/^:?-+:?$/.test(t))return!1;t.charCodeAt(t.length-1)===58?u.push(t.charCodeAt(0)===58?`center`:`right`):t.charCodeAt(0)===58?u.push(`left`):u.push(``)}if(c=wb(e,t).trim(),c.indexOf(`|`)===-1||e.sCount[t]-e.blkIndent>=4)return!1;l=Tb(c),l.length&&l[0]===``&&l.shift(),l.length&&l[l.length-1]===``&&l.pop();let d=l.length;if(d===0||d!==u.length)return!1;if(r)return!0;let f=e.parentType;e.parentType=`table`;let p=e.md.block.ruler.getRules(`blockquote`),m=e.push(`table_open`,`table`,1),h=[t,0];m.map=h;let g=e.push(`thead_open`,`thead`,1);g.map=[t,t+1];let _=e.push(`tr_open`,`tr`,1);_.map=[t,t+1];for(let t=0;t<l.length;t++){let n=e.push(`th_open`,`th`,1);u[t]&&(n.attrs=[[`style`,`text-align:`+u[t]]]);let r=e.push(`inline`,``,0);r.content=l[t].trim(),r.children=[],e.push(`th_close`,`th`,-1)}e.push(`tr_close`,`tr`,-1),e.push(`thead_close`,`thead`,-1);let v,y=0;for(i=t+2;i<n&&!(e.sCount[i]<e.blkIndent);i++){let r=!1;for(let t=0,a=p.length;t<a;t++)if(p[t](e,i,n,!0)){r=!0;break}if(r||(c=wb(e,i).trim(),!c)||e.sCount[i]-e.blkIndent>=4||(l=Tb(c),l.length&&l[0]===``&&l.shift(),l.length&&l[l.length-1]===``&&l.pop(),y+=d-l.length,y>Cb))break;if(i===t+2){let n=e.push(`tbody_open`,`tbody`,1);n.map=v=[t+2,0]}let a=e.push(`tr_open`,`tr`,1);a.map=[i,i+1];for(let t=0;t<d;t++){let n=e.push(`td_open`,`td`,1);u[t]&&(n.attrs=[[`style`,`text-align:`+u[t]]]);let r=e.push(`inline`,``,0);r.content=l[t]?l[t].trim():``,r.children=[],e.push(`td_close`,`td`,-1)}e.push(`tr_close`,`tr`,-1)}return v&&(e.push(`tbody_close`,`tbody`,-1),v[1]=i),e.push(`table_close`,`table`,-1),h[1]=i,e.parentType=f,e.line=i,!0}function Db(e,t,n){if(e.sCount[t]-e.blkIndent<4)return!1;let r=t+1,i=r;for(;r<n;){if(e.isEmpty(r)){r++;continue}if(e.sCount[r]-e.blkIndent>=4){r++,i=r;continue}break}e.line=i;let a=e.push(`code_block`,`code`,0);return a.content=e.getLines(t,i,4+e.blkIndent,!1)+`
|
|
65
|
+
`,a.map=[t,e.line],!0}function Ob(e,t,n,r){let i=e.bMarks[t]+e.tShift[t],a=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||i+3>a)return!1;let o=e.src.charCodeAt(i);if(o!==126&&o!==96)return!1;let s=i;i=e.skipChars(i,o);let c=i-s;if(c<3)return!1;let l=e.src.slice(s,i),u=e.src.slice(i,a);if(o===96&&u.indexOf(String.fromCharCode(o))>=0)return!1;if(r)return!0;let d=t,f=!1;for(;d++,!(d>=n||(i=s=e.bMarks[d]+e.tShift[d],a=e.eMarks[d],i<a&&e.sCount[d]<e.blkIndent));)if(e.src.charCodeAt(i)===o&&!(e.sCount[d]-e.blkIndent>=4)&&(i=e.skipChars(i,o),!(i-s<c)&&(i=e.skipSpaces(i),!(i<a)))){f=!0;break}c=e.sCount[t],e.line=d+ +!!f;let p=e.push(`fence`,`code`,0);return p.info=u,p.content=e.getLines(t+1,d,c,!0),p.markup=l,p.map=[t,e.line],!0}function kb(e,t,n,r){let i=e.bMarks[t]+e.tShift[t],a=e.eMarks[t],o=e.lineMax;if(e.sCount[t]-e.blkIndent>=4||e.src.charCodeAt(i)!==62)return!1;if(r)return!0;let s=[],c=[],l=[],u=[],d=e.md.block.ruler.getRules(`blockquote`),f=e.parentType;e.parentType=`blockquote`;let p=!1,m;for(m=t;m<n;m++){let t=e.sCount[m]<e.blkIndent;if(i=e.bMarks[m]+e.tShift[m],a=e.eMarks[m],i>=a)break;if(e.src.charCodeAt(i++)===62&&!t){let t=e.sCount[m]+1,n,r;e.src.charCodeAt(i)===32?(i++,t++,r=!1,n=!0):e.src.charCodeAt(i)===9?(n=!0,(e.bsCount[m]+t)%4==3?(i++,t++,r=!1):r=!0):n=!1;let o=t;for(s.push(e.bMarks[m]),e.bMarks[m]=i;i<a;){let t=e.src.charCodeAt(i);if(My(t))t===9?o+=4-(o+e.bsCount[m]+ +!!r)%4:o++;else break;i++}p=i>=a,c.push(e.bsCount[m]),e.bsCount[m]=e.sCount[m]+1+ +!!n,l.push(e.sCount[m]),e.sCount[m]=o-t,u.push(e.tShift[m]),e.tShift[m]=i-e.bMarks[m];continue}if(p)break;let r=!1;for(let t=0,i=d.length;t<i;t++)if(d[t](e,m,n,!0)){r=!0;break}if(r){e.lineMax=m,e.blkIndent!==0&&(s.push(e.bMarks[m]),c.push(e.bsCount[m]),u.push(e.tShift[m]),l.push(e.sCount[m]),e.sCount[m]-=e.blkIndent);break}s.push(e.bMarks[m]),c.push(e.bsCount[m]),u.push(e.tShift[m]),l.push(e.sCount[m]),e.sCount[m]=-1}let h=e.blkIndent;e.blkIndent=0;let g=e.push(`blockquote_open`,`blockquote`,1);g.markup=`>`;let _=[t,0];g.map=_,e.md.block.tokenize(e,t,m);let v=e.push(`blockquote_close`,`blockquote`,-1);v.markup=`>`,e.lineMax=o,e.parentType=f,_[1]=e.line;for(let n=0;n<u.length;n++)e.bMarks[n+t]=s[n],e.tShift[n+t]=u[n],e.sCount[n+t]=l[n],e.bsCount[n+t]=c[n];return e.blkIndent=h,!0}function Ab(e,t,n,r){let i=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4)return!1;let a=e.bMarks[t]+e.tShift[t],o=e.src.charCodeAt(a++);if(o!==42&&o!==45&&o!==95)return!1;let s=1;for(;a<i;){let t=e.src.charCodeAt(a++);if(t!==o&&!My(t))return!1;t===o&&s++}if(s<3)return!1;if(r)return!0;e.line=t+1;let c=e.push(`hr`,`hr`,0);return c.map=[t,e.line],c.markup=Array(s+1).join(String.fromCharCode(o)),!0}function jb(e,t){let n=e.eMarks[t],r=e.bMarks[t]+e.tShift[t],i=e.src.charCodeAt(r++);return i!==42&&i!==45&&i!==43||r<n&&!My(e.src.charCodeAt(r))?-1:r}function Mb(e,t){let n=e.bMarks[t]+e.tShift[t],r=e.eMarks[t],i=n;if(i+1>=r)return-1;let a=e.src.charCodeAt(i++);if(a<48||a>57)return-1;for(;;){if(i>=r)return-1;if(a=e.src.charCodeAt(i++),a>=48&&a<=57){if(i-n>=10)return-1;continue}if(a===41||a===46)break;return-1}return i<r&&(a=e.src.charCodeAt(i),!My(a))?-1:i}function Nb(e,t){let n=e.level+2;for(let r=t+2,i=e.tokens.length-2;r<i;r++)e.tokens[r].level===n&&e.tokens[r].type===`paragraph_open`&&(e.tokens[r+2].hidden=!0,e.tokens[r].hidden=!0,r+=2)}function Pb(e,t,n,r){let i,a,o,s,c=t,l=!0;if(e.sCount[c]-e.blkIndent>=4||e.listIndent>=0&&e.sCount[c]-e.listIndent>=4&&e.sCount[c]<e.blkIndent)return!1;let u=!1;r&&e.parentType===`paragraph`&&e.sCount[c]>=e.blkIndent&&(u=!0);let d,f,p;if((p=Mb(e,c))>=0){if(d=!0,o=e.bMarks[c]+e.tShift[c],f=Number(e.src.slice(o,p-1)),u&&f!==1)return!1}else if((p=jb(e,c))>=0)d=!1;else return!1;if(u&&e.skipSpaces(p)>=e.eMarks[c])return!1;if(r)return!0;let m=e.src.charCodeAt(p-1),h=e.tokens.length;d?(s=e.push(`ordered_list_open`,`ol`,1),f!==1&&(s.attrs=[[`start`,f]])):s=e.push(`bullet_list_open`,`ul`,1);let g=[c,0];s.map=g,s.markup=String.fromCharCode(m);let _=!1,v=e.md.block.ruler.getRules(`list`),y=e.parentType;for(e.parentType=`list`;c<n;){a=p,i=e.eMarks[c];let t=e.sCount[c]+p-(e.bMarks[c]+e.tShift[c]),r=t;for(;a<i;){let t=e.src.charCodeAt(a);if(t===9)r+=4-(r+e.bsCount[c])%4;else if(t===32)r++;else break;a++}let u=a,f;f=u>=i?1:r-t,f>4&&(f=1);let h=t+f;s=e.push(`list_item_open`,`li`,1),s.markup=String.fromCharCode(m);let g=[c,0];s.map=g,d&&(s.info=e.src.slice(o,p-1));let y=e.tight,b=e.tShift[c],x=e.sCount[c],S=e.listIndent;if(e.listIndent=e.blkIndent,e.blkIndent=h,e.tight=!0,e.tShift[c]=u-e.bMarks[c],e.sCount[c]=r,u>=i&&e.isEmpty(c+1)?e.line=Math.min(e.line+2,n):e.md.block.tokenize(e,c,n,!0),(!e.tight||_)&&(l=!1),_=e.line-c>1&&e.isEmpty(e.line-1),e.blkIndent=e.listIndent,e.listIndent=S,e.tShift[c]=b,e.sCount[c]=x,e.tight=y,s=e.push(`list_item_close`,`li`,-1),s.markup=String.fromCharCode(m),c=e.line,g[1]=c,c>=n||e.sCount[c]<e.blkIndent||e.sCount[c]-e.blkIndent>=4)break;let C=!1;for(let t=0,r=v.length;t<r;t++)if(v[t](e,c,n,!0)){C=!0;break}if(C)break;if(d){if(p=Mb(e,c),p<0)break;o=e.bMarks[c]+e.tShift[c]}else if(p=jb(e,c),p<0)break;if(m!==e.src.charCodeAt(p-1))break}return s=d?e.push(`ordered_list_close`,`ol`,-1):e.push(`bullet_list_close`,`ul`,-1),s.markup=String.fromCharCode(m),g[1]=c,e.line=c,e.parentType=y,l&&Nb(e,h),!0}function Fb(e,t,n,r){let i=e.bMarks[t]+e.tShift[t],a=e.eMarks[t],o=t+1;if(e.sCount[t]-e.blkIndent>=4||e.src.charCodeAt(i)!==91)return!1;function s(t){let n=e.lineMax;if(t>=n||e.isEmpty(t))return null;let r=!1;if(e.sCount[t]-e.blkIndent>3&&(r=!0),e.sCount[t]<0&&(r=!0),!r){let r=e.md.block.ruler.getRules(`reference`),i=e.parentType;e.parentType=`reference`;let a=!1;for(let i=0,o=r.length;i<o;i++)if(r[i](e,t,n,!0)){a=!0;break}if(e.parentType=i,a)return null}let i=e.bMarks[t]+e.tShift[t],a=e.eMarks[t];return e.src.slice(i,a+1)}let c=e.src.slice(i,a+1);a=c.length;let l=-1;for(i=1;i<a;i++){let e=c.charCodeAt(i);if(e===91)return!1;if(e===93){l=i;break}else if(e===10){let e=s(o);e!==null&&(c+=e,a=c.length,o++)}else if(e===92&&(i++,i<a&&c.charCodeAt(i)===10)){let e=s(o);e!==null&&(c+=e,a=c.length,o++)}}if(l<0||c.charCodeAt(l+1)!==58)return!1;for(i=l+2;i<a;i++){let e=c.charCodeAt(i);if(e===10){let e=s(o);e!==null&&(c+=e,a=c.length,o++)}else if(!My(e))break}let u=e.md.helpers.parseLinkDestination(c,i,a);if(!u.ok)return!1;let d=e.md.normalizeLink(u.str);if(!e.md.validateLink(d))return!1;i=u.pos;let f=i,p=o,m=i;for(;i<a;i++){let e=c.charCodeAt(i);if(e===10){let e=s(o);e!==null&&(c+=e,a=c.length,o++)}else if(!My(e))break}let h=e.md.helpers.parseLinkTitle(c,i,a);for(;h.can_continue;){let t=s(o);if(t===null)break;c+=t,i=a,a=c.length,o++,h=e.md.helpers.parseLinkTitle(c,i,a,h)}let g;for(i<a&&m!==i&&h.ok?(g=h.str,i=h.pos):(g=``,i=f,o=p);i<a&&My(c.charCodeAt(i));)i++;if(i<a&&c.charCodeAt(i)!==10&&g)for(g=``,i=f,o=p;i<a&&My(c.charCodeAt(i));)i++;if(i<a&&c.charCodeAt(i)!==10)return!1;let _=Ly(c.slice(1,l));return _?r?!0:(e.env.references===void 0&&(e.env.references={}),e.env.references[_]===void 0&&(e.env.references[_]={title:g,href:d}),e.line=o,!0):!1}var Ib=`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`.split(`.`),Lb=RegExp(`^(?:<[A-Za-z][A-Za-z0-9\\-]*(?:\\s+[a-zA-Z_:][a-zA-Z0-9:._-]*(?:\\s*=\\s*(?:[^"'=<>\`\\x00-\\x20]+|'[^']*'|"[^"]*"))?)*\\s*\\/?>|<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>|<!---?>|<!--(?:[^-]|-[^-]|--[^>])*-->|<[?][\\s\\S]*?[?]>|<![A-Za-z][^>]*>|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>)`),Rb=RegExp(`^(?:<[A-Za-z][A-Za-z0-9\\-]*(?:\\s+[a-zA-Z_:][a-zA-Z0-9:._-]*(?:\\s*=\\s*(?:[^"'=<>\`\\x00-\\x20]+|'[^']*'|"[^"]*"))?)*\\s*\\/?>|<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>)`),zb=[[/^<(script|pre|style|textarea)(?=(\s|>|$))/i,/<\/(script|pre|style|textarea)>/i,!0],[/^<!--/,/-->/,!0],[/^<\?/,/\?>/,!0],[/^<![A-Z]/,/>/,!0],[/^<!\[CDATA\[/,/\]\]>/,!0],[RegExp(`^</?(`+Ib.join(`|`)+`)(?=(\\s|/?>|$))`,`i`),/^$/,!0],[RegExp(Rb.source+`\\s*$`),/^$/,!1]];function Bb(e,t,n,r){let i=e.bMarks[t]+e.tShift[t],a=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||!e.md.options.html||e.src.charCodeAt(i)!==60)return!1;let o=e.src.slice(i,a),s=0;for(;s<zb.length&&!zb[s][0].test(o);s++);if(s===zb.length)return!1;if(r)return zb[s][2];let c=t+1,l=zb[s][1].test(``);if(!zb[s][1].test(o)){for(;c<n&&!(e.sCount[c]<e.blkIndent&&(l||!e.isEmpty(c)));c++)if(i=e.bMarks[c]+e.tShift[c],a=e.eMarks[c],o=e.src.slice(i,a),zb[s][1].test(o)){o.length!==0&&c++;break}}e.line=c;let u=e.push(`html_block`,``,0);return u.map=[t,c],u.content=e.getLines(t,c,e.blkIndent,!0),!0}function Vb(e,t,n,r){let i=e.bMarks[t]+e.tShift[t],a=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4)return!1;let o=e.src.charCodeAt(i);if(o!==35||i>=a)return!1;let s=1;for(o=e.src.charCodeAt(++i);o===35&&i<a&&s<=6;)s++,o=e.src.charCodeAt(++i);if(s>6||i<a&&!My(o))return!1;if(r)return!0;a=e.skipSpacesBack(a,i);let c=e.skipCharsBack(a,35,i);c>i&&My(e.src.charCodeAt(c-1))&&(a=c),e.line=t+1;let l=e.push(`heading_open`,`h`+String(s),1);l.markup=`########`.slice(0,s),l.map=[t,e.line];let u=e.push(`inline`,``,0);u.content=zy(e.src.slice(i,a)),u.map=[t,e.line],u.children=[];let d=e.push(`heading_close`,`h`+String(s),-1);return d.markup=`########`.slice(0,s),!0}function Hb(e,t,n){let r=e.md.block.ruler.getRules(`paragraph`);if(e.sCount[t]-e.blkIndent>=4)return!1;let i=e.parentType;e.parentType=`paragraph`;let a=0,o,s=t+1;for(;s<n&&!e.isEmpty(s);s++){if(e.sCount[s]-e.blkIndent>3)continue;if(e.sCount[s]>=e.blkIndent){let t=e.bMarks[s]+e.tShift[s],n=e.eMarks[s];if(t<n&&(o=e.src.charCodeAt(t),(o===45||o===61)&&(t=e.skipChars(t,o),t=e.skipSpaces(t),t>=n))){a=o===61?1:2;break}}if(e.sCount[s]<0)continue;let t=!1;for(let i=0,a=r.length;i<a;i++)if(r[i](e,s,n,!0)){t=!0;break}if(t)break}if(!a)return e.parentType=i,!1;let c=zy(e.getLines(t,s,e.blkIndent,!1));e.line=s+1;let l=e.push(`heading_open`,`h`+String(a),1);l.markup=String.fromCharCode(o),l.map=[t,e.line];let u=e.push(`inline`,``,0);u.content=c,u.map=[t,e.line-1],u.children=[];let d=e.push(`heading_close`,`h`+String(a),-1);return d.markup=String.fromCharCode(o),e.parentType=i,!0}function Ub(e,t,n){let r=e.md.block.ruler.getRules(`paragraph`),i=e.parentType,a=t+1;for(e.parentType=`paragraph`;a<n&&!e.isEmpty(a);a++){if(e.sCount[a]-e.blkIndent>3||e.sCount[a]<0)continue;let t=!1;for(let i=0,o=r.length;i<o;i++)if(r[i](e,a,n,!0)){t=!0;break}if(t)break}let o=zy(e.getLines(t,a,e.blkIndent,!1));e.line=a;let s=e.push(`paragraph_open`,`p`,1);s.map=[t,e.line];let c=e.push(`inline`,``,0);return c.content=o,c.map=[t,e.line],c.children=[],e.push(`paragraph_close`,`p`,-1),e.parentType=i,!0}var Wb=[[`table`,Eb,[`paragraph`,`reference`]],[`code`,Db],[`fence`,Ob,[`paragraph`,`reference`,`blockquote`,`list`]],[`blockquote`,kb,[`paragraph`,`reference`,`blockquote`,`list`]],[`hr`,Ab,[`paragraph`,`reference`,`blockquote`,`list`]],[`list`,Pb,[`paragraph`,`reference`,`blockquote`]],[`reference`,Fb],[`html_block`,Bb,[`paragraph`,`reference`,`blockquote`]],[`heading`,Vb,[`paragraph`,`reference`,`blockquote`]],[`lheading`,Hb],[`paragraph`,Ub]];function Gb(){this.ruler=new qy;for(let e=0;e<Wb.length;e++)this.ruler.push(Wb[e][0],Wb[e][1],{alt:(Wb[e][2]||[]).slice()})}Gb.prototype.tokenize=function(e,t,n){let r=this.ruler.getRules(``),i=r.length,a=e.md.options.maxNesting,o=t,s=!1;for(;o<n&&(e.line=o=e.skipEmptyLines(o),!(o>=n||e.sCount[o]<e.blkIndent));){if(e.level>=a){e.line=n;break}let t=e.line,c=!1;for(let a=0;a<i;a++)if(c=r[a](e,o,n,!1),c){if(t>=e.line)throw Error(`block rule didn't increment state.line`);break}if(!c)throw Error(`none of the block rules matched`);e.tight=!s,e.isEmpty(e.line-1)&&(s=!0),o=e.line,o<n&&e.isEmpty(o)&&(s=!0,o++,e.line=o)}},Gb.prototype.parse=function(e,t,n,r){if(!e)return;let i=new this.State(e,t,n,r);this.tokenize(i,i.line,i.lineMax)},Gb.prototype.State=Sb;function Kb(e,t,n,r){this.src=e,this.env=n,this.md=t,this.tokens=r,this.tokens_meta=Array(r.length),this.pos=0,this.posMax=this.src.length,this.level=0,this.pending=``,this.pendingLevel=0,this.cache={},this.delimiters=[],this._prev_delimiters=[],this.backticks={},this.backticksScanned=!1,this.linkLevel=0}Kb.prototype.pushPending=function(){let e=new Jy(`text`,``,0);return e.content=this.pending,e.level=this.pendingLevel,this.tokens.push(e),this.pending=``,e},Kb.prototype.push=function(e,t,n){this.pending&&this.pushPending();let r=new Jy(e,t,n),i=null;return n<0&&(this.level--,this.delimiters=this._prev_delimiters.pop()),r.level=this.level,n>0&&(this.level++,this._prev_delimiters.push(this.delimiters),this.delimiters=[],i={delimiters:this.delimiters}),this.pendingLevel=this.level,this.tokens.push(r),this.tokens_meta.push(i),r},Kb.prototype.scanDelims=function(e,t){let n=this.posMax,r=this.src.charCodeAt(e),i;if(e===0)i=32;else if(e===1)i=this.src.charCodeAt(0),(i&63488)==55296&&(i=65533);else if(i=this.src.charCodeAt(e-1),(i&64512)==56320){let t=this.src.charCodeAt(e-2);i=(t&64512)==55296?65536+(t-55296<<10)+(i-56320):65533}else(i&64512)==55296&&(i=65533);let a=e;for(;a<n&&this.src.charCodeAt(a)===r;)a++;let o=a-e,s=a<n?this.src.charCodeAt(a):32;if((s&64512)==55296){let e=this.src.charCodeAt(a+1);s=(e&64512)==56320?65536+(s-55296<<10)+(e-56320):65533}else(s&64512)==56320&&(s=65533);let c=Iy(i)||Fy(i),l=Iy(s)||Fy(s),u=Ny(i),d=Ny(s),f=!d&&(!l||u||c),p=!u&&(!c||d||l);return{can_open:f&&(t||!p||c),can_close:p&&(t||!f||l),length:o}},Kb.prototype.Token=Jy;function qb(e){switch(e){case 10:case 33:case 35:case 36:case 37:case 38:case 42:case 43:case 45:case 58:case 60:case 61:case 62:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 125:case 126:return!0;default:return!1}}function Jb(e,t){let n=e.pos;for(;n<e.posMax&&!qb(e.src.charCodeAt(n));)n++;return n===e.pos?!1:(t||(e.pending+=e.src.slice(e.pos,n)),e.pos=n,!0)}var Yb=/(?:^|[^a-z0-9.+-])([a-z][a-z0-9.+-]*)$/i;function Xb(e,t){if(!e.md.options.linkify||e.linkLevel>0)return!1;let n=e.pos,r=e.posMax;if(n+3>r||e.src.charCodeAt(n)!==58||e.src.charCodeAt(n+1)!==47||e.src.charCodeAt(n+2)!==47)return!1;let i=e.pending.match(Yb);if(!i)return!1;let a=i[1],o=e.md.linkify.matchAtStart(e.src.slice(n-a.length));if(!o)return!1;let s=o.url;if(s.length<=a.length)return!1;let c=s.length;for(;c>0&&s.charCodeAt(c-1)===42;)c--;c!==s.length&&(s=s.slice(0,c));let l=e.md.normalizeLink(s);if(!e.md.validateLink(l))return!1;if(!t){e.pending=e.pending.slice(0,-a.length);let t=e.push(`link_open`,`a`,1);t.attrs=[[`href`,l]],t.markup=`linkify`,t.info=`auto`;let n=e.push(`text`,``,0);n.content=e.md.normalizeLinkText(s);let r=e.push(`link_close`,`a`,-1);r.markup=`linkify`,r.info=`auto`}return e.pos+=s.length-a.length,!0}function Zb(e,t){let n=e.pos;if(e.src.charCodeAt(n)!==10)return!1;let r=e.pending.length-1,i=e.posMax;if(!t)if(r>=0&&e.pending.charCodeAt(r)===32)if(r>=1&&e.pending.charCodeAt(r-1)===32){let t=r-1;for(;t>=1&&e.pending.charCodeAt(t-1)===32;)t--;e.pending=e.pending.slice(0,t),e.push(`hardbreak`,`br`,0)}else e.pending=e.pending.slice(0,-1),e.push(`softbreak`,`br`,0);else e.push(`softbreak`,`br`,0);for(n++;n<i&&My(e.src.charCodeAt(n));)n++;return e.pos=n,!0}var Qb=[];for(let e=0;e<256;e++)Qb.push(0);`\\!"#$%&'()*+,./:;<=>?@[]^_\`{|}~-`.split(``).forEach(function(e){Qb[e.charCodeAt(0)]=1});function $b(e,t){let n=e.pos,r=e.posMax;if(e.src.charCodeAt(n)!==92||(n++,n>=r))return!1;let i=e.src.charCodeAt(n);if(i===10){for(t||e.push(`hardbreak`,`br`,0),n++;n<r&&(i=e.src.charCodeAt(n),My(i));)n++;return e.pos=n,!0}if(i===32){if(!t){let t=e.push(`text_special`,``,0);t.content=`\\`,t.markup=`\\`,t.info=`escape`}return e.pos=n,!0}let a=e.src[n];if(i>=55296&&i<=56319&&n+1<r){let t=e.src.charCodeAt(n+1);t>=56320&&t<=57343&&(a+=e.src[n+1],n++)}let o=`\\`+a;if(!t){let t=e.push(`text_special`,``,0);i<256&&Qb[i]!==0?t.content=a:t.content=o,t.markup=o,t.info=`escape`}return e.pos=n+1,!0}function ex(e,t){let n=e.pos;if(e.src.charCodeAt(n)!==96)return!1;let r=n;n++;let i=e.posMax;for(;n<i&&e.src.charCodeAt(n)===96;)n++;let a=e.src.slice(r,n),o=a.length;if(e.backticksScanned&&(e.backticks[o]||0)<=r)return t||(e.pending+=a),e.pos+=o,!0;let s=n,c;for(;(c=e.src.indexOf("`",s))!==-1;){for(s=c+1;s<i&&e.src.charCodeAt(s)===96;)s++;let r=s-c;if(r===o){if(!t){let t=e.push(`code_inline`,`code`,0);t.markup=a,t.content=e.src.slice(n,c).replace(/\n/g,` `).replace(/^ (.+) $/,`$1`)}return e.pos=s,!0}e.backticks[r]=c}return e.backticksScanned=!0,t||(e.pending+=a),e.pos+=o,!0}function tx(e,t){let n=e.pos,r=e.src.charCodeAt(n);if(t||r!==126)return!1;let i=e.scanDelims(e.pos,!0),a=i.length,o=String.fromCharCode(r);if(a<2)return!1;let s;a%2&&(s=e.push(`text`,``,0),s.content=o,a--);for(let t=0;t<a;t+=2)s=e.push(`text`,``,0),s.content=o+o,e.delimiters.push({marker:r,length:0,token:e.tokens.length-1,end:-1,open:i.can_open,close:i.can_close});return e.pos+=i.length,!0}function nx(e,t){let n,r=[],i=t.length;for(let a=0;a<i;a++){let i=t[a];if(i.marker!==126||i.end===-1)continue;let o=t[i.end];n=e.tokens[i.token],n.type=`s_open`,n.tag=`s`,n.nesting=1,n.markup=`~~`,n.content=``,n=e.tokens[o.token],n.type=`s_close`,n.tag=`s`,n.nesting=-1,n.markup=`~~`,n.content=``,e.tokens[o.token-1].type===`text`&&e.tokens[o.token-1].content===`~`&&r.push(o.token-1)}for(;r.length;){let t=r.pop(),i=t+1;for(;i<e.tokens.length&&e.tokens[i].type===`s_close`;)i++;i--,t!==i&&(n=e.tokens[i],e.tokens[i]=e.tokens[t],e.tokens[t]=n)}}function rx(e){let t=e.tokens_meta,n=e.tokens_meta.length;nx(e,e.delimiters);for(let r=0;r<n;r++)t[r]&&t[r].delimiters&&nx(e,t[r].delimiters)}var ix={tokenize:tx,postProcess:rx};function ax(e,t){let n=e.pos,r=e.src.charCodeAt(n);if(t||r!==95&&r!==42)return!1;let i=e.scanDelims(e.pos,r===42);for(let t=0;t<i.length;t++){let t=e.push(`text`,``,0);t.content=String.fromCharCode(r),e.delimiters.push({marker:r,length:i.length,token:e.tokens.length-1,end:-1,open:i.can_open,close:i.can_close})}return e.pos+=i.length,!0}function ox(e,t){let n=t.length;for(let r=n-1;r>=0;r--){let n=t[r];if(n.marker!==95&&n.marker!==42||n.end===-1)continue;let i=t[n.end],a=r>0&&t[r-1].end===n.end+1&&t[r-1].marker===n.marker&&t[r-1].token===n.token-1&&t[n.end+1].token===i.token+1,o=String.fromCharCode(n.marker),s=e.tokens[n.token];s.type=a?`strong_open`:`em_open`,s.tag=a?`strong`:`em`,s.nesting=1,s.markup=a?o+o:o,s.content=``;let c=e.tokens[i.token];c.type=a?`strong_close`:`em_close`,c.tag=a?`strong`:`em`,c.nesting=-1,c.markup=a?o+o:o,c.content=``,a&&(e.tokens[t[r-1].token].content=``,e.tokens[t[n.end+1].token].content=``,r--)}}function sx(e){let t=e.tokens_meta,n=e.tokens_meta.length;ox(e,e.delimiters);for(let r=0;r<n;r++)t[r]&&t[r].delimiters&&ox(e,t[r].delimiters)}var cx={tokenize:ax,postProcess:sx};function lx(e,t){let n,r,i,a,o=``,s=``,c=e.pos,l=!0;if(e.src.charCodeAt(e.pos)!==91)return!1;let u=e.pos,d=e.posMax,f=e.pos+1,p=e.md.helpers.parseLinkLabel(e,e.pos,!0);if(p<0)return!1;let m=p+1;if(m<d&&e.src.charCodeAt(m)===40){for(l=!1,m++;m<d&&(n=e.src.charCodeAt(m),!(!My(n)&&n!==10));m++);if(m>=d)return!1;if(c=m,i=e.md.helpers.parseLinkDestination(e.src,m,e.posMax),i.ok){for(o=e.md.normalizeLink(i.str),e.md.validateLink(o)?m=i.pos:o=``,c=m;m<d&&(n=e.src.charCodeAt(m),!(!My(n)&&n!==10));m++);if(i=e.md.helpers.parseLinkTitle(e.src,m,e.posMax),m<d&&c!==m&&i.ok)for(s=i.str,m=i.pos;m<d&&(n=e.src.charCodeAt(m),!(!My(n)&&n!==10));m++);}(m>=d||e.src.charCodeAt(m)!==41)&&(l=!0),m++}if(l){if(e.env.references===void 0)return!1;if(m<d&&e.src.charCodeAt(m)===91?(c=m+1,m=e.md.helpers.parseLinkLabel(e,m),m>=0?r=e.src.slice(c,m++):m=p+1):m=p+1,r||=e.src.slice(f,p),a=e.env.references[Ly(r)],!a)return e.pos=u,!1;o=a.href,s=a.title}if(!t){e.pos=f,e.posMax=p;let t=e.push(`link_open`,`a`,1),n=[[`href`,o]];t.attrs=n,s&&n.push([`title`,s]),e.linkLevel++,e.md.inline.tokenize(e),e.linkLevel--,e.push(`link_close`,`a`,-1)}return e.pos=m,e.posMax=d,!0}function ux(e,t){let n,r,i,a,o,s,c,l,u=``,d=e.pos,f=e.posMax;if(e.src.charCodeAt(e.pos)!==33||e.src.charCodeAt(e.pos+1)!==91)return!1;let p=e.pos+2,m=e.md.helpers.parseLinkLabel(e,e.pos+1,!1);if(m<0)return!1;if(a=m+1,a<f&&e.src.charCodeAt(a)===40){for(a++;a<f&&(n=e.src.charCodeAt(a),!(!My(n)&&n!==10));a++);if(a>=f)return!1;for(l=a,s=e.md.helpers.parseLinkDestination(e.src,a,e.posMax),s.ok&&(u=e.md.normalizeLink(s.str),e.md.validateLink(u)?a=s.pos:u=``),l=a;a<f&&(n=e.src.charCodeAt(a),!(!My(n)&&n!==10));a++);if(s=e.md.helpers.parseLinkTitle(e.src,a,e.posMax),a<f&&l!==a&&s.ok)for(c=s.str,a=s.pos;a<f&&(n=e.src.charCodeAt(a),!(!My(n)&&n!==10));a++);else c=``;if(a>=f||e.src.charCodeAt(a)!==41)return e.pos=d,!1;a++}else{if(e.env.references===void 0)return!1;if(a<f&&e.src.charCodeAt(a)===91?(l=a+1,a=e.md.helpers.parseLinkLabel(e,a),a>=0?i=e.src.slice(l,a++):a=m+1):a=m+1,i||=e.src.slice(p,m),o=e.env.references[Ly(i)],!o)return e.pos=d,!1;u=o.href,c=o.title}if(!t){r=e.src.slice(p,m);let t=[];e.md.inline.parse(r,e.md,e.env,t);let n=e.push(`image`,`img`,0),i=[[`src`,u],[`alt`,``]];n.attrs=i,n.children=t,n.content=r,c&&i.push([`title`,c])}return e.pos=a,e.posMax=f,!0}var dx=/^([a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)$/,fx=/^([a-zA-Z][a-zA-Z0-9+.-]{1,31}):([^<>\x00-\x20]*)$/;function px(e,t){let n=e.pos;if(e.src.charCodeAt(n)!==60)return!1;let r=e.pos,i=e.posMax;for(;;){if(++n>=i)return!1;let t=e.src.charCodeAt(n);if(t===60)return!1;if(t===62)break}let a=e.src.slice(r+1,n);if(fx.test(a)){let n=e.md.normalizeLink(a);if(!e.md.validateLink(n))return!1;if(!t){let t=e.push(`link_open`,`a`,1);t.attrs=[[`href`,n]],t.markup=`autolink`,t.info=`auto`;let r=e.push(`text`,``,0);r.content=e.md.normalizeLinkText(a);let i=e.push(`link_close`,`a`,-1);i.markup=`autolink`,i.info=`auto`}return e.pos+=a.length+2,!0}if(dx.test(a)){let n=e.md.normalizeLink(`mailto:`+a);if(!e.md.validateLink(n))return!1;if(!t){let t=e.push(`link_open`,`a`,1);t.attrs=[[`href`,n]],t.markup=`autolink`,t.info=`auto`;let r=e.push(`text`,``,0);r.content=e.md.normalizeLinkText(a);let i=e.push(`link_close`,`a`,-1);i.markup=`autolink`,i.info=`auto`}return e.pos+=a.length+2,!0}return!1}function mx(e){return/^<a[>\s]/i.test(e)}function hx(e){return/^<\/a\s*>/i.test(e)}function gx(e){let t=e|32;return t>=97&&t<=122}function _x(e,t){if(!e.md.options.html)return!1;let n=e.posMax,r=e.pos;if(e.src.charCodeAt(r)!==60||r+2>=n)return!1;let i=e.src.charCodeAt(r+1);if(i!==33&&i!==63&&i!==47&&!gx(i))return!1;let a=e.src.slice(r).match(Lb);if(!a)return!1;if(!t){let t=e.push(`html_inline`,``,0);t.content=a[0],mx(t.content)&&e.linkLevel++,hx(t.content)&&e.linkLevel--}return e.pos+=a[0].length,!0}var vx=/^&#((?:x[a-f0-9]{1,6}|[0-9]{1,7}));/i,yx=/^&([a-z][a-z0-9]{1,31});/i;function bx(e,t){let n=e.pos,r=e.posMax;if(e.src.charCodeAt(n)!==38||n+1>=r)return!1;if(e.src.charCodeAt(n+1)===35){let r=e.src.slice(n).match(vx);if(r){if(!t){let t=r[1][0].toLowerCase()===`x`?parseInt(r[1].slice(1),16):parseInt(r[1],10),n=e.push(`text_special`,``,0);n.content=_y(t)?vy(t):vy(65533),n.markup=r[0],n.info=`entity`}return e.pos+=r[0].length,!0}}else{let r=e.src.slice(n).match(yx);if(r){let n=ly(r[0]);if(n!==r[0]){if(!t){let t=e.push(`text_special`,``,0);t.content=n,t.markup=r[0],t.info=`entity`}return e.pos+=r[0].length,!0}}}return!1}function xx(e){let t={},n=e.length;if(!n)return;let r=0,i=-2,a=[];for(let o=0;o<n;o++){let n=e[o];if(a.push(0),(e[r].marker!==n.marker||i!==n.token-1)&&(r=o),i=n.token,n.length=n.length||0,!n.close)continue;t.hasOwnProperty(n.marker)||(t[n.marker]=[-1,-1,-1,-1,-1,-1]);let s=t[n.marker][(n.open?3:0)+n.length%3],c=r-a[r]-1,l=c;for(;c>s;c-=a[c]+1){let t=e[c];if(t.marker===n.marker&&t.open&&t.end<0){let r=!1;if((t.close||n.open)&&(t.length+n.length)%3==0&&(t.length%3!=0||n.length%3!=0)&&(r=!0),!r){let r=c>0&&!e[c-1].open?a[c-1]+1:0;a[o]=o-c+r,a[c]=r,n.open=!1,t.end=o,t.close=!1,l=-1,i=-2;break}}}l!==-1&&(t[n.marker][(n.open?3:0)+(n.length||0)%3]=l)}}function Sx(e){let t=e.tokens_meta,n=e.tokens_meta.length;xx(e.delimiters);for(let e=0;e<n;e++)t[e]&&t[e].delimiters&&xx(t[e].delimiters)}function Cx(e){let t,n,r=0,i=e.tokens,a=e.tokens.length;for(t=n=0;t<a;t++)i[t].nesting<0&&r--,i[t].level=r,i[t].nesting>0&&r++,i[t].type===`text`&&t+1<a&&i[t+1].type===`text`?i[t+1].content=i[t].content+i[t+1].content:(t!==n&&(i[n]=i[t]),n++);t!==n&&(i.length=n)}var wx=[[`text`,Jb],[`linkify`,Xb],[`newline`,Zb],[`escape`,$b],[`backticks`,ex],[`strikethrough`,ix.tokenize],[`emphasis`,cx.tokenize],[`link`,lx],[`image`,ux],[`autolink`,px],[`html_inline`,_x],[`entity`,bx]],Tx=[[`balance_pairs`,Sx],[`strikethrough`,ix.postProcess],[`emphasis`,cx.postProcess],[`fragments_join`,Cx]];function Ex(){this.ruler=new qy;for(let e=0;e<wx.length;e++)this.ruler.push(wx[e][0],wx[e][1]);this.ruler2=new qy;for(let e=0;e<Tx.length;e++)this.ruler2.push(Tx[e][0],Tx[e][1])}Ex.prototype.skipToken=function(e){let t=e.pos,n=this.ruler.getRules(``),r=n.length,i=e.md.options.maxNesting,a=e.cache;if(a[t]!==void 0){e.pos=a[t];return}let o=!1;if(e.level<i){for(let i=0;i<r;i++)if(e.level++,o=n[i](e,!0),e.level--,o){if(t>=e.pos)throw Error(`inline rule didn't increment state.pos`);break}}else e.pos=e.posMax;o||e.pos++,a[t]=e.pos},Ex.prototype.tokenize=function(e){let t=this.ruler.getRules(``),n=t.length,r=e.posMax,i=e.md.options.maxNesting;for(;e.pos<r;){let a=e.pos,o=!1;if(e.level<i){for(let r=0;r<n;r++)if(o=t[r](e,!1),o){if(a>=e.pos)throw Error(`inline rule didn't increment state.pos`);break}}if(o){if(e.pos>=r)break;continue}e.pending+=e.src[e.pos++]}e.pending&&e.pushPending()},Ex.prototype.parse=function(e,t,n,r){let i=new this.State(e,t,n,r);this.tokenize(i);let a=this.ruler2.getRules(``),o=a.length;for(let e=0;e<o;e++)a[e](i)},Ex.prototype.State=Kb;function Dx(e){let t={};e||={},t.src_Any=Lv.source,t.src_Cc=Rv.source,t.src_Z=Hv.source,t.src_P=Bv.source,t.src_ZPCc=[t.src_Z,t.src_P,t.src_Cc].join(`|`),t.src_ZCc=[t.src_Z,t.src_Cc].join(`|`);let n=`[><|]`;return t.src_pseudo_letter=`(?:(?!${n}|${t.src_ZPCc})${t.src_Any})`,t.src_ip4=`(?:(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)`,t.src_auth=`(?:(?:(?!${t.src_ZCc}|[@/\\[\\]()]).){1,50}@)?`,t.src_port=`(?::(?:6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))|[1-5]?\\d{1,4}))?`,t.src_host_terminator=`(?=$|${n}|${t.src_ZPCc})(?!${e[`---`]?`-(?!--)|`:`-|`}_|:\\d|\\.-|\\.(?!$|${t.src_ZPCc}))`,t.src_path=`(?:[/?#](?:(?!${t.src_ZCc}|${n}|[()[\\]{}.,"'?!\\-;]).|\\[(?:(?!${t.src_ZCc}|\\]).)*\\]|\\((?:(?!${t.src_ZCc}|[)]).)*\\)|\\{(?:(?!${t.src_ZCc}|[}]).)*\\}|\\"(?:(?!${t.src_ZCc}|["]).)+\\"|\\'(?:(?!${t.src_ZCc}|[']).)+\\'|\\'(?=${t.src_pseudo_letter}|[-])|\\.{2,}[a-zA-Z0-9%/&]|\\.(?!${t.src_ZCc}|[.]|$)|`+(e[`---`]?`\\-(?!--(?:[^-]|$))(?:-*)|`:`\\-+|`)+`,(?!${t.src_ZCc}|$)|;(?!${t.src_ZCc}|$)|\\!+(?!${t.src_ZCc}|[!]|$)|\\?(?!${t.src_ZCc}|[?]|$))+|\\/)?`,t.src_email_name=`[\\-;:&=\\+\\$,\\.a-zA-Z0-9_][\\-;:&=\\+\\$,\\"\\.a-zA-Z0-9_]{0,63}`,t.src_xn=`xn--[a-z0-9\\-]{1,59}`,t.src_domain_root=`(?:`+t.src_xn+`|${t.src_pseudo_letter}{1,63})`,t.src_domain=`(?:`+t.src_xn+`|(?:${t.src_pseudo_letter})|(?:${t.src_pseudo_letter}(?:-|${t.src_pseudo_letter}){0,61}${t.src_pseudo_letter}))`,t.src_host=`(?:(?:(?:(?:${t.src_domain})\\.)*${t.src_domain}))`,t.tpl_host_fuzzy=`(?:`+t.src_ip4+`|(?:(?:(?:${t.src_domain})\\.)+(?:%TLDS%)))`,t.tpl_host_no_ip_fuzzy=`(?:(?:(?:${t.src_domain})\\.)+(?:%TLDS%))`,t.src_host_strict=t.src_host+t.src_host_terminator,t.tpl_host_fuzzy_strict=t.tpl_host_fuzzy+t.src_host_terminator,t.src_host_port_strict=t.src_host+t.src_port+t.src_host_terminator,t.tpl_host_port_fuzzy_strict=t.tpl_host_fuzzy+t.src_port+t.src_host_terminator,t.tpl_host_port_no_ip_fuzzy_strict=t.tpl_host_no_ip_fuzzy+t.src_port+t.src_host_terminator,t.tpl_host_fuzzy_test=`localhost|www\\.|\\.\\d{1,3}\\.|(?:\\.(?:%TLDS%)(?:${t.src_ZPCc}|>|$))`,t.tpl_email_fuzzy=`(^|${n}|"|\\(|${t.src_ZCc})(${t.src_email_name}@${t.tpl_host_fuzzy_strict})`,t.tpl_link_fuzzy=`(^|(?![.:/\\-_@])(?:[$+<=>^\`|\uff5c]|${t.src_ZPCc}))((?![$+<=>^\`|\uff5c])${t.tpl_host_port_fuzzy_strict}${t.src_path})`,t.tpl_link_no_ip_fuzzy=`(^|(?![.:/\\-_@])(?:[$+<=>^\`|\uff5c]|${t.src_ZPCc}))((?![$+<=>^\`|\uff5c])${t.tpl_host_port_no_ip_fuzzy_strict}${t.src_path})`,t}function Ox(e){return Array.prototype.slice.call(arguments,1).forEach(function(t){t&&Object.keys(t).forEach(function(n){e[n]=t[n]})}),e}function kx(e){return Object.prototype.toString.call(e)}function Ax(e){return kx(e)===`[object String]`}function jx(e){return kx(e)===`[object Object]`}function Mx(e){return kx(e)===`[object RegExp]`}function Nx(e){return kx(e)===`[object Function]`}function Px(e){return e.replace(/[.?*+^$[\]\\(){}|-]/g,`\\$&`)}var Fx={fuzzyLink:!0,fuzzyEmail:!0,fuzzyIP:!1};function Ix(e){return Object.keys(e||{}).reduce(function(e,t){return e||Fx.hasOwnProperty(t)},!1)}var Lx={"http:":{validate:function(e,t,n){let r=e.slice(t);return n.re.http||(n.re.http=RegExp(`^\\/\\/${n.re.src_auth}${n.re.src_host_port_strict}${n.re.src_path}`,`i`)),n.re.http.test(r)?r.match(n.re.http)[0].length:0}},"https:":`http:`,"ftp:":`http:`,"//":{validate:function(e,t,n){let r=e.slice(t);return n.re.no_http||(n.re.no_http=RegExp(`^`+n.re.src_auth+`(?:localhost|(?:(?:${n.re.src_domain})\\.)+${n.re.src_domain_root})`+n.re.src_port+n.re.src_host_terminator+n.re.src_path,`i`)),n.re.no_http.test(r)?t>=3&&e[t-3]===`:`||t>=3&&e[t-3]===`/`?0:r.match(n.re.no_http)[0].length:0}},"mailto:":{validate:function(e,t,n){let r=e.slice(t);return n.re.mailto||(n.re.mailto=RegExp(`^${n.re.src_email_name}@${n.re.src_host_strict}`,`i`)),n.re.mailto.test(r)?r.match(n.re.mailto)[0].length:0}}},Rx=`a[cdefgilmnoqrstuwxz]|b[abdefghijmnorstvwyz]|c[acdfghiklmnoruvwxyz]|d[ejkmoz]|e[cegrstu]|f[ijkmor]|g[abdefghilmnpqrstuwy]|h[kmnrtu]|i[delmnoqrst]|j[emop]|k[eghimnprwyz]|l[abcikrstuvy]|m[acdeghklmnopqrstuvwxyz]|n[acefgilopruz]|om|p[aefghklmnrstwy]|qa|r[eosuw]|s[abcdeghijklmnortuvxyz]|t[cdfghjklmnortvwz]|u[agksyz]|v[aceginu]|w[fs]|y[et]|z[amw]`,zx=`biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф`.split(`|`);function Bx(e){return function(t,n){let r=t.slice(n);return e.test(r)?r.match(e)[0].length:0}}function Vx(){return function(e,t){t.normalize(e)}}function Hx(e){let t=e.re=Dx(e.__opts__),n=e.__tlds__.slice();e.onCompile(),e.__tlds_replaced__||n.push(Rx),n.push(t.src_xn),t.src_tlds=n.join(`|`);function r(e){return e.replace(`%TLDS%`,t.src_tlds)}t.email_fuzzy=RegExp(r(t.tpl_email_fuzzy),`i`),t.email_fuzzy_global=RegExp(r(t.tpl_email_fuzzy),`ig`),t.link_fuzzy=RegExp(r(t.tpl_link_fuzzy),`i`),t.link_fuzzy_global=RegExp(r(t.tpl_link_fuzzy),`ig`),t.link_no_ip_fuzzy=RegExp(r(t.tpl_link_no_ip_fuzzy),`i`),t.link_no_ip_fuzzy_global=RegExp(r(t.tpl_link_no_ip_fuzzy),`ig`),t.host_fuzzy_test=RegExp(r(t.tpl_host_fuzzy_test),`i`);let i=[];e.__compiled__={};function a(e,t){throw Error(`(LinkifyIt) Invalid schema "${e}": ${t}`)}Object.keys(e.__schemas__).forEach(function(t){let n=e.__schemas__[t];if(n===null)return;let r={validate:null,link:null};if(e.__compiled__[t]=r,jx(n)){Mx(n.validate)?r.validate=Bx(n.validate):Nx(n.validate)?r.validate=n.validate:a(t,n),Nx(n.normalize)?r.normalize=n.normalize:n.normalize?a(t,n):r.normalize=Vx();return}if(Ax(n)){i.push(t);return}a(t,n)}),i.forEach(function(t){e.__compiled__[e.__schemas__[t]]&&(e.__compiled__[t].validate=e.__compiled__[e.__schemas__[t]].validate,e.__compiled__[t].normalize=e.__compiled__[e.__schemas__[t]].normalize)}),e.__compiled__[``]={validate:null,normalize:Vx()};let o=Object.keys(e.__compiled__).filter(function(t){return t.length>0&&e.__compiled__[t]}).map(Px).join(`|`);e.re.schema_test=RegExp(`(^|(?!_)(?:[><\uff5c]|${t.src_ZPCc}))(${o})`,`i`),e.re.schema_search=RegExp(`(^|(?!_)(?:[><\uff5c]|${t.src_ZPCc}))(${o})`,`ig`),e.re.schema_at_start=RegExp(`^${e.re.schema_search.source}`,`i`),e.re.pretest=RegExp(`(${e.re.schema_test.source})|(${e.re.host_fuzzy_test.source})|@`,`i`)}function Ux(e,t,n,r){let i=e.slice(n,r);this.schema=t.toLowerCase(),this.index=n,this.lastIndex=r,this.raw=i,this.text=i,this.url=i}function Wx(e,t){if(!(this instanceof Wx))return new Wx(e,t);t||Ix(e)&&(t=e,e={}),this.__opts__=Ox({},Fx,t),this.__schemas__=Ox({},Lx,e),this.__compiled__={},this.__tlds__=zx,this.__tlds_replaced__=!1,this.re={},Hx(this)}Wx.prototype.add=function(e,t){return this.__schemas__[e]=t,Hx(this),this},Wx.prototype.set=function(e){return this.__opts__=Ox(this.__opts__,e),this},Wx.prototype.test=function(e){if(!e.length)return!1;let t,n;if(this.re.schema_test.test(e)){for(n=this.re.schema_search,n.lastIndex=0;(t=n.exec(e))!==null;)if(this.testSchemaAt(e,t[2],n.lastIndex))return!0}return!!(this.__opts__.fuzzyLink&&this.__compiled__[`http:`]&&e.search(this.re.host_fuzzy_test)>=0&&e.match(this.__opts__.fuzzyIP?this.re.link_fuzzy:this.re.link_no_ip_fuzzy)!==null||this.__opts__.fuzzyEmail&&this.__compiled__[`mailto:`]&&e.indexOf(`@`)>=0&&e.match(this.re.email_fuzzy)!==null)},Wx.prototype.pretest=function(e){return this.re.pretest.test(e)},Wx.prototype.testSchemaAt=function(e,t,n){return this.__compiled__[t.toLowerCase()]?this.__compiled__[t.toLowerCase()].validate(e,n,this):0},Wx.prototype.match=function(e){let t=[],n=[],r=[],i=[],a,o,s;function c(e,t){return e?t?e.index===t.index?e.lastIndex>=t.lastIndex?e:t:e.index<t.index?e:t:e:t}if(!e.length)return null;if(this.re.schema_test.test(e))for(s=this.re.schema_search,s.lastIndex=0;(a=s.exec(e))!==null;)o=this.testSchemaAt(e,a[2],s.lastIndex),o&&n.push({schema:a[2],index:a.index+a[1].length,lastIndex:a.index+a[0].length+o});if(this.__opts__.fuzzyLink&&this.__compiled__[`http:`])for(s=this.__opts__.fuzzyIP?this.re.link_fuzzy_global:this.re.link_no_ip_fuzzy_global,s.lastIndex=0;(a=s.exec(e))!==null;)r.push({schema:``,index:a.index+a[1].length,lastIndex:a.index+a[0].length});if(this.__opts__.fuzzyEmail&&this.__compiled__[`mailto:`])for(s=this.re.email_fuzzy_global,s.lastIndex=0;(a=s.exec(e))!==null;)i.push({schema:`mailto:`,index:a.index+a[1].length,lastIndex:a.index+a[0].length});let l=[0,0,0],u=0;for(;;){let a=[n[l[0]],i[l[1]],r[l[2]]],o=c(c(a[0],a[1]),a[2]);if(!o)break;if(o===a[0]?l[0]++:o===a[1]?l[1]++:l[2]++,o.index<u)continue;let s=new Ux(e,o.schema,o.index,o.lastIndex);this.__compiled__[s.schema].normalize(s,this),t.push(s),u=o.lastIndex}return t.length?t:null},Wx.prototype.matchAtStart=function(e){if(!e.length)return null;let t=this.re.schema_at_start.exec(e);if(!t)return null;let n=this.testSchemaAt(e,t[2],t[0].length);if(!n)return null;let r=new Ux(e,t[2],t.index+t[1].length,t.index+t[0].length+n);return this.__compiled__[r.schema].normalize(r,this),r},Wx.prototype.tlds=function(e,t){return e=Array.isArray(e)?e:[e],t?(this.__tlds__=this.__tlds__.concat(e).sort().filter(function(e,t,n){return e!==n[t-1]}).reverse(),Hx(this),this):(this.__tlds__=e.slice(),this.__tlds_replaced__=!0,Hx(this),this)},Wx.prototype.normalize=function(e){e.schema||(e.url=`http://${e.url}`),e.schema===`mailto:`&&!/^mailto:/i.test(e.url)&&(e.url=`mailto:${e.url}`)},Wx.prototype.onCompile=function(){};var Gx=2147483647,Kx=36,qx=1,Jx=26,Yx=38,Xx=700,Zx=72,Qx=128,$x=`-`,eS=/^xn--/,tS=/[^\0-\x7F]/,nS=/[\x2E\u3002\uFF0E\uFF61]/g,rS={overflow:`Overflow: input needs wider integers to process`,"not-basic":`Illegal input >= 0x80 (not a basic code point)`,"invalid-input":`Invalid input`},iS=Kx-qx,aS=Math.floor,oS=String.fromCharCode;function sS(e){throw RangeError(rS[e])}function cS(e,t){let n=[],r=e.length;for(;r--;)n[r]=t(e[r]);return n}function lS(e,t){let n=e.split(`@`),r=``;n.length>1&&(r=n[0]+`@`,e=n[1]),e=e.replace(nS,`.`);let i=cS(e.split(`.`),t).join(`.`);return r+i}function uS(e){let t=[],n=0,r=e.length;for(;n<r;){let i=e.charCodeAt(n++);if(i>=55296&&i<=56319&&n<r){let r=e.charCodeAt(n++);(r&64512)==56320?t.push(((i&1023)<<10)+(r&1023)+65536):(t.push(i),n--)}else t.push(i)}return t}var dS=e=>String.fromCodePoint(...e),fS=function(e){return e>=48&&e<58?26+(e-48):e>=65&&e<91?e-65:e>=97&&e<123?e-97:Kx},pS=function(e,t){return e+22+75*(e<26)-((t!=0)<<5)},mS=function(e,t,n){let r=0;for(e=n?aS(e/Xx):e>>1,e+=aS(e/t);e>455;r+=Kx)e=aS(e/iS);return aS(r+36*e/(e+Yx))},hS=function(e){let t=[],n=e.length,r=0,i=Qx,a=Zx,o=e.lastIndexOf($x);o<0&&(o=0);for(let n=0;n<o;++n)e.charCodeAt(n)>=128&&sS(`not-basic`),t.push(e.charCodeAt(n));for(let s=o>0?o+1:0;s<n;){let o=r;for(let t=1,i=Kx;;i+=Kx){s>=n&&sS(`invalid-input`);let o=fS(e.charCodeAt(s++));o>=Kx&&sS(`invalid-input`),o>aS((Gx-r)/t)&&sS(`overflow`),r+=o*t;let c=i<=a?qx:i>=a+Jx?Jx:i-a;if(o<c)break;let l=Kx-c;t>aS(Gx/l)&&sS(`overflow`),t*=l}let c=t.length+1;a=mS(r-o,c,o==0),aS(r/c)>Gx-i&&sS(`overflow`),i+=aS(r/c),r%=c,t.splice(r++,0,i)}return String.fromCodePoint(...t)},gS=function(e){let t=[];e=uS(e);let n=e.length,r=Qx,i=0,a=Zx;for(let n of e)n<128&&t.push(oS(n));let o=t.length,s=o;for(o&&t.push($x);s<n;){let n=Gx;for(let t of e)t>=r&&t<n&&(n=t);let c=s+1;n-r>aS((Gx-i)/c)&&sS(`overflow`),i+=(n-r)*c,r=n;for(let n of e)if(n<r&&++i>Gx&&sS(`overflow`),n===r){let e=i;for(let n=Kx;;n+=Kx){let r=n<=a?qx:n>=a+Jx?Jx:n-a;if(e<r)break;let i=e-r,o=Kx-r;t.push(oS(pS(r+i%o,0))),e=aS(i/o)}t.push(oS(pS(e,0))),a=mS(i,c,s===o),i=0,++s}++i,++r}return t.join(``)},_S={version:`2.3.1`,ucs2:{decode:uS,encode:dS},decode:hS,encode:gS,toASCII:function(e){return lS(e,function(e){return tS.test(e)?`xn--`+gS(e):e})},toUnicode:function(e){return lS(e,function(e){return eS.test(e)?hS(e.slice(4).toLowerCase()):e})}},vS={default:{options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:`language-`,linkify:!1,typographer:!1,quotes:`“”‘’`,highlight:null,maxNesting:100},components:{core:{},block:{},inline:{}}},zero:{options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:`language-`,linkify:!1,typographer:!1,quotes:`“”‘’`,highlight:null,maxNesting:20},components:{core:{rules:[`normalize`,`block`,`inline`,`text_join`]},block:{rules:[`paragraph`]},inline:{rules:[`text`],rules2:[`balance_pairs`,`fragments_join`]}}},commonmark:{options:{html:!0,xhtmlOut:!0,breaks:!1,langPrefix:`language-`,linkify:!1,typographer:!1,quotes:`“”‘’`,highlight:null,maxNesting:20},components:{core:{rules:[`normalize`,`block`,`inline`,`text_join`]},block:{rules:[`blockquote`,`code`,`fence`,`heading`,`hr`,`html_block`,`lheading`,`list`,`reference`,`paragraph`]},inline:{rules:[`autolink`,`backticks`,`emphasis`,`entity`,`escape`,`html_inline`,`image`,`link`,`newline`,`text`],rules2:[`balance_pairs`,`emphasis`,`fragments_join`]}}}},yS=/^(vbscript|javascript|file|data):/,bS=/^data:image\/(gif|png|jpeg|webp);/;function xS(e){let t=e.trim().toLowerCase();return!yS.test(t)||bS.test(t)}var SS=[`http:`,`https:`,`mailto:`];function CS(e){let t=Fv(e,!0);if(t.hostname&&(!t.protocol||SS.indexOf(t.protocol)>=0))try{t.hostname=_S.toASCII(t.hostname)}catch{}return Sv(Cv(t))}function wS(e){let t=Fv(e,!0);if(t.hostname&&(!t.protocol||SS.indexOf(t.protocol)>=0))try{t.hostname=_S.toUnicode(t.hostname)}catch{}return yv(Cv(t),yv.defaultChars+`%`)}function TS(e,t){if(!(this instanceof TS))return new TS(e,t);t||fy(e)||(t=e||{},e=`default`),this.inline=new Ex,this.block=new Gb,this.core=new xb,this.renderer=new Ky,this.linkify=new Wx,this.validateLink=xS,this.normalizeLink=CS,this.normalizeLinkText=wS,this.utils=uy,this.helpers=hy({},Wy),this.options={},this.configure(e),t&&this.set(t)}TS.prototype.set=function(e){return hy(this.options,e),this},TS.prototype.configure=function(e){let t=this;if(fy(e)){let t=e;if(e=vS[t],!e)throw Error('Wrong `markdown-it` preset "'+t+`", check name`)}if(!e)throw Error("Wrong `markdown-it` preset, can't be empty");return e.options&&t.set(e.options),e.components&&Object.keys(e.components).forEach(function(n){e.components[n].rules&&t[n].ruler.enableOnly(e.components[n].rules),e.components[n].rules2&&t[n].ruler2.enableOnly(e.components[n].rules2)}),this},TS.prototype.enable=function(e,t){let n=[];Array.isArray(e)||(e=[e]),[`core`,`block`,`inline`].forEach(function(t){n=n.concat(this[t].ruler.enable(e,!0))},this),n=n.concat(this.inline.ruler2.enable(e,!0));let r=e.filter(function(e){return n.indexOf(e)<0});if(r.length&&!t)throw Error(`MarkdownIt. Failed to enable unknown rule(s): `+r);return this},TS.prototype.disable=function(e,t){let n=[];Array.isArray(e)||(e=[e]),[`core`,`block`,`inline`].forEach(function(t){n=n.concat(this[t].ruler.disable(e,!0))},this),n=n.concat(this.inline.ruler2.disable(e,!0));let r=e.filter(function(e){return n.indexOf(e)<0});if(r.length&&!t)throw Error(`MarkdownIt. Failed to disable unknown rule(s): `+r);return this},TS.prototype.use=function(e){let t=[this].concat(Array.prototype.slice.call(arguments,1));return e.apply(e,t),this},TS.prototype.parse=function(e,t){if(typeof e!=`string`)throw Error(`Input data should be a String`);let n=new this.core.State(e,this,t);return this.core.process(n),n.tokens},TS.prototype.render=function(e,t){return t||={},this.renderer.render(this.parse(e,t),this.options,t)},TS.prototype.parseInline=function(e,t){let n=new this.core.State(e,this,t);return n.inlineMode=!0,this.core.process(n),n.tokens},TS.prototype.renderInline=function(e,t){return t||={},this.renderer.render(this.parseInline(e,t),this.options,t)};var ES=l(o(((e,t)=>{function n(e){return e instanceof Map?e.clear=e.delete=e.set=function(){throw Error(`map is read-only`)}:e instanceof Set&&(e.add=e.clear=e.delete=function(){throw Error(`set is read-only`)}),Object.freeze(e),Object.getOwnPropertyNames(e).forEach(t=>{let r=e[t],i=typeof r;(i===`object`||i===`function`)&&!Object.isFrozen(r)&&n(r)}),e}var r=class{constructor(e){e.data===void 0&&(e.data={}),this.data=e.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}};function i(e){return e.replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`).replace(/"/g,`"`).replace(/'/g,`'`)}function a(e,...t){let n=Object.create(null);for(let t in e)n[t]=e[t];return t.forEach(function(e){for(let t in e)n[t]=e[t]}),n}var o=`</span>`,s=e=>!!e.scope,c=(e,{prefix:t})=>{if(e.startsWith(`language:`))return e.replace(`language:`,`language-`);if(e.includes(`.`)){let n=e.split(`.`);return[`${t}${n.shift()}`,...n.map((e,t)=>`${e}${`_`.repeat(t+1)}`)].join(` `)}return`${t}${e}`},l=class{constructor(e,t){this.buffer=``,this.classPrefix=t.classPrefix,e.walk(this)}addText(e){this.buffer+=i(e)}openNode(e){if(!s(e))return;let t=c(e.scope,{prefix:this.classPrefix});this.span(t)}closeNode(e){s(e)&&(this.buffer+=o)}value(){return this.buffer}span(e){this.buffer+=`<span class="${e}">`}},u=(e={})=>{let t={children:[]};return Object.assign(t,e),t},d=class e{constructor(){this.rootNode=u(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(e){this.top.children.push(e)}openNode(e){let t=u({scope:e});this.add(t),this.stack.push(t)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(e){return this.constructor._walk(e,this.rootNode)}static _walk(e,t){return typeof t==`string`?e.addText(t):t.children&&(e.openNode(t),t.children.forEach(t=>this._walk(e,t)),e.closeNode(t)),e}static _collapse(t){typeof t!=`string`&&t.children&&(t.children.every(e=>typeof e==`string`)?t.children=[t.children.join(``)]:t.children.forEach(t=>{e._collapse(t)}))}},f=class extends d{constructor(e){super(),this.options=e}addText(e){e!==``&&this.add(e)}startScope(e){this.openNode(e)}endScope(){this.closeNode()}__addSublanguage(e,t){let n=e.root;t&&(n.scope=`language:${t}`),this.add(n)}toHTML(){return new l(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}};function p(e){return e?typeof e==`string`?e:e.source:null}function m(e){return _(`(?=`,e,`)`)}function h(e){return _(`(?:`,e,`)*`)}function g(e){return _(`(?:`,e,`)?`)}function _(...e){return e.map(e=>p(e)).join(``)}function v(e){let t=e[e.length-1];return typeof t==`object`&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function y(...e){return`(`+(v(e).capture?``:`?:`)+e.map(e=>p(e)).join(`|`)+`)`}function b(e){return RegExp(e.toString()+`|`).exec(``).length-1}function x(e,t){let n=e&&e.exec(t);return n&&n.index===0}var S=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function C(e,{joinWith:t}){let n=0;return e.map(e=>{n+=1;let t=n,r=p(e),i=``;for(;r.length>0;){let e=S.exec(r);if(!e){i+=r;break}i+=r.substring(0,e.index),r=r.substring(e.index+e[0].length),e[0][0]===`\\`&&e[1]?i+=`\\`+String(Number(e[1])+t):(i+=e[0],e[0]===`(`&&n++)}return i}).map(e=>`(${e})`).join(t)}var w=/\b\B/,T=`[a-zA-Z]\\w*`,E=`[a-zA-Z_]\\w*`,D=`\\b\\d+(\\.\\d+)?`,O=`(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)`,k=`\\b(0b[01]+)`,A=`!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~`,j=(e={})=>{let t=/^#![ ]*\//;return e.binary&&(e.begin=_(t,/.*\b/,e.binary,/\b.*/)),a({scope:`meta`,begin:t,end:/$/,relevance:0,"on:begin":(e,t)=>{e.index!==0&&t.ignoreMatch()}},e)},M={begin:`\\\\[\\s\\S]`,relevance:0},N={scope:`string`,begin:`'`,end:`'`,illegal:`\\n`,contains:[M]},P={scope:`string`,begin:`"`,end:`"`,illegal:`\\n`,contains:[M]},F={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},I=function(e,t,n={}){let r=a({scope:`comment`,begin:e,end:t,contains:[]},n);r.contains.push({scope:`doctag`,begin:`[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)`,end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});let i=y(`I`,`a`,`is`,`so`,`us`,`to`,`at`,`if`,`in`,`it`,`on`,/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return r.contains.push({begin:_(/[ ]+/,`(`,i,/[.]?[:]?([.][ ]|[ ])/,`){3}`)}),r},L=I(`//`,`$`),ee=I(`/\\*`,`\\*/`),te=I(`#`,`$`),ne=Object.freeze({__proto__:null,APOS_STRING_MODE:N,BACKSLASH_ESCAPE:M,BINARY_NUMBER_MODE:{scope:`number`,begin:k,relevance:0},BINARY_NUMBER_RE:k,COMMENT:I,C_BLOCK_COMMENT_MODE:ee,C_LINE_COMMENT_MODE:L,C_NUMBER_MODE:{scope:`number`,begin:O,relevance:0},C_NUMBER_RE:O,END_SAME_AS_BEGIN:function(e){return Object.assign(e,{"on:begin":(e,t)=>{t.data._beginMatch=e[1]},"on:end":(e,t)=>{t.data._beginMatch!==e[1]&&t.ignoreMatch()}})},HASH_COMMENT_MODE:te,IDENT_RE:T,MATCH_NOTHING_RE:w,METHOD_GUARD:{begin:`\\.\\s*[a-zA-Z_]\\w*`,relevance:0},NUMBER_MODE:{scope:`number`,begin:D,relevance:0},NUMBER_RE:D,PHRASAL_WORDS_MODE:F,QUOTE_STRING_MODE:P,REGEXP_MODE:{scope:`regexp`,begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[M,{begin:/\[/,end:/\]/,relevance:0,contains:[M]}]},RE_STARTERS_RE:A,SHEBANG:j,TITLE_MODE:{scope:`title`,begin:T,relevance:0},UNDERSCORE_IDENT_RE:E,UNDERSCORE_TITLE_MODE:{scope:`title`,begin:E,relevance:0}});function re(e,t){e.input[e.index-1]===`.`&&t.ignoreMatch()}function ie(e,t){e.className!==void 0&&(e.scope=e.className,delete e.className)}function R(e,t){t&&e.beginKeywords&&(e.begin=`\\b(`+e.beginKeywords.split(` `).join(`|`)+`)(?!\\.)(?=\\b|\\s)`,e.__beforeBegin=re,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,e.relevance===void 0&&(e.relevance=0))}function ae(e,t){Array.isArray(e.illegal)&&(e.illegal=y(...e.illegal))}function oe(e,t){if(e.match){if(e.begin||e.end)throw Error(`begin & end are not supported with match`);e.begin=e.match,delete e.match}}function z(e,t){e.relevance===void 0&&(e.relevance=1)}var se=(e,t)=>{if(!e.beforeMatch)return;if(e.starts)throw Error(`beforeMatch cannot be used with starts`);let n=Object.assign({},e);Object.keys(e).forEach(t=>{delete e[t]}),e.keywords=n.keywords,e.begin=_(n.beforeMatch,m(n.begin)),e.starts={relevance:0,contains:[Object.assign(n,{endsParent:!0})]},e.relevance=0,delete n.beforeMatch},ce=[`of`,`and`,`for`,`in`,`not`,`or`,`if`,`then`,`parent`,`list`,`value`],le=`keyword`;function ue(e,t,n=le){let r=Object.create(null);return typeof e==`string`?i(n,e.split(` `)):Array.isArray(e)?i(n,e):Object.keys(e).forEach(function(n){Object.assign(r,ue(e[n],t,n))}),r;function i(e,n){t&&(n=n.map(e=>e.toLowerCase())),n.forEach(function(t){let n=t.split(`|`);r[n[0]]=[e,de(n[0],n[1])]})}}function de(e,t){return t?Number(t):+!fe(e)}function fe(e){return ce.includes(e.toLowerCase())}var pe={},me=e=>{console.error(e)},he=(e,...t)=>{console.log(`WARN: ${e}`,...t)},ge=(e,t)=>{pe[`${e}/${t}`]||(console.log(`Deprecated as of ${e}. ${t}`),pe[`${e}/${t}`]=!0)},_e=Error();function ve(e,t,{key:n}){let r=0,i=e[n],a={},o={};for(let e=1;e<=t.length;e++)o[e+r]=i[e],a[e+r]=!0,r+=b(t[e-1]);e[n]=o,e[n]._emit=a,e[n]._multi=!0}function ye(e){if(Array.isArray(e.begin)){if(e.skip||e.excludeBegin||e.returnBegin)throw me(`skip, excludeBegin, returnBegin not compatible with beginScope: {}`),_e;if(typeof e.beginScope!=`object`||e.beginScope===null)throw me(`beginScope must be object`),_e;ve(e,e.begin,{key:`beginScope`}),e.begin=C(e.begin,{joinWith:``})}}function be(e){if(Array.isArray(e.end)){if(e.skip||e.excludeEnd||e.returnEnd)throw me(`skip, excludeEnd, returnEnd not compatible with endScope: {}`),_e;if(typeof e.endScope!=`object`||e.endScope===null)throw me(`endScope must be object`),_e;ve(e,e.end,{key:`endScope`}),e.end=C(e.end,{joinWith:``})}}function xe(e){e.scope&&typeof e.scope==`object`&&e.scope!==null&&(e.beginScope=e.scope,delete e.scope)}function Se(e){xe(e),typeof e.beginScope==`string`&&(e.beginScope={_wrap:e.beginScope}),typeof e.endScope==`string`&&(e.endScope={_wrap:e.endScope}),ye(e),be(e)}function Ce(e){function t(t,n){return new RegExp(p(t),`m`+(e.case_insensitive?`i`:``)+(e.unicodeRegex?`u`:``)+(n?`g`:``))}class n{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(e,t){t.position=this.position++,this.matchIndexes[this.matchAt]=t,this.regexes.push([t,e]),this.matchAt+=b(e)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);let e=this.regexes.map(e=>e[1]);this.matcherRe=t(C(e,{joinWith:`|`}),!0),this.lastIndex=0}exec(e){this.matcherRe.lastIndex=this.lastIndex;let t=this.matcherRe.exec(e);if(!t)return null;let n=t.findIndex((e,t)=>t>0&&e!==void 0),r=this.matchIndexes[n];return t.splice(0,n),Object.assign(t,r)}}class r{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(e){if(this.multiRegexes[e])return this.multiRegexes[e];let t=new n;return this.rules.slice(e).forEach(([e,n])=>t.addRule(e,n)),t.compile(),this.multiRegexes[e]=t,t}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(e,t){this.rules.push([e,t]),t.type===`begin`&&this.count++}exec(e){let t=this.getMatcher(this.regexIndex);t.lastIndex=this.lastIndex;let n=t.exec(e);if(this.resumingScanAtSamePosition()&&!(n&&n.index===this.lastIndex)){let t=this.getMatcher(0);t.lastIndex=this.lastIndex+1,n=t.exec(e)}return n&&(this.regexIndex+=n.position+1,this.regexIndex===this.count&&this.considerAll()),n}}function i(e){let t=new r;return e.contains.forEach(e=>t.addRule(e.begin,{rule:e,type:`begin`})),e.terminatorEnd&&t.addRule(e.terminatorEnd,{type:`end`}),e.illegal&&t.addRule(e.illegal,{type:`illegal`}),t}function o(n,r){let a=n;if(n.isCompiled)return a;[ie,oe,Se,se].forEach(e=>e(n,r)),e.compilerExtensions.forEach(e=>e(n,r)),n.__beforeBegin=null,[R,ae,z].forEach(e=>e(n,r)),n.isCompiled=!0;let s=null;return typeof n.keywords==`object`&&n.keywords.$pattern&&(n.keywords=Object.assign({},n.keywords),s=n.keywords.$pattern,delete n.keywords.$pattern),s||=/\w+/,n.keywords&&=ue(n.keywords,e.case_insensitive),a.keywordPatternRe=t(s,!0),r&&(n.begin||=/\B|\b/,a.beginRe=t(a.begin),!n.end&&!n.endsWithParent&&(n.end=/\B|\b/),n.end&&(a.endRe=t(a.end)),a.terminatorEnd=p(a.end)||``,n.endsWithParent&&r.terminatorEnd&&(a.terminatorEnd+=(n.end?`|`:``)+r.terminatorEnd)),n.illegal&&(a.illegalRe=t(n.illegal)),n.contains||=[],n.contains=[].concat(...n.contains.map(function(e){return Te(e===`self`?n:e)})),n.contains.forEach(function(e){o(e,a)}),n.starts&&o(n.starts,r),a.matcher=i(a),a}if(e.compilerExtensions||=[],e.contains&&e.contains.includes(`self`))throw Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return e.classNameAliases=a(e.classNameAliases||{}),o(e)}function we(e){return e?e.endsWithParent||we(e.starts):!1}function Te(e){return e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map(function(t){return a(e,{variants:null},t)})),e.cachedVariants?e.cachedVariants:we(e)?a(e,{starts:e.starts?a(e.starts):null}):Object.isFrozen(e)?a(e):e}var Ee=`11.11.1`,De=class extends Error{constructor(e,t){super(e),this.name=`HTMLInjectionError`,this.html=t}},Oe=i,ke=a,Ae=Symbol(`nomatch`),je=7,Me=function(e){let t=Object.create(null),i=Object.create(null),a=[],o=!0,s=`Could not find the language '{}', did you forget to load/include a language module?`,c={disableAutodetect:!0,name:`Plain text`,contains:[]},l={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:`hljs-`,cssSelector:`pre code`,languages:null,__emitter:f};function u(e){return l.noHighlightRe.test(e)}function d(e){let t=e.className+` `;t+=e.parentNode?e.parentNode.className:``;let n=l.languageDetectRe.exec(t);if(n){let t=N(n[1]);return t||(he(s.replace(`{}`,n[1])),he(`Falling back to no-highlight mode for this block.`,e)),t?n[1]:`no-highlight`}return t.split(/\s+/).find(e=>u(e)||N(e))}function p(e,t,n){let r=``,i=``;typeof t==`object`?(r=e,n=t.ignoreIllegals,i=t.language):(ge(`10.7.0`,`highlight(lang, code, ...args) has been deprecated.`),ge(`10.7.0`,`Please use highlight(code, options) instead.
|
|
65
66
|
https://github.com/highlightjs/highlight.js/issues/2277`),i=e,r=t),n===void 0&&(n=!0);let a={code:r,language:i};te(`before:highlight`,a);let o=a.result?a.result:v(a.language,a.code,n);return o.code=a.code,te(`after:highlight`,o),o}function v(e,n,i,a){let c=Object.create(null);function u(e,t){return e.keywords[t]}function d(){if(!A.keywords){M.addText(P);return}let e=0;A.keywordPatternRe.lastIndex=0;let t=A.keywordPatternRe.exec(P),n=``;for(;t;){n+=P.substring(e,t.index);let r=D.case_insensitive?t[0].toLowerCase():t[0],i=u(A,r);if(i){let[e,a]=i;if(M.addText(n),n=``,c[r]=(c[r]||0)+1,c[r]<=je&&(F+=a),e.startsWith(`_`))n+=t[0];else{let n=D.classNameAliases[e]||e;m(t[0],n)}}else n+=t[0];e=A.keywordPatternRe.lastIndex,t=A.keywordPatternRe.exec(P)}n+=P.substring(e),M.addText(n)}function f(){if(P===``)return;let e=null;if(typeof A.subLanguage==`string`){if(!t[A.subLanguage]){M.addText(P);return}e=v(A.subLanguage,P,!0,j[A.subLanguage]),j[A.subLanguage]=e._top}else e=S(P,A.subLanguage.length?A.subLanguage:null);A.relevance>0&&(F+=e.relevance),M.__addSublanguage(e._emitter,e.language)}function p(){A.subLanguage==null?d():f(),P=``}function m(e,t){e!==``&&(M.startScope(t),M.addText(e),M.endScope())}function h(e,t){let n=1,r=t.length-1;for(;n<=r;){if(!e._emit[n]){n++;continue}let r=D.classNameAliases[e[n]]||e[n],i=t[n];r?m(i,r):(P=i,d(),P=``),n++}}function g(e,t){return e.scope&&typeof e.scope==`string`&&M.openNode(D.classNameAliases[e.scope]||e.scope),e.beginScope&&(e.beginScope._wrap?(m(P,D.classNameAliases[e.beginScope._wrap]||e.beginScope._wrap),P=``):e.beginScope._multi&&(h(e.beginScope,t),P=``)),A=Object.create(e,{parent:{value:A}}),A}function _(e,t,n){let i=x(e.endRe,n);if(i){if(e[`on:end`]){let n=new r(e);e[`on:end`](t,n),n.isMatchIgnored&&(i=!1)}if(i){for(;e.endsParent&&e.parent;)e=e.parent;return e}}if(e.endsWithParent)return _(e.parent,t,n)}function y(e){return A.matcher.regexIndex===0?(P+=e[0],1):(ee=!0,0)}function b(e){let t=e[0],n=e.rule,i=new r(n),a=[n.__beforeBegin,n[`on:begin`]];for(let n of a)if(n&&(n(e,i),i.isMatchIgnored))return y(t);return n.skip?P+=t:(n.excludeBegin&&(P+=t),p(),!n.returnBegin&&!n.excludeBegin&&(P=t)),g(n,e),n.returnBegin?0:t.length}function C(e){let t=e[0],r=n.substring(e.index),i=_(A,e,r);if(!i)return Ae;let a=A;A.endScope&&A.endScope._wrap?(p(),m(t,A.endScope._wrap)):A.endScope&&A.endScope._multi?(p(),h(A.endScope,e)):a.skip?P+=t:(a.returnEnd||a.excludeEnd||(P+=t),p(),a.excludeEnd&&(P=t));do A.scope&&M.closeNode(),!A.skip&&!A.subLanguage&&(F+=A.relevance),A=A.parent;while(A!==i.parent);return i.starts&&g(i.starts,e),a.returnEnd?0:t.length}function w(){let e=[];for(let t=A;t!==D;t=t.parent)t.scope&&e.unshift(t.scope);e.forEach(e=>M.openNode(e))}let T={};function E(t,r){let a=r&&r[0];if(P+=t,a==null)return p(),0;if(T.type===`begin`&&r.type===`end`&&T.index===r.index&&a===``){if(P+=n.slice(r.index,r.index+1),!o){let t=Error(`0 width match regex (${e})`);throw t.languageName=e,t.badRule=T.rule,t}return 1}if(T=r,r.type===`begin`)return b(r);if(r.type===`illegal`&&!i){let e=Error(`Illegal lexeme "`+a+`" for mode "`+(A.scope||`<unnamed>`)+`"`);throw e.mode=A,e}else if(r.type===`end`){let e=C(r);if(e!==Ae)return e}if(r.type===`illegal`&&a===``)return P+=`
|
|
66
|
-
`,1;if(L>1e5&&L>r.index*3)throw Error(`potential infinite loop, way more iterations than matches`);return P+=a,a.length}let D=N(e);if(!D)throw me(s.replace(`{}`,e)),Error(`Unknown language: "`+e+`"`);let O=Ce(D),k=``,A=a||O,j={},M=new l.__emitter(l);w();let P=``,F=0,I=0,L=0,ee=!1;try{if(D.__emitTokens)D.__emitTokens(n,M);else{for(A.matcher.considerAll();;){L++,ee?ee=!1:A.matcher.considerAll(),A.matcher.lastIndex=I;let e=A.matcher.exec(n);if(!e)break;let t=E(n.substring(I,e.index),e);I=e.index+t}E(n.substring(I))}return M.finalize(),k=M.toHTML(),{language:e,value:k,relevance:F,illegal:!1,_emitter:M,_top:A}}catch(t){if(t.message&&t.message.includes(`Illegal`))return{language:e,value:Oe(n),illegal:!0,relevance:0,_illegalBy:{message:t.message,index:I,context:n.slice(I-100,I+100),mode:t.mode,resultSoFar:k},_emitter:M};if(o)return{language:e,value:Oe(n),illegal:!1,relevance:0,errorRaised:t,_emitter:M,_top:A};throw t}}function b(e){let t={value:Oe(e),illegal:!1,relevance:0,_top:c,_emitter:new l.__emitter(l)};return t._emitter.addText(e),t}function S(e,n){n=n||l.languages||Object.keys(t);let r=b(e),i=n.filter(N).filter(F).map(t=>v(t,e,!1));i.unshift(r);let[a,o]=i.sort((e,t)=>{if(e.relevance!==t.relevance)return t.relevance-e.relevance;if(e.language&&t.language){if(N(e.language).supersetOf===t.language)return 1;if(N(t.language).supersetOf===e.language)return-1}return 0}),s=a;return s.secondBest=o,s}function C(e,t,n){let r=t&&i[t]||n;e.classList.add(`hljs`),e.classList.add(`language-${r}`)}function w(e){let t=null,n=d(e);if(u(n))return;if(te(`before:highlightElement`,{el:e,language:n}),e.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",e);return}if(e.children.length>0&&(l.ignoreUnescapedHTML||(console.warn(`One of your code blocks includes unescaped HTML. This is a potentially serious security risk.`),console.warn(`https://github.com/highlightjs/highlight.js/wiki/security`),console.warn(`The element with unescaped HTML:`),console.warn(e)),l.throwUnescapedHTML))throw new De(`One of your code blocks includes unescaped HTML.`,e.innerHTML);t=e;let r=t.textContent,i=n?p(r,{language:n,ignoreIllegals:!0}):S(r);e.innerHTML=i.value,e.dataset.highlighted=`yes`,C(e,n,i.language),e.result={language:i.language,re:i.relevance,relevance:i.relevance},i.secondBest&&(e.secondBest={language:i.secondBest.language,relevance:i.secondBest.relevance}),te(`after:highlightElement`,{el:e,result:i,text:r})}function T(e){l=ke(l,e)}let E=()=>{k(),ge(`10.6.0`,`initHighlighting() deprecated. Use highlightAll() now.`)};function D(){k(),ge(`10.6.0`,`initHighlightingOnLoad() deprecated. Use highlightAll() now.`)}let O=!1;function k(){function e(){k()}if(document.readyState===`loading`){O||window.addEventListener(`DOMContentLoaded`,e,!1),O=!0;return}document.querySelectorAll(l.cssSelector).forEach(w)}function A(n,r){let i=null;try{i=r(e)}catch(e){if(me(`Language definition for '{}' could not be registered.`.replace(`{}`,n)),o)me(e);else throw e;i=c}i.name||=n,t[n]=i,i.rawDefinition=r.bind(null,e),i.aliases&&P(i.aliases,{languageName:n})}function j(e){delete t[e];for(let t of Object.keys(i))i[t]===e&&delete i[t]}function M(){return Object.keys(t)}function N(e){return e=(e||``).toLowerCase(),t[e]||t[i[e]]}function P(e,{languageName:t}){typeof e==`string`&&(e=[e]),e.forEach(e=>{i[e.toLowerCase()]=t})}function F(e){let t=N(e);return t&&!t.disableAutodetect}function I(e){e[`before:highlightBlock`]&&!e[`before:highlightElement`]&&(e[`before:highlightElement`]=t=>{e[`before:highlightBlock`](Object.assign({block:t.el},t))}),e[`after:highlightBlock`]&&!e[`after:highlightElement`]&&(e[`after:highlightElement`]=t=>{e[`after:highlightBlock`](Object.assign({block:t.el},t))})}function L(e){I(e),a.push(e)}function ee(e){let t=a.indexOf(e);t!==-1&&a.splice(t,1)}function te(e,t){let n=e;a.forEach(function(e){e[n]&&e[n](t)})}function re(e){return ge(`10.7.0`,`highlightBlock will be removed entirely in v12.0`),ge(`10.7.0`,`Please use highlightElement now.`),w(e)}Object.assign(e,{highlight:p,highlightAuto:S,highlightAll:k,highlightElement:w,highlightBlock:re,configure:T,initHighlighting:E,initHighlightingOnLoad:D,registerLanguage:A,unregisterLanguage:j,listLanguages:M,getLanguage:N,registerAliases:P,autoDetection:F,inherit:ke,addPlugin:L,removePlugin:ee}),e.debugMode=function(){o=!1},e.safeMode=function(){o=!0},e.versionString=Ee,e.regex={concat:_,lookahead:m,either:y,optional:g,anyNumberOfTimes:h};for(let e in ne)typeof ne[e]==`object`&&n(ne[e]);return Object.assign(e,ne),e},Ne=Me({});Ne.newInstance=()=>Me({}),t.exports=Ne,Ne.HighlightJS=Ne,Ne.default=Ne}))()).default,ES=`[A-Za-z$_][0-9A-Za-z$_]*`,DS=`as.in.of.if.for.while.finally.var.new.function.do.return.void.else.break.catch.instanceof.with.throw.case.default.try.switch.continue.typeof.delete.let.yield.const.class.debugger.async.await.static.import.from.export.extends.using`.split(`.`),OS=[`true`,`false`,`null`,`undefined`,`NaN`,`Infinity`],kS=`Object.Function.Boolean.Symbol.Math.Date.Number.BigInt.String.RegExp.Array.Float32Array.Float64Array.Int8Array.Uint8Array.Uint8ClampedArray.Int16Array.Int32Array.Uint16Array.Uint32Array.BigInt64Array.BigUint64Array.Set.Map.WeakSet.WeakMap.ArrayBuffer.SharedArrayBuffer.Atomics.DataView.JSON.Promise.Generator.GeneratorFunction.AsyncFunction.Reflect.Proxy.Intl.WebAssembly`.split(`.`),AS=[`Error`,`EvalError`,`InternalError`,`RangeError`,`ReferenceError`,`SyntaxError`,`TypeError`,`URIError`],jS=[`setInterval`,`setTimeout`,`clearInterval`,`clearTimeout`,`require`,`exports`,`eval`,`isFinite`,`isNaN`,`parseFloat`,`parseInt`,`decodeURI`,`decodeURIComponent`,`encodeURI`,`encodeURIComponent`,`escape`,`unescape`],MS=[`arguments`,`this`,`super`,`console`,`window`,`document`,`localStorage`,`sessionStorage`,`module`,`global`],NS=[].concat(jS,kS,AS);function PS(e){let t=e.regex,n=(e,{after:t})=>{let n=`</`+e[0].slice(1);return e.input.indexOf(n,t)!==-1},r=ES,i={begin:`<>`,end:`</>`},a=/<[A-Za-z0-9\\._:-]+\s*\/>/,o={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(e,t)=>{let r=e[0].length+e.index,i=e.input[r];if(i===`<`||i===`,`){t.ignoreMatch();return}i===`>`&&(n(e,{after:r})||t.ignoreMatch());let a,o=e.input.substring(r);if(a=o.match(/^\s*=/)){t.ignoreMatch();return}if((a=o.match(/^\s+extends\s+/))&&a.index===0){t.ignoreMatch();return}}},s={$pattern:ES,keyword:DS,literal:OS,built_in:NS,"variable.language":MS},c=`[0-9](_?[0-9])*`,l=`\\.(${c})`,u=`0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*`,d={className:`number`,variants:[{begin:`(\\b(${u})((${l})|\\.)?|(${l}))[eE][+-]?(${c})\\b`},{begin:`\\b(${u})\\b((${l})\\b|\\.)?|(${l})\\b`},{begin:`\\b(0|[1-9](_?[0-9])*)n\\b`},{begin:`\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b`},{begin:`\\b0[bB][0-1](_?[0-1])*n?\\b`},{begin:`\\b0[oO][0-7](_?[0-7])*n?\\b`},{begin:`\\b0[0-7]+n?\\b`}],relevance:0},f={className:`subst`,begin:`\\$\\{`,end:`\\}`,keywords:s,contains:[]},p={begin:".?html`",end:``,starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:`xml`}},m={begin:".?css`",end:``,starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:`css`}},h={begin:".?gql`",end:``,starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:`graphql`}},g={className:`string`,begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,f]},_={className:`comment`,variants:[e.COMMENT(/\/\*\*(?!\/)/,`\\*/`,{relevance:0,contains:[{begin:`(?=@[A-Za-z]+)`,relevance:0,contains:[{className:`doctag`,begin:`@[A-Za-z]+`},{className:`type`,begin:`\\{`,end:`\\}`,excludeEnd:!0,excludeBegin:!0,relevance:0},{className:`variable`,begin:`[A-Za-z$_][0-9A-Za-z$_]*(?=\\s*(-)|$)`,endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},v=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,m,h,g,{match:/\$\d+/},d];f.contains=v.concat({begin:/\{/,end:/\}/,keywords:s,contains:[`self`].concat(v)});let y=[].concat(_,f.contains),b=y.concat([{begin:/(\s*)\(/,end:/\)/,keywords:s,contains:[`self`].concat(y)}]),x={className:`params`,begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:b},S={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,t.concat(r,`(`,t.concat(/\./,r),`)*`)],scope:{1:`keyword`,3:`title.class`,5:`keyword`,7:`title.class.inherited`}},{match:[/class/,/\s+/,r],scope:{1:`keyword`,3:`title.class`}}]},C={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:`title.class`,keywords:{_:[...kS,...AS]}},w={label:`use_strict`,className:`meta`,relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},T={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:`keyword`,3:`title.function`},label:`func.def`,contains:[x],illegal:/%/},E={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:`variable.constant`};function D(e){return t.concat(`(?!`,e.join(`|`),`)`)}let O={match:t.concat(/\b/,D([...jS,`super`,`import`].map(e=>`${e}\\s*\\(`)),r,t.lookahead(/\s*\(/)),className:`title.function`,relevance:0},k={begin:t.concat(/\./,t.lookahead(t.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:`prototype`,className:`property`,relevance:0},A={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:`keyword`,3:`title.function`},contains:[{begin:/\(\)/},x]},j=`(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|`+e.UNDERSCORE_IDENT_RE+`)\\s*=>`,M={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(j)],keywords:`async`,className:{1:`keyword`,3:`title.function`},contains:[x]};return{name:`JavaScript`,aliases:[`js`,`jsx`,`mjs`,`cjs`],keywords:s,exports:{PARAMS_CONTAINS:b,CLASS_REFERENCE:C},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:`shebang`,binary:`node`,relevance:5}),w,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,m,h,g,_,{match:/\$\d+/},d,C,{scope:`attr`,match:r+t.lookahead(`:`),relevance:0},M,{begin:`(`+e.RE_STARTERS_RE+`|\\b(case|return|throw)\\b)\\s*`,keywords:`return throw case`,relevance:0,contains:[_,e.REGEXP_MODE,{className:`function`,begin:j,returnBegin:!0,end:`\\s*=>`,contains:[{className:`params`,variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:b}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:i.begin,end:i.end},{match:a},{begin:o.begin,"on:begin":o.isTrulyOpeningTag,end:o.end}],subLanguage:`xml`,contains:[{begin:o.begin,end:o.end,skip:!0,contains:[`self`]}]}]},T,{beginKeywords:`while if switch catch for`},{begin:`\\b(?!function)`+e.UNDERSCORE_IDENT_RE+`\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{`,returnBegin:!0,label:`func.def`,contains:[x,e.inherit(e.TITLE_MODE,{begin:r,className:`title.function`})]},{match:/\.\.\./,relevance:0},k,{match:`\\$[A-Za-z$_][0-9A-Za-z$_]*`,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:`title.function`},contains:[x]},O,E,S,A,{match:/\$[(.]/}]}}function FS(e){let t=e.regex,n=PS(e),r=ES,i=[`any`,`void`,`number`,`boolean`,`string`,`object`,`never`,`symbol`,`bigint`,`unknown`],a={begin:[/namespace/,/\s+/,e.IDENT_RE],beginScope:{1:`keyword`,3:`title.class`}},o={beginKeywords:`interface`,end:/\{/,excludeEnd:!0,keywords:{keyword:`interface extends`,built_in:i},contains:[n.exports.CLASS_REFERENCE]},s={className:`meta`,relevance:10,begin:/^\s*['"]use strict['"]/},c={$pattern:ES,keyword:DS.concat([`type`,`interface`,`public`,`private`,`protected`,`implements`,`declare`,`abstract`,`readonly`,`enum`,`override`,`satisfies`]),literal:OS,built_in:NS.concat(i),"variable.language":MS},l={className:`meta`,begin:`@[A-Za-z$_][0-9A-Za-z$_]*`},u=(e,t,n)=>{let r=e.contains.findIndex(e=>e.label===t);if(r===-1)throw Error(`can not find mode to replace`);e.contains.splice(r,1,n)};Object.assign(n.keywords,c),n.exports.PARAMS_CONTAINS.push(l);let d=n.contains.find(e=>e.scope===`attr`),f=Object.assign({},d,{match:t.concat(r,t.lookahead(/\s*\?:/))});n.exports.PARAMS_CONTAINS.push([n.exports.CLASS_REFERENCE,d,f]),n.contains=n.contains.concat([l,a,o,f]),u(n,`shebang`,e.SHEBANG()),u(n,`use_strict`,s);let p=n.contains.find(e=>e.label===`func.def`);return p.relevance=0,Object.assign(n,{name:`TypeScript`,aliases:[`ts`,`tsx`,`mts`,`cts`]}),n}var IS=`[A-Za-z$_][0-9A-Za-z$_]*`,LS=`as.in.of.if.for.while.finally.var.new.function.do.return.void.else.break.catch.instanceof.with.throw.case.default.try.switch.continue.typeof.delete.let.yield.const.class.debugger.async.await.static.import.from.export.extends.using`.split(`.`),RS=[`true`,`false`,`null`,`undefined`,`NaN`,`Infinity`],zS=`Object.Function.Boolean.Symbol.Math.Date.Number.BigInt.String.RegExp.Array.Float32Array.Float64Array.Int8Array.Uint8Array.Uint8ClampedArray.Int16Array.Int32Array.Uint16Array.Uint32Array.BigInt64Array.BigUint64Array.Set.Map.WeakSet.WeakMap.ArrayBuffer.SharedArrayBuffer.Atomics.DataView.JSON.Promise.Generator.GeneratorFunction.AsyncFunction.Reflect.Proxy.Intl.WebAssembly`.split(`.`),BS=[`Error`,`EvalError`,`InternalError`,`RangeError`,`ReferenceError`,`SyntaxError`,`TypeError`,`URIError`],VS=[`setInterval`,`setTimeout`,`clearInterval`,`clearTimeout`,`require`,`exports`,`eval`,`isFinite`,`isNaN`,`parseFloat`,`parseInt`,`decodeURI`,`decodeURIComponent`,`encodeURI`,`encodeURIComponent`,`escape`,`unescape`],HS=[`arguments`,`this`,`super`,`console`,`window`,`document`,`localStorage`,`sessionStorage`,`module`,`global`],US=[].concat(VS,zS,BS);function WS(e){let t=e.regex,n=(e,{after:t})=>{let n=`</`+e[0].slice(1);return e.input.indexOf(n,t)!==-1},r=IS,i={begin:`<>`,end:`</>`},a=/<[A-Za-z0-9\\._:-]+\s*\/>/,o={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(e,t)=>{let r=e[0].length+e.index,i=e.input[r];if(i===`<`||i===`,`){t.ignoreMatch();return}i===`>`&&(n(e,{after:r})||t.ignoreMatch());let a,o=e.input.substring(r);if(a=o.match(/^\s*=/)){t.ignoreMatch();return}if((a=o.match(/^\s+extends\s+/))&&a.index===0){t.ignoreMatch();return}}},s={$pattern:IS,keyword:LS,literal:RS,built_in:US,"variable.language":HS},c=`[0-9](_?[0-9])*`,l=`\\.(${c})`,u=`0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*`,d={className:`number`,variants:[{begin:`(\\b(${u})((${l})|\\.)?|(${l}))[eE][+-]?(${c})\\b`},{begin:`\\b(${u})\\b((${l})\\b|\\.)?|(${l})\\b`},{begin:`\\b(0|[1-9](_?[0-9])*)n\\b`},{begin:`\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b`},{begin:`\\b0[bB][0-1](_?[0-1])*n?\\b`},{begin:`\\b0[oO][0-7](_?[0-7])*n?\\b`},{begin:`\\b0[0-7]+n?\\b`}],relevance:0},f={className:`subst`,begin:`\\$\\{`,end:`\\}`,keywords:s,contains:[]},p={begin:".?html`",end:``,starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:`xml`}},m={begin:".?css`",end:``,starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:`css`}},h={begin:".?gql`",end:``,starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:`graphql`}},g={className:`string`,begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,f]},_={className:`comment`,variants:[e.COMMENT(/\/\*\*(?!\/)/,`\\*/`,{relevance:0,contains:[{begin:`(?=@[A-Za-z]+)`,relevance:0,contains:[{className:`doctag`,begin:`@[A-Za-z]+`},{className:`type`,begin:`\\{`,end:`\\}`,excludeEnd:!0,excludeBegin:!0,relevance:0},{className:`variable`,begin:`[A-Za-z$_][0-9A-Za-z$_]*(?=\\s*(-)|$)`,endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},v=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,m,h,g,{match:/\$\d+/},d];f.contains=v.concat({begin:/\{/,end:/\}/,keywords:s,contains:[`self`].concat(v)});let y=[].concat(_,f.contains),b=y.concat([{begin:/(\s*)\(/,end:/\)/,keywords:s,contains:[`self`].concat(y)}]),x={className:`params`,begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:b},S={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,t.concat(r,`(`,t.concat(/\./,r),`)*`)],scope:{1:`keyword`,3:`title.class`,5:`keyword`,7:`title.class.inherited`}},{match:[/class/,/\s+/,r],scope:{1:`keyword`,3:`title.class`}}]},C={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:`title.class`,keywords:{_:[...zS,...BS]}},w={label:`use_strict`,className:`meta`,relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},T={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:`keyword`,3:`title.function`},label:`func.def`,contains:[x],illegal:/%/},E={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:`variable.constant`};function D(e){return t.concat(`(?!`,e.join(`|`),`)`)}let O={match:t.concat(/\b/,D([...VS,`super`,`import`].map(e=>`${e}\\s*\\(`)),r,t.lookahead(/\s*\(/)),className:`title.function`,relevance:0},k={begin:t.concat(/\./,t.lookahead(t.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:`prototype`,className:`property`,relevance:0},A={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:`keyword`,3:`title.function`},contains:[{begin:/\(\)/},x]},j=`(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|`+e.UNDERSCORE_IDENT_RE+`)\\s*=>`,M={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(j)],keywords:`async`,className:{1:`keyword`,3:`title.function`},contains:[x]};return{name:`JavaScript`,aliases:[`js`,`jsx`,`mjs`,`cjs`],keywords:s,exports:{PARAMS_CONTAINS:b,CLASS_REFERENCE:C},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:`shebang`,binary:`node`,relevance:5}),w,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,m,h,g,_,{match:/\$\d+/},d,C,{scope:`attr`,match:r+t.lookahead(`:`),relevance:0},M,{begin:`(`+e.RE_STARTERS_RE+`|\\b(case|return|throw)\\b)\\s*`,keywords:`return throw case`,relevance:0,contains:[_,e.REGEXP_MODE,{className:`function`,begin:j,returnBegin:!0,end:`\\s*=>`,contains:[{className:`params`,variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:b}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:i.begin,end:i.end},{match:a},{begin:o.begin,"on:begin":o.isTrulyOpeningTag,end:o.end}],subLanguage:`xml`,contains:[{begin:o.begin,end:o.end,skip:!0,contains:[`self`]}]}]},T,{beginKeywords:`while if switch catch for`},{begin:`\\b(?!function)`+e.UNDERSCORE_IDENT_RE+`\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{`,returnBegin:!0,label:`func.def`,contains:[x,e.inherit(e.TITLE_MODE,{begin:r,className:`title.function`})]},{match:/\.\.\./,relevance:0},k,{match:`\\$[A-Za-z$_][0-9A-Za-z$_]*`,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:`title.function`},contains:[x]},O,E,S,A,{match:/\$[(.]/}]}}function GS(e){let t={className:`attr`,begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},n={match:/[{}[\],:]/,className:`punctuation`,relevance:0},r=[`true`,`false`,`null`],i={scope:`literal`,beginKeywords:r.join(` `)};return{name:`JSON`,aliases:[`jsonc`],keywords:{literal:r},contains:[t,n,e.QUOTE_STRING_MODE,i,e.C_NUMBER_MODE,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE],illegal:`\\S`}}function KS(e){let t=e.regex,n={},r={begin:/\$\{/,end:/\}/,contains:[`self`,{begin:/:-/,contains:[n]}]};Object.assign(n,{className:`variable`,variants:[{begin:t.concat(/\$[\w\d#@][\w\d_]*/,`(?![\\w\\d])(?![$])`)},r]});let i={className:`subst`,begin:/\$\(/,end:/\)/,contains:[e.BACKSLASH_ESCAPE]},a=e.inherit(e.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:`comment`}}),o={begin:/<<-?\s*(?=\w+)/,starts:{contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:`string`})]}},s={className:`string`,begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,n,i]};i.contains.push(s);let c={match:/\\"/},l={className:`string`,begin:/'/,end:/'/},u={match:/\\'/},d={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:`number`},e.NUMBER_MODE,n]},f=e.SHEBANG({binary:`(${[`fish`,`bash`,`zsh`,`sh`,`csh`,`ksh`,`tcsh`,`dash`,`scsh`].join(`|`)})`,relevance:10}),p={className:`function`,begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[e.inherit(e.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},m=[`if`,`then`,`else`,`elif`,`fi`,`time`,`for`,`while`,`until`,`in`,`do`,`done`,`case`,`esac`,`coproc`,`function`,`select`],h=[`true`,`false`],g={match:/(\/[a-z._-]+)+/},_=[`break`,`cd`,`continue`,`eval`,`exec`,`exit`,`export`,`getopts`,`hash`,`pwd`,`readonly`,`return`,`shift`,`test`,`times`,`trap`,`umask`,`unset`],v=[`alias`,`bind`,`builtin`,`caller`,`command`,`declare`,`echo`,`enable`,`help`,`let`,`local`,`logout`,`mapfile`,`printf`,`read`,`readarray`,`source`,`sudo`,`type`,`typeset`,`ulimit`,`unalias`],y=`autoload.bg.bindkey.bye.cap.chdir.clone.comparguments.compcall.compctl.compdescribe.compfiles.compgroups.compquote.comptags.comptry.compvalues.dirs.disable.disown.echotc.echoti.emulate.fc.fg.float.functions.getcap.getln.history.integer.jobs.kill.limit.log.noglob.popd.print.pushd.pushln.rehash.sched.setcap.setopt.stat.suspend.ttyctl.unfunction.unhash.unlimit.unsetopt.vared.wait.whence.where.which.zcompile.zformat.zftp.zle.zmodload.zparseopts.zprof.zpty.zregexparse.zsocket.zstyle.ztcp`.split(`.`),b=`chcon.chgrp.chown.chmod.cp.dd.df.dir.dircolors.ln.ls.mkdir.mkfifo.mknod.mktemp.mv.realpath.rm.rmdir.shred.sync.touch.truncate.vdir.b2sum.base32.base64.cat.cksum.comm.csplit.cut.expand.fmt.fold.head.join.md5sum.nl.numfmt.od.paste.ptx.pr.sha1sum.sha224sum.sha256sum.sha384sum.sha512sum.shuf.sort.split.sum.tac.tail.tr.tsort.unexpand.uniq.wc.arch.basename.chroot.date.dirname.du.echo.env.expr.factor.groups.hostid.id.link.logname.nice.nohup.nproc.pathchk.pinky.printenv.printf.pwd.readlink.runcon.seq.sleep.stat.stdbuf.stty.tee.test.timeout.tty.uname.unlink.uptime.users.who.whoami.yes`.split(`.`);return{name:`Bash`,aliases:[`sh`,`zsh`],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:m,literal:h,built_in:[..._,...v,`set`,`shopt`,...y,...b]},contains:[f,e.SHEBANG(),p,d,a,o,g,s,c,l,u,n]}}function qS(e){return{name:`Shell Session`,aliases:[`console`,`shellsession`],contains:[{className:`meta.prompt`,begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:`bash`}}]}}function JS(e){let t=e.regex,n=/[\p{XID_Start}_]\p{XID_Continue}*/u,r=`and.as.assert.async.await.break.case.class.continue.def.del.elif.else.except.finally.for.from.global.if.import.in.is.lambda.match.nonlocal|10.not.or.pass.raise.return.try.while.with.yield`.split(`.`),i={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:r,built_in:`__import__.abs.all.any.ascii.bin.bool.breakpoint.bytearray.bytes.callable.chr.classmethod.compile.complex.delattr.dict.dir.divmod.enumerate.eval.exec.filter.float.format.frozenset.getattr.globals.hasattr.hash.help.hex.id.input.int.isinstance.issubclass.iter.len.list.locals.map.max.memoryview.min.next.object.oct.open.ord.pow.print.property.range.repr.reversed.round.set.setattr.slice.sorted.staticmethod.str.sum.super.tuple.type.vars.zip`.split(`.`),literal:[`__debug__`,`Ellipsis`,`False`,`None`,`NotImplemented`,`True`],type:[`Any`,`Callable`,`Coroutine`,`Dict`,`List`,`Literal`,`Generic`,`Optional`,`Sequence`,`Set`,`Tuple`,`Type`,`Union`]},a={className:`meta`,begin:/^(>>>|\.\.\.) /},o={className:`subst`,begin:/\{/,end:/\}/,keywords:i,illegal:/#/},s={begin:/\{\{/,relevance:0},c={className:`string`,contains:[e.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,a],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,a],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,a,s,o]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,a,s,o]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[e.BACKSLASH_ESCAPE,s,o]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,s,o]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},l=`[0-9](_?[0-9])*`,u=`(\\b(${l}))?\\.(${l})|\\b(${l})\\.`,d=`\\b|${r.join(`|`)}`,f={className:`number`,relevance:0,variants:[{begin:`(\\b(${l})|(${u}))[eE][+-]?(${l})[jJ]?(?=${d})`},{begin:`(${u})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${d})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${d})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${d})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${d})`},{begin:`\\b(${l})[jJ](?=${d})`}]},p={className:`comment`,begin:t.lookahead(/# type:/),end:/$/,keywords:i,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},m={className:`params`,variants:[{className:``,begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:i,contains:[`self`,a,f,c,e.HASH_COMMENT_MODE]}]};return o.contains=[c,f,a],{name:`Python`,aliases:[`py`,`gyp`,`ipython`],unicodeRegex:!0,keywords:i,illegal:/(<\/|\?)|=>/,contains:[a,f,{scope:`variable.language`,match:/\bself\b/},{beginKeywords:`if`,relevance:0},{match:/\bor\b/,scope:`keyword`},c,p,e.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,n],scope:{1:`keyword`,3:`title.function`},contains:[m]},{variants:[{match:[/\bclass/,/\s+/,n,/\s*/,/\(\s*/,n,/\s*\)/]},{match:[/\bclass/,/\s+/,n]}],scope:{1:`keyword`,3:`title.class`,6:`title.class.inherited`}},{className:`meta`,begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[f,m,c]}]}}function YS(e){let t=e.regex;return{name:`Diff`,aliases:[`patch`],contains:[{className:`meta`,relevance:10,match:t.either(/^@@ +-\d+,\d+ +\+\d+,\d+ +@@/,/^\*\*\* +\d+,\d+ +\*\*\*\*$/,/^--- +\d+,\d+ +----$/)},{className:`comment`,variants:[{begin:t.either(/Index: /,/^index/,/={3,}/,/^-{3}/,/^\*{3} /,/^\+{3}/,/^diff --git/),end:/$/},{match:/^\*{15}$/}]},{className:`addition`,begin:/^\+/,end:/$/},{className:`deletion`,begin:/^-/,end:/$/},{className:`addition`,begin:/^!/,end:/$/}]}}function XS(e){let t=e.regex,n=t.concat(/[\p{L}_]/u,t.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),r=/[\p{L}0-9._:-]+/u,i={className:`symbol`,begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},a={begin:/\s/,contains:[{className:`keyword`,begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},o=e.inherit(a,{begin:/\(/,end:/\)/}),s=e.inherit(e.APOS_STRING_MODE,{className:`string`}),c=e.inherit(e.QUOTE_STRING_MODE,{className:`string`}),l={endsWithParent:!0,illegal:/</,relevance:0,contains:[{className:`attr`,begin:r,relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:`string`,endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[i]},{begin:/'/,end:/'/,contains:[i]},{begin:/[^\s"'=<>`]+/}]}]}]};return{name:`HTML, XML`,aliases:[`html`,`xhtml`,`rss`,`atom`,`xjb`,`xsd`,`xsl`,`plist`,`wsf`,`svg`],case_insensitive:!0,unicodeRegex:!0,contains:[{className:`meta`,begin:/<![a-z]/,end:/>/,relevance:10,contains:[a,c,s,o,{begin:/\[/,end:/\]/,contains:[{className:`meta`,begin:/<![a-z]/,end:/>/,contains:[a,o,c,s]}]}]},e.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},i,{className:`meta`,end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[c]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:`tag`,begin:/<style(?=\s|>)/,end:/>/,keywords:{name:`style`},contains:[l],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:[`css`,`xml`]}},{className:`tag`,begin:/<script(?=\s|>)/,end:/>/,keywords:{name:`script`},contains:[l],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:[`javascript`,`handlebars`,`xml`]}},{className:`tag`,begin:/<>|<\/>/},{className:`tag`,begin:t.concat(/</,t.lookahead(t.concat(n,t.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:`name`,begin:n,relevance:0,starts:l}]},{className:`tag`,begin:t.concat(/<\//,t.lookahead(t.concat(n,/>/))),contains:[{className:`name`,begin:n,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}var ZS=e=>({IMPORTANT:{scope:`meta`,begin:`!important`},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:`number`,begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:`built_in`,begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:`selector-attr`,begin:/\[/,end:/\]/,illegal:`$`,contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:`number`,begin:e.NUMBER_RE+`(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?`,relevance:0},CSS_VARIABLE:{className:`attr`,begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),QS=`a.abbr.address.article.aside.audio.b.blockquote.body.button.canvas.caption.cite.code.dd.del.details.dfn.div.dl.dt.em.fieldset.figcaption.figure.footer.form.h1.h2.h3.h4.h5.h6.header.hgroup.html.i.iframe.img.input.ins.kbd.label.legend.li.main.mark.menu.nav.object.ol.optgroup.option.p.picture.q.quote.samp.section.select.source.span.strong.summary.sup.table.tbody.td.textarea.tfoot.th.thead.time.tr.ul.var.video`.split(`.`),$S=`defs.g.marker.mask.pattern.svg.switch.symbol.feBlend.feColorMatrix.feComponentTransfer.feComposite.feConvolveMatrix.feDiffuseLighting.feDisplacementMap.feFlood.feGaussianBlur.feImage.feMerge.feMorphology.feOffset.feSpecularLighting.feTile.feTurbulence.linearGradient.radialGradient.stop.circle.ellipse.image.line.path.polygon.polyline.rect.text.use.textPath.tspan.foreignObject.clipPath`.split(`.`),eC=[...QS,...$S],tC=`any-hover.any-pointer.aspect-ratio.color.color-gamut.color-index.device-aspect-ratio.device-height.device-width.display-mode.forced-colors.grid.height.hover.inverted-colors.monochrome.orientation.overflow-block.overflow-inline.pointer.prefers-color-scheme.prefers-contrast.prefers-reduced-motion.prefers-reduced-transparency.resolution.scan.scripting.update.width.min-width.max-width.min-height.max-height`.split(`.`).sort().reverse(),nC=`active.any-link.blank.checked.current.default.defined.dir.disabled.drop.empty.enabled.first.first-child.first-of-type.fullscreen.future.focus.focus-visible.focus-within.has.host.host-context.hover.indeterminate.in-range.invalid.is.lang.last-child.last-of-type.left.link.local-link.not.nth-child.nth-col.nth-last-child.nth-last-col.nth-last-of-type.nth-of-type.only-child.only-of-type.optional.out-of-range.past.placeholder-shown.read-only.read-write.required.right.root.scope.target.target-within.user-invalid.valid.visited.where`.split(`.`).sort().reverse(),rC=[`after`,`backdrop`,`before`,`cue`,`cue-region`,`first-letter`,`first-line`,`grammar-error`,`marker`,`part`,`placeholder`,`selection`,`slotted`,`spelling-error`].sort().reverse(),iC=`accent-color.align-content.align-items.align-self.alignment-baseline.all.anchor-name.animation.animation-composition.animation-delay.animation-direction.animation-duration.animation-fill-mode.animation-iteration-count.animation-name.animation-play-state.animation-range.animation-range-end.animation-range-start.animation-timeline.animation-timing-function.appearance.aspect-ratio.backdrop-filter.backface-visibility.background.background-attachment.background-blend-mode.background-clip.background-color.background-image.background-origin.background-position.background-position-x.background-position-y.background-repeat.background-size.baseline-shift.block-size.border.border-block.border-block-color.border-block-end.border-block-end-color.border-block-end-style.border-block-end-width.border-block-start.border-block-start-color.border-block-start-style.border-block-start-width.border-block-style.border-block-width.border-bottom.border-bottom-color.border-bottom-left-radius.border-bottom-right-radius.border-bottom-style.border-bottom-width.border-collapse.border-color.border-end-end-radius.border-end-start-radius.border-image.border-image-outset.border-image-repeat.border-image-slice.border-image-source.border-image-width.border-inline.border-inline-color.border-inline-end.border-inline-end-color.border-inline-end-style.border-inline-end-width.border-inline-start.border-inline-start-color.border-inline-start-style.border-inline-start-width.border-inline-style.border-inline-width.border-left.border-left-color.border-left-style.border-left-width.border-radius.border-right.border-right-color.border-right-style.border-right-width.border-spacing.border-start-end-radius.border-start-start-radius.border-style.border-top.border-top-color.border-top-left-radius.border-top-right-radius.border-top-style.border-top-width.border-width.bottom.box-align.box-decoration-break.box-direction.box-flex.box-flex-group.box-lines.box-ordinal-group.box-orient.box-pack.box-shadow.box-sizing.break-after.break-before.break-inside.caption-side.caret-color.clear.clip.clip-path.clip-rule.color.color-interpolation.color-interpolation-filters.color-profile.color-rendering.color-scheme.column-count.column-fill.column-gap.column-rule.column-rule-color.column-rule-style.column-rule-width.column-span.column-width.columns.contain.contain-intrinsic-block-size.contain-intrinsic-height.contain-intrinsic-inline-size.contain-intrinsic-size.contain-intrinsic-width.container.container-name.container-type.content.content-visibility.counter-increment.counter-reset.counter-set.cue.cue-after.cue-before.cursor.cx.cy.direction.display.dominant-baseline.empty-cells.enable-background.field-sizing.fill.fill-opacity.fill-rule.filter.flex.flex-basis.flex-direction.flex-flow.flex-grow.flex-shrink.flex-wrap.float.flood-color.flood-opacity.flow.font.font-display.font-family.font-feature-settings.font-kerning.font-language-override.font-optical-sizing.font-palette.font-size.font-size-adjust.font-smooth.font-smoothing.font-stretch.font-style.font-synthesis.font-synthesis-position.font-synthesis-small-caps.font-synthesis-style.font-synthesis-weight.font-variant.font-variant-alternates.font-variant-caps.font-variant-east-asian.font-variant-emoji.font-variant-ligatures.font-variant-numeric.font-variant-position.font-variation-settings.font-weight.forced-color-adjust.gap.glyph-orientation-horizontal.glyph-orientation-vertical.grid.grid-area.grid-auto-columns.grid-auto-flow.grid-auto-rows.grid-column.grid-column-end.grid-column-start.grid-gap.grid-row.grid-row-end.grid-row-start.grid-template.grid-template-areas.grid-template-columns.grid-template-rows.hanging-punctuation.height.hyphenate-character.hyphenate-limit-chars.hyphens.icon.image-orientation.image-rendering.image-resolution.ime-mode.initial-letter.initial-letter-align.inline-size.inset.inset-area.inset-block.inset-block-end.inset-block-start.inset-inline.inset-inline-end.inset-inline-start.isolation.justify-content.justify-items.justify-self.kerning.left.letter-spacing.lighting-color.line-break.line-height.line-height-step.list-style.list-style-image.list-style-position.list-style-type.margin.margin-block.margin-block-end.margin-block-start.margin-bottom.margin-inline.margin-inline-end.margin-inline-start.margin-left.margin-right.margin-top.margin-trim.marker.marker-end.marker-mid.marker-start.marks.mask.mask-border.mask-border-mode.mask-border-outset.mask-border-repeat.mask-border-slice.mask-border-source.mask-border-width.mask-clip.mask-composite.mask-image.mask-mode.mask-origin.mask-position.mask-repeat.mask-size.mask-type.masonry-auto-flow.math-depth.math-shift.math-style.max-block-size.max-height.max-inline-size.max-width.min-block-size.min-height.min-inline-size.min-width.mix-blend-mode.nav-down.nav-index.nav-left.nav-right.nav-up.none.normal.object-fit.object-position.offset.offset-anchor.offset-distance.offset-path.offset-position.offset-rotate.opacity.order.orphans.outline.outline-color.outline-offset.outline-style.outline-width.overflow.overflow-anchor.overflow-block.overflow-clip-margin.overflow-inline.overflow-wrap.overflow-x.overflow-y.overlay.overscroll-behavior.overscroll-behavior-block.overscroll-behavior-inline.overscroll-behavior-x.overscroll-behavior-y.padding.padding-block.padding-block-end.padding-block-start.padding-bottom.padding-inline.padding-inline-end.padding-inline-start.padding-left.padding-right.padding-top.page.page-break-after.page-break-before.page-break-inside.paint-order.pause.pause-after.pause-before.perspective.perspective-origin.place-content.place-items.place-self.pointer-events.position.position-anchor.position-visibility.print-color-adjust.quotes.r.resize.rest.rest-after.rest-before.right.rotate.row-gap.ruby-align.ruby-position.scale.scroll-behavior.scroll-margin.scroll-margin-block.scroll-margin-block-end.scroll-margin-block-start.scroll-margin-bottom.scroll-margin-inline.scroll-margin-inline-end.scroll-margin-inline-start.scroll-margin-left.scroll-margin-right.scroll-margin-top.scroll-padding.scroll-padding-block.scroll-padding-block-end.scroll-padding-block-start.scroll-padding-bottom.scroll-padding-inline.scroll-padding-inline-end.scroll-padding-inline-start.scroll-padding-left.scroll-padding-right.scroll-padding-top.scroll-snap-align.scroll-snap-stop.scroll-snap-type.scroll-timeline.scroll-timeline-axis.scroll-timeline-name.scrollbar-color.scrollbar-gutter.scrollbar-width.shape-image-threshold.shape-margin.shape-outside.shape-rendering.speak.speak-as.src.stop-color.stop-opacity.stroke.stroke-dasharray.stroke-dashoffset.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-opacity.stroke-width.tab-size.table-layout.text-align.text-align-all.text-align-last.text-anchor.text-combine-upright.text-decoration.text-decoration-color.text-decoration-line.text-decoration-skip.text-decoration-skip-ink.text-decoration-style.text-decoration-thickness.text-emphasis.text-emphasis-color.text-emphasis-position.text-emphasis-style.text-indent.text-justify.text-orientation.text-overflow.text-rendering.text-shadow.text-size-adjust.text-transform.text-underline-offset.text-underline-position.text-wrap.text-wrap-mode.text-wrap-style.timeline-scope.top.touch-action.transform.transform-box.transform-origin.transform-style.transition.transition-behavior.transition-delay.transition-duration.transition-property.transition-timing-function.translate.unicode-bidi.user-modify.user-select.vector-effect.vertical-align.view-timeline.view-timeline-axis.view-timeline-inset.view-timeline-name.view-transition-name.visibility.voice-balance.voice-duration.voice-family.voice-pitch.voice-range.voice-rate.voice-stress.voice-volume.white-space.white-space-collapse.widows.width.will-change.word-break.word-spacing.word-wrap.writing-mode.x.y.z-index.zoom`.split(`.`).sort().reverse();function aC(e){let t=e.regex,n=ZS(e),r={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},i=/@-?\w[\w]*(-\w+)*/,a=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE];return{name:`CSS`,case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:`from to`},classNameAliases:{keyframePosition:`selector-tag`},contains:[n.BLOCK_COMMENT,r,n.CSS_NUMBER_MODE,{className:`selector-id`,begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:`selector-class`,begin:`\\.[a-zA-Z-][a-zA-Z0-9_-]*`,relevance:0},n.ATTRIBUTE_SELECTOR_MODE,{className:`selector-pseudo`,variants:[{begin:`:(`+nC.join(`|`)+`)`},{begin:`:(:)?(`+rC.join(`|`)+`)`}]},n.CSS_VARIABLE,{className:`attribute`,begin:`\\b(`+iC.join(`|`)+`)\\b`},{begin:/:/,end:/[;}{]/,contains:[n.BLOCK_COMMENT,n.HEXCOLOR,n.IMPORTANT,n.CSS_NUMBER_MODE,...a,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:`url data-uri`},contains:[...a,{className:`string`,begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},n.FUNCTION_DISPATCH]},{begin:t.lookahead(/@/),end:`[{;]`,relevance:0,illegal:/:/,contains:[{className:`keyword`,begin:i},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:`and or not only`,attribute:tC.join(` `)},contains:[{begin:/[a-z-]+(?=:)/,className:`attribute`},...a,n.CSS_NUMBER_MODE]}]},{className:`selector-tag`,begin:`\\b(`+eC.join(`|`)+`)\\b`}]}}function oC(e){let t=e.regex,n={begin:/<\/?[A-Za-z_]/,end:`>`,subLanguage:`xml`,relevance:0},r={begin:`^[-\\*]{3,}`,end:`$`},i={className:`code`,variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:`(~{3,})[^~](.|\\n)*?\\1~*[ ]*`},{begin:"```",end:"```+[ ]*$"},{begin:`~~~`,end:`~~~+[ ]*$`},{begin:"`.+?`"},{begin:`(?=^( {4}|\\t))`,contains:[{begin:`^( {4}|\\t)`,end:`(\\n)$`}],relevance:0}]},a={className:`bullet`,begin:`^[ ]*([*+-]|(\\d+\\.))(?=\\s+)`,end:`\\s+`,excludeEnd:!0},o={begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:`symbol`,begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:`link`,begin:/:\s*/,end:/$/,excludeBegin:!0}]},s={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:t.concat(/\[.+?\]\(/,/[A-Za-z][A-Za-z0-9+.-]*/,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:`string`,relevance:0,begin:`\\[`,end:`\\]`,excludeBegin:!0,returnEnd:!0},{className:`link`,relevance:0,begin:`\\]\\(`,end:`\\)`,excludeBegin:!0,excludeEnd:!0},{className:`symbol`,relevance:0,begin:`\\]\\[`,end:`\\]`,excludeBegin:!0,excludeEnd:!0}]},c={className:`strong`,contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},l={className:`emphasis`,contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},u=e.inherit(c,{contains:[]}),d=e.inherit(l,{contains:[]});c.contains.push(d),l.contains.push(u);let f=[n,s];return[c,l,u,d].forEach(e=>{e.contains=e.contains.concat(f)}),f=f.concat(c,l),{name:`Markdown`,aliases:[`md`,`mkdown`,`mkd`],contains:[{className:`section`,variants:[{begin:`^#{1,6}`,end:`$`,contains:f},{begin:`(?=^.+?\\n[=-]{2,}$)`,contains:[{begin:`^[=-]*$`},{begin:`^`,end:`\\n`,contains:f}]}]},n,a,c,l,{className:`quote`,begin:`^>\\s+`,contains:f,end:`$`},i,r,s,o,{scope:`literal`,match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function sC(e){let t=`true false yes no null`,n={className:`attr`,variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},r={className:`template-variable`,variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},i={className:`string`,relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:`char.escape`,relevance:0}]},a={className:`string`,relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[e.BACKSLASH_ESCAPE,r]},o=e.inherit(a,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),s={className:`number`,begin:`\\b[0-9]{4}(-[0-9][0-9]){0,2}([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?(\\.[0-9]*)?([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?\\b`},c={end:`,`,endsWithParent:!0,excludeEnd:!0,keywords:t,relevance:0},l={begin:/\{/,end:/\}/,contains:[c],illegal:`\\n`,relevance:0},u={begin:`\\[`,end:`\\]`,contains:[c],illegal:`\\n`,relevance:0},d=[n,{className:`meta`,begin:`^---\\s*$`,relevance:10},{className:`string`,begin:`[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*`},{begin:`<%[%=-]?`,end:`[%-]?%>`,subLanguage:`ruby`,excludeBegin:!0,excludeEnd:!0,relevance:0},{className:`type`,begin:`!\\w+![\\w#;/?:@&=+$,.~*'()[\\]]+`},{className:`type`,begin:`!<[\\w#;/?:@&=+$,.~*'()[\\]]+>`},{className:`type`,begin:`![\\w#;/?:@&=+$,.~*'()[\\]]+`},{className:`type`,begin:`!![\\w#;/?:@&=+$,.~*'()[\\]]+`},{className:`meta`,begin:`&`+e.UNDERSCORE_IDENT_RE+`$`},{className:`meta`,begin:`\\*`+e.UNDERSCORE_IDENT_RE+`$`},{className:`bullet`,begin:`-(?=[ ]|$)`,relevance:0},e.HASH_COMMENT_MODE,{beginKeywords:t,keywords:{literal:t}},s,{className:`number`,begin:e.C_NUMBER_RE+`\\b`,relevance:0},l,u,i,a],f=[...d];return f.pop(),f.push(o),c.contains=f,{name:`YAML`,case_insensitive:!0,aliases:[`yml`],contains:d}}function cC(e){return{name:`Plain text`,aliases:[`text`,`txt`],disableAutodetect:!0}}function lC(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function uC(e){if(Array.isArray(e))return e}function dC(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function fC(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
67
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function pC(e,t){return uC(e)||dC(e,t)||mC(e,t)||fC()}function mC(e,t){if(e){if(typeof e==`string`)return lC(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?lC(e,t):void 0}}var hC=Object.entries,gC=Object.setPrototypeOf,_C=Object.isFrozen,vC=Object.getPrototypeOf,yC=Object.getOwnPropertyDescriptor,bC=Object.freeze,xC=Object.seal,SC=Object.create,CC=typeof Reflect<`u`&&Reflect,wC=CC.apply,TC=CC.construct;bC||=function(e){return e},xC||=function(e){return e},wC||=function(e,t){var n=[...arguments].slice(2);return e.apply(t,n)},TC||=function(e){return new e(...[...arguments].slice(1))};var EC=KC(Array.prototype.forEach),DC=KC(Array.prototype.lastIndexOf),OC=KC(Array.prototype.pop),kC=KC(Array.prototype.push),AC=KC(Array.prototype.splice),jC=Array.isArray,MC=KC(String.prototype.toLowerCase),NC=KC(String.prototype.toString),PC=KC(String.prototype.match),FC=KC(String.prototype.replace),IC=KC(String.prototype.indexOf),LC=KC(String.prototype.trim),RC=KC(Number.prototype.toString),zC=KC(Boolean.prototype.toString),BC=typeof BigInt>`u`?null:KC(BigInt.prototype.toString),VC=typeof Symbol>`u`?null:KC(Symbol.prototype.toString),HC=KC(Object.prototype.hasOwnProperty),UC=KC(Object.prototype.toString),WC=KC(RegExp.prototype.test),GC=qC(TypeError);function KC(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);var n=[...arguments].slice(1);return wC(e,t,n)}}function qC(e){return function(){return TC(e,[...arguments])}}function $(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:MC;if(gC&&gC(e,null),!jC(t))return e;let r=t.length;for(;r--;){let i=t[r];if(typeof i==`string`){let e=n(i);e!==i&&(_C(t)||(t[r]=e),i=e)}e[i]=!0}return e}function JC(e){for(let t=0;t<e.length;t++)HC(e,t)||(e[t]=null);return e}function YC(e){let t=SC(null);for(let r of hC(e)){var n=pC(r,2);let i=n[0],a=n[1];HC(e,i)&&(jC(a)?t[i]=JC(a):a&&typeof a==`object`&&a.constructor===Object?t[i]=YC(a):t[i]=a)}return t}function XC(e){switch(typeof e){case`string`:return e;case`number`:return RC(e);case`boolean`:return zC(e);case`bigint`:return BC?BC(e):`0`;case`symbol`:return VC?VC(e):`Symbol()`;case`undefined`:return UC(e);case`function`:case`object`:{if(e===null)return UC(e);let t=e,n=ZC(t,`toString`);if(typeof n==`function`){let e=n(t);return typeof e==`string`?e:UC(e)}return UC(e)}default:return UC(e)}}function ZC(e,t){for(;e!==null;){let n=yC(e,t);if(n){if(n.get)return KC(n.get);if(typeof n.value==`function`)return KC(n.value)}e=vC(e)}function n(){return null}return n}function QC(e){try{return WC(e,``),!0}catch{return!1}}var $C=bC(`a.abbr.acronym.address.area.article.aside.audio.b.bdi.bdo.big.blink.blockquote.body.br.button.canvas.caption.center.cite.code.col.colgroup.content.data.datalist.dd.decorator.del.details.dfn.dialog.dir.div.dl.dt.element.em.fieldset.figcaption.figure.font.footer.form.h1.h2.h3.h4.h5.h6.head.header.hgroup.hr.html.i.img.input.ins.kbd.label.legend.li.main.map.mark.marquee.menu.menuitem.meter.nav.nobr.ol.optgroup.option.output.p.picture.pre.progress.q.rp.rt.ruby.s.samp.search.section.select.shadow.slot.small.source.spacer.span.strike.strong.style.sub.summary.sup.table.tbody.td.template.textarea.tfoot.th.thead.time.tr.track.tt.u.ul.var.video.wbr`.split(`.`)),ew=bC(`svg.a.altglyph.altglyphdef.altglyphitem.animatecolor.animatemotion.animatetransform.circle.clippath.defs.desc.ellipse.enterkeyhint.exportparts.filter.font.g.glyph.glyphref.hkern.image.inputmode.line.lineargradient.marker.mask.metadata.mpath.part.path.pattern.polygon.polyline.radialgradient.rect.stop.style.switch.symbol.text.textpath.title.tref.tspan.view.vkern`.split(`.`)),tw=bC([`feBlend`,`feColorMatrix`,`feComponentTransfer`,`feComposite`,`feConvolveMatrix`,`feDiffuseLighting`,`feDisplacementMap`,`feDistantLight`,`feDropShadow`,`feFlood`,`feFuncA`,`feFuncB`,`feFuncG`,`feFuncR`,`feGaussianBlur`,`feImage`,`feMerge`,`feMergeNode`,`feMorphology`,`feOffset`,`fePointLight`,`feSpecularLighting`,`feSpotLight`,`feTile`,`feTurbulence`]),nw=bC([`animate`,`color-profile`,`cursor`,`discard`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`foreignobject`,`hatch`,`hatchpath`,`mesh`,`meshgradient`,`meshpatch`,`meshrow`,`missing-glyph`,`script`,`set`,`solidcolor`,`unknown`,`use`]),rw=bC(`math.menclose.merror.mfenced.mfrac.mglyph.mi.mlabeledtr.mmultiscripts.mn.mo.mover.mpadded.mphantom.mroot.mrow.ms.mspace.msqrt.mstyle.msub.msup.msubsup.mtable.mtd.mtext.mtr.munder.munderover.mprescripts`.split(`.`)),iw=bC([`maction`,`maligngroup`,`malignmark`,`mlongdiv`,`mscarries`,`mscarry`,`msgroup`,`mstack`,`msline`,`msrow`,`semantics`,`annotation`,`annotation-xml`,`mprescripts`,`none`]),aw=bC([`#text`]),ow=bC(`accept.action.align.alt.autocapitalize.autocomplete.autopictureinpicture.autoplay.background.bgcolor.border.capture.cellpadding.cellspacing.checked.cite.class.clear.color.cols.colspan.command.commandfor.controls.controlslist.coords.crossorigin.datetime.decoding.default.dir.disabled.disablepictureinpicture.disableremoteplayback.download.draggable.enctype.enterkeyhint.exportparts.face.for.headers.height.hidden.high.href.hreflang.id.inert.inputmode.integrity.ismap.kind.label.lang.list.loading.loop.low.max.maxlength.media.method.min.minlength.multiple.muted.name.nonce.noshade.novalidate.nowrap.open.optimum.part.pattern.placeholder.playsinline.popover.popovertarget.popovertargetaction.poster.preload.pubdate.radiogroup.readonly.rel.required.rev.reversed.role.rows.rowspan.spellcheck.scope.selected.shape.size.sizes.slot.span.srclang.start.src.srcset.step.style.summary.tabindex.title.translate.type.usemap.valign.value.width.wrap.xmlns`.split(`.`)),sw=bC(`accent-height.accumulate.additive.alignment-baseline.amplitude.ascent.attributename.attributetype.azimuth.basefrequency.baseline-shift.begin.bias.by.class.clip.clippathunits.clip-path.clip-rule.color.color-interpolation.color-interpolation-filters.color-profile.color-rendering.cx.cy.d.dx.dy.diffuseconstant.direction.display.divisor.dur.edgemode.elevation.end.exponent.fill.fill-opacity.fill-rule.filter.filterunits.flood-color.flood-opacity.font-family.font-size.font-size-adjust.font-stretch.font-style.font-variant.font-weight.fx.fy.g1.g2.glyph-name.glyphref.gradientunits.gradienttransform.height.href.id.image-rendering.in.in2.intercept.k.k1.k2.k3.k4.kerning.keypoints.keysplines.keytimes.lang.lengthadjust.letter-spacing.kernelmatrix.kernelunitlength.lighting-color.local.marker-end.marker-mid.marker-start.markerheight.markerunits.markerwidth.maskcontentunits.maskunits.max.mask.mask-type.media.method.mode.min.name.numoctaves.offset.operator.opacity.order.orient.orientation.origin.overflow.paint-order.path.pathlength.patterncontentunits.patterntransform.patternunits.points.preservealpha.preserveaspectratio.primitiveunits.r.rx.ry.radius.refx.refy.repeatcount.repeatdur.restart.result.rotate.scale.seed.shape-rendering.slope.specularconstant.specularexponent.spreadmethod.startoffset.stddeviation.stitchtiles.stop-color.stop-opacity.stroke-dasharray.stroke-dashoffset.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-opacity.stroke.stroke-width.style.surfacescale.systemlanguage.tabindex.tablevalues.targetx.targety.transform.transform-origin.text-anchor.text-decoration.text-rendering.textlength.type.u1.u2.unicode.values.viewbox.visibility.version.vert-adv-y.vert-origin-x.vert-origin-y.width.word-spacing.wrap.writing-mode.xchannelselector.ychannelselector.x.x1.x2.xmlns.y.y1.y2.z.zoomandpan`.split(`.`)),cw=bC(`accent.accentunder.align.bevelled.close.columnalign.columnlines.columnspacing.columnspan.denomalign.depth.dir.display.displaystyle.encoding.fence.frame.height.href.id.largeop.length.linethickness.lquote.lspace.mathbackground.mathcolor.mathsize.mathvariant.maxsize.minsize.movablelimits.notation.numalign.open.rowalign.rowlines.rowspacing.rowspan.rspace.rquote.scriptlevel.scriptminsize.scriptsizemultiplier.selection.separator.separators.stretchy.subscriptshift.supscriptshift.symmetric.voffset.width.xmlns`.split(`.`)),lw=bC([`xlink:href`,`xml:id`,`xlink:title`,`xml:space`,`xmlns:xlink`]),uw=xC(/{{[\w\W]*|^[\w\W]*}}/g),dw=xC(/<%[\w\W]*|^[\w\W]*%>/g),fw=xC(/\${[\w\W]*/g),pw=xC(/^data-[\-\w.\u00B7-\uFFFF]+$/),mw=xC(/^aria-[\-\w]+$/),hw=xC(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),gw=xC(/^(?:\w+script|data):/i),_w=xC(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),vw=xC(/^html$/i),yw=xC(/^[a-z][.\w]*(-[.\w]+)+$/i),bw=xC(/<[/\w!]/g),xw=xC(/<[/\w]/g),Sw=xC(/<\/no(script|embed|frames)/i),Cw=xC(/\/>/i),ww={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},Tw=function(){return typeof window>`u`?null:window},Ew=function(e,t){if(typeof e!=`object`||typeof e.createPolicy!=`function`)return null;let n=null,r=`data-tt-policy-suffix`;t&&t.hasAttribute(r)&&(n=t.getAttribute(r));let i=`dompurify`+(n?`#`+n:``);try{return e.createPolicy(i,{createHTML(e){return e},createScriptURL(e){return e}})}catch{return console.warn(`TrustedTypes policy `+i+` could not be created.`),null}},Dw=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},Ow=function(e,t,n,r){return HC(e,t)&&jC(e[t])?$(r.base?YC(r.base):{},e[t],r.transform):n};function kw(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Tw(),t=e=>kw(e);if(t.version=`3.4.11`,t.removed=[],!e||!e.document||e.document.nodeType!==ww.document||!e.Element)return t.isSupported=!1,t;let n=e.document,r=n,i=r.currentScript;e.DocumentFragment;let a=e.HTMLTemplateElement,o=e.Node,s=e.Element,c=e.NodeFilter;e.NamedNodeMap===void 0&&(e.NamedNodeMap||e.MozNamedAttrMap),e.HTMLFormElement;let l=e.DOMParser,u=e.trustedTypes,d=s.prototype,f=ZC(d,`cloneNode`),p=ZC(d,`remove`),m=ZC(d,`nextSibling`),h=ZC(d,`childNodes`),g=ZC(d,`parentNode`),_=ZC(d,`shadowRoot`),v=ZC(d,`attributes`),y=o&&o.prototype?ZC(o.prototype,`nodeType`):null,b=o&&o.prototype?ZC(o.prototype,`nodeName`):null;if(typeof a==`function`){let e=n.createElement(`template`);e.content&&e.content.ownerDocument&&(n=e.content.ownerDocument)}let x,S=``,C,w=!1,T=0,E=function(){if(T>0)throw GC(`A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.`)},D=function(e){E(),T++;try{return x.createHTML(e)}finally{T--}},O=function(e){E(),T++;try{return x.createScriptURL(e)}finally{T--}},k=function(){return w||=(C=Ew(u,i),!0),C},A=n,j=A.implementation,M=A.createNodeIterator,N=A.createDocumentFragment,P=A.getElementsByTagName,F=r.importNode,I=Dw();t.isSupported=typeof hC==`function`&&typeof g==`function`&&j&&j.createHTMLDocument!==void 0;let L=uw,ee=dw,te=fw,ne=pw,re=mw,ie=gw,R=_w,ae=yw,oe=hw,z=null,se=$({},[...$C,...ew,...tw,...rw,...aw]),ce=null,le=$({},[...ow,...sw,...cw,...lw]),ue=Object.seal(SC(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),de=null,fe=null,pe=Object.seal(SC(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),me=!0,he=!0,ge=!1,_e=!0,ve=!1,ye=!0,be=!1,xe=!1,Se=null,Ce=null,we=!1,Te=!1,Ee=!1,De=!1,Oe=!0,ke=!1,Ae=`user-content-`,je=!0,Me=!1,Ne={},Pe=null,Fe=$({},`annotation-xml.audio.colgroup.desc.foreignobject.head.iframe.math.mi.mn.mo.ms.mtext.noembed.noframes.noscript.plaintext.script.selectedcontent.style.svg.template.thead.title.video.xmp`.split(`.`)),Ie=null,Le=$({},[`audio`,`video`,`img`,`source`,`image`,`track`]),Re=null,ze=$({},[`alt`,`class`,`for`,`id`,`label`,`name`,`pattern`,`placeholder`,`role`,`summary`,`title`,`value`,`style`,`xmlns`]),Be=`http://www.w3.org/1998/Math/MathML`,Ve=`http://www.w3.org/2000/svg`,He=`http://www.w3.org/1999/xhtml`,Ue=He,We=!1,Ge=null,Ke=$({},[Be,Ve,He],NC),qe=bC([`mi`,`mo`,`mn`,`ms`,`mtext`]),Je=$({},qe),Ye=bC([`annotation-xml`]),Xe=$({},Ye),Ze=$({},[`title`,`style`,`font`,`a`,`script`]),Qe=null,$e=[`application/xhtml+xml`,`text/html`],et=null,tt=null,nt=n.createElement(`form`),rt=function(e){return e instanceof RegExp||e instanceof Function},it=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(tt&&tt===e)return;(!e||typeof e!=`object`)&&(e={}),e=YC(e),Qe=$e.indexOf(e.PARSER_MEDIA_TYPE)===-1?`text/html`:e.PARSER_MEDIA_TYPE,et=Qe===`application/xhtml+xml`?NC:MC,z=Ow(e,`ALLOWED_TAGS`,se,{transform:et}),ce=Ow(e,`ALLOWED_ATTR`,le,{transform:et}),Ge=Ow(e,`ALLOWED_NAMESPACES`,Ke,{transform:NC}),Re=Ow(e,`ADD_URI_SAFE_ATTR`,ze,{transform:et,base:ze}),Ie=Ow(e,`ADD_DATA_URI_TAGS`,Le,{transform:et,base:Le}),Pe=Ow(e,`FORBID_CONTENTS`,Fe,{transform:et}),de=Ow(e,`FORBID_TAGS`,YC({}),{transform:et}),fe=Ow(e,`FORBID_ATTR`,YC({}),{transform:et}),Ne=HC(e,`USE_PROFILES`)?e.USE_PROFILES&&typeof e.USE_PROFILES==`object`?YC(e.USE_PROFILES):e.USE_PROFILES:!1,me=e.ALLOW_ARIA_ATTR!==!1,he=e.ALLOW_DATA_ATTR!==!1,ge=e.ALLOW_UNKNOWN_PROTOCOLS||!1,_e=e.ALLOW_SELF_CLOSE_IN_ATTR!==!1,ve=e.SAFE_FOR_TEMPLATES||!1,ye=e.SAFE_FOR_XML!==!1,be=e.WHOLE_DOCUMENT||!1,Te=e.RETURN_DOM||!1,Ee=e.RETURN_DOM_FRAGMENT||!1,De=e.RETURN_TRUSTED_TYPE||!1,we=e.FORCE_BODY||!1,Oe=e.SANITIZE_DOM!==!1,ke=e.SANITIZE_NAMED_PROPS||!1,je=e.KEEP_CONTENT!==!1,Me=e.IN_PLACE||!1,oe=QC(e.ALLOWED_URI_REGEXP)?e.ALLOWED_URI_REGEXP:hw,Ue=typeof e.NAMESPACE==`string`?e.NAMESPACE:He,Je=HC(e,`MATHML_TEXT_INTEGRATION_POINTS`)&&e.MATHML_TEXT_INTEGRATION_POINTS&&typeof e.MATHML_TEXT_INTEGRATION_POINTS==`object`?YC(e.MATHML_TEXT_INTEGRATION_POINTS):$({},qe),Xe=HC(e,`HTML_INTEGRATION_POINTS`)&&e.HTML_INTEGRATION_POINTS&&typeof e.HTML_INTEGRATION_POINTS==`object`?YC(e.HTML_INTEGRATION_POINTS):$({},Ye);let t=HC(e,`CUSTOM_ELEMENT_HANDLING`)&&e.CUSTOM_ELEMENT_HANDLING&&typeof e.CUSTOM_ELEMENT_HANDLING==`object`?YC(e.CUSTOM_ELEMENT_HANDLING):SC(null);if(ue=SC(null),HC(t,`tagNameCheck`)&&rt(t.tagNameCheck)&&(ue.tagNameCheck=t.tagNameCheck),HC(t,`attributeNameCheck`)&&rt(t.attributeNameCheck)&&(ue.attributeNameCheck=t.attributeNameCheck),HC(t,`allowCustomizedBuiltInElements`)&&typeof t.allowCustomizedBuiltInElements==`boolean`&&(ue.allowCustomizedBuiltInElements=t.allowCustomizedBuiltInElements),xC(ue),ve&&(he=!1),Ee&&(Te=!0),Ne&&(z=$({},aw),ce=SC(null),Ne.html===!0&&($(z,$C),$(ce,ow)),Ne.svg===!0&&($(z,ew),$(ce,sw),$(ce,lw)),Ne.svgFilters===!0&&($(z,tw),$(ce,sw),$(ce,lw)),Ne.mathMl===!0&&($(z,rw),$(ce,cw),$(ce,lw))),pe.tagCheck=null,pe.attributeCheck=null,HC(e,`ADD_TAGS`)&&(typeof e.ADD_TAGS==`function`?pe.tagCheck=e.ADD_TAGS:jC(e.ADD_TAGS)&&(z===se&&(z=YC(z)),$(z,e.ADD_TAGS,et))),HC(e,`ADD_ATTR`)&&(typeof e.ADD_ATTR==`function`?pe.attributeCheck=e.ADD_ATTR:jC(e.ADD_ATTR)&&(ce===le&&(ce=YC(ce)),$(ce,e.ADD_ATTR,et))),HC(e,`ADD_URI_SAFE_ATTR`)&&jC(e.ADD_URI_SAFE_ATTR)&&$(Re,e.ADD_URI_SAFE_ATTR,et),HC(e,`FORBID_CONTENTS`)&&jC(e.FORBID_CONTENTS)&&(Pe===Fe&&(Pe=YC(Pe)),$(Pe,e.FORBID_CONTENTS,et)),HC(e,`ADD_FORBID_CONTENTS`)&&jC(e.ADD_FORBID_CONTENTS)&&(Pe===Fe&&(Pe=YC(Pe)),$(Pe,e.ADD_FORBID_CONTENTS,et)),je&&(z[`#text`]=!0),be&&$(z,[`html`,`head`,`body`]),z.table&&($(z,[`tbody`]),delete de.tbody),e.TRUSTED_TYPES_POLICY){if(typeof e.TRUSTED_TYPES_POLICY.createHTML!=`function`)throw GC(`TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.`);if(typeof e.TRUSTED_TYPES_POLICY.createScriptURL!=`function`)throw GC(`TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.`);let t=x;x=e.TRUSTED_TYPES_POLICY;try{S=D(``)}catch(e){throw x=t,e}}else e.TRUSTED_TYPES_POLICY===null?(x=void 0,S=``):(x===void 0&&(x=k()),x&&typeof S==`string`&&(S=D(``)));bC&&bC(e),tt=e},at=$({},[...ew,...tw,...nw]),ot=$({},[...rw,...iw]),st=function(e,t,n){return t.namespaceURI===He?e===`svg`:t.namespaceURI===Be?e===`svg`&&(n===`annotation-xml`||Je[n]):!!at[e]},ct=function(e,t,n){return t.namespaceURI===He?e===`math`:t.namespaceURI===Ve?e===`math`&&Xe[n]:!!ot[e]},lt=function(e,t,n){return t.namespaceURI===Ve&&!Xe[n]||t.namespaceURI===Be&&!Je[n]?!1:!ot[e]&&(Ze[e]||!at[e])},ut=function(e){let t=g(e);(!t||!t.tagName)&&(t={namespaceURI:Ue,tagName:`template`});let n=MC(e.tagName),r=MC(t.tagName);return Ge[e.namespaceURI]?e.namespaceURI===Ve?st(n,t,r):e.namespaceURI===Be?ct(n,t,r):e.namespaceURI===He?lt(n,t,r):!!(Qe===`application/xhtml+xml`&&Ge[e.namespaceURI]):!1},dt=function(e){kC(t.removed,{element:e});try{g(e).removeChild(e)}catch{if(p(e),!g(e))throw GC(`a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place`)}},ft=function(e){let t=h(e);if(t){let e=[];EC(t,t=>{kC(e,t)}),EC(e,e=>{try{p(e)}catch{}})}let n=v(e);if(n)for(let t=n.length-1;t>=0;--t){let r=n[t],i=r&&r.name;if(typeof i==`string`)try{e.removeAttribute(i)}catch{}}},pt=function(e,n){try{kC(t.removed,{attribute:n.getAttributeNode(e),from:n})}catch{kC(t.removed,{attribute:null,from:n})}if(n.removeAttribute(e),e===`is`)if(Te||Ee)try{dt(n)}catch{}else try{n.setAttribute(e,``)}catch{}},mt=function(e){let t=v(e);if(t)for(let n=t.length-1;n>=0;--n){let r=t[n],i=r&&r.name;if(!(typeof i!=`string`||ce[et(i)]))try{e.removeAttribute(i)}catch{}}},ht=function(e){let t=[e];for(;t.length>0;){let e=t.pop();(y?y(e):e.nodeType)===ww.element&&mt(e);let n=h(e);if(n)for(let e=n.length-1;e>=0;--e)t.push(n[e])}},gt=function(e){let t=null,r=null;if(we)e=`<remove></remove>`+e;else{let t=PC(e,/^[\r\n\t ]+/);r=t&&t[0]}Qe===`application/xhtml+xml`&&Ue===He&&(e=`<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>`+e+`</body></html>`);let i=x?D(e):e;if(Ue===He)try{t=new l().parseFromString(i,Qe)}catch{}if(!t||!t.documentElement){t=j.createDocument(Ue,`template`,null);try{t.documentElement.innerHTML=We?S:i}catch{}}let a=t.body||t.documentElement;return e&&r&&a.insertBefore(n.createTextNode(r),a.childNodes[0]||null),Ue===He?P.call(t,be?`html`:`body`)[0]:be?t.documentElement:a},_t=function(e){return M.call(e.ownerDocument||e,e,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},vt=function(e){return e=FC(e,L,` `),e=FC(e,ee,` `),e=FC(e,te,` `),e},yt=function(e){e.normalize();let t=M.call(e.ownerDocument||e,e,c.SHOW_TEXT|c.SHOW_COMMENT|c.SHOW_CDATA_SECTION|c.SHOW_PROCESSING_INSTRUCTION,null),n=t.nextNode();for(;n;)n.data=vt(n.data),n=t.nextNode();let r=e.querySelectorAll?.call(e,`template`);r&&EC(r,e=>{xt(e.content)&&yt(e.content)})},bt=function(e){let t=b?b(e):null;return typeof t!=`string`||et(t)!==`form`?!1:typeof e.nodeName!=`string`||typeof e.textContent!=`string`||typeof e.removeChild!=`function`||e.attributes!==v(e)||typeof e.removeAttribute!=`function`||typeof e.setAttribute!=`function`||typeof e.namespaceURI!=`string`||typeof e.insertBefore!=`function`||typeof e.hasChildNodes!=`function`||e.nodeType!==y(e)||e.childNodes!==h(e)},xt=function(e){if(!y||typeof e!=`object`||!e)return!1;try{return y(e)===ww.documentFragment}catch{return!1}},St=function(e){if(!y||typeof e!=`object`||!e)return!1;try{return typeof y(e)==`number`}catch{return!1}};function Ct(e,n,r){e.length!==0&&EC(e,e=>{e.call(t,n,r,tt)})}let wt=function(e,t){return!!(ye&&e.hasChildNodes()&&!St(e.firstElementChild)&&WC(bw,e.textContent)&&WC(bw,e.innerHTML)||ye&&e.namespaceURI===He&&t===`style`&&St(e.firstElementChild)||e.nodeType===ww.processingInstruction||ye&&e.nodeType===ww.comment&&WC(xw,e.data))},Tt=function(e,t){if(!de[t]&&kt(t)&&(ue.tagNameCheck instanceof RegExp&&WC(ue.tagNameCheck,t)||ue.tagNameCheck instanceof Function&&ue.tagNameCheck(t)))return!1;if(je&&!Pe[t]){let t=g(e),n=h(e);if(n&&t){let r=n.length;for(let i=r-1;i>=0;--i){let r=Me?n[i]:f(n[i],!0);t.insertBefore(r,m(e))}}}return dt(e),!0},Et=function(e){if(Ct(I.beforeSanitizeElements,e,null),bt(e))return dt(e),!0;let n=et(b?b(e):e.nodeName);if(Ct(I.uponSanitizeElement,e,{tagName:n,allowedTags:z}),wt(e,n))return dt(e),!0;if(de[n]||!(pe.tagCheck instanceof Function&&pe.tagCheck(n))&&!z[n])return Tt(e,n);if((y?y(e):e.nodeType)===ww.element&&!ut(e)||(n===`noscript`||n===`noembed`||n===`noframes`)&&WC(Sw,e.innerHTML))return dt(e),!0;if(ve&&e.nodeType===ww.text){let n=vt(e.textContent);e.textContent!==n&&(kC(t.removed,{element:e.cloneNode()}),e.textContent=n)}return Ct(I.afterSanitizeElements,e,null),!1},Dt=function(e,t,r){if(fe[t]||Oe&&(t===`id`||t===`name`)&&(r in n||r in nt))return!1;let i=ce[t]||pe.attributeCheck instanceof Function&&pe.attributeCheck(t,e);if(!(he&&WC(ne,t))&&!(me&&WC(re,t))){if(!i){if(!(kt(e)&&(ue.tagNameCheck instanceof RegExp&&WC(ue.tagNameCheck,e)||ue.tagNameCheck instanceof Function&&ue.tagNameCheck(e))&&(ue.attributeNameCheck instanceof RegExp&&WC(ue.attributeNameCheck,t)||ue.attributeNameCheck instanceof Function&&ue.attributeNameCheck(t,e))||t===`is`&&ue.allowCustomizedBuiltInElements&&(ue.tagNameCheck instanceof RegExp&&WC(ue.tagNameCheck,r)||ue.tagNameCheck instanceof Function&&ue.tagNameCheck(r))))return!1}else if(!Re[t]&&!WC(oe,FC(r,R,``))&&!((t===`src`||t===`xlink:href`||t===`href`)&&e!==`script`&&IC(r,`data:`)===0&&Ie[e])&&!(ge&&!WC(ie,FC(r,R,``)))&&r)return!1}return!0},Ot=$({},[`annotation-xml`,`color-profile`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`missing-glyph`]),kt=function(e){return!Ot[MC(e)]&&WC(ae,e)},At=function(e,t,n,r){if(x&&typeof u==`object`&&typeof u.getAttributeType==`function`&&!n)switch(u.getAttributeType(e,t)){case`TrustedHTML`:return D(r);case`TrustedScriptURL`:return O(r)}return r},jt=function(e,n,r,i){try{r?e.setAttributeNS(r,n,i):e.setAttribute(n,i),bt(e)?dt(e):OC(t.removed)}catch{pt(n,e)}},Mt=function(e){Ct(I.beforeSanitizeAttributes,e,null);let t=e.attributes;if(!t||bt(e))return;let n={attrName:``,attrValue:``,keepAttr:!0,allowedAttributes:ce,forceKeepAttr:void 0},r=t.length,i=et(e.nodeName);for(;r--;){let a=t[r],o=a.name,s=a.namespaceURI,c=a.value,l=et(o),u=c,d=o===`value`?u:LC(u);if(n.attrName=l,n.attrValue=d,n.keepAttr=!0,n.forceKeepAttr=void 0,Ct(I.uponSanitizeAttribute,e,n),d=n.attrValue,ke&&(l===`id`||l===`name`)&&IC(d,Ae)!==0&&(pt(o,e),d=Ae+d),ye&&WC(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,d)){pt(o,e);continue}if(l===`attributename`&&PC(d,`href`)){pt(o,e);continue}if(!n.forceKeepAttr){if(!n.keepAttr){pt(o,e);continue}if(!_e&&WC(Cw,d)){pt(o,e);continue}if(ve&&(d=vt(d)),!Dt(i,l,d)){pt(o,e);continue}d=At(i,l,s,d),d!==u&&jt(e,o,s,d)}}Ct(I.afterSanitizeAttributes,e,null)},Nt=function(e){let t=null,n=_t(e);for(Ct(I.beforeSanitizeShadowDOM,e,null);t=n.nextNode();)if(Ct(I.uponSanitizeShadowNode,t,null),Et(t),Mt(t),xt(t.content)&&Nt(t.content),(y?y(t):t.nodeType)===ww.element){let e=_(t);xt(e)&&(Pt(e),Nt(e))}Ct(I.afterSanitizeShadowDOM,e,null)},Pt=function(e){let t=[{node:e,shadow:null}];for(;t.length>0;){let e=t.pop();if(e.shadow){Nt(e.shadow);continue}let n=e.node,r=(y?y(n):n.nodeType)===ww.element,i=h(n);if(i)for(let e=i.length-1;e>=0;--e)t.push({node:i[e],shadow:null});if(r){let e=b?b(n):null;if(typeof e==`string`&&et(e)===`template`){let e=n.content;xt(e)&&t.push({node:e,shadow:null})}}if(r){let e=_(n);xt(e)&&t.push({node:null,shadow:e},{node:e,shadow:null})}}};return t.sanitize=function(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=null,a=null,o=null,s=null;if(We=!e,We&&(e=`<!-->`),typeof e!=`string`&&!St(e)&&(e=XC(e),typeof e!=`string`))throw GC(`dirty is not a string, aborting`);if(!t.isSupported)return e;xe?(z=Se,ce=Ce):it(n),(I.uponSanitizeElement.length>0||I.uponSanitizeAttribute.length>0)&&(z=YC(z)),I.uponSanitizeAttribute.length>0&&(ce=YC(ce)),t.removed=[];let c=Me&&typeof e!=`string`&&St(e);if(c){let t=b?b(e):e.nodeName;if(typeof t==`string`){let e=et(t);if(!z[e]||de[e])throw GC(`root node is forbidden and cannot be sanitized in-place`)}if(bt(e))throw GC(`root node is clobbered and cannot be sanitized in-place`);try{Pt(e)}catch(t){throw ft(e),t}}else if(St(e))i=gt(`<!---->`),a=i.ownerDocument.importNode(e,!0),a.nodeType===ww.element&&a.nodeName===`BODY`||a.nodeName===`HTML`?i=a:i.appendChild(a),Pt(a);else{if(!Te&&!ve&&!be&&e.indexOf(`<`)===-1)return x&&De?D(e):e;if(i=gt(e),!i)return Te?null:De?S:``}i&&we&&dt(i.firstChild);let l=_t(c?e:i);try{for(;o=l.nextNode();)Et(o),Mt(o),xt(o.content)&&Nt(o.content)}catch(t){throw c&&ft(e),t}if(c)return EC(t.removed,e=>{e.element&&ht(e.element)}),ve&&yt(e),e;if(Te){if(ve&&yt(i),Ee)for(s=N.call(i.ownerDocument);i.firstChild;)s.appendChild(i.firstChild);else s=i;return(ce.shadowroot||ce.shadowrootmode)&&(s=F.call(r,s,!0)),s}let u=be?i.outerHTML:i.innerHTML;return be&&z[`!doctype`]&&i.ownerDocument&&i.ownerDocument.doctype&&i.ownerDocument.doctype.name&&WC(vw,i.ownerDocument.doctype.name)&&(u=`<!DOCTYPE `+i.ownerDocument.doctype.name+`>
|
|
68
|
-
`+u),ve&&(u=vt(u)),x&&De?D(u):u},t.setConfig=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};it(e),xe=!0,Se=z,Ce=ce},t.clearConfig=function(){tt=null,xe=!1,Se=null,Ce=null,x=C,S=``},t.isValidAttribute=function(e,t,n){tt||it({});let r=et(e),i=et(t);return Dt(r,i,n)},t.addHook=function(e,t){typeof t==`function`&&
|
|
69
|
-
`]}),(0,B.jsx)(`span`,{dangerouslySetInnerHTML:{__html:
|
|
67
|
+
`,1;if(L>1e5&&L>r.index*3)throw Error(`potential infinite loop, way more iterations than matches`);return P+=a,a.length}let D=N(e);if(!D)throw me(s.replace(`{}`,e)),Error(`Unknown language: "`+e+`"`);let O=Ce(D),k=``,A=a||O,j={},M=new l.__emitter(l);w();let P=``,F=0,I=0,L=0,ee=!1;try{if(D.__emitTokens)D.__emitTokens(n,M);else{for(A.matcher.considerAll();;){L++,ee?ee=!1:A.matcher.considerAll(),A.matcher.lastIndex=I;let e=A.matcher.exec(n);if(!e)break;let t=E(n.substring(I,e.index),e);I=e.index+t}E(n.substring(I))}return M.finalize(),k=M.toHTML(),{language:e,value:k,relevance:F,illegal:!1,_emitter:M,_top:A}}catch(t){if(t.message&&t.message.includes(`Illegal`))return{language:e,value:Oe(n),illegal:!0,relevance:0,_illegalBy:{message:t.message,index:I,context:n.slice(I-100,I+100),mode:t.mode,resultSoFar:k},_emitter:M};if(o)return{language:e,value:Oe(n),illegal:!1,relevance:0,errorRaised:t,_emitter:M,_top:A};throw t}}function b(e){let t={value:Oe(e),illegal:!1,relevance:0,_top:c,_emitter:new l.__emitter(l)};return t._emitter.addText(e),t}function S(e,n){n=n||l.languages||Object.keys(t);let r=b(e),i=n.filter(N).filter(F).map(t=>v(t,e,!1));i.unshift(r);let[a,o]=i.sort((e,t)=>{if(e.relevance!==t.relevance)return t.relevance-e.relevance;if(e.language&&t.language){if(N(e.language).supersetOf===t.language)return 1;if(N(t.language).supersetOf===e.language)return-1}return 0}),s=a;return s.secondBest=o,s}function C(e,t,n){let r=t&&i[t]||n;e.classList.add(`hljs`),e.classList.add(`language-${r}`)}function w(e){let t=null,n=d(e);if(u(n))return;if(te(`before:highlightElement`,{el:e,language:n}),e.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",e);return}if(e.children.length>0&&(l.ignoreUnescapedHTML||(console.warn(`One of your code blocks includes unescaped HTML. This is a potentially serious security risk.`),console.warn(`https://github.com/highlightjs/highlight.js/wiki/security`),console.warn(`The element with unescaped HTML:`),console.warn(e)),l.throwUnescapedHTML))throw new De(`One of your code blocks includes unescaped HTML.`,e.innerHTML);t=e;let r=t.textContent,i=n?p(r,{language:n,ignoreIllegals:!0}):S(r);e.innerHTML=i.value,e.dataset.highlighted=`yes`,C(e,n,i.language),e.result={language:i.language,re:i.relevance,relevance:i.relevance},i.secondBest&&(e.secondBest={language:i.secondBest.language,relevance:i.secondBest.relevance}),te(`after:highlightElement`,{el:e,result:i,text:r})}function T(e){l=ke(l,e)}let E=()=>{k(),ge(`10.6.0`,`initHighlighting() deprecated. Use highlightAll() now.`)};function D(){k(),ge(`10.6.0`,`initHighlightingOnLoad() deprecated. Use highlightAll() now.`)}let O=!1;function k(){function e(){k()}if(document.readyState===`loading`){O||window.addEventListener(`DOMContentLoaded`,e,!1),O=!0;return}document.querySelectorAll(l.cssSelector).forEach(w)}function A(n,r){let i=null;try{i=r(e)}catch(e){if(me(`Language definition for '{}' could not be registered.`.replace(`{}`,n)),o)me(e);else throw e;i=c}i.name||=n,t[n]=i,i.rawDefinition=r.bind(null,e),i.aliases&&P(i.aliases,{languageName:n})}function j(e){delete t[e];for(let t of Object.keys(i))i[t]===e&&delete i[t]}function M(){return Object.keys(t)}function N(e){return e=(e||``).toLowerCase(),t[e]||t[i[e]]}function P(e,{languageName:t}){typeof e==`string`&&(e=[e]),e.forEach(e=>{i[e.toLowerCase()]=t})}function F(e){let t=N(e);return t&&!t.disableAutodetect}function I(e){e[`before:highlightBlock`]&&!e[`before:highlightElement`]&&(e[`before:highlightElement`]=t=>{e[`before:highlightBlock`](Object.assign({block:t.el},t))}),e[`after:highlightBlock`]&&!e[`after:highlightElement`]&&(e[`after:highlightElement`]=t=>{e[`after:highlightBlock`](Object.assign({block:t.el},t))})}function L(e){I(e),a.push(e)}function ee(e){let t=a.indexOf(e);t!==-1&&a.splice(t,1)}function te(e,t){let n=e;a.forEach(function(e){e[n]&&e[n](t)})}function re(e){return ge(`10.7.0`,`highlightBlock will be removed entirely in v12.0`),ge(`10.7.0`,`Please use highlightElement now.`),w(e)}Object.assign(e,{highlight:p,highlightAuto:S,highlightAll:k,highlightElement:w,highlightBlock:re,configure:T,initHighlighting:E,initHighlightingOnLoad:D,registerLanguage:A,unregisterLanguage:j,listLanguages:M,getLanguage:N,registerAliases:P,autoDetection:F,inherit:ke,addPlugin:L,removePlugin:ee}),e.debugMode=function(){o=!1},e.safeMode=function(){o=!0},e.versionString=Ee,e.regex={concat:_,lookahead:m,either:y,optional:g,anyNumberOfTimes:h};for(let e in ne)typeof ne[e]==`object`&&n(ne[e]);return Object.assign(e,ne),e},Ne=Me({});Ne.newInstance=()=>Me({}),t.exports=Ne,Ne.HighlightJS=Ne,Ne.default=Ne}))()).default,DS=`[A-Za-z$_][0-9A-Za-z$_]*`,OS=`as.in.of.if.for.while.finally.var.new.function.do.return.void.else.break.catch.instanceof.with.throw.case.default.try.switch.continue.typeof.delete.let.yield.const.class.debugger.async.await.static.import.from.export.extends.using`.split(`.`),kS=[`true`,`false`,`null`,`undefined`,`NaN`,`Infinity`],AS=`Object.Function.Boolean.Symbol.Math.Date.Number.BigInt.String.RegExp.Array.Float32Array.Float64Array.Int8Array.Uint8Array.Uint8ClampedArray.Int16Array.Int32Array.Uint16Array.Uint32Array.BigInt64Array.BigUint64Array.Set.Map.WeakSet.WeakMap.ArrayBuffer.SharedArrayBuffer.Atomics.DataView.JSON.Promise.Generator.GeneratorFunction.AsyncFunction.Reflect.Proxy.Intl.WebAssembly`.split(`.`),jS=[`Error`,`EvalError`,`InternalError`,`RangeError`,`ReferenceError`,`SyntaxError`,`TypeError`,`URIError`],MS=[`setInterval`,`setTimeout`,`clearInterval`,`clearTimeout`,`require`,`exports`,`eval`,`isFinite`,`isNaN`,`parseFloat`,`parseInt`,`decodeURI`,`decodeURIComponent`,`encodeURI`,`encodeURIComponent`,`escape`,`unescape`],NS=[`arguments`,`this`,`super`,`console`,`window`,`document`,`localStorage`,`sessionStorage`,`module`,`global`],PS=[].concat(MS,AS,jS);function FS(e){let t=e.regex,n=(e,{after:t})=>{let n=`</`+e[0].slice(1);return e.input.indexOf(n,t)!==-1},r=DS,i={begin:`<>`,end:`</>`},a=/<[A-Za-z0-9\\._:-]+\s*\/>/,o={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(e,t)=>{let r=e[0].length+e.index,i=e.input[r];if(i===`<`||i===`,`){t.ignoreMatch();return}i===`>`&&(n(e,{after:r})||t.ignoreMatch());let a,o=e.input.substring(r);if(a=o.match(/^\s*=/)){t.ignoreMatch();return}if((a=o.match(/^\s+extends\s+/))&&a.index===0){t.ignoreMatch();return}}},s={$pattern:DS,keyword:OS,literal:kS,built_in:PS,"variable.language":NS},c=`[0-9](_?[0-9])*`,l=`\\.(${c})`,u=`0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*`,d={className:`number`,variants:[{begin:`(\\b(${u})((${l})|\\.)?|(${l}))[eE][+-]?(${c})\\b`},{begin:`\\b(${u})\\b((${l})\\b|\\.)?|(${l})\\b`},{begin:`\\b(0|[1-9](_?[0-9])*)n\\b`},{begin:`\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b`},{begin:`\\b0[bB][0-1](_?[0-1])*n?\\b`},{begin:`\\b0[oO][0-7](_?[0-7])*n?\\b`},{begin:`\\b0[0-7]+n?\\b`}],relevance:0},f={className:`subst`,begin:`\\$\\{`,end:`\\}`,keywords:s,contains:[]},p={begin:".?html`",end:``,starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:`xml`}},m={begin:".?css`",end:``,starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:`css`}},h={begin:".?gql`",end:``,starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:`graphql`}},g={className:`string`,begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,f]},_={className:`comment`,variants:[e.COMMENT(/\/\*\*(?!\/)/,`\\*/`,{relevance:0,contains:[{begin:`(?=@[A-Za-z]+)`,relevance:0,contains:[{className:`doctag`,begin:`@[A-Za-z]+`},{className:`type`,begin:`\\{`,end:`\\}`,excludeEnd:!0,excludeBegin:!0,relevance:0},{className:`variable`,begin:`[A-Za-z$_][0-9A-Za-z$_]*(?=\\s*(-)|$)`,endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},v=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,m,h,g,{match:/\$\d+/},d];f.contains=v.concat({begin:/\{/,end:/\}/,keywords:s,contains:[`self`].concat(v)});let y=[].concat(_,f.contains),b=y.concat([{begin:/(\s*)\(/,end:/\)/,keywords:s,contains:[`self`].concat(y)}]),x={className:`params`,begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:b},S={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,t.concat(r,`(`,t.concat(/\./,r),`)*`)],scope:{1:`keyword`,3:`title.class`,5:`keyword`,7:`title.class.inherited`}},{match:[/class/,/\s+/,r],scope:{1:`keyword`,3:`title.class`}}]},C={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:`title.class`,keywords:{_:[...AS,...jS]}},w={label:`use_strict`,className:`meta`,relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},T={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:`keyword`,3:`title.function`},label:`func.def`,contains:[x],illegal:/%/},E={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:`variable.constant`};function D(e){return t.concat(`(?!`,e.join(`|`),`)`)}let O={match:t.concat(/\b/,D([...MS,`super`,`import`].map(e=>`${e}\\s*\\(`)),r,t.lookahead(/\s*\(/)),className:`title.function`,relevance:0},k={begin:t.concat(/\./,t.lookahead(t.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:`prototype`,className:`property`,relevance:0},A={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:`keyword`,3:`title.function`},contains:[{begin:/\(\)/},x]},j=`(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|`+e.UNDERSCORE_IDENT_RE+`)\\s*=>`,M={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(j)],keywords:`async`,className:{1:`keyword`,3:`title.function`},contains:[x]};return{name:`JavaScript`,aliases:[`js`,`jsx`,`mjs`,`cjs`],keywords:s,exports:{PARAMS_CONTAINS:b,CLASS_REFERENCE:C},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:`shebang`,binary:`node`,relevance:5}),w,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,m,h,g,_,{match:/\$\d+/},d,C,{scope:`attr`,match:r+t.lookahead(`:`),relevance:0},M,{begin:`(`+e.RE_STARTERS_RE+`|\\b(case|return|throw)\\b)\\s*`,keywords:`return throw case`,relevance:0,contains:[_,e.REGEXP_MODE,{className:`function`,begin:j,returnBegin:!0,end:`\\s*=>`,contains:[{className:`params`,variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:b}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:i.begin,end:i.end},{match:a},{begin:o.begin,"on:begin":o.isTrulyOpeningTag,end:o.end}],subLanguage:`xml`,contains:[{begin:o.begin,end:o.end,skip:!0,contains:[`self`]}]}]},T,{beginKeywords:`while if switch catch for`},{begin:`\\b(?!function)`+e.UNDERSCORE_IDENT_RE+`\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{`,returnBegin:!0,label:`func.def`,contains:[x,e.inherit(e.TITLE_MODE,{begin:r,className:`title.function`})]},{match:/\.\.\./,relevance:0},k,{match:`\\$[A-Za-z$_][0-9A-Za-z$_]*`,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:`title.function`},contains:[x]},O,E,S,A,{match:/\$[(.]/}]}}function IS(e){let t=e.regex,n=FS(e),r=DS,i=[`any`,`void`,`number`,`boolean`,`string`,`object`,`never`,`symbol`,`bigint`,`unknown`],a={begin:[/namespace/,/\s+/,e.IDENT_RE],beginScope:{1:`keyword`,3:`title.class`}},o={beginKeywords:`interface`,end:/\{/,excludeEnd:!0,keywords:{keyword:`interface extends`,built_in:i},contains:[n.exports.CLASS_REFERENCE]},s={className:`meta`,relevance:10,begin:/^\s*['"]use strict['"]/},c={$pattern:DS,keyword:OS.concat([`type`,`interface`,`public`,`private`,`protected`,`implements`,`declare`,`abstract`,`readonly`,`enum`,`override`,`satisfies`]),literal:kS,built_in:PS.concat(i),"variable.language":NS},l={className:`meta`,begin:`@[A-Za-z$_][0-9A-Za-z$_]*`},u=(e,t,n)=>{let r=e.contains.findIndex(e=>e.label===t);if(r===-1)throw Error(`can not find mode to replace`);e.contains.splice(r,1,n)};Object.assign(n.keywords,c),n.exports.PARAMS_CONTAINS.push(l);let d=n.contains.find(e=>e.scope===`attr`),f=Object.assign({},d,{match:t.concat(r,t.lookahead(/\s*\?:/))});n.exports.PARAMS_CONTAINS.push([n.exports.CLASS_REFERENCE,d,f]),n.contains=n.contains.concat([l,a,o,f]),u(n,`shebang`,e.SHEBANG()),u(n,`use_strict`,s);let p=n.contains.find(e=>e.label===`func.def`);return p.relevance=0,Object.assign(n,{name:`TypeScript`,aliases:[`ts`,`tsx`,`mts`,`cts`]}),n}var LS=`[A-Za-z$_][0-9A-Za-z$_]*`,RS=`as.in.of.if.for.while.finally.var.new.function.do.return.void.else.break.catch.instanceof.with.throw.case.default.try.switch.continue.typeof.delete.let.yield.const.class.debugger.async.await.static.import.from.export.extends.using`.split(`.`),zS=[`true`,`false`,`null`,`undefined`,`NaN`,`Infinity`],BS=`Object.Function.Boolean.Symbol.Math.Date.Number.BigInt.String.RegExp.Array.Float32Array.Float64Array.Int8Array.Uint8Array.Uint8ClampedArray.Int16Array.Int32Array.Uint16Array.Uint32Array.BigInt64Array.BigUint64Array.Set.Map.WeakSet.WeakMap.ArrayBuffer.SharedArrayBuffer.Atomics.DataView.JSON.Promise.Generator.GeneratorFunction.AsyncFunction.Reflect.Proxy.Intl.WebAssembly`.split(`.`),VS=[`Error`,`EvalError`,`InternalError`,`RangeError`,`ReferenceError`,`SyntaxError`,`TypeError`,`URIError`],HS=[`setInterval`,`setTimeout`,`clearInterval`,`clearTimeout`,`require`,`exports`,`eval`,`isFinite`,`isNaN`,`parseFloat`,`parseInt`,`decodeURI`,`decodeURIComponent`,`encodeURI`,`encodeURIComponent`,`escape`,`unescape`],US=[`arguments`,`this`,`super`,`console`,`window`,`document`,`localStorage`,`sessionStorage`,`module`,`global`],WS=[].concat(HS,BS,VS);function GS(e){let t=e.regex,n=(e,{after:t})=>{let n=`</`+e[0].slice(1);return e.input.indexOf(n,t)!==-1},r=LS,i={begin:`<>`,end:`</>`},a=/<[A-Za-z0-9\\._:-]+\s*\/>/,o={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(e,t)=>{let r=e[0].length+e.index,i=e.input[r];if(i===`<`||i===`,`){t.ignoreMatch();return}i===`>`&&(n(e,{after:r})||t.ignoreMatch());let a,o=e.input.substring(r);if(a=o.match(/^\s*=/)){t.ignoreMatch();return}if((a=o.match(/^\s+extends\s+/))&&a.index===0){t.ignoreMatch();return}}},s={$pattern:LS,keyword:RS,literal:zS,built_in:WS,"variable.language":US},c=`[0-9](_?[0-9])*`,l=`\\.(${c})`,u=`0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*`,d={className:`number`,variants:[{begin:`(\\b(${u})((${l})|\\.)?|(${l}))[eE][+-]?(${c})\\b`},{begin:`\\b(${u})\\b((${l})\\b|\\.)?|(${l})\\b`},{begin:`\\b(0|[1-9](_?[0-9])*)n\\b`},{begin:`\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b`},{begin:`\\b0[bB][0-1](_?[0-1])*n?\\b`},{begin:`\\b0[oO][0-7](_?[0-7])*n?\\b`},{begin:`\\b0[0-7]+n?\\b`}],relevance:0},f={className:`subst`,begin:`\\$\\{`,end:`\\}`,keywords:s,contains:[]},p={begin:".?html`",end:``,starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:`xml`}},m={begin:".?css`",end:``,starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:`css`}},h={begin:".?gql`",end:``,starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:`graphql`}},g={className:`string`,begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,f]},_={className:`comment`,variants:[e.COMMENT(/\/\*\*(?!\/)/,`\\*/`,{relevance:0,contains:[{begin:`(?=@[A-Za-z]+)`,relevance:0,contains:[{className:`doctag`,begin:`@[A-Za-z]+`},{className:`type`,begin:`\\{`,end:`\\}`,excludeEnd:!0,excludeBegin:!0,relevance:0},{className:`variable`,begin:`[A-Za-z$_][0-9A-Za-z$_]*(?=\\s*(-)|$)`,endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},v=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,m,h,g,{match:/\$\d+/},d];f.contains=v.concat({begin:/\{/,end:/\}/,keywords:s,contains:[`self`].concat(v)});let y=[].concat(_,f.contains),b=y.concat([{begin:/(\s*)\(/,end:/\)/,keywords:s,contains:[`self`].concat(y)}]),x={className:`params`,begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:b},S={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,t.concat(r,`(`,t.concat(/\./,r),`)*`)],scope:{1:`keyword`,3:`title.class`,5:`keyword`,7:`title.class.inherited`}},{match:[/class/,/\s+/,r],scope:{1:`keyword`,3:`title.class`}}]},C={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:`title.class`,keywords:{_:[...BS,...VS]}},w={label:`use_strict`,className:`meta`,relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},T={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:`keyword`,3:`title.function`},label:`func.def`,contains:[x],illegal:/%/},E={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:`variable.constant`};function D(e){return t.concat(`(?!`,e.join(`|`),`)`)}let O={match:t.concat(/\b/,D([...HS,`super`,`import`].map(e=>`${e}\\s*\\(`)),r,t.lookahead(/\s*\(/)),className:`title.function`,relevance:0},k={begin:t.concat(/\./,t.lookahead(t.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:`prototype`,className:`property`,relevance:0},A={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:`keyword`,3:`title.function`},contains:[{begin:/\(\)/},x]},j=`(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|`+e.UNDERSCORE_IDENT_RE+`)\\s*=>`,M={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(j)],keywords:`async`,className:{1:`keyword`,3:`title.function`},contains:[x]};return{name:`JavaScript`,aliases:[`js`,`jsx`,`mjs`,`cjs`],keywords:s,exports:{PARAMS_CONTAINS:b,CLASS_REFERENCE:C},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:`shebang`,binary:`node`,relevance:5}),w,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,m,h,g,_,{match:/\$\d+/},d,C,{scope:`attr`,match:r+t.lookahead(`:`),relevance:0},M,{begin:`(`+e.RE_STARTERS_RE+`|\\b(case|return|throw)\\b)\\s*`,keywords:`return throw case`,relevance:0,contains:[_,e.REGEXP_MODE,{className:`function`,begin:j,returnBegin:!0,end:`\\s*=>`,contains:[{className:`params`,variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:b}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:i.begin,end:i.end},{match:a},{begin:o.begin,"on:begin":o.isTrulyOpeningTag,end:o.end}],subLanguage:`xml`,contains:[{begin:o.begin,end:o.end,skip:!0,contains:[`self`]}]}]},T,{beginKeywords:`while if switch catch for`},{begin:`\\b(?!function)`+e.UNDERSCORE_IDENT_RE+`\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{`,returnBegin:!0,label:`func.def`,contains:[x,e.inherit(e.TITLE_MODE,{begin:r,className:`title.function`})]},{match:/\.\.\./,relevance:0},k,{match:`\\$[A-Za-z$_][0-9A-Za-z$_]*`,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:`title.function`},contains:[x]},O,E,S,A,{match:/\$[(.]/}]}}function KS(e){let t={className:`attr`,begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},n={match:/[{}[\],:]/,className:`punctuation`,relevance:0},r=[`true`,`false`,`null`],i={scope:`literal`,beginKeywords:r.join(` `)};return{name:`JSON`,aliases:[`jsonc`],keywords:{literal:r},contains:[t,n,e.QUOTE_STRING_MODE,i,e.C_NUMBER_MODE,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE],illegal:`\\S`}}function qS(e){let t=e.regex,n={},r={begin:/\$\{/,end:/\}/,contains:[`self`,{begin:/:-/,contains:[n]}]};Object.assign(n,{className:`variable`,variants:[{begin:t.concat(/\$[\w\d#@][\w\d_]*/,`(?![\\w\\d])(?![$])`)},r]});let i={className:`subst`,begin:/\$\(/,end:/\)/,contains:[e.BACKSLASH_ESCAPE]},a=e.inherit(e.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:`comment`}}),o={begin:/<<-?\s*(?=\w+)/,starts:{contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:`string`})]}},s={className:`string`,begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,n,i]};i.contains.push(s);let c={match:/\\"/},l={className:`string`,begin:/'/,end:/'/},u={match:/\\'/},d={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:`number`},e.NUMBER_MODE,n]},f=e.SHEBANG({binary:`(${[`fish`,`bash`,`zsh`,`sh`,`csh`,`ksh`,`tcsh`,`dash`,`scsh`].join(`|`)})`,relevance:10}),p={className:`function`,begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[e.inherit(e.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},m=[`if`,`then`,`else`,`elif`,`fi`,`time`,`for`,`while`,`until`,`in`,`do`,`done`,`case`,`esac`,`coproc`,`function`,`select`],h=[`true`,`false`],g={match:/(\/[a-z._-]+)+/},_=[`break`,`cd`,`continue`,`eval`,`exec`,`exit`,`export`,`getopts`,`hash`,`pwd`,`readonly`,`return`,`shift`,`test`,`times`,`trap`,`umask`,`unset`],v=[`alias`,`bind`,`builtin`,`caller`,`command`,`declare`,`echo`,`enable`,`help`,`let`,`local`,`logout`,`mapfile`,`printf`,`read`,`readarray`,`source`,`sudo`,`type`,`typeset`,`ulimit`,`unalias`],y=`autoload.bg.bindkey.bye.cap.chdir.clone.comparguments.compcall.compctl.compdescribe.compfiles.compgroups.compquote.comptags.comptry.compvalues.dirs.disable.disown.echotc.echoti.emulate.fc.fg.float.functions.getcap.getln.history.integer.jobs.kill.limit.log.noglob.popd.print.pushd.pushln.rehash.sched.setcap.setopt.stat.suspend.ttyctl.unfunction.unhash.unlimit.unsetopt.vared.wait.whence.where.which.zcompile.zformat.zftp.zle.zmodload.zparseopts.zprof.zpty.zregexparse.zsocket.zstyle.ztcp`.split(`.`),b=`chcon.chgrp.chown.chmod.cp.dd.df.dir.dircolors.ln.ls.mkdir.mkfifo.mknod.mktemp.mv.realpath.rm.rmdir.shred.sync.touch.truncate.vdir.b2sum.base32.base64.cat.cksum.comm.csplit.cut.expand.fmt.fold.head.join.md5sum.nl.numfmt.od.paste.ptx.pr.sha1sum.sha224sum.sha256sum.sha384sum.sha512sum.shuf.sort.split.sum.tac.tail.tr.tsort.unexpand.uniq.wc.arch.basename.chroot.date.dirname.du.echo.env.expr.factor.groups.hostid.id.link.logname.nice.nohup.nproc.pathchk.pinky.printenv.printf.pwd.readlink.runcon.seq.sleep.stat.stdbuf.stty.tee.test.timeout.tty.uname.unlink.uptime.users.who.whoami.yes`.split(`.`);return{name:`Bash`,aliases:[`sh`,`zsh`],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:m,literal:h,built_in:[..._,...v,`set`,`shopt`,...y,...b]},contains:[f,e.SHEBANG(),p,d,a,o,g,s,c,l,u,n]}}function JS(e){return{name:`Shell Session`,aliases:[`console`,`shellsession`],contains:[{className:`meta.prompt`,begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:`bash`}}]}}function YS(e){let t=e.regex,n=/[\p{XID_Start}_]\p{XID_Continue}*/u,r=`and.as.assert.async.await.break.case.class.continue.def.del.elif.else.except.finally.for.from.global.if.import.in.is.lambda.match.nonlocal|10.not.or.pass.raise.return.try.while.with.yield`.split(`.`),i={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:r,built_in:`__import__.abs.all.any.ascii.bin.bool.breakpoint.bytearray.bytes.callable.chr.classmethod.compile.complex.delattr.dict.dir.divmod.enumerate.eval.exec.filter.float.format.frozenset.getattr.globals.hasattr.hash.help.hex.id.input.int.isinstance.issubclass.iter.len.list.locals.map.max.memoryview.min.next.object.oct.open.ord.pow.print.property.range.repr.reversed.round.set.setattr.slice.sorted.staticmethod.str.sum.super.tuple.type.vars.zip`.split(`.`),literal:[`__debug__`,`Ellipsis`,`False`,`None`,`NotImplemented`,`True`],type:[`Any`,`Callable`,`Coroutine`,`Dict`,`List`,`Literal`,`Generic`,`Optional`,`Sequence`,`Set`,`Tuple`,`Type`,`Union`]},a={className:`meta`,begin:/^(>>>|\.\.\.) /},o={className:`subst`,begin:/\{/,end:/\}/,keywords:i,illegal:/#/},s={begin:/\{\{/,relevance:0},c={className:`string`,contains:[e.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,a],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,a],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,a,s,o]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,a,s,o]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[e.BACKSLASH_ESCAPE,s,o]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,s,o]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},l=`[0-9](_?[0-9])*`,u=`(\\b(${l}))?\\.(${l})|\\b(${l})\\.`,d=`\\b|${r.join(`|`)}`,f={className:`number`,relevance:0,variants:[{begin:`(\\b(${l})|(${u}))[eE][+-]?(${l})[jJ]?(?=${d})`},{begin:`(${u})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${d})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${d})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${d})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${d})`},{begin:`\\b(${l})[jJ](?=${d})`}]},p={className:`comment`,begin:t.lookahead(/# type:/),end:/$/,keywords:i,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},m={className:`params`,variants:[{className:``,begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:i,contains:[`self`,a,f,c,e.HASH_COMMENT_MODE]}]};return o.contains=[c,f,a],{name:`Python`,aliases:[`py`,`gyp`,`ipython`],unicodeRegex:!0,keywords:i,illegal:/(<\/|\?)|=>/,contains:[a,f,{scope:`variable.language`,match:/\bself\b/},{beginKeywords:`if`,relevance:0},{match:/\bor\b/,scope:`keyword`},c,p,e.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,n],scope:{1:`keyword`,3:`title.function`},contains:[m]},{variants:[{match:[/\bclass/,/\s+/,n,/\s*/,/\(\s*/,n,/\s*\)/]},{match:[/\bclass/,/\s+/,n]}],scope:{1:`keyword`,3:`title.class`,6:`title.class.inherited`}},{className:`meta`,begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[f,m,c]}]}}function XS(e){let t=e.regex;return{name:`Diff`,aliases:[`patch`],contains:[{className:`meta`,relevance:10,match:t.either(/^@@ +-\d+,\d+ +\+\d+,\d+ +@@/,/^\*\*\* +\d+,\d+ +\*\*\*\*$/,/^--- +\d+,\d+ +----$/)},{className:`comment`,variants:[{begin:t.either(/Index: /,/^index/,/={3,}/,/^-{3}/,/^\*{3} /,/^\+{3}/,/^diff --git/),end:/$/},{match:/^\*{15}$/}]},{className:`addition`,begin:/^\+/,end:/$/},{className:`deletion`,begin:/^-/,end:/$/},{className:`addition`,begin:/^!/,end:/$/}]}}function ZS(e){let t=e.regex,n=t.concat(/[\p{L}_]/u,t.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),r=/[\p{L}0-9._:-]+/u,i={className:`symbol`,begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},a={begin:/\s/,contains:[{className:`keyword`,begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},o=e.inherit(a,{begin:/\(/,end:/\)/}),s=e.inherit(e.APOS_STRING_MODE,{className:`string`}),c=e.inherit(e.QUOTE_STRING_MODE,{className:`string`}),l={endsWithParent:!0,illegal:/</,relevance:0,contains:[{className:`attr`,begin:r,relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:`string`,endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[i]},{begin:/'/,end:/'/,contains:[i]},{begin:/[^\s"'=<>`]+/}]}]}]};return{name:`HTML, XML`,aliases:[`html`,`xhtml`,`rss`,`atom`,`xjb`,`xsd`,`xsl`,`plist`,`wsf`,`svg`],case_insensitive:!0,unicodeRegex:!0,contains:[{className:`meta`,begin:/<![a-z]/,end:/>/,relevance:10,contains:[a,c,s,o,{begin:/\[/,end:/\]/,contains:[{className:`meta`,begin:/<![a-z]/,end:/>/,contains:[a,o,c,s]}]}]},e.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},i,{className:`meta`,end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[c]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:`tag`,begin:/<style(?=\s|>)/,end:/>/,keywords:{name:`style`},contains:[l],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:[`css`,`xml`]}},{className:`tag`,begin:/<script(?=\s|>)/,end:/>/,keywords:{name:`script`},contains:[l],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:[`javascript`,`handlebars`,`xml`]}},{className:`tag`,begin:/<>|<\/>/},{className:`tag`,begin:t.concat(/</,t.lookahead(t.concat(n,t.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:`name`,begin:n,relevance:0,starts:l}]},{className:`tag`,begin:t.concat(/<\//,t.lookahead(t.concat(n,/>/))),contains:[{className:`name`,begin:n,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}var QS=e=>({IMPORTANT:{scope:`meta`,begin:`!important`},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:`number`,begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:`built_in`,begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:`selector-attr`,begin:/\[/,end:/\]/,illegal:`$`,contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:`number`,begin:e.NUMBER_RE+`(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?`,relevance:0},CSS_VARIABLE:{className:`attr`,begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),$S=`a.abbr.address.article.aside.audio.b.blockquote.body.button.canvas.caption.cite.code.dd.del.details.dfn.div.dl.dt.em.fieldset.figcaption.figure.footer.form.h1.h2.h3.h4.h5.h6.header.hgroup.html.i.iframe.img.input.ins.kbd.label.legend.li.main.mark.menu.nav.object.ol.optgroup.option.p.picture.q.quote.samp.section.select.source.span.strong.summary.sup.table.tbody.td.textarea.tfoot.th.thead.time.tr.ul.var.video`.split(`.`),eC=`defs.g.marker.mask.pattern.svg.switch.symbol.feBlend.feColorMatrix.feComponentTransfer.feComposite.feConvolveMatrix.feDiffuseLighting.feDisplacementMap.feFlood.feGaussianBlur.feImage.feMerge.feMorphology.feOffset.feSpecularLighting.feTile.feTurbulence.linearGradient.radialGradient.stop.circle.ellipse.image.line.path.polygon.polyline.rect.text.use.textPath.tspan.foreignObject.clipPath`.split(`.`),tC=[...$S,...eC],nC=`any-hover.any-pointer.aspect-ratio.color.color-gamut.color-index.device-aspect-ratio.device-height.device-width.display-mode.forced-colors.grid.height.hover.inverted-colors.monochrome.orientation.overflow-block.overflow-inline.pointer.prefers-color-scheme.prefers-contrast.prefers-reduced-motion.prefers-reduced-transparency.resolution.scan.scripting.update.width.min-width.max-width.min-height.max-height`.split(`.`).sort().reverse(),rC=`active.any-link.blank.checked.current.default.defined.dir.disabled.drop.empty.enabled.first.first-child.first-of-type.fullscreen.future.focus.focus-visible.focus-within.has.host.host-context.hover.indeterminate.in-range.invalid.is.lang.last-child.last-of-type.left.link.local-link.not.nth-child.nth-col.nth-last-child.nth-last-col.nth-last-of-type.nth-of-type.only-child.only-of-type.optional.out-of-range.past.placeholder-shown.read-only.read-write.required.right.root.scope.target.target-within.user-invalid.valid.visited.where`.split(`.`).sort().reverse(),iC=[`after`,`backdrop`,`before`,`cue`,`cue-region`,`first-letter`,`first-line`,`grammar-error`,`marker`,`part`,`placeholder`,`selection`,`slotted`,`spelling-error`].sort().reverse(),aC=`accent-color.align-content.align-items.align-self.alignment-baseline.all.anchor-name.animation.animation-composition.animation-delay.animation-direction.animation-duration.animation-fill-mode.animation-iteration-count.animation-name.animation-play-state.animation-range.animation-range-end.animation-range-start.animation-timeline.animation-timing-function.appearance.aspect-ratio.backdrop-filter.backface-visibility.background.background-attachment.background-blend-mode.background-clip.background-color.background-image.background-origin.background-position.background-position-x.background-position-y.background-repeat.background-size.baseline-shift.block-size.border.border-block.border-block-color.border-block-end.border-block-end-color.border-block-end-style.border-block-end-width.border-block-start.border-block-start-color.border-block-start-style.border-block-start-width.border-block-style.border-block-width.border-bottom.border-bottom-color.border-bottom-left-radius.border-bottom-right-radius.border-bottom-style.border-bottom-width.border-collapse.border-color.border-end-end-radius.border-end-start-radius.border-image.border-image-outset.border-image-repeat.border-image-slice.border-image-source.border-image-width.border-inline.border-inline-color.border-inline-end.border-inline-end-color.border-inline-end-style.border-inline-end-width.border-inline-start.border-inline-start-color.border-inline-start-style.border-inline-start-width.border-inline-style.border-inline-width.border-left.border-left-color.border-left-style.border-left-width.border-radius.border-right.border-right-color.border-right-style.border-right-width.border-spacing.border-start-end-radius.border-start-start-radius.border-style.border-top.border-top-color.border-top-left-radius.border-top-right-radius.border-top-style.border-top-width.border-width.bottom.box-align.box-decoration-break.box-direction.box-flex.box-flex-group.box-lines.box-ordinal-group.box-orient.box-pack.box-shadow.box-sizing.break-after.break-before.break-inside.caption-side.caret-color.clear.clip.clip-path.clip-rule.color.color-interpolation.color-interpolation-filters.color-profile.color-rendering.color-scheme.column-count.column-fill.column-gap.column-rule.column-rule-color.column-rule-style.column-rule-width.column-span.column-width.columns.contain.contain-intrinsic-block-size.contain-intrinsic-height.contain-intrinsic-inline-size.contain-intrinsic-size.contain-intrinsic-width.container.container-name.container-type.content.content-visibility.counter-increment.counter-reset.counter-set.cue.cue-after.cue-before.cursor.cx.cy.direction.display.dominant-baseline.empty-cells.enable-background.field-sizing.fill.fill-opacity.fill-rule.filter.flex.flex-basis.flex-direction.flex-flow.flex-grow.flex-shrink.flex-wrap.float.flood-color.flood-opacity.flow.font.font-display.font-family.font-feature-settings.font-kerning.font-language-override.font-optical-sizing.font-palette.font-size.font-size-adjust.font-smooth.font-smoothing.font-stretch.font-style.font-synthesis.font-synthesis-position.font-synthesis-small-caps.font-synthesis-style.font-synthesis-weight.font-variant.font-variant-alternates.font-variant-caps.font-variant-east-asian.font-variant-emoji.font-variant-ligatures.font-variant-numeric.font-variant-position.font-variation-settings.font-weight.forced-color-adjust.gap.glyph-orientation-horizontal.glyph-orientation-vertical.grid.grid-area.grid-auto-columns.grid-auto-flow.grid-auto-rows.grid-column.grid-column-end.grid-column-start.grid-gap.grid-row.grid-row-end.grid-row-start.grid-template.grid-template-areas.grid-template-columns.grid-template-rows.hanging-punctuation.height.hyphenate-character.hyphenate-limit-chars.hyphens.icon.image-orientation.image-rendering.image-resolution.ime-mode.initial-letter.initial-letter-align.inline-size.inset.inset-area.inset-block.inset-block-end.inset-block-start.inset-inline.inset-inline-end.inset-inline-start.isolation.justify-content.justify-items.justify-self.kerning.left.letter-spacing.lighting-color.line-break.line-height.line-height-step.list-style.list-style-image.list-style-position.list-style-type.margin.margin-block.margin-block-end.margin-block-start.margin-bottom.margin-inline.margin-inline-end.margin-inline-start.margin-left.margin-right.margin-top.margin-trim.marker.marker-end.marker-mid.marker-start.marks.mask.mask-border.mask-border-mode.mask-border-outset.mask-border-repeat.mask-border-slice.mask-border-source.mask-border-width.mask-clip.mask-composite.mask-image.mask-mode.mask-origin.mask-position.mask-repeat.mask-size.mask-type.masonry-auto-flow.math-depth.math-shift.math-style.max-block-size.max-height.max-inline-size.max-width.min-block-size.min-height.min-inline-size.min-width.mix-blend-mode.nav-down.nav-index.nav-left.nav-right.nav-up.none.normal.object-fit.object-position.offset.offset-anchor.offset-distance.offset-path.offset-position.offset-rotate.opacity.order.orphans.outline.outline-color.outline-offset.outline-style.outline-width.overflow.overflow-anchor.overflow-block.overflow-clip-margin.overflow-inline.overflow-wrap.overflow-x.overflow-y.overlay.overscroll-behavior.overscroll-behavior-block.overscroll-behavior-inline.overscroll-behavior-x.overscroll-behavior-y.padding.padding-block.padding-block-end.padding-block-start.padding-bottom.padding-inline.padding-inline-end.padding-inline-start.padding-left.padding-right.padding-top.page.page-break-after.page-break-before.page-break-inside.paint-order.pause.pause-after.pause-before.perspective.perspective-origin.place-content.place-items.place-self.pointer-events.position.position-anchor.position-visibility.print-color-adjust.quotes.r.resize.rest.rest-after.rest-before.right.rotate.row-gap.ruby-align.ruby-position.scale.scroll-behavior.scroll-margin.scroll-margin-block.scroll-margin-block-end.scroll-margin-block-start.scroll-margin-bottom.scroll-margin-inline.scroll-margin-inline-end.scroll-margin-inline-start.scroll-margin-left.scroll-margin-right.scroll-margin-top.scroll-padding.scroll-padding-block.scroll-padding-block-end.scroll-padding-block-start.scroll-padding-bottom.scroll-padding-inline.scroll-padding-inline-end.scroll-padding-inline-start.scroll-padding-left.scroll-padding-right.scroll-padding-top.scroll-snap-align.scroll-snap-stop.scroll-snap-type.scroll-timeline.scroll-timeline-axis.scroll-timeline-name.scrollbar-color.scrollbar-gutter.scrollbar-width.shape-image-threshold.shape-margin.shape-outside.shape-rendering.speak.speak-as.src.stop-color.stop-opacity.stroke.stroke-dasharray.stroke-dashoffset.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-opacity.stroke-width.tab-size.table-layout.text-align.text-align-all.text-align-last.text-anchor.text-combine-upright.text-decoration.text-decoration-color.text-decoration-line.text-decoration-skip.text-decoration-skip-ink.text-decoration-style.text-decoration-thickness.text-emphasis.text-emphasis-color.text-emphasis-position.text-emphasis-style.text-indent.text-justify.text-orientation.text-overflow.text-rendering.text-shadow.text-size-adjust.text-transform.text-underline-offset.text-underline-position.text-wrap.text-wrap-mode.text-wrap-style.timeline-scope.top.touch-action.transform.transform-box.transform-origin.transform-style.transition.transition-behavior.transition-delay.transition-duration.transition-property.transition-timing-function.translate.unicode-bidi.user-modify.user-select.vector-effect.vertical-align.view-timeline.view-timeline-axis.view-timeline-inset.view-timeline-name.view-transition-name.visibility.voice-balance.voice-duration.voice-family.voice-pitch.voice-range.voice-rate.voice-stress.voice-volume.white-space.white-space-collapse.widows.width.will-change.word-break.word-spacing.word-wrap.writing-mode.x.y.z-index.zoom`.split(`.`).sort().reverse();function oC(e){let t=e.regex,n=QS(e),r={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},i=/@-?\w[\w]*(-\w+)*/,a=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE];return{name:`CSS`,case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:`from to`},classNameAliases:{keyframePosition:`selector-tag`},contains:[n.BLOCK_COMMENT,r,n.CSS_NUMBER_MODE,{className:`selector-id`,begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:`selector-class`,begin:`\\.[a-zA-Z-][a-zA-Z0-9_-]*`,relevance:0},n.ATTRIBUTE_SELECTOR_MODE,{className:`selector-pseudo`,variants:[{begin:`:(`+rC.join(`|`)+`)`},{begin:`:(:)?(`+iC.join(`|`)+`)`}]},n.CSS_VARIABLE,{className:`attribute`,begin:`\\b(`+aC.join(`|`)+`)\\b`},{begin:/:/,end:/[;}{]/,contains:[n.BLOCK_COMMENT,n.HEXCOLOR,n.IMPORTANT,n.CSS_NUMBER_MODE,...a,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:`url data-uri`},contains:[...a,{className:`string`,begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},n.FUNCTION_DISPATCH]},{begin:t.lookahead(/@/),end:`[{;]`,relevance:0,illegal:/:/,contains:[{className:`keyword`,begin:i},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:`and or not only`,attribute:nC.join(` `)},contains:[{begin:/[a-z-]+(?=:)/,className:`attribute`},...a,n.CSS_NUMBER_MODE]}]},{className:`selector-tag`,begin:`\\b(`+tC.join(`|`)+`)\\b`}]}}function sC(e){let t=e.regex,n={begin:/<\/?[A-Za-z_]/,end:`>`,subLanguage:`xml`,relevance:0},r={begin:`^[-\\*]{3,}`,end:`$`},i={className:`code`,variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:`(~{3,})[^~](.|\\n)*?\\1~*[ ]*`},{begin:"```",end:"```+[ ]*$"},{begin:`~~~`,end:`~~~+[ ]*$`},{begin:"`.+?`"},{begin:`(?=^( {4}|\\t))`,contains:[{begin:`^( {4}|\\t)`,end:`(\\n)$`}],relevance:0}]},a={className:`bullet`,begin:`^[ ]*([*+-]|(\\d+\\.))(?=\\s+)`,end:`\\s+`,excludeEnd:!0},o={begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:`symbol`,begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:`link`,begin:/:\s*/,end:/$/,excludeBegin:!0}]},s={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:t.concat(/\[.+?\]\(/,/[A-Za-z][A-Za-z0-9+.-]*/,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:`string`,relevance:0,begin:`\\[`,end:`\\]`,excludeBegin:!0,returnEnd:!0},{className:`link`,relevance:0,begin:`\\]\\(`,end:`\\)`,excludeBegin:!0,excludeEnd:!0},{className:`symbol`,relevance:0,begin:`\\]\\[`,end:`\\]`,excludeBegin:!0,excludeEnd:!0}]},c={className:`strong`,contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},l={className:`emphasis`,contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},u=e.inherit(c,{contains:[]}),d=e.inherit(l,{contains:[]});c.contains.push(d),l.contains.push(u);let f=[n,s];return[c,l,u,d].forEach(e=>{e.contains=e.contains.concat(f)}),f=f.concat(c,l),{name:`Markdown`,aliases:[`md`,`mkdown`,`mkd`],contains:[{className:`section`,variants:[{begin:`^#{1,6}`,end:`$`,contains:f},{begin:`(?=^.+?\\n[=-]{2,}$)`,contains:[{begin:`^[=-]*$`},{begin:`^`,end:`\\n`,contains:f}]}]},n,a,c,l,{className:`quote`,begin:`^>\\s+`,contains:f,end:`$`},i,r,s,o,{scope:`literal`,match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function cC(e){let t=`true false yes no null`,n={className:`attr`,variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},r={className:`template-variable`,variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},i={className:`string`,relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:`char.escape`,relevance:0}]},a={className:`string`,relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[e.BACKSLASH_ESCAPE,r]},o=e.inherit(a,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),s={className:`number`,begin:`\\b[0-9]{4}(-[0-9][0-9]){0,2}([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?(\\.[0-9]*)?([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?\\b`},c={end:`,`,endsWithParent:!0,excludeEnd:!0,keywords:t,relevance:0},l={begin:/\{/,end:/\}/,contains:[c],illegal:`\\n`,relevance:0},u={begin:`\\[`,end:`\\]`,contains:[c],illegal:`\\n`,relevance:0},d=[n,{className:`meta`,begin:`^---\\s*$`,relevance:10},{className:`string`,begin:`[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*`},{begin:`<%[%=-]?`,end:`[%-]?%>`,subLanguage:`ruby`,excludeBegin:!0,excludeEnd:!0,relevance:0},{className:`type`,begin:`!\\w+![\\w#;/?:@&=+$,.~*'()[\\]]+`},{className:`type`,begin:`!<[\\w#;/?:@&=+$,.~*'()[\\]]+>`},{className:`type`,begin:`![\\w#;/?:@&=+$,.~*'()[\\]]+`},{className:`type`,begin:`!![\\w#;/?:@&=+$,.~*'()[\\]]+`},{className:`meta`,begin:`&`+e.UNDERSCORE_IDENT_RE+`$`},{className:`meta`,begin:`\\*`+e.UNDERSCORE_IDENT_RE+`$`},{className:`bullet`,begin:`-(?=[ ]|$)`,relevance:0},e.HASH_COMMENT_MODE,{beginKeywords:t,keywords:{literal:t}},s,{className:`number`,begin:e.C_NUMBER_RE+`\\b`,relevance:0},l,u,i,a],f=[...d];return f.pop(),f.push(o),c.contains=f,{name:`YAML`,case_insensitive:!0,aliases:[`yml`],contains:d}}function lC(e){return{name:`Plain text`,aliases:[`text`,`txt`],disableAutodetect:!0}}function uC(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function dC(e){if(Array.isArray(e))return e}function fC(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function pC(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
68
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function mC(e,t){return dC(e)||fC(e,t)||hC(e,t)||pC()}function hC(e,t){if(e){if(typeof e==`string`)return uC(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?uC(e,t):void 0}}var gC=Object.entries,_C=Object.setPrototypeOf,vC=Object.isFrozen,yC=Object.getPrototypeOf,bC=Object.getOwnPropertyDescriptor,xC=Object.freeze,SC=Object.seal,CC=Object.create,wC=typeof Reflect<`u`&&Reflect,TC=wC.apply,EC=wC.construct;xC||=function(e){return e},SC||=function(e){return e},TC||=function(e,t){var n=[...arguments].slice(2);return e.apply(t,n)},EC||=function(e){return new e(...[...arguments].slice(1))};var DC=qC(Array.prototype.forEach),OC=qC(Array.prototype.lastIndexOf),kC=qC(Array.prototype.pop),AC=qC(Array.prototype.push),jC=qC(Array.prototype.splice),MC=Array.isArray,NC=qC(String.prototype.toLowerCase),PC=qC(String.prototype.toString),FC=qC(String.prototype.match),IC=qC(String.prototype.replace),LC=qC(String.prototype.indexOf),RC=qC(String.prototype.trim),zC=qC(Number.prototype.toString),BC=qC(Boolean.prototype.toString),VC=typeof BigInt>`u`?null:qC(BigInt.prototype.toString),HC=typeof Symbol>`u`?null:qC(Symbol.prototype.toString),UC=qC(Object.prototype.hasOwnProperty),WC=qC(Object.prototype.toString),GC=qC(RegExp.prototype.test),KC=JC(TypeError);function qC(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);var n=[...arguments].slice(1);return TC(e,t,n)}}function JC(e){return function(){return EC(e,[...arguments])}}function $(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:NC;if(_C&&_C(e,null),!MC(t))return e;let r=t.length;for(;r--;){let i=t[r];if(typeof i==`string`){let e=n(i);e!==i&&(vC(t)||(t[r]=e),i=e)}e[i]=!0}return e}function YC(e){for(let t=0;t<e.length;t++)UC(e,t)||(e[t]=null);return e}function XC(e){let t=CC(null);for(let r of gC(e)){var n=mC(r,2);let i=n[0],a=n[1];UC(e,i)&&(MC(a)?t[i]=YC(a):a&&typeof a==`object`&&a.constructor===Object?t[i]=XC(a):t[i]=a)}return t}function ZC(e){switch(typeof e){case`string`:return e;case`number`:return zC(e);case`boolean`:return BC(e);case`bigint`:return VC?VC(e):`0`;case`symbol`:return HC?HC(e):`Symbol()`;case`undefined`:return WC(e);case`function`:case`object`:{if(e===null)return WC(e);let t=e,n=QC(t,`toString`);if(typeof n==`function`){let e=n(t);return typeof e==`string`?e:WC(e)}return WC(e)}default:return WC(e)}}function QC(e,t){for(;e!==null;){let n=bC(e,t);if(n){if(n.get)return qC(n.get);if(typeof n.value==`function`)return qC(n.value)}e=yC(e)}function n(){return null}return n}function $C(e){try{return GC(e,``),!0}catch{return!1}}var ew=xC(`a.abbr.acronym.address.area.article.aside.audio.b.bdi.bdo.big.blink.blockquote.body.br.button.canvas.caption.center.cite.code.col.colgroup.content.data.datalist.dd.decorator.del.details.dfn.dialog.dir.div.dl.dt.element.em.fieldset.figcaption.figure.font.footer.form.h1.h2.h3.h4.h5.h6.head.header.hgroup.hr.html.i.img.input.ins.kbd.label.legend.li.main.map.mark.marquee.menu.menuitem.meter.nav.nobr.ol.optgroup.option.output.p.picture.pre.progress.q.rp.rt.ruby.s.samp.search.section.select.shadow.slot.small.source.spacer.span.strike.strong.style.sub.summary.sup.table.tbody.td.template.textarea.tfoot.th.thead.time.tr.track.tt.u.ul.var.video.wbr`.split(`.`)),tw=xC(`svg.a.altglyph.altglyphdef.altglyphitem.animatecolor.animatemotion.animatetransform.circle.clippath.defs.desc.ellipse.enterkeyhint.exportparts.filter.font.g.glyph.glyphref.hkern.image.inputmode.line.lineargradient.marker.mask.metadata.mpath.part.path.pattern.polygon.polyline.radialgradient.rect.stop.style.switch.symbol.text.textpath.title.tref.tspan.view.vkern`.split(`.`)),nw=xC([`feBlend`,`feColorMatrix`,`feComponentTransfer`,`feComposite`,`feConvolveMatrix`,`feDiffuseLighting`,`feDisplacementMap`,`feDistantLight`,`feDropShadow`,`feFlood`,`feFuncA`,`feFuncB`,`feFuncG`,`feFuncR`,`feGaussianBlur`,`feImage`,`feMerge`,`feMergeNode`,`feMorphology`,`feOffset`,`fePointLight`,`feSpecularLighting`,`feSpotLight`,`feTile`,`feTurbulence`]),rw=xC([`animate`,`color-profile`,`cursor`,`discard`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`foreignobject`,`hatch`,`hatchpath`,`mesh`,`meshgradient`,`meshpatch`,`meshrow`,`missing-glyph`,`script`,`set`,`solidcolor`,`unknown`,`use`]),iw=xC(`math.menclose.merror.mfenced.mfrac.mglyph.mi.mlabeledtr.mmultiscripts.mn.mo.mover.mpadded.mphantom.mroot.mrow.ms.mspace.msqrt.mstyle.msub.msup.msubsup.mtable.mtd.mtext.mtr.munder.munderover.mprescripts`.split(`.`)),aw=xC([`maction`,`maligngroup`,`malignmark`,`mlongdiv`,`mscarries`,`mscarry`,`msgroup`,`mstack`,`msline`,`msrow`,`semantics`,`annotation`,`annotation-xml`,`mprescripts`,`none`]),ow=xC([`#text`]),sw=xC(`accept.action.align.alt.autocapitalize.autocomplete.autopictureinpicture.autoplay.background.bgcolor.border.capture.cellpadding.cellspacing.checked.cite.class.clear.color.cols.colspan.command.commandfor.controls.controlslist.coords.crossorigin.datetime.decoding.default.dir.disabled.disablepictureinpicture.disableremoteplayback.download.draggable.enctype.enterkeyhint.exportparts.face.for.headers.height.hidden.high.href.hreflang.id.inert.inputmode.integrity.ismap.kind.label.lang.list.loading.loop.low.max.maxlength.media.method.min.minlength.multiple.muted.name.nonce.noshade.novalidate.nowrap.open.optimum.part.pattern.placeholder.playsinline.popover.popovertarget.popovertargetaction.poster.preload.pubdate.radiogroup.readonly.rel.required.rev.reversed.role.rows.rowspan.spellcheck.scope.selected.shape.size.sizes.slot.span.srclang.start.src.srcset.step.style.summary.tabindex.title.translate.type.usemap.valign.value.width.wrap.xmlns`.split(`.`)),cw=xC(`accent-height.accumulate.additive.alignment-baseline.amplitude.ascent.attributename.attributetype.azimuth.basefrequency.baseline-shift.begin.bias.by.class.clip.clippathunits.clip-path.clip-rule.color.color-interpolation.color-interpolation-filters.color-profile.color-rendering.cx.cy.d.dx.dy.diffuseconstant.direction.display.divisor.dur.edgemode.elevation.end.exponent.fill.fill-opacity.fill-rule.filter.filterunits.flood-color.flood-opacity.font-family.font-size.font-size-adjust.font-stretch.font-style.font-variant.font-weight.fx.fy.g1.g2.glyph-name.glyphref.gradientunits.gradienttransform.height.href.id.image-rendering.in.in2.intercept.k.k1.k2.k3.k4.kerning.keypoints.keysplines.keytimes.lang.lengthadjust.letter-spacing.kernelmatrix.kernelunitlength.lighting-color.local.marker-end.marker-mid.marker-start.markerheight.markerunits.markerwidth.maskcontentunits.maskunits.max.mask.mask-type.media.method.mode.min.name.numoctaves.offset.operator.opacity.order.orient.orientation.origin.overflow.paint-order.path.pathlength.patterncontentunits.patterntransform.patternunits.points.preservealpha.preserveaspectratio.primitiveunits.r.rx.ry.radius.refx.refy.repeatcount.repeatdur.restart.result.rotate.scale.seed.shape-rendering.slope.specularconstant.specularexponent.spreadmethod.startoffset.stddeviation.stitchtiles.stop-color.stop-opacity.stroke-dasharray.stroke-dashoffset.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-opacity.stroke.stroke-width.style.surfacescale.systemlanguage.tabindex.tablevalues.targetx.targety.transform.transform-origin.text-anchor.text-decoration.text-rendering.textlength.type.u1.u2.unicode.values.viewbox.visibility.version.vert-adv-y.vert-origin-x.vert-origin-y.width.word-spacing.wrap.writing-mode.xchannelselector.ychannelselector.x.x1.x2.xmlns.y.y1.y2.z.zoomandpan`.split(`.`)),lw=xC(`accent.accentunder.align.bevelled.close.columnalign.columnlines.columnspacing.columnspan.denomalign.depth.dir.display.displaystyle.encoding.fence.frame.height.href.id.largeop.length.linethickness.lquote.lspace.mathbackground.mathcolor.mathsize.mathvariant.maxsize.minsize.movablelimits.notation.numalign.open.rowalign.rowlines.rowspacing.rowspan.rspace.rquote.scriptlevel.scriptminsize.scriptsizemultiplier.selection.separator.separators.stretchy.subscriptshift.supscriptshift.symmetric.voffset.width.xmlns`.split(`.`)),uw=xC([`xlink:href`,`xml:id`,`xlink:title`,`xml:space`,`xmlns:xlink`]),dw=SC(/{{[\w\W]*|^[\w\W]*}}/g),fw=SC(/<%[\w\W]*|^[\w\W]*%>/g),pw=SC(/\${[\w\W]*/g),mw=SC(/^data-[\-\w.\u00B7-\uFFFF]+$/),hw=SC(/^aria-[\-\w]+$/),gw=SC(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),_w=SC(/^(?:\w+script|data):/i),vw=SC(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),yw=SC(/^html$/i),bw=SC(/^[a-z][.\w]*(-[.\w]+)+$/i),xw=SC(/<[/\w!]/g),Sw=SC(/<[/\w]/g),Cw=SC(/<\/no(script|embed|frames)/i),ww=SC(/\/>/i),Tw={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},Ew=function(){return typeof window>`u`?null:window},Dw=function(e,t){if(typeof e!=`object`||typeof e.createPolicy!=`function`)return null;let n=null,r=`data-tt-policy-suffix`;t&&t.hasAttribute(r)&&(n=t.getAttribute(r));let i=`dompurify`+(n?`#`+n:``);try{return e.createPolicy(i,{createHTML(e){return e},createScriptURL(e){return e}})}catch{return console.warn(`TrustedTypes policy `+i+` could not be created.`),null}},Ow=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},kw=function(e,t,n,r){return UC(e,t)&&MC(e[t])?$(r.base?XC(r.base):{},e[t],r.transform):n};function Aw(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Ew(),t=e=>Aw(e);if(t.version=`3.4.11`,t.removed=[],!e||!e.document||e.document.nodeType!==Tw.document||!e.Element)return t.isSupported=!1,t;let n=e.document,r=n,i=r.currentScript;e.DocumentFragment;let a=e.HTMLTemplateElement,o=e.Node,s=e.Element,c=e.NodeFilter;e.NamedNodeMap===void 0&&(e.NamedNodeMap||e.MozNamedAttrMap),e.HTMLFormElement;let l=e.DOMParser,u=e.trustedTypes,d=s.prototype,f=QC(d,`cloneNode`),p=QC(d,`remove`),m=QC(d,`nextSibling`),h=QC(d,`childNodes`),g=QC(d,`parentNode`),_=QC(d,`shadowRoot`),v=QC(d,`attributes`),y=o&&o.prototype?QC(o.prototype,`nodeType`):null,b=o&&o.prototype?QC(o.prototype,`nodeName`):null;if(typeof a==`function`){let e=n.createElement(`template`);e.content&&e.content.ownerDocument&&(n=e.content.ownerDocument)}let x,S=``,C,w=!1,T=0,E=function(){if(T>0)throw KC(`A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.`)},D=function(e){E(),T++;try{return x.createHTML(e)}finally{T--}},O=function(e){E(),T++;try{return x.createScriptURL(e)}finally{T--}},k=function(){return w||=(C=Dw(u,i),!0),C},A=n,j=A.implementation,M=A.createNodeIterator,N=A.createDocumentFragment,P=A.getElementsByTagName,F=r.importNode,I=Ow();t.isSupported=typeof gC==`function`&&typeof g==`function`&&j&&j.createHTMLDocument!==void 0;let L=dw,ee=fw,te=pw,ne=mw,re=hw,ie=_w,R=vw,ae=bw,oe=gw,z=null,se=$({},[...ew,...tw,...nw,...iw,...ow]),ce=null,le=$({},[...sw,...cw,...lw,...uw]),ue=Object.seal(CC(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),de=null,fe=null,pe=Object.seal(CC(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),me=!0,he=!0,ge=!1,_e=!0,ve=!1,ye=!0,be=!1,xe=!1,Se=null,Ce=null,we=!1,Te=!1,Ee=!1,De=!1,Oe=!0,ke=!1,Ae=`user-content-`,je=!0,Me=!1,Ne={},Pe=null,Fe=$({},`annotation-xml.audio.colgroup.desc.foreignobject.head.iframe.math.mi.mn.mo.ms.mtext.noembed.noframes.noscript.plaintext.script.selectedcontent.style.svg.template.thead.title.video.xmp`.split(`.`)),Ie=null,Le=$({},[`audio`,`video`,`img`,`source`,`image`,`track`]),Re=null,ze=$({},[`alt`,`class`,`for`,`id`,`label`,`name`,`pattern`,`placeholder`,`role`,`summary`,`title`,`value`,`style`,`xmlns`]),Be=`http://www.w3.org/1998/Math/MathML`,Ve=`http://www.w3.org/2000/svg`,He=`http://www.w3.org/1999/xhtml`,Ue=He,We=!1,Ge=null,Ke=$({},[Be,Ve,He],PC),qe=xC([`mi`,`mo`,`mn`,`ms`,`mtext`]),Je=$({},qe),Ye=xC([`annotation-xml`]),Xe=$({},Ye),Ze=$({},[`title`,`style`,`font`,`a`,`script`]),Qe=null,$e=[`application/xhtml+xml`,`text/html`],et=null,tt=null,nt=n.createElement(`form`),rt=function(e){return e instanceof RegExp||e instanceof Function},it=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(tt&&tt===e)return;(!e||typeof e!=`object`)&&(e={}),e=XC(e),Qe=$e.indexOf(e.PARSER_MEDIA_TYPE)===-1?`text/html`:e.PARSER_MEDIA_TYPE,et=Qe===`application/xhtml+xml`?PC:NC,z=kw(e,`ALLOWED_TAGS`,se,{transform:et}),ce=kw(e,`ALLOWED_ATTR`,le,{transform:et}),Ge=kw(e,`ALLOWED_NAMESPACES`,Ke,{transform:PC}),Re=kw(e,`ADD_URI_SAFE_ATTR`,ze,{transform:et,base:ze}),Ie=kw(e,`ADD_DATA_URI_TAGS`,Le,{transform:et,base:Le}),Pe=kw(e,`FORBID_CONTENTS`,Fe,{transform:et}),de=kw(e,`FORBID_TAGS`,XC({}),{transform:et}),fe=kw(e,`FORBID_ATTR`,XC({}),{transform:et}),Ne=UC(e,`USE_PROFILES`)?e.USE_PROFILES&&typeof e.USE_PROFILES==`object`?XC(e.USE_PROFILES):e.USE_PROFILES:!1,me=e.ALLOW_ARIA_ATTR!==!1,he=e.ALLOW_DATA_ATTR!==!1,ge=e.ALLOW_UNKNOWN_PROTOCOLS||!1,_e=e.ALLOW_SELF_CLOSE_IN_ATTR!==!1,ve=e.SAFE_FOR_TEMPLATES||!1,ye=e.SAFE_FOR_XML!==!1,be=e.WHOLE_DOCUMENT||!1,Te=e.RETURN_DOM||!1,Ee=e.RETURN_DOM_FRAGMENT||!1,De=e.RETURN_TRUSTED_TYPE||!1,we=e.FORCE_BODY||!1,Oe=e.SANITIZE_DOM!==!1,ke=e.SANITIZE_NAMED_PROPS||!1,je=e.KEEP_CONTENT!==!1,Me=e.IN_PLACE||!1,oe=$C(e.ALLOWED_URI_REGEXP)?e.ALLOWED_URI_REGEXP:gw,Ue=typeof e.NAMESPACE==`string`?e.NAMESPACE:He,Je=UC(e,`MATHML_TEXT_INTEGRATION_POINTS`)&&e.MATHML_TEXT_INTEGRATION_POINTS&&typeof e.MATHML_TEXT_INTEGRATION_POINTS==`object`?XC(e.MATHML_TEXT_INTEGRATION_POINTS):$({},qe),Xe=UC(e,`HTML_INTEGRATION_POINTS`)&&e.HTML_INTEGRATION_POINTS&&typeof e.HTML_INTEGRATION_POINTS==`object`?XC(e.HTML_INTEGRATION_POINTS):$({},Ye);let t=UC(e,`CUSTOM_ELEMENT_HANDLING`)&&e.CUSTOM_ELEMENT_HANDLING&&typeof e.CUSTOM_ELEMENT_HANDLING==`object`?XC(e.CUSTOM_ELEMENT_HANDLING):CC(null);if(ue=CC(null),UC(t,`tagNameCheck`)&&rt(t.tagNameCheck)&&(ue.tagNameCheck=t.tagNameCheck),UC(t,`attributeNameCheck`)&&rt(t.attributeNameCheck)&&(ue.attributeNameCheck=t.attributeNameCheck),UC(t,`allowCustomizedBuiltInElements`)&&typeof t.allowCustomizedBuiltInElements==`boolean`&&(ue.allowCustomizedBuiltInElements=t.allowCustomizedBuiltInElements),SC(ue),ve&&(he=!1),Ee&&(Te=!0),Ne&&(z=$({},ow),ce=CC(null),Ne.html===!0&&($(z,ew),$(ce,sw)),Ne.svg===!0&&($(z,tw),$(ce,cw),$(ce,uw)),Ne.svgFilters===!0&&($(z,nw),$(ce,cw),$(ce,uw)),Ne.mathMl===!0&&($(z,iw),$(ce,lw),$(ce,uw))),pe.tagCheck=null,pe.attributeCheck=null,UC(e,`ADD_TAGS`)&&(typeof e.ADD_TAGS==`function`?pe.tagCheck=e.ADD_TAGS:MC(e.ADD_TAGS)&&(z===se&&(z=XC(z)),$(z,e.ADD_TAGS,et))),UC(e,`ADD_ATTR`)&&(typeof e.ADD_ATTR==`function`?pe.attributeCheck=e.ADD_ATTR:MC(e.ADD_ATTR)&&(ce===le&&(ce=XC(ce)),$(ce,e.ADD_ATTR,et))),UC(e,`ADD_URI_SAFE_ATTR`)&&MC(e.ADD_URI_SAFE_ATTR)&&$(Re,e.ADD_URI_SAFE_ATTR,et),UC(e,`FORBID_CONTENTS`)&&MC(e.FORBID_CONTENTS)&&(Pe===Fe&&(Pe=XC(Pe)),$(Pe,e.FORBID_CONTENTS,et)),UC(e,`ADD_FORBID_CONTENTS`)&&MC(e.ADD_FORBID_CONTENTS)&&(Pe===Fe&&(Pe=XC(Pe)),$(Pe,e.ADD_FORBID_CONTENTS,et)),je&&(z[`#text`]=!0),be&&$(z,[`html`,`head`,`body`]),z.table&&($(z,[`tbody`]),delete de.tbody),e.TRUSTED_TYPES_POLICY){if(typeof e.TRUSTED_TYPES_POLICY.createHTML!=`function`)throw KC(`TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.`);if(typeof e.TRUSTED_TYPES_POLICY.createScriptURL!=`function`)throw KC(`TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.`);let t=x;x=e.TRUSTED_TYPES_POLICY;try{S=D(``)}catch(e){throw x=t,e}}else e.TRUSTED_TYPES_POLICY===null?(x=void 0,S=``):(x===void 0&&(x=k()),x&&typeof S==`string`&&(S=D(``)));xC&&xC(e),tt=e},at=$({},[...tw,...nw,...rw]),ot=$({},[...iw,...aw]),st=function(e,t,n){return t.namespaceURI===He?e===`svg`:t.namespaceURI===Be?e===`svg`&&(n===`annotation-xml`||Je[n]):!!at[e]},ct=function(e,t,n){return t.namespaceURI===He?e===`math`:t.namespaceURI===Ve?e===`math`&&Xe[n]:!!ot[e]},lt=function(e,t,n){return t.namespaceURI===Ve&&!Xe[n]||t.namespaceURI===Be&&!Je[n]?!1:!ot[e]&&(Ze[e]||!at[e])},ut=function(e){let t=g(e);(!t||!t.tagName)&&(t={namespaceURI:Ue,tagName:`template`});let n=NC(e.tagName),r=NC(t.tagName);return Ge[e.namespaceURI]?e.namespaceURI===Ve?st(n,t,r):e.namespaceURI===Be?ct(n,t,r):e.namespaceURI===He?lt(n,t,r):!!(Qe===`application/xhtml+xml`&&Ge[e.namespaceURI]):!1},dt=function(e){AC(t.removed,{element:e});try{g(e).removeChild(e)}catch{if(p(e),!g(e))throw KC(`a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place`)}},ft=function(e){let t=h(e);if(t){let e=[];DC(t,t=>{AC(e,t)}),DC(e,e=>{try{p(e)}catch{}})}let n=v(e);if(n)for(let t=n.length-1;t>=0;--t){let r=n[t],i=r&&r.name;if(typeof i==`string`)try{e.removeAttribute(i)}catch{}}},pt=function(e,n){try{AC(t.removed,{attribute:n.getAttributeNode(e),from:n})}catch{AC(t.removed,{attribute:null,from:n})}if(n.removeAttribute(e),e===`is`)if(Te||Ee)try{dt(n)}catch{}else try{n.setAttribute(e,``)}catch{}},mt=function(e){let t=v(e);if(t)for(let n=t.length-1;n>=0;--n){let r=t[n],i=r&&r.name;if(!(typeof i!=`string`||ce[et(i)]))try{e.removeAttribute(i)}catch{}}},ht=function(e){let t=[e];for(;t.length>0;){let e=t.pop();(y?y(e):e.nodeType)===Tw.element&&mt(e);let n=h(e);if(n)for(let e=n.length-1;e>=0;--e)t.push(n[e])}},gt=function(e){let t=null,r=null;if(we)e=`<remove></remove>`+e;else{let t=FC(e,/^[\r\n\t ]+/);r=t&&t[0]}Qe===`application/xhtml+xml`&&Ue===He&&(e=`<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>`+e+`</body></html>`);let i=x?D(e):e;if(Ue===He)try{t=new l().parseFromString(i,Qe)}catch{}if(!t||!t.documentElement){t=j.createDocument(Ue,`template`,null);try{t.documentElement.innerHTML=We?S:i}catch{}}let a=t.body||t.documentElement;return e&&r&&a.insertBefore(n.createTextNode(r),a.childNodes[0]||null),Ue===He?P.call(t,be?`html`:`body`)[0]:be?t.documentElement:a},_t=function(e){return M.call(e.ownerDocument||e,e,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},vt=function(e){return e=IC(e,L,` `),e=IC(e,ee,` `),e=IC(e,te,` `),e},yt=function(e){e.normalize();let t=M.call(e.ownerDocument||e,e,c.SHOW_TEXT|c.SHOW_COMMENT|c.SHOW_CDATA_SECTION|c.SHOW_PROCESSING_INSTRUCTION,null),n=t.nextNode();for(;n;)n.data=vt(n.data),n=t.nextNode();let r=e.querySelectorAll?.call(e,`template`);r&&DC(r,e=>{xt(e.content)&&yt(e.content)})},bt=function(e){let t=b?b(e):null;return typeof t!=`string`||et(t)!==`form`?!1:typeof e.nodeName!=`string`||typeof e.textContent!=`string`||typeof e.removeChild!=`function`||e.attributes!==v(e)||typeof e.removeAttribute!=`function`||typeof e.setAttribute!=`function`||typeof e.namespaceURI!=`string`||typeof e.insertBefore!=`function`||typeof e.hasChildNodes!=`function`||e.nodeType!==y(e)||e.childNodes!==h(e)},xt=function(e){if(!y||typeof e!=`object`||!e)return!1;try{return y(e)===Tw.documentFragment}catch{return!1}},St=function(e){if(!y||typeof e!=`object`||!e)return!1;try{return typeof y(e)==`number`}catch{return!1}};function Ct(e,n,r){e.length!==0&&DC(e,e=>{e.call(t,n,r,tt)})}let wt=function(e,t){return!!(ye&&e.hasChildNodes()&&!St(e.firstElementChild)&&GC(xw,e.textContent)&&GC(xw,e.innerHTML)||ye&&e.namespaceURI===He&&t===`style`&&St(e.firstElementChild)||e.nodeType===Tw.processingInstruction||ye&&e.nodeType===Tw.comment&&GC(Sw,e.data))},Tt=function(e,t){if(!de[t]&&kt(t)&&(ue.tagNameCheck instanceof RegExp&&GC(ue.tagNameCheck,t)||ue.tagNameCheck instanceof Function&&ue.tagNameCheck(t)))return!1;if(je&&!Pe[t]){let t=g(e),n=h(e);if(n&&t){let r=n.length;for(let i=r-1;i>=0;--i){let r=Me?n[i]:f(n[i],!0);t.insertBefore(r,m(e))}}}return dt(e),!0},Et=function(e){if(Ct(I.beforeSanitizeElements,e,null),bt(e))return dt(e),!0;let n=et(b?b(e):e.nodeName);if(Ct(I.uponSanitizeElement,e,{tagName:n,allowedTags:z}),wt(e,n))return dt(e),!0;if(de[n]||!(pe.tagCheck instanceof Function&&pe.tagCheck(n))&&!z[n])return Tt(e,n);if((y?y(e):e.nodeType)===Tw.element&&!ut(e)||(n===`noscript`||n===`noembed`||n===`noframes`)&&GC(Cw,e.innerHTML))return dt(e),!0;if(ve&&e.nodeType===Tw.text){let n=vt(e.textContent);e.textContent!==n&&(AC(t.removed,{element:e.cloneNode()}),e.textContent=n)}return Ct(I.afterSanitizeElements,e,null),!1},Dt=function(e,t,r){if(fe[t]||Oe&&(t===`id`||t===`name`)&&(r in n||r in nt))return!1;let i=ce[t]||pe.attributeCheck instanceof Function&&pe.attributeCheck(t,e);if(!(he&&GC(ne,t))&&!(me&&GC(re,t))){if(!i){if(!(kt(e)&&(ue.tagNameCheck instanceof RegExp&&GC(ue.tagNameCheck,e)||ue.tagNameCheck instanceof Function&&ue.tagNameCheck(e))&&(ue.attributeNameCheck instanceof RegExp&&GC(ue.attributeNameCheck,t)||ue.attributeNameCheck instanceof Function&&ue.attributeNameCheck(t,e))||t===`is`&&ue.allowCustomizedBuiltInElements&&(ue.tagNameCheck instanceof RegExp&&GC(ue.tagNameCheck,r)||ue.tagNameCheck instanceof Function&&ue.tagNameCheck(r))))return!1}else if(!Re[t]&&!GC(oe,IC(r,R,``))&&!((t===`src`||t===`xlink:href`||t===`href`)&&e!==`script`&&LC(r,`data:`)===0&&Ie[e])&&!(ge&&!GC(ie,IC(r,R,``)))&&r)return!1}return!0},Ot=$({},[`annotation-xml`,`color-profile`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`missing-glyph`]),kt=function(e){return!Ot[NC(e)]&&GC(ae,e)},At=function(e,t,n,r){if(x&&typeof u==`object`&&typeof u.getAttributeType==`function`&&!n)switch(u.getAttributeType(e,t)){case`TrustedHTML`:return D(r);case`TrustedScriptURL`:return O(r)}return r},jt=function(e,n,r,i){try{r?e.setAttributeNS(r,n,i):e.setAttribute(n,i),bt(e)?dt(e):kC(t.removed)}catch{pt(n,e)}},Mt=function(e){Ct(I.beforeSanitizeAttributes,e,null);let t=e.attributes;if(!t||bt(e))return;let n={attrName:``,attrValue:``,keepAttr:!0,allowedAttributes:ce,forceKeepAttr:void 0},r=t.length,i=et(e.nodeName);for(;r--;){let a=t[r],o=a.name,s=a.namespaceURI,c=a.value,l=et(o),u=c,d=o===`value`?u:RC(u);if(n.attrName=l,n.attrValue=d,n.keepAttr=!0,n.forceKeepAttr=void 0,Ct(I.uponSanitizeAttribute,e,n),d=n.attrValue,ke&&(l===`id`||l===`name`)&&LC(d,Ae)!==0&&(pt(o,e),d=Ae+d),ye&&GC(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,d)){pt(o,e);continue}if(l===`attributename`&&FC(d,`href`)){pt(o,e);continue}if(!n.forceKeepAttr){if(!n.keepAttr){pt(o,e);continue}if(!_e&&GC(ww,d)){pt(o,e);continue}if(ve&&(d=vt(d)),!Dt(i,l,d)){pt(o,e);continue}d=At(i,l,s,d),d!==u&&jt(e,o,s,d)}}Ct(I.afterSanitizeAttributes,e,null)},Nt=function(e){let t=null,n=_t(e);for(Ct(I.beforeSanitizeShadowDOM,e,null);t=n.nextNode();)if(Ct(I.uponSanitizeShadowNode,t,null),Et(t),Mt(t),xt(t.content)&&Nt(t.content),(y?y(t):t.nodeType)===Tw.element){let e=_(t);xt(e)&&(Pt(e),Nt(e))}Ct(I.afterSanitizeShadowDOM,e,null)},Pt=function(e){let t=[{node:e,shadow:null}];for(;t.length>0;){let e=t.pop();if(e.shadow){Nt(e.shadow);continue}let n=e.node,r=(y?y(n):n.nodeType)===Tw.element,i=h(n);if(i)for(let e=i.length-1;e>=0;--e)t.push({node:i[e],shadow:null});if(r){let e=b?b(n):null;if(typeof e==`string`&&et(e)===`template`){let e=n.content;xt(e)&&t.push({node:e,shadow:null})}}if(r){let e=_(n);xt(e)&&t.push({node:null,shadow:e},{node:e,shadow:null})}}};return t.sanitize=function(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=null,a=null,o=null,s=null;if(We=!e,We&&(e=`<!-->`),typeof e!=`string`&&!St(e)&&(e=ZC(e),typeof e!=`string`))throw KC(`dirty is not a string, aborting`);if(!t.isSupported)return e;xe?(z=Se,ce=Ce):it(n),(I.uponSanitizeElement.length>0||I.uponSanitizeAttribute.length>0)&&(z=XC(z)),I.uponSanitizeAttribute.length>0&&(ce=XC(ce)),t.removed=[];let c=Me&&typeof e!=`string`&&St(e);if(c){let t=b?b(e):e.nodeName;if(typeof t==`string`){let e=et(t);if(!z[e]||de[e])throw KC(`root node is forbidden and cannot be sanitized in-place`)}if(bt(e))throw KC(`root node is clobbered and cannot be sanitized in-place`);try{Pt(e)}catch(t){throw ft(e),t}}else if(St(e))i=gt(`<!---->`),a=i.ownerDocument.importNode(e,!0),a.nodeType===Tw.element&&a.nodeName===`BODY`||a.nodeName===`HTML`?i=a:i.appendChild(a),Pt(a);else{if(!Te&&!ve&&!be&&e.indexOf(`<`)===-1)return x&&De?D(e):e;if(i=gt(e),!i)return Te?null:De?S:``}i&&we&&dt(i.firstChild);let l=_t(c?e:i);try{for(;o=l.nextNode();)Et(o),Mt(o),xt(o.content)&&Nt(o.content)}catch(t){throw c&&ft(e),t}if(c)return DC(t.removed,e=>{e.element&&ht(e.element)}),ve&&yt(e),e;if(Te){if(ve&&yt(i),Ee)for(s=N.call(i.ownerDocument);i.firstChild;)s.appendChild(i.firstChild);else s=i;return(ce.shadowroot||ce.shadowrootmode)&&(s=F.call(r,s,!0)),s}let u=be?i.outerHTML:i.innerHTML;return be&&z[`!doctype`]&&i.ownerDocument&&i.ownerDocument.doctype&&i.ownerDocument.doctype.name&&GC(yw,i.ownerDocument.doctype.name)&&(u=`<!DOCTYPE `+i.ownerDocument.doctype.name+`>
|
|
69
|
+
`+u),ve&&(u=vt(u)),x&&De?D(u):u},t.setConfig=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};it(e),xe=!0,Se=z,Ce=ce},t.clearConfig=function(){tt=null,xe=!1,Se=null,Ce=null,x=C,S=``},t.isValidAttribute=function(e,t,n){tt||it({});let r=et(e),i=et(t);return Dt(r,i,n)},t.addHook=function(e,t){typeof t==`function`&&UC(I,e)&&AC(I[e],t)},t.removeHook=function(e,t){if(UC(I,e)){if(t!==void 0){let n=OC(I[e],t);return n===-1?void 0:jC(I[e],n,1)[0]}return kC(I[e])}},t.removeHooks=function(e){UC(I,e)&&(I[e]=[])},t.removeAllHooks=function(){I=Ow()},t}var jw=Aw(),Mw=null;function Nw(){return Mw||(Mw=jw(globalThis.window??globalThis),Mw.addHook(`afterSanitizeAttributes`,e=>{let t=e;t.tagName===`A`&&t.getAttribute?.(`target`)&&t.setAttribute(`rel`,`noopener noreferrer`)}),Mw)}function Pw(e){return Nw().sanitize(e,{FORBID_TAGS:[`style`,`form`,`input`,`button`,`textarea`,`object`,`embed`],FORBID_ATTR:[`style`],ALLOW_DATA_ATTR:!1,USE_PROFILES:{html:!0},ADD_DATA_URI_TAGS:[`img`]})}function Fw(e){return e.replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`).replace(/"/g,`"`).replace(/'/g,`'`)}var Iw=!1;function Lw(){Iw||(Iw=!0,ES.registerLanguage(`typescript`,IS),ES.registerLanguage(`javascript`,GS),ES.registerLanguage(`json`,KS),ES.registerLanguage(`bash`,qS),ES.registerLanguage(`shell`,JS),ES.registerLanguage(`python`,YS),ES.registerLanguage(`diff`,XS),ES.registerLanguage(`xml`,ZS),ES.registerLanguage(`css`,oC),ES.registerLanguage(`markdown`,sC),ES.registerLanguage(`yaml`,cC),ES.registerLanguage(`plaintext`,lC),ES.registerAliases([`ts`,`tsx`],{languageName:`typescript`}),ES.registerAliases([`js`,`jsx`,`mjs`,`cjs`],{languageName:`javascript`}),ES.registerAliases([`sh`,`zsh`,`console`],{languageName:`bash`}),ES.registerAliases([`py`],{languageName:`python`}),ES.registerAliases([`html`,`xhtml`,`svg`],{languageName:`xml`}),ES.registerAliases([`yml`],{languageName:`yaml`}),ES.registerAliases([`md`],{languageName:`markdown`}),ES.registerAliases([`text`,`txt`],{languageName:`plaintext`}))}function Rw(e,t){if(Lw(),t&&ES.getLanguage(t))try{return ES.highlight(e,{language:t,ignoreIllegals:!0}).value}catch{}return zw.utils.escapeHtml(e)}var zw=new TS({html:!1,linkify:!0,breaks:!1,highlight(e,t){let n=Rw(e,(t||``).toLowerCase()),r=t?`language-${t} hljs`:`hljs`;return`<pre class="hljs"><code class="${zw.utils.escapeHtml(r)}">${n}</code></pre>`}});function Bw(e){return Lw(),Pw(zw.render(e??``))}function Vw(e,t){Lw();let n=Rw(e??``,(t||``).toLowerCase()),r=t?`language-${t} hljs`:`hljs`;return Pw(`<pre class="hljs"><code class="${zw.utils.escapeHtml(r)}">${n}</code></pre>`)}var Hw=`crtr:transcript-detail`,Uw=[`focused`,`standard`,`verbose`];function Ww(){try{let e=localStorage.getItem(Hw);if(e===`focused`||e===`standard`||e===`verbose`)return e}catch{}return`standard`}var Gw=Ww(),Kw=new Set;function qw(){for(let e of Kw)e()}function Jw(e){if(e!==Gw){Gw=e;try{localStorage.setItem(Hw,e)}catch{}qw()}}function Yw(){Jw(Uw[(Uw.indexOf(Gw)+1)%Uw.length])}function Xw(e){return Kw.add(e),()=>{Kw.delete(e)}}typeof window<`u`&&window.addEventListener(`storage`,e=>{if(e.key!==Hw)return;let t=Ww();t!==Gw&&(Gw=t,qw())});function Zw(){return(0,v.useSyncExternalStore)(Xw,()=>Gw,()=>Gw)}var Qw=[`[&_pre]:overflow-auto [&_pre]:p-[12px_14px] [&_pre]:rounded-none [&_pre]:border [&_pre]:border-[var(--line)] [&_pre]:bg-[var(--panel2)]`,`[&_pre_code]:text-[var(--ink2)]`,`[&_code]:font-mono [&_code]:text-xs`,`[&_:not(pre)>code]:bg-[var(--panel2)] [&_:not(pre)>code]:text-[var(--ink2)] [&_:not(pre)>code]:px-1.5 [&_:not(pre)>code]:py-0.5 [&_:not(pre)>code]:rounded-none`,`[&_a]:text-[var(--bone)] [&_a]:underline [&_a]:decoration-dotted`].join(` `),$w={focused:`leading-relaxed`,standard:`leading-relaxed`,verbose:`leading-relaxed`};function eT({text:e,inProgress:t}){let n=(0,v.useMemo)(()=>t?``:Bw(e??``),[t,e]),r=$w[Zw()];return(0,B.jsx)(`div`,{className:Y(`prose`,r),children:t?(0,B.jsx)(`div`,{className:`whitespace-pre-wrap`,dangerouslySetInnerHTML:{__html:Fw(e??``)}}):(0,B.jsx)(`div`,{className:Y(Qw,r),dangerouslySetInnerHTML:{__html:n}})})}function tT({thinking:e,inProgress:t}){let n=Zw(),[r,i]=(0,v.useState)(!1),a=t||r||n===`verbose`,o=n===`focused`?`Thought`:`Thinking`;return(0,B.jsxs)(`div`,{className:Y(`thinking`,a&&`open`),children:[(0,B.jsxs)(`div`,{className:`think-toggle`,onClick:()=>i(e=>!e),children:[o,t?`…`:``]}),(0,B.jsx)(`div`,{className:`think-body whitespace-pre-wrap`,dangerouslySetInnerHTML:{__html:Fw(e)}})]})}var nT=new Set([`image/png`,`image/jpeg`,`image/jpg`,`image/gif`,`image/webp`,`image/svg+xml`,`image/avif`,`image/bmp`]);function rT({image:e}){let t=(e.mimeType||``).toLowerCase();return(0,B.jsx)(`img`,{className:`block max-w-[min(100%,520px)] max-h-[26rem] rounded-md my-1.5 object-contain`,src:`data:${nT.has(t)?t:`image/png`};base64,${e.data??``}`,alt:`image content`,loading:`lazy`,decoding:`async`})}var iT=new Set(`.md,.txt,.json,.ts,.tsx,.js,.mjs,.cjs,.css,.html,.htm,.yaml,.yml,.toml,.log,.sh,.py,.rb,.go,.rs,.java,.c,.cpp,.h,.env,.gitignore`.split(`,`));function aT(e){if(!e.startsWith(`/`))return!1;let t=e.split(`/`).filter(Boolean);if(t.length<2)return!1;let n=t[t.length-1],r=n.lastIndexOf(`.`);if(r<1)return!1;let i=n.slice(r).toLowerCase();return iT.has(i)}function oT(e){let t=/\/[a-zA-Z0-9_.\-/]+\.[a-zA-Z0-9]+/g,n=[],r;for(;(r=t.exec(e))!==null;)aT(r[0])&&n.push(r[0]);return[...new Set(n)]}var sT=(0,v.createContext)({peekedPath:null,onPeek:()=>{}});function cT(){return(0,v.useContext)(sT)}var lT=`[&_pre]:overflow-auto [&_pre]:p-[10px_12px] [&_pre]:rounded-md [&_pre]:bg-muted [&_code]:font-mono [&_code]:text-xs [&_:not(pre)>code]:bg-muted [&_:not(pre)>code]:px-1.5 [&_:not(pre)>code]:py-0.5 [&_:not(pre)>code]:rounded [&_p]:my-[0.4em] [&_a]:text-primary`,uT=`m-0 px-3 py-2 bg-[#0c0f13] text-[#d6dde6] font-mono text-xs whitespace-pre-wrap overflow-auto max-h-[26rem]`,dT=`px-3 py-2 opacity-50 text-xs italic`,fT={bash:`❯`,shell:`❯`,sh:`❯`,run:`❯`,terminal:`❯`,read:`≣`,read_file:`≣`,cat:`≣`,view:`≣`,edit:`✎`,str_replace:`✎`,apply_patch:`✎`,write:`✚`,write_file:`✚`,create:`✚`,grep:`⌕`,search:`⌕`,rg:`⌕`,web_search:`◎`,websearch:`◎`,web:`◎`,fetch:`⤓`,curl:`⤓`,http:`⤓`};function pT(e){return fT[(e||``).toLowerCase()]??`◆`}var mT={bash:`bash`,shell:`bash`,sh:`bash`,run:`bash`,terminal:`bash`,read:`read`,read_file:`read`,cat:`read`,view:`read`,grep:`read`,search:`read`,rg:`read`,edit:`write`,str_replace:`write`,apply_patch:`write`,write:`write`,write_file:`write`,create:`write`,web_search:`web`,websearch:`web`,web:`web`,fetch:`web`,curl:`web`,http:`web`};function hT(e){return mT[(e||``).toLowerCase()]??`other`}function gT(e){return e?e.content.filter(e=>e.type===`text`).map(e=>e.text).join(``):``}function _T(e){return e?e.content.filter(e=>e.type===`image`):[]}function vT(e){if(!e||Object.keys(e).length===0)return``;try{return JSON.stringify(e,null,2)}catch{return String(e)}}function yT(e){let t=e.arguments??{},n=e=>typeof t[e]==`string`?t[e]:void 0;return n(`command`)??n(`cmd`)??n(`path`)??n(`file_path`)??n(`filename`)??n(`pattern`)??n(`query`)??``}function bT({call:e,subtitle:t,inProgress:n,isError:r,children:i}){let a=t??yT(e),o=e.name,s=Zw(),{peekedPath:c,onPeek:l}=cT(),u=s===`verbose`||s===`standard`&&n,[d,f]=(0,v.useState)(null),p=d??u;return(0,B.jsxs)(`div`,{className:Y(`tool`,p&&`open`,r&&`tool-error`),"data-fam":hT(e.name),children:[(0,B.jsxs)(`div`,{className:`tool-head`,onClick:()=>f(!p),children:[(0,B.jsx)(`span`,{className:`tool-glyph`,children:pT(e.name)}),(0,B.jsx)(`span`,{className:`tool-name`,children:o}),a&&(0,B.jsx)(`span`,{className:`tool-arg`,children:aT(a)?(0,B.jsx)(`span`,{className:Y(`filelink`,c===a&&`peeked`),onClick:e=>{e.stopPropagation(),l(a)},children:a}):a}),(0,B.jsx)(`span`,{className:`ml-auto shrink-0 flex items-center`,children:(0,B.jsx)(`span`,{className:Y(`dot`,n?`active`:r?`error`:`done`),title:n?`running`:r?`error`:`done`,"aria-label":n?`running`:r?`error`:`done`})}),(0,B.jsx)(of,{className:Y(`size-3.5 text-[var(--dim)] transition-transform`,!p&&`-rotate-90`)})]}),(0,B.jsx)(`div`,{className:`tool-body`,children:i})]})}function xT({result:e}){let t=_T(e);return t.length===0?null:(0,B.jsx)(B.Fragment,{children:t.map((e,t)=>(0,B.jsx)(`div`,{className:`px-3 py-1`,children:(0,B.jsx)(rT,{image:e})},t))})}function ST(e){let t=e.command??e.cmd??e.script;return typeof t==`string`?t:``}function CT(e){let t=ST(e.call.arguments??{}),n=gT(e.result),r=e.inProgress,i=e.isError;return(0,B.jsxs)(bT,{call:e.call,subtitle:``,inProgress:r,isError:i,children:[(0,B.jsxs)(`pre`,{className:Y(uT,i&&`text-[#ff9b8a]`),children:[t&&(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`span`,{style:{opacity:.6},children:`$ `}),(0,B.jsx)(`span`,{dangerouslySetInnerHTML:{__html:Fw(t)}}),`
|
|
70
|
+
`]}),(0,B.jsx)(`span`,{dangerouslySetInnerHTML:{__html:Fw(n)}}),r&&(0,B.jsx)(`span`,{className:`inline-block size-2 rounded-full bg-[#7fb3ff] ml-1.5 animate-pulse`})]}),(0,B.jsx)(xT,{result:e.result})]})}var wT={ts:`ts`,tsx:`tsx`,js:`js`,jsx:`jsx`,mjs:`js`,cjs:`js`,json:`json`,sh:`bash`,bash:`bash`,zsh:`bash`,py:`python`,diff:`diff`,patch:`diff`,html:`html`,htm:`html`,xml:`xml`,svg:`xml`,css:`css`,scss:`css`,md:`markdown`,markdown:`markdown`,yml:`yaml`,yaml:`yaml`};function TT(e){let t=/\.([a-z0-9]+)$/i.exec(e||``);return t&&wT[t[1].toLowerCase()]||``}function ET(e){let t=yT(e.call),n=gT(e.result),r=n?Vw(n,TT(t)):``,i=e.inProgress;return(0,B.jsxs)(bT,{call:e.call,inProgress:i,isError:e.isError,children:[n?(0,B.jsx)(`div`,{className:lT,style:{padding:`4px 8px`},dangerouslySetInnerHTML:{__html:r}}):!i&&(0,B.jsx)(`div`,{className:`px-3 py-2 opacity-50 text-xs italic`,children:`no content`}),(0,B.jsx)(xT,{result:e.result})]})}var DT=1e6;function OT(e,t){let n=(e??``).split(`
|
|
70
71
|
`),r=(t??``).split(`
|
|
71
|
-
`),i=n.length,a=r.length;if((i+1)*(a+1)>
|
|
72
|
-
`).filter(e=>e.length>0):[],i=e.inProgress;return(0,B.jsxs)(yT,{call:e.call,subtitle:t,inProgress:i,isError:e.isError,children:[r.length>0?(0,B.jsx)(`div`,{className:`m-0 font-mono text-xs overflow-auto max-h-[28rem]`,children:r.map((e,t)=>(0,B.jsx)(`div`,{className:`px-3 py-1 font-mono text-xs opacity-85`,dangerouslySetInnerHTML:{__html:Pw(e)}},t))}):!i&&(0,B.jsx)(`div`,{className:`px-3 py-2 opacity-50 text-xs italic`,children:`no matches`}),(0,B.jsx)(bT,{result:e.result})]})}function FT(e){let t=_T(e.call.arguments),n=hT(e.result),r=e.isError,i=e.inProgress;return(0,B.jsxs)(yT,{call:e.call,inProgress:i,isError:r,children:[t&&(0,B.jsx)(`pre`,{className:`m-0 px-3 py-2 bg-[#11161c] font-mono text-xs whitespace-pre-wrap overflow-auto max-h-60 border-b border-[#222b35]`,children:t}),n&&(0,B.jsx)(`div`,{className:Y(`[&_pre]:overflow-auto [&_pre]:p-[10px_12px] [&_pre]:rounded-md [&_pre]:bg-muted [&_code]:font-mono [&_code]:text-xs [&_:not(pre)>code]:bg-muted [&_:not(pre)>code]:px-1.5 [&_:not(pre)>code]:py-0.5 [&_:not(pre)>code]:rounded [&_p]:my-[0.4em] [&_a]:text-primary`,r&&`text-[#ff9b8a]`),style:{padding:`8px 11px`},dangerouslySetInnerHTML:{__html:zw(n)}}),(0,B.jsx)(bT,{result:e.result}),!t&&!n&&!i&&(0,B.jsx)(`div`,{className:`px-3 py-2 opacity-50 text-xs italic`,children:`no output`})]})}var IT={bash:ST,shell:ST,sh:ST,run:ST,terminal:ST,read:TT,read_file:TT,cat:TT,view:TT,edit:kT,str_replace:kT,apply_patch:kT,write:MT,write_file:MT,create:MT,grep:PT,search:PT,rg:PT};function LT(e){return IT[(e||``).toLowerCase()]??FT}Object.keys(IT);function RT({message:e,isLastAssistant:t,streaming:n,resultFor:r,executingToolIds:i}){let a=e.role;return a===`user`?e.origin===`inbox`?(0,B.jsx)(JT,{message:e}):(0,B.jsx)(`div`,{className:`text-sm leading-[1.55] break-words`,children:(0,B.jsx)(UT,{message:e})}):a===`assistant`?(0,B.jsx)(`div`,{className:`text-sm leading-[1.55] break-words`,children:(0,B.jsx)(WT,{message:e,isLastAssistant:t,streaming:n,resultFor:r,executingToolIds:i})}):a===`toolResult`?(0,B.jsx)(`div`,{className:`text-sm leading-[1.55] break-words`,children:(0,B.jsx)(qT,{message:e})}):a===`bashExecution`?(0,B.jsx)(`div`,{className:`text-sm leading-[1.55] break-words`,children:(0,B.jsx)(VT,{message:e})}):a===`custom`&&e.customType===zT?(0,B.jsx)(BT,{message:e}):null}var zT=`crtr-cycle-divider`;function BT({message:e}){let t=typeof e.content==`string`?e.content:`yielded — new cycle begins`;return(0,B.jsxs)(`div`,{className:`flex items-center gap-3 my-1`,style:{opacity:.55},children:[(0,B.jsx)(`div`,{className:`h-px flex-1`,style:{background:`var(--line2)`}}),(0,B.jsx)(`span`,{className:`text-xs text-[var(--dim)] whitespace-nowrap`,children:t}),(0,B.jsx)(`div`,{className:`h-px flex-1`,style:{background:`var(--line2)`}})]})}function VT({message:e}){let t=e.excludeFromContext?`!!`:`!`,n=e.exitCode===void 0&&!e.cancelled;return(0,B.jsxs)(`div`,{className:`font-mono text-xs rounded border border-[var(--border,#333)] overflow-hidden`,children:[(0,B.jsxs)(`div`,{className:`px-2 py-1 bg-[var(--surface-raised,#1a1a1a)] flex items-center gap-2`,children:[(0,B.jsx)(`span`,{className:`opacity-60 select-none`,children:t}),(0,B.jsx)(`span`,{className:`whitespace-pre-wrap break-all`,children:e.command}),n&&(0,B.jsx)(`span`,{className:`ml-auto opacity-50`,children:`running…`}),e.cancelled&&(0,B.jsx)(`span`,{className:`ml-auto opacity-70`,children:`cancelled`}),!n&&!e.cancelled&&e.exitCode!==0&&(0,B.jsxs)(`span`,{className:`ml-auto opacity-70`,children:[`exit `,e.exitCode]})]}),e.output!==``&&(0,B.jsx)(`pre`,{className:`px-2 py-1 whitespace-pre-wrap break-all m-0`,children:e.output}),e.truncated&&(0,B.jsx)(`div`,{className:`px-2 py-1 opacity-50`,children:`output truncated`})]})}function HT({text:e}){return(0,B.jsxs)(`div`,{className:`queued`,children:[(0,B.jsxs)(`div`,{className:`tag`,children:[(0,B.jsx)(`span`,{className:`select-none`,children:`⋯`}),(0,B.jsx)(`span`,{children:`queued`})]}),(0,B.jsx)(`div`,{className:`whitespace-pre-wrap`,children:e})]})}function UT({message:e}){let t=e.content;return(0,B.jsx)(`div`,{className:`user`,children:typeof t==`string`?(0,B.jsx)(`div`,{className:`whitespace-pre-wrap`,children:t}):t.map((e,t)=>e.type===`text`?(0,B.jsx)(`div`,{className:`whitespace-pre-wrap`,children:e.text},t):e.type===`image`?(0,B.jsx)(nT,{image:e},t):null)})}function WT({message:e,isLastAssistant:t,streaming:n,resultFor:r,executingToolIds:i}){let a=e.content,o=e=>t&&n&&e===a.length-1,s=a.some(e=>e.type===`toolCall`),c=e.stopReason,l=!s&&(c===`error`||c===`aborted`);return(0,B.jsxs)(B.Fragment,{children:[a.map((e,t)=>e.type===`text`?(0,B.jsx)($w,{text:e.text,inProgress:o(t)},t):e.type===`thinking`?(0,B.jsx)(eT,{thinking:e.thinking,inProgress:o(t)},t):e.type===`toolCall`?(0,B.jsx)(KT,{call:e,streaming:n,resultFor:r,executingToolIds:i},t):null),l&&(0,B.jsx)(GT,{stopReason:c,errorMessage:e.errorMessage})]})}function GT({stopReason:e,errorMessage:t}){let n=e===`aborted`?t&&t!==`Request was aborted`?t:`Operation aborted`:`Error: ${t||`Unknown error`}`;return(0,B.jsxs)(`div`,{className:`msg-error`,children:[(0,B.jsx)(`span`,{className:`ic`,"aria-hidden":`true`,children:`⚠`}),(0,B.jsx)(`span`,{className:`txt`,children:n})]})}function KT({call:e,streaming:t,resultFor:n,executingToolIds:r}){let i=LT(e.name),a=n(e.id);return(0,B.jsx)(i,{call:e,result:a,inProgress:t&&r.has(e.id),isError:a?.isError??!1})}function qT({message:e}){return(0,B.jsx)(LT(e.toolName),{call:{type:`toolCall`,id:e.toolCallId,name:e.toolName,arguments:{}},result:e,inProgress:!1,isError:e.isError})}function JT({message:e}){let{onPeek:t,peekedPath:n}=sT(),r=typeof e.content==`string`?e.content:e.content.filter(e=>e.type===`text`).map(e=>typeof e.text==`string`?e.text:``).join(``),i=Xh(r),a=aT(r);function o(e){if(a.length===0)return(0,B.jsx)(`span`,{className:`whitespace-pre-wrap`,children:e});let r=[],i=e,o=0;for(let e of a){let a=i.indexOf(e);if(a===-1)continue;a>0&&r.push((0,B.jsx)(`span`,{className:`whitespace-pre-wrap`,children:i.slice(0,a)},o++));let s=n===e;r.push((0,B.jsx)(`span`,{onClick:n=>{n.stopPropagation(),t(e)},className:[`filelink text-xs`,s&&`peeked`].filter(Boolean).join(` `),children:e},o++)),i=i.slice(a+e.length)}return i&&r.push((0,B.jsx)(`span`,{className:`whitespace-pre-wrap`,children:i},o++)),(0,B.jsx)(B.Fragment,{children:r})}return(0,B.jsxs)(`div`,{className:`inbound`,children:[(0,B.jsx)(`span`,{className:`ic select-none`,children:`◍`}),(0,B.jsxs)(`div`,{className:`body`,children:[(0,B.jsxs)(`div`,{className:`src`,children:[(0,B.jsx)(`span`,{children:`inbox`}),i&&(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`span`,{children:`·`}),(0,B.jsxs)(`span`,{children:[`from `,i]})]})]}),o(r)]})]})}function YT({messages:e,partialToolResults:t,executingToolIds:n,queued:r,streaming:i,bottomInsetPx:a=0,keyboardOpen:o=!1,composerHeightPx:s}){let c=Xw(),l=(0,v.useMemo)(()=>{let n=new Map,r=new Set,i;for(let t of e)if(t.role===`assistant`){i=t;for(let e of t.content)e.type===`toolCall`&&r.add(e.id)}else t.role===`toolResult`&&n.set(t.toolCallId,t);for(let[e,r]of t)n.has(e)||n.set(e,r);let a=e.filter(e=>!(e.role===`toolResult`&&r.has(e.toolCallId))),o=0,s=a.map(e=>e.role===`user`&&e.origin!==`inbox`?(o+=1,`turn ${o}`):null);return{visible:a,resultMap:n,lastAssistant:i,turnLabels:s}},[e,t]),u=l.visible,d=e=>l.resultMap.get(e),f=(0,v.useRef)(null),p=(0,v.useRef)(!0),m=(0,v.useRef)(!1),h=hv({count:u.length,getScrollElement:()=>f.current,estimateSize:()=>96,overscan:10}),g=()=>{if(m.current)return;let e=f.current;if(!e)return;let t=e.scrollHeight-e.scrollTop-e.clientHeight;p.current=t<48},_=(e=8)=>{let t=f.current;if(!t||!p.current){m.current=!1;return}m.current=!0,t.scrollTop=t.scrollHeight,requestAnimationFrame(e>0?()=>_(e-1):()=>{m.current=!1})};return(0,v.useEffect)(()=>{p.current&&(u.length>0||r.length>0)&&queueMicrotask(()=>_())},[u,i,r,a,o,s]),(0,B.jsxs)(`div`,{ref:f,className:`flex min-h-0 flex-1 flex-col overflow-auto py-2`,style:a>0?{paddingBottom:`${a}px`}:void 0,onScroll:g,children:[(0,B.jsx)(`div`,{className:`relative w-full`,style:{height:`${h.getTotalSize()}px`},children:h.getVirtualItems().map(e=>{let t=u[e.index];return t?(0,B.jsxs)(`div`,{"data-index":e.index,ref:h.measureElement,className:`px-3.5 py-1.5 box-border`,style:{position:`absolute`,top:0,left:0,width:`100%`,transform:`translateY(${e.start}px)`},children:[l.turnLabels[e.index]&&(0,B.jsxs)(`div`,{className:`flex items-center gap-3 mt-2.5 mb-3.5`,children:[c!==`focused`&&(0,B.jsx)(`span`,{className:`font-inst text-xs tracking-[0.16em] uppercase text-[var(--dim)]`,children:l.turnLabels[e.index]}),(0,B.jsx)(`div`,{className:`flex-1 h-px bg-[var(--line2)]`})]}),(0,B.jsx)(RT,{executingToolIds:n,message:t,isLastAssistant:t===l.lastAssistant,streaming:i,resultFor:d})]},e.key):null})}),r.length>0&&(0,B.jsx)(`div`,{className:`flex flex-col gap-1.5`,children:r.map((e,t)=>(0,B.jsx)(`div`,{className:`px-3.5 py-1.5 box-border`,children:(0,B.jsx)(HT,{text:e})},t))})]})}var XT={notify:`Your agent has an update`,validation:`Your agent needs your approval`,decision:`Your agent needs a decision`,context:`Your agent needs more from you`,error:`Your agent hit a problem`};function ZT({conversationId:e}){let t=om(e),[n]=Rn(),r=st(),i=n.get(`ask`);return t.length===0?null:(0,B.jsx)(`div`,{className:`flex flex-col gap-2 border-b border-primary/20 bg-primary/5 px-4 py-3`,children:t.map(e=>(0,B.jsx)(QT,{deck:e,highlighted:i!==null&&e.job_id===i,navKey:r.key},e.id))})}function QT({deck:e,highlighted:t=!1,navKey:n}){let r=(0,v.useRef)(null);(0,v.useEffect)(()=>{t&&r.current?.scrollIntoView({behavior:`smooth`,block:`center`})},[t,n]);let i=ut(),{refetch:a}=am(),[o,s]=(0,v.useState)(!1),c=cm(e.kind).icon,l=e.kind===`notify`||e.kind===`validation`,u=async t=>{if(!o){s(!0);try{let n=(await tm(e.job_id)).interactions[0],r=t===`ack`?{id:n.id}:{id:n.id,selectedOptionIds:[(t===`yes`?n.options.find(e=>e.id===`yes`)?.id??n.options[0]?.id:n.options.find(e=>e.id===`no`)?.id??n.options[1]?.id)??t]};await nm(e.job_id,{responses:[r]}),fm(`Done — thanks!`,`success`),a()}catch(e){if(qp(e)){fm(e instanceof Error?e.message:`That request was already handled.`),a();return}fm(`Something went wrong — try again.`)}finally{s(!1)}}};return(0,B.jsxs)(`div`,{ref:r,className:`flex items-center gap-3 ${t?`rounded-md ring-2 ring-primary ring-offset-2 ring-offset-background`:``}`,children:[(0,B.jsx)(`span`,{className:`inline-flex size-7 shrink-0 items-center justify-center rounded-lg bg-primary/15 text-primary`,children:(0,B.jsx)(c,{className:`size-4`})}),(0,B.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,B.jsx)(`p`,{className:`truncate text-sm font-medium`,children:XT[e.kind]??XT.context}),(0,B.jsx)(`p`,{className:`truncate text-xs text-muted-foreground`,children:e.title})]}),e.kind===`notify`&&(0,B.jsxs)(Z,{size:`sm`,disabled:o,onClick:()=>void u(`ack`),children:[(0,B.jsx)(af,{className:`mr-1 size-3.5`}),` Got it`]}),e.kind===`validation`&&(0,B.jsxs)(`div`,{className:`flex gap-2`,children:[(0,B.jsx)(Z,{size:`sm`,disabled:o,onClick:()=>void u(`yes`),children:`Approve`}),(0,B.jsx)(Z,{size:`sm`,variant:`outline`,disabled:o,onClick:()=>void u(`no`),children:`Reject`})]}),!l&&(0,B.jsxs)(Z,{size:`sm`,variant:`secondary`,onClick:()=>i(`/inbox/${encodeURIComponent(e.job_id)}`),children:[`Review `,(0,B.jsx)(nf,{className:`ml-1 size-3.5`})]})]})}var $T=[`[&_h1]:text-xl [&_h1]:font-medium [&_h1]:leading-[1.3] [&_h1]:mb-4 [&_h1]:text-[var(--ink)]`,`[&_h2]:text-base [&_h2]:font-medium [&_h2]:mb-3 [&_h2]:mt-4 [&_h2]:text-[var(--ink)]`,`[&_p]:text-xs [&_p]:leading-[1.65] [&_p]:text-[var(--ink2)] [&_p]:mb-3`,`[&_ul]:list-none [&_ol]:list-none`,`[&_li]:relative [&_li]:pl-5 [&_li]:pb-3.5 [&_li]:text-xs [&_li]:leading-[1.65] [&_li]:text-[var(--ink2)]`,`[&_li]:before:content-[''] [&_li]:before:absolute [&_li]:before:left-[2px] [&_li]:before:top-[8px] [&_li]:before:size-1.5 [&_li]:before:border [&_li]:before:border-[var(--mut)] [&_li]:before:rounded-[2px] [&_li]:before:rotate-45`,`[&_b]:text-[var(--ink)] [&_b]:font-semibold [&_strong]:text-[var(--ink)] [&_strong]:font-semibold`,`[&_pre]:overflow-auto [&_pre]:p-[10px_12px] [&_pre]:rounded-md [&_pre]:bg-[oklch(0_0_0/0.28)] [&_pre]:text-xs`,`[&_code]:font-mono [&_code]:text-xs`,`[&_a]:text-[var(--bone)] [&_a]:underline [&_a]:decoration-dotted`].join(` `);function eE({nodeId:e,path:t,onClose:n,className:r}){let[i,a]=(0,v.useState)(`pretty`),[o,s]=(0,v.useState)(!1),[c,l]=(0,v.useState)(null),[u,d]=(0,v.useState)(null);return(0,v.useEffect)(()=>{t&&(s(!0),l(null),d(null),$f(e,t).then(e=>{d(e),s(!1)}).catch(e=>{l(e instanceof Error?e.message:String(e)),s(!1)}))},[e,t]),(0,v.useEffect)(()=>{if(!t)return;let e=e=>{e.key===`Escape`&&n()};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[t,n]),t?(0,B.jsxs)(`div`,{className:Y(`relative z-[1] flex h-full w-[21.5rem] shrink-0 flex-col border-l border-[var(--line)] bg-[var(--panel)]`,r),children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-2 px-3.5 py-3 border-b border-[var(--line)]`,children:[(0,B.jsx)(`span`,{className:`text-xs text-[var(--done)] shrink-0`,children:`◆`}),(0,B.jsx)(`span`,{className:`font-mono text-xs text-[var(--ink2)] flex-1 truncate`,style:{direction:`rtl`,textAlign:`left`,unicodeBidi:`plaintext`},title:t,children:t}),(0,B.jsxs)(`div`,{className:`flex gap-1.5 shrink-0`,children:[(0,B.jsx)(tE,{on:i===`pretty`,onClick:()=>a(`pretty`),children:`Pretty`}),(0,B.jsx)(tE,{on:i===`raw`,onClick:()=>a(`raw`),children:`Raw`}),(0,B.jsx)(tE,{onClick:n,"aria-label":`Close file peek`,children:`✕`})]})]}),(0,B.jsxs)(`div`,{className:`flex-1 overflow-auto px-5 py-5`,children:[o&&(0,B.jsx)(`div`,{className:`flex items-center justify-center h-16 text-[var(--dim)] text-xs`,children:(0,B.jsx)(`span`,{className:`animate-pulse`,children:`Loading…`})}),c&&(0,B.jsx)(`div`,{className:`text-xs text-[var(--blk)]`,children:c}),u&&!o&&(0,B.jsxs)(B.Fragment,{children:[u.truncated&&(0,B.jsx)(`div`,{className:`mb-3 text-xs text-[var(--dim)]`,children:`File truncated — showing partial content`}),i===`raw`?(0,B.jsx)(`pre`,{className:`text-xs font-mono text-[var(--ink2)] whitespace-pre-wrap break-all leading-[1.7]`,children:u.content}):(0,B.jsx)(nE,{content:u.content})]})]}),(0,B.jsxs)(`div`,{className:`flex items-center gap-2 border-t border-[var(--line)] px-3.5 py-2.5 text-xs text-[var(--dim)]`,children:[`any file path in the stream opens here`,(0,B.jsx)(`span`,{className:`kbd ml-auto`,children:`esc`})]})]}):null}function tE({on:e,onClick:t,children:n,...r}){return(0,B.jsx)(`button`,{type:`button`,onClick:t,className:Y(`font-mono text-xs px-2 py-1 border transition-all duration-[0.12s] cursor-pointer`,e?`text-[var(--bone-ink)] bg-[var(--bone)] border-[var(--bone)]`:`text-[var(--mut)] bg-transparent border-[var(--line)] hover:text-[var(--ink)] hover:border-[var(--line2)]`),...r,children:n})}function nE({content:e}){if(e.startsWith(`---
|
|
72
|
+
`),i=n.length,a=r.length;if((i+1)*(a+1)>DT){let e=[];for(let t of n)e.push({kind:`del`,text:t});for(let t of r)e.push({kind:`add`,text:t});return e}let o=Array.from({length:i+1},()=>Array(a+1).fill(0));for(let e=i-1;e>=0;e--)for(let t=a-1;t>=0;t--)o[e][t]=n[e]===r[t]?o[e+1][t+1]+1:Math.max(o[e+1][t],o[e][t+1]);let s=[],c=0,l=0;for(;c<i&&l<a;)n[c]===r[l]?(s.push({kind:`ctx`,text:n[c]}),c++,l++):o[c+1][l]>=o[c][l+1]?(s.push({kind:`del`,text:n[c]}),c++):(s.push({kind:`add`,text:r[l]}),l++);for(;c<i;)s.push({kind:`del`,text:n[c++]});for(;l<a;)s.push({kind:`add`,text:r[l++]});return s}function kT(e,t){for(let n of t)if(typeof e[n]==`string`)return e[n];return``}function AT(e){let t=e.call.arguments??{},n=kT(t,[`old_string`,`oldText`,`old`,`before`,`search`]),r=kT(t,[`new_string`,`newText`,`new`,`after`,`replace`]),i=OT(n,r),a=gT(e.result),o=e.isError;return(0,B.jsxs)(bT,{call:e.call,subtitle:yT(e.call),inProgress:e.inProgress,isError:o,children:[n||r?(0,B.jsx)(`div`,{className:`m-0 font-mono text-xs overflow-auto max-h-[28rem]`,children:i.map((e,t)=>(0,B.jsx)(`div`,{className:Y(`px-3 whitespace-pre-wrap`,e.kind===`add`&&`bg-[rgba(46,160,67,0.18)] text-[#aef0bf]`,e.kind===`del`&&`bg-[rgba(192,57,43,0.18)] text-[#ffb4ab]`,e.kind===`ctx`&&`opacity-70`),dangerouslySetInnerHTML:{__html:(e.kind===`add`?`+ `:e.kind===`del`?`- `:` `)+Fw(e.text)}},t))}):(0,B.jsx)(`div`,{className:dT,children:`no diff available`}),a&&(0,B.jsx)(`div`,{className:Y(`m-0 px-3 py-2 bg-[#0c0f13] text-[#d6dde6] font-mono text-xs whitespace-pre-wrap overflow-auto max-h-[26rem]`,o&&`text-[#ff9b8a]`),dangerouslySetInnerHTML:{__html:Fw(a)}}),(0,B.jsx)(xT,{result:e.result})]})}var jT={ts:`ts`,tsx:`tsx`,js:`js`,jsx:`jsx`,json:`json`,sh:`bash`,py:`python`,html:`html`,xml:`xml`,css:`css`,md:`markdown`,yml:`yaml`,yaml:`yaml`};function MT(e,t){for(let n of t)if(typeof e[n]==`string`)return e[n];return``}function NT(e){let t=e.call.arguments??{},n=yT(e.call),r=MT(t,[`content`,`contents`,`text`,`body`,`new_string`,`file_text`]),i=gT(e.result),a=e.isError,o=(()=>{if(!r)return``;let e=/\.([a-z0-9]+)$/i.exec(n),t=e&&jT[e[1].toLowerCase()]||``;return Vw(r,t)})();return(0,B.jsxs)(bT,{call:e.call,subtitle:n,inProgress:e.inProgress,isError:a,children:[r?(0,B.jsx)(`div`,{className:lT,style:{padding:`4px 8px`},dangerouslySetInnerHTML:{__html:o}}):(0,B.jsx)(`div`,{className:dT,children:`no content`}),i&&(0,B.jsx)(`div`,{className:Y(`m-0 px-3 py-2 bg-[#0c0f13] text-[#d6dde6] font-mono text-xs whitespace-pre-wrap overflow-auto max-h-[26rem]`,a&&`text-[#ff9b8a]`),dangerouslySetInnerHTML:{__html:Fw(i)}}),(0,B.jsx)(xT,{result:e.result})]})}function PT(e){let t=e.pattern??e.query??e.regex??e.search;return typeof t==`string`?t:``}function FT(e){let t=PT(e.call.arguments??{}),n=gT(e.result),r=n?n.split(`
|
|
73
|
+
`).filter(e=>e.length>0):[],i=e.inProgress;return(0,B.jsxs)(bT,{call:e.call,subtitle:t,inProgress:i,isError:e.isError,children:[r.length>0?(0,B.jsx)(`div`,{className:`m-0 font-mono text-xs overflow-auto max-h-[28rem]`,children:r.map((e,t)=>(0,B.jsx)(`div`,{className:`px-3 py-1 font-mono text-xs opacity-85`,dangerouslySetInnerHTML:{__html:Fw(e)}},t))}):!i&&(0,B.jsx)(`div`,{className:`px-3 py-2 opacity-50 text-xs italic`,children:`no matches`}),(0,B.jsx)(xT,{result:e.result})]})}function IT(e){let t=vT(e.call.arguments),n=gT(e.result),r=e.isError,i=e.inProgress;return(0,B.jsxs)(bT,{call:e.call,inProgress:i,isError:r,children:[t&&(0,B.jsx)(`pre`,{className:`m-0 px-3 py-2 bg-[#11161c] font-mono text-xs whitespace-pre-wrap overflow-auto max-h-60 border-b border-[#222b35]`,children:t}),n&&(0,B.jsx)(`div`,{className:Y(`[&_pre]:overflow-auto [&_pre]:p-[10px_12px] [&_pre]:rounded-md [&_pre]:bg-muted [&_code]:font-mono [&_code]:text-xs [&_:not(pre)>code]:bg-muted [&_:not(pre)>code]:px-1.5 [&_:not(pre)>code]:py-0.5 [&_:not(pre)>code]:rounded [&_p]:my-[0.4em] [&_a]:text-primary`,r&&`text-[#ff9b8a]`),style:{padding:`8px 11px`},dangerouslySetInnerHTML:{__html:Bw(n)}}),(0,B.jsx)(xT,{result:e.result}),!t&&!n&&!i&&(0,B.jsx)(`div`,{className:`px-3 py-2 opacity-50 text-xs italic`,children:`no output`})]})}var LT={bash:CT,shell:CT,sh:CT,run:CT,terminal:CT,read:ET,read_file:ET,cat:ET,view:ET,edit:AT,str_replace:AT,apply_patch:AT,write:NT,write_file:NT,create:NT,grep:FT,search:FT,rg:FT};function RT(e){return LT[(e||``).toLowerCase()]??IT}Object.keys(LT);function zT({message:e,isLastAssistant:t,streaming:n,resultFor:r,executingToolIds:i}){let a=e.role;return a===`user`?e.origin===`inbox`?(0,B.jsx)(YT,{message:e}):(0,B.jsx)(`div`,{className:`text-sm leading-[1.55] break-words`,children:(0,B.jsx)(WT,{message:e})}):a===`assistant`?(0,B.jsx)(`div`,{className:`text-sm leading-[1.55] break-words`,children:(0,B.jsx)(GT,{message:e,isLastAssistant:t,streaming:n,resultFor:r,executingToolIds:i})}):a===`toolResult`?(0,B.jsx)(`div`,{className:`text-sm leading-[1.55] break-words`,children:(0,B.jsx)(JT,{message:e})}):a===`bashExecution`?(0,B.jsx)(`div`,{className:`text-sm leading-[1.55] break-words`,children:(0,B.jsx)(HT,{message:e})}):a===`custom`&&e.customType===BT?(0,B.jsx)(VT,{message:e}):null}var BT=`crtr-cycle-divider`;function VT({message:e}){let t=typeof e.content==`string`?e.content:`yielded — new cycle begins`;return(0,B.jsxs)(`div`,{className:`flex items-center gap-3 my-1`,style:{opacity:.55},children:[(0,B.jsx)(`div`,{className:`h-px flex-1`,style:{background:`var(--line2)`}}),(0,B.jsx)(`span`,{className:`text-xs text-[var(--dim)] whitespace-nowrap`,children:t}),(0,B.jsx)(`div`,{className:`h-px flex-1`,style:{background:`var(--line2)`}})]})}function HT({message:e}){let t=e.excludeFromContext?`!!`:`!`,n=e.exitCode===void 0&&!e.cancelled;return(0,B.jsxs)(`div`,{className:`font-mono text-xs rounded border border-[var(--border,#333)] overflow-hidden`,children:[(0,B.jsxs)(`div`,{className:`px-2 py-1 bg-[var(--surface-raised,#1a1a1a)] flex items-center gap-2`,children:[(0,B.jsx)(`span`,{className:`opacity-60 select-none`,children:t}),(0,B.jsx)(`span`,{className:`whitespace-pre-wrap break-all`,children:e.command}),n&&(0,B.jsx)(`span`,{className:`ml-auto opacity-50`,children:`running…`}),e.cancelled&&(0,B.jsx)(`span`,{className:`ml-auto opacity-70`,children:`cancelled`}),!n&&!e.cancelled&&e.exitCode!==0&&(0,B.jsxs)(`span`,{className:`ml-auto opacity-70`,children:[`exit `,e.exitCode]})]}),e.output!==``&&(0,B.jsx)(`pre`,{className:`px-2 py-1 whitespace-pre-wrap break-all m-0`,children:e.output}),e.truncated&&(0,B.jsx)(`div`,{className:`px-2 py-1 opacity-50`,children:`output truncated`})]})}function UT({text:e}){return(0,B.jsxs)(`div`,{className:`queued`,children:[(0,B.jsxs)(`div`,{className:`tag`,children:[(0,B.jsx)(`span`,{className:`select-none`,children:`⋯`}),(0,B.jsx)(`span`,{children:`queued`})]}),(0,B.jsx)(`div`,{className:`whitespace-pre-wrap`,children:e})]})}function WT({message:e}){let t=e.content;return(0,B.jsx)(`div`,{className:`user`,children:typeof t==`string`?(0,B.jsx)(`div`,{className:`whitespace-pre-wrap`,children:t}):t.map((e,t)=>e.type===`text`?(0,B.jsx)(`div`,{className:`whitespace-pre-wrap`,children:e.text},t):e.type===`image`?(0,B.jsx)(rT,{image:e},t):null)})}function GT({message:e,isLastAssistant:t,streaming:n,resultFor:r,executingToolIds:i}){let a=e.content,o=e=>t&&n&&e===a.length-1,s=a.some(e=>e.type===`toolCall`),c=e.stopReason,l=!s&&(c===`error`||c===`aborted`);return(0,B.jsxs)(B.Fragment,{children:[a.map((e,t)=>e.type===`text`?(0,B.jsx)(eT,{text:e.text,inProgress:o(t)},t):e.type===`thinking`?(0,B.jsx)(tT,{thinking:e.thinking,inProgress:o(t)},t):e.type===`toolCall`?(0,B.jsx)(qT,{call:e,streaming:n,resultFor:r,executingToolIds:i},t):null),l&&(0,B.jsx)(KT,{stopReason:c,errorMessage:e.errorMessage})]})}function KT({stopReason:e,errorMessage:t}){let n=e===`aborted`?t&&t!==`Request was aborted`?t:`Operation aborted`:`Error: ${t||`Unknown error`}`;return(0,B.jsxs)(`div`,{className:`msg-error`,children:[(0,B.jsx)(`span`,{className:`ic`,"aria-hidden":`true`,children:`⚠`}),(0,B.jsx)(`span`,{className:`txt`,children:n})]})}function qT({call:e,streaming:t,resultFor:n,executingToolIds:r}){let i=RT(e.name),a=n(e.id);return(0,B.jsx)(i,{call:e,result:a,inProgress:t&&r.has(e.id),isError:a?.isError??!1})}function JT({message:e}){return(0,B.jsx)(RT(e.toolName),{call:{type:`toolCall`,id:e.toolCallId,name:e.toolName,arguments:{}},result:e,inProgress:!1,isError:e.isError})}function YT({message:e}){let{onPeek:t,peekedPath:n}=cT(),r=typeof e.content==`string`?e.content:e.content.filter(e=>e.type===`text`).map(e=>typeof e.text==`string`?e.text:``).join(``),i=Xh(r),a=oT(r);function o(e){if(a.length===0)return(0,B.jsx)(`span`,{className:`whitespace-pre-wrap`,children:e});let r=[],i=e,o=0;for(let e of a){let a=i.indexOf(e);if(a===-1)continue;a>0&&r.push((0,B.jsx)(`span`,{className:`whitespace-pre-wrap`,children:i.slice(0,a)},o++));let s=n===e;r.push((0,B.jsx)(`span`,{onClick:n=>{n.stopPropagation(),t(e)},className:[`filelink text-xs`,s&&`peeked`].filter(Boolean).join(` `),children:e},o++)),i=i.slice(a+e.length)}return i&&r.push((0,B.jsx)(`span`,{className:`whitespace-pre-wrap`,children:i},o++)),(0,B.jsx)(B.Fragment,{children:r})}return(0,B.jsxs)(`div`,{className:`inbound`,children:[(0,B.jsx)(`span`,{className:`ic select-none`,children:`◍`}),(0,B.jsxs)(`div`,{className:`body`,children:[(0,B.jsxs)(`div`,{className:`src`,children:[(0,B.jsx)(`span`,{children:`inbox`}),i&&(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`span`,{children:`·`}),(0,B.jsxs)(`span`,{children:[`from `,i]})]})]}),o(r)]})]})}function XT({messages:e,partialToolResults:t,executingToolIds:n,queued:r,streaming:i,bottomInsetPx:a=0,keyboardOpen:o=!1,composerHeightPx:s}){let c=Zw(),l=(0,v.useMemo)(()=>{let n=new Map,r=new Set,i;for(let t of e)if(t.role===`assistant`){i=t;for(let e of t.content)e.type===`toolCall`&&r.add(e.id)}else t.role===`toolResult`&&n.set(t.toolCallId,t);for(let[e,r]of t)n.has(e)||n.set(e,r);let a=e.filter(e=>!(e.role===`toolResult`&&r.has(e.toolCallId))),o=0,s=a.map(e=>e.role===`user`&&e.origin!==`inbox`?(o+=1,`turn ${o}`):null);return{visible:a,resultMap:n,lastAssistant:i,turnLabels:s}},[e,t]),u=l.visible,d=e=>l.resultMap.get(e),f=(0,v.useRef)(null),p=(0,v.useRef)(!0),m=(0,v.useRef)(!1),h=gv({count:u.length,getScrollElement:()=>f.current,estimateSize:()=>96,overscan:10}),g=()=>{if(m.current)return;let e=f.current;if(!e)return;let t=e.scrollHeight-e.scrollTop-e.clientHeight;p.current=t<48},_=(e=8)=>{let t=f.current;if(!t||!p.current){m.current=!1;return}m.current=!0,t.scrollTop=t.scrollHeight,requestAnimationFrame(e>0?()=>_(e-1):()=>{m.current=!1})};return(0,v.useEffect)(()=>{p.current&&(u.length>0||r.length>0)&&queueMicrotask(()=>_())},[u,i,r,a,o,s]),(0,B.jsxs)(`div`,{ref:f,className:`flex min-h-0 flex-1 flex-col overflow-auto py-2`,style:a>0?{paddingBottom:`${a}px`}:void 0,onScroll:g,children:[(0,B.jsx)(`div`,{className:`relative w-full`,style:{height:`${h.getTotalSize()}px`},children:h.getVirtualItems().map(e=>{let t=u[e.index];return t?(0,B.jsxs)(`div`,{"data-index":e.index,ref:h.measureElement,className:`px-3.5 py-1.5 box-border`,style:{position:`absolute`,top:0,left:0,width:`100%`,transform:`translateY(${e.start}px)`},children:[l.turnLabels[e.index]&&(0,B.jsxs)(`div`,{className:`flex items-center gap-3 mt-2.5 mb-3.5`,children:[c!==`focused`&&(0,B.jsx)(`span`,{className:`font-inst text-xs tracking-[0.16em] uppercase text-[var(--dim)]`,children:l.turnLabels[e.index]}),(0,B.jsx)(`div`,{className:`flex-1 h-px bg-[var(--line2)]`})]}),(0,B.jsx)(zT,{executingToolIds:n,message:t,isLastAssistant:t===l.lastAssistant,streaming:i,resultFor:d})]},e.key):null})}),r.length>0&&(0,B.jsx)(`div`,{className:`flex flex-col gap-1.5`,children:r.map((e,t)=>(0,B.jsx)(`div`,{className:`px-3.5 py-1.5 box-border`,children:(0,B.jsx)(UT,{text:e})},t))})]})}var ZT={notify:`Your agent has an update`,validation:`Your agent needs your approval`,decision:`Your agent needs a decision`,context:`Your agent needs more from you`,error:`Your agent hit a problem`};function QT({conversationId:e}){let t=om(e),[n]=Rn(),r=st(),i=n.get(`ask`);return t.length===0?null:(0,B.jsx)(`div`,{className:`flex flex-col gap-2 border-b border-primary/20 bg-primary/5 px-4 py-3`,children:t.map(e=>(0,B.jsx)($T,{deck:e,highlighted:i!==null&&e.job_id===i,navKey:r.key},e.id))})}function $T({deck:e,highlighted:t=!1,navKey:n}){let r=(0,v.useRef)(null);(0,v.useEffect)(()=>{t&&r.current?.scrollIntoView({behavior:`smooth`,block:`center`})},[t,n]);let i=ut(),{refetch:a}=am(),[o,s]=(0,v.useState)(!1),c=cm(e.kind).icon,l=e.kind===`notify`||e.kind===`validation`,u=async t=>{if(!o){s(!0);try{let n=(await tm(e.job_id)).interactions[0],r=t===`ack`?{id:n.id}:{id:n.id,selectedOptionIds:[(t===`yes`?n.options.find(e=>e.id===`yes`)?.id??n.options[0]?.id:n.options.find(e=>e.id===`no`)?.id??n.options[1]?.id)??t]};await nm(e.job_id,{responses:[r]}),fm(`Done — thanks!`,`success`),a()}catch(e){if(qp(e)){fm(e instanceof Error?e.message:`That request was already handled.`),a();return}fm(`Something went wrong — try again.`)}finally{s(!1)}}};return(0,B.jsxs)(`div`,{ref:r,className:`flex items-center gap-3 ${t?`rounded-md ring-2 ring-primary ring-offset-2 ring-offset-background`:``}`,children:[(0,B.jsx)(`span`,{className:`inline-flex size-7 shrink-0 items-center justify-center rounded-lg bg-primary/15 text-primary`,children:(0,B.jsx)(c,{className:`size-4`})}),(0,B.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,B.jsx)(`p`,{className:`truncate text-sm font-medium`,children:ZT[e.kind]??ZT.context}),(0,B.jsx)(`p`,{className:`truncate text-xs text-muted-foreground`,children:e.title})]}),e.kind===`notify`&&(0,B.jsxs)(Z,{size:`sm`,disabled:o,onClick:()=>void u(`ack`),children:[(0,B.jsx)(af,{className:`mr-1 size-3.5`}),` Got it`]}),e.kind===`validation`&&(0,B.jsxs)(`div`,{className:`flex gap-2`,children:[(0,B.jsx)(Z,{size:`sm`,disabled:o,onClick:()=>void u(`yes`),children:`Approve`}),(0,B.jsx)(Z,{size:`sm`,variant:`outline`,disabled:o,onClick:()=>void u(`no`),children:`Reject`})]}),!l&&(0,B.jsxs)(Z,{size:`sm`,variant:`secondary`,onClick:()=>i(`/inbox/${encodeURIComponent(e.job_id)}`),children:[`Review `,(0,B.jsx)(nf,{className:`ml-1 size-3.5`})]})]})}var eE=[`[&_h1]:text-xl [&_h1]:font-medium [&_h1]:leading-[1.3] [&_h1]:mb-4 [&_h1]:text-[var(--ink)]`,`[&_h2]:text-base [&_h2]:font-medium [&_h2]:mb-3 [&_h2]:mt-4 [&_h2]:text-[var(--ink)]`,`[&_p]:text-xs [&_p]:leading-[1.65] [&_p]:text-[var(--ink2)] [&_p]:mb-3`,`[&_ul]:list-none [&_ol]:list-none`,`[&_li]:relative [&_li]:pl-5 [&_li]:pb-3.5 [&_li]:text-xs [&_li]:leading-[1.65] [&_li]:text-[var(--ink2)]`,`[&_li]:before:content-[''] [&_li]:before:absolute [&_li]:before:left-[2px] [&_li]:before:top-[8px] [&_li]:before:size-1.5 [&_li]:before:border [&_li]:before:border-[var(--mut)] [&_li]:before:rounded-[2px] [&_li]:before:rotate-45`,`[&_b]:text-[var(--ink)] [&_b]:font-semibold [&_strong]:text-[var(--ink)] [&_strong]:font-semibold`,`[&_pre]:overflow-auto [&_pre]:p-[10px_12px] [&_pre]:rounded-md [&_pre]:bg-[oklch(0_0_0/0.28)] [&_pre]:text-xs`,`[&_code]:font-mono [&_code]:text-xs`,`[&_a]:text-[var(--bone)] [&_a]:underline [&_a]:decoration-dotted`].join(` `);function tE({nodeId:e,path:t,onClose:n,className:r}){let[i,a]=(0,v.useState)(`pretty`),[o,s]=(0,v.useState)(!1),[c,l]=(0,v.useState)(null),[u,d]=(0,v.useState)(null);return(0,v.useEffect)(()=>{t&&(s(!0),l(null),d(null),$f(e,t).then(e=>{d(e),s(!1)}).catch(e=>{l(e instanceof Error?e.message:String(e)),s(!1)}))},[e,t]),(0,v.useEffect)(()=>{if(!t)return;let e=e=>{e.key===`Escape`&&n()};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[t,n]),t?(0,B.jsxs)(`div`,{className:Y(`relative z-[1] flex h-full w-[21.5rem] shrink-0 flex-col border-l border-[var(--line)] bg-[var(--panel)]`,r),children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-2 px-3.5 py-3 border-b border-[var(--line)]`,children:[(0,B.jsx)(`span`,{className:`text-xs text-[var(--done)] shrink-0`,children:`◆`}),(0,B.jsx)(`span`,{className:`font-mono text-xs text-[var(--ink2)] flex-1 truncate`,style:{direction:`rtl`,textAlign:`left`,unicodeBidi:`plaintext`},title:t,children:t}),(0,B.jsxs)(`div`,{className:`flex gap-1.5 shrink-0`,children:[(0,B.jsx)(nE,{on:i===`pretty`,onClick:()=>a(`pretty`),children:`Pretty`}),(0,B.jsx)(nE,{on:i===`raw`,onClick:()=>a(`raw`),children:`Raw`}),(0,B.jsx)(nE,{onClick:n,"aria-label":`Close file peek`,children:`✕`})]})]}),(0,B.jsxs)(`div`,{className:`flex-1 overflow-auto px-5 py-5`,children:[o&&(0,B.jsx)(`div`,{className:`flex items-center justify-center h-16 text-[var(--dim)] text-xs`,children:(0,B.jsx)(`span`,{className:`animate-pulse`,children:`Loading…`})}),c&&(0,B.jsx)(`div`,{className:`text-xs text-[var(--blk)]`,children:c}),u&&!o&&(0,B.jsxs)(B.Fragment,{children:[u.truncated&&(0,B.jsx)(`div`,{className:`mb-3 text-xs text-[var(--dim)]`,children:`File truncated — showing partial content`}),i===`raw`?(0,B.jsx)(`pre`,{className:`text-xs font-mono text-[var(--ink2)] whitespace-pre-wrap break-all leading-[1.7]`,children:u.content}):(0,B.jsx)(rE,{content:u.content})]})]}),(0,B.jsxs)(`div`,{className:`flex items-center gap-2 border-t border-[var(--line)] px-3.5 py-2.5 text-xs text-[var(--dim)]`,children:[`any file path in the stream opens here`,(0,B.jsx)(`span`,{className:`kbd ml-auto`,children:`esc`})]})]}):null}function nE({on:e,onClick:t,children:n,...r}){return(0,B.jsx)(`button`,{type:`button`,onClick:t,className:Y(`font-mono text-xs px-2 py-1 border transition-all duration-[0.12s] cursor-pointer`,e?`text-[var(--bone-ink)] bg-[var(--bone)] border-[var(--bone)]`:`text-[var(--mut)] bg-transparent border-[var(--line)] hover:text-[var(--ink)] hover:border-[var(--line2)]`),...r,children:n})}function rE({content:e}){if(e.startsWith(`---
|
|
73
74
|
`)||e.startsWith(`---\r
|
|
74
75
|
`)){let t=e.indexOf(`
|
|
75
76
|
---
|
|
76
77
|
`,4);if(t!==-1){let n=e.slice(4,t),r=e.slice(t+5),i=n.split(`
|
|
77
|
-
`).map(e=>{let t=e.indexOf(`:`);return t<1?null:{key:e.slice(0,t).trim(),val:e.slice(t+1).trim()}}).filter(Boolean);return(0,B.jsxs)(B.Fragment,{children:[i.length>0&&(0,B.jsx)(`div`,{className:`fm-chips`,children:i.map(({key:e,val:t})=>(0,B.jsxs)(`span`,{className:`fm-chip`,children:[e,` `,(0,B.jsx)(`b`,{children:t})]},e))}),(0,B.jsx)(`div`,{className:$T,dangerouslySetInnerHTML:{__html:zw(r)}})]})}}return(0,B.jsx)(`div`,{className:$T,dangerouslySetInnerHTML:{__html:zw(e)}})}var rE=[`off`,`minimal`,`low`,`medium`,`high`,`xhigh`],iE=e=>({"--i":e}),aE={borderBottom:`1px solid var(--line)`,background:`linear-gradient(180deg, rgba(33,31,25,.7), rgba(20,19,16,0))`};function oE(e){let t=ut(),{store:n,detail:r,input:i,setInput:a,reviving:o,actionError:s,peekedPath:c,setPeekedPath:l,dormant:u,brokerUp:d,isController:f,streaming:p,canDrive:m,commands:h,sendPrimary:g,onInputKeyDown:_,selectCommand:y,doRevive:b,doClose:x}=P_(e.id);return(0,v.useEffect)(()=>{let e=e=>{!e.altKey||e.metaKey||e.ctrlKey||e.code!==`KeyD`||document.activeElement instanceof HTMLTextAreaElement||(e.preventDefault(),Jw())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[]),(0,B.jsx)(oT.Provider,{value:{peekedPath:c,onPeek:l},children:(0,B.jsxs)(`div`,{className:`in flex h-full min-h-0 flex-col`,children:[(0,B.jsxs)(`div`,{className:Y(`con-head rv flex shrink-0 items-center gap-3 px-6 py-4`,u&&`opacity-80`),style:{...aE,...iE(1)},children:[(0,B.jsxs)(`button`,{type:`button`,onClick:()=>t(`/`),className:`flex shrink-0 items-center gap-1.5 text-sm text-muted-foreground transition-colors hover:text-[var(--ink)]`,children:[(0,B.jsx)(sf,{className:`size-4`}),`Conversations`]}),(0,B.jsx)(oh,{store:n,detail:r}),(0,B.jsx)(`div`,{className:`flex-1`}),(0,B.jsx)(cE,{}),(0,B.jsx)(Lh,{store:n})]}),(0,B.jsx)(`div`,{className:`rv`,style:iE(2),children:(0,B.jsx)(fh,{store:n,detail:r})}),(0,B.jsx)(uE,{state:n.brokerStatus,dormant:u}),n.error&&(0,B.jsxs)(`div`,{className:`border-b border-destructive/30 bg-destructive/15 px-4 py-2 text-sm text-destructive`,children:[n.error.code,`: `,n.error.message]}),s&&(0,B.jsx)(`div`,{className:`border-b border-destructive/30 bg-destructive/15 px-4 py-2 text-sm text-destructive`,children:s}),(0,B.jsx)(ZT,{conversationId:e.id}),(0,B.jsxs)(`div`,{className:`streamwrap relative flex min-h-0 flex-1 overflow-hidden`,children:[(0,B.jsx)(Dh,{currentId:e.id,onNavigate:e=>t(`/nodes/${e}`)}),(0,B.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col`,children:[(0,B.jsx)(`main`,{className:`flex min-h-0 flex-1 flex-col overflow-hidden`,children:(0,B.jsx)(YT,{messages:n.messages,partialToolResults:n.partialToolResults,executingToolIds:n.executingToolIds,queued:n.queued,streaming:p})}),u?(0,B.jsx)(fE,{id:e.id,reviving:o,onRevive:b,onClose:x}):(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(dE,{store:n,canDrive:m,streaming:p,onClose:x}),(0,B.jsxs)(`div`,{className:`relative flex shrink-0 flex-col gap-2 border-t border-border px-4 py-3`,children:[(0,B.jsx)(I_,{commands:h,query:i,visible:i.startsWith(`/`),onSelect:y}),(0,B.jsx)(Wp,{className:`resize-none font-mono text-sm`,value:i,onChange:e=>a(e.currentTarget.value),onKeyDown:_,disabled:!m,placeholder:lE(f,d),rows:3}),(0,B.jsxs)(`div`,{className:`flex items-center justify-end gap-2`,children:[(0,B.jsx)(pE,{id:e.id}),(0,B.jsx)(Z,{variant:`default`,onClick:g,disabled:!m||!i.trim(),children:p?`Steer`:`Send`})]})]})]})]}),(0,B.jsx)(eE,{nodeId:e.id,path:c,onClose:()=>l(null)})]}),(0,B.jsx)(gh,{store:n,detail:r}),(0,B.jsx)(z_,{store:n})]})})}var sE=[{value:`focused`,label:`Focused`},{value:`standard`,label:`Standard`},{value:`verbose`,label:`Verbose`}];function cE(){let e=Xw();return(0,B.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,title:`Transcript detail — Focused / Standard / Verbose (⌥D to cycle)`,children:[(0,B.jsx)(`span`,{className:`instlabel`,children:`Detail`}),(0,B.jsxs)(Lp,{value:e,onValueChange:e=>qw(e),children:[(0,B.jsx)(zp,{size:`sm`,className:`text-sm`,"aria-label":`Transcript detail`,children:(0,B.jsx)(Rp,{})}),(0,B.jsx)(Bp,{children:sE.map(e=>(0,B.jsx)(Vp,{value:e.value,children:e.label},e.value))})]})]})}function lE(e,t){return e?t?`Type a prompt, or / for commands…`:`broker is down — input is frozen`:`observer — request control to drive this session`}function uE({state:e,dormant:t}){return t||e!==`down`&&e!==`reconnecting`?null:(0,B.jsx)(`div`,{className:[`broker-banner border px-4 py-2 text-sm`,e===`down`?`bg-destructive/15 text-destructive border-destructive/30`:`bg-warning/15 border-warning/30`].join(` `),children:e===`down`?`Broker is down — history frozen, input disabled. Waiting for auto-revive…`:`Reconnecting to the broker…`})}function dE({store:e,canDrive:t,streaming:n,onClose:r}){let[i,a]=(0,v.useState)(null),o=i??e.state?.thinkingLevel??`medium`;return(0,B.jsxs)(`div`,{className:`flex shrink-0 flex-wrap items-center gap-2 border-t border-border px-4 py-2`,children:[(0,B.jsx)(Z,{variant:`secondary`,size:`sm`,disabled:!t||!n,onClick:()=>e.abort(),children:`Abort`}),(0,B.jsxs)(`label`,{className:`tiny-sel relative`,"aria-disabled":!t,children:[`thinking `,(0,B.jsx)(`b`,{children:o}),(0,B.jsx)(of,{className:`size-3.5`}),(0,B.jsx)(`select`,{disabled:!t,value:o,onChange:t=>{let n=t.currentTarget.value;a(n),e.setThinkingLevel(n)},"aria-label":`Thinking level`,className:`absolute inset-0 cursor-pointer opacity-0`,children:rE.map(e=>(0,B.jsx)(`option`,{value:e,children:e},e))})]}),(0,B.jsx)(Z,{variant:`ghost`,size:`sm`,disabled:!t,onClick:()=>e.cycleModel(),children:`Cycle model`}),(0,B.jsx)(Z,{variant:`ghost`,size:`sm`,disabled:!t,onClick:()=>e.compact(),children:`Compact`}),(0,B.jsx)(Z,{variant:`destructive`,size:`sm`,className:`ml-auto`,onClick:r,children:`Close node`})]})}function fE({id:e,reviving:t,onRevive:n,onClose:r}){return(0,B.jsxs)(`div`,{className:`flex shrink-0 flex-wrap items-center gap-2 border-t border-border px-4 py-3`,children:[(0,B.jsx)(`span`,{className:`text-muted-foreground text-sm`,children:`This node is dormant (read-only). Revive to drive it live.`}),(0,B.jsx)(pE,{id:e}),(0,B.jsx)(Z,{variant:`default`,disabled:t,onClick:n,children:t?`Revive…`:`Revive`}),(0,B.jsx)(Z,{variant:`destructive`,onClick:r,children:`Close node`})]})}function pE({id:e}){let[t,n]=(0,v.useState)(!1);return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(Z,{variant:`secondary`,onClick:()=>n(!0),children:`Message (inbox)`}),(0,B.jsx)(mE,{id:e,open:t,onOpenChange:n})]})}function mE({id:e,open:t,onOpenChange:n}){let[r,i]=(0,v.useState)(``),[a,o]=(0,v.useState)(``),[s,c]=(0,v.useState)(!1),[l,u]=(0,v.useState)(null);return(0,v.useEffect)(()=>{t&&(i(``),o(``),u(null))},[t]),(0,B.jsx)(Dp,{open:t,onOpenChange:n,children:(0,B.jsxs)(Ap,{children:[(0,B.jsxs)(jp,{children:[(0,B.jsx)(Np,{children:`Send an inbox message`}),(0,B.jsx)(Pp,{children:`A directive deliverable to any node, including a dormant one.`})]}),(0,B.jsxs)(`form`,{onSubmit:async t=>{if(t.preventDefault(),r.trim()){c(!0),u(null);try{let t=await Xf(e,{body:r.trim(),...a.trim()?{tier:a.trim()}:{}});u(`delivered=${String(t.delivered)} revived=${String(t.revived)}`),i(``)}catch(e){u(F_(e))}finally{c(!1)}}},className:`flex flex-col gap-3`,children:[(0,B.jsx)(Wp,{value:r,onChange:e=>i(e.currentTarget.value),rows:4,required:!0,placeholder:`Message body…`}),(0,B.jsxs)(`label`,{className:`flex flex-col gap-1 text-sm`,children:[`tier`,(0,B.jsx)(`input`,{className:`rounded border bg-transparent px-2 py-1 text-sm`,value:a,onChange:e=>o(e.currentTarget.value),placeholder:`(default)`})]}),l&&(0,B.jsx)(`p`,{className:`text-muted-foreground text-sm`,children:l}),(0,B.jsxs)(Mp,{children:[(0,B.jsx)(Z,{type:`button`,variant:`secondary`,onClick:()=>n(!1),disabled:s,children:`Close`}),(0,B.jsx)(Z,{type:`submit`,variant:`default`,disabled:s,children:s?`Sending…`:`Send`})]})]})]})})}function hE(e){e.key===`Enter`&&e.stopPropagation()}function gE(e){return!e.canDrive&&!e.store.serverConnected?`broker is down — input is frozen`:e.canDrive?`Type a prompt. Enter makes a new line; Send submits.`:`observer — request control in More to drive`}function _E({screen:e,onMetricsChange:t}){let n=(0,v.useRef)(null),r=(0,v.useRef)(null),i=(0,v.useRef)(null),a=(0,v.useRef)(!1),o=(0,v.useRef)(0),s=(0,v.useRef)({height:0,keyboardHeight:0,keyboardOpen:!1}),c=(0,v.useMemo)(()=>(e,r=o.current)=>{a.current=e,o.current=r;let c=Math.ceil(n.current?.getBoundingClientRect().height??0),l={height:c,keyboardHeight:r,keyboardOpen:e},u=i.current??document.querySelector(`.mobile-shell-root`);i.current=u,u&&u.style.setProperty(`--composer-height`,`${c}px`),(s.current.height!==l.height||s.current.keyboardHeight!==l.keyboardHeight||s.current.keyboardOpen!==l.keyboardOpen)&&(s.current=l,t(l))},[t]),l=(0,v.useMemo)(()=>e=>{let t=i.current??document.querySelector(`.mobile-shell-root`);if(i.current=t,!t)return;let n=window.visualViewport,r=n&&e?Math.max(0,Math.round(window.innerHeight-(n.height+n.offsetTop))):0,a=n?Math.max(0,Math.round(n.offsetTop)):0;t.style.setProperty(`--kb-height`,`${r}px`),t.style.setProperty(`--vv-offset`,`${a}px`),t.dataset.keyboardOpen=e||r>0?`true`:`false`,c(e||r>0,r)},[c]);return(0,v.useLayoutEffect)(()=>{let e=r.current;e&&(e.style.height=`auto`,e.style.height=`${Math.min(e.scrollHeight,180)}px`,c(a.current))},[e.input,c]),(0,v.useEffect)(()=>{let e=document.querySelector(`.mobile-shell-root`);if(i.current=e,!e)return;let t=()=>{let e=window.visualViewport,t=e?window.innerHeight-(e.height+e.offsetTop)>0:a.current;l(t)},o=window.visualViewport,s=()=>{o||l(!0)},u=()=>{o||l(!1)},d=r.current;d?.addEventListener(`focus`,s),d?.addEventListener(`blur`,u);let f=()=>t();o&&(o.addEventListener(`resize`,f),o.addEventListener(`scroll`,f)),window.addEventListener(`resize`,f),t();let p=typeof ResizeObserver>`u`?null:new ResizeObserver(()=>c(a.current));return p&&n.current&&p.observe(n.current),()=>{d?.removeEventListener(`focus`,s),d?.removeEventListener(`blur`,u),window.removeEventListener(`resize`,f),o&&(o.removeEventListener(`resize`,f),o.removeEventListener(`scroll`,f)),p?.disconnect(),e&&(e.style.setProperty(`--kb-height`,`0px`),e.style.setProperty(`--vv-offset`,`0px`),e.style.setProperty(`--composer-height`,`0px`),delete e.dataset.keyboardOpen)}},[c,l]),(0,B.jsxs)(`div`,{ref:n,className:`mobile-composer shrink-0 border-t border-border bg-[var(--panel)] px-3 py-3`,children:[(0,B.jsx)(Wp,{ref:r,className:`mobile-composer-textarea resize-none rounded-xl border-border bg-[rgba(0,0,0,.16)] font-mono text-sm leading-5 text-[var(--ink)] placeholder:text-[var(--dim)]`,rows:2,value:e.input,placeholder:gE(e),onChange:t=>{e.setInput(t.currentTarget.value),requestAnimationFrame(()=>c(a.current))},onKeyDown:hE}),(0,B.jsxs)(`div`,{className:`mt-3 flex items-center gap-2`,children:[e.streaming&&(0,B.jsx)(Z,{type:`button`,variant:`secondary`,size:`sm`,disabled:!e.canDrive,onClick:()=>e.store.abort(),children:`Stop`}),(0,B.jsx)(Z,{type:`button`,size:`sm`,className:`flex-1`,disabled:!e.canDrive||!e.input.trim(),onClick:()=>e.sendPrimary(),children:e.streaming?`Steer`:`Send`})]}),!e.store.serverConnected&&(0,B.jsx)(`p`,{className:`mt-2 text-xs text-muted-foreground`,children:`Offline — draft saved locally.`}),e.store.serverConnected&&!e.canDrive&&(0,B.jsx)(`p`,{className:`mt-2 text-xs text-muted-foreground`,children:`Request control in More to drive this thread.`})]})}var vE={live:`border-success/25 bg-success/10 text-success`,working:`border-success/25 bg-success/10 text-success`,idle:`border-border bg-transparent text-muted-foreground`,"needs-you":`border-warning/30 bg-warning/10 text-warning`,done:`border-border bg-transparent text-muted-foreground`,reconnecting:`border-warning/30 bg-warning/10 text-warning`,offline:`border-destructive/30 bg-destructive/10 text-destructive`};function yE({title:e,statusLabel:t,statusTone:n,onBack:r,onOpenOverflow:i}){return(0,B.jsxs)(`header`,{className:`flex shrink-0 items-center gap-2 border-b px-3 py-2 [border-color:var(--line)] [background:var(--panel)]`,children:[(0,B.jsx)(`button`,{type:`button`,onClick:r,"aria-label":`Back to conversations`,className:`flex size-8 shrink-0 items-center justify-center rounded-full border border-border bg-transparent text-[var(--ink2)] transition-colors hover:text-[var(--ink)]`,children:(0,B.jsx)(sf,{className:`size-4`})}),(0,B.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,B.jsx)(`h1`,{className:`truncate text-base font-medium text-[var(--ink)]`,children:e})}),t&&(0,B.jsxs)(`span`,{className:Y(`inline-flex max-w-[44vw] items-center gap-1.5 rounded-full border px-2 py-1 text-xs font-medium`,vE[n]),children:[n===`working`||n===`reconnecting`?(0,B.jsx)(wf,{className:`size-3.5 shrink-0 animate-spin`}):(0,B.jsx)(`span`,{className:`size-2 shrink-0 rounded-full`,style:{background:n===`live`?`var(--success)`:n===`needs-you`?`var(--warning)`:n===`offline`?`var(--destructive)`:`var(--dim)`}}),(0,B.jsx)(`span`,{className:`truncate`,children:t})]}),(0,B.jsx)(`button`,{type:`button`,onClick:i,"aria-label":`More thread actions`,className:`flex size-8 shrink-0 items-center justify-center rounded-full border border-border bg-transparent text-[var(--ink2)] transition-colors hover:text-[var(--ink)]`,children:(0,B.jsx)(_f,{className:`size-4`})})]})}var bE=[`off`,`minimal`,`low`,`medium`,`high`,`xhigh`];function xE({open:e,screen:t,onClose:n}){let[r,i]=(0,v.useState)(t.store.state?.thinkingLevel??`medium`);return(0,v.useEffect)(()=>{i(t.store.state?.thinkingLevel??`medium`)},[t.store.state?.thinkingLevel]),(0,v.useEffect)(()=>{if(!e)return;let t=e=>{e.key===`Escape`&&n()};return window.addEventListener(`keydown`,t),()=>window.removeEventListener(`keydown`,t)},[e,n]),e?(0,B.jsx)(`div`,{role:`dialog`,"aria-modal":`true`,"aria-label":`Thread actions`,className:`fixed inset-0 z-50 flex items-end bg-black/45 backdrop-blur-[2px]`,onMouseDown:e=>{e.target===e.currentTarget&&n()},children:(0,B.jsxs)(`section`,{className:`max-h-[88vh] w-full overflow-auto rounded-t-3xl border-t border-border bg-[var(--panel)] shadow-2xl shadow-black/40`,children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-3 border-b border-border px-4 py-3`,children:[(0,B.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,B.jsx)(`p`,{className:`instlabel`,children:`Thread actions`}),(0,B.jsx)(`p`,{className:`truncate text-sm text-[var(--ink)]`,children:t.detail?.name?.trim()||`Thread`})]}),(0,B.jsx)(`button`,{type:`button`,onClick:n,"aria-label":`Close thread actions`,className:`flex size-8 items-center justify-center rounded-full border border-border bg-transparent text-[var(--ink2)] transition-colors hover:text-[var(--ink)]`,children:(0,B.jsx)(Pf,{className:`size-4`})})]}),(0,B.jsxs)(`div`,{className:`flex flex-col gap-4 px-4 pt-4 pb-[max(1rem,env(safe-area-inset-bottom))]`,children:[(0,B.jsxs)(`section`,{className:`space-y-3`,children:[(0,B.jsx)(`p`,{className:`instlabel`,children:`Control`}),(0,B.jsx)(`div`,{className:`flex flex-wrap items-center gap-2`,children:(0,B.jsx)(Lh,{store:t.store})})]}),(0,B.jsxs)(`section`,{className:`space-y-3`,children:[(0,B.jsx)(`p`,{className:`instlabel`,children:`Session`}),(0,B.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,B.jsx)(Z,{type:`button`,variant:`secondary`,size:`sm`,onClick:()=>t.store.cycleModel(),disabled:!t.canDrive,children:`Cycle model`}),(0,B.jsx)(Z,{type:`button`,variant:`secondary`,size:`sm`,onClick:()=>t.store.compact(),disabled:!t.canDrive,children:`Compact`}),(0,B.jsx)(Z,{type:`button`,variant:`destructive`,size:`sm`,onClick:()=>void t.doClose(),children:`Close node`}),t.dormant&&(0,B.jsx)(Z,{type:`button`,size:`sm`,onClick:()=>void t.doRevive(),disabled:t.reviving,children:t.reviving?`Reviving…`:`Revive`})]}),(0,B.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,B.jsx)(`span`,{className:`instlabel`,children:`Thinking`}),(0,B.jsxs)(Lp,{value:r,onValueChange:e=>{let n=e;i(n),t.store.setThinkingLevel(n)},disabled:!t.canDrive,children:[(0,B.jsx)(zp,{size:`sm`,className:`min-w-36 text-sm`,children:(0,B.jsx)(Rp,{placeholder:`Thinking`})}),(0,B.jsx)(Bp,{children:bE.map(e=>(0,B.jsx)(Vp,{value:e,children:e},e))})]})]})]}),(0,B.jsxs)(`section`,{className:`space-y-2`,children:[(0,B.jsx)(`p`,{className:`instlabel`,children:`Context`}),(0,B.jsx)(`div`,{className:`overflow-hidden rounded-2xl border border-border bg-[rgba(0,0,0,.12)]`,children:(0,B.jsx)(fh,{store:t.store,detail:t.detail})})]}),(0,B.jsxs)(`section`,{className:`space-y-2`,children:[(0,B.jsx)(`p`,{className:`instlabel`,children:`Instruments`}),(0,B.jsx)(`div`,{className:`panel overflow-hidden p-3`,children:(0,B.jsx)(ch,{store:t.store,detail:t.detail})})]})]})]})}):null}function SE({id:e}){let t=ut(),n=P_(e),{nodes:r}=Sp(),[i,a]=(0,v.useState)(!1),[o,s]=(0,v.useState)({height:0,keyboardHeight:0,keyboardOpen:!1}),c=(0,v.useCallback)(e=>{s(t=>t.height===e.height&&t.keyboardHeight===e.keyboardHeight&&t.keyboardOpen===e.keyboardOpen?t:e)},[]),l=(0,v.useMemo)(()=>Km(r),[r]),u=(0,v.useMemo)(()=>Sh(r,e).thisGraph[0]?.node.node_id??e,[e,r]),d=(0,v.useMemo)(()=>l.find(e=>e.id===u)??null,[l,u]),f=n.detail?.name?.trim()||n.detail?.kind?.trim()||`Conversation`,{label:p,tone:m}=(0,v.useMemo)(()=>CE(n,d),[d,n]),h=n.store.messages.length===0,g=wE(n,d),_=(0,v.useMemo)(()=>({peekedPath:n.peekedPath,onPeek:n.setPeekedPath}),[n.peekedPath,n.setPeekedPath]);return(0,B.jsx)(oT.Provider,{value:_,children:(0,B.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col overflow-hidden`,children:[(0,B.jsx)(yE,{title:f,statusLabel:p,statusTone:m,onBack:()=>t(`/`),onOpenOverflow:()=>a(!0)}),n.actionError&&(0,B.jsx)(`div`,{className:`border-b border-destructive/30 bg-destructive/10 px-4 py-2 text-sm text-destructive`,children:n.actionError}),n.store.error&&!n.actionError&&(0,B.jsx)(`div`,{className:`border-b border-warning/30 bg-warning/10 px-4 py-2 text-sm text-warning`,children:n.store.error.message}),(0,B.jsx)(ZT,{conversationId:u}),(0,B.jsxs)(`main`,{className:`relative flex min-h-0 flex-1 flex-col overflow-hidden`,children:[(0,B.jsx)(YT,{messages:n.store.messages,partialToolResults:n.store.partialToolResults,executingToolIds:n.store.executingToolIds,queued:n.store.queued,streaming:n.streaming,bottomInsetPx:o.keyboardHeight,keyboardOpen:o.keyboardOpen,composerHeightPx:o.height}),h&&(0,B.jsx)(`div`,{className:`pointer-events-none absolute inset-0 flex items-center justify-center px-8 text-center text-sm text-muted-foreground`,children:(0,B.jsxs)(`div`,{className:`max-w-sm space-y-2 rounded-2xl border border-border bg-[rgba(0,0,0,.14)] px-4 py-3 shadow-lg shadow-black/20`,children:[(0,B.jsx)(`p`,{className:`font-medium text-[var(--ink)]`,children:g}),(0,B.jsx)(`p`,{children:n.store.serverConnected?`Waiting for the thread to load…`:`Drafts stay local while the broker reconnects.`})]})})]}),(0,B.jsx)(_E,{screen:n,onMetricsChange:c}),(0,B.jsx)(z_,{store:n.store}),(0,B.jsx)(xE,{open:i,screen:n,onClose:()=>a(!1)}),n.peekedPath&&(0,B.jsx)(`div`,{className:`fixed inset-0 z-40 flex justify-end bg-black/45 backdrop-blur-[2px]`,onMouseDown:e=>{e.target===e.currentTarget&&n.setPeekedPath(null)},children:(0,B.jsx)(eE,{nodeId:e,path:n.peekedPath,onClose:()=>n.setPeekedPath(null),className:`w-full max-w-[100vw]`})})]})})}function CE(e,t){if(e.store.brokerStatus===`down`)return{label:`Offline`,tone:`offline`};if(e.store.brokerStatus===`reconnecting`)return{label:`Reconnecting…`,tone:`reconnecting`};if(e.streaming)return{label:`Working…`,tone:`working`};if(e.store.source===`static`){if(!t)return{label:`Cached`,tone:`idle`};switch(t.state){case`needs-you`:return{label:`Needs you`,tone:`needs-you`};case`active`:return{label:`Active`,tone:`live`};case`idle`:return{label:`Idle`,tone:`idle`};case`done`:return{label:`Done`,tone:`done`}}}return{label:`Live`,tone:`live`}}function wE(e,t){return e.store.brokerStatus===`down`?`Couldn’t reach your thread yet — retrying quietly.`:e.store.brokerStatus===`reconnecting`?`Reconnecting to your thread…`:e.store.source===`static`?t?.state===`needs-you`?`Cached thread — waiting for your reply.`:`Cached thread — connecting to the live broker.`:`Loading conversation…`}function TE(){let{decks:e,loading:t}=am();return(0,B.jsxs)(`div`,{className:`mx-auto flex h-full min-h-0 max-w-3xl flex-col px-6 py-8`,children:[(0,B.jsxs)(`div`,{className:`mb-6 flex items-center gap-3`,children:[(0,B.jsx)(`h1`,{className:`text-3xl`,style:{fontWeight:460,letterSpacing:`-0.01em`,color:`var(--ink)`},children:`Inbox`}),e.length>0&&(0,B.jsx)(`span`,{className:`font-inst text-xs`,style:{fontWeight:600,color:`#ff8260`,background:`var(--blk-dim)`,border:`1px solid rgba(255,94,54,.35)`,padding:`1.5px 7px`,borderRadius:`99px`},children:e.length})]}),(0,B.jsx)(`div`,{className:`min-h-0 flex-1 overflow-auto`,children:t?(0,B.jsx)(kE,{}):e.length===0?(0,B.jsx)(OE,{}):(0,B.jsx)(`ul`,{className:`flex flex-col gap-2.5`,children:e.map(e=>(0,B.jsx)(EE,{deck:e},e.id))})})]})}function EE({deck:e}){let t=ut(),n=cm(e.kind),r=n.icon;return(0,B.jsx)(`li`,{className:`list-none`,children:(0,B.jsxs)(`button`,{type:`button`,onClick:()=>t(`/inbox/${encodeURIComponent(e.job_id)}`),className:`panel flex w-full items-start gap-4 px-4 py-3.5 text-left transition-colors hover:bg-[color-mix(in_oklch,var(--ink)_3%,transparent)] focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring`,children:[(0,B.jsx)(`span`,{className:`mt-0.5 inline-flex size-9 shrink-0 items-center justify-center rounded-lg`,style:{border:`1px solid var(--line)`,color:`var(--ink2)`,background:`color-mix(in oklch, var(--ink) 4%, transparent)`},title:n.label,children:(0,B.jsx)(r,{className:`size-4.5`})}),(0,B.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[(0,B.jsx)(`span`,{className:`truncate text-sm`,style:{fontWeight:500,color:`var(--ink)`},children:e.title}),(0,B.jsx)(`span`,{className:`instlabel shrink-0`,children:n.label})]}),e.subtitle&&(0,B.jsx)(`p`,{className:`mt-0.5 truncate text-sm`,style:{color:`var(--mut)`},children:e.subtitle}),(0,B.jsx)(DE,{deck:e,className:`mt-1.5`})]}),(0,B.jsx)(`span`,{className:`font-inst shrink-0 text-xs`,style:{letterSpacing:`0.08em`,color:`var(--mut)`},title:`waiting ${lm(e.blocked_since)}`,children:lm(e.blocked_since)})]})})}function DE({deck:e,className:t}){return(0,B.jsxs)(`div`,{className:Y(`flex flex-wrap items-center gap-x-2 gap-y-0.5 text-xs`,t),children:[(0,B.jsxs)(`span`,{className:`text-muted-foreground`,children:[`in `,(0,B.jsx)(`span`,{className:`font-medium text-foreground/80`,children:e.conversation_title})]}),(0,B.jsx)(`span`,{className:`text-muted-foreground/40`,children:`·`}),(0,B.jsxs)(An,{to:`/nodes/${encodeURIComponent(e.asking_node_id)}`,onClick:e=>e.stopPropagation(),className:`font-mono text-muted-foreground hover:text-primary hover:underline`,title:e.cwd,children:[e.asking_node_name,` (`,e.asking_node_id,`)`]}),(0,B.jsx)(`span`,{className:`text-muted-foreground/40`,children:`·`}),(0,B.jsx)(`span`,{className:`font-mono text-muted-foreground/60`,title:e.cwd,children:e.cwd})]})}function OE(){return(0,B.jsxs)(`div`,{className:`flex h-full flex-col items-center justify-center py-16 text-center`,children:[(0,B.jsx)(`p`,{className:`text-2xl`,style:{fontStyle:`italic`,color:`var(--ink)`},children:`You're all caught up.`}),(0,B.jsx)(`p`,{className:`mt-1.5 text-sm`,style:{color:`var(--mut)`},children:`Nothing needs your input right now.`})]})}function kE(){return(0,B.jsx)(`ul`,{className:`flex flex-col gap-2.5`,children:[0,1,2].map(e=>(0,B.jsxs)(`li`,{className:`panel flex items-center gap-4 px-4 py-3.5`,children:[(0,B.jsx)(`div`,{className:`size-9 shrink-0 animate-pulse rounded-lg bg-muted`}),(0,B.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-2`,children:[(0,B.jsx)(`div`,{className:`h-4 w-1/3 animate-pulse rounded-none bg-muted`}),(0,B.jsx)(`div`,{className:`h-3 w-2/3 animate-pulse rounded-none bg-muted/70`})]})]},e))})}function AE({deckId:e}){let t=ut(),[n,r]=(0,v.useState)(null),[i,a]=(0,v.useState)(!0),[o,s]=(0,v.useState)(null),[c,l]=(0,v.useState)({}),[u,d]=(0,v.useState)(!1),[f,p]=(0,v.useState)(0);(0,v.useEffect)(()=>{let n=!1;return r(null),l({}),s(null),d(!1),a(!0),tm(e).then(e=>{n||(r(e),l(Object.fromEntries(e.interactions.map(e=>[e.id,{id:e.id}]))),a(!1))}).catch(e=>{if(!n){if(qp(e)){fm(e instanceof Uf?e.message:`That request was already handled.`),t(`/inbox`,{replace:!0});return}s(e instanceof Error?e:Error(`Failed to load deck.`)),a(!1)}}),()=>{n=!0}},[e,t,f]);let m=(e,t)=>l(n=>({...n,[e]:{...n[e],id:e,...t}}));if(i)return(0,B.jsx)(UE,{});if(o)return(0,B.jsx)(jE,{error:o,onRetry:()=>p(e=>e+1),onBack:()=>t(`/inbox`)});if(!n)return(0,B.jsx)(UE,{});let h=async e=>{if(u)return;d(!0);let r=Object.values(e??c).map(({selectedOptionId:e,...t})=>t);try{await nm(n.job_id,{responses:r}),fm(`Done — thanks!`,`success`),t(`/inbox`,{replace:!0})}catch(e){if(qp(e)){fm(e instanceof Uf?e.message:`That request was already handled.`),t(`/inbox`,{replace:!0});return}fm(e instanceof Uf?e.message:`Something went wrong — try again.`),d(!1)}},g=n.interactions.length===1?n.interactions[0]:null,_=cm(n.kind).icon;return(0,B.jsxs)(`div`,{className:`mx-auto flex h-full min-h-0 max-w-2xl flex-col px-6 py-8`,children:[(0,B.jsxs)(`button`,{type:`button`,onClick:()=>t(`/inbox`),className:`mb-4 inline-flex items-center gap-1.5 text-sm text-muted-foreground hover:text-foreground`,children:[(0,B.jsx)(tf,{className:`size-4`}),` Inbox`]}),(0,B.jsxs)(`header`,{className:`mb-5 flex items-start gap-3`,children:[(0,B.jsx)(`span`,{className:`mt-0.5 inline-flex size-10 shrink-0 items-center justify-center rounded-lg`,style:{border:`1px solid var(--line)`,color:`var(--ink2)`,background:`color-mix(in oklch, var(--ink) 4%, transparent)`},children:(0,B.jsx)(_,{className:`size-5`})}),(0,B.jsxs)(`div`,{className:`min-w-0`,children:[(0,B.jsx)(`h1`,{className:`text-2xl`,style:{fontWeight:460,letterSpacing:`-0.01em`,color:`var(--ink)`},children:n.title}),n.subtitle&&(0,B.jsx)(`p`,{className:`mt-0.5 text-sm`,style:{color:`var(--mut)`},children:n.subtitle}),(0,B.jsx)(DE,{deck:n,className:`mt-2`})]})]}),(0,B.jsx)(`div`,{className:`min-h-0 flex-1 overflow-auto`,children:(0,B.jsx)(`div`,{className:`flex flex-col gap-6`,children:n.interactions.map(e=>(0,B.jsx)(PE,{interaction:e,answer:c[e.id]??{id:e.id},onChange:t=>m(e.id,t),conversationId:n.conversation_id,busy:u,onResolveWith:g?t=>void h({[e.id]:t}):void 0},e.id))})}),!ME(g)&&(0,B.jsxs)(`footer`,{className:`mt-6 flex shrink-0 items-center justify-end gap-2 border-t border-border pt-4`,children:[(0,B.jsx)(Z,{variant:`ghost`,onClick:()=>t(`/inbox`),disabled:u,children:`Cancel`}),(0,B.jsx)(Z,{onClick:()=>void h(),disabled:u||!NE(n,c),children:u?`Sending…`:`Submit`})]})]})}function jE({error:e,onRetry:t,onBack:n}){return(0,B.jsx)(`div`,{className:`mx-auto flex h-full min-h-0 max-w-2xl flex-col justify-center px-6 py-8`,children:(0,B.jsxs)(`section`,{className:`panel p-5`,children:[(0,B.jsx)(`h1`,{className:`text-lg font-semibold`,children:`Couldn’t load the deck`}),(0,B.jsx)(`p`,{className:`mt-2 text-sm text-muted-foreground`,children:e.message}),(0,B.jsxs)(`div`,{className:`mt-4 flex gap-2`,children:[(0,B.jsx)(Z,{onClick:t,children:`Retry`}),(0,B.jsx)(Z,{variant:`ghost`,onClick:n,children:`Back to inbox`})]})]})})}function ME(e){return e!==null&&(e.kind===`notify`||e.kind===`validation`)}function NE(e,t){return e.interactions.every(e=>{let n=t[e.id];if(!n)return!1;if(e.kind===`notify`||e.kind===`error`)return!0;let r=!!n.selectedOptionIds?.length||!!n.freetext?.trim();return e.options.length===0&&!e.allowFreetext||r})}function PE({interaction:e,answer:t,onChange:n,conversationId:r,busy:i,onResolveWith:a}){switch(e.kind){case`notify`:return(0,B.jsx)(RE,{interaction:e,onGotIt:()=>a?.({id:e.id}),direct:!!a});case`validation`:return(0,B.jsx)(zE,{interaction:e,answer:t,onChange:n,busy:i,onResolveWith:a});case`context`:return(0,B.jsx)(VE,{interaction:e,answer:t,onChange:n});case`error`:return(0,B.jsx)(HE,{interaction:e,answer:t,onChange:n,conversationId:r});default:return(0,B.jsx)(BE,{interaction:e,answer:t,onChange:n})}}function FE({body:e}){return e?(0,B.jsx)(`div`,{className:`prose prose-sm max-w-none text-sm text-foreground/85 dark:prose-invert`,dangerouslySetInnerHTML:{__html:Nw(zw(e))}}):null}function IE({children:e,className:t}){return(0,B.jsx)(`section`,{className:Y(`panel p-5`,t),children:e})}function LE({it:e}){return(0,B.jsxs)(`div`,{className:`mb-3`,children:[(0,B.jsx)(`h2`,{className:`text-base font-semibold`,children:e.title}),e.subtitle&&(0,B.jsx)(`p`,{className:`mt-0.5 text-sm text-muted-foreground`,children:e.subtitle})]})}function RE({interaction:e,onGotIt:t,direct:n}){return(0,B.jsxs)(IE,{children:[(0,B.jsx)(LE,{it:e}),(0,B.jsx)(FE,{body:e.body}),n&&(0,B.jsx)(`div`,{className:`mt-4 flex justify-end`,children:(0,B.jsxs)(Z,{onClick:t,children:[(0,B.jsx)(af,{className:`mr-1.5 size-4`}),` Got it`]})})]})}function zE({interaction:e,answer:t,onChange:n,busy:r,onResolveWith:i}){let a=e.options.find(e=>e.id===`yes`)??e.options[0],o=e.options.find(e=>e.id===`no`)??e.options[1],s=r=>{let a={...t,id:e.id,selectedOptionIds:[r]};i?i(a):n({selectedOptionIds:[r],selectedOptionId:void 0})};return(0,B.jsxs)(IE,{children:[(0,B.jsx)(LE,{it:e}),(0,B.jsx)(FE,{body:e.body}),(0,B.jsxs)(`div`,{className:`mt-4 flex flex-col gap-3`,children:[(0,B.jsx)(Wp,{rows:2,value:t.freetext??``,onChange:e=>n({freetext:e.currentTarget.value}),placeholder:e.freetextLabel??`Add a comment (optional)`,className:`resize-none text-sm`}),(0,B.jsxs)(`div`,{className:`flex gap-3`,children:[(0,B.jsx)(Z,{className:`flex-1`,size:`lg`,disabled:r,onClick:()=>a&&s(a.id),children:a?.label??`Approve`}),(0,B.jsx)(Z,{className:`flex-1`,size:`lg`,variant:`outline`,disabled:r,onClick:()=>o&&s(o.id),children:o?.label??`Reject`})]}),!i&&t.selectedOptionIds?.[0]&&(0,B.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Selected: `,e.options.find(e=>e.id===t.selectedOptionIds?.[0])?.label]})]})]})}function BE({interaction:e,answer:t,onChange:n}){let r=new Set(t.selectedOptionIds??[]),i=t=>{if(e.multiSelect){let e=new Set(r);e.has(t)?e.delete(t):e.add(t),n({selectedOptionIds:[...e],selectedOptionId:void 0})}else n({selectedOptionIds:[t],selectedOptionId:void 0})};return(0,B.jsxs)(IE,{children:[(0,B.jsx)(LE,{it:e}),(0,B.jsx)(FE,{body:e.body}),(0,B.jsx)(`ul`,{className:`mt-4 flex flex-col gap-2`,children:e.options.map(t=>{let n=r.has(t.id);return(0,B.jsx)(`li`,{children:(0,B.jsxs)(`button`,{type:`button`,onClick:()=>i(t.id),className:Y(`flex w-full items-start gap-3 rounded-xl border px-4 py-3 text-left transition-colors`,n?`border-primary bg-primary/5 ring-1 ring-primary`:`border-border hover:border-primary/40 hover:bg-accent/40`),children:[(0,B.jsx)(`span`,{className:Y(`mt-0.5 flex size-4 shrink-0 items-center justify-center border`,e.multiSelect?`rounded`:`rounded-full`,n?`border-primary bg-primary text-primary-foreground`:`border-muted-foreground/40`),children:n&&(0,B.jsx)(af,{className:`size-3`})}),(0,B.jsxs)(`span`,{className:`min-w-0`,children:[(0,B.jsx)(`span`,{className:`block text-sm font-medium`,children:t.label}),t.description&&(0,B.jsx)(`span`,{className:`mt-0.5 block text-xs text-muted-foreground`,children:t.description})]})]})},t.id)})}),e.allowFreetext&&(0,B.jsx)(Wp,{rows:2,value:t.freetext??``,onChange:e=>n({freetext:e.currentTarget.value}),placeholder:e.freetextLabel??`Anything else? (optional)`,className:`mt-3 resize-none text-sm`})]})}function VE({interaction:e,answer:t,onChange:n}){let r=t.selectedOptionIds?.[0];return(0,B.jsxs)(IE,{children:[(0,B.jsx)(LE,{it:e}),e.body&&(0,B.jsxs)(`div`,{className:`mb-4 rounded-xl border border-border p-3`,style:{background:`color-mix(in oklch, var(--ink) 3%, transparent)`},children:[(0,B.jsx)(`p`,{className:`instlabel mb-1.5`,children:`Why we're asking`}),(0,B.jsx)(FE,{body:e.body})]}),e.options.length>0&&(0,B.jsx)(`ul`,{className:`mb-3 flex flex-col gap-2`,children:e.options.map(e=>(0,B.jsx)(`li`,{children:(0,B.jsx)(`button`,{type:`button`,onClick:()=>n({selectedOptionIds:[e.id],selectedOptionId:void 0}),className:Y(`flex w-full items-start gap-3 rounded-xl border px-4 py-3 text-left transition-colors`,r===e.id?`border-primary bg-primary/5 ring-1 ring-primary`:`border-border hover:border-primary/40 hover:bg-accent/40`),children:(0,B.jsxs)(`span`,{className:`min-w-0`,children:[(0,B.jsx)(`span`,{className:`block text-sm font-medium`,children:e.label}),e.description&&(0,B.jsx)(`span`,{className:`mt-0.5 block text-xs text-muted-foreground`,children:e.description})]})})},e.id))}),(e.allowFreetext||e.options.length===0)&&(0,B.jsx)(Wp,{autoFocus:!0,rows:3,value:t.freetext??``,onChange:e=>n({freetext:e.currentTarget.value}),placeholder:e.freetextLabel??`Your answer`,className:`resize-none text-sm`})]})}function HE({interaction:e,answer:t,onChange:n,conversationId:r}){let i=ut();return(0,B.jsxs)(IE,{className:`border-destructive/30`,children:[(0,B.jsx)(LE,{it:e}),(0,B.jsx)(FE,{body:e.body}),(0,B.jsxs)(`div`,{className:`mt-4 flex flex-col gap-2`,children:[e.options.map(e=>(0,B.jsx)(`button`,{type:`button`,onClick:()=>n({selectedOptionIds:[e.id],selectedOptionId:void 0}),className:Y(`flex w-full items-start gap-3 rounded-xl border px-4 py-3 text-left transition-colors`,t.selectedOptionIds?.[0]===e.id?`border-primary bg-primary/5 ring-1 ring-primary`:`border-border hover:border-primary/40 hover:bg-accent/40`),children:(0,B.jsxs)(`span`,{className:`min-w-0`,children:[(0,B.jsx)(`span`,{className:`block text-sm font-medium`,children:e.label}),e.description&&(0,B.jsx)(`span`,{className:`mt-0.5 block text-xs text-muted-foreground`,children:e.description})]})},e.id)),(0,B.jsx)(`button`,{type:`button`,onClick:()=>i(`/c/${encodeURIComponent(r)}`),className:`flex w-full items-center gap-2 rounded-xl border border-border px-4 py-3 text-left text-sm font-medium transition-colors hover:border-primary/40 hover:bg-accent/40`,children:`Take over — open the conversation`})]})]})}function UE(){return(0,B.jsxs)(`div`,{className:`mx-auto flex h-full max-w-2xl flex-col gap-5 px-6 py-8`,children:[(0,B.jsx)(`div`,{className:`h-4 w-16 animate-pulse rounded-none bg-muted`}),(0,B.jsx)(`div`,{className:`h-7 w-1/2 animate-pulse rounded-none bg-muted`}),(0,B.jsx)(`div`,{className:`h-40 w-full animate-pulse rounded-2xl bg-muted/60`})]})}var WE=`crtr-push-token-v1`,GE=`/__push-token`;async function KE(e){if(typeof caches>`u`)return;let t=await caches.open(WE);if(e===void 0||e===``){await t.delete(GE);return}await t.put(GE,new Response(e))}function qE(){let e={"content-type":`application/json`};return Bf!==void 0&&(e.authorization=`Bearer ${Bf}`),e}function JE(){return typeof window<`u`&&`serviceWorker`in navigator&&`PushManager`in window&&`Notification`in window}function YE(e){let t=(e+`=`.repeat((4-e.length%4)%4)).replace(/-/g,`+`).replace(/_/g,`/`),n=atob(t),r=new Uint8Array(n.length);for(let e=0;e<n.length;e++)r[e]=n.charCodeAt(e);return r}async function XE(){let e=await fetch(`/__crtr/push/vapid-public-key`,{headers:qE()});if(!e.ok)throw Error(`could not load the push key (${e.status})`);return(await e.json()).publicKey}async function ZE(e){let t=await fetch(`/__crtr/push/subscribe`,{method:`POST`,headers:qE(),body:JSON.stringify(e.toJSON())});if(!t.ok){let e=await t.json().catch(()=>({}));throw Error(e.error??`subscribe failed (${t.status})`)}}async function QE(){if(!JE())return`unsupported`;if(Notification.permission===`denied`)return`denied`;let e=await navigator.serviceWorker.getRegistration();return e===void 0||await e.pushManager.getSubscription()===null?`unsubscribed`:`subscribed`}async function $E(){if(!JE())throw Error(`push notifications are not supported in this browser`);if(await Notification.requestPermission()!==`granted`)throw Error(`notification permission was not granted`);let e=await navigator.serviceWorker.ready,t=await e.pushManager.getSubscription();if(t!==null){await KE(Bf);try{await ZE(t)}catch(e){throw await t.unsubscribe().catch(()=>{}),await KE(void 0).catch(()=>{}),e}return}let n=await XE(),r=await e.pushManager.subscribe({userVisibleOnly:!0,applicationServerKey:YE(n)});try{await KE(Bf)}catch(e){throw await r.unsubscribe().catch(()=>{}),e}try{await ZE(r)}catch(e){throw await r.unsubscribe().catch(()=>{}),await KE(void 0).catch(()=>{}),e}}async function eD(){if(!JE())return;let e=await navigator.serviceWorker.getRegistration();if(e===void 0)return;let t=await e.pushManager.getSubscription();if(t===null)return;let n=t.endpoint;await t.unsubscribe(),await KE(void 0).catch(()=>{});try{await fetch(`/__crtr/push/subscribe`,{method:`DELETE`,headers:qE(),body:JSON.stringify({endpoint:n})})}catch{}}function tD(){let[e,t]=(0,v.useState)(()=>JE()?`unsubscribed`:`unsupported`),[n,r]=(0,v.useState)(!1),[i,a]=(0,v.useState)(null),o=(0,v.useCallback)(()=>{QE().then(t)},[]);return(0,v.useEffect)(()=>{o()},[o]),{status:e,busy:n,error:i,enable:(0,v.useCallback)(()=>{r(!0),a(null),$E().catch(e=>a(e instanceof Error?e.message:String(e))).then(o).finally(()=>r(!1))},[o]),disable:(0,v.useCallback)(()=>{r(!0),a(null),eD().catch(e=>a(e instanceof Error?e.message:String(e))).then(o).finally(()=>r(!1))},[o])}}function nD(){let[e,t]=(0,v.useState)(()=>document.documentElement.classList.contains(`dark`));return(0,B.jsxs)(`div`,{className:`mx-auto flex h-full min-h-0 max-w-2xl flex-col gap-8 overflow-auto px-6 py-8`,children:[(0,B.jsx)(`h1`,{className:`text-3xl`,style:{fontWeight:460,letterSpacing:`-0.01em`,color:`var(--ink)`},children:`Settings`}),(0,B.jsxs)(`section`,{className:`space-y-2.5`,children:[(0,B.jsx)(`h2`,{className:`instlabel`,children:`Appearance`}),(0,B.jsxs)(`p`,{className:`text-sm`,style:{color:`var(--mut)`},children:[e?`Dark theme`:`Light theme`,` is active.`]}),(0,B.jsxs)(Z,{variant:`outline`,onClick:()=>{let e=document.documentElement,n=!e.classList.contains(`dark`);e.classList.toggle(`dark`,n),e.classList.toggle(`light`,!n),t(n)},children:[`Switch to `,e?`light`:`dark`]})]}),(0,B.jsx)(rD,{})]})}function rD(){let{status:e,busy:t,error:n,enable:r,disable:i}=tD();return(0,B.jsxs)(`section`,{className:`space-y-2.5`,children:[(0,B.jsx)(`h2`,{className:`instlabel`,children:`Notifications`}),e===`unsupported`&&(0,B.jsx)(`p`,{className:`text-sm`,style:{color:`var(--mut)`},children:`Notifications aren’t supported in this browser.`}),e===`denied`&&(0,B.jsx)(`p`,{className:`text-sm`,style:{color:`var(--mut)`},children:`Notifications off — enable them for this site in your browser/OS settings.`}),e===`unsubscribed`&&(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`p`,{className:`text-sm`,style:{color:`var(--mut)`},children:`Get a push when an agent needs you or finishes, even when this tab is closed.`}),(0,B.jsx)(Z,{variant:`outline`,onClick:r,disabled:t,children:`Enable notifications`})]}),e===`subscribed`&&(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`p`,{className:`text-sm`,style:{color:`var(--mut)`},children:`Notifications are on for this browser.`}),(0,B.jsx)(Z,{variant:`outline`,onClick:i,disabled:t,children:`Disable notifications`})]}),n!==null&&(0,B.jsx)(`p`,{className:`text-sm`,style:{color:`var(--warning)`},children:n})]})}var iD=`(max-width: 767px)`;function aD(){return typeof window<`u`&&typeof window.matchMedia==`function`&&window.matchMedia(iD).matches}function oD(){let[e,t]=(0,v.useState)(aD);return(0,v.useEffect)(()=>{if(typeof window>`u`||typeof window.matchMedia!=`function`)return;let e=window.matchMedia(iD),n=e=>t(e.matches);return t(e.matches),e.addEventListener(`change`,n),()=>e.removeEventListener(`change`,n)},[]),e}function sD(e,t,n){let r=new URLSearchParams;t!==void 0&&t!==``&&r.set(`ask`,t),n!==void 0&&n!==``&&r.set(`token`,n);let i=r.toString();return`/c/${encodeURIComponent(e)}${i===``?``:`?${i}`}`}function cD(){let{id:e}=ft();return oD()?(0,B.jsx)(SE,{id:e??``},e):(0,B.jsx)(oE,{id:e??``},e)}function lD(){let{deckId:e}=ft();return(0,B.jsx)(AE,{deckId:e??``})}function uD(){return(0,B.jsxs)(Rt,{children:[(0,B.jsx)(It,{path:`/`,element:(0,B.jsx)(Xm,{})}),(0,B.jsx)(It,{path:`/canvas`,element:(0,B.jsx)(Nm,{})}),(0,B.jsx)(It,{path:`/nodes/:id`,element:(0,B.jsx)(cD,{})}),(0,B.jsx)(It,{path:`/c/:id`,element:(0,B.jsx)(cD,{})}),(0,B.jsx)(It,{path:`/inbox`,element:(0,B.jsx)(TE,{})}),(0,B.jsx)(It,{path:`/inbox/:deckId`,element:(0,B.jsx)(lD,{})}),(0,B.jsx)(It,{path:`/settings`,element:(0,B.jsx)(nD,{})}),(0,B.jsx)(It,{path:`*`,element:(0,B.jsx)(Xm,{})})]})}function dD(){let e=ut();return(0,v.useEffect)(()=>{if(!(`serviceWorker`in navigator))return;let t=t=>{let n=t.data;if(n?.type!==`crtr-deep-link`||typeof n.conversationId!=`string`)return;let r=typeof n.askId==`string`?n.askId:void 0;e(sD(n.conversationId,r,Bf))};return navigator.serviceWorker.addEventListener(`message`,t),()=>navigator.serviceWorker.removeEventListener(`message`,t)},[e]),null}function fD(){return up(e=>e.reachable)?null:(0,B.jsx)(`div`,{role:`status`,className:`fixed inset-x-0 top-0 z-50 bg-warning/90 px-4 py-1.5 text-center text-sm font-medium text-background`,children:`Reconnecting…`})}function pD(e){e(`/?new=1`)}var mD=[{id:`conversations`,label:`Conversations`,path:`/`},{id:`canvas`,label:`Canvas`,path:`/canvas`},{id:`inbox`,label:`Inbox`,path:`/inbox`},{id:`settings`,label:`Settings`,path:`/settings`}],hD={conversations:Ef,canvas:Df,inbox:xf,settings:jf};function gD({compact:e}){let t=ut();return(0,B.jsxs)(`aside`,{"aria-label":`Primary`,style:e?{width:58}:void 0,className:Y(`flex flex-none flex-col gap-0.5 py-4 [border-right:1px_solid_var(--line)] [background:linear-gradient(180deg,rgba(20,19,16,.6),rgba(20,19,16,.2))]`,e?`items-center`:`w-57 px-3`),children:[(0,B.jsxs)(An,{to:`/`,title:`crouter`,className:Y(`flex items-center no-underline [color:var(--ink)]`,e?`justify-center pt-1 pb-4`:`gap-2.5 px-2.5 pt-1 pb-4 text-base font-medium tracking-[.01em]`),children:[(0,B.jsx)(`span`,{className:`font-inst flex flex-none items-center justify-center rounded-md text-xs font-bold [background:var(--bone)] [color:var(--bone-ink)]`,style:{width:22,height:22},children:`cr`}),!e&&`crouter`]}),(0,B.jsxs)(`button`,{type:`button`,onClick:()=>pD(t),title:`New chat (⌘⇧O)`,"aria-label":`New chat`,className:Y(`flex items-center rounded-lg font-medium transition-all [color:var(--bone-ink)] [background:var(--bone)] hover:[background:var(--ink)]`,e?`mb-1 size-9 justify-center`:`mb-1.5 h-9 gap-2.5 px-3 text-sm`),children:[(0,B.jsx)(Of,{size:e?18:16,className:`flex-none`,"aria-hidden":!0}),!e&&(0,B.jsx)(`span`,{children:`New chat`})]}),mD.map(t=>{let n=hD[t.id]??Ef;return(0,B.jsxs)(jn,{to:t.path,end:t.path===`/`,title:e?t.label:void 0,className:({isActive:t})=>Y(`relative flex items-center no-underline transition-all`,e?`size-9 justify-center rounded-lg border border-transparent opacity-75`:`h-9 gap-2.5 rounded-lg border border-transparent px-3 text-sm font-medium`,t?`[color:var(--ink)] opacity-100 [background:rgba(232,228,216,.06)] [border-color:var(--line)] [box-shadow:inset_0_1px_0_var(--raise)]`:`[color:var(--ink2)] hover:opacity-100 hover:[color:var(--ink)] hover:[background:rgba(232,228,216,.04)]`),children:[(0,B.jsx)(n,{size:18,className:e?void 0:`flex-none opacity-75`,"aria-hidden":!0}),!e&&(0,B.jsx)(`span`,{children:t.label}),t.id===`inbox`&&(0,B.jsx)(_D,{compact:e})]},t.id)}),(0,B.jsx)(`div`,{className:`flex-1`})]})}function _D({compact:e}){let t=im();return t<=0?null:e?(0,B.jsx)(`span`,{className:`absolute right-[5px] top-[5px] size-2.5 rounded-full [background:var(--blk)] [box-shadow:0_0_10px_rgba(255,94,54,.55)] [animation:pulse-hot_1.6s_ease-out_infinite]`}):(0,B.jsx)(`span`,{className:`font-inst ml-auto rounded-full border px-2 py-0.5 text-xs font-semibold [color:#ff8260] [background:var(--blk-dim)] [border-color:rgba(255,94,54,.35)]`,children:t})}function vD(e,t){let n=(0,v.useRef)(e),r=(0,v.useRef)(t);n.current=e,r.current=t,(0,v.useEffect)(()=>{let e=e=>{let t=document.activeElement;t instanceof HTMLTextAreaElement||t instanceof HTMLInputElement||t instanceof HTMLElement&&t.isContentEditable||n.current(e)&&(e.preventDefault(),r.current(e))};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[])}function yD({open:e,onClose:t}){let{nodes:n}=Sp(),r=ut(),[i,a]=(0,v.useState)(``),[o,s]=(0,v.useState)(0),c=(0,v.useRef)(null),l=(0,v.useMemo)(()=>{let e=n.filter(e=>e.enterable).map(e=>({id:e.node_id,title:Rm(e),dot:Um(e),kind:e.kind,last:e.last_activity??e.created}));e.sort((e,t)=>t.last.localeCompare(e.last));let t=i.trim().toLowerCase();return t?e.filter(e=>e.title.toLowerCase().includes(t)||e.kind.toLowerCase().includes(t)):e},[n,i]);if((0,v.useEffect)(()=>{e&&(a(``),s(0),c.current?.focus())},[e]),(0,v.useEffect)(()=>{s(e=>Math.min(e,Math.max(0,l.length-1)))},[l.length]),!e)return null;let u=e=>{e&&(r(`/c/${encodeURIComponent(e.id)}`),t())};return(0,B.jsx)(`div`,{className:`fixed inset-0 z-50 flex items-start justify-center px-4 pt-24`,style:{background:`var(--scrim)`},onClick:t,children:(0,B.jsxs)(`div`,{className:`panel w-full max-w-xl overflow-hidden p-0`,onClick:e=>e.stopPropagation(),onKeyDown:e=>{e.key===`Escape`?(e.preventDefault(),t()):e.key===`ArrowDown`?(e.preventDefault(),s(e=>Math.min(e+1,l.length-1))):e.key===`ArrowUp`?(e.preventDefault(),s(e=>Math.max(e-1,0))):e.key===`Enter`&&(e.preventDefault(),u(l[o]))},children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-2 border-b px-4 py-3`,style:{borderColor:`var(--line)`},children:[(0,B.jsx)(`span`,{className:`instlabel`,style:{color:`var(--dim)`},children:`Jump to`}),(0,B.jsx)(`input`,{ref:c,value:i,onChange:e=>a(e.currentTarget.value),placeholder:`Search conversations…`,className:`flex-1 bg-transparent text-sm outline-none`,style:{color:`var(--ink)`}}),(0,B.jsx)(`span`,{className:`kbd`,children:`esc`})]}),(0,B.jsx)(`ul`,{className:`max-h-80 overflow-auto py-1`,children:l.length===0?(0,B.jsx)(`li`,{className:`px-4 py-3 text-sm italic`,style:{color:`var(--mut)`},children:`no live nodes`}):l.map((e,t)=>(0,B.jsx)(`li`,{children:(0,B.jsxs)(`button`,{type:`button`,onClick:()=>u(e),onMouseEnter:()=>s(t),className:Y(`flex w-full items-center gap-2.5 px-4 py-2 text-left transition-colors`,t===o&&`bg-[color-mix(in_oklch,var(--ink)_6%,transparent)]`),children:[(0,B.jsx)(`span`,{className:Y(`dot shrink-0`,e.dot)}),(0,B.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-sm`,style:{color:`var(--ink)`},children:e.title}),(0,B.jsx)(`span`,{className:`font-inst shrink-0 text-xs`,style:{letterSpacing:`0.04em`,color:`var(--mut)`},children:e.kind})]})},e.id))})]})})}var bD=/^\/(nodes|c)\//;function xD({children:e}){let t=st(),n=ut(),[r,i]=(0,v.useState)(!1);return vD((0,v.useCallback)(e=>(e.metaKey||e.ctrlKey)&&e.shiftKey&&!e.altKey&&e.code===`KeyO`,[]),(0,v.useCallback)(()=>pD(n),[n])),vD((0,v.useCallback)(e=>(e.metaKey||e.ctrlKey)&&!e.shiftKey&&!e.altKey&&e.code===`KeyK`,[]),(0,v.useCallback)(()=>i(e=>!e),[])),(0,B.jsxs)(`div`,{className:`flex h-full min-h-0`,children:[(0,B.jsx)(gD,{compact:bD.test(t.pathname)}),(0,B.jsx)(`main`,{className:`min-h-0 flex-1 overflow-hidden`,children:e}),(0,B.jsx)(yD,{open:r,onClose:()=>i(!1)})]})}var SD=/^\/(?:c|nodes)\/([^/]+)\/?$/;function CD(e){let t=SD.exec(e);if(!t)return null;let n=t[1];return n===void 0?null:decodeURIComponent(n)}var wD=[{id:`home`,label:`Home`,path:`/`,icon:bf},{id:`inbox`,label:`Inbox`,path:`/inbox`,icon:xf}];function TD(){let e=ut();return(0,B.jsxs)(`nav`,{"aria-label":`Primary`,className:`mobile-bottom-nav flex flex-none items-stretch gap-1 border-t px-2 pt-1 [border-color:var(--line)] [background:var(--panel)]`,children:[wD.map(e=>(0,B.jsxs)(jn,{to:e.path,end:e.path===`/`,className:({isActive:e})=>Y(`relative flex flex-1 flex-col items-center gap-0.5 rounded-lg py-1.5 text-xs font-medium no-underline transition-all`,e?`[color:var(--ink)] opacity-100`:`[color:var(--ink2)] opacity-75`),children:[(0,B.jsx)(e.icon,{size:20,"aria-hidden":!0}),(0,B.jsx)(`span`,{children:e.label}),e.id===`inbox`&&(0,B.jsx)(ED,{})]},e.id)),(0,B.jsxs)(`button`,{type:`button`,onClick:()=>pD(e),"aria-label":`New chat`,className:`flex flex-1 flex-col items-center gap-0.5 rounded-lg py-1.5 text-xs font-medium [color:var(--ink2)]`,children:[(0,B.jsx)(`span`,{className:`flex size-7 items-center justify-center rounded-full [background:var(--bone)] [color:var(--bone-ink)]`,children:(0,B.jsx)(Of,{size:18,"aria-hidden":!0})}),(0,B.jsx)(`span`,{children:`New`})]})]})}function ED(){let e=im();return e<=0?null:(0,B.jsx)(`span`,{className:`font-inst absolute right-2 top-0 min-w-4 rounded-full border px-1 text-center text-xs font-semibold [color:#ff8260] [background:var(--blk-dim)] [border-color:rgba(255,94,54,.35)]`,children:e})}function DD(){return typeof window>`u`?!1:window.matchMedia?.(`(display-mode: standalone)`).matches===!0||window.navigator.standalone===!0}function OD(){let[e,t]=(0,v.useState)(null),[n,r]=(0,v.useState)(DD);(0,v.useEffect)(()=>{let e=e=>{e.preventDefault(),t(e)},n=()=>{r(!0),t(null)};return window.addEventListener(`beforeinstallprompt`,e),window.addEventListener(`appinstalled`,n),()=>{window.removeEventListener(`beforeinstallprompt`,e),window.removeEventListener(`appinstalled`,n)}},[]);let i=(0,v.useCallback)(async()=>{e!==null&&(await e.prompt(),await e.userChoice,t(null))},[e]);return{canInstall:e!==null&&!n,promptInstall:i}}function kD(){let{canInstall:e,promptInstall:t}=OD(),[n,r]=(0,v.useState)(!1);return!e||n?null:(0,B.jsxs)(`div`,{className:`flex flex-none items-center gap-3 border-t px-3 py-2 text-sm [border-color:var(--line)] [background:var(--panel)] [color:var(--ink)]`,children:[(0,B.jsx)(`span`,{className:`flex-1`,children:`Install crouter for quick, full-screen access.`}),(0,B.jsxs)(`button`,{type:`button`,onClick:()=>void t(),className:`flex items-center gap-1 rounded-md px-2 py-1 text-xs font-semibold [background:var(--bone)] [color:var(--bone-ink)]`,children:[(0,B.jsx)(gf,{size:14,"aria-hidden":!0}),`Install`]}),(0,B.jsx)(`button`,{type:`button`,onClick:()=>r(!0),"aria-label":`Dismiss install prompt`,className:`[color:var(--ink2)]`,children:(0,B.jsx)(Pf,{size:14,"aria-hidden":!0})})]})}function AD(e){let t=(0,v.useSyncExternalStore)(h_.subscribe,h_.getWarmIds),{nodes:n}=Sp();return(0,v.useMemo)(()=>{let r=t.includes(e)?t:[...t,e],i=new Map(n.map(e=>[e.node_id,e]));return r.map(e=>{let t=i.get(e);return{nodeId:e,title:t?Rm(t):e,dot:t?Um(t):`idle`}})},[t,n,e])}function jD(e,t,n){let r=e.findIndex(e=>e.nodeId===t);return r===-1?null:e[n===`next`?r+1:r-1]?.nodeId??null}function MD(e,t){let n=e.findIndex(e=>e.nodeId===t);if(n===-1)return null;let r=e[n+1];if(r)return r.nodeId;let i=e[n-1];return i?i.nodeId:null}var ND=48,PD=1.5,FD=24;function ID(e){if(e.scrolled||e.startX<FD)return null;let t=e.endX-e.startX,n=e.endY-e.startY;return Math.abs(t)<ND||Math.abs(t)<Math.abs(n)*PD?null:t<0?`next`:`prev`}function LD(e,t){return t>-48?!1:Math.abs(t)>=Math.abs(e)*PD}function RD({open:e,activeId:t,onClose:n}){let r=ut(),{nodes:i}=Sp(),a=im(),[o,s]=(0,v.useState)(``),c=(0,v.useMemo)(()=>Km(i),[i]),l=(0,v.useMemo)(()=>{let e=o.trim().toLowerCase();return e?c.filter(t=>t.title.toLowerCase().includes(e)):c},[c,o]);if((0,v.useEffect)(()=>{e&&s(``)},[e]),(0,v.useEffect)(()=>{if(!e)return;let t=e=>{e.key===`Escape`&&n()};return window.addEventListener(`keydown`,t),()=>window.removeEventListener(`keydown`,t)},[e,n]),!e)return null;let u=e=>{r(e),n()};return(0,B.jsx)(`div`,{role:`dialog`,"aria-modal":`true`,"aria-label":`Switch conversation`,className:`fixed inset-0 z-50 flex items-end bg-black/45 backdrop-blur-[2px]`,onMouseDown:e=>{e.target===e.currentTarget&&n()},children:(0,B.jsxs)(`section`,{className:`flex max-h-[88vh] w-full flex-col overflow-hidden rounded-t-3xl border-t border-border bg-[var(--panel)] shadow-2xl shadow-black/40`,children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-3 border-b border-border px-4 py-3`,children:[(0,B.jsx)(`p`,{className:`instlabel flex-1`,children:`Conversations`}),(0,B.jsx)(`button`,{type:`button`,onClick:n,"aria-label":`Close switcher`,className:`flex size-8 shrink-0 items-center justify-center rounded-full border border-border bg-transparent text-[var(--ink2)] transition-colors hover:text-[var(--ink)]`,children:(0,B.jsx)(Pf,{className:`size-4`})})]}),(0,B.jsx)(`div`,{className:`border-b border-border px-4 py-2`,children:(0,B.jsx)(`input`,{value:o,onChange:e=>s(e.currentTarget.value),placeholder:`Search conversations\\u2026`,className:`w-full bg-transparent text-sm outline-none [color:var(--ink)] placeholder:[color:var(--dim)]`})}),(0,B.jsxs)(`ul`,{className:`min-h-0 flex-none overflow-auto border-b border-border py-1`,children:[(0,B.jsx)(`li`,{children:(0,B.jsxs)(`button`,{type:`button`,onClick:()=>u(`/`),className:`flex w-full items-center gap-2.5 px-4 py-2.5 text-left transition-colors hover:bg-[color-mix(in_oklch,var(--ink)_6%,transparent)]`,children:[(0,B.jsx)(bf,{className:`size-4 shrink-0 [color:var(--ink2)]`,"aria-hidden":!0}),(0,B.jsx)(`span`,{className:`text-sm [color:var(--ink)]`,children:`Home`})]})}),(0,B.jsx)(`li`,{children:(0,B.jsxs)(`button`,{type:`button`,onClick:()=>u(`/inbox`),className:`flex w-full items-center gap-2.5 px-4 py-2.5 text-left transition-colors hover:bg-[color-mix(in_oklch,var(--ink)_6%,transparent)]`,children:[(0,B.jsx)(xf,{className:`size-4 shrink-0 [color:var(--ink2)]`,"aria-hidden":!0}),(0,B.jsx)(`span`,{className:`flex-1 text-sm [color:var(--ink)]`,children:`Inbox`}),a>0&&(0,B.jsx)(`span`,{className:`font-inst rounded-full border px-1.5 text-xs font-semibold [color:#ff8260] [background:var(--blk-dim)] [border-color:rgba(255,94,54,.35)]`,children:a})]})})]}),(0,B.jsx)(`ul`,{className:`min-h-0 flex-1 overflow-auto py-1 pb-[max(0.5rem,env(safe-area-inset-bottom))]`,children:l.length===0?(0,B.jsx)(`li`,{className:`px-4 py-3 text-sm italic [color:var(--mut)]`,children:`no conversations`}):l.map(e=>(0,B.jsx)(`li`,{children:(0,B.jsxs)(`button`,{type:`button`,onClick:()=>u(`/c/${encodeURIComponent(e.id)}`),className:Y(`flex w-full items-center gap-2.5 px-4 py-2.5 text-left transition-colors hover:bg-[color-mix(in_oklch,var(--ink)_6%,transparent)]`,e.id===t&&`bg-[color-mix(in_oklch,var(--ink)_6%,transparent)]`),children:[(0,B.jsx)(`span`,{className:Y(`dot shrink-0`,e.state===`needs-you`?`blocked`:e.state),"aria-hidden":!0}),(0,B.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,B.jsx)(`span`,{className:`block truncate text-sm [color:var(--ink)]`,children:e.title}),(0,B.jsx)(`span`,{className:`block truncate text-xs [color:var(--mut)]`,children:qm(e)})]})]})},e.id))})]})})}var zD=4;function BD({activeId:e}){let t=ut(),n=AD(e),[r,i]=(0,v.useState)(!1),[a,o]=(0,v.useState)(null),s=(0,v.useRef)(null),c=(0,v.useRef)(null),l=n=>{n!==e&&t(`/c/${encodeURIComponent(n)}`)},u=r=>{if(o(null),r===e){let e=MD(n,r);t(e?`/c/${encodeURIComponent(e)}`:`/`)}h_.evict(r)};return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`nav`,{"aria-label":`Panes`,className:`mobile-pane-bar flex flex-none items-stretch gap-1.5 border-t px-2 pt-1.5 [border-color:var(--line)] [background:var(--panel)]`,onTouchStart:e=>{let t=e.touches[0];t&&(c.current={x:t.clientX,y:t.clientY,scrollLeft:s.current?.scrollLeft??0})},onTouchEnd:r=>{let i=c.current;if(c.current=null,!i)return;let a=r.changedTouches[0];if(!a)return;let o=Math.abs((s.current?.scrollLeft??0)-i.scrollLeft)>zD,l=ID({startX:i.x,startY:i.y,endX:a.clientX,endY:a.clientY,scrolled:o});if(!l)return;let u=jD(n,e,l);u&&t(`/c/${encodeURIComponent(u)}`)},children:[(0,B.jsx)(`button`,{type:`button`,onClick:()=>i(!0),"aria-label":`Switch conversation`,className:`flex size-9 shrink-0 items-center justify-center self-center rounded-full border border-border bg-transparent text-[var(--ink2)] transition-colors hover:text-[var(--ink)]`,children:(0,B.jsx)(Cf,{className:`size-4`,"aria-hidden":!0})}),(0,B.jsx)(`div`,{ref:s,className:`flex min-w-0 flex-1 items-center gap-1.5 overflow-x-auto pb-1.5`,children:n.map(t=>(0,B.jsx)(UD,{entry:t,active:t.nodeId===e,revealed:a===t.nodeId,onReveal:()=>o(t.nodeId),onDismissReveal:()=>o(null),onSelect:()=>l(t.nodeId),onClose:()=>u(t.nodeId)},t.nodeId))}),(0,B.jsx)(`button`,{type:`button`,onClick:()=>pD(t),"aria-label":`New chat`,className:`mb-1.5 flex size-9 shrink-0 items-center justify-center self-center rounded-full [background:var(--bone)] [color:var(--bone-ink)]`,children:(0,B.jsx)(Of,{className:`size-4`,"aria-hidden":!0})})]}),(0,B.jsx)(RD,{open:r,activeId:e,onClose:()=>i(!1)})]})}var VD=480,HD=8;function UD({entry:e,active:t,revealed:n,onReveal:r,onDismissReveal:i,onSelect:a,onClose:o}){let s=(0,v.useRef)(null),c=(0,v.useRef)(null),l=(0,v.useRef)(!1),u=()=>{c.current&&=(clearTimeout(c.current),null)};return(0,B.jsxs)(`button`,{type:`button`,onTouchStart:e=>{let t=e.touches[0];t&&(s.current={x:t.clientX,y:t.clientY},l.current=!1,u(),c.current=setTimeout(()=>{l.current=!0,r()},VD))},onTouchMove:e=>{let t=s.current,n=e.touches[0];!t||!n||Math.hypot(n.clientX-t.x,n.clientY-t.y)>HD&&u()},onTouchEnd:e=>{u();let t=s.current;s.current=null;let n=e.changedTouches[0];if(!(!t||!n)){if(l.current){e.preventDefault();return}LD(n.clientX-t.x,n.clientY-t.y)&&(e.preventDefault(),o())}},onClick:()=>n?i():a(),"aria-label":n?`Close ${e.title}`:e.title,className:Y(`relative flex shrink-0 items-center gap-1.5 rounded-full border px-3 py-1.5 text-xs font-medium transition-colors`,t?`border-[color:var(--line2)] [background:var(--panel2)] [color:var(--ink)]`:`border-border bg-transparent [color:var(--ink2)]`),children:[(0,B.jsx)(`span`,{className:Y(`dot shrink-0`,e.dot),"aria-hidden":!0}),(0,B.jsx)(`span`,{className:`max-w-32 truncate`,children:e.title}),n&&(0,B.jsx)(`span`,{role:`button`,tabIndex:0,onClick:e=>{e.stopPropagation(),o()},"aria-label":`Close ${e.title}`,className:`ml-0.5 flex size-4 shrink-0 items-center justify-center rounded-full [background:var(--destructive)] text-white`,children:(0,B.jsx)(Pf,{className:`size-3`,"aria-hidden":!0})})]})}function WD({children:e}){let t=CD(st().pathname);return(0,B.jsxs)(`div`,{className:`mobile-shell-root flex flex-col overflow-hidden`,children:[(0,B.jsx)(`main`,{className:`min-h-0 flex-1 overflow-hidden`,children:e}),t===null?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(kD,{}),(0,B.jsx)(TD,{})]}):(0,B.jsx)(BD,{activeId:t},t)]})}function GD({children:e}){return oD()?(0,B.jsx)(WD,{children:e}):(0,B.jsx)(xD,{children:e})}var KD=`false`,qD=`false`,JD=KD===`true`,YD=qD===`true`;function XD(e={}){let{immediate:t=!1,onNeedReload:n,onNeedRefresh:r,onOfflineReady:i,onRegistered:a,onRegisteredSW:o,onRegisterError:s}=e,c,l,u,d=async(e=!0)=>{await l,JD||u?.()};async function f(){if(`serviceWorker`in navigator){if(c=await w(async()=>{let{Workbox:e}=await import(`./workbox-window.prod.es5-Bd17z0YL.js`);return{Workbox:e}},[]).then(({Workbox:e})=>new e(`/sw.js`,{scope:`/`,type:`classic`})).catch(e=>{s?.(e)}),!c)return;if(u=()=>{c?.messageSkipWaiting()},!YD)if(JD)c.addEventListener(`activated`,e=>{(e.isUpdate||e.isExternal)&&(n?n():window.location.reload())}),c.addEventListener(`installed`,e=>{e.isUpdate||i?.()});else{let e=!1,t=()=>{e=!0,c?.addEventListener(`controlling`,e=>{e.isUpdate&&(n?n():window.location.reload())}),r?.()};c.addEventListener(`installed`,n=>{n.isUpdate===void 0?n.isExternal===void 0?!e&&i?.():n.isExternal?t():!e&&i?.():n.isUpdate||i?.()}),c.addEventListener(`waiting`,t)}c.register({immediate:t}).then(e=>{o?o(`/sw.js`,e):a?.(e)}).catch(e=>{s?.(e)})}}return l=f(),d}function ZD(e={}){let{immediate:t=!0,onNeedReload:n,onNeedRefresh:r,onOfflineReady:i,onRegistered:a,onRegisteredSW:o,onRegisterError:s}=e,[c,l]=(0,v.useState)(!1),[u,d]=(0,v.useState)(!1),[f]=(0,v.useState)(()=>XD({immediate:t,onNeedReload:n,onOfflineReady(){d(!0),i?.()},onNeedRefresh(){l(!0),r?.()},onRegistered:a,onRegisteredSW:o,onRegisterError:s}));return{needRefresh:[c,l],offlineReady:[u,d],updateServiceWorker:f}}function QD(){let{needRefresh:[e,t],offlineReady:[n,r],updateServiceWorker:i}=ZD({onRegisterError(e){console.warn(`crtr web: service worker registration failed`,e)}});return(0,v.useEffect)(()=>{n&&(fm(`App ready to work offline`,`success`),r(!1))},[n,r]),{needRefresh:e,dismiss:()=>t(!1),refresh:()=>void i(!0)}}function $D(){let{needRefresh:e,dismiss:t,refresh:n}=QD();return e?(0,B.jsx)(`div`,{className:`pwa-update-banner px-3`,children:(0,B.jsxs)(`div`,{className:`pointer-events-auto flex items-center gap-3 rounded-lg border px-3 py-2 text-sm shadow-md [border-color:var(--line)] [background:var(--panel)] [color:var(--ink)]`,children:[(0,B.jsx)(`span`,{children:`Update ready`}),(0,B.jsxs)(`button`,{type:`button`,onClick:n,className:`flex items-center gap-1 rounded-md px-2 py-1 text-xs font-semibold [background:var(--bone)] [color:var(--bone-ink)]`,children:[(0,B.jsx)(kf,{size:14,"aria-hidden":!0}),`Refresh`]}),(0,B.jsx)(`button`,{type:`button`,onClick:t,"aria-label":`Dismiss update prompt`,className:`[color:var(--ink2)]`,children:(0,B.jsx)(Pf,{size:14,"aria-hidden":!0})})]})}):null}function eO(){let e=dm(e=>e.toasts),t=dm(e=>e.dismiss);return e.length===0?null:(0,B.jsx)(`div`,{className:`pointer-events-none fixed inset-x-0 bottom-4 z-50 flex flex-col items-center gap-2`,children:e.map(e=>(0,B.jsx)(`button`,{type:`button`,onClick:()=>t(e.id),className:Y(`pointer-events-auto border px-4 py-2 font-mono text-sm transition-opacity`,e.tone===`success`?`border-success/40 bg-success/10 text-success`:`border-border bg-card text-foreground`),children:e.message},e.id))})}function tO(){return(0,B.jsx)(On,{children:(0,B.jsxs)(Xd,{delayDuration:300,children:[(0,B.jsx)(fD,{}),(0,B.jsx)(dD,{}),(0,B.jsx)(GD,{children:(0,B.jsx)(uD,{})}),(0,B.jsx)($D,{}),(0,B.jsx)(eO,{})]})})}document.documentElement.classList.add(`dark`),document.documentElement.classList.remove(`light`);var nO=document.getElementById(`root`);if(!nO)throw Error(`crtr web: #root element not found in index.html`);(0,b.createRoot)(nO).render((0,B.jsx)(v.StrictMode,{children:(0,B.jsx)(tO,{})}));
|
|
78
|
+
`).map(e=>{let t=e.indexOf(`:`);return t<1?null:{key:e.slice(0,t).trim(),val:e.slice(t+1).trim()}}).filter(Boolean);return(0,B.jsxs)(B.Fragment,{children:[i.length>0&&(0,B.jsx)(`div`,{className:`fm-chips`,children:i.map(({key:e,val:t})=>(0,B.jsxs)(`span`,{className:`fm-chip`,children:[e,` `,(0,B.jsx)(`b`,{children:t})]},e))}),(0,B.jsx)(`div`,{className:eE,dangerouslySetInnerHTML:{__html:Bw(r)}})]})}}return(0,B.jsx)(`div`,{className:eE,dangerouslySetInnerHTML:{__html:Bw(e)}})}var iE=[`off`,`minimal`,`low`,`medium`,`high`,`xhigh`],aE=e=>({"--i":e}),oE={borderBottom:`1px solid var(--line)`,background:`linear-gradient(180deg, rgba(33,31,25,.7), rgba(20,19,16,0))`};function sE(e){let t=ut(),{store:n,detail:r,input:i,setInput:a,reviving:o,actionError:s,peekedPath:c,setPeekedPath:l,dormant:u,brokerUp:d,isController:f,streaming:p,canDrive:m,commands:h,sendPrimary:g,onInputKeyDown:_,selectCommand:y,doRevive:b,doClose:x}=P_(e.id);return(0,v.useEffect)(()=>{let e=e=>{!e.altKey||e.metaKey||e.ctrlKey||e.code!==`KeyD`||document.activeElement instanceof HTMLTextAreaElement||(e.preventDefault(),Yw())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[]),(0,B.jsx)(sT.Provider,{value:{peekedPath:c,onPeek:l},children:(0,B.jsxs)(`div`,{className:`in flex h-full min-h-0 flex-col`,children:[(0,B.jsxs)(`div`,{className:Y(`con-head rv flex shrink-0 items-center gap-3 px-6 py-4`,u&&`opacity-80`),style:{...oE,...aE(1)},children:[(0,B.jsxs)(`button`,{type:`button`,onClick:()=>t(`/`),className:`flex shrink-0 items-center gap-1.5 text-sm text-muted-foreground transition-colors hover:text-[var(--ink)]`,children:[(0,B.jsx)(sf,{className:`size-4`}),`Conversations`]}),(0,B.jsx)(oh,{store:n,detail:r}),(0,B.jsx)(`div`,{className:`flex-1`}),(0,B.jsx)(lE,{}),(0,B.jsx)(Lh,{store:n})]}),(0,B.jsx)(`div`,{className:`rv`,style:aE(2),children:(0,B.jsx)(fh,{store:n,detail:r})}),(0,B.jsx)(dE,{state:n.brokerStatus,dormant:u}),n.error&&(0,B.jsxs)(`div`,{className:`border-b border-destructive/30 bg-destructive/15 px-4 py-2 text-sm text-destructive`,children:[n.error.code,`: `,n.error.message]}),s&&(0,B.jsx)(`div`,{className:`border-b border-destructive/30 bg-destructive/15 px-4 py-2 text-sm text-destructive`,children:s}),(0,B.jsx)(QT,{conversationId:e.id}),(0,B.jsxs)(`div`,{className:`streamwrap relative flex min-h-0 flex-1 overflow-hidden`,children:[(0,B.jsx)(Dh,{currentId:e.id,onNavigate:e=>t(`/nodes/${e}`)}),(0,B.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col`,children:[(0,B.jsx)(`main`,{className:`flex min-h-0 flex-1 flex-col overflow-hidden`,children:(0,B.jsx)(XT,{messages:n.messages,partialToolResults:n.partialToolResults,executingToolIds:n.executingToolIds,queued:n.queued,streaming:p})}),u?(0,B.jsx)(pE,{id:e.id,reviving:o,onRevive:b,onClose:x}):(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(fE,{store:n,canDrive:m,streaming:p,onClose:x}),(0,B.jsxs)(`div`,{className:`relative flex shrink-0 flex-col gap-2 border-t border-border px-4 py-3`,children:[(0,B.jsx)(I_,{commands:h,query:i,visible:i.startsWith(`/`),onSelect:y}),(0,B.jsx)(Wp,{className:`resize-none font-mono text-sm`,value:i,onChange:e=>a(e.currentTarget.value),onKeyDown:_,disabled:!m,placeholder:uE(f,d),rows:3}),(0,B.jsxs)(`div`,{className:`flex items-center justify-end gap-2`,children:[(0,B.jsx)(mE,{id:e.id}),(0,B.jsx)(Z,{variant:`default`,onClick:g,disabled:!m||!i.trim(),children:p?`Steer`:`Send`})]})]})]})]}),(0,B.jsx)(tE,{nodeId:e.id,path:c,onClose:()=>l(null)})]}),(0,B.jsx)(gh,{store:n,detail:r}),(0,B.jsx)(z_,{store:n})]})})}var cE=[{value:`focused`,label:`Focused`},{value:`standard`,label:`Standard`},{value:`verbose`,label:`Verbose`}];function lE(){let e=Zw();return(0,B.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,title:`Transcript detail — Focused / Standard / Verbose (⌥D to cycle)`,children:[(0,B.jsx)(`span`,{className:`instlabel`,children:`Detail`}),(0,B.jsxs)(Lp,{value:e,onValueChange:e=>Jw(e),children:[(0,B.jsx)(zp,{size:`sm`,className:`text-sm`,"aria-label":`Transcript detail`,children:(0,B.jsx)(Rp,{})}),(0,B.jsx)(Bp,{children:cE.map(e=>(0,B.jsx)(Vp,{value:e.value,children:e.label},e.value))})]})]})}function uE(e,t){return e?t?`Type a prompt, or / for commands…`:`broker is down — input is frozen`:`observer — request control to drive this session`}function dE({state:e,dormant:t}){return t||e!==`down`&&e!==`reconnecting`?null:(0,B.jsx)(`div`,{className:[`broker-banner border px-4 py-2 text-sm`,e===`down`?`bg-destructive/15 text-destructive border-destructive/30`:`bg-warning/15 border-warning/30`].join(` `),children:e===`down`?`Broker is down — history frozen, input disabled. Waiting for auto-revive…`:`Reconnecting to the broker…`})}function fE({store:e,canDrive:t,streaming:n,onClose:r}){let[i,a]=(0,v.useState)(null),o=i??e.state?.thinkingLevel??`medium`;return(0,B.jsxs)(`div`,{className:`flex shrink-0 flex-wrap items-center gap-2 border-t border-border px-4 py-2`,children:[(0,B.jsx)(Z,{variant:`secondary`,size:`sm`,disabled:!t||!n,onClick:()=>e.abort(),children:`Abort`}),(0,B.jsxs)(`label`,{className:`tiny-sel relative`,"aria-disabled":!t,children:[`thinking `,(0,B.jsx)(`b`,{children:o}),(0,B.jsx)(of,{className:`size-3.5`}),(0,B.jsx)(`select`,{disabled:!t,value:o,onChange:t=>{let n=t.currentTarget.value;a(n),e.setThinkingLevel(n)},"aria-label":`Thinking level`,className:`absolute inset-0 cursor-pointer opacity-0`,children:iE.map(e=>(0,B.jsx)(`option`,{value:e,children:e},e))})]}),(0,B.jsx)(Z,{variant:`ghost`,size:`sm`,disabled:!t,onClick:()=>e.cycleModel(),children:`Cycle model`}),(0,B.jsx)(Z,{variant:`ghost`,size:`sm`,disabled:!t,onClick:()=>e.compact(),children:`Compact`}),(0,B.jsx)(Z,{variant:`destructive`,size:`sm`,className:`ml-auto`,onClick:r,children:`Close node`})]})}function pE({id:e,reviving:t,onRevive:n,onClose:r}){return(0,B.jsxs)(`div`,{className:`flex shrink-0 flex-wrap items-center gap-2 border-t border-border px-4 py-3`,children:[(0,B.jsx)(`span`,{className:`text-muted-foreground text-sm`,children:`This node is dormant (read-only). Revive to drive it live.`}),(0,B.jsx)(mE,{id:e}),(0,B.jsx)(Z,{variant:`default`,disabled:t,onClick:n,children:t?`Revive…`:`Revive`}),(0,B.jsx)(Z,{variant:`destructive`,onClick:r,children:`Close node`})]})}function mE({id:e}){let[t,n]=(0,v.useState)(!1);return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(Z,{variant:`secondary`,onClick:()=>n(!0),children:`Message (inbox)`}),(0,B.jsx)(hE,{id:e,open:t,onOpenChange:n})]})}function hE({id:e,open:t,onOpenChange:n}){let[r,i]=(0,v.useState)(``),[a,o]=(0,v.useState)(``),[s,c]=(0,v.useState)(!1),[l,u]=(0,v.useState)(null);return(0,v.useEffect)(()=>{t&&(i(``),o(``),u(null))},[t]),(0,B.jsx)(Dp,{open:t,onOpenChange:n,children:(0,B.jsxs)(Ap,{children:[(0,B.jsxs)(jp,{children:[(0,B.jsx)(Np,{children:`Send an inbox message`}),(0,B.jsx)(Pp,{children:`A directive deliverable to any node, including a dormant one.`})]}),(0,B.jsxs)(`form`,{onSubmit:async t=>{if(t.preventDefault(),r.trim()){c(!0),u(null);try{let t=await Xf(e,{body:r.trim(),...a.trim()?{tier:a.trim()}:{}});u(`delivered=${String(t.delivered)} revived=${String(t.revived)}`),i(``)}catch(e){u(F_(e))}finally{c(!1)}}},className:`flex flex-col gap-3`,children:[(0,B.jsx)(Wp,{value:r,onChange:e=>i(e.currentTarget.value),rows:4,required:!0,placeholder:`Message body…`}),(0,B.jsxs)(`label`,{className:`flex flex-col gap-1 text-sm`,children:[`tier`,(0,B.jsx)(`input`,{className:`rounded border bg-transparent px-2 py-1 text-sm`,value:a,onChange:e=>o(e.currentTarget.value),placeholder:`(default)`})]}),l&&(0,B.jsx)(`p`,{className:`text-muted-foreground text-sm`,children:l}),(0,B.jsxs)(Mp,{children:[(0,B.jsx)(Z,{type:`button`,variant:`secondary`,onClick:()=>n(!1),disabled:s,children:`Close`}),(0,B.jsx)(Z,{type:`submit`,variant:`default`,disabled:s,children:s?`Sending…`:`Send`})]})]})]})})}function gE(e){e.key===`Enter`&&e.stopPropagation()}function _E(e){return!e.canDrive&&!e.store.serverConnected?`broker is down — input is frozen`:e.canDrive?`Type a prompt. Enter makes a new line; Send submits.`:`observer — request control in More to drive`}function vE({screen:e,onMetricsChange:t}){let n=(0,v.useRef)(null),r=(0,v.useRef)(null),i=(0,v.useRef)(null),a=(0,v.useRef)(!1),o=(0,v.useRef)(0),s=(0,v.useRef)({height:0,keyboardHeight:0,keyboardOpen:!1}),c=(0,v.useMemo)(()=>(e,r=o.current)=>{a.current=e,o.current=r;let c=Math.ceil(n.current?.getBoundingClientRect().height??0),l={height:c,keyboardHeight:r,keyboardOpen:e},u=i.current??document.querySelector(`.mobile-shell-root`);i.current=u,u&&u.style.setProperty(`--composer-height`,`${c}px`),(s.current.height!==l.height||s.current.keyboardHeight!==l.keyboardHeight||s.current.keyboardOpen!==l.keyboardOpen)&&(s.current=l,t(l))},[t]),l=(0,v.useMemo)(()=>e=>{let t=i.current??document.querySelector(`.mobile-shell-root`);if(i.current=t,!t)return;let n=window.visualViewport,r=n&&e?Math.max(0,Math.round(window.innerHeight-(n.height+n.offsetTop))):0,a=n?Math.max(0,Math.round(n.offsetTop)):0;t.style.setProperty(`--kb-height`,`${r}px`),t.style.setProperty(`--vv-offset`,`${a}px`),t.dataset.keyboardOpen=e||r>0?`true`:`false`,c(e||r>0,r)},[c]);return(0,v.useLayoutEffect)(()=>{let e=r.current;e&&(e.style.height=`auto`,e.style.height=`${Math.min(e.scrollHeight,180)}px`,c(a.current))},[e.input,c]),(0,v.useEffect)(()=>{let e=document.querySelector(`.mobile-shell-root`);if(i.current=e,!e)return;let t=()=>{let e=window.visualViewport,t=e?window.innerHeight-(e.height+e.offsetTop)>0:a.current;l(t)},o=window.visualViewport,s=()=>{o||l(!0)},u=()=>{o||l(!1)},d=r.current;d?.addEventListener(`focus`,s),d?.addEventListener(`blur`,u);let f=()=>t();o&&(o.addEventListener(`resize`,f),o.addEventListener(`scroll`,f)),window.addEventListener(`resize`,f),t();let p=typeof ResizeObserver>`u`?null:new ResizeObserver(()=>c(a.current));return p&&n.current&&p.observe(n.current),()=>{d?.removeEventListener(`focus`,s),d?.removeEventListener(`blur`,u),window.removeEventListener(`resize`,f),o&&(o.removeEventListener(`resize`,f),o.removeEventListener(`scroll`,f)),p?.disconnect(),e&&(e.style.setProperty(`--kb-height`,`0px`),e.style.setProperty(`--vv-offset`,`0px`),e.style.setProperty(`--composer-height`,`0px`),delete e.dataset.keyboardOpen)}},[c,l]),(0,B.jsxs)(`div`,{ref:n,className:`mobile-composer shrink-0 border-t border-border bg-[var(--panel)] px-3 py-3`,children:[(0,B.jsx)(Wp,{ref:r,className:`mobile-composer-textarea resize-none rounded-xl border-border bg-[rgba(0,0,0,.16)] font-mono text-sm leading-5 text-[var(--ink)] placeholder:text-[var(--dim)]`,rows:2,value:e.input,placeholder:_E(e),onChange:t=>{e.setInput(t.currentTarget.value),requestAnimationFrame(()=>c(a.current))},onKeyDown:gE}),(0,B.jsxs)(`div`,{className:`mt-3 flex items-center gap-2`,children:[e.streaming&&(0,B.jsx)(Z,{type:`button`,variant:`secondary`,size:`sm`,disabled:!e.canDrive,onClick:()=>e.store.abort(),children:`Stop`}),(0,B.jsx)(Z,{type:`button`,size:`sm`,className:`flex-1`,disabled:!e.canDrive||!e.input.trim(),onClick:()=>e.sendPrimary(),children:e.streaming?`Steer`:`Send`})]}),!e.store.serverConnected&&(0,B.jsx)(`p`,{className:`mt-2 text-xs text-muted-foreground`,children:`Offline — draft saved locally.`}),e.store.serverConnected&&!e.canDrive&&(0,B.jsx)(`p`,{className:`mt-2 text-xs text-muted-foreground`,children:`Request control in More to drive this thread.`})]})}var yE={live:`border-success/25 bg-success/10 text-success`,working:`border-success/25 bg-success/10 text-success`,idle:`border-border bg-transparent text-muted-foreground`,"needs-you":`border-warning/30 bg-warning/10 text-warning`,done:`border-border bg-transparent text-muted-foreground`,reconnecting:`border-warning/30 bg-warning/10 text-warning`,offline:`border-destructive/30 bg-destructive/10 text-destructive`};function bE({title:e,statusLabel:t,statusTone:n,onBack:r,onOpenOverflow:i}){return(0,B.jsxs)(`header`,{className:`flex shrink-0 items-center gap-2 border-b px-3 py-2 [border-color:var(--line)] [background:var(--panel)]`,children:[(0,B.jsx)(`button`,{type:`button`,onClick:r,"aria-label":`Back to conversations`,className:`flex size-8 shrink-0 items-center justify-center rounded-full border border-border bg-transparent text-[var(--ink2)] transition-colors hover:text-[var(--ink)]`,children:(0,B.jsx)(sf,{className:`size-4`})}),(0,B.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,B.jsx)(`h1`,{className:`truncate text-base font-medium text-[var(--ink)]`,children:e})}),t&&(0,B.jsxs)(`span`,{className:Y(`inline-flex max-w-[44vw] items-center gap-1.5 rounded-full border px-2 py-1 text-xs font-medium`,yE[n]),children:[n===`working`||n===`reconnecting`?(0,B.jsx)(wf,{className:`size-3.5 shrink-0 animate-spin`}):(0,B.jsx)(`span`,{className:`size-2 shrink-0 rounded-full`,style:{background:n===`live`?`var(--success)`:n===`needs-you`?`var(--warning)`:n===`offline`?`var(--destructive)`:`var(--dim)`}}),(0,B.jsx)(`span`,{className:`truncate`,children:t})]}),(0,B.jsx)(`button`,{type:`button`,onClick:i,"aria-label":`More thread actions`,className:`flex size-8 shrink-0 items-center justify-center rounded-full border border-border bg-transparent text-[var(--ink2)] transition-colors hover:text-[var(--ink)]`,children:(0,B.jsx)(_f,{className:`size-4`})})]})}var xE=[`off`,`minimal`,`low`,`medium`,`high`,`xhigh`];function SE({open:e,screen:t,onClose:n}){let[r,i]=(0,v.useState)(t.store.state?.thinkingLevel??`medium`);return(0,v.useEffect)(()=>{i(t.store.state?.thinkingLevel??`medium`)},[t.store.state?.thinkingLevel]),(0,v.useEffect)(()=>{if(!e)return;let t=e=>{e.key===`Escape`&&n()};return window.addEventListener(`keydown`,t),()=>window.removeEventListener(`keydown`,t)},[e,n]),e?(0,B.jsx)(`div`,{role:`dialog`,"aria-modal":`true`,"aria-label":`Thread actions`,className:`fixed inset-0 z-50 flex items-end bg-black/45 backdrop-blur-[2px]`,onMouseDown:e=>{e.target===e.currentTarget&&n()},children:(0,B.jsxs)(`section`,{className:`max-h-[88vh] w-full overflow-auto rounded-t-3xl border-t border-border bg-[var(--panel)] shadow-2xl shadow-black/40`,children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-3 border-b border-border px-4 py-3`,children:[(0,B.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,B.jsx)(`p`,{className:`instlabel`,children:`Thread actions`}),(0,B.jsx)(`p`,{className:`truncate text-sm text-[var(--ink)]`,children:t.detail?.name?.trim()||`Thread`})]}),(0,B.jsx)(`button`,{type:`button`,onClick:n,"aria-label":`Close thread actions`,className:`flex size-8 items-center justify-center rounded-full border border-border bg-transparent text-[var(--ink2)] transition-colors hover:text-[var(--ink)]`,children:(0,B.jsx)(Pf,{className:`size-4`})})]}),(0,B.jsxs)(`div`,{className:`flex flex-col gap-4 px-4 pt-4 pb-[max(1rem,env(safe-area-inset-bottom))]`,children:[(0,B.jsxs)(`section`,{className:`space-y-3`,children:[(0,B.jsx)(`p`,{className:`instlabel`,children:`Control`}),(0,B.jsx)(`div`,{className:`flex flex-wrap items-center gap-2`,children:(0,B.jsx)(Lh,{store:t.store})})]}),(0,B.jsxs)(`section`,{className:`space-y-3`,children:[(0,B.jsx)(`p`,{className:`instlabel`,children:`Session`}),(0,B.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,B.jsx)(Z,{type:`button`,variant:`secondary`,size:`sm`,onClick:()=>t.store.cycleModel(),disabled:!t.canDrive,children:`Cycle model`}),(0,B.jsx)(Z,{type:`button`,variant:`secondary`,size:`sm`,onClick:()=>t.store.compact(),disabled:!t.canDrive,children:`Compact`}),(0,B.jsx)(Z,{type:`button`,variant:`destructive`,size:`sm`,onClick:()=>void t.doClose(),children:`Close node`}),t.dormant&&(0,B.jsx)(Z,{type:`button`,size:`sm`,onClick:()=>void t.doRevive(),disabled:t.reviving,children:t.reviving?`Reviving…`:`Revive`})]}),(0,B.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,B.jsx)(`span`,{className:`instlabel`,children:`Thinking`}),(0,B.jsxs)(Lp,{value:r,onValueChange:e=>{let n=e;i(n),t.store.setThinkingLevel(n)},disabled:!t.canDrive,children:[(0,B.jsx)(zp,{size:`sm`,className:`min-w-36 text-sm`,children:(0,B.jsx)(Rp,{placeholder:`Thinking`})}),(0,B.jsx)(Bp,{children:xE.map(e=>(0,B.jsx)(Vp,{value:e,children:e},e))})]})]})]}),(0,B.jsxs)(`section`,{className:`space-y-2`,children:[(0,B.jsx)(`p`,{className:`instlabel`,children:`Context`}),(0,B.jsx)(`div`,{className:`overflow-hidden rounded-2xl border border-border bg-[rgba(0,0,0,.12)]`,children:(0,B.jsx)(fh,{store:t.store,detail:t.detail})})]}),(0,B.jsxs)(`section`,{className:`space-y-2`,children:[(0,B.jsx)(`p`,{className:`instlabel`,children:`Instruments`}),(0,B.jsx)(`div`,{className:`panel overflow-hidden p-3`,children:(0,B.jsx)(ch,{store:t.store,detail:t.detail})})]})]})]})}):null}function CE({id:e}){let t=ut(),n=P_(e),{nodes:r}=Sp(),[i,a]=(0,v.useState)(!1),[o,s]=(0,v.useState)({height:0,keyboardHeight:0,keyboardOpen:!1}),c=(0,v.useCallback)(e=>{s(t=>t.height===e.height&&t.keyboardHeight===e.keyboardHeight&&t.keyboardOpen===e.keyboardOpen?t:e)},[]),l=(0,v.useMemo)(()=>Km(r),[r]),u=(0,v.useMemo)(()=>Sh(r,e).thisGraph[0]?.node.node_id??e,[e,r]),d=(0,v.useMemo)(()=>l.find(e=>e.id===u)??null,[l,u]),f=n.detail?.name?.trim()||n.detail?.kind?.trim()||`Conversation`,{label:p,tone:m}=(0,v.useMemo)(()=>wE(n,d),[d,n]),h=n.store.messages.length===0,g=TE(n,d),_=(0,v.useMemo)(()=>({peekedPath:n.peekedPath,onPeek:n.setPeekedPath}),[n.peekedPath,n.setPeekedPath]);return(0,B.jsx)(sT.Provider,{value:_,children:(0,B.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col overflow-hidden`,children:[(0,B.jsx)(bE,{title:f,statusLabel:p,statusTone:m,onBack:()=>t(`/`),onOpenOverflow:()=>a(!0)}),n.actionError&&(0,B.jsx)(`div`,{className:`border-b border-destructive/30 bg-destructive/10 px-4 py-2 text-sm text-destructive`,children:n.actionError}),n.store.error&&!n.actionError&&(0,B.jsx)(`div`,{className:`border-b border-warning/30 bg-warning/10 px-4 py-2 text-sm text-warning`,children:n.store.error.message}),(0,B.jsx)(QT,{conversationId:u}),(0,B.jsxs)(`main`,{className:`relative flex min-h-0 flex-1 flex-col overflow-hidden`,children:[(0,B.jsx)(XT,{messages:n.store.messages,partialToolResults:n.store.partialToolResults,executingToolIds:n.store.executingToolIds,queued:n.store.queued,streaming:n.streaming,bottomInsetPx:o.keyboardHeight,keyboardOpen:o.keyboardOpen,composerHeightPx:o.height}),h&&(0,B.jsx)(`div`,{className:`pointer-events-none absolute inset-0 flex items-center justify-center px-8 text-center text-sm text-muted-foreground`,children:(0,B.jsxs)(`div`,{className:`max-w-sm space-y-2 rounded-2xl border border-border bg-[rgba(0,0,0,.14)] px-4 py-3 shadow-lg shadow-black/20`,children:[(0,B.jsx)(`p`,{className:`font-medium text-[var(--ink)]`,children:g}),(0,B.jsx)(`p`,{children:n.store.serverConnected?`Waiting for the thread to load…`:`Drafts stay local while the broker reconnects.`})]})})]}),(0,B.jsx)(vE,{screen:n,onMetricsChange:c}),(0,B.jsx)(z_,{store:n.store}),(0,B.jsx)(SE,{open:i,screen:n,onClose:()=>a(!1)}),n.peekedPath&&(0,B.jsx)(`div`,{className:`fixed inset-0 z-40 flex justify-end bg-black/45 backdrop-blur-[2px]`,onMouseDown:e=>{e.target===e.currentTarget&&n.setPeekedPath(null)},children:(0,B.jsx)(tE,{nodeId:e,path:n.peekedPath,onClose:()=>n.setPeekedPath(null),className:`w-full max-w-[100vw]`})})]})})}function wE(e,t){if(e.store.brokerStatus===`down`)return{label:`Offline`,tone:`offline`};if(e.store.brokerStatus===`reconnecting`)return{label:`Reconnecting…`,tone:`reconnecting`};if(e.streaming)return{label:`Working…`,tone:`working`};if(e.store.source===`static`){if(!t)return{label:`Cached`,tone:`idle`};switch(t.state){case`needs-you`:return{label:`Needs you`,tone:`needs-you`};case`active`:return{label:`Active`,tone:`live`};case`idle`:return{label:`Idle`,tone:`idle`};case`done`:return{label:`Done`,tone:`done`}}}return{label:`Live`,tone:`live`}}function TE(e,t){return e.store.brokerStatus===`down`?`Couldn’t reach your thread yet — retrying quietly.`:e.store.brokerStatus===`reconnecting`?`Reconnecting to your thread…`:e.store.source===`static`?t?.state===`needs-you`?`Cached thread — waiting for your reply.`:`Cached thread — connecting to the live broker.`:`Loading conversation…`}function EE(){let{decks:e,loading:t}=am();return(0,B.jsxs)(`div`,{className:`mx-auto flex h-full min-h-0 max-w-3xl flex-col px-6 py-8`,children:[(0,B.jsxs)(`div`,{className:`mb-6 flex items-center gap-3`,children:[(0,B.jsx)(`h1`,{className:`text-3xl`,style:{fontWeight:460,letterSpacing:`-0.01em`,color:`var(--ink)`},children:`Inbox`}),e.length>0&&(0,B.jsx)(`span`,{className:`font-inst text-xs`,style:{fontWeight:600,color:`#ff8260`,background:`var(--blk-dim)`,border:`1px solid rgba(255,94,54,.35)`,padding:`1.5px 7px`,borderRadius:`99px`},children:e.length})]}),(0,B.jsx)(`div`,{className:`min-h-0 flex-1 overflow-auto`,children:t?(0,B.jsx)(AE,{}):e.length===0?(0,B.jsx)(kE,{}):(0,B.jsx)(`ul`,{className:`flex flex-col gap-2.5`,children:e.map(e=>(0,B.jsx)(DE,{deck:e},e.id))})})]})}function DE({deck:e}){let t=ut(),n=cm(e.kind),r=n.icon;return(0,B.jsx)(`li`,{className:`list-none`,children:(0,B.jsxs)(`button`,{type:`button`,onClick:()=>t(`/inbox/${encodeURIComponent(e.job_id)}`),className:`panel flex w-full items-start gap-4 px-4 py-3.5 text-left transition-colors hover:bg-[color-mix(in_oklch,var(--ink)_3%,transparent)] focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring`,children:[(0,B.jsx)(`span`,{className:`mt-0.5 inline-flex size-9 shrink-0 items-center justify-center rounded-lg`,style:{border:`1px solid var(--line)`,color:`var(--ink2)`,background:`color-mix(in oklch, var(--ink) 4%, transparent)`},title:n.label,children:(0,B.jsx)(r,{className:`size-4.5`})}),(0,B.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[(0,B.jsx)(`span`,{className:`truncate text-sm`,style:{fontWeight:500,color:`var(--ink)`},children:e.title}),(0,B.jsx)(`span`,{className:`instlabel shrink-0`,children:n.label})]}),e.subtitle&&(0,B.jsx)(`p`,{className:`mt-0.5 truncate text-sm`,style:{color:`var(--mut)`},children:e.subtitle}),(0,B.jsx)(OE,{deck:e,className:`mt-1.5`})]}),(0,B.jsx)(`span`,{className:`font-inst shrink-0 text-xs`,style:{letterSpacing:`0.08em`,color:`var(--mut)`},title:`waiting ${lm(e.blocked_since)}`,children:lm(e.blocked_since)})]})})}function OE({deck:e,className:t}){return(0,B.jsxs)(`div`,{className:Y(`flex flex-wrap items-center gap-x-2 gap-y-0.5 text-xs`,t),children:[(0,B.jsxs)(`span`,{className:`text-muted-foreground`,children:[`in `,(0,B.jsx)(`span`,{className:`font-medium text-foreground/80`,children:e.conversation_title})]}),(0,B.jsx)(`span`,{className:`text-muted-foreground/40`,children:`·`}),(0,B.jsxs)(An,{to:`/nodes/${encodeURIComponent(e.asking_node_id)}`,onClick:e=>e.stopPropagation(),className:`font-mono text-muted-foreground hover:text-primary hover:underline`,title:e.cwd,children:[e.asking_node_name,` (`,e.asking_node_id,`)`]}),(0,B.jsx)(`span`,{className:`text-muted-foreground/40`,children:`·`}),(0,B.jsx)(`span`,{className:`font-mono text-muted-foreground/60`,title:e.cwd,children:e.cwd})]})}function kE(){return(0,B.jsxs)(`div`,{className:`flex h-full flex-col items-center justify-center py-16 text-center`,children:[(0,B.jsx)(`p`,{className:`text-2xl`,style:{fontStyle:`italic`,color:`var(--ink)`},children:`You're all caught up.`}),(0,B.jsx)(`p`,{className:`mt-1.5 text-sm`,style:{color:`var(--mut)`},children:`Nothing needs your input right now.`})]})}function AE(){return(0,B.jsx)(`ul`,{className:`flex flex-col gap-2.5`,children:[0,1,2].map(e=>(0,B.jsxs)(`li`,{className:`panel flex items-center gap-4 px-4 py-3.5`,children:[(0,B.jsx)(`div`,{className:`size-9 shrink-0 animate-pulse rounded-lg bg-muted`}),(0,B.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-2`,children:[(0,B.jsx)(`div`,{className:`h-4 w-1/3 animate-pulse rounded-none bg-muted`}),(0,B.jsx)(`div`,{className:`h-3 w-2/3 animate-pulse rounded-none bg-muted/70`})]})]},e))})}function jE({deckId:e}){let t=ut(),[n,r]=(0,v.useState)(null),[i,a]=(0,v.useState)(!0),[o,s]=(0,v.useState)(null),[c,l]=(0,v.useState)({}),[u,d]=(0,v.useState)(!1),[f,p]=(0,v.useState)(0);(0,v.useEffect)(()=>{let n=!1;return r(null),l({}),s(null),d(!1),a(!0),tm(e).then(e=>{n||(r(e),l(Object.fromEntries(e.interactions.map(e=>[e.id,{id:e.id}]))),a(!1))}).catch(e=>{if(!n){if(qp(e)){fm(e instanceof Uf?e.message:`That request was already handled.`),t(`/inbox`,{replace:!0});return}s(e instanceof Error?e:Error(`Failed to load deck.`)),a(!1)}}),()=>{n=!0}},[e,t,f]);let m=(e,t)=>l(n=>({...n,[e]:{...n[e],id:e,...t}}));if(i)return(0,B.jsx)(WE,{});if(o)return(0,B.jsx)(ME,{error:o,onRetry:()=>p(e=>e+1),onBack:()=>t(`/inbox`)});if(!n)return(0,B.jsx)(WE,{});let h=async e=>{if(u)return;d(!0);let r=Object.values(e??c).map(({selectedOptionId:e,...t})=>t);try{await nm(n.job_id,{responses:r}),fm(`Done — thanks!`,`success`),t(`/inbox`,{replace:!0})}catch(e){if(qp(e)){fm(e instanceof Uf?e.message:`That request was already handled.`),t(`/inbox`,{replace:!0});return}fm(e instanceof Uf?e.message:`Something went wrong — try again.`),d(!1)}},g=n.interactions.length===1?n.interactions[0]:null,_=cm(n.kind).icon;return(0,B.jsxs)(`div`,{className:`mx-auto flex h-full min-h-0 max-w-2xl flex-col px-6 py-8`,children:[(0,B.jsxs)(`button`,{type:`button`,onClick:()=>t(`/inbox`),className:`mb-4 inline-flex items-center gap-1.5 text-sm text-muted-foreground hover:text-foreground`,children:[(0,B.jsx)(tf,{className:`size-4`}),` Inbox`]}),(0,B.jsxs)(`header`,{className:`mb-5 flex items-start gap-3`,children:[(0,B.jsx)(`span`,{className:`mt-0.5 inline-flex size-10 shrink-0 items-center justify-center rounded-lg`,style:{border:`1px solid var(--line)`,color:`var(--ink2)`,background:`color-mix(in oklch, var(--ink) 4%, transparent)`},children:(0,B.jsx)(_,{className:`size-5`})}),(0,B.jsxs)(`div`,{className:`min-w-0`,children:[(0,B.jsx)(`h1`,{className:`text-2xl`,style:{fontWeight:460,letterSpacing:`-0.01em`,color:`var(--ink)`},children:n.title}),n.subtitle&&(0,B.jsx)(`p`,{className:`mt-0.5 text-sm`,style:{color:`var(--mut)`},children:n.subtitle}),(0,B.jsx)(OE,{deck:n,className:`mt-2`})]})]}),(0,B.jsx)(`div`,{className:`min-h-0 flex-1 overflow-auto`,children:(0,B.jsx)(`div`,{className:`flex flex-col gap-6`,children:n.interactions.map(e=>(0,B.jsx)(FE,{interaction:e,answer:c[e.id]??{id:e.id},onChange:t=>m(e.id,t),conversationId:n.conversation_id,busy:u,onResolveWith:g?t=>void h({[e.id]:t}):void 0},e.id))})}),!NE(g)&&(0,B.jsxs)(`footer`,{className:`mt-6 flex shrink-0 items-center justify-end gap-2 border-t border-border pt-4`,children:[(0,B.jsx)(Z,{variant:`ghost`,onClick:()=>t(`/inbox`),disabled:u,children:`Cancel`}),(0,B.jsx)(Z,{onClick:()=>void h(),disabled:u||!PE(n,c),children:u?`Sending…`:`Submit`})]})]})}function ME({error:e,onRetry:t,onBack:n}){return(0,B.jsx)(`div`,{className:`mx-auto flex h-full min-h-0 max-w-2xl flex-col justify-center px-6 py-8`,children:(0,B.jsxs)(`section`,{className:`panel p-5`,children:[(0,B.jsx)(`h1`,{className:`text-lg font-semibold`,children:`Couldn’t load the deck`}),(0,B.jsx)(`p`,{className:`mt-2 text-sm text-muted-foreground`,children:e.message}),(0,B.jsxs)(`div`,{className:`mt-4 flex gap-2`,children:[(0,B.jsx)(Z,{onClick:t,children:`Retry`}),(0,B.jsx)(Z,{variant:`ghost`,onClick:n,children:`Back to inbox`})]})]})})}function NE(e){return e!==null&&(e.kind===`notify`||e.kind===`validation`)}function PE(e,t){return e.interactions.every(e=>{let n=t[e.id];if(!n)return!1;if(e.kind===`notify`||e.kind===`error`)return!0;let r=!!n.selectedOptionIds?.length||!!n.freetext?.trim();return e.options.length===0&&!e.allowFreetext||r})}function FE({interaction:e,answer:t,onChange:n,conversationId:r,busy:i,onResolveWith:a}){switch(e.kind){case`notify`:return(0,B.jsx)(zE,{interaction:e,onGotIt:()=>a?.({id:e.id}),direct:!!a});case`validation`:return(0,B.jsx)(BE,{interaction:e,answer:t,onChange:n,busy:i,onResolveWith:a});case`context`:return(0,B.jsx)(HE,{interaction:e,answer:t,onChange:n});case`error`:return(0,B.jsx)(UE,{interaction:e,answer:t,onChange:n,conversationId:r});default:return(0,B.jsx)(VE,{interaction:e,answer:t,onChange:n})}}function IE({body:e}){return e?(0,B.jsx)(`div`,{className:`prose prose-sm max-w-none text-sm text-foreground/85 dark:prose-invert`,dangerouslySetInnerHTML:{__html:Pw(Bw(e))}}):null}function LE({children:e,className:t}){return(0,B.jsx)(`section`,{className:Y(`panel p-5`,t),children:e})}function RE({it:e}){return(0,B.jsxs)(`div`,{className:`mb-3`,children:[(0,B.jsx)(`h2`,{className:`text-base font-semibold`,children:e.title}),e.subtitle&&(0,B.jsx)(`p`,{className:`mt-0.5 text-sm text-muted-foreground`,children:e.subtitle})]})}function zE({interaction:e,onGotIt:t,direct:n}){return(0,B.jsxs)(LE,{children:[(0,B.jsx)(RE,{it:e}),(0,B.jsx)(IE,{body:e.body}),n&&(0,B.jsx)(`div`,{className:`mt-4 flex justify-end`,children:(0,B.jsxs)(Z,{onClick:t,children:[(0,B.jsx)(af,{className:`mr-1.5 size-4`}),` Got it`]})})]})}function BE({interaction:e,answer:t,onChange:n,busy:r,onResolveWith:i}){let a=e.options.find(e=>e.id===`yes`)??e.options[0],o=e.options.find(e=>e.id===`no`)??e.options[1],s=r=>{let a={...t,id:e.id,selectedOptionIds:[r]};i?i(a):n({selectedOptionIds:[r],selectedOptionId:void 0})};return(0,B.jsxs)(LE,{children:[(0,B.jsx)(RE,{it:e}),(0,B.jsx)(IE,{body:e.body}),(0,B.jsxs)(`div`,{className:`mt-4 flex flex-col gap-3`,children:[(0,B.jsx)(Wp,{rows:2,value:t.freetext??``,onChange:e=>n({freetext:e.currentTarget.value}),placeholder:e.freetextLabel??`Add a comment (optional)`,className:`resize-none text-sm`}),(0,B.jsxs)(`div`,{className:`flex gap-3`,children:[(0,B.jsx)(Z,{className:`flex-1`,size:`lg`,disabled:r,onClick:()=>a&&s(a.id),children:a?.label??`Approve`}),(0,B.jsx)(Z,{className:`flex-1`,size:`lg`,variant:`outline`,disabled:r,onClick:()=>o&&s(o.id),children:o?.label??`Reject`})]}),!i&&t.selectedOptionIds?.[0]&&(0,B.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Selected: `,e.options.find(e=>e.id===t.selectedOptionIds?.[0])?.label]})]})]})}function VE({interaction:e,answer:t,onChange:n}){let r=new Set(t.selectedOptionIds??[]),i=t=>{if(e.multiSelect){let e=new Set(r);e.has(t)?e.delete(t):e.add(t),n({selectedOptionIds:[...e],selectedOptionId:void 0})}else n({selectedOptionIds:[t],selectedOptionId:void 0})};return(0,B.jsxs)(LE,{children:[(0,B.jsx)(RE,{it:e}),(0,B.jsx)(IE,{body:e.body}),(0,B.jsx)(`ul`,{className:`mt-4 flex flex-col gap-2`,children:e.options.map(t=>{let n=r.has(t.id);return(0,B.jsx)(`li`,{children:(0,B.jsxs)(`button`,{type:`button`,onClick:()=>i(t.id),className:Y(`flex w-full items-start gap-3 rounded-xl border px-4 py-3 text-left transition-colors`,n?`border-primary bg-primary/5 ring-1 ring-primary`:`border-border hover:border-primary/40 hover:bg-accent/40`),children:[(0,B.jsx)(`span`,{className:Y(`mt-0.5 flex size-4 shrink-0 items-center justify-center border`,e.multiSelect?`rounded`:`rounded-full`,n?`border-primary bg-primary text-primary-foreground`:`border-muted-foreground/40`),children:n&&(0,B.jsx)(af,{className:`size-3`})}),(0,B.jsxs)(`span`,{className:`min-w-0`,children:[(0,B.jsx)(`span`,{className:`block text-sm font-medium`,children:t.label}),t.description&&(0,B.jsx)(`span`,{className:`mt-0.5 block text-xs text-muted-foreground`,children:t.description})]})]})},t.id)})}),e.allowFreetext&&(0,B.jsx)(Wp,{rows:2,value:t.freetext??``,onChange:e=>n({freetext:e.currentTarget.value}),placeholder:e.freetextLabel??`Anything else? (optional)`,className:`mt-3 resize-none text-sm`})]})}function HE({interaction:e,answer:t,onChange:n}){let r=t.selectedOptionIds?.[0];return(0,B.jsxs)(LE,{children:[(0,B.jsx)(RE,{it:e}),e.body&&(0,B.jsxs)(`div`,{className:`mb-4 rounded-xl border border-border p-3`,style:{background:`color-mix(in oklch, var(--ink) 3%, transparent)`},children:[(0,B.jsx)(`p`,{className:`instlabel mb-1.5`,children:`Why we're asking`}),(0,B.jsx)(IE,{body:e.body})]}),e.options.length>0&&(0,B.jsx)(`ul`,{className:`mb-3 flex flex-col gap-2`,children:e.options.map(e=>(0,B.jsx)(`li`,{children:(0,B.jsx)(`button`,{type:`button`,onClick:()=>n({selectedOptionIds:[e.id],selectedOptionId:void 0}),className:Y(`flex w-full items-start gap-3 rounded-xl border px-4 py-3 text-left transition-colors`,r===e.id?`border-primary bg-primary/5 ring-1 ring-primary`:`border-border hover:border-primary/40 hover:bg-accent/40`),children:(0,B.jsxs)(`span`,{className:`min-w-0`,children:[(0,B.jsx)(`span`,{className:`block text-sm font-medium`,children:e.label}),e.description&&(0,B.jsx)(`span`,{className:`mt-0.5 block text-xs text-muted-foreground`,children:e.description})]})})},e.id))}),(e.allowFreetext||e.options.length===0)&&(0,B.jsx)(Wp,{autoFocus:!0,rows:3,value:t.freetext??``,onChange:e=>n({freetext:e.currentTarget.value}),placeholder:e.freetextLabel??`Your answer`,className:`resize-none text-sm`})]})}function UE({interaction:e,answer:t,onChange:n,conversationId:r}){let i=ut();return(0,B.jsxs)(LE,{className:`border-destructive/30`,children:[(0,B.jsx)(RE,{it:e}),(0,B.jsx)(IE,{body:e.body}),(0,B.jsxs)(`div`,{className:`mt-4 flex flex-col gap-2`,children:[e.options.map(e=>(0,B.jsx)(`button`,{type:`button`,onClick:()=>n({selectedOptionIds:[e.id],selectedOptionId:void 0}),className:Y(`flex w-full items-start gap-3 rounded-xl border px-4 py-3 text-left transition-colors`,t.selectedOptionIds?.[0]===e.id?`border-primary bg-primary/5 ring-1 ring-primary`:`border-border hover:border-primary/40 hover:bg-accent/40`),children:(0,B.jsxs)(`span`,{className:`min-w-0`,children:[(0,B.jsx)(`span`,{className:`block text-sm font-medium`,children:e.label}),e.description&&(0,B.jsx)(`span`,{className:`mt-0.5 block text-xs text-muted-foreground`,children:e.description})]})},e.id)),(0,B.jsx)(`button`,{type:`button`,onClick:()=>i(`/c/${encodeURIComponent(r)}`),className:`flex w-full items-center gap-2 rounded-xl border border-border px-4 py-3 text-left text-sm font-medium transition-colors hover:border-primary/40 hover:bg-accent/40`,children:`Take over — open the conversation`})]})]})}function WE(){return(0,B.jsxs)(`div`,{className:`mx-auto flex h-full max-w-2xl flex-col gap-5 px-6 py-8`,children:[(0,B.jsx)(`div`,{className:`h-4 w-16 animate-pulse rounded-none bg-muted`}),(0,B.jsx)(`div`,{className:`h-7 w-1/2 animate-pulse rounded-none bg-muted`}),(0,B.jsx)(`div`,{className:`h-40 w-full animate-pulse rounded-2xl bg-muted/60`})]})}var GE=`crtr-push-token-v1`,KE=`/__push-token`;async function qE(e){if(typeof caches>`u`)return;let t=await caches.open(GE);if(e===void 0||e===``){await t.delete(KE);return}await t.put(KE,new Response(e))}function JE(){let e={"content-type":`application/json`};return Bf!==void 0&&(e.authorization=`Bearer ${Bf}`),e}function YE(){return typeof window<`u`&&`serviceWorker`in navigator&&`PushManager`in window&&`Notification`in window}function XE(e){let t=(e+`=`.repeat((4-e.length%4)%4)).replace(/-/g,`+`).replace(/_/g,`/`),n=atob(t),r=new Uint8Array(n.length);for(let e=0;e<n.length;e++)r[e]=n.charCodeAt(e);return r}async function ZE(){let e=await fetch(`/__crtr/push/vapid-public-key`,{headers:JE()});if(!e.ok)throw Error(`could not load the push key (${e.status})`);return(await e.json()).publicKey}async function QE(e){let t=await fetch(`/__crtr/push/subscribe`,{method:`POST`,headers:JE(),body:JSON.stringify(e.toJSON())});if(!t.ok){let e=await t.json().catch(()=>({}));throw Error(e.error??`subscribe failed (${t.status})`)}}async function $E(){if(!YE())return`unsupported`;if(Notification.permission===`denied`)return`denied`;let e=await navigator.serviceWorker.getRegistration();return e===void 0||await e.pushManager.getSubscription()===null?`unsubscribed`:`subscribed`}async function eD(){if(!YE())throw Error(`push notifications are not supported in this browser`);if(await Notification.requestPermission()!==`granted`)throw Error(`notification permission was not granted`);let e=await navigator.serviceWorker.ready,t=await e.pushManager.getSubscription();if(t!==null){await qE(Bf);try{await QE(t)}catch(e){throw await t.unsubscribe().catch(()=>{}),await qE(void 0).catch(()=>{}),e}return}let n=await ZE(),r=await e.pushManager.subscribe({userVisibleOnly:!0,applicationServerKey:XE(n)});try{await qE(Bf)}catch(e){throw await r.unsubscribe().catch(()=>{}),e}try{await QE(r)}catch(e){throw await r.unsubscribe().catch(()=>{}),await qE(void 0).catch(()=>{}),e}}async function tD(){if(!YE())return;let e=await navigator.serviceWorker.getRegistration();if(e===void 0)return;let t=await e.pushManager.getSubscription();if(t===null)return;let n=t.endpoint;await t.unsubscribe(),await qE(void 0).catch(()=>{});try{await fetch(`/__crtr/push/subscribe`,{method:`DELETE`,headers:JE(),body:JSON.stringify({endpoint:n})})}catch{}}function nD(){let[e,t]=(0,v.useState)(()=>YE()?`unsubscribed`:`unsupported`),[n,r]=(0,v.useState)(!1),[i,a]=(0,v.useState)(null),o=(0,v.useCallback)(()=>{$E().then(t)},[]);return(0,v.useEffect)(()=>{o()},[o]),{status:e,busy:n,error:i,enable:(0,v.useCallback)(()=>{r(!0),a(null),eD().catch(e=>a(e instanceof Error?e.message:String(e))).then(o).finally(()=>r(!1))},[o]),disable:(0,v.useCallback)(()=>{r(!0),a(null),tD().catch(e=>a(e instanceof Error?e.message:String(e))).then(o).finally(()=>r(!1))},[o])}}function rD(){let[e,t]=(0,v.useState)(()=>document.documentElement.classList.contains(`dark`));return(0,B.jsxs)(`div`,{className:`mx-auto flex h-full min-h-0 max-w-2xl flex-col gap-8 overflow-auto px-6 py-8`,children:[(0,B.jsx)(`h1`,{className:`text-3xl`,style:{fontWeight:460,letterSpacing:`-0.01em`,color:`var(--ink)`},children:`Settings`}),(0,B.jsxs)(`section`,{className:`space-y-2.5`,children:[(0,B.jsx)(`h2`,{className:`instlabel`,children:`Appearance`}),(0,B.jsxs)(`p`,{className:`text-sm`,style:{color:`var(--mut)`},children:[e?`Dark theme`:`Light theme`,` is active.`]}),(0,B.jsxs)(Z,{variant:`outline`,onClick:()=>{let e=document.documentElement,n=!e.classList.contains(`dark`);e.classList.toggle(`dark`,n),e.classList.toggle(`light`,!n),t(n)},children:[`Switch to `,e?`light`:`dark`]})]}),(0,B.jsx)(iD,{})]})}function iD(){let{status:e,busy:t,error:n,enable:r,disable:i}=nD();return(0,B.jsxs)(`section`,{className:`space-y-2.5`,children:[(0,B.jsx)(`h2`,{className:`instlabel`,children:`Notifications`}),e===`unsupported`&&(0,B.jsx)(`p`,{className:`text-sm`,style:{color:`var(--mut)`},children:`Notifications aren’t supported in this browser.`}),e===`denied`&&(0,B.jsx)(`p`,{className:`text-sm`,style:{color:`var(--mut)`},children:`Notifications off — enable them for this site in your browser/OS settings.`}),e===`unsubscribed`&&(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`p`,{className:`text-sm`,style:{color:`var(--mut)`},children:`Get a push when an agent needs you or finishes, even when this tab is closed.`}),(0,B.jsx)(Z,{variant:`outline`,onClick:r,disabled:t,children:`Enable notifications`})]}),e===`subscribed`&&(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`p`,{className:`text-sm`,style:{color:`var(--mut)`},children:`Notifications are on for this browser.`}),(0,B.jsx)(Z,{variant:`outline`,onClick:i,disabled:t,children:`Disable notifications`})]}),n!==null&&(0,B.jsx)(`p`,{className:`text-sm`,style:{color:`var(--warning)`},children:n})]})}var aD=`(max-width: 767px)`;function oD(){return typeof window<`u`&&typeof window.matchMedia==`function`&&window.matchMedia(aD).matches}function sD(){let[e,t]=(0,v.useState)(oD);return(0,v.useEffect)(()=>{if(typeof window>`u`||typeof window.matchMedia!=`function`)return;let e=window.matchMedia(aD),n=e=>t(e.matches);return t(e.matches),e.addEventListener(`change`,n),()=>e.removeEventListener(`change`,n)},[]),e}function cD(e,t,n){let r=new URLSearchParams;t!==void 0&&t!==``&&r.set(`ask`,t),n!==void 0&&n!==``&&r.set(`token`,n);let i=r.toString();return`/c/${encodeURIComponent(e)}${i===``?``:`?${i}`}`}function lD(){let{id:e}=ft();return sD()?(0,B.jsx)(CE,{id:e??``},e):(0,B.jsx)(sE,{id:e??``},e)}function uD(){let{deckId:e}=ft();return(0,B.jsx)(jE,{deckId:e??``})}function dD(){return(0,B.jsxs)(Rt,{children:[(0,B.jsx)(It,{path:`/`,element:(0,B.jsx)(Xm,{})}),(0,B.jsx)(It,{path:`/canvas`,element:(0,B.jsx)(Nm,{})}),(0,B.jsx)(It,{path:`/nodes/:id`,element:(0,B.jsx)(lD,{})}),(0,B.jsx)(It,{path:`/c/:id`,element:(0,B.jsx)(lD,{})}),(0,B.jsx)(It,{path:`/inbox`,element:(0,B.jsx)(EE,{})}),(0,B.jsx)(It,{path:`/inbox/:deckId`,element:(0,B.jsx)(uD,{})}),(0,B.jsx)(It,{path:`/settings`,element:(0,B.jsx)(rD,{})}),(0,B.jsx)(It,{path:`*`,element:(0,B.jsx)(Xm,{})})]})}function fD(){let e=ut();return(0,v.useEffect)(()=>{if(!(`serviceWorker`in navigator))return;let t=t=>{let n=t.data;if(n?.type!==`crtr-deep-link`||typeof n.conversationId!=`string`)return;let r=typeof n.askId==`string`?n.askId:void 0;e(cD(n.conversationId,r,Bf))};return navigator.serviceWorker.addEventListener(`message`,t),()=>navigator.serviceWorker.removeEventListener(`message`,t)},[e]),null}function pD(){return up(e=>e.reachable)?null:(0,B.jsx)(`div`,{role:`status`,className:`fixed inset-x-0 top-0 z-50 bg-warning/90 px-4 py-1.5 text-center text-sm font-medium text-background`,children:`Reconnecting…`})}function mD(e){e(`/?new=1`)}var hD=[{id:`conversations`,label:`Conversations`,path:`/`},{id:`canvas`,label:`Canvas`,path:`/canvas`},{id:`inbox`,label:`Inbox`,path:`/inbox`},{id:`settings`,label:`Settings`,path:`/settings`}],gD={conversations:Ef,canvas:Df,inbox:xf,settings:jf};function _D({compact:e}){let t=ut();return(0,B.jsxs)(`aside`,{"aria-label":`Primary`,style:e?{width:58}:void 0,className:Y(`flex flex-none flex-col gap-0.5 py-4 [border-right:1px_solid_var(--line)] [background:linear-gradient(180deg,rgba(20,19,16,.6),rgba(20,19,16,.2))]`,e?`items-center`:`w-57 px-3`),children:[(0,B.jsxs)(An,{to:`/`,title:`crouter`,className:Y(`flex items-center no-underline [color:var(--ink)]`,e?`justify-center pt-1 pb-4`:`gap-2.5 px-2.5 pt-1 pb-4 text-base font-medium tracking-[.01em]`),children:[(0,B.jsx)(`span`,{className:`font-inst flex flex-none items-center justify-center rounded-md text-xs font-bold [background:var(--bone)] [color:var(--bone-ink)]`,style:{width:22,height:22},children:`cr`}),!e&&`crouter`]}),(0,B.jsxs)(`button`,{type:`button`,onClick:()=>mD(t),title:`New chat (⌘⇧O)`,"aria-label":`New chat`,className:Y(`flex items-center rounded-lg font-medium transition-all [color:var(--bone-ink)] [background:var(--bone)] hover:[background:var(--ink)]`,e?`mb-1 size-9 justify-center`:`mb-1.5 h-9 gap-2.5 px-3 text-sm`),children:[(0,B.jsx)(Of,{size:e?18:16,className:`flex-none`,"aria-hidden":!0}),!e&&(0,B.jsx)(`span`,{children:`New chat`})]}),hD.map(t=>{let n=gD[t.id]??Ef;return(0,B.jsxs)(jn,{to:t.path,end:t.path===`/`,title:e?t.label:void 0,className:({isActive:t})=>Y(`relative flex items-center no-underline transition-all`,e?`size-9 justify-center rounded-lg border border-transparent opacity-75`:`h-9 gap-2.5 rounded-lg border border-transparent px-3 text-sm font-medium`,t?`[color:var(--ink)] opacity-100 [background:rgba(232,228,216,.06)] [border-color:var(--line)] [box-shadow:inset_0_1px_0_var(--raise)]`:`[color:var(--ink2)] hover:opacity-100 hover:[color:var(--ink)] hover:[background:rgba(232,228,216,.04)]`),children:[(0,B.jsx)(n,{size:18,className:e?void 0:`flex-none opacity-75`,"aria-hidden":!0}),!e&&(0,B.jsx)(`span`,{children:t.label}),t.id===`inbox`&&(0,B.jsx)(vD,{compact:e})]},t.id)}),(0,B.jsx)(`div`,{className:`flex-1`})]})}function vD({compact:e}){let t=im();return t<=0?null:e?(0,B.jsx)(`span`,{className:`absolute right-[5px] top-[5px] size-2.5 rounded-full [background:var(--blk)] [box-shadow:0_0_10px_rgba(255,94,54,.55)] [animation:pulse-hot_1.6s_ease-out_infinite]`}):(0,B.jsx)(`span`,{className:`font-inst ml-auto rounded-full border px-2 py-0.5 text-xs font-semibold [color:#ff8260] [background:var(--blk-dim)] [border-color:rgba(255,94,54,.35)]`,children:t})}function yD(e,t){let n=(0,v.useRef)(e),r=(0,v.useRef)(t);n.current=e,r.current=t,(0,v.useEffect)(()=>{let e=e=>{let t=document.activeElement;t instanceof HTMLTextAreaElement||t instanceof HTMLInputElement||t instanceof HTMLElement&&t.isContentEditable||n.current(e)&&(e.preventDefault(),r.current(e))};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[])}function bD({open:e,onClose:t}){let{nodes:n}=Sp(),r=ut(),[i,a]=(0,v.useState)(``),[o,s]=(0,v.useState)(0),c=(0,v.useRef)(null),l=(0,v.useMemo)(()=>{let e=n.filter(e=>e.enterable).map(e=>({id:e.node_id,title:Rm(e),dot:Um(e),kind:e.kind,last:e.last_activity??e.created}));e.sort((e,t)=>t.last.localeCompare(e.last));let t=i.trim().toLowerCase();return t?e.filter(e=>e.title.toLowerCase().includes(t)||e.kind.toLowerCase().includes(t)):e},[n,i]);if((0,v.useEffect)(()=>{e&&(a(``),s(0),c.current?.focus())},[e]),(0,v.useEffect)(()=>{s(e=>Math.min(e,Math.max(0,l.length-1)))},[l.length]),!e)return null;let u=e=>{e&&(r(`/c/${encodeURIComponent(e.id)}`),t())};return(0,B.jsx)(`div`,{className:`fixed inset-0 z-50 flex items-start justify-center px-4 pt-24`,style:{background:`var(--scrim)`},onClick:t,children:(0,B.jsxs)(`div`,{className:`panel w-full max-w-xl overflow-hidden p-0`,onClick:e=>e.stopPropagation(),onKeyDown:e=>{e.key===`Escape`?(e.preventDefault(),t()):e.key===`ArrowDown`?(e.preventDefault(),s(e=>Math.min(e+1,l.length-1))):e.key===`ArrowUp`?(e.preventDefault(),s(e=>Math.max(e-1,0))):e.key===`Enter`&&(e.preventDefault(),u(l[o]))},children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-2 border-b px-4 py-3`,style:{borderColor:`var(--line)`},children:[(0,B.jsx)(`span`,{className:`instlabel`,style:{color:`var(--dim)`},children:`Jump to`}),(0,B.jsx)(`input`,{ref:c,value:i,onChange:e=>a(e.currentTarget.value),placeholder:`Search conversations…`,className:`flex-1 bg-transparent text-sm outline-none`,style:{color:`var(--ink)`}}),(0,B.jsx)(`span`,{className:`kbd`,children:`esc`})]}),(0,B.jsx)(`ul`,{className:`max-h-80 overflow-auto py-1`,children:l.length===0?(0,B.jsx)(`li`,{className:`px-4 py-3 text-sm italic`,style:{color:`var(--mut)`},children:`no live nodes`}):l.map((e,t)=>(0,B.jsx)(`li`,{children:(0,B.jsxs)(`button`,{type:`button`,onClick:()=>u(e),onMouseEnter:()=>s(t),className:Y(`flex w-full items-center gap-2.5 px-4 py-2 text-left transition-colors`,t===o&&`bg-[color-mix(in_oklch,var(--ink)_6%,transparent)]`),children:[(0,B.jsx)(`span`,{className:Y(`dot shrink-0`,e.dot)}),(0,B.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-sm`,style:{color:`var(--ink)`},children:e.title}),(0,B.jsx)(`span`,{className:`font-inst shrink-0 text-xs`,style:{letterSpacing:`0.04em`,color:`var(--mut)`},children:e.kind})]})},e.id))})]})})}var xD=/^\/(nodes|c)\//;function SD({children:e}){let t=st(),n=ut(),[r,i]=(0,v.useState)(!1);return yD((0,v.useCallback)(e=>(e.metaKey||e.ctrlKey)&&e.shiftKey&&!e.altKey&&e.code===`KeyO`,[]),(0,v.useCallback)(()=>mD(n),[n])),yD((0,v.useCallback)(e=>(e.metaKey||e.ctrlKey)&&!e.shiftKey&&!e.altKey&&e.code===`KeyK`,[]),(0,v.useCallback)(()=>i(e=>!e),[])),(0,B.jsxs)(`div`,{className:`flex h-full min-h-0`,children:[(0,B.jsx)(_D,{compact:xD.test(t.pathname)}),(0,B.jsx)(`main`,{className:`min-h-0 flex-1 overflow-hidden`,children:e}),(0,B.jsx)(bD,{open:r,onClose:()=>i(!1)})]})}var CD=/^\/(?:c|nodes)\/([^/]+)\/?$/;function wD(e){let t=CD.exec(e);if(!t)return null;let n=t[1];return n===void 0?null:decodeURIComponent(n)}var TD=[{id:`home`,label:`Home`,path:`/`,icon:bf},{id:`inbox`,label:`Inbox`,path:`/inbox`,icon:xf}];function ED(){let e=ut();return(0,B.jsxs)(`nav`,{"aria-label":`Primary`,className:`mobile-bottom-nav flex flex-none items-stretch gap-1 border-t px-2 pt-1 [border-color:var(--line)] [background:var(--panel)]`,children:[TD.map(e=>(0,B.jsxs)(jn,{to:e.path,end:e.path===`/`,className:({isActive:e})=>Y(`relative flex flex-1 flex-col items-center gap-0.5 rounded-lg py-1.5 text-xs font-medium no-underline transition-all`,e?`[color:var(--ink)] opacity-100`:`[color:var(--ink2)] opacity-75`),children:[(0,B.jsx)(e.icon,{size:20,"aria-hidden":!0}),(0,B.jsx)(`span`,{children:e.label}),e.id===`inbox`&&(0,B.jsx)(DD,{})]},e.id)),(0,B.jsxs)(`button`,{type:`button`,onClick:()=>mD(e),"aria-label":`New chat`,className:`flex flex-1 flex-col items-center gap-0.5 rounded-lg py-1.5 text-xs font-medium [color:var(--ink2)]`,children:[(0,B.jsx)(`span`,{className:`flex size-7 items-center justify-center rounded-full [background:var(--bone)] [color:var(--bone-ink)]`,children:(0,B.jsx)(Of,{size:18,"aria-hidden":!0})}),(0,B.jsx)(`span`,{children:`New`})]})]})}function DD(){let e=im();return e<=0?null:(0,B.jsx)(`span`,{className:`font-inst absolute right-2 top-0 min-w-4 rounded-full border px-1 text-center text-xs font-semibold [color:#ff8260] [background:var(--blk-dim)] [border-color:rgba(255,94,54,.35)]`,children:e})}function OD(){return typeof window>`u`?!1:window.matchMedia?.(`(display-mode: standalone)`).matches===!0||window.navigator.standalone===!0}function kD(){let[e,t]=(0,v.useState)(null),[n,r]=(0,v.useState)(OD);(0,v.useEffect)(()=>{let e=e=>{e.preventDefault(),t(e)},n=()=>{r(!0),t(null)};return window.addEventListener(`beforeinstallprompt`,e),window.addEventListener(`appinstalled`,n),()=>{window.removeEventListener(`beforeinstallprompt`,e),window.removeEventListener(`appinstalled`,n)}},[]);let i=(0,v.useCallback)(async()=>{e!==null&&(await e.prompt(),await e.userChoice,t(null))},[e]);return{canInstall:e!==null&&!n,promptInstall:i}}function AD(){let{canInstall:e,promptInstall:t}=kD(),[n,r]=(0,v.useState)(!1);return!e||n?null:(0,B.jsxs)(`div`,{className:`flex flex-none items-center gap-3 border-t px-3 py-2 text-sm [border-color:var(--line)] [background:var(--panel)] [color:var(--ink)]`,children:[(0,B.jsx)(`span`,{className:`flex-1`,children:`Install crouter for quick, full-screen access.`}),(0,B.jsxs)(`button`,{type:`button`,onClick:()=>void t(),className:`flex items-center gap-1 rounded-md px-2 py-1 text-xs font-semibold [background:var(--bone)] [color:var(--bone-ink)]`,children:[(0,B.jsx)(gf,{size:14,"aria-hidden":!0}),`Install`]}),(0,B.jsx)(`button`,{type:`button`,onClick:()=>r(!0),"aria-label":`Dismiss install prompt`,className:`[color:var(--ink2)]`,children:(0,B.jsx)(Pf,{size:14,"aria-hidden":!0})})]})}function jD(e){let t=(0,v.useSyncExternalStore)(h_.subscribe,h_.getWarmIds),{nodes:n}=Sp();return(0,v.useMemo)(()=>{let r=t.includes(e)?t:[...t,e],i=new Map(n.map(e=>[e.node_id,e]));return r.map(e=>{let t=i.get(e);return{nodeId:e,title:t?Rm(t):e,dot:t?Um(t):`idle`}})},[t,n,e])}function MD(e,t,n){let r=e.findIndex(e=>e.nodeId===t);return r===-1?null:e[n===`next`?r+1:r-1]?.nodeId??null}function ND(e,t){let n=e.findIndex(e=>e.nodeId===t);if(n===-1)return null;let r=e[n+1];if(r)return r.nodeId;let i=e[n-1];return i?i.nodeId:null}var PD=48,FD=1.5,ID=24;function LD(e){if(e.scrolled||e.startX<ID)return null;let t=e.endX-e.startX,n=e.endY-e.startY;return Math.abs(t)<PD||Math.abs(t)<Math.abs(n)*FD?null:t<0?`next`:`prev`}function RD(e,t){return t>-48?!1:Math.abs(t)>=Math.abs(e)*FD}function zD({open:e,activeId:t,onClose:n}){let r=ut(),{nodes:i}=Sp(),a=im(),[o,s]=(0,v.useState)(``),c=(0,v.useMemo)(()=>Km(i),[i]),l=(0,v.useMemo)(()=>{let e=o.trim().toLowerCase();return e?c.filter(t=>t.title.toLowerCase().includes(e)):c},[c,o]);if((0,v.useEffect)(()=>{e&&s(``)},[e]),(0,v.useEffect)(()=>{if(!e)return;let t=e=>{e.key===`Escape`&&n()};return window.addEventListener(`keydown`,t),()=>window.removeEventListener(`keydown`,t)},[e,n]),!e)return null;let u=e=>{r(e),n()};return(0,B.jsx)(`div`,{role:`dialog`,"aria-modal":`true`,"aria-label":`Switch conversation`,className:`fixed inset-0 z-50 flex items-end bg-black/45 backdrop-blur-[2px]`,onMouseDown:e=>{e.target===e.currentTarget&&n()},children:(0,B.jsxs)(`section`,{className:`flex max-h-[88vh] w-full flex-col overflow-hidden rounded-t-3xl border-t border-border bg-[var(--panel)] shadow-2xl shadow-black/40`,children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-3 border-b border-border px-4 py-3`,children:[(0,B.jsx)(`p`,{className:`instlabel flex-1`,children:`Conversations`}),(0,B.jsx)(`button`,{type:`button`,onClick:n,"aria-label":`Close switcher`,className:`flex size-8 shrink-0 items-center justify-center rounded-full border border-border bg-transparent text-[var(--ink2)] transition-colors hover:text-[var(--ink)]`,children:(0,B.jsx)(Pf,{className:`size-4`})})]}),(0,B.jsx)(`div`,{className:`border-b border-border px-4 py-2`,children:(0,B.jsx)(`input`,{value:o,onChange:e=>s(e.currentTarget.value),placeholder:`Search conversations\\u2026`,className:`w-full bg-transparent text-sm outline-none [color:var(--ink)] placeholder:[color:var(--dim)]`})}),(0,B.jsxs)(`ul`,{className:`min-h-0 flex-none overflow-auto border-b border-border py-1`,children:[(0,B.jsx)(`li`,{children:(0,B.jsxs)(`button`,{type:`button`,onClick:()=>u(`/`),className:`flex w-full items-center gap-2.5 px-4 py-2.5 text-left transition-colors hover:bg-[color-mix(in_oklch,var(--ink)_6%,transparent)]`,children:[(0,B.jsx)(bf,{className:`size-4 shrink-0 [color:var(--ink2)]`,"aria-hidden":!0}),(0,B.jsx)(`span`,{className:`text-sm [color:var(--ink)]`,children:`Home`})]})}),(0,B.jsx)(`li`,{children:(0,B.jsxs)(`button`,{type:`button`,onClick:()=>u(`/inbox`),className:`flex w-full items-center gap-2.5 px-4 py-2.5 text-left transition-colors hover:bg-[color-mix(in_oklch,var(--ink)_6%,transparent)]`,children:[(0,B.jsx)(xf,{className:`size-4 shrink-0 [color:var(--ink2)]`,"aria-hidden":!0}),(0,B.jsx)(`span`,{className:`flex-1 text-sm [color:var(--ink)]`,children:`Inbox`}),a>0&&(0,B.jsx)(`span`,{className:`font-inst rounded-full border px-1.5 text-xs font-semibold [color:#ff8260] [background:var(--blk-dim)] [border-color:rgba(255,94,54,.35)]`,children:a})]})})]}),(0,B.jsx)(`ul`,{className:`min-h-0 flex-1 overflow-auto py-1 pb-[max(0.5rem,env(safe-area-inset-bottom))]`,children:l.length===0?(0,B.jsx)(`li`,{className:`px-4 py-3 text-sm italic [color:var(--mut)]`,children:`no conversations`}):l.map(e=>(0,B.jsx)(`li`,{children:(0,B.jsxs)(`button`,{type:`button`,onClick:()=>u(`/c/${encodeURIComponent(e.id)}`),className:Y(`flex w-full items-center gap-2.5 px-4 py-2.5 text-left transition-colors hover:bg-[color-mix(in_oklch,var(--ink)_6%,transparent)]`,e.id===t&&`bg-[color-mix(in_oklch,var(--ink)_6%,transparent)]`),children:[(0,B.jsx)(`span`,{className:Y(`dot shrink-0`,e.state===`needs-you`?`blocked`:e.state),"aria-hidden":!0}),(0,B.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,B.jsx)(`span`,{className:`block truncate text-sm [color:var(--ink)]`,children:e.title}),(0,B.jsx)(`span`,{className:`block truncate text-xs [color:var(--mut)]`,children:qm(e)})]})]})},e.id))})]})})}var BD=4;function VD({activeId:e}){let t=ut(),n=jD(e),[r,i]=(0,v.useState)(!1),[a,o]=(0,v.useState)(null),s=(0,v.useRef)(null),c=(0,v.useRef)(null),l=n=>{n!==e&&t(`/c/${encodeURIComponent(n)}`)},u=r=>{if(o(null),r===e){let e=ND(n,r);t(e?`/c/${encodeURIComponent(e)}`:`/`)}h_.evict(r)};return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`nav`,{"aria-label":`Panes`,className:`mobile-pane-bar flex flex-none items-stretch gap-1.5 border-t px-2 pt-1.5 [border-color:var(--line)] [background:var(--panel)]`,onTouchStart:e=>{let t=e.touches[0];t&&(c.current={x:t.clientX,y:t.clientY,scrollLeft:s.current?.scrollLeft??0})},onTouchEnd:r=>{let i=c.current;if(c.current=null,!i)return;let a=r.changedTouches[0];if(!a)return;let o=Math.abs((s.current?.scrollLeft??0)-i.scrollLeft)>BD,l=LD({startX:i.x,startY:i.y,endX:a.clientX,endY:a.clientY,scrolled:o});if(!l)return;let u=MD(n,e,l);u&&t(`/c/${encodeURIComponent(u)}`)},children:[(0,B.jsx)(`button`,{type:`button`,onClick:()=>i(!0),"aria-label":`Switch conversation`,className:`flex size-9 shrink-0 items-center justify-center self-center rounded-full border border-border bg-transparent text-[var(--ink2)] transition-colors hover:text-[var(--ink)]`,children:(0,B.jsx)(Cf,{className:`size-4`,"aria-hidden":!0})}),(0,B.jsx)(`div`,{ref:s,className:`flex min-w-0 flex-1 items-center gap-1.5 overflow-x-auto pb-1.5`,children:n.map(t=>(0,B.jsx)(WD,{entry:t,active:t.nodeId===e,revealed:a===t.nodeId,onReveal:()=>o(t.nodeId),onDismissReveal:()=>o(null),onSelect:()=>l(t.nodeId),onClose:()=>u(t.nodeId)},t.nodeId))}),(0,B.jsx)(`button`,{type:`button`,onClick:()=>mD(t),"aria-label":`New chat`,className:`mb-1.5 flex size-9 shrink-0 items-center justify-center self-center rounded-full [background:var(--bone)] [color:var(--bone-ink)]`,children:(0,B.jsx)(Of,{className:`size-4`,"aria-hidden":!0})})]}),(0,B.jsx)(zD,{open:r,activeId:e,onClose:()=>i(!1)})]})}var HD=480,UD=8;function WD({entry:e,active:t,revealed:n,onReveal:r,onDismissReveal:i,onSelect:a,onClose:o}){let s=(0,v.useRef)(null),c=(0,v.useRef)(null),l=(0,v.useRef)(!1),u=()=>{c.current&&=(clearTimeout(c.current),null)};return(0,B.jsxs)(`button`,{type:`button`,onTouchStart:e=>{let t=e.touches[0];t&&(s.current={x:t.clientX,y:t.clientY},l.current=!1,u(),c.current=setTimeout(()=>{l.current=!0,r()},HD))},onTouchMove:e=>{let t=s.current,n=e.touches[0];!t||!n||Math.hypot(n.clientX-t.x,n.clientY-t.y)>UD&&u()},onTouchEnd:e=>{u();let t=s.current;s.current=null;let n=e.changedTouches[0];if(!(!t||!n)){if(l.current){e.preventDefault();return}RD(n.clientX-t.x,n.clientY-t.y)&&(e.preventDefault(),o())}},onClick:()=>n?i():a(),"aria-label":n?`Close ${e.title}`:e.title,className:Y(`relative flex shrink-0 items-center gap-1.5 rounded-full border px-3 py-1.5 text-xs font-medium transition-colors`,t?`border-[color:var(--line2)] [background:var(--panel2)] [color:var(--ink)]`:`border-border bg-transparent [color:var(--ink2)]`),children:[(0,B.jsx)(`span`,{className:Y(`dot shrink-0`,e.dot),"aria-hidden":!0}),(0,B.jsx)(`span`,{className:`max-w-32 truncate`,children:e.title}),n&&(0,B.jsx)(`span`,{role:`button`,tabIndex:0,onClick:e=>{e.stopPropagation(),o()},"aria-label":`Close ${e.title}`,className:`ml-0.5 flex size-4 shrink-0 items-center justify-center rounded-full [background:var(--destructive)] text-white`,children:(0,B.jsx)(Pf,{className:`size-3`,"aria-hidden":!0})})]})}function GD({children:e}){let t=wD(st().pathname);return(0,B.jsxs)(`div`,{className:`mobile-shell-root flex flex-col overflow-hidden`,children:[(0,B.jsx)(`main`,{className:`min-h-0 flex-1 overflow-hidden`,children:e}),t===null?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(AD,{}),(0,B.jsx)(ED,{})]}):(0,B.jsx)(VD,{activeId:t},t)]})}function KD({children:e}){return sD()?(0,B.jsx)(GD,{children:e}):(0,B.jsx)(SD,{children:e})}var qD=`false`,JD=`false`,YD=qD===`true`,XD=JD===`true`;function ZD(e={}){let{immediate:t=!1,onNeedReload:n,onNeedRefresh:r,onOfflineReady:i,onRegistered:a,onRegisteredSW:o,onRegisterError:s}=e,c,l,u,d=async(e=!0)=>{await l,YD||u?.()};async function f(){if(`serviceWorker`in navigator){if(c=await w(async()=>{let{Workbox:e}=await import(`./workbox-window.prod.es5-Bd17z0YL.js`);return{Workbox:e}},[]).then(({Workbox:e})=>new e(`/sw.js`,{scope:`/`,type:`classic`})).catch(e=>{s?.(e)}),!c)return;if(u=()=>{c?.messageSkipWaiting()},!XD)if(YD)c.addEventListener(`activated`,e=>{(e.isUpdate||e.isExternal)&&(n?n():window.location.reload())}),c.addEventListener(`installed`,e=>{e.isUpdate||i?.()});else{let e=!1,t=()=>{e=!0,c?.addEventListener(`controlling`,e=>{e.isUpdate&&(n?n():window.location.reload())}),r?.()};c.addEventListener(`installed`,n=>{n.isUpdate===void 0?n.isExternal===void 0?!e&&i?.():n.isExternal?t():!e&&i?.():n.isUpdate||i?.()}),c.addEventListener(`waiting`,t)}c.register({immediate:t}).then(e=>{o?o(`/sw.js`,e):a?.(e)}).catch(e=>{s?.(e)})}}return l=f(),d}function QD(e={}){let{immediate:t=!0,onNeedReload:n,onNeedRefresh:r,onOfflineReady:i,onRegistered:a,onRegisteredSW:o,onRegisterError:s}=e,[c,l]=(0,v.useState)(!1),[u,d]=(0,v.useState)(!1),[f]=(0,v.useState)(()=>ZD({immediate:t,onNeedReload:n,onOfflineReady(){d(!0),i?.()},onNeedRefresh(){l(!0),r?.()},onRegistered:a,onRegisteredSW:o,onRegisterError:s}));return{needRefresh:[c,l],offlineReady:[u,d],updateServiceWorker:f}}function $D(){let{needRefresh:[e,t],offlineReady:[n,r],updateServiceWorker:i}=QD({onRegisterError(e){console.warn(`crtr web: service worker registration failed`,e)}});return(0,v.useEffect)(()=>{n&&(fm(`App ready to work offline`,`success`),r(!1))},[n,r]),{needRefresh:e,dismiss:()=>t(!1),refresh:()=>void i(!0)}}function eO(){let{needRefresh:e,dismiss:t,refresh:n}=$D();return e?(0,B.jsx)(`div`,{className:`pwa-update-banner px-3`,children:(0,B.jsxs)(`div`,{className:`pointer-events-auto flex items-center gap-3 rounded-lg border px-3 py-2 text-sm shadow-md [border-color:var(--line)] [background:var(--panel)] [color:var(--ink)]`,children:[(0,B.jsx)(`span`,{children:`Update ready`}),(0,B.jsxs)(`button`,{type:`button`,onClick:n,className:`flex items-center gap-1 rounded-md px-2 py-1 text-xs font-semibold [background:var(--bone)] [color:var(--bone-ink)]`,children:[(0,B.jsx)(kf,{size:14,"aria-hidden":!0}),`Refresh`]}),(0,B.jsx)(`button`,{type:`button`,onClick:t,"aria-label":`Dismiss update prompt`,className:`[color:var(--ink2)]`,children:(0,B.jsx)(Pf,{size:14,"aria-hidden":!0})})]})}):null}function tO(){let e=dm(e=>e.toasts),t=dm(e=>e.dismiss);return e.length===0?null:(0,B.jsx)(`div`,{className:`pointer-events-none fixed inset-x-0 bottom-4 z-50 flex flex-col items-center gap-2`,children:e.map(e=>(0,B.jsx)(`button`,{type:`button`,onClick:()=>t(e.id),className:Y(`pointer-events-auto border px-4 py-2 font-mono text-sm transition-opacity`,e.tone===`success`?`border-success/40 bg-success/10 text-success`:`border-border bg-card text-foreground`),children:e.message},e.id))})}function nO(){return(0,B.jsx)(On,{children:(0,B.jsxs)(Xd,{delayDuration:300,children:[(0,B.jsx)(pD,{}),(0,B.jsx)(fD,{}),(0,B.jsx)(KD,{children:(0,B.jsx)(dD,{})}),(0,B.jsx)(eO,{}),(0,B.jsx)(tO,{})]})})}document.documentElement.classList.add(`dark`),document.documentElement.classList.remove(`light`);var rO=document.getElementById(`root`);if(!rO)throw Error(`crtr web: #root element not found in index.html`);(0,b.createRoot)(rO).render((0,B.jsx)(v.StrictMode,{children:(0,B.jsx)(nO,{})}));
|