diff --git a/suites-experimental/chat-stream/.gitignore b/suites-experimental/chat-stream/.gitignore new file mode 100644 index 000000000..3c3629e64 --- /dev/null +++ b/suites-experimental/chat-stream/.gitignore @@ -0,0 +1 @@ +node_modules diff --git a/suites-experimental/chat-stream/README.md b/suites-experimental/chat-stream/README.md new file mode 100644 index 000000000..df1fdd708 --- /dev/null +++ b/suites-experimental/chat-stream/README.md @@ -0,0 +1,69 @@ +# ChatStream + +An LLM chat client: a sidebar of conversations, a message list, and a +composer, with assistant replies streamed in a few tokens at a time and +rendered as Markdown. It is written in Octane (`octane/App.tsrx`, +ChatStream-Octane). The corpus, Markdown parser, network stub and stylesheet +are in `shared/`. + +It is an original app and ships no third-party assets. It is adapted from the +`chat-stream` benchmark in the Octane repository, with Markdown replies, code +highlighting and scroll pinning added. + +## What are we testing + +- Streaming: chunks append to the reply's text, and rendering re-parses the + reply's Markdown. Unchanged blocks keep their identity across parses (the + memoized-Markdown pattern streaming chat UIs use), so `memo` skips all but + the blocks that grew. +- Code blocks highlighted into one span per token, the way chat UIs' regex + highlighters produce them. +- Scroll pinning with CSS scroll anchoring: an anchor element after the + messages (the list's only `overflow-anchor: auto` candidate) keeps the + newest text in view as replies grow and conversations switch. The browser + adjusts the scroll position during its own layout, so no script reads + layout after a commit. +- Mounting and unmounting whole conversations, up to 200 messages. +- A controlled composer updated on every keystroke. + +## How are we testing + +All content comes from one fixed seed in `shared/corpus.js`. There is no network, +storage, `Math.random` or `Date.now`, so every run renders the same +conversations and streams the same replies. + +`shared/network.js` stands in for a streaming fetch. Each `window.deliverChunk()` +call hands the open reply its next four tokens, so chunk arrival is +deterministic and needs no timers. + +The app commits the way the Octane fixture of the chat-stream benchmark in the +Octane repository does. Its event handlers only set state, and the steps commit +it through `window.__benchFlush` after every interaction, as that benchmark's +`run.mjs` does. Each chunk renders with `flushSync`, since a chunk arrives +outside any event. So each send, chunk, conversation click and keystroke is on +screen before the step's next interaction. A step stops delivering chunks once +the reply loses its `streaming` class (see `chatStreamTests` in +`suites-experimental/suites.mjs`). No step yields to the event loop before it +ends, so every browser paints once per step. + +- `StreamReplies`: sends three prompts in turn in the first conversation, + streaming each reply to completion before sending the next. +- `SwitchConversations`: clicks every conversation in the sidebar, then returns + to the first. +- `StreamIntoLongConversation`: streams one reply at the end of the + 200-message conversation. +- `TypePrompt`: types a 163-character prompt into the composer one character + at a time. + +The composer uses `onInput`, which fires for every input event, including the +ones the benchmark dispatches after setting the value from script. + +## Developer Documentation + +The app is built with Vite. It can be previewed during development with +`npm run dev`. To update the files run in the harness, run `npm run build`, +which regenerates the committed `dist/octane` directory and its +`resources.txt`. + +The built workload can be loaded within the harness at e.g. +`http://localhost:8080/?developerMode&suites=ChatStream-Octane`. diff --git a/suites-experimental/chat-stream/dist/octane/assets/index-DEIczM35.css b/suites-experimental/chat-stream/dist/octane/assets/index-DEIczM35.css new file mode 100644 index 000000000..fcdff3f0b --- /dev/null +++ b/suites-experimental/chat-stream/dist/octane/assets/index-DEIczM35.css @@ -0,0 +1 @@ +*{box-sizing:border-box}html,body{height:100%;margin:0}body{color:#1d2125;background-color:#fff;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif;font-size:15px;line-height:1.55}#root{height:100vh}button{font:inherit;color:inherit;cursor:pointer}.app{grid-template-columns:260px 1fr;height:100vh;display:grid;overflow:hidden}.sidebar{background-color:#f5f6f8;border-right:1px solid #e4e7eb;flex-direction:column;min-height:0;padding:12px 8px;display:flex}.sidebar-heading{letter-spacing:.04em;text-transform:uppercase;color:#6b7380;margin:4px 10px 8px;font-size:12px;font-weight:600}.conversation-list{flex-direction:column;gap:2px;display:flex;overflow-y:auto}.conversation-item{text-align:left;text-overflow:ellipsis;white-space:nowrap;background:0 0;border:0;border-radius:6px;width:100%;padding:7px 10px;display:block;overflow:hidden}.conversation-item:hover{background-color:#e9ebef}.conversation-item.active{background-color:#e1e5eb;font-weight:600}.chat{flex-direction:column;min-width:0;min-height:0;display:flex}.chat-header{border-bottom:1px solid #eef0f3;align-items:center;height:52px;padding:0 24px;display:flex}.chat-header h1{text-overflow:ellipsis;white-space:nowrap;margin:0;font-size:16px;font-weight:600;overflow:hidden}.chat-header .message-count{color:#6b7380;margin-left:auto;font-size:13px}.messages{flex:1;min-height:0;overflow-y:auto}.messages-inner{overflow-anchor:none;max-width:760px;margin:0 auto;padding:16px 24px 32px}.scroll-anchor{overflow-anchor:auto;height:1px}.message{gap:14px;padding:14px 0;display:flex}.avatar{color:#fff;border-radius:50%;flex:none;justify-content:center;align-items:center;width:30px;height:30px;font-size:11px;font-weight:700;display:inline-flex}.message.user .avatar{background-color:#5b6b7f}.message.assistant .avatar{background-color:#c2662d}.message-body{flex:1;min-width:0}.message-author{margin-bottom:2px;font-weight:600}.user-text{white-space:pre-wrap;margin:0}.message.streaming .markdown>:last-child:after{vertical-align:text-bottom;content:"";background-color:currentColor;width:8px;height:1em;margin-left:2px;display:inline-block}.thinking{color:#6b7380}.message-actions{gap:4px;margin-top:6px;display:flex}.message-actions button{color:#6b7380;background:0 0;border:1px solid #0000;border-radius:4px;padding:2px 8px;font-size:12px}.message-actions button:hover{border-color:#dfe3e8}.markdown p,.markdown ul,.markdown ol{margin:0 0 12px}.markdown ul,.markdown ol{padding-left:24px}.markdown li+li{margin-top:4px}.markdown h3{margin:18px 0 8px;font-size:16px}.markdown .inline-code{background-color:#f0f2f5;border-radius:4px;padding:1px 4px;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:.88em}.code-block{background-color:#1f2329;border-radius:8px;margin:0 0 12px;overflow:hidden}.code-header{color:#aeb6c2;background-color:#2a2f37;justify-content:space-between;align-items:center;padding:4px 12px;font-size:12px;display:flex}.code-header button{color:inherit;background:0 0;border:0;padding:2px 6px;font-size:12px}.code-block pre{color:#e6e9ee;margin:0;padding:12px 14px;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:13px;line-height:1.5;overflow-x:auto}.code-block .line{white-space:pre;min-height:1.5em;display:block}.tok-keyword{color:#c792ea}.tok-function{color:#82aaff}.tok-string{color:#c3e88d}.tok-number{color:#f78c6c}.tok-comment{color:#7f8794;font-style:italic}.tok-punctuation{color:#89ddff}.composer{width:100%;max-width:760px;margin:0 auto;padding:0 24px 20px}.composer-box{border:1px solid #d8dde3;border-radius:12px;align-items:flex-end;gap:8px;padding:8px 8px 8px 14px;display:flex;box-shadow:0 1px 3px #0000000f}.prompt{height:72px;font:inherit;resize:none;border:0;outline:none;flex:1;padding:4px 0}.send{color:#fff;background-color:#c2662d;border:0;border-radius:8px;padding:6px 14px;font-weight:600}.send:disabled{cursor:default;opacity:.4}.composer-hint{color:#8a929e;text-align:center;margin-top:6px;font-size:12px} diff --git a/suites-experimental/chat-stream/dist/octane/assets/index-DZAT5HXC.js b/suites-experimental/chat-stream/dist/octane/assets/index-DZAT5HXC.js new file mode 100644 index 000000000..4180349fa --- /dev/null +++ b/suites-experimental/chat-stream/dist/octane/assets/index-DZAT5HXC.js @@ -0,0 +1,12 @@ +function e(e){return`Minified Octane error #${e}; visit https://octanejs.dev/errors/${e} for the full message or use a development build for full errors and additional helpful warnings.`}var t=new WeakMap;function n(e,n,r){let i=t.get(e),a=i?.get(n)??0,o=r?2:1;return(a&o)!==0&&((a&~o)===0?i.delete(n):i.set(n,a&~o),!0)}function r(e){t.delete(e)}function i(e){if(typeof e==`string`)return e;if(typeof e!=`object`)return typeof e==`number`&&e?``+e:``;if(e===null)return``;let t=``;if(Array.isArray(e))for(let n=0;n32&&t<127&&t!==74&&t!==106?e:a.test(e)?o:e}function l(e,t){return e=e===void 0?void 0:e.toLowerCase(),e!==void 0&&e.includes(`-`)&&!s.has(e)?!1:(t=t.toLowerCase(),t===`src`||t===`href`||t===`action`||t===`formaction`||t===`xlink:href`||t===`xlinkhref`||t===`data`&&e===`object`)}function u(e,t,n){return l(e,t)?c(n):n}var d=`https://octanejs.dev/errors/`,f=/[\uD800-\uDFFF]/gu;function p(e){return encodeURIComponent(String(e).replace(f,`�`))}function m(e,t){let n=d+e;for(let e=0;e=65&&r<=90){t=!0;break}}if(!t)return e;let n=``;for(let t=0;t=65&&r<=90?`-`+String.fromCharCode(r+32):e[t]}return n.charCodeAt(0)===109&&n.charCodeAt(1)===115&&n.charCodeAt(2)===45&&(n=`-`+n),n}var x={active:!1},S=globalThis[Symbol.for(`octane.contextEpoch`)]??={value:0};function C(){S.value++}var w=new Set([`area`,`base`,`br`,`col`,`embed`,`hr`,`img`,`input`,`link`,`meta`,`param`,`source`,`track`,`wbr`]),T=new Set([`allowfullscreen`,`async`,`autoplay`,`controls`,`credentialless`,`default`,`defer`,`disabled`,`disablepictureinpicture`,`disableremoteplayback`,`formnovalidate`,`hidden`,`inert`,`itemscope`,`loop`,`nomodule`,`novalidate`,`open`,`playsinline`,`readonly`,`required`,`reversed`,`scoped`,`seamless`]),E=new Set([`size`,`cols`,`rows`,`span`]),D=new Set(`altGlyph.altGlyphDef.altGlyphItem.animate.animateColor.animateMotion.animateTransform.circle.clipPath.defs.desc.ellipse.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.filter.font-face.font-face-format.font-face-name.font-face-src.font-face-uri.foreignObject.g.glyph.glyphRef.hkern.image.line.linearGradient.marker.mask.metadata.missing-glyph.mpath.path.pattern.polygon.polyline.radialGradient.rect.set.stop.switch.symbol.text.textPath.tref.tspan.use.view.vkern`.split(`.`)),ee=new Map([[`acceptCharset`,`accept-charset`],[`htmlFor`,`for`],[`httpEquiv`,`http-equiv`],[`crossOrigin`,`crossorigin`],[`accentHeight`,`accent-height`],[`alignmentBaseline`,`alignment-baseline`],[`arabicForm`,`arabic-form`],[`baselineShift`,`baseline-shift`],[`capHeight`,`cap-height`],[`clipPath`,`clip-path`],[`clipRule`,`clip-rule`],[`colorInterpolation`,`color-interpolation`],[`colorInterpolationFilters`,`color-interpolation-filters`],[`colorProfile`,`color-profile`],[`colorRendering`,`color-rendering`],[`dominantBaseline`,`dominant-baseline`],[`enableBackground`,`enable-background`],[`fillOpacity`,`fill-opacity`],[`fillRule`,`fill-rule`],[`floodColor`,`flood-color`],[`floodOpacity`,`flood-opacity`],[`fontFamily`,`font-family`],[`fontSize`,`font-size`],[`fontSizeAdjust`,`font-size-adjust`],[`fontStretch`,`font-stretch`],[`fontStyle`,`font-style`],[`fontVariant`,`font-variant`],[`fontWeight`,`font-weight`],[`glyphName`,`glyph-name`],[`glyphOrientationHorizontal`,`glyph-orientation-horizontal`],[`glyphOrientationVertical`,`glyph-orientation-vertical`],[`horizAdvX`,`horiz-adv-x`],[`horizOriginX`,`horiz-origin-x`],[`imageRendering`,`image-rendering`],[`letterSpacing`,`letter-spacing`],[`lightingColor`,`lighting-color`],[`markerEnd`,`marker-end`],[`markerMid`,`marker-mid`],[`markerStart`,`marker-start`],[`overlinePosition`,`overline-position`],[`overlineThickness`,`overline-thickness`],[`paintOrder`,`paint-order`],[`panose-1`,`panose-1`],[`pointerEvents`,`pointer-events`],[`renderingIntent`,`rendering-intent`],[`shapeRendering`,`shape-rendering`],[`stopColor`,`stop-color`],[`stopOpacity`,`stop-opacity`],[`strikethroughPosition`,`strikethrough-position`],[`strikethroughThickness`,`strikethrough-thickness`],[`strokeDasharray`,`stroke-dasharray`],[`strokeDashoffset`,`stroke-dashoffset`],[`strokeLinecap`,`stroke-linecap`],[`strokeLinejoin`,`stroke-linejoin`],[`strokeMiterlimit`,`stroke-miterlimit`],[`strokeOpacity`,`stroke-opacity`],[`strokeWidth`,`stroke-width`],[`textAnchor`,`text-anchor`],[`textDecoration`,`text-decoration`],[`textRendering`,`text-rendering`],[`transformOrigin`,`transform-origin`],[`underlinePosition`,`underline-position`],[`underlineThickness`,`underline-thickness`],[`unicodeBidi`,`unicode-bidi`],[`unicodeRange`,`unicode-range`],[`unitsPerEm`,`units-per-em`],[`vAlphabetic`,`v-alphabetic`],[`vHanging`,`v-hanging`],[`vIdeographic`,`v-ideographic`],[`vMathematical`,`v-mathematical`],[`vectorEffect`,`vector-effect`],[`vertAdvY`,`vert-adv-y`],[`vertOriginX`,`vert-origin-x`],[`vertOriginY`,`vert-origin-y`],[`wordSpacing`,`word-spacing`],[`writingMode`,`writing-mode`],[`xmlnsXlink`,`xmlns:xlink`],[`xHeight`,`x-height`],[`xlinkActuate`,`xlink:actuate`],[`xlinkArcrole`,`xlink:arcrole`],[`xlinkHref`,`xlink:href`],[`xlinkRole`,`xlink:role`],[`xlinkShow`,`xlink:show`],[`xlinkTitle`,`xlink:title`],[`xlinkType`,`xlink:type`],[`xmlBase`,`xml:base`],[`xmlLang`,`xml:lang`],[`xmlSpace`,`xml:space`],[`tabIndex`,`tabindex`]]);function te(e){switch(e.length){case 10:return e.toLowerCase()===`spellcheck`;case 9:return e.toLowerCase()===`draggable`;case 15:return e.toLowerCase()===`contenteditable`}return!1}var O=w,ne=T,re=E,ie=/^[^\s"'>\/=\u0000-\u001F]+$/,ae=D,oe=ee,se=te,ce=y,le=`Abort AnimationEnd AnimationIteration AnimationStart AuxClick BeforeInput BeforeToggle Blur Cancel CanPlay CanPlayThrough Change Click Close CompositionEnd CompositionStart CompositionUpdate ContextMenu Copy Cut DoubleClick Drag DragEnd DragEnter DragExit DragLeave DragOver DragStart Drop DurationChange Emptied Encrypted Ended Error Focus GotPointerCapture Input Invalid KeyDown KeyPress KeyUp Load LoadedData LoadedMetadata LoadStart LostPointerCapture MouseDown MouseEnter MouseLeave MouseMove MouseOut MouseOver MouseUp Paste Pause Play Playing PointerCancel PointerDown PointerEnter PointerLeave PointerMove PointerOut PointerOver PointerUp Progress RateChange Reset Resize Scroll ScrollEnd Seeked Seeking Select Stalled Submit Suspend TimeUpdate Toggle TouchCancel TouchEnd TouchMove TouchStart TransitionCancel TransitionEnd TransitionRun TransitionStart VolumeChange Waiting Wheel`,ue;function de(e){if(ue===void 0){ue=new Set;for(let e of le.split(` `))ue.add(`on`+e),ue.add(`on`+e+`Capture`)}return ue.has(e)}var fe=`abort.beforetoggle.cancel.canplay.canplaythrough.close.durationchange.emptied.encrypted.ended.error.load.loadeddata.loadedmetadata.loadstart.pause.play.playing.progress.ratechange.resize.seeked.seeking.stalled.suspend.timeupdate.toggle.volumechange.waiting`.split(`.`),pe=new Set([`focus`,`blur`,`invalid`,`pointerenter`,`pointerleave`,`mouseenter`,`mouseleave`,`scroll`,`scrollend`,...fe]),me=new Set([`pointerenter`,`pointerleave`,`mouseenter`,`mouseleave`,`scroll`,`scrollend`]),he=new Set(`auxclick.beforeblur.beforeinput.blur.cancel.change.click.close.compositionend.compositionstart.compositionupdate.contextmenu.copy.cut.dblclick.dragend.dragstart.drop.focus.focusin.focusout.fullscreenchange.gotpointercapture.hashchange.input.invalid.keydown.keypress.keyup.lostpointercapture.mousedown.mouseup.paste.pause.play.pointercancel.pointerdown.pointerup.popstate.ratechange.reset.resize.seeked.select.selectionchange.selectstart.submit.textInput.touchcancel.touchend.touchstart.volumechange`.split(`.`)),ge=[`input`,`change`,`click`],_e=new Set(ge);function ve(e){return(pe.has(e)?4:0)|(me.has(e)?8:0)|(he.has(e)?16:0)|(_e.has(e)?32:0)|(e===`click`||e===`dblclick`||e===`mousedown`||e===`mousemove`||e===`mouseup`?64:0)|(e===`mouseenter`?128:0)|(e===`invalid`||fe.includes(e)?256:0)}var ye=Object.prototype.hasOwnProperty;function be(e){if(typeof e!=`object`||!e)return null;let t=typeof Symbol==`function`&&e[Symbol.iterator]||e[`@@iterator`];return typeof t==`function`?t:null}var xe=Symbol.for(`octane.flags.component`);function Se(e,t){return typeof e==`function`&&ye.call(e,xe)&&(e[xe]&t)===t}var Ce=`[b;`,we=`;b;`,Te=`[f0`+we;``+we,Te.length,Ce.length;var Ee=Symbol.for(`octane.element`),De=Symbol.for(`octane.portal`),Oe=Symbol.for(`octane.childrenBlock`);function ke(e,t,n,r,i){let a=Le(e);if(a!==null&&t.isConnected===!0&&e.ownerDocument===t.ownerDocument&&!(i&&Re(t,r))){a.call(e,t,n);return}if(!Re(t,r)||!Fe(t,e)||n!==null&&!Fe(n,e)){e.insertBefore(t,n);return}if(t===n||Ie(t)===n)return;let o=n===null||!!(Ne(t).compareDocumentPosition.call(t,n)&4),s=[];for(let e=o?Ie(t):n;e!==null&&e!==(o?n:t);e=Ie(e))s.push(e);let c=a??e.insertBefore,l=t;for(let n=0;nnull,Xe=A,Ze=A,Qe=A,$e=A,et=!1;function tt(){et=!0,Ve=!0,Ye=Lr,Xe=Rr,Ze=fr,Qe=Vr,$e=Cr}var nt=e=>e,k=null,rt=A,it=A,at=null;function ot(e){at=e}var st=A,ct=()=>!1,lt=A;function ut(e,t,n){Ue===A&&(Ve=!0,Ue=ir,We=ul,Ge=ku),ft?.(e.block,n);let r=V,i={ref:t,el:n,block:e.block,op:r===null?mn:r.ops.length};(H===null?P:H.refs).push(i)}var dt=0,ft=null,pt=null;function A(){}function mt(e,t){rt===A&&(Ve=!0,rt=Bf),e.push(t)}function ht(e){let t=Sf(e);return t===void 0&&(k??={begin:lf,delivery:cf,enqueue:Kf,finish:rf,restore:Wf},t={v:af,c:-1,sv:null,sawV:!1,sawC:!1,sawDC:!1,dvv:af,composing:!1,compositionEndTask:void 0,queued:!1,formSeen:!1,formMultiple:!1,formChildren:!1},e.$$ctrl=t,xd(ge)),t}var gt=null,_t=new WeakMap;function vt(e,t){if(typeof t==`string`){e.signalInstanceResolved=t;return}let n=t.parentScope,r=t.invocationSite===`r:`;e.signalInstanceParent=r?n.signalInstanceParent:n,e.signalInstanceSite=r?n.signalInstanceSite:t.invocationSite,e.signalInstanceValue=r?n.signalInstanceValue:t.key,e.signalInstanceHasKey=r?n.signalInstanceHasKey:t.hasKey,e.signalInstanceResolved=r?n.signalInstanceResolved:void 0}function yt(e,t){return t()}function bt(e,t,n=!1){return!1}var xt=null,St=null,Ct=0;function wt(e){let t=St??=new Map;t.has(e)||t.set(e,{value:e.value,base:e.base,last:e.last})}function j(t){let n=xt,r=St;n===null&&Ct++,xt=t,St=null;try{let i=0;for(;Ma(t);){if(t.rare?.updateError)throw t.rare.updateError=!1,In(t);if(++i>25)throw Error(e(9))}let a=St;if(a!==null&&n!==null&&Or(n,t)){r??=new Map;for(let[e,t]of a)r.has(e)||r.set(e,t)}}catch(e){let n=St;if(n!==null){for(let[e,t]of n)Hi(e,t);Vi(n),t.crossRenderUpdate||(t.pending=!1)}throw e}finally{xt=n,St=r}}var Tt=A;function Et(e,t){return t()}var Dt=[];function Ot(e,t){let n=P,r=e,i=t;for(let a of n.slice(e,t)){for(;i0||an>0&&xi()}var sn=null,cn=null,ln=!1,un=null,dn=0,fn=null,pn=0,mn=0,hn=[];function gn(e){let t=V;t===null||t.aborted||e.idState.renderOwner!==t.owner||_n(e,t,!0)}function _n(e,t,n){for(let r=e;r!==null;r=n?null:r.nextSibling)(r.pending||r.rare?.updateError===!0||r.hooks!==null||r.effectSlots!==null||r.cleanups!==null||r.children!==null||r._slots!==null||r.signalOwner!==void 0||r.signalTokenEscaped)&&((t.retired??=new Set).add(r),r.pending&&(r.pending,r.pending=!1))}function vn(e,t,n){let r=t,i=e;for(let e=r.firstChild;e!==null;e=r.firstChild)i.insertBefore(e,n);t.$$next=void 0}function yn(e,t){return t.createdStamp===e.createdStamp}function bn(e){let t=At.length;R(e,!1),At.length=t}function xn(e){let t=V;t!==null&&e.createdStamp!==t.createdStamp&&(e.createdStamp=t.createdStamp,e.kind!==`portal`&&t.hydrating,(t.created??=[]).push(e))}function Sn(e){if(e.aborted)return;e.aborted=!0,e.cells=null;let t=wa(e.owner);try{e.log,e.ops.length=0;let t=e.created;if(t!==null)for(let e=t.length-1;e>=0;e--)t[e].disposed||bn(t[e]);Cs(e.capture)}finally{Ta(t)}}function Cn(){try{let e=hn;e.length!==0&&(hn=[]);for(let t of e){if(t.rendering!==0){hn.push(t);continue}let e=t.owner;try{if(t.holders,t.aborted||e.disposed){e.transaction===t&&(e.transaction=null);continue}e.transaction===t&&(e.transaction=null),t.rootRequest&&un?.has(e)!==!0&&(e.wakeable=null,e.generation++),e.wakeable===null&&(e.retryKey=null,e.nativeRetry?.clear());let n=bt(t.capture,e,!0);t.cells!==null&&ii(t.cells),t.batches!==null&&(un===null||un.size);let r=e.generation,i=t.ops,a=P.length;if(i.length!==0){let t=fn,n=pn;fn=e,pn=r;try{for(let t=0;ta&&Ot(a,o)}finally{t.ops.length===0&&e.transaction!==t&&(e.spareOps=t.ops)}}}finally{}}var P=[];function wn(e){e._reapply(),Rt(e._currentRef,e)}var Tn=new Set;function En(){if(Tn.size!==0)for(let e of Tn)e._reapply()}var Dn=0,On=null,kn=50,An=0,jn=0,Mn=!1,Nn=-1;function Pn(){jn++}var Fn=class extends Error{};function In(e){return new Fn(h(1))}function Ln(e,t){let n=zi(e);n.updateChain!==jn&&(n.updateChain=jn,n.updateCount=0),++n.updateCount>kn&&(n.updateCount===51&&Kt<=1&&Gt!==2&&et&&(F[2].length>0||Br.length>0)?Nn=jn:(Nn=-1,n.updateError=!0))}function Rn(e,t,n,r){if(e.disposed)return;let i=B===e;B===null||i&&z===e||dn!==0||Yt!==0||(e.crossRenderUpdate=!0);let a=(rn>0||an>0)&&on()||i&&e.currentRenderMode===`transition`?`transition`:`urgent`,o=ln||i&&e.currentRenderDeferred;e.pending?(!r&&tn.length!==0&&Ke.upgrade(e,a,n),a===`urgent`&&(e.pendingMode=`urgent`,e.pendingDeferred=!1)):(Gt===2&&(!en||N)||(t||Sr()?(Mn=!0,Ln(e,t)):B===null&&(An++,++jn,e.rare!==null&&(e.rare.updateCount=0,e.rare.updateError=!1))),e.pending=!0,e.pendingMode=a,e.pendingDeferred=o,M.push(e),en||$t||($t=!0,queueMicrotask(Gn)))}var zn=0;function Bn(e,t){for(let n=e;n!==null;n=n.parentBlock)if(n===t)return!0;return!1}function Vn(e,t=!1){let n=null,r=0,i=0,a=Qt;try{for(;r=(t?kn:25))throw t?In():Error(h(9));n.set(o,e+1),o.crossRenderUpdate=!1,j(o)}catch(e){ha(o,e)}a!==Qt&&(a=Qt,r=0,i=0)}}}finally{if(a===Qt){for(;r1&&Hn(M,t);for(let n=0;n(o?kn:25))throw o?In():Error(h(9))}else r.drainStamp=t,r.drainRenders=1;{let e=r.idState.renderOwner;if(e!==void 0&&e.current===r&&e.request!==null){let t=e.request;e.request=null;let n=r.pendingMode??`urgent`;r.pendingMode=null,t(n)}else s(r)}}catch(t){try{ha(r,t)}catch(t){let n=r.idState.renderOwner?.transaction;n!=null&&(Sn(n),n.holders=null);let i=t;ct(r,i)||(e===null?e={err:i,all:[i]}:(e.all.push(i),e.err=typeof AggregateError==`function`?AggregateError(e.all,h(13)):e.all[0]));let a=r;for(;a.parentBlock!==null;)a=a.parentBlock;a.kind===`root`&&!a.disposed&&(l=a)}}finally{Ta(c),l===null||l.disposed||R(l)}}return M.length=0,Qt++,Cn(),e}function Gn(){if($t=!1,N)(M.length>0||hn.length>0)&&!$t&&($t=!0,queueMicrotask(Gn));else if(Dr()||At.length!==0||P.length!==0||Tn.size!==0||Ci.length!==0)try{Qn()}catch(e){if(Dn===0)throw e;(On??=[]).push(e)}}var Kn=null,qn=null;function Jn(e){if(e===null&&Kn===null)return Wn();let t=Kn,n=qn;Kn=e,qn=null;try{return Wn()}finally{try{Du()}finally{qn=n,Kn=t}}}function Yn(e,t){let n=null;if(Array.isArray(t)){for(let r=0;r0||hn.length>0)&&t<50;t++){$n();let t=M.length===0?null:Tu(),n=Jn(t);t!==null&&Eu(t),n!==null&&e===null&&(e=n),cr()}return e}function Zn(e){try{k&&k.restore()}finally{throw e}}function Qn(){try{N=!0;let e=Ci.length>0;try{M.length>0&&$n();let e=M.length===0?null:Tu(),t=Jn(e);if(e!==null&&Eu(e),cr(),(M.length>0||hn.length>0)&&(t=Xn(t)),t!==null)throw t.err}finally{N=!1,(e||Ci.length>0)&&tn.length===0&&Ti()}}catch(e){Zn(e)}k&&k.restore()}function $n(){et&&(F[2].length>0||Br.length>0)&&Tr()}function er(e){if(N)return e();let t=en;en=!0;let n;try{try{n=e(),N=!0;let t=Gt;Gt=-1;let r=null;try{M.length>0&&$n();let e=M.length===0?null:Tu();r=Jn(e),e!==null&&Eu(e),cr(),(M.length>0||hn.length>0)&&(r=Xn(r))}finally{N=!1,(Ci.length!==0||wi!==null)&&Ti(),Gt=t}if((M.length>0||hn.length>0)&&!$t&&($t=!0,queueMicrotask(Gn)),r!==null)throw r.err}finally{en=t}}catch(e){Zn(e)}return k&&k.restore(),n}var tr=new Map;function nr(e){let t=tr;for(let n=0;ne[t]===i.ref);if(t!==-1&&t1){let t=e[0].block?.parentBlock??null;for(let n=1;n0||Br.length>0)&&!xr&&$e(),Kt===0&&(Mn?Mn=!1:Nn===jn?Pn():jn++);return}let e=rn,t=sn;rn=0,sn=null,Kt++;try{Je();let e=zr();rt();let t=Ye();sr(),En(),t!==null&&Xe(t),e!==null&<(e),Vt(),et&&(F[2].length>0||Br.length>0)&&!xr&&$e(),Kt===1&&(Mn?Mn=!1:Nn===jn?Pn():jn++)}finally{rn=e,sn=t,lr()}}function lr(){if(--Kt!==0||qt===null)return;let e=qt;qt=null;for(let{block:t,error:n,handler:r}of e)ur(t,n,r)}function ur(e,t,n){if(Kt>0){(qt??=[]).push({block:e,error:t,handler:n});return}let r=n===void 0?ma(e):n;if(r!==null){st(e,t,r(t));return}let i=e;for(;i!==null&&i.parentBlock!==null;)i=i.parentBlock;i!==null&&i.kind===`root`&&!i.disposed&&(R(i),Tt()),ct(e,t)||console.error(t)}function dr(e){if(e.fn===null)return;let t,n=e.scope.hooks?.get(e.slot);if(n!==void 0&&n.revision===e.revision&&Ir(e,n)){n.connectedFn=e.fn,n.connectedArgs=e.args,n.disconnected=!1;try{let n=Gt;Gt=e.phase,Wt++;try{t=e.fn.apply(null,e.args)}finally{Wt--,Gt=n}}catch(t){if(t instanceof Fn)throw t;ur(e.scope.block,t);return}typeof t==`function`&&(n.cleanup=t)}}function fr(){if(Nn===jn){if(M.length!==0)return;Pn()}Kt++;try{Qe();let e=F[2];if(e.length===0)return;let t=e.splice(0);t.sort(Ar);for(let e=0;e{if(i.disposed)return;let n=a;if(n.queue===null&&!(i.pending&&typeof e==`function`)){let r;try{r=typeof e==`function`?e(n.value):e}catch{oi(n,i,Si(i),e,`state`,t);return}let a=sn===null&&(Od>0||en)?null:Si(i);if(Object.is(r,n.value))return;if(a===null){if(or&&Jt>0){let e=ar??=new Map,t=n;if(!e.has(t)){let r={block:i,previous:n.value};e.set(t,r)}n.value=r;return}B===i&&wt(n),n.value=r,i.disposed,Rn(i),un!==null&&un.size!==0&&si(i);return}oi(n,i,a,e,`state`,t)}else oi(n,i,Si(i),e,`state`,t)},getter:void 0},Xr(r).set(t,a)}return a}var mr=0;function hr(e){e.$$retiredEpoch=++_r,mr===0&&(mr=_r,fn===null&&queueMicrotask(()=>{mr=0}))}var gr=0,_r=0;function vr(e,t){let n=fd.get(e);fd.set(e,{count:(n?.count||0)+t,since:++_r,previous:n}),n!==void 0&&setTimeout(()=>{let t=fd.get(e);t!==void 0&&(t.previous=void 0)},0)}function yr(e,t,n,r,i,a,o,s,c){let l,u=!1,d=-1,f=0,p=e=>{let n=!1;Ut.set(e,()=>{if(!(n||t!==e)){n=!0;try{l.unmount()}finally{n=!1}}})},m={current:t,signalOwner:s,retry:A,request:null,generation:0,wakeable:null,retryKey:null,transaction:null,disposed:!1,spareOps:[]};i.renderOwner=m;let g=(o,s,c,d,f=!1)=>{if(u)return;if(C(),t&&!t.disposed&&n===o&&Object.is(r,c)){let e=t;m.request=t=>{m.transaction.rootRequest=!0,e.props,e.props=s,e.pendingMode=t,j(e)},Rn(t);return}if(d===void 0&&t!==null&&!t.disposed&&on()){m.request=e=>g(o,s,c,e),Rn(t);return}if(!N&&B===null&&d===void 0&&!on()&&u)return;let h=wa(m);m.transaction.rootRequest=!0;let _=t,v=e.nodeType!==9&&_!==null&&_.mounted&&!_.disposed&&!yn(m.transaction,_),y=v?K(e):null,b=v?e.lastChild:null;try{t&&(Ut.delete(t),v||R(t),t=null,n=null,r=null);let u=null,g=null,x=null;v?(u=document.createComment(`root`),g=document.createComment(`/root`),x=Wl(null,e,null).$$next,x.frag.append(u,g)):m.hydrationFallback===void 0?(x=Wl(null,e,null).$$next,x.out.push(()=>Ja(e),null,null)):x=m.hydrationFallback(!1),t=L(`root`,null,x===null?e:x.frag,u,g,o,s,void 0,a),x!==null&&(x.owner=t,Jl(x.frag,t)),t.idState=i,m.current=t,xn(t),p(t),n=o,r=c;let S=d===void 0&&on();if(S||d===void 0&&an>0&&Bt>0){t.pending=!0,t.pendingMode=S?`transition`:`urgent`,M.push(t),!en&&!$t&&($t=!0,queueMicrotask(Gn));return}let C=t;C.pendingMode=d??null,C.pendingDeferred=f;try{j(C),M.length>0&&Vn(C)}catch(e){let n=!1;try{ha(C,e)}catch(r){n=!0,e=r;let i=m.transaction;i!==null&&Sn(i),v&&!_.disposed&&R(_),t!==null&&!t.disposed&&R(t)}if(Ta(h),h=null,!n){m.wakeable===null&&l.unmount();return}if(m.hydrationFallback?.(!0),!ct(C,e))throw e;return}v&&(gn(_),ou(_,y,b)),!en&&!$t&&($t=!0,queueMicrotask(Gn))}finally{Ta(h),V===null&&(N||Cn())}};return l={render(e,i){if(u)throw Error(h(29));if(!N&&B===null&&!Sr()&&!on()&&u)return;if(Sr()||B!==null){if(d!==An&&(d=An,f=0),++f>kn){t!==null&&!t.disposed&&(zi(t).updateError=!0,Rn(t));return}}else An++,jn++,d=An,f=0;let a,o=null;is(e)?(arguments.length,o=e.key??null,typeof e.type==`function`?(a=e.type,i=e.props):(a=Ga,i=e)):typeof e==`function`?a=e:(a=Ga,i=typeof e==`symbol`?null:e),(un?.has(m)!==!0||t===null||t.disposed||n!==a||!Object.is(r,o))&&(m.generation++,m.wakeable=null),t!==null&&!t.disposed&&n===a&&Object.is(r,o)&&fn===m&&(pn=m.generation),m.nativeRetry?.clear(),m.retryKey=null,m.request=null,m.transaction?.aborted===!0&&(m.transaction=null),m.retry=e=>g(a,i,o,e?`transition`:void 0,e),g(a,i,o)},unmount(){if(arguments.length,!u&&(N||B!==null||Sr()||Yt!==0||!u)){!N&&B===null&&!Sr()&&Yt===0&&(An++,jn++),u=!0,m.disposed=!0,m.nativeRetry?.clear(),m.retry=A,m.generation++,m.wakeable=null,m.request=null,m.transaction!==null&&Sn(m.transaction);try{t&&(Ut.delete(t),cd(K(e),null),Ge(null,()=>R(t,!1)),Tt(),m.preservePresentation||Ja(e),Qe(),t=null,n=null,r=null)}finally{i.signalState?.opaqueKeys?.clear(),m.current=null,m.retry=A,m.adopt=void 0,m.initialDocumentSignals=void 0,m.retryKey=null,m.transaction=null,Dd(e,!0),Xa(e,o)}}}},t!==null&&(p(t),m.adopt=e=>{t!==null&&Ut.delete(t),t=e,m.current=e,p(e)}),l}var br=0,F=[[],[],[]],xr=!1;function Sr(){return Wt>0||Jt>0||br>0}function Cr(){xr=!0,Yr(wr)}function wr(){xr=!1,Ze()}function Tr(){xr=!1,Gr(),Ze()}function Er(){return tn.length>0||nn.length>0||Dr()}function Dr(){return M.length>0||hn.length>0||Da.length>0||Oa.length>0||F[0].length>0||F[1].length>0||F[2].length>0||Br.length>0||Dt.length>0||_f()}function Or(e,t){for(let n=t.parentBlock;n!==null;n=n.parentBlock)if(n===e)return!0;return!1}function kr(e,t,n,r){if(e!==n&&e!==null&&n!==null){let i=e.parentBlock,a=n.parentBlock;if(i===n)return-1;if(a===e)return 1;if(i===a)return t-r;for(let t=a;t!==null;t=t.parentBlock)if(t===e)return 1;for(let e=i;e!==null;e=e.parentBlock)if(e===n)return-1}return t-r}function Ar(e,t){return e.scope===t.scope?e.order-t.order||e.seq-t.seq:kr(e.scope.block,e.seq,t.scope.block,t.seq)}function jr(e,t){return kr(e.block,0,t.block,0)}function Mr(e){for(let t=1;t0&&e[r-1].block===n.block&&Nr(e[r-1],n)>0;)e[r]=e[r-1],r--;e[r]=n}}function Nr(e,t){let n=Pr(e),r=Ne(n).compareDocumentPosition.call(n,Pr(t));return r&16||(r&10)==2?1:r===0?0:-1}function Pr(e){return e.el._startMarker??e.el}function Fr(e){let t=e.scope.hooks?.get(e.slot);if(t===void 0||t.revision!==e.revision||!Ir(e,t))return;let n=e.fn===null,r=t.cleanup;if(n&&(t.connectedFn=null,t.connectedArgs=void 0,t.disconnected=!1),r){t.cleanup=void 0;try{Zt(r,e.phase,e.scope)}catch(t){if(t instanceof Fn)throw t;ur(e.scope.block,t)}}}function Ir(e,t){return!0}function Lr(){let e=F[0],t=F[1];if(e.length===0&&t.length===0)return null;let n=e.length===0?t.splice(0):t.length===0?e.splice(0):e.splice(0).concat(t.splice(0));n.sort(Ar);let r=n.length,i=0;for(;i`u`)qr=e=>setTimeout(()=>Kr(e),0);else{let e=new MessageChannel;e.port1.onmessage=e=>Kr(e?.data),qr=t=>e.port2.postMessage(t)}}return qr}function Yr(e){if(Hr.push(e),Hr.length!==1)return;let t=Jr(),n=++Wr,r=typeof document<`u`&&document.visibilityState===`hidden`,i=typeof requestAnimationFrame==`function`;Ur=setTimeout(()=>Kr(n),r||!i?0:250),!r&&i&&requestAnimationFrame(()=>{t(n)})}function Xr(e){return e.hooks??=new Map}var Zr=0;function Qr(e){let t=Zr;return Zr+=e,t}function $r(e){throw Error(h(15,e))}var ei=[];function ti(e,t,n){return n===null?typeof t==`function`?t(e):t:n(e,t)}function ni(e,t){let n=V;B.currentRenderMode;let r=e.base,i=e.queue,a=n!==null&&e.stamp===n.createdStamp?e.at:-1;if(a!==-1){let e=n.cells,t=e[a+3];if(i=t??e[a+4].next,i===null)return e[a+1];r=e[t===null?a+1:a+2]}let o=r,s=null,c=i;for(let e=c;e!==null;e=e.next)c=e,e.batch===null?(r=ti(r,e.action,t),s===null&&(o=r)):s??=e;if(n===null)ri(e,r,o,s,c);else if(a!==-1){let e=n.cells;e[a+1]=r,e[a+2]=o,e[a+3]=s,e[a+4]=c}else{let t=n.cells??=[];e.stamp=n.createdStamp,e.at=t.length,t.push(e,r,o,s,c)}return r}function ri(e,t,n,r,i){e.value=t,e.base=n;let a=r??i.next;e.queue=a,a===null&&(e.last=null)}function ii(e){for(let t=0;t0&&Gt!==2||Jt>0}function xi(){return!en&&Od===0&&Bt===0&&dt===0&&!bi()}function Si(e){return B===e?null:sn===null?cn!==null&&xi()?cn:null:sn}var Ci=[],wi=null;function Ti(){Ci.length=0,wi=null}function Ei(e,t,n){let r=e.block,i=r.endMarker,a=Wl(t,n,i);return r.parentNode=a,r.endMarker=null,Jl(a,e),i}var Di=null,Oi=Symbol.for(`octane.host-context-request`);function ki(e){try{return typeof e==`object`&&!!e&&e.$$kind===Oi}catch{return!1}}function Ai(e){let t=e.block;e===t&&t.memoInChain||(t.memoInChain=!0,ll(e,Ai))}function ji(e){return e.nodeType===1&&e.localName===`style`&&e.hasAttribute(`data-octane`)}function Mi(e){return e!==null&&e.nodeType===8&&e.data===` `}var Ni=A,Pi=A,Fi=A,Ii=0;function Li(){return(Ii++).toString(36)}var Ri=class{constructor(e,t,n,r,i,a,o,s,c){this.body=a,this.props=o,this.extra=s,this.outputHandler=c,this.memoInChain=a?.__memo===!0||t!==null&&t.memoInChain===!0,this.parentNode=n,this.parentBlock=t,this.idState=t?.idState??{prefix:``,next:0},this.startMarker=r,this.endMarker=i,this.exclusiveMarkers=!1,this.itemIndex=0,this.pending=!1,this.disposed=!1,this.mounted=!1,this.renderStatus=0,this.pendingMode=null,this.currentRenderMode=null,this.pendingDeferred=!1,this.currentRenderDeferred=!1,this.inactive=!1,this.hooks=null,this.cleanups=null,this.effectSlots=null,this.children=null,this._slots=null,this.refFields=null,this.$$ctxValues=null,this.$$ctxReads=null,this.$$ctxDirect=null,this.$$ctxDepsEpoch=-1,this.$$ctxCache=null,this.$$ctxCacheOwner=null,this.$$implicitBail=!1,this.drainStamp=0,this.drainRenders=0,this.crossRenderUpdate=!1,this.deoptNode=null,this.deoptRefs=!1,this.slots=[void 0],this.compilerMemo=null,this.forSlot=null,this.prevSibling=null,this.nextSibling=null,this.key=null,this.parent=null,this.block=this,this.kind=e,this.createdStamp=0,this.__warmEpisode=void 0,this.__thenableDone=void 0,this.rare=null,this.signalInstanceParent=null,this.signalInstanceSite=void 0,this.signalInstanceValue=void 0,this.signalInstanceHasKey=!1,this.signalInstanceResolved=void 0,this.signalTokenEscaped=!1,this.signalOwner=void 0}};function zi(e){return e.rare??={tryHandler:void 0,suspenseHandler:void 0,trySlot:void 0,activitySlot:void 0,thenables:void 0,thenableIdx:0,batchThenables:void 0,warmCache:void 0,warmCacheEpisode:void 0,updateChain:-1,updateCount:0,updateError:!1,eventRender:0,eventCommitted:0,vt:null}}var Bi=class{constructor(e,t){this.block=t,this.parent=e,this.hooks=null,this.cleanups=null,this.effectSlots=null,this.children=null,this._slots=null,this.refFields=null,this.$$ctxValues=null,this.$$ctxReads=null,this.$$ctxCache=null,this.$$ctxCacheOwner=null,this.mounted=!1,this.slots=[void 0],this.compilerMemo=null,this.signalInstanceParent=null,this.signalInstanceSite=void 0,this.signalInstanceValue=void 0,this.signalInstanceHasKey=!1,this.signalInstanceResolved=void 0,this.signalTokenEscaped=!1,this.signalOwner=void 0}};function L(e,t,n,r,i,a,o,s,c=null){let l=new Ri(e,t,n,r,i,a,o,s,c);if(t!==null&&l.idState.renderOwner===V?.owner&&(xn(l),n.nodeType===11)){let e=n.$$next;e!==void 0&&e.members.push(l,n)}return l}function Vi(e){let t=V?.cells;if(t==null)return;let n=0;for(let r=0;r{sa(e,t)})}function oa(e,t){let n=e.cleanups;if(n!==null)for(let t=n.length-1;t>=0;t--)try{Xt(n[t],e)}catch(e){ta(e)}}function sa(e,t,n=!0){oa(e,n),ca(e,t)}function ca(e,t){let n=e.children,r=e._slots,i=0;if(r!==null)for(let e=0,a=r.length;et(n,r,e))}finally{z=i}}function Va(e,t,n){let r=z;z=e;try{t(void 0,e,n)}finally{z=r}e.mounted=!0}function Ha(e,t,n,r,i,a,o,s,c){let l=e.block,u=l.currentRenderMode??`urgent`,d=l.currentRenderDeferred,f=z,p=B,m=null,h=null;V!==null&&t.env!==s&&t.env,t.env=s,(o||0)&4&&s!==void 0&&(V!==null&&t.cachedDeps!==s&&t.cachedDeps,t.cachedDeps=s),c&&(t.mappedNative!==!0&&t.mappedNative,t.mappedNative=!0);let g=V===null?null:du(t,l,V.ops.length),_=g===null?null:mu(g,t.end),v=_===null?t.end:fu??pu();try{for(let e=0;ee===void 0?null:e);function Ka(e){if(typeof e!=`object`||!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)throw Error(h(63))}function qa(e){let t=e.parentNode;if(t.$$next!==void 0)return;let n=Wl(e,t,null).$$next;n.out.push(()=>Ja(t),null,null),e.parentNode=n.frag,Jl(n.frag,e)}function Ja(e){if(e.nodeType!==9)e.textContent=``;else for(let t=K(e);t!==null;){let n=q(t);t.nodeType!==10&&e.removeChild(t),t=n}}function Ya(e){return null}function Xa(e,t){t!==null&&t===void 0&&Wa.delete(e)}function Za(e){if(!is(e))return e}function Qa(e,t,n){if(Ka(e),t?.bindingLeases!==void 0||t?.controlLeases!==void 0)throw Error(h(76));t=Za(t);let r=Ya(e);Ed(e,!0);let i=(t?.identifierPrefix??``)+`r`+Li()+`-`;return yr(e,null,null,null,{prefix:i,next:0,signalState:{prefix:t?.signalInstancePrefix??i,next:0}},n,r,t?.signalOwner??void 0,t)}function $a(e){return Qa(e,void 0,null)}function eo(e){return!1}function to(e,t,n,r){t!==void 0&&(e[t]=n)}function no(e){let t=V;return t.aborted||e!==null&&e.createdStamp===Sa?null:t}var ro=Symbol(`octane.signal-host-prop-sources`),io=(()=>{let e=globalThis.trustedTypes;try{return e?e.createPolicy(`octane`,{createHTML:String}):null}catch{return null}})();function ao(e,t){let n=globalThis.trustedTypes;return e!==null&&n&&(n.isHTML(e)||n.isScriptURL(e)||n.isScript(e))&&t===String(e)?e:t}function oo(e,t){fa!==null&&fa(e,t)||e.nodeValue!==t&&(e.nodeValue=t)}function so(e,t,n){let r=e??n.firstChild,i=Ku(t);fa!==null&&fa(r,i)||(r.nodeValue=i)}function co(e,t,n){let r=V===null?null:no(e);if(r===null){oo(t,n);return}let i=r.texts;if(i===null||!i.has(t)){if(fa===null&&t.nodeValue===n)return;(r.texts??=new Set).add(t)}r.ops.push(lo,[t,n])}function lo(e){oo(e[0],e[1])}function uo(e,t){let n=t==null?``:String(t),r=typeof t==`object`?ao(t,n):n,i=V===null?null:no(B);if(i!==null){i.ops.push(mo,[e,r]);return}let a=K(e);(a===null||a!==e.lastChild||a.nodeType!==3||a.nodeValue!==n)&&(e.textContent=r)}function fo(e,t){let n=t==null?``:String(t),r=typeof t==`object`?ao(t,n):n,i=e;if(e.localName===`script`){uo(e,r);return}if(i[ho]===n)return;i[ho],i[ho]=n;let a=V===null?null:no(B);a===null?e.innerHTML=r:a.ops.push(po,[e,r])}function po(e){e[0].innerHTML=e[1]}function mo(e){uo(e[0],e[1])}var ho=Symbol(`octane.dangerHTMLValue`),go=`__oct_dangerHTML`,_o=!1,vo=`__oct_dangerChild`,yo=`__oct_dangerSpreadChild`;function bo(){return Error(h(5))}function xo(e){if(e!=null&&(typeof e!=`object`||!(`__html`in e)))throw Error(h(6))}function So(e,t){xo(t),e[go];let n=e[go]===!0;if(t==null){if(e[go]=!1,n){fo(e,null);let t=e;t[ho]!==void 0&&(t[ho],t[ho]=void 0)}}else{if(t!=null&&O.has(e.localName))throw Error(h(7,e.localName));if(t!=null&&(e.__oct_dangerChild===!0||e.__oct_dangerSpreadChild!=null))throw bo();e[go]=!0,_o=!0,fo(e,t.__html)}}function Co(e,t){if(!_o||e.nodeType!==1||e.__oct_dangerHTML!==!0)return!1;if(t!=null)throw bo();return!0}var wo=`http://www.w3.org/1999/xlink`,To=`http://www.w3.org/XML/1998/namespace`,Eo=`http://www.w3.org/2000/xmlns/`,Do=`http://www.w3.org/2000/svg`,Oo=`http://www.w3.org/1998/Math/MathML`;function ko(e){return e.namespaceURI===`http://www.w3.org/1999/xhtml`&&e.localName.indexOf(`-`)!==-1}function Ao(e,t){return e===`svg`?Do:e===`math`?Oo:t===void 0&&ae.has(e)?Do:t}var jo=function e(t){if(t.nodeType!==1){let n=t.$$next;return n===void 0?void 0:e(n.parent)}let n=t;if(n.namespaceURI===`http://www.w3.org/2000/svg`)return n.localName===`foreignObject`?void 0:Do;if(n.namespaceURI===`http://www.w3.org/1998/Math/MathML`)return Oo};function Mo(e){if(e===`xmlns`)return Eo;let t=e.indexOf(`:`);if(t<=0)return null;let n=e.slice(0,t);return n===`xlink`?wo:n===`xml`?To:n===`xmlns`?Eo:null}function No(e,t,n){if(typeof n!=`function`&&e.$$ceListeners?.[t]===void 0)return!1;let r=t.endsWith(`Capture`),i=r?t.slice(2,-7):t.slice(2),a=e.$$ceListeners??={},o=a[t];return o!==void 0&&o!==n&&e.removeEventListener(i,o,r),typeof n==`function`?(o!==n&&e.addEventListener(i,n,r),a[t]=n,e.removeAttribute(t),!0):(delete a[t],!1)}function Po(e,t,n){if(t===`innerText`||t===`textContent`)return;if(t===`dangerouslySetInnerHTML`){So(e,n);return}if(t===`suppressContentEditableWarning`||t===`suppressNativeChangeWarning`||t===`__octaneNativeChangeDiagnostic`)return;switch(t.length){case 5:if(t===`value`){let t=e.localName;if(t===`input`||t===`textarea`)return Tf(e,n);if(t===`select`)return Pf(e,n)}else if(t===`muted`&&!ko(e)){e.muted=n&&typeof n!=`function`&&typeof n!=`symbol`;return}break;case 7:if(t===`checked`&&e.localName===`input`)return Nf(e,n);break;case 8:if((t===`multiple`||t===`selected`)&&!ko(e)){e[t]=n&&typeof n!=`function`&&typeof n!=`symbol`;return}break;case 9:if(t===`autoFocus`&&!ko(e))return vf(e,n);break;case 12:if(t===`defaultValue`){let t=e.localName;if(t===`input`||t===`textarea`||t===`select`)return If(e,n)}break;case 14:if(t===`defaultChecked`&&e.localName===`input`)return zf(e,n)}if(t.length>2&&t.charCodeAt(0)===111&&t.charCodeAt(1)===110&&ko(e)&&No(e,t,n))return;if(!ko(e)){let e=oe.get(t);e!==void 0&&(t=e)}let r=Lo(e,t,n);r!==null&&(r=u(e.localName,t,r));let i=Mo(t);if(r===null){if(i){let n=t.indexOf(`:`);e.removeAttributeNS(i,n>=0?t.slice(n+1):t)}else e.removeAttribute(t);return}if(!ie.test(t))return;let a=typeof n==`object`?ao(n,r):r;i?e.setAttributeNS(i,t,a):e.setAttribute(t,a)}function Fo(e,t,n){let r=typeof n,i;i=n==null||r===`function`||r===`symbol`?null:typeof n==`string`?n:String(n),i===null?e.removeAttribute(t):e.setAttribute(t,i)}function Io(e,t,n){let r=typeof n,i=!n||r===`function`||r===`symbol`?null:``;i===null?e.removeAttribute(t):e.setAttribute(t,i)}function Lo(e,t,n){if(t.charCodeAt(0)===97&&t.startsWith(`aria-`))return n==null||typeof n==`function`||typeof n==`symbol`?null:String(n);let r=typeof n;if(r===`boolean`&&se(t)||r===`boolean`&&t.startsWith(`data-`))return n?`true`:`false`;if(r===`function`||r===`symbol`)return null;if(!ko(e)){let e=t.toLowerCase();if(ne.has(e)||r===`boolean`&&(e===`download`||e===`capture`))return n?``:null;if(r===`boolean`||re.has(e)&&!(Number(n)>=1)||(e===`rowspan`||e===`start`)&&Number.isNaN(Number(n))||t.length>2&&t.charCodeAt(0)===111&&t.charCodeAt(1)===110)return null}if(n==null||n===!1)return null;let i;return i=n===!0?``:String(n),i===``&&(t===`src`||t===`href`&&e.nodeName!==`A`&&e.nodeName!==`AREA`||t===`data`&&e.nodeName===`OBJECT`)?null:i}function Ro(e,t,n){let r=typeof t==`string`?t:i(t);t==null||t===!1?e.removeAttribute(`class`):e.className=r}function zo(e,t){let n=t==null||t===!1?null:i(t);n===null?e.removeAttribute(`class`):e.setAttribute(`class`,n)}var Bo=`!important`;function Vo(e,t,n){let r=e.style;pa!==null&&pa(e,t,n)||Ho(e,r,t,n)}function Ho(e,t,n,r){if(n==null||n===!1||n===``){if(r&&typeof r==`object`)for(let e in r)t.removeProperty(Be(e));else typeof r==`string`&&(t.cssText=``)}else if(typeof n==`string`)r!==n&&(t.cssText=n);else if(r&&typeof r==`object`){for(let e in r)e in n||t.removeProperty(Be(e));for(let i in n){let a=n[i];a!==r[i]&&(a==null||typeof a==`boolean`?t.removeProperty(Be(i)):Uo(e,t,i,a))}}else{typeof r==`string`&&(t.cssText=``);for(let r in n){let i=n[r];i!=null&&typeof i!=`boolean`&&Uo(e,t,r,i)}}}function Uo(e,t,n,r){let i=Be(n),a;a=ce(n,r);let o=a.trimEnd();o.endsWith(Bo)?t.setProperty(i,o.slice(0,o.length-10).trimEnd(),`important`):t.setProperty(i,a)}function Wo(e,t,n){if(t===`class`||t===`className`)e.removeAttribute(`class`);else if(t===`style`)Vo(e,null,n);else if(t===`dangerouslySetInnerHTML`)So(e,null);else if(t===`suppressHydrationWarning`)e.__oct_suppress=!1;else if(t!==`suppressNativeChangeWarning`&&t!==`__octaneNativeChangeDiagnostic`){let n=Go(e,t);if(n!==null){Zu(e,n,null);return}let r=nd(t,e);r?to(e,r.key,null,!0):Po(e,t,null)}}function Go(e,t){return t===`action`&&e.localName===`form`?`action`:(t===`formAction`||t===`formaction`)&&(e.localName===`button`||e.localName===`input`)?`formaction`:null}function Ko(e,t){return Object.prototype.propertyIsEnumerable.call(e,t)}var qo=3,Jo=null,Yo=new WeakMap;function Xo(e){if(e==null||e===!1)return null;if(typeof e==`string`||typeof e==`number`||typeof e==`boolean`)return i(e);if(typeof e==`object`&&e||typeof e==`function`)return Yo.get(e)}function Zo(e,t,n){let r=Xo(n),a=t==null||t===!1?null:i(t);(typeof t==`object`&&t||typeof t==`function`)&&Yo.set(t,a),(V!==null&&no(B)!==null||r===void 0||r!==a||e.getAttribute(`class`)!==a)&&(a===null?e.removeAttribute(`class`):e.setAttribute(`class`,a))}function Qo(e,t,n,r,i){let a=!!(i&4),o=a&&n===void 0&&e.localName===`input`;if(t!=null&&Object.prototype.propertyIsEnumerable.call(Object(t),`suppressHydrationWarning`)&&(e.__oct_suppress=t.suppressHydrationWarning===!0),n){for(let r in n)if(r!==`key`&&r!==`children`&&(a||Ko(n,r))&&!((i&qo)!==0&&Jo(e,r,i))){if(r===`ref`){let r=t?t.ref:void 0;n.ref!=null&&n.ref!==r&&jt(n.ref,e)}else t!=null&&(a?r in t:Ko(t,r))||Wo(e,r,n[r])}}if(t==null)o&&hc(e);else{for(let s in t){if(s===`key`||s===`children`||!a&&!Ko(t,s)||(i&qo)!==0&&Jo(e,s,i))continue;let c=t[s],l=n?n[s]:void 0;if(o&&(s===`defaultChecked`||s===`checked`&&c!=null)&&(o=!1),s===`ref`){if(c===l)continue;if(a){if(c==null)continue;fc(r)}r?ut(r,c,e):Rt(c,e);continue}if(s===`suppressHydrationWarning`||s===`suppressNativeChangeWarning`||s===`__octaneNativeChangeDiagnostic`)continue;if(s===`class`||s===`className`){if(c===l)continue;a?zo(e,c):Zo(e,c,l);continue}if(s===`style`){Vo(e,c,l);continue}if(s===`dangerouslySetInnerHTML`){a&&c===l||So(e,c);continue}let u=Go(e,s);if(u!==null){if(c===l)continue;$o(e,u,c,l);continue}if(c===l&&!Gf(e,s))continue;let d=nd(s,e);if(d){if(c===l)continue;d.capture?gd.has(d.type)||wd([d.type]):ld.has(d.type)||xd([d.type]),to(e,d.key,c,!0)}else(n===void 0||s!==`autoFocus`||ko(e))&&Po(e,s,c)}o&&hc(e)}}var $o=Zu,es=null,ts=Symbol(`octane.scopedChildren`);function ns(e){return e==null||typeof e!=`object`&&typeof e!=`function`?!1:e.key!==void 0}var rs=Symbol(`octane.scopedValue`);function is(e){return e!=null&&e.$$kind===Ee}function as(e){let t;try{t=String(e)}catch{return`object with keys {`+Object.keys(e).join(`, `)+`}`}return t===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:t}function os(e){let t=as(e);return Error(h(3,t))}function ss(e){let t=e===null?`null`:e===void 0?`undefined`:typeof e==`object`?as(e):JSON.stringify(e);return Error(h(24,t))}var cs=Symbol.for(`octane.childrenBody`);function ls(e,t){let n=e[cs],r=t[cs];return n===void 0||r===void 0||n===r}function us(e){return e.$$singleRoot=!0,e}function ds(e){return typeof e==`function`&&e[Oe]===!0}var fs=Symbol.for(`octane.lazyBodyCheck`);function ps(e,t){Object.defineProperty(e,fs,{get(){return this===e?t:void 0}})}var ms=Symbol(`NO_KEY`);function hs(e,t,n,r,i,a,o,s,c,l,u){let d=es,f=d!==null&&r===d.type;if(!f&&typeof r!=`function`&&typeof r!=`string`)throw ss(r);let p=f?d.body:typeof r==`string`?$c:r;f&&(s=!1,c=!1,!u&&l===void 0&&ns(i)&&(l=i.key,u=!0)),vs(qi,e,t,n,p,r,i,typeof r==`string`?{$$kind:Ee,type:r,props:i,key:null,ref:i!=null&&i.ref!==void 0?i.ref:null,children:i==null?null:i.children}:i,o,l,s,c,u,typeof r==`string`?`r:`:a)}function gs(e,t,n,r,i,a,o,s,c,l,u){if(typeof r!=`function`)throw ss(r);vs(qi,e,t,n,r,r,i,i,o,l,s,c,u,a)}function _s(e,t,n,r,i,a,o,s,c,l,u){if(typeof r!=`function`)throw ss(r);vs(null,e,t,n,r,r,i,i,o,l,s,c,u,a)}function vs(e,t,n,r,i,a,o,s,c,l,u,d,f,p){if(B?.pending&&!B.crossRenderUpdate)return;if(n===0&&t!==Gi){let e=t.slots[0];if(e?.returnedOutput===!0){if(e.__kind===`componentSlotSlot`)Ki(e,!1);else{let e=t.block;if(e.outputHandler(e,null,!0),e.disposed)return}}}let m=t.block;if(t.slots[n]===void 0&&V!==null&&m.createdStamp!==V.createdStamp){let d=ic(m,r,c);if(d!==null){try{vs(e,t,n,d.parentNode,i,a,o,s,d,l,u,!1,f,p)}finally{ac(t,d,c)}return}}let h=t.slots[n];if(h===void 0){let e=null,i=null,o=!1;if(d===!0&&Se(a,1)&&(d=!1),d===!0&&m!==null){let t=m.startMarker,n=m.endMarker;t!=null&&n!=null&&t!==n&&t.nodeType===8&&n.nodeType===8?(e=t,i=n,o=!0):t===null&&n===null&&(o=!0)}o||(u===!0||u===2&&a.$$singleRoot===!0?(e=null,i=null):(e=document.createComment(`comp`),i=document.createComment(`/comp`),r.insertBefore(e,c??null),r.insertBefore(i,c??null))),h={__kind:`componentSlotSlot`,start:e,end:i,anchor:c??null,singleRoot:e===null&&!o,inherited:o,block:null,currentComp:null,prevKey:ms,keyed:f===!0||l!==void 0,next:null},t.slots[n]=h,ia(t,h)}let g=l===void 0?ms:``+l,_=g!==h.prevKey,v=a!==h.currentComp||_,y=V!==null&&h.block!==null&&v,b=y&&G(m,r);if(f!==!0&&l===void 0||h.keyed||(y||h.keyed,h.keyed=!0),_&&(h.currentComp=null),!y&&!Object.is(h.prevKey,g)&&h.prevKey,h.prevKey=g,v){let o=h.block===null||!h.block.mounted||m.idState.renderOwner?.signalOwner===void 0?void 0:{parent:t,slot:n,kind:h.__kind,branch:void 0,component:a,key:g};if(b){xs(h,m,r,i,a,s,e,void 0,o);return}if(h.block){if(h.inherited){if(R(h.block),m.disposed)return;if(h.start===null)for(;K(r);)r.removeChild(K(r))}else if(h.singleRoot){if(R(h.block),m.disposed)return}else{let e=q(h.end);if(R(h.block),m.disposed)return;let t=document.createComment(`comp`),n=document.createComment(`/comp`);r.insertBefore(t,e),r.insertBefore(n,e),h.start=t,h.end=n}}if(h.currentComp=a,h.singleRoot){let t=h.anchor?h.anchor.previousSibling:r.lastChild,n=L(`dynamic`,m,r,null,h.anchor,i,s,void 0,e);h.block=n;try{j(n)}finally{let e=h.anchor?h.anchor.previousSibling:r.lastChild;e!==null&&e!==t&&(n.startMarker=e,n.endMarker=e)}}else{let t=L(`dynamic`,m,r,h.start,h.end,i,s,void 0,e);h.inherited&&(t.exclusiveMarkers=!0),h.block=t,j(t)}}else if(h.block){if(at&&at(h.block,a,o))return;h.block.props!==s&&(h.block,h.block.props),h.block.props=s,j(h.block)}}function ys(e){return e==null||e===!1||e===!0?``:String(e)}function bs(e,t,n,r,i,a,o,s,c){let l=document.createComment(n),u=document.createComment(`/`+n);e.append(l,u);let d=L(`dynamic`,t,e,l,u,r,i,void 0,a);s!==void 0&&vt(d,s),c!==void 0&&_t.set(d,c),o&&(d.$$implicitBail=!0,d.memoInChain=!0);try{j(d)}catch(n){throw za(d,t,n,c),oc(e,l.previousSibling,null),n}return d}function xs(e,t,n,r,i,a,o,s,c){let l=e.block,u=yn(V,l),d=e.inherited,f=l.startMarker,p=l.endMarker,m=null,h=null,g;u?g=e.next.before:d?(m=e.start===null?K(n):q(e.start),m===e.end?m=null:h=e.end===null?n.lastChild:e.end.previousSibling,g=e.end):(m=e.start??f,h=e.end??p,m===null?(g=e.anchor,h=null):g=q(h));let _=bs(Ul(e,t,n,g),t,`comp`,r,a,o,!1,s,c);if(u?R(l):Yl(e,l,m,h),t.disposed)return;e.start=_.startMarker,e.end=_.endMarker,e.singleRoot=!1,e.inherited=!1,e.block=_,e.currentComp=i;let v=e.next;!u&&!d&&m!==null&&(v.follows=!0,$s(t,f,p)&&(v.bound=[t,f,p,null,null])),v.bound!==null&&(v.bound[3]=e.start,v.bound[4]=e.end)}function Ss(e,t=!1){let n=e.renderedBlocks;if(e.renderedBlocks=null,e.renderRoot=null,n!==null&&H!==null)for(let e of n)Wi(H,e);if(Ve){for(let t=0;t<3;t++){let n=e.effects[t],r=H===null?F[t]:H.effects[t];for(let e=0;eU(s,null),n,i);e.block=null,e.forSlot=null,e.text=null,e.hostNode=null,e.currentComp=null,e.ownerHost!==null&&(e.start=null,e.end=null);return}}let n=e.block!==null;if(e.block!==null&&(R(e.block,!1),e.block=null),e.ownerHost!==null){let t=e.ownerHost,r=K(t);for(;r!==null;){let e=q(r);n||U(r,null),t.removeChild(r),r=e}e.start=null,e.end=null}else if(e.start!==null){let t=e.start.parentNode;if(t!==null){let r=q(e.start);for(;r!==null&&r!==e.end;){let e=q(r);n||U(r,null),t.removeChild(r),r=e}}}else e.text===null?e.hostNode!==null&&e.hostNode.parentNode!==null&&(U(e.hostNode,null),e.hostNode.parentNode.removeChild(e.hostNode)):e.text.remove();e.text=null,e.currentComp=null,e.hostNode=null}function Ts(e,t,n){if(t.__memo!==!0||!e.mounted||e.renderStatus!==0)return!1;let r=t.__compare;return!!(r?t[fs]===void 0?r(e.props,n):r(e.props,n,e):As(e.props,n))}function Es(e){if(e.$$implicitBail!==!0||!e.mounted||e.renderStatus!==0)return!1;let t=e.body[fs];return!(t!==void 0&&!t(e))}function Ds(e,t){e.renderStatus!==0&&j(e)}function Os(e,t,n,r=!1){let i=S.value;if(n===void 0)return i;let a=r&&e.block.memoInChain,o=B!==null&&B.renderStatus!==0;if(n===i&&!a&&!o)return i;let s=e.slots[t];if(s==null)return i;if(o){let e=n!==i,t=s.__kind===`forBlockSlot`?s:s.__kind===`childSlot`?s.forSlot:null;if(t!==null){for(let n=t.head;n!==null;n=n.nextSibling)Ds(n,e);t.emptyBlock!==null&&Ds(t.emptyBlock,e)}else{let t=s.block??(s.__kind===`childSlot`?s.portal?.block:null);t!=null&&Ds(t,e)}return i}return i}var ks=Object.prototype;function As(e,t){if(e===t)return!0;if(e==null||t==null)return!1;let n=Object.getPrototypeOf(e),r=Object.getPrototypeOf(t);if(n!==ks&&n!==null||r!==ks&&r!==null)return js(e,t);let i=0;for(let n in e){let r=e[n];if(!Object.is(r,t[n])||(r===void 0||typeof r==`object`||typeof r==`function`)&&!ye.call(t,n))return!1;i++}for(let e in t)i--;return i===0}function js(e,t){let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r=0;rr(i)&&(t?t(e,n):As(e,n))})),n}function Ls(e,t){for(let n=e;n!==null;n=n.parentBlock)if(n.kind===`portal`&&n.parentNode===t)return!0;return!1}function Rs(e,t,n,r,i,a,o,s,c=!0,l,u,d,f,p,m){if(B?.pending&&!B.crossRenderUpdate)return;if(t===0&&e!==Gi){let t=e.slots[0];if(t?.returnedOutput===!0){if(t.__kind===`childSlot`)Ki(t,!1);else{let t=e.block;if(t.outputHandler(t,null,!0),t.disposed)return}}}if(e.slots[t]===void 0&&o===void 0&&V!==null&&e.block.createdStamp!==V.createdStamp){let a=ic(e.block,n,i);if(a!==null){try{Rs(e,t,a.parentNode,r,a,!1,void 0,s,c,l,u,d,f,p,m)}finally{ac(e,a,i)}return}}if(r!=null&&c&&n.nodeType===1&&O.has(n.localName)&&!Ls(e.block,n))throw Error(h(26,n.localName));if(Co(n,r))return;let g=e.block;for(;r!==null&&(typeof r==`object`||typeof r==`function`);){if(typeof r.then==`function`)throw r;break}let _=typeof r==`function`?r:null,v=Ac(r);v!==null&&(r=v);let y=l===void 0?kc(r,!1,c,void 0):{items:r,keys:null},b=e.slots[t],x=!1;if(b!==void 0&&V!==null){let e=y===null?_:null,t=y!==null&&b.forSlot!==null,n=b.block!==null&&e!==null&&(e===b.currentComp||typeof r==`function`&&b.currentIsBodyFn&&ls(b.currentComp,e)),i=r==null||typeof r!=`object`&&typeof r!=`function`,a=i?ys(r):null,o=i&&b.block===null&&b.forSlot===null&&b.hostNode===null&&b.portal===null&&b.text===null==(a===``);t||n||o||(sl(b),x=!0)}let S=!1,C=!1;if(b===void 0){let r=V;r!==null&&!r.aborted&&e.mounted&&yn(r,g);let c,l,u=e===Gi&&t===0&&i===g.endMarker&&Ji(g);u?(c=g.startMarker,l=g.endMarker,S=!1):m===void 0?a&&i!=null?(c=null,l=i):o===void 0?(c=null,l=document.createComment(``),n.insertBefore(l,i??null)):(c=null,l=null):(c=document.createComment(m),l=a&&i!=null?i:document.createComment(`]`),l.data=`]`,n.insertBefore(c,i??null),l!==i&&n.insertBefore(l,i??null)),b={__kind:`childSlot`,start:c,end:l,ownerHost:o??null,borrowed:u,compactable:s===!0,block:null,text:null,currentComp:null,currentIsBodyFn:!1,forSlot:null,hostNode:null,portal:null,next:null,implicitSignal:void 0},e.slots[t]=b,ia(e,b),x=o!==void 0&&V!==null&&!0}S&&(C=null.claimRange(e,t,b.start,b.end,r,l===void 0&&p!==!0?y:null)),s===!0&&(b.compactable=!0);let w;if(y!==null){if(C){let e=b;null.suspend(()=>cl(e,g,n,y,null,!1,w));return}cl(b,g,n,y,null,!1,w,l,u,d,f,p);return}b.forSlot!==null&&(V===null?ol(b):ws(b));let T=null,E={},D=!1;if(typeof r==`function`&&(T=r,D=!0),T!==null){if(D&&b.block!==null&&b.currentIsBodyFn&&ls(b.currentComp,T)){let e=ds(T),t=b.block.$$implicitBail;if(e&&!t&&(b.block.$$implicitBail=!0,b.block.memoInChain||Ai(b.block)),t&&e&&T===b.currentComp&&Es(b.block))return;b.block.body!==T&&(b.block,b.block.body),b.currentComp!==T&&b.currentComp,b.block.body=T,j(b.block),b.currentComp=T;return}if(b.block!==null&&T===b.currentComp){if(at&&at(b.block,T,E)||E===b.block.props&&Es(b.block))return;b.block.props!==E&&(b.block,b.block.props),b.block.props=E,j(b.block);return}let r,i=b.block===null&&b.hostNode===null&&b.text===null||g.idState.renderOwner?.signalOwner===void 0?void 0:{parent:e,slot:t,kind:b.__kind,branch:void 0,component:D?void 0:T,key:void 0};if(x&&G(g,n)){let t=b.ownerHost!==null||b.borrowed&&b.start===null,a=e===g&&g.forSlot!==null&&!g.exclusiveMarkers&&b.borrowed&&($s(g,b.start,b.end)||g.endMarker===b.end),o=!D||ds(T),s=bs(Ul(b,g,n,t?null:a?q(b.end):b.end),g,``,T,E,qi,o,r,i),c=!t&&b.end===null;ws(b);let l=b.next;if((c||a)&&(l.follows=!0),a){let e=b.start,t=b.end;b.start=s.startMarker,b.end=s.endMarker,s.exclusiveMarkers=!0,l.out.push(null,e,e,null,t,t),l.bound=[g,e,t,b.start,b.end]}else b.start===null&&b.ownerHost===null&&!b.borrowed&&(b.start=s.startMarker);b.block=s,b.currentComp=T,b.currentIsBodyFn=D;return}if(ws(b),g.disposed)return;b.currentComp=T,b.currentIsBodyFn=D,b.start===null&&b.ownerHost===null&&!b.borrowed&&(b.start=document.createComment(``),n.insertBefore(b.start,b.end));let a=L(`dynamic`,g,n,b.start,b.end,T,E,void 0,qi);b.borrowed&&(a.exclusiveMarkers=!0),(!D||ds(T))&&(a.$$implicitBail=!0,a.memoInChain=!0),b.block=a,S?null.renderClaimed(a,e,t):j(a);return}if(typeof r==`object`&&r)throw os(r);(b.block!==null||b.hostNode!==null)&&ws(b);let ee=ys(r);S&&null.settleTextRange(e,t,b,ee),ee===``?b.text!==null&&(V===null?(b.text.remove(),b.text=null):ws(b)):b.text===null?zs(b,g,n,ee):co(g,b.text,ee)}function zs(e,t,n,r){let i=document.createTextNode(r);e.text=i,V===null||!G(t,n)?n.insertBefore(i,e.end):Ul(e,t,n,e.ownerHost!==null||e.borrowed&&e.start===null?null:e.end).appendChild(i)}function Bs(e,t,n,r){let i=0,a=e._slots;if(a!==null)for(let e=0;e1?void 0:null;for(let c=0;cU(r,null),r,r)),n.deoptNode=null),t.slots[0]===void 0&&i!==null&&a!==null&&i!==a&&i.nodeType===8&&a.nodeType===8){let e={__kind:`childSlot`,start:i,end:a,ownerHost:null,borrowed:!0,compactable:!1,block:null,text:null,currentComp:null,currentIsBodyFn:!1,forSlot:null,hostNode:null,portal:null,next:null,implicitSignal:void 0};t.slots[0]=e,ia(t,e)}Rs(t,0,n.parentNode,e,a,void 0,void 0,void 0,!1);return}t.slots[0]!==void 0&&t.slots[0]!==null&&t.slots[0].__kind===`childSlot`&&Rs(t,0,n.parentNode,null,a);let o=a,s=n.deoptNode,c=jc(s,e,n);if(c!==s){n.deoptNode;let e=n.parentNode,t=s===null?null:s.parentNode,r=null;if(t!==null&&t!==e&&t.$$next!==void 0){let e=s;c===null?t.removeChild(e):t.replaceChild(c,e),ou(()=>U(e,null),null,null);let n=t.$$next.bound;n!==null&&(n[3]=n[4]=c)}else{let i=t===e,a=G(n,e);if(c!==null){let t=i?s:o;if(a){let i=Wl(n,e,t);i.appendChild(c),r=i.$$next}else e.insertBefore(c,t)}if(i){let t=s;V===null?(U(t,null),e.removeChild(t)):ou(()=>U(t,null),t,t)}}r!==null&&i===s?r.bound=[n,s,s,c,c]:s!==null&&i===s&&(n.startMarker,n.endMarker,n.startMarker=c,n.endMarker=c)}n.deoptNode=c}function qc(e,t){let n=t.slots[0],r=t.block;n?.__kind===`componentSlotSlot`&&(Hc(r),Yi(r,n),r.deoptNode=null),Kc(e,t)}var Jc=function e(t){if(typeof t==`function`)return!0;if(typeof t!=`object`||!t)return!1;if(typeof t.then==`function`)return!0;if(Array.isArray(t)){for(let n=0;nal(e),K(n),n.lastChild)),e.incoming=il(t,Ul(e,t,n,null),r)):(R(e.block,!1),n.textContent=``,e.block=il(t,n,r))}function il(e,t,n){return L(`dynamic`,e,t,null,null,n,{},void 0,qi)}function al(e){R(e.block,!1),e.block=e.incoming,e.incoming=null}function ol(e){let t=e.forSlot;kl(t,t.items),t.head=null,t.tail=null,t.size=0,e.forSlot=null}function sl(e){V===null||V.aborted}function cl(e,t,n,r,i,a,o,s,c,l,u,d){if(r.items.length===0&&i===null&&e.ownerHost!==null){e.forSlot!==null&&V===null&&ol(e),ws(e);return}if(e.forSlot===null){if(i===null&&!a&&ws(e),e.end!==null&&e.end.parentNode===null&&(e.end=null,e.start=null),e.end===null&&(e.end=document.createComment(``),a||(i===null?G(t,n)?Ul(e,t,n,null).appendChild(e.end):n.insertBefore(e.end,null):$l(n,e.end,null))),e.start===null){e.start=document.createComment(``);let r=e.end;if(!a){if(i!==null)$l(n,e.start,r);else{let n=e.end.parentNode;G(t,n)?Ul(e,t,n,e.end).appendChild(e.start):n.insertBefore(e.start,r)}}}e.forSlot={__kind:`forBlockSlot`,start:e.start,end:e.end,items:new Map,inOrder:!0,head:null,tail:null,size:0,cachedDeps:null,ctxEpoch:0,emptyBlock:null,env:void 0,adopt:null,plainDeopt:null,mappedNative:void 0,selectionItems:void 0,signalSite:void 0,next:null}}let{items:f,keys:p}=r,m=c||p,h=!!c;e.forSlot.mappedNative;let g=s||(d===!0?qc:Kc);s!==void 0&&(e.forSlot.mappedNative=!0),e.forSlot.plainDeopt=null;let _=l||0,v=s!==void 0&&!!(_&16),y=!!(_&1),b=!1;s!==void 0&&(e.forSlot.env=u,_&4&&u!==void 0&&(e.forSlot.cachedDeps!==null&&_l(e.forSlot.cachedDeps,u)?y=!0:b=!0,e.forSlot.cachedDeps=u));let x=null,S=e.forSlot;if(S.size===0){let r=S.adopt;try{if(r!==null&&f.length!==0){x=new Map;for(let e=0;eU(r,null),r,r))}e.forSlot.adopt=null}}function ll(e,t,n=!0){let r=e.children,i=e._slots,a=0;if(i!==null)for(let e=0,o=i.length;eWe(e,t,n,r,i,a),r)}function dl(e,t,n=null){We(e,t,!1,!1,null,n)}function U(e,t,n=!0,r,i=null,a=null){if(!dc)return;let o=_c(e)?.props?.ref??a?.get(e)?.connected;o!=null&&(t===null?jt(o,e):(t.push({ref:o,el:e,scope:r}),n&&!Ft(i,e,o)&&Rt(o,null,e)));let s=e===r?.deoptNode&&Qc(r)?null:K(e);for(;s!==null;){let e=s.$$portalEnd;e==null?(U(s,t,n,r,i,a),s=q(s)):s=Bc(s,e)}}function fl(e,t,n,r,i,a,o,s,c,l,u,d){if(B?.pending&&!B.crossRenderUpdate)return;let f=Array.isArray(r)?r:Array.from(r),p=e.block,m=e.slots[t];if(m===void 0&&V!==null&&p.createdStamp!==V.createdStamp){let r=ic(p,n,l);if(r!==null){try{fl(e,t,r.parentNode,f,i,a,o,s,c,r,!1,d)}finally{ac(e,r,l)}return}}if(m===void 0){let r,i;r=document.createComment(`for`),u===!0&&l?.nodeType===8?(i=l,i.data=`/for`,n.insertBefore(r,i)):(i=document.createComment(`/for`),n.insertBefore(r,l??null),n.insertBefore(i,l??null)),m={__kind:`forBlockSlot`,start:r,end:i,items:new Map,inOrder:!0,head:null,tail:null,size:0,cachedDeps:null,ctxEpoch:0,emptyBlock:null,env:void 0,adopt:null,plainDeopt:null,mappedNative:void 0,selectionItems:void 0,signalSite:d,next:null},e.slots[t]=m,ia(e,m)}V!==null&&m.env!==s&&m.env,m.env=s;let h=V===null?0:V.ops.length;if(f.length===0&&c){if(m.size>0&&Ol(p,m,f,i,a,!1,!1),m.emptyBlock)m.emptyBlock.body!==c&&(m.emptyBlock,m.emptyBlock.body),m.emptyBlock.extra!==m.env&&(m.emptyBlock,m.emptyBlock.extra),m.emptyBlock.body=c,m.emptyBlock.extra=m.env,j(m.emptyBlock);else{let e=du(m,p,h),t=null,r=null;e!==null&&(t=document.createDocumentFragment(),t.$$next=e,e.members??=[],e.out.push(vn,t,m.end),r=nc(t,`/for`));let i=L(`control-flow`,p,t??n,t===null?m.start:null,r??m.end,c,void 0,m.env);i.exclusiveMarkers=!0,Ea(i),m.emptyBlock=i,j(i),r!==null&&(rc(i,t,r,m.end),i.startMarker=m.start,i.endMarker=m.end)}return}if(m.emptyBlock){let e=m.emptyBlock,t=du(m,p,h);if(t===null)R(e);else if(!yn(t.tx,e))uu(e,!0,t.out);else{let t=e.parentNode;R(e,!1),t.nodeType===11&&oc(t,null,null)}m.emptyBlock=null}let g=o||0,_=!!(g&1),v=!1;if(g&4&&s!==void 0){let e=!!(g&32);m.cachedDeps!==null&&_l(m.cachedDeps,s)?_=!0:v=!e,V!==null&&m.cachedDeps!==s&&m.cachedDeps,m.cachedDeps=s}let y=!!(g&16)||!!(g&128)&&2;m.size===0?Tl(p,m,f,i,a,!!(g&2),y):Ol(p,m,f,i,a,_,!!(g&2),v,!!(g&8),y)}var pl=16;function ml(e,t,n){return e==null||e.size!==0||e.emptyBlock!==null||e.adopt!==null||!((n||0)&2)||!Array.isArray(t)||t.length=0?(y=h[t].node,u.set(d,-t-1)):x=g??=Wl(e,p,null)}let S=Al(e,x,b,l,c,d,i,t,a,o,y,!1,m);y!==null&&S.startMarker!==y&&(_??=[]).push(S,y),f.set(d,S),S.prevSibling=v,S.nextSibling=null,v?v.nextSibling=S:t.head=S,v=S}t.tail=v,t.size=d}catch(e){for(;v!==null;){let t=v;v=t.prevSibling,f.delete(t.key);let n=c?t.startMarker:null,r=c?t.endMarker:null,i=c&&!ki(e)&&!eo(e);R(t,!V?.retainedCreated?.has(t)),n!==null&&r!==null&&El(p,n,r,i)}throw t.head=null,t.tail=null,t.size=0,e}return _}function El(e,t,n,r){let i=nu(t),a=tu(n)?nu(n):q(n);iu(t),iu(n),r&&au(Dl,[e,i,a])}function Dl([e,t,n]){for(let r=t;r!==null&&r!==n;){let t=q(r);r.parentNode===e&&!ji(r)&&r.remove(),r=t}}function Ol(e,t,n,r,i,a,o,s=!1,c=!1,l=!1,u=!1){let d=t.items,f=t.size,p=n.length,m=t.end.parentNode,h=V===null?0:V.ops.length,g;if(f===0){Tl(e,t,n,r,i,o,l,u);return}if(e.idState.renderOwner?.signalOwner,p===0){g=du(t,e,h),kl(t,t.items,g),t.head=null,t.tail=null,t.size=0,t.inOrder=!0;return}let _=t.head,v=0;for(;_!==null&&v0&&b>=v;){let e=n[b],o=wl(r,e,b,u);if(y.key!==o)break;let l=y;a&&l.props===e&&l.body===i&&l.itemIndex===b||(a&&c&&l.props===e&&l.body===i?l.itemIndex=b:Cl(l,e,b,i,a,s,c,t.env)),y=l.prevSibling,b--,x--}let S,C;if(x===0?(C=_,S=C?C.prevSibling:t.tail):(S=_.prevSibling,C=y.nextSibling),x===0){let a=vu(null);a!==null&&S!==null&&!a.has(S)&&a.set(S,S.nextSibling),C!==null&&(t.inOrder=!1);let s=C?C.startMarker:t.end;g=du(t,e,h);let c=S;for(let a=v;a<=b;a++){let f=n[a],p=wl(r,f,a,u),h=Al(e,m,s,f,a,p,i,t,o,l,null,!0,g);d.set(p,h),h.prevSibling=c,h.nextSibling=C,c?c.nextSibling=h:t.head=h,c=h,C?C.prevSibling=h:t.tail=h,t.size++}return}if(v>b){let n=vu(null);n!==null&&(null.inOrder||(null.prior??=[...d.values()]),S!==null&&!n.has(S)&&n.set(S,S.nextSibling)),g=du(t,e,h);let r=_,i=0;for(;r!==C;){let e=r.nextSibling;g===null?R(r):uu(r,!1,g.out),d.delete(r.key),r=e,i++}S?S.nextSibling=C:t.head=C,C?C.prevSibling=S:t.tail=S,t.size-=i;return}let w=b-v+1,T=[],E=new Map,D=x===w?_:null,ee=!1;for(let e=0;e=w?(xl=null,O=te):O=new Int32Array(w);try{for(let e=0;e0?d.get(T[n-1]):null)}for(let t of e)t!==null&&!r.has(t)&&r.set(t,t.nextSibling)}let i=C?C.startMarker:t.end;g===void 0&&(g=du(t,e,h));for(let e=n-1;e>=0;e--){let t=yl[e],n=d.get(T[t]),r=t+10?d.get(T[n-1]):S,a=n+1=0;i--){let a=d.get(T[i]);if(n<0||i!==e[n]){let e=r?r.startMarker:b;g===null?Nl(a,e):g.out.push(Nl,a,e)}else n--;a.nextSibling=r,r?r.prevSibling=a:t.tail=a,r=a}r.prevSibling=S,S?S.nextSibling=r:t.head=r;return}if(r){let e=Fl(O,w),n=e.length-1,r=C;for(let i=w-1;i>=0;i--){if(O[i]===-1)continue;let a=d.get(T[i]);if(n<0||i!==e[n]){let e=r?r.startMarker:b;g===null?Nl(a,e):g.out.push(Nl,a,e)}else n--;a.nextSibling=r,r?r.prevSibling=a:t.tail=a,r=a}r.prevSibling=S,S?S.nextSibling=r:t.head=r}let x=S,D=0;for(let r=0;rda(r,i,a,o),null,null)),t.clear()}function Al(e,t,n,r,i,a,o,s,c,l,u=null,d=!1,f=null){if(f!==null&&!(c===!0&&l)&&(t=gu(f,n),n=null),c===!0){if(u!==null){let n=L(`control-flow`,e,t,u,u,o,r,s.env);return n.forSlot=s,n.key=a,n.itemIndex=i,n.deoptNode=u,Ea(n),j(n),n}let d=f!==null&&c===!0&&l!==!1,p=L(`control-flow`,e,t,null,d?fu??pu():n,o,r,s.env);p.forSlot=s,p.key=a,p.itemIndex=i;try{j(p)}catch(e){throw jl(p,e,d?null:t,n),e}if(d){let e=f.out,t=e.length;return t!==0&&e[t-3]===hu&&e[t-1]===n?e[t-2].push(p):e.push(hu,[p],n),p}let m=n===null?t.lastChild:n.previousSibling;return p.startMarker=m,p.endMarker=m,p}let p=document.createComment(`it`),m=document.createComment(`/it`);u===null&&(t.insertBefore(p,n),t.insertBefore(m,n));let h=L(`control-flow`,e,t,p,m,o,r,s.env);h.forSlot=s,h.key=a,h.itemIndex=i,u!==null&&(h.deoptNode=u,Ea(h));try{j(h)}catch(e){throw jl(h,e,null,null),e}return h}function jl(e,t,n,r){let i=e.slots[0];if(n!==null&&i!=null&&i.__kind===void 0){let t=Ml(n,r);e.startMarker=t,e.endMarker=t}R(e,!V?.retainedCreated?.has(e))}function Ml(e,t){return t===null?e.lastChild:t.previousSibling}function Nl(e,t){let n=e.startMarker,r=n.parentNode,i=e.endMarker,a=Kn;a!==null&&Yn(r,a);let o=a===null&&r.isConnected===!0?r.moveBefore:void 0,s=typeof o==`function`?o:null;if(n===i){a===null?s===null?r.insertBefore(n,t):s.call(r,n,t):Pl(r,n,t,a);return}let c=[];for(let e=n;e!==null&&(c.push(e),e!==i);e=q(e));for(let e=0;e>1;e[r[n]]0?r[a-1]:-1,r[a]=i)}let i=r.length,a=r[i-1];for(;i-->0;)r[i]=a,a=n[a];return r}var Il=256,Ll=512,Rl=[[],[],[],[],[],[],[],[]];function W(e,t,n,r,i,a,o,s){let c=e.slots[0],l=r!==i;if(t===null){let n=c.$;if(!l&&n<=255)return null;let r=n&255;if(n>255)t=zl(c);else{if(t=c.next,typeof t==`function`){let e=t;for(t=c.next=Rl.pop()??[];t.length=0;e--)t[e]=c;c.$=n|=Il}let i=V;(n&Ll)===0&&i!==null&&e.block.createdStamp!==Sa&&(t[r]=e,t[r+1]=i.ops.length,c.$=n|Ll,i.ops.push(Vl,c))}if(t[n]=l?r:c,a!==void 0){let e=a.args;e!==od&&(t[n+1]=l?o:c),(e===2||e===-2)&&(t[n+2]=l?s:c)}return t}function zl(e){return e.next}function Bl(e,t){let n=t.next,r=t.$&=255;n[r]=e,n[r+2](t,n,Od!==0&&Hd.length!==0)}function Vl(e,t){let n=e.next;n[(e.$&=255)+2](e,n,t)}function Hl(e){let t=V,n=e.next;return(n===null||n.tx!==t)&&(n=e.next={tx:t,out:[],frag:null,root:null,parent:null,before:null,members:null,owner:null,follows:!1,bound:null},t.ops.push(Xl,e)),n}function Ul(e,t,n,r){let i=Hl(e);return i.frag===null&&ql(i,t,n,r),i.frag}function Wl(e,t,n){let r=V,i={tx:r,out:[],frag:null,root:null,parent:null,before:null,members:null,owner:null,follows:!1,bound:null};return r.ops.push(Xl,{next:i}),ql(i,e,t,n)}var Gl=[],Kl=[];function ql(e,t,n,r){let i=n.nodeType===9?n:n.ownerDocument,a=Kl.pop(),o=a!==void 0&&a.ownerDocument===i?a:i.createDocumentFragment();return o.$$next=e,e.frag=o,e.members=[],e.parent=n,e.before=r,e.owner=t===null?null:Js(t),o}function Jl(e,t){let n=e.$$next;n!==void 0&&n.members.push(t,e)}function G(e,t){let n=V;if(n===null||n.aborted)return!1;let r=e instanceof Xi?e.ownerBlock:e;if(r.createdStamp===n.createdStamp&&!n.retainedCreated?.has(r))return!1;if(t.isConnected)return!0;let i=t;for(let e=i.parentNode;e!==null;e=i.parentNode)i=e;return i.nodeType!==11||i.$$next===void 0}function Yl(e,t,n,r){gn(t.block),Hl(e).out.push(t,n,r)}function Xl(e){let t=e.next;if(e.next=null,t===null)return;let n=t.out,r=t.parent,i=t.before;if(t.follows&&n.length!==0){let e=n[n.length-2];e!==null&&e.parentNode===r&&(i=q(n[n.length-1]))}su(n,r);let a=t.members;if(a===null||t.owner.disposed)return;let o=t.frag;(o!==null||t.root!==null)&&r.insertBefore(o??t.root,i);for(let e=0;e{let t=Ou;Ou=c;try{cu(e)}finally{Ou=t}};n===void 0?ou(l,o,s):n.push(l,o,s)}function du(e,t,n){let r=V;if(r===null)return null;if(e.next!==null&&e.next.tx===r)return Hl(e);let i=e.end.parentNode??ru(e.end);if(e.adopt!==null||!G(t,i))return null;let a=e.next={tx:r,out:[],frag:null,root:null,parent:i,before:null,members:null,owner:t instanceof Xi?t.ownerBlock:t,follows:!1,bound:null},o=r.ops;return n>=o.length?o.push(Xl,e):o.splice(n,0,Xl,e),a}var fu=null;function pu(){return fu=document.createComment(``)}function mu(e,t){let n=e.out,r=n.length;if(r!==0&&n[r-3]===hu&&n[r-1]===t)return n[r-2];let i=[];return n.push(hu,i,t),i}function hu(e,t,n){let r=e;for(let e=0;e`u`)return;Mu=!0;let e=Node.prototype;Au=Object.getOwnPropertyDescriptor(e,`firstChild`)?.get,ju=Object.getOwnPropertyDescriptor(e,`nextSibling`)?.get;let t=Element.prototype;Object.isExtensible(t)&&(J(t,`$$portalParent`),J(t,`$$portalEnd`),J(t,`$$deoptKey`),J(t,`$$ctrl`),J(t,`__oct_suppress`),J(t,`__oct_frag`),J(t,`__oct_vfrag`),J(t,go,!1),J(t,vo,!1),J(t,yo,!1),J(t,gc,!1),J(t,Lf,!1)),typeof CharacterData<`u`&&Object.isExtensible(CharacterData.prototype)&&(J(CharacterData.prototype,`$$portalEnd`),J(CharacterData.prototype,`$$deoptKey`),J(CharacterData.prototype,gc,!1))}var Pu=Symbol(`octane.lazy-template`);function Fu(e){for(let t of e.querySelectorAll(`*`))if(t.localName.includes(`-`)||t.hasAttribute(`is`))return e.__oct_frag=!0,e;let t=document.createDocumentFragment(),n;for(;(n=K(e))!==null;)t.appendChild(n);return t.__oct_frag=!0,t}function Iu(e,t,n){Nu();let r=document.createElement(`template`);if(t===0){if(r.innerHTML=io?io.createHTML(e):e,n){let e=r.content.ownerDocument.createElement(`octane-frag`);return e.appendChild(r.content),Fu(e)}let t=K(r.content);return t.nodeType===1&&t.localName===`octane-frag`?Fu(t):t}let i=t===1?`svg`:`math`,a=`<${i}>${e}`;r.innerHTML=io?io.createHTML(a):a;let o=K(r.content);return n?Fu(o):K(o)}function Y(e,t=0,n=0){return{[Pu]:{html:e,ns:t===1?1:t===2?2:t===3?3:0,frag:n,parsed:[null,null,null],root:0}}}function Lu(e){let t;t=e.ns===3?0:e.ns;let n=e.parsed[t];return n===null&&(n=Iu(e.html,t,e.frag),e.parsed[t]=n),n}function X(e,t,n){let r=e.nodeType===void 0?e[Pu]:void 0;return r===void 0?e.cloneNode(!0):Lu(r).cloneNode(!0)}function Ru(e,t,n){if(t!==null){let n=e.block,r=n.endMarker;if(r!==null&&r===fu)for(let e=n;e!==null&&e.endMarker===r&&(e.endMarker=e.startMarker===void 0?null:e.startMarker=t,!e.forSlot);e=e.parentBlock);else{let e=n.parentNode,i=V;i!==null&&n.createdStamp!==i.createdStamp&&n instanceof Ri&&(n.startMarker===null||n.startMarker!==r)&&G(n,e)?Wl(n,e,r).appendChild(t):e.insertBefore(t,r)}}return e.slots[0]=n,n}function zu(e,t,n=0,r=null){return Ru(e,t,{__journalWindow:0,$:n,next:r,[_u]:0})}function Bu(e,t,n,r=0,i=null){return Ru(e,t,{a:n,__journalWindow:0,$:r,next:i,[_u]:1})}function Vu(e,t,n,r,i=0,a=null){return Ru(e,t,{a:n,b:r,__journalWindow:0,$:i,next:a,[_u]:2})}function Hu(e,t,n,r,i,a,o=0,s=null){return Ru(e,t,{a:n,b:r,c:i,d:a,__journalWindow:0,$:o,next:s,[_u]:4})}function Uu(e,t,n,r,i,a,o,s=0,c=null){return Ru(e,t,{a:n,b:r,c:i,d:a,e:o,__journalWindow:0,$:s,next:c,[_u]:5})}function Wu(e,t,n,r,i,a,o,s,c,l,u,d=0,f=null){return Ru(e,t,{a:n,b:r,c:i,d:a,e:o,f:s,g:c,h:l,i:u,__journalWindow:0,$:d,next:f,[_u]:9})}function Gu(e,t,n,r,i,a,o,s,c,l,u,d,f,p=0,m=null){return Ru(e,t,{a:n,b:r,c:i,d:a,e:o,f:s,g:c,h:l,i:u,j:d,k:f,__journalWindow:0,$:p,next:m,[_u]:11})}function Ku(e){return e==null||e===!1?``:typeof e==`string`?e:String(e)}function qu(e,t,n=void 0){let r=typeof t==`string`?t:Ku(t);if(n===1){let t=Au===void 0?e.firstChild:Au.call(e);if(t!==null&&t.nodeType===3)return t.nodeValue=r,t}let i=document.createTextNode(r);return e.appendChild(i),i}function Z(e){return Au===void 0?e.firstChild:Au.call(e)}function Ju(e,t=1){let n=e;for(let e=0;e2&&e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&t>=65&&t<=90}var $u=`$ocapture:`;function ed(e){return e===`DoubleClick`?`dblclick`:e===`Focus`?`focusin`:e===`Blur`?`focusout`:e.toLowerCase()}var td;function nd(e,t){if(!Qu(e)||t!==void 0&&ko(t)&&!de(e))return null;let n=td?.get(e);if(n!==void 0)return n;let r=e.slice(2),i=!1;r.length>7&&r.endsWith(`Capture`)&&e!==`onGotPointerCapture`&&e!==`onLostPointerCapture`&&(i=!0,r=r.slice(0,r.length-7));let a=ed(r),o={type:a,key:i?$u+a:`$o`+a,capture:i};return de(e)&&(td??=new Map).set(e,o),o}var rd=Symbol(),id=1;function ad(e){return typeof e==`object`&&!!e&&e[rd]===id}var od=[];function sd(e,t,n){let r=e;r[t]=n}function cd(e,t){for(;e!==null;e=q(e))if(hr(e),e===t)return}var ld=new Map,ud=new Map,dd=Symbol(`octane.portalPathLength`),fd=new WeakMap,pd=Symbol(`octane.rootEpoch`);function md(e,t){let n=fd.get(e);for(;n!==void 0&&n.since>t;)n=n.previous;return n!==void 0&&n.count>0}function hd(e,t){if(ud.size===1&&gr===0){r(e),k&&k.begin(e,!0),e[pd]=_r;return}let n=e.composedPath();if(ud.size===1)return r(e),k&&k.begin(e,!0),e[pd]=_r,gr!==0&&(Ni(n,_r),e[dd]=n.length),n;for(let i=n.length-1;i>=0;i--)if(ud.has(n[i])){n[i]===t?(r(e),k&&k.begin(e,!0),e[pd]=_r,gr!==0&&(Ni(n,_r),e[dd]=n.length)):(k&&k.begin(e,!1),gr!==0&&n.length>(e[dd]||0)&&(Ni(n,e[pd]??_r),e[dd]=n.length));break}return n}var gd=new Map,_d=null,vd={passive:!1},yd={capture:!0,passive:!1};function bd(e,t){return e===`touchstart`||e===`touchmove`?t?yd:vd:t}function xd(e){let t=typeof Element<`u`&&Object.isExtensible(Element.prototype);for(let n=0;n=0;t--){let n=jd[t];if(n.event===e)return n}}function Pd(){let e=Nd(this);e!==void 0&&(e.flags|=1);let t=e?.stop||this.stopPropagation;(t===Pd?Event.prototype.stopPropagation:t).call(this)}function Fd(){let e=Nd(this);e!==void 0&&(e.flags|=2);let t=e?.immediate||this.stopImmediatePropagation;(t===Fd?Event.prototype.stopImmediatePropagation:t).call(this)}var Id={configurable:!0,writable:!0,value:Pd},Ld={configurable:!0,writable:!0,value:Fd};function Rd(e,t,n,r){n?.configurable===!1?n.writable&&Object.defineProperty(e,t,{value:r.value}):Object.defineProperty(e,t,r)}function zd(e,t,n){let r=jd[Md];return r===void 0&&(r={event:null,flags:0,stop:null,immediate:null,currentTarget:null},jd.push(r)),Md++,r.event=e,r.flags=0,r.stop=e.stopPropagation,Rd(e,`stopPropagation`,t,Id),n!==null&&(r.immediate=e.stopImmediatePropagation,Rd(e,`stopImmediatePropagation`,n,Ld)),r}function Bd(e,t,n){let r=jd[--Md];r.event=null,r.stop=null,r.immediate=null,r.currentTarget=null,t===void 0?delete e.stopPropagation:Object.defineProperty(e,"stopPropagation",t),n!==null&&(n===void 0?delete e.stopImmediatePropagation:Object.defineProperty(e,"stopImmediatePropagation",n))}var Vd={configurable:!0,get(){return Nd(this)?.currentTarget}},Q=[],Hd=[],Ud=null;function Wd(e,t,n,r){let i=r?n.captureKey:n.bubbleKey,a=e[pd],o=!!(n.flags&64)||!r&&!!(n.flags&128),s=-1;if(mr!==0)for(let e=Q.length-1;e>=t;e--){let t=Q[e].$$retiredEpoch;if(t>=mr&&t<=a){s=e;break}}let c=!1;for(let e=t;e=0?Gd(n[++d]):e.parentNode}if(m)return r.length=i,0;if(p)return r.length-i;if(f===null)return r.length=i,0;let h=n.indexOf(f);if(h=s||h===l&&u)return r.length=i,0;c=f,l=h,u=!0}}function qd(e,t){if(typeof e==`function`)e(t);else if(ad(e)){let n=e.args;if(typeof n!=`number`)switch(n.length){case 0:e.fn();break;case 1:e.fn(n[0]);break;case 2:e.fn(n[0],n[1]);break;default:e.fn.apply(null,n)}else n===1?e.fn(e.a0):n===2?e.fn(e.a0,e.a1):n===-1?e.fn(t,e.a0):e.fn(t,e.a0,e.a1)}else Jd(`${t.type} event`,e,t)}function Jd(e,t,n){if(t)throw Error(h(46,e,typeof t));t(n)}function Yd(e){if(typeof reportError==`function`)reportError(e);else if(typeof window<`u`&&typeof ErrorEvent==`function`){let t=new ErrorEvent(`error`,{error:e,message:String(e?.message??e),cancelable:!0});window.dispatchEvent(t),t.defaultPrevented||console.error(e)}else console.error(e)}function Xd(e,t){if(!e.bubbles||e.cancelBubble||!(t.flags&1)){e.bubbles&&t.flags&1&&k&&k.enqueue(e,t),k&&k.finish(t);return}if(!(t.flags&16))return;if(uf.length===0){if(!(t.flags&32))return;let n=e.target?.localName;if(n!==`input`&&n!==`textarea`&&n!==`select`)return}let n=e[Ad],r=N,i=e.target,a=k?k.delivery(e):void 0,o=()=>{e[Ad]===n&&k&&k.enqueue(e,t,r,i,a)&&k.finish(t)};e.isTrusted?setTimeout(o,0):queueMicrotask(o)}function Zd(e){let t=ld.get(e.type)??gd.get(e.type);if(t===void 0)return;let r=!!(t.flags&4),i=r?hd(e,this):void 0,a=Q.length,o=e.target,s=ef,c=null,l,u,d=!1,f;try{if(!r&&Kd(e,this)===0||(l=null,Od++,e[Ad]=(e[Ad]||0)+1,k&&k.enqueue(e,t),e.type===`submit`&&o!=null&&o.nodeName===`FORM`&&(c=Xu(o,e),ef=c),r&&t.flags&2&&(i??=e.composedPath(),Qd.call(this,e,i,t)))||!(t.flags&1)||o?.nodeType===1&&ko(o)&&t.flags&256||(r&&Kd(e,this,i),!Wd(e,a,t,!1)&&c===null))return;u=Object.getOwnPropertyDescriptor(e,`stopPropagation`),d=!0,f=zd(e,u,null);let s=!!(t.flags&8);for(let t=a;t=i;t--){let r=Hd[t];if(r!=null&&!n(e,Q[t],!0)&&($d(e,Q[t],u),Ra(r,e,Ud?.[t]),u.flags&1))break}}}finally{l=(u===void 0?a:u.flags!==0)||!c&&e.cancelBubble,Q.length=i,Hd.length=i,Ud!==null&&(Ud.length=i),a&&(Bd(e,o,s),Yu(e)),Od--,_d(e,r)}return l}function $d(e,t,n){n.currentTarget=t,Object.defineProperty(e,"currentTarget",Vd)}var ef=null;function tf(e){let t=e.name;if(t===``)return[e];let n=e.form;if(n!==null){let e=n.elements.namedItem(t);return e===null?[]:`nodeType`in e?[e]:e}let r=e.getRootNode();return r===e?[e]:r.nodeType===9?r.getElementsByName(t):r.querySelectorAll(`input[type="radio"]`)}function nf(e){return typeof e==`string`?e:typeof e==`function`||typeof e==`symbol`?``:String(e)}function rf(e){Od===0&&e.flags&16&&uf.length>0&&(!N&&Er()&&er(A),Wf()),e.name===`click`&&(df=null)}var af=Symbol(`octane.uncontrolled`),of=Symbol(`octane.controlledDelivery`),sf=0;function cf(e){return e.type===`input`||e.type===`change`?e[of]:void 0}function lf(e,t){if(e.type!==`input`&&e.type!==`change`)return;if(t){let t=++sf;e[of]=N?-t:t}let n=ld.get(e.type)??gd.get(e.type);if(n===void 0||!(n.flags&2))return;let r=cf(e),i=e.target;if(r===void 0||i===null||i.localName!==`input`&&i.localName!==`textarea`&&i.localName!==`select`)return;let a=i.$$restoreDelivery;(a===void 0||Math.abs(a)0||hf.length>0||gf.length>0}function vf(e,t){if(e.$$afSeen===void 0&&(e.$$afSeen=!0,t)){switch(e.localName){case`button`:case`input`:case`select`:case`textarea`:break;default:return}mt(gf,e)}}function yf(e){if(e.localName===`textarea`)return!0;if(e.localName!==`input`)return!1;switch(e.type){case`text`:case`search`:case`url`:case`tel`:case`password`:case`email`:case`number`:return!0}return!1}function bf(e){let t=e.currentTarget,n=t.$$ctrl;n!==void 0&&(n.compositionEndTask!==void 0&&n.compositionEndTask!==null&&(clearTimeout(n.compositionEndTask),n.compositionEndTask=null),n.composing=!0,t.addEventListener(`blur`,xf))}function xf(e){let t=e.currentTarget,n=t.$$ctrl;if(n===void 0)return;t.removeEventListener(`blur`,xf),n.compositionEndTask!==void 0&&n.compositionEndTask!==null&&clearTimeout(n.compositionEndTask),n.composing=!0;let r=()=>{n.compositionEndTask=null,n.composing=!1,Vf(t)};n.compositionEndTask=e.type===`blur`?setTimeout(r,0):setTimeout(()=>{n.compositionEndTask=setTimeout(r,0)},0)}function Sf(e){return e.$$ctrl}function Cf(e){let t=Sf(e);return t===void 0&&(t=ht(e)),t.compositionEndTask===void 0&&yf(e)&&(t.compositionEndTask=null,e.addEventListener(`compositionstart`,bf),e.addEventListener(`compositionend`,xf)),t}function wf(e,t){return e.type===`number`?t===0&&e.value===``||e.value!=t:e.value!==nf(t)}function Tf(e,t){let n=e,r=Cf(e),i=!r.sawV;if(r.sawV=!0,t==null){r.v=af;return}let a=nf(t);if(i)r.v=t,n.value!==a&&(n.value=a),n.defaultValue=a;else{let e=r.v;r.v=t,Ef([n,t,a,!(r.composing&&Object.is(e,t))]);return}}function Ef([e,t,n,r]){r&&wf(e,t)&&(e.value=n),Df([e,n])}function Df([e,t]){if(e.defaultValue===t)return;let n=e.localName===`textarea`?K(e):null;n!==null&&n.nodeType===3&&q(n)===null?n.data=t:e.defaultValue=t}function Of(e){e.localName===`input`?e.removeAttribute(`value`):e.defaultValue=``}function kf(e,t,n){e?au(t,n):t(n)}function Af([e,t]){(e.defaultValue!==t||t===``&&e.localName===`input`&&!e.hasAttribute(`value`))&&(e.defaultValue=t)}function jf(e,t,n){let r=!n.sawC;if(n.sawC=!0,t==null){n.c=-1;return}let i=!!t;if(ff??=Hf,r){n.c=i,n.sawDC=!0,e.checked=i,e.defaultChecked!==i&&(e.defaultChecked=i);return}let a=i!==n.c;n.c=i,(a||!Mf(e))&&e.checked!==i&&(e.checked=i)}function Mf(e){let t=df;return t===null?!1:e===t||e.type===`radio`&&t.type===`radio`&&e.name!==``&&e.name===t.name&&e.form===t.form&&(e.form!==null||e.getRootNode()===t.getRootNode())}function Nf(e,t){jf(e,t,Cf(e))}function Pf(e,t){let n=e,r=Cf(e);if(r.sawV,r.sawV=!0,t==null){r.sv=null;return}if(pf??=Ff,n.multiple){if(!Array.isArray(t))return;let e=new Set;for(let n=0;n0){let e=gf;gf=[];for(let t=0;t0){let e=hf;hf=[];for(let t=0;t0){let e=mf;mf=[];for(let t=0;t0||hn.length>0,t=uf;if(uf=[],e)for(let e=0;e{a.$$checkableActivation===!0&&(a.$$checkableActivation=!1,a===df&&(df=null),Vf(a))},0)),!0;if(a===df&&(df=null),e.type===`input`&&a.localName===`select`)return a.$$selectPick=!0,setTimeout(()=>{a.$$selectPick===!0&&(a.$$selectPick=!1,Vf(a))},0),!0;if(e.type===`input`&&s&&a.$$checkableActivation===!0)return!0;e.type===`change`&&(s&&(a.$$checkableActivation=!1),a.localName===`select`&&(a.$$selectPick=!1));let c=uf.indexOf(a);return c===-1?uf.push(a,n):uf[c+1]=n,!0}function qf(e){return()=>{e|=0,e=e+1831565813|0;let t=Math.imul(e^e>>>15,1|e);return t=t+Math.imul(t^t>>>7,61|t)^t,((t^t>>>14)>>>0)/4294967296}}var Jf=qf(20261104),Yf=e=>e[Jf()*e.length|0],Xf=(e,t)=>e+(Jf()*(t-e+1)|0),Zf=`the a this each every that state render update component list stream token browser layout frame request response cache value event handler queue scheduler commit result effect boundary model reply message server client keeps reads writes returns sends receives renders updates batches schedules measures avoids reuses stores tracks applies resolves compares merges splits quickly safely only always usually first later again once directly with from into before after during between without across through small large stable expensive cheap separate shared current previous next and or but so because when while if then`.split(` `),Qf=[`useState`,`fetch`,`requestAnimationFrame`,`AbortController`,`ReadableStream`,`TextDecoder`,`Map`,`WeakMap`,`Promise.all`,`structuredClone`,`key`,`props`,`onInput`,`aria-live`,`flex`,`grid`,`position: sticky`,`overflow-anchor`,`content-visibility`],$f=[`How it works`,`Why this happens`,`A simpler approach`,`Putting it together`,`Things to watch for`,`Performance notes`,`Example`,`Next steps`,`Trade-offs`,`Testing it`],ep=[`How do I stream a response from fetch and render it as it arrives?`,`Why does my list re-render every item when only the last one changes?`,`Can you explain how the event loop orders microtasks and tasks?`,`What is the best way to debounce a search input?`,`Show me how to cancel an in-flight request when the user navigates away.`,`How should I structure state for a chat application?`,`Why is my layout thrashing when I read offsetHeight in a loop?`,`What does content-visibility do and when should I use it?`,`How do I keep the scroll position pinned to the bottom while messages stream in?`,`Write a small tokenizer that splits text on whitespace but keeps the separators.`,`Compare a Map and a plain object for a cache keyed by id.`,`How can I make syntax highlighting cheaper for long code blocks?`,`Summarize the trade-offs between virtualizing a list and rendering it all.`,`What is a good way to memoize parsed Markdown per message?`,`Explain structural sharing in immutable updates.`,`How do I test a component that renders streamed text?`],tp=[`const response = await fetch(url, { signal: controller.signal });`,`const reader = response.body.getReader();`,`const decoder = new TextDecoder();`,`let buffer = '';`,`while (true) {`,` const { done, value } = await reader.read();`,` if (done) break;`,` buffer += decoder.decode(value, { stream: true });`,` onChunk(buffer);`,`}`,`export function tokenize(text) {`,` return text.match(/\\s*\\S+/g) ?? [];`,`}`,`const cache = new Map();`,`function getParsed(id, source) {`,` const hit = cache.get(id);`,` if (hit && hit.source === source) return hit.blocks;`,` const blocks = parse(source);`,` cache.set(id, { source, blocks });`,` return blocks;`,`}`,`// Keep the newest message in view while it grows.`,`list.scrollTop = list.scrollHeight - list.clientHeight;`,`const timeout = setTimeout(() => controller.abort(), 30000);`,`const items = messages.filter((m) => m.role === 'assistant');`,`return { ...state, messages: [...state.messages, reply] };`],np=[[`javascript`,tp],[`javascript`,tp],[`python`,[`import asyncio`,`from dataclasses import dataclass`,`@dataclass`,`class Message:`,` role: str`,` text: str`,`async def stream_reply(client, prompt):`,` async for chunk in client.stream(prompt):`,` yield chunk.delta`,`def tokenize(text):`,` # Split on whitespace but keep the separators.`,` return re.findall(r'\\s*\\S+', text)`,`cache = {}`,`if key in cache:`,` return cache[key]`,`result = await asyncio.gather(*tasks)`,`for index, item in enumerate(items):`,` print(f'{index}: {item}')`]],[`css`,[`.messages {`,` display: flex;`,` flex-direction: column;`,` overflow-y: auto;`,` overflow-anchor: none;`,`}`,`.message {`,` content-visibility: auto;`,` contain-intrinsic-size: auto 120px;`,` padding: 12px 16px;`,` border-radius: 8px;`,`}`,`pre code {`,` font-family: ui-monospace, monospace;`,` white-space: pre;`,`}`]]];function rp(){let e=Jf();return e<.06?`\`${Yf(Qf)}\``:e<.1?`**${Yf(Zf)} ${Yf(Zf)}**`:e<.12?`*${Yf(Zf)}*`:Yf(Zf)}function ip(){let e=Xf(7,18),t=[];for(let n=0;n{let i=[];for(let e=0;e({...e,messages:e.messages.slice()}))}function gp(e){return dp(`user`,e)}function _p(){let e=pp[mp++%pp.length];return{message:dp(`assistant`,``),text:e}}var vp=[],yp=/^(#{1,3}) (.*)$/,bp=/^(?:[-*]|\d+\.) /,xp=/^\d+\. /;function Sp(e,t=vp){let n=e.split(` +`),r=[],i=(e,n,i)=>{let a=r.length,o=t[a];o!==void 0&&o.type===e&&o.raw===n?r.push(o):r.push({id:a,type:e,raw:n,...i()})},a=0;for(;a({lang:r,lines:n.slice(t+1,o).map((e,t)=>({id:t,tokens:Ep(e)}))}));continue}if(e.trim()===``){a++;continue}let t=yp.exec(e);if(t!==null){i(`heading`,e,()=>({level:t[1].length,inlines:Cp(t[2])})),a++;continue}if(bp.test(e)){let t=xp.test(e),r=a;for(;a({ordered:t,items:o.map((e,t)=>({id:t,inlines:Cp(e.slice(e.indexOf(` `)+1))}))}));continue}let r=a;for(;a({inlines:Cp(o.join(` `))}))}return r}function Cp(e){let t=[],n=0,r=(e,n)=>t.push({id:t.length,kind:e,text:n}),i=(t,i,a,o)=>{let s=e.indexOf(o,i+a);return s<=i+a?i+1:(i>n&&r(`text`,e.slice(n,i)),r(t,e.slice(i+a,s)),n=s+o.length,n)},a=0;for(;a{let r=t[t.length-1];e===`plain`&&r!==void 0&&r.kind===`plain`?r.text+=n:t.push({id:t.length,kind:e,text:n})};Tp.lastIndex=0;let r;for(;Tp.lastIndex{Op===n&&(Op=null)}}window.deliverChunk=()=>{let e=Op;if(e===null)return;let t=Math.min(e.tokens.length,e.position+Dp),n=``;for(let r=e.position;r