+${n.map(((n,o)=>e.line-1-t<=o&&o<=e.line-1+t?i.html`<${Dt} code=${n} i=${o} frameLine=${o===e.line-1} />`:null))}+
`},It=e=>e.flatMap(((t,n)=>n===e.length-1?[t]:n===e.length-2?[t," and "]:[t,", "])),Pt=({cell_id:e,diagnostics:t})=>(i.useEffect((()=>(window.dispatchEvent(new CustomEvent("cell_diagnostics",{detail:{cell_id:e,diagnostics:t}})),()=>window.dispatchEvent(new CustomEvent("cell_diagnostics",{detail:{cell_id:e,diagnostics:[]}})))),[t]),i.html`
+ Syntax error
${""===e?i.html`
`:e}
+ {e.preventDefault(),a.split_remote_cell(n,o,!0)}} + >Split this cell into ${o.length} cells, or +
`;return i.html`Multiple expressions in one cell.
+How would you like to fix it?
+Multiple expressions in one cell.
+${t}
`},show_stacktrace:()=>!1},{pattern:/LoadError: cannot assign a value to variable workspace#\d+\..+ from module workspace#\d+/,display:()=>i.html`Tried to reevaluate an include
call, this is not supported. You might need to restart this notebook from the main menu.
+ For a workaround, use the alternative version of include
described here:
+ GH issue 115
+
In the future, include
will be deprecated, and this will be the default.
${e}
`))},{pattern:/Cyclic references among (.*)\./,display:e=>e.split("\n").map((e=>{const t=e.match(/Cyclic references among (.*)\./);if(t){let e=t[1].split(/, | and /).map((e=>i.html`${e}`));return i.html`Cyclic references among${" "}${It(e)}.
`}return i.html`${e}
`}))},{pattern:/Multiple definitions for (.*)\./,display:e=>e.split("\n").map((e=>{const t=e.match(/Multiple definitions for (.*)\./);if(t){let e=t[1].split(/, | and /).map((e=>i.html`{const o=document.querySelector(`pluto-cell:not([id='${n}']) span[id='${encodeURI(e)}']`);t.preventDefault(),null==o||o.scrollIntoView()}}>${e}`));return i.html`Multiple definitions for${" "}${It(e)}.
`}return i.html`${e}
`}))},{pattern:/^syntax: (.*)$/,display:r.display,show_stacktrace:()=>!1},{pattern:/^\s*$/,display:()=>r.display("Error")},{pattern:/^UndefVarError: (.*) not defined\.?$/,display:e=>{const t=a.get_notebook(),o=Bt(t,n),r=e.match(/UndefVarError: (.*) not defined/);let s=((null==r?void 0:r[1])??"").replaceAll("`","");const l=Object.values((null==t?void 0:t.cell_dependencies)??{}).some((e=>Object.keys(e.downstream_cells_map).includes(s)));if(0===Object.keys(o).length||!l)return i.html`${e}
`;const c=Object.keys(o).map((e=>i.html`{t.preventDefault();const n=document.querySelector(`pluto-cell[id='${o[e]}']`);null==n||n.scrollIntoView()}}>${e}`));return i.html`Another cell defining ${It(c)} contains errors.
`},show_stacktrace:()=>{const e=Bt(a.get_notebook(),n);return 0===Object.keys(e).length}},{pattern:/^ArgumentError: Package (.*) not found in current path/,display:e=>{var t,n,o;const r=e.match(/^ArgumentError: Package (.*) not found in current path/),s=((null==r?void 0:r[1])??"").replaceAll("`",""),l=null===(t=a.get_notebook())||void 0===t||null===(n=t.nbpkg)||void 0===n||null===(o=n.terminal_outputs)||void 0===o?void 0:o[s];return i.html`The package ${s}.jl could not load because it failed to initialize.
+That's not nice! Things you could try:
+You might find useful information in the package installation log:
+ <${St} value=${l} />`},show_stacktrace:()=>!1},r],l=s.find((({pattern:t})=>t.test(e)))??r,[c,d]=i.useState(!1);i.useEffect((()=>{d(!1)}),[e,t,n]);const u=t.findIndex((e=>null!=Nt(e.file))),p=!c&&-1!=u&&uHere is what happened, the most recent locations are first:
+${t}`;case"application/vnd.pluto.tree+object":return i.html`<${Ht} cell_id=${n} body=${t} persist_js_state=${o} sanitize_html=${a} />`;default:return Rs({mime:e,body:t,cell_id:n,persist_js_state:o,sanitize_html:a,last_run_timestamp:null})}},Ft=({on_click_more:e})=>{const[t,n]=i.useState(!1);return i.html`
Welcome to the Live docs! Keep this little window open while you work on the notebook, and you will get documentation of everything you type!
You can also type a query above.
Still stuck? Here are some tips.
',loading:!1}),d=e=>c(le((t=>e(t))));i.useEffect((()=>{l.loading||(null==t||/[^\s]/.test(t))&&l.searched_query!==t&&u(t)}),[t,l.loading,l.searched_query]),i.useLayoutEffect((()=>{e&&s.current&&(s.current.focus({preventScroll:!0}),s.current.select())}),[e]);let u=e=>{d((t=>{t.loading=!0,t.searched_query=e})),Promise.race([Vt.default.Promises.delay(2e3,!1),r.send("docs",{query:e.replace(/^\?/,"")},{notebook_id:o.notebook_id}).then((t=>"⌛"!==t.message.status&&("👍"===t.message.status?(d((n=>{n.shown_query=e,n.body=t.message.doc})),!0):void 0)))]).then((()=>{d((e=>{e.loading=!1}))}))},p=i.useMemo((()=>i.html`<${Fs} body=${Po(l.body)} sanitize_html=${a} sanitize_html_message=${!1} />`),[l.body,a]),m=!1===l.loading&&""!==l.searched_query&&l.searched_query!==l.shown_query;return i.html` +${l.shown_query}
A new server was started - this notebook session is no longer running.
+Would you like to go back to the main menu?
+The statefile failed to download. Original error message:
+${t.toString()}
+ Launch parameters:
+${JSON.stringify(e,null,2)}
+ The latest versions of Firefox and Chrome will work best.