@pi-outpost/embed 0.62.3 → 0.63.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{CodeEditor-C2mtBAxz.js → CodeEditor-BW8cShfE.js} +870 -869
- package/dist/CodeEditor-BZfOQyjO.cjs +9 -0
- package/dist/{conversationExport-jRLUX0kH.js → conversationExport-BHXWfKKh.js} +37 -37
- package/dist/{conversationExport-DXxmgLoF.cjs → conversationExport-CWUOyeJO.cjs} +2 -2
- package/dist/{conversationHistory-C6PqGsO9.cjs → conversationHistory-0ds9dEO5.cjs} +26 -4
- package/dist/{conversationHistory-3pDBlkZZ.js → conversationHistory-xEFHYA2a.js} +94 -61
- package/dist/{dist-B9wvGgxB.js → dist-B-n0qSdY.js} +134 -133
- package/dist/{dist-LBUs7dVk.js → dist-B53CIh_q.js} +62 -61
- package/dist/{dist-DeLxY4Ia.js → dist-BBPYf4ef.js} +30 -29
- package/dist/dist-BFbWWJdM.cjs +23 -0
- package/dist/dist-BLE5-Y8p.cjs +9 -0
- package/dist/dist-BQCPWecG.cjs +1 -0
- package/dist/dist-BmjjdWVL.cjs +1 -0
- package/dist/{dist-kpPXlS4A.cjs → dist-Bo7aGd2O.cjs} +2 -2
- package/dist/{dist-Bk3hLKgL.js → dist-BoHwBqKn.js} +49 -49
- package/dist/{dist-VWDOErn8.js → dist-BpRy8-Lq.js} +47 -47
- package/dist/dist-BzV3uXd3.js +2842 -0
- package/dist/dist-C3wOZTh_.cjs +1 -0
- package/dist/dist-C6485_TJ.cjs +1 -0
- package/dist/{dist-BIMxMB--.js → dist-CEPaeNz_.js} +57 -57
- package/dist/dist-CbNZ-oK_.cjs +11 -0
- package/dist/dist-CewGgiCl.cjs +1 -0
- package/dist/dist-Cgkuh5Wk.cjs +11 -0
- package/dist/dist-ChIJFFop.cjs +3 -0
- package/dist/dist-Cqy-WSUm.cjs +6 -0
- package/dist/{dist-Bg1-NGne.js → dist-D1XDfvdG.js} +17 -17
- package/dist/{dist-qeX2QqDc.js → dist-DAh__jUg.js} +6724 -9561
- package/dist/dist-DV7vb3Vn.cjs +1 -0
- package/dist/dist-DWOMmaS_.cjs +1 -0
- package/dist/{dist-BWAsFrsx.js → dist-DcevhA0K.js} +73 -73
- package/dist/dist-DdI6ugoG.cjs +1 -0
- package/dist/{dist-CpOA8cNn.js → dist-DhtR0qbm.js} +49 -49
- package/dist/{dist-CwPu13CG.js → dist-DlwWvZ4d.js} +46 -46
- package/dist/{dist-nQ2aeIgK.js → dist-DnmbmV7C.js} +495 -494
- package/dist/dist-DsOiUWHL.cjs +1 -0
- package/dist/dist-DuyBYmw-.cjs +1 -0
- package/dist/{dist-DUziszL2.js → dist-T7rNKseu.js} +32 -32
- package/dist/{dist-CcTOENSK.js → dist-XKeyr4Om.js} +26 -26
- package/dist/{dist-CvxwObne.js → dist-n29rG6c2.js} +117 -117
- package/dist/{dist-DCT8mdeU.js → dist-s8hmOD0A.js} +52 -52
- package/dist/pi-outpost-embed.cjs +46 -44
- package/dist/pi-outpost-embed.js +5022 -4147
- package/package.json +1 -1
- package/dist/CodeEditor-CHKp59kP.cjs +0 -9
- package/dist/dist-B9TXDASo.cjs +0 -1
- package/dist/dist-BMzIUMhf.cjs +0 -1
- package/dist/dist-BawiB8yE.cjs +0 -23
- package/dist/dist-BjxwUutQ.cjs +0 -6
- package/dist/dist-BlUoR-U1.cjs +0 -13
- package/dist/dist-Bnsp4Y3i.cjs +0 -9
- package/dist/dist-CM2l_BHt.cjs +0 -1
- package/dist/dist-CkDnvyBs.cjs +0 -1
- package/dist/dist-CpsCEkIr.cjs +0 -1
- package/dist/dist-DJYmQsI-.cjs +0 -1
- package/dist/dist-F6qtkv2Q.cjs +0 -11
- package/dist/dist-Lxxq5IH0.cjs +0 -1
- package/dist/dist-c-DRw6Dh.cjs +0 -1
- package/dist/dist-sM-IE5EO.cjs +0 -1
- package/dist/dist-vBlUeRrZ.cjs +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const e=require("./rolldown-runtime-DbbDpzbe.cjs"),t=require("./lib-CRTt_FoR.cjs"),n=require("./workspacePath-BdmjN0W2.cjs"),r=require("./download-CVl_k6EM.cjs"),i=require("./katex-C-T_oEhv.cjs");let a=require("react"),o=require("react/jsx-runtime"),s=require("react-dom");var c=(0,a.createContext)(`dark`),l=()=>(0,a.useContext)(c);function u({text:e,className:t,iconOnly:n=!1}){let[r,i]=(0,a.useState)(!1);async function s(){try{await navigator.clipboard.writeText(e),i(!0),setTimeout(()=>i(!1),1500)}catch{}}return(0,o.jsx)(`button`,{type:`button`,onClick:s,title:r?`Copied!`:n?`Copy code`:`Copy`,"aria-label":n?r?`Copied`:`Copy code`:void 0,className:t??`rounded px-1.5 py-0.5 text-xs text-zinc-400 hover:bg-zinc-100 hover:text-zinc-700 dark:text-zinc-600 dark:hover:bg-zinc-800 dark:hover:text-zinc-300`,children:n?r?`✓`:`⧉`:r?`✓ copied`:`⧉ copy`})}function d(e){if(e==null)return;if(!(e.getRootNode()instanceof ShadowRoot))return globalThis.document.body;let t=e;for(;t.parentElement!==null;)t=t.parentElement;return t}function f({label:e,open:t,onClose:n,children:r,actions:i,containerRef:c,anchorRef:l,testId:u=`structured-enlarged`}){(0,a.useEffect)(()=>{if(!t)return;let e=e=>{e.key===`Escape`&&n()};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[t,n]);let f=(0,a.useRef)(void 0);return f.current=d(l?.current)??f.current,t?(0,s.createPortal)((0,o.jsx)(`div`,{role:`dialog`,"aria-modal":`true`,"aria-label":`${e}, full size`,"data-testid":u,onClick:n,className:`fixed inset-0 z-[100] flex items-center justify-center overflow-hidden bg-black/60 p-6`,children:(0,o.jsxs)(`div`,{onClick:e=>e.stopPropagation(),className:`flex max-h-full min-w-0 w-auto max-w-[95vw] flex-col overflow-hidden rounded-lg bg-white p-4 shadow-xl dark:bg-zinc-900`,children:[(0,o.jsxs)(`div`,{className:`mb-2 flex shrink-0 items-center justify-between gap-4`,children:[(0,o.jsx)(`span`,{className:`text-xs text-zinc-500`,children:e}),(0,o.jsx)(`div`,{className:`flex items-center gap-3`,children:(0,o.jsx)(`button`,{type:`button`,onClick:n,"aria-label":`Close`,className:`rounded px-2 py-0.5 text-xs text-zinc-500 hover:bg-zinc-100 dark:hover:bg-zinc-800`,children:`✕`})})]}),(0,o.jsx)(`div`,{ref:c,role:`region`,"aria-label":`${e} content`,tabIndex:0,className:`min-h-0 min-w-0 overflow-auto [&_svg]:!max-w-none`,children:r}),i&&(0,o.jsx)(`div`,{className:`mt-2 flex shrink-0 flex-wrap items-center justify-start gap-3`,children:i})]})}),f.current??globalThis.document.body):null}var p=.8;function m(e){return e===`landscape`?`portrait`:`landscape`}function h(e,t){return!Number.isFinite(e)||!Number.isFinite(t)||e<=710?`landscape`:t<=e*p?`portrait`:`landscape`}var g=[`LR`,`RL`];function _(e){return g.includes(e)?`landscape`:`portrait`}function v(e){switch(e){case`LR`:return`TB`;case`TB`:return`LR`;case`RL`:return`BT`;case`BT`:return`RL`}}function y(e){let t=e.toUpperCase();return t===`TD`?`TB`:t===`TB`||t===`BT`||t===`LR`||t===`RL`?t:void 0}function b(e){let t=0;if(e[0]?.trim()===`---`){let n=e.findIndex((e,t)=>t>0&&e.trim()===`---`);if(n===-1)return-1;t=n+1}for(;t<e.length;t+=1){let n=e[t].trim();if(!(n===``||n.startsWith(`%%`)))return t}return-1}function x(e){let t=e.split(`
|
|
1
|
+
const e=require("./rolldown-runtime-DbbDpzbe.cjs"),t=require("./lib-CRTt_FoR.cjs"),n=require("./workspacePath-BdmjN0W2.cjs"),r=require("./download-CVl_k6EM.cjs"),i=require("./katex-C-T_oEhv.cjs");let a=require("react"),o=require("react/jsx-runtime"),s=require("react-dom");var c=(0,a.createContext)(`dark`),l=()=>(0,a.useContext)(c);function u({text:e,className:t,iconOnly:n=!1}){let[r,i]=(0,a.useState)(!1);async function s(){try{await navigator.clipboard.writeText(e),i(!0),setTimeout(()=>i(!1),1500)}catch{}}return(0,o.jsx)(`button`,{type:`button`,onClick:s,title:r?`Copied!`:n?`Copy code`:`Copy`,"aria-label":n?r?`Copied`:`Copy code`:void 0,className:t??`inline-flex min-h-6 items-center justify-center rounded px-1.5 py-0.5 text-xs text-zinc-400 hover:bg-zinc-100 hover:text-zinc-700 dark:text-zinc-600 dark:hover:bg-zinc-800 dark:hover:text-zinc-300`,children:n?r?`✓`:`⧉`:r?`✓ copied`:`⧉ copy`})}function d(e){if(e==null)return;if(!(e.getRootNode()instanceof ShadowRoot))return globalThis.document.body;let t=e;for(;t.parentElement!==null;)t=t.parentElement;return t}function f({label:e,open:t,onClose:n,children:r,actions:i,containerRef:c,anchorRef:l,testId:u=`structured-enlarged`}){(0,a.useEffect)(()=>{if(!t)return;let e=e=>{e.key===`Escape`&&n()};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[t,n]);let f=(0,a.useRef)(void 0);return f.current=d(l?.current)??f.current,t?(0,s.createPortal)((0,o.jsx)(`div`,{role:`dialog`,"aria-modal":`true`,"aria-label":`${e}, full size`,"data-testid":u,onClick:n,className:`fixed inset-0 z-[100] flex items-center justify-center overflow-hidden bg-black/60 p-6`,children:(0,o.jsxs)(`div`,{onClick:e=>e.stopPropagation(),className:`flex max-h-full min-w-0 w-auto max-w-[95vw] flex-col overflow-hidden rounded-lg bg-white p-4 shadow-xl dark:bg-zinc-900`,children:[(0,o.jsxs)(`div`,{className:`mb-2 flex shrink-0 items-center justify-between gap-4`,children:[(0,o.jsx)(`span`,{className:`text-xs text-zinc-500`,children:e}),(0,o.jsx)(`div`,{className:`flex items-center gap-3`,children:(0,o.jsx)(`button`,{type:`button`,onClick:n,"aria-label":`Close`,className:`rounded px-2 py-0.5 text-xs text-zinc-500 hover:bg-zinc-100 dark:hover:bg-zinc-800`,children:`✕`})})]}),(0,o.jsx)(`div`,{ref:c,role:`region`,"aria-label":`${e} content`,tabIndex:0,className:`min-h-0 min-w-0 overflow-auto [&_svg]:!max-w-none`,children:r}),i&&(0,o.jsx)(`div`,{className:`mt-2 flex shrink-0 flex-wrap items-center justify-start gap-3`,children:i})]})}),f.current??globalThis.document.body):null}var p=.8;function m(e){return e===`landscape`?`portrait`:`landscape`}function h(e,t){return!Number.isFinite(e)||!Number.isFinite(t)||e<=710?`landscape`:t<=e*p?`portrait`:`landscape`}var g=[`LR`,`RL`];function _(e){return g.includes(e)?`landscape`:`portrait`}function v(e){switch(e){case`LR`:return`TB`;case`TB`:return`LR`;case`RL`:return`BT`;case`BT`:return`RL`}}function y(e){let t=e.toUpperCase();return t===`TD`?`TB`:t===`TB`||t===`BT`||t===`LR`||t===`RL`?t:void 0}function b(e){let t=0;if(e[0]?.trim()===`---`){let n=e.findIndex((e,t)=>t>0&&e.trim()===`---`);if(n===-1)return-1;t=n+1}for(;t<e.length;t+=1){let n=e[t].trim();if(!(n===``||n.startsWith(`%%`)))return t}return-1}function x(e){let t=e.split(`
|
|
2
2
|
`),n=b(t);if(n===-1)return;let r=t[n],i=/^(\s*)(flowchart|graph)([ \t]+(TD|TB|BT|LR|RL)\b)?(.*)$/i.exec(r);if(i!==null){let[,e,r,,a,o]=i,s=a===void 0?`TB`:y(a),c=v(s),l=[...t];return l[n]=`${e}${r} ${c}${o}`,{direction:s,turned:l.join(`
|
|
3
3
|
`)}}let a=/^(\s*)stateDiagram(-v2)?\s*$/i.exec(r);if(a!==null)return S(t,n,a[1])}function S(e,t,n){let r=0;for(let n=t+1;n<e.length;n+=1){let t=e[n],i=r===0?/^\s*direction\s+(TD|TB|BT|LR|RL)\s*$/i.exec(t):null;if(i!==null){let r=y(i[1]),a=[...e];return a[n]=t.replace(/(direction\s+)(TD|TB|BT|LR|RL)/i,`$1${v(r)}`),{direction:r,turned:a.join(`
|
|
4
4
|
`)}}r+=(t.match(/\{/g)?.length??0)-(t.match(/\}/g)?.length??0),r<0&&(r=0)}let i=[...e];return i.splice(t+1,0,`${n} direction LR`),{direction:`TB`,turned:i.join(`
|
|
@@ -311,12 +311,34 @@ div.mxRubberband { position: absolute; overflow: hidden; border: 1px solid #29b6
|
|
|
311
311
|
// After a bend goes, Delete waits for the next click: a second press, or a held key, would
|
|
312
312
|
// otherwise delete the wire still selected under it
|
|
313
313
|
var bendJustRemoved = false;
|
|
314
|
+
// The handle's picture with its fill turned orange; the picture as it is when it is not
|
|
315
|
+
// an SVG this can read.
|
|
316
|
+
var orangeHandle = function (src) {
|
|
317
|
+
var marker = ";base64,";
|
|
318
|
+
var at = src.indexOf(marker);
|
|
319
|
+
if (src.indexOf("data:image/svg+xml") !== 0 || at < 0) return src;
|
|
320
|
+
try {
|
|
321
|
+
var svg = atob(src.slice(at + marker.length));
|
|
322
|
+
var painted = svg.split('fill="#29b6f2"').join('fill="#f97316"');
|
|
323
|
+
return painted === svg ? src : src.slice(0, at + marker.length) + btoa(painted);
|
|
324
|
+
} catch (error) {
|
|
325
|
+
return src;
|
|
326
|
+
}
|
|
327
|
+
};
|
|
314
328
|
var showChosen = function (on) {
|
|
315
329
|
if (chosen === null) return;
|
|
316
330
|
var handler = graph.selectionCellsHandler.getHandler(chosen.cell);
|
|
317
331
|
var shape = handler && handler.bends ? handler.bends[chosen.index] : null;
|
|
318
332
|
if (!shape) return;
|
|
319
|
-
|
|
333
|
+
// draw.io draws a handle as a picture — a small SVG with its colour inside — so a
|
|
334
|
+
// fill colour set on the shape shows nothing: the picture itself is swapped for the
|
|
335
|
+
// same one in orange, and back.
|
|
336
|
+
if (typeof shape.image === "string") {
|
|
337
|
+
if (shape.plainImage === undefined) shape.plainImage = shape.image;
|
|
338
|
+
shape.image = on ? orangeHandle(shape.plainImage) : shape.plainImage;
|
|
339
|
+
} else {
|
|
340
|
+
shape.fill = on ? "#f97316" : mxConstants.HANDLE_FILLCOLOR;
|
|
341
|
+
}
|
|
320
342
|
shape.redraw();
|
|
321
343
|
};
|
|
322
344
|
var forget = function () { showChosen(false); chosen = null; };
|
|
@@ -532,6 +554,6 @@ div.mxRubberband { position: absolute; overflow: hidden; border: 1px solid #29b6
|
|
|
532
554
|
`:`
|
|
533
555
|
`,i=KO(e);if(i.length===0){let i=e.search(/<mxGraphModel[\s>]/),a=e.lastIndexOf(`</mxGraphModel>`);if(i===-1||a===-1||t!==0)throw new GO(`the file has no page to put this one in`);let o=a+15;return e.slice(0,i)+JO(n,qO(e,i)).trimStart().split(`
|
|
534
556
|
`).join(r)+e.slice(o)}let a=i[t];if(a===void 0)throw new GO(`the file has no page ${t+1}`);let o=qO(e,a.start),s=JO(n,o+` `).split(`
|
|
535
|
-
`).join(r),c=e.slice(a.start,a.innerStart).replace(/\s*\/>$/,`>`);return e.slice(0,a.start)+c+r+s+r+o+`</diagram>`+e.slice(a.end)}function XO(e){let t=new DOMParser().parseFromString(e,`application/xml`).documentElement;if(t.nodeName===`parsererror`||t.getElementsByTagName(`parsererror`).length>0)throw Error(`it is not a draw.io diagram (not XML)`);if(t.nodeName!==`mxfile`&&t.nodeName!==`mxGraphModel`)throw Error(`it is not a draw.io diagram (its root is <${t.nodeName}>)`);return t}function ZO(e){return[...e.children].filter(e=>e.nodeName===`diagram`)}function QO(e){let t=XO(e);if(t.nodeName===`mxGraphModel`)return[`Page 1`];let n=ZO(t);if(n.length===0)throw Error(`it holds no page`);return n.map((e,t)=>e.getAttribute(`name`)?.trim()||`Page ${t+1}`)}function $O(e,t){if(t===void 0||t.trim()===``)return 0;let n=QO(e),r=t.trim(),i=n.indexOf(r),a=i>=0?i:/^\d+$/.test(r)?Number(r)-1:-1;if(a<0||a>=n.length)throw Error(`it has no page "${r}"; its pages are ${n.map(e=>`"${e}"`).join(`, `)}`);return a}function ek(e,t){let n=XO(e),r=$O(e,t);if(n.nodeName===`mxGraphModel`)return e;let i=n.cloneNode(!1);return i.appendChild(ZO(n)[r].cloneNode(!0)),new XMLSerializer().serializeToString(i)}function tk(e,t){let n=e.split(`/`).slice(0,-1),r=t.split(`/`),i=0;for(;i<n.length&&i<r.length-1&&n[i]===r[i];)i+=1;return[...n.slice(i).map(()=>`..`),...r.slice(i)].join(`/`)}var nk={dirty:!1,canUndo:!1,canRedo:!1},rk=`Discard the unsaved touch-ups to this diagram?`;function ik(e){return e.slice(e.lastIndexOf(`/`)+1).replace(/\.(drawio|dio)$/i,``)||`diagram`}function ak(e,t,n){let r=URL.createObjectURL(new Blob([t],{type:n}));try{let t=document.createElement(`a`);t.href=r,t.download=e,t.click()}finally{URL.revokeObjectURL(r)}}function ok(e,t){let n=t?.trim().replace(/[^\p{L}\p{N}._-]+/gu,`-`).replace(/^-+|-+$/g,``);return`${ik(e)}${n?`-${n}`:``}.svg`}function sk(e,t,n){let{fileIo:r}=Np(),[i,o]=(0,a.useState)({status:`loading`}),s=(0,a.useRef)(0),c=(0,a.useCallback)(()=>{if(!t)return;if(r===void 0){o({status:`failed`,message:`files cannot be read here`});return}let n=++s.current;r.read(e).then(({content:e})=>{n===s.current&&o({status:`loaded`,content:e})},e=>{n===s.current&&o({status:`failed`,message:e instanceof Error?e.message:String(e)})})},[t,r,e]);return(0,a.useEffect)(()=>{n&&c()},[c,n]),(0,a.useEffect)(()=>{if(t&&n&&r!==void 0)return r.onChanged(e,c)},[t,n,r,e,c]),i}function ck(e,t){let[n,r]=(0,a.useState)(!t||typeof IntersectionObserver>`u`);return(0,a.useEffect)(()=>{if(n||e.current===null)return;let t=new IntersectionObserver(e=>{e.some(e=>e.isIntersecting)&&r(!0)},{rootMargin:`600px 0px`});return t.observe(e.current),()=>t.disconnect()},[n,e]),n}function lk({path:e,xml:t,variant:n,fallback:r,onTouchUpDirtyChange:i,page:s,startTouchUp:c=!1,onEscape:l}){let{serverUrl:u,fileIo:d,onOpenFile:p}=Np(),m=(0,a.useRef)(null),h=ck(m,n===`reply`),g=sk(e,t===void 0,h),_=t??(g.status===`loaded`?g.content:null),v=(0,a.useRef)(null),y=(0,a.useRef)(null),[b,x]=(0,a.useState)(!1),[S,T]=(0,a.useState)(null),[E,ee]=(0,a.useState)(null),[D,te]=(0,a.useState)(null),ne=(0,a.useRef)(null),[re,ie]=(0,a.useState)(nk),[ae,oe]=(0,a.useState)(!1),se=(0,a.useRef)(!1),[ce,le]=(0,a.useState)(null),[ue,de]=(0,a.useState)(null),O=e=>e===`inline`?v:y,fe=e=>D===e&&ne.current!==null?ne.current.content:_,pe=d!==void 0,me=D!==null&&re.dirty,he=(0,a.useMemo)(()=>{if(s===void 0||_===null)return{index:0,problem:null};try{return{index:$O(_,s),problem:null}}catch(e){return{index:0,problem:e instanceof Error?e.message:String(e)}}},[s,_]),ge=(0,a.useRef)(!1);(0,a.useEffect)(()=>{c&&!ge.current&&_!==null&&he.problem===null&&(ge.current=!0,ve(`inline`))});let _e=(0,a.useRef)(null);(0,a.useEffect)(()=>{D===null||re.dirty||ne.current===null||_===null||_===ne.current.content||(_e.current=D,ne.current=null,ie(nk),te(null))},[_,D,re.dirty]),(0,a.useEffect)(()=>{if(D!==null||_e.current===null)return;let e=_e.current;_e.current=null,ve(e)}),(0,a.useEffect)(()=>{i?.(me)},[me,i]),(0,a.useEffect)(()=>()=>i?.(!1),[i]);async function ve(t){if(d!==void 0&&D===null){le(null),de(null);try{ne.current=await d.read(e),ie(nk),te(t)}catch(e){le({message:e instanceof Error?e.message:String(e),conflict:!1})}}}function ye(){return me&&!window.confirm(rk)?!1:(te(null),ie(nk),le(null),de(null),ne.current=null,!0)}async function be(){let t=D,n=ne.current;if(!(t===null||n===null||d===void 0||se.current)){se.current=!0,oe(!0),le(null);try{let r=await O(t).current.save(),i=YO(n.content,r.page,r.xml),{mtimeMs:a}=await d.write(e,i,n.mtimeMs);ne.current={content:i,mtimeMs:a},O(t).current?.markClean()}catch(e){let t=e instanceof WO&&e.reason===`conflict`;le({message:t?`The file changed on disk, or was removed, since this touch-up began, so it was not saved. Leave without saving to see what is there now.`:`Could not save: ${e instanceof Error?e.message:String(e)}`,conflict:t})}finally{se.current=!1,oe(!1)}}}async function xe(t){ee(null);try{let n=await O(t).current.exportSvg();ak(ok(e,n.name),n.svg,`image/svg+xml;charset=utf-8`)}catch(e){ee(e instanceof Error?e.message:String(e))}}function k(){(D!==`enlarged`||ye())&&x(!1)}let A=(0,a.useCallback)(()=>de(`Save or undo the touch-ups on this page before turning to another.`),[]),Se=(0,a.useRef)(ye);Se.current=ye;let Ce=(0,a.useRef)(k);Ce.current=k;let we=(0,a.useRef)(D);we.current=D;let Te=(0,a.useRef)(b);Te.current=b;let Ee=(0,a.useRef)(l);Ee.current=l;let De=(0,a.useCallback)(()=>{Ee.current?Ee.current():we.current===null?Te.current&&Ce.current():Se.current()},[]);(0,a.useEffect)(()=>{if(D===null)return;function e(e){e.key===`Escape`&&(e.preventDefault(),e.stopImmediatePropagation(),Ee.current?Ee.current():Se.current())}return window.addEventListener(`keydown`,e,!0),()=>window.removeEventListener(`keydown`,e,!0)},[D]);function Oe(t){return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(`button`,{type:`button`,className:C,disabled:_===null||S!==null,onClick:()=>void xe(t),title:`Save the page shown as .svg — insert it as a picture in a document`,children:`⤓ download SVG`}),(0,o.jsx)(`button`,{type:`button`,className:C,disabled:_===null,onClick:()=>_!==null&&ak(e.slice(e.lastIndexOf(`/`)+1),_,`application/xml;charset=utf-8`),title:`Save the .drawio file, to open or share it`,children:`⤓ download .drawio`})]})}function ke(e){return D===e?(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(`button`,{type:`button`,className:C,disabled:!re.dirty||ae,onClick:()=>void be(),children:ae?`saving…`:`✓ save`}),(0,o.jsx)(`button`,{type:`button`,className:C,disabled:!re.canUndo,onClick:()=>O(e).current?.undo(),title:`Undo (⌘Z / Ctrl+Z)`,children:`↶ undo`}),(0,o.jsx)(`button`,{type:`button`,className:C,disabled:!re.canRedo,onClick:()=>O(e).current?.redo(),title:`Redo (⇧⌘Z / Ctrl+Y)`,children:`↷ redo`}),(0,o.jsxs)(`label`,{className:`inline-flex items-center gap-1 text-xs text-zinc-500 dark:text-zinc-400`,title:`How the selected wires are drawn — or every wire of the page when none is selected — and new wires too`,children:[`wires`,(0,o.jsxs)(`select`,{className:C,"aria-label":`Wire style`,value:re.wireStyle??`orthogonal`,onChange:t=>{let n=t.target.value;n!==`mixed`&&O(e).current?.setWireStyle(n)},children:[(0,o.jsx)(`option`,{value:`straight`,children:`straight`}),(0,o.jsx)(`option`,{value:`orthogonal`,children:`orthogonal`}),(0,o.jsx)(`option`,{value:`curved`,children:`curved`}),re.wireStyle===`mixed`&&(0,o.jsx)(`option`,{value:`mixed`,disabled:!0,children:`mixed`})]})]}),(0,o.jsx)(`button`,{type:`button`,className:C,disabled:!re.bends,onClick:()=>O(e).current?.removeBends(),title:`Remove the bends of the selected wires — or of every wire of the page when none is selected — and let draw.io route them. Double-click a bend to remove just that one.`,children:`remove bends`}),(0,o.jsx)(`button`,{type:`button`,className:C,onClick:()=>ye(),title:`Leave touch-up (Escape); unsaved touch-ups are asked about first`,children:`done`}),(0,o.jsx)(`span`,{className:`text-xs text-zinc-400`,"data-testid":`drawio-touchup-status`,children:re.dirty?`● unsaved`:`touching up — drag boxes and wire ends, double-click a label`})]}):pe&&D===null&&S===null?(0,o.jsx)(`button`,{type:`button`,className:C,disabled:_===null,onClick:()=>void ve(e),title:`Move boxes, re-attach wires and fix labels here; anything more in draw.io`,children:`✎ touch up`}):null}function Ae(e){return(0,o.jsxs)(o.Fragment,{children:[D===e&&ce&&(0,o.jsx)(`span`,{role:`alert`,"data-testid":`drawio-touchup-problem`,className:`text-red-600 dark:text-red-400`,children:ce.message}),D===e&&ue&&(0,o.jsx)(`span`,{role:`status`,className:`text-amber-700 dark:text-amber-300`,children:ue}),D===null&&ce&&(0,o.jsxs)(`span`,{role:`alert`,className:`text-red-600 dark:text-red-400`,children:[`Could not start touch-up: `,ce.message]}),E&&(0,o.jsxs)(`span`,{role:`alert`,className:`text-red-600 dark:text-red-400`,children:[`Could not download SVG: `,E]})]})}if(n===`reply`&&g.status===`failed`)return(0,o.jsxs)(`div`,{ref:m,role:`alert`,"data-testid":`drawio-block-missing`,className:`my-2 rounded-lg border border-amber-300 bg-amber-50 px-3 py-2 text-xs text-amber-900 dark:border-amber-700 dark:bg-amber-950/40 dark:text-amber-200`,children:[`The diagram `,(0,o.jsx)(`code`,{children:e}),` could not be shown: `,g.message]});let je=r??(0,o.jsxs)(`p`,{className:`px-3 py-2 text-xs text-zinc-500`,children:[`The diagram `,(0,o.jsx)(`code`,{children:e}),` could not be drawn.`]}),Me=(0,o.jsxs)(`div`,{className:`${w} ${n===`reply`?`order-3`:`shrink-0 px-3 py-1.5`}`,children:[D!==`inline`&&(0,o.jsx)(`button`,{type:`button`,className:`text-xs text-zinc-500 underline hover:text-zinc-800 dark:hover:text-zinc-200 disabled:opacity-50`,disabled:_===null||D!==null,onClick:()=>x(!0),"aria-label":`Show diagram at full size`,children:`⤢ enlarge`}),D!==`inline`&&Oe(`inline`),n===`reply`&&p&&(0,o.jsx)(`button`,{type:`button`,className:`text-xs text-zinc-500 underline hover:text-zinc-800 dark:hover:text-zinc-200 disabled:opacity-50`,onClick:()=>p(e),title:`Open the file in the file viewer`,children:`↗ open`}),n===`viewer`&&ke(`inline`),Ae(`inline`)]});return(0,o.jsxs)(`div`,{ref:m,"data-testid":n===`reply`?`drawio-block-reply`:`drawio-block-viewer`,className:n===`reply`?`my-2 flex flex-col gap-2 rounded-lg border border-zinc-200 bg-zinc-50 p-3 dark:border-zinc-800 dark:bg-zinc-900`:`flex h-full flex-col`,children:[n===`viewer`&&Me,he.problem!==null&&(0,o.jsxs)(`p`,{role:`alert`,"data-testid":`drawio-block-page-problem`,className:`px-3 py-1.5 text-xs text-amber-800 dark:text-amber-200`,children:[`The diagram `,(0,o.jsx)(`code`,{children:e}),` `,he.problem,`; its first page is shown.`]}),_===null||!h?(0,o.jsx)(`div`,{className:`h-80 animate-pulse rounded bg-zinc-100 dark:bg-zinc-800/60`,"data-testid":`drawio-block-loading`,"aria-label":`Loading ${e}`}):(0,o.jsx)(Wp,{ref:v,xml:fe(`inline`),serverUrl:u,title:e,fallback:je,editing:D===`inline`,onTouchUpChange:ie,onPageLocked:A,onEscape:De,onRendered:T,className:n===`reply`?`flex h-80 flex-col`:`flex min-h-[24rem] flex-1 flex-col`,page:s===void 0?void 0:he.index}),n===`reply`&&Me,(0,o.jsx)(f,{label:e,testId:`drawio-enlarged`,open:b,onClose:k,anchorRef:m,actions:(0,o.jsxs)(o.Fragment,{children:[Oe(`enlarged`),ke(`enlarged`),Ae(`enlarged`)]}),children:_!==null&&(0,o.jsx)(`div`,{style:{width:`90vw`,height:`75vh`},children:(0,o.jsx)(Wp,{ref:y,xml:fe(`enlarged`),serverUrl:u,title:`${e}, full size`,fallback:je,editing:D===`enlarged`,onTouchUpChange:ie,onPageLocked:A,onEscape:De,className:`flex h-full flex-col`})})})]})}function uk(e){return e===`className`||Array.isArray(e)&&e[0]===`className`}function dk(e){let t={};for(let[n,r]of Object.entries(e))t[n]=r.filter(e=>!uk(e));return t[`*`]=[...t[`*`]??[],`className`],t}var fk={...EO,tagNames:[...new Set([...EO.tagNames??[],`details`,`summary`])],attributes:dk(EO.attributes??{})},pk=[wO,[UO,fk],LC],mk=[t.n,t.t];function hk(e){let t=n.c(``,e);try{return decodeURIComponent(t)}catch{return t}}function gk(e){return typeof e==`string`&&e!==``&&!n.r(e)&&n.n(e.split(/[?#]/)[0])}function _k({text:e}){let[t,n]=(0,a.useState)(!1);return(0,o.jsxs)(`div`,{className:`my-1 rounded-lg border border-zinc-200 bg-zinc-50 text-sm dark:border-zinc-800/80 dark:bg-zinc-900/40`,children:[(0,o.jsxs)(`button`,{type:`button`,onClick:()=>n(!t),className:`flex w-full items-center gap-2 px-3 py-1.5 text-left text-xs text-zinc-500`,children:[(0,o.jsx)(`span`,{className:`italic`,children:`thinking`}),(0,o.jsx)(`span`,{className:`ml-auto`,children:t?`▾`:`▸`})]}),t&&(0,o.jsx)(`div`,{className:`whitespace-pre-wrap border-t border-zinc-200 px-3 py-2 text-xs italic text-zinc-500 dark:border-zinc-800/80`,children:e})]})}function vk({item:e,serverUrl:r=``,token:i=null,workspace:s,onOpenFile:c,hideReasoning:l=!1}){let d=l?e.blocks.filter(e=>e.type!==`thinking`):e.blocks,f=e.blocks.filter(e=>e.type===`text`).map(e=>e.text).join(`
|
|
557
|
+
`).join(r),c=e.slice(a.start,a.innerStart).replace(/\s*\/>$/,`>`);return e.slice(0,a.start)+c+r+s+r+o+`</diagram>`+e.slice(a.end)}function XO(e){let t=new DOMParser().parseFromString(e,`application/xml`).documentElement;if(t.nodeName===`parsererror`||t.getElementsByTagName(`parsererror`).length>0)throw Error(`it is not a draw.io diagram (not XML)`);if(t.nodeName!==`mxfile`&&t.nodeName!==`mxGraphModel`)throw Error(`it is not a draw.io diagram (its root is <${t.nodeName}>)`);return t}function ZO(e){return[...e.children].filter(e=>e.nodeName===`diagram`)}function QO(e){let t=XO(e);if(t.nodeName===`mxGraphModel`)return[`Page 1`];let n=ZO(t);if(n.length===0)throw Error(`it holds no page`);return n.map((e,t)=>e.getAttribute(`name`)?.trim()||`Page ${t+1}`)}function $O(e,t){if(t===void 0||t.trim()===``)return 0;let n=QO(e),r=t.trim(),i=n.indexOf(r),a=i>=0?i:/^\d+$/.test(r)?Number(r)-1:-1;if(a<0||a>=n.length)throw Error(`it has no page "${r}"; its pages are ${n.map(e=>`"${e}"`).join(`, `)}`);return a}function ek(e,t){let n=XO(e),r=$O(e,t);if(n.nodeName===`mxGraphModel`)return e;let i=n.cloneNode(!1);return i.appendChild(ZO(n)[r].cloneNode(!0)),new XMLSerializer().serializeToString(i)}function tk(e,t){let n=e.split(`/`).slice(0,-1),r=t.split(`/`),i=0;for(;i<n.length&&i<r.length-1&&n[i]===r[i];)i+=1;return[...n.slice(i).map(()=>`..`),...r.slice(i)].join(`/`)}var nk={dirty:!1,canUndo:!1,canRedo:!1},rk=`Discard the unsaved touch-ups to this diagram?`;function ik(e){return e.slice(e.lastIndexOf(`/`)+1).replace(/\.(drawio|dio)$/i,``)||`diagram`}function ak(e,t,n){let r=URL.createObjectURL(new Blob([t],{type:n}));try{let t=document.createElement(`a`);t.href=r,t.download=e,t.click()}finally{URL.revokeObjectURL(r)}}function ok(e,t){let n=t?.trim().replace(/[^\p{L}\p{N}._-]+/gu,`-`).replace(/^-+|-+$/g,``);return`${ik(e)}${n?`-${n}`:``}.svg`}function sk(e,t,n){let{fileIo:r}=Np(),[i,o]=(0,a.useState)({status:`loading`}),s=(0,a.useRef)(0),c=(0,a.useCallback)(()=>{if(!t)return;if(r===void 0){o({status:`failed`,message:`files cannot be read here`});return}let n=++s.current;r.read(e).then(({content:e})=>{n===s.current&&o({status:`loaded`,content:e})},e=>{n===s.current&&o({status:`failed`,message:e instanceof Error?e.message:String(e)})})},[t,r,e]);return(0,a.useEffect)(()=>{n&&c()},[c,n]),(0,a.useEffect)(()=>{if(t&&n&&r!==void 0)return r.onChanged(e,c)},[t,n,r,e,c]),i}function ck(e,t){let[n,r]=(0,a.useState)(!t||typeof IntersectionObserver>`u`);return(0,a.useEffect)(()=>{if(n||e.current===null)return;let t=new IntersectionObserver(e=>{e.some(e=>e.isIntersecting)&&r(!0)},{rootMargin:`600px 0px`});return t.observe(e.current),()=>t.disconnect()},[n,e]),n}function lk({path:e,xml:t,variant:n,fallback:r,onTouchUpDirtyChange:i,page:s,startTouchUp:c=!1,onEscape:l}){let{serverUrl:u,fileIo:d,onOpenFile:p}=Np(),m=(0,a.useRef)(null),h=ck(m,n===`reply`),g=sk(e,t===void 0,h),_=t??(g.status===`loaded`?g.content:null),v=(0,a.useRef)(null),y=(0,a.useRef)(null),[b,x]=(0,a.useState)(!1),[S,T]=(0,a.useState)(null),[E,ee]=(0,a.useState)(null),[D,te]=(0,a.useState)(null),ne=(0,a.useRef)(null),[re,ie]=(0,a.useState)(nk),[ae,oe]=(0,a.useState)(!1),se=(0,a.useRef)(!1),[ce,le]=(0,a.useState)(null),[ue,de]=(0,a.useState)(null),O=e=>e===`inline`?v:y,fe=e=>D===e&&ne.current!==null?ne.current.content:_,pe=d!==void 0,me=D!==null&&re.dirty,he=(0,a.useMemo)(()=>{if(s===void 0||_===null)return{index:0,problem:null};try{return{index:$O(_,s),problem:null}}catch(e){return{index:0,problem:e instanceof Error?e.message:String(e)}}},[s,_]),ge=(0,a.useRef)(!1);(0,a.useEffect)(()=>{c&&!ge.current&&_!==null&&he.problem===null&&(ge.current=!0,ve(`inline`))});let _e=(0,a.useRef)(null);(0,a.useEffect)(()=>{D===null||re.dirty||ne.current===null||_===null||_===ne.current.content||(_e.current=D,ne.current=null,ie(nk),te(null))},[_,D,re.dirty]),(0,a.useEffect)(()=>{if(D!==null||_e.current===null)return;let e=_e.current;_e.current=null,ve(e)}),(0,a.useEffect)(()=>{i?.(me)},[me,i]),(0,a.useEffect)(()=>()=>i?.(!1),[i]);async function ve(t){if(d!==void 0&&D===null){le(null),de(null);try{ne.current=await d.read(e),ie(nk),te(t)}catch(e){le({message:e instanceof Error?e.message:String(e),conflict:!1})}}}function ye(){return me&&!window.confirm(rk)?!1:(te(null),ie(nk),le(null),de(null),ne.current=null,!0)}async function be(){let t=D,n=ne.current;if(!(t===null||n===null||d===void 0||se.current)){se.current=!0,oe(!0),le(null);try{let r=await O(t).current.save(),i=YO(n.content,r.page,r.xml),{mtimeMs:a}=await d.write(e,i,n.mtimeMs);ne.current={content:i,mtimeMs:a},O(t).current?.markClean()}catch(e){let t=e instanceof WO&&e.reason===`conflict`;le({message:t?`The file changed on disk, or was removed, since this touch-up began, so it was not saved. Leave without saving to see what is there now.`:`Could not save: ${e instanceof Error?e.message:String(e)}`,conflict:t})}finally{se.current=!1,oe(!1)}}}async function xe(t){ee(null);try{let n=await O(t).current.exportSvg();ak(ok(e,n.name),n.svg,`image/svg+xml;charset=utf-8`)}catch(e){ee(e instanceof Error?e.message:String(e))}}function k(){(D!==`enlarged`||ye())&&x(!1)}let A=(0,a.useCallback)(()=>de(`Save or undo the touch-ups on this page before turning to another.`),[]),Se=(0,a.useRef)(ye);Se.current=ye;let Ce=(0,a.useRef)(k);Ce.current=k;let we=(0,a.useRef)(D);we.current=D;let Te=(0,a.useRef)(b);Te.current=b;let Ee=(0,a.useRef)(l);Ee.current=l;let De=(0,a.useCallback)(()=>{Ee.current?Ee.current():we.current===null?Te.current&&Ce.current():Se.current()},[]);(0,a.useEffect)(()=>{if(D===null&&!b)return;function e(e){e.key===`Escape`&&(e.preventDefault(),e.stopImmediatePropagation(),De())}return window.addEventListener(`keydown`,e,!0),()=>window.removeEventListener(`keydown`,e,!0)},[D,b,De]);function Oe(t){return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(`button`,{type:`button`,className:C,disabled:_===null||S!==null,onClick:()=>void xe(t),title:`Save the page shown as .svg — insert it as a picture in a document`,children:`⤓ download SVG`}),(0,o.jsx)(`button`,{type:`button`,className:C,disabled:_===null,onClick:()=>_!==null&&ak(e.slice(e.lastIndexOf(`/`)+1),_,`application/xml;charset=utf-8`),title:`Save the .drawio file, to open or share it`,children:`⤓ download .drawio`})]})}function ke(e){return D===e?(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(`button`,{type:`button`,className:C,disabled:!re.dirty||ae,onClick:()=>void be(),children:ae?`saving…`:`✓ save`}),(0,o.jsx)(`button`,{type:`button`,className:C,disabled:!re.canUndo,onClick:()=>O(e).current?.undo(),title:`Undo (⌘Z / Ctrl+Z)`,children:`↶ undo`}),(0,o.jsx)(`button`,{type:`button`,className:C,disabled:!re.canRedo,onClick:()=>O(e).current?.redo(),title:`Redo (⇧⌘Z / Ctrl+Y)`,children:`↷ redo`}),(0,o.jsxs)(`label`,{className:`inline-flex items-center gap-1 text-xs text-zinc-500 dark:text-zinc-400`,title:`How the selected wires are drawn — or every wire of the page when none is selected — and new wires too`,children:[`wires`,(0,o.jsxs)(`select`,{className:C,"aria-label":`Wire style`,value:re.wireStyle??`orthogonal`,onChange:t=>{let n=t.target.value;n!==`mixed`&&O(e).current?.setWireStyle(n)},children:[(0,o.jsx)(`option`,{value:`straight`,children:`straight`}),(0,o.jsx)(`option`,{value:`orthogonal`,children:`orthogonal`}),(0,o.jsx)(`option`,{value:`curved`,children:`curved`}),re.wireStyle===`mixed`&&(0,o.jsx)(`option`,{value:`mixed`,disabled:!0,children:`mixed`})]})]}),(0,o.jsx)(`button`,{type:`button`,className:C,disabled:!re.bends,onClick:()=>O(e).current?.removeBends(),title:`Remove the bends of the selected wires — or of every wire of the page when none is selected — and let draw.io route them. Double-click a bend to remove just that one.`,children:`remove bends`}),(0,o.jsx)(`button`,{type:`button`,className:C,onClick:()=>ye(),title:`Leave touch-up (Escape); unsaved touch-ups are asked about first`,children:`done`}),(0,o.jsx)(`span`,{className:`text-xs text-zinc-400`,"data-testid":`drawio-touchup-status`,children:re.dirty?`● unsaved`:`touching up — drag boxes and wire ends, double-click a label`})]}):pe&&D===null&&S===null?(0,o.jsx)(`button`,{type:`button`,className:C,disabled:_===null,onClick:()=>void ve(e),title:`Move boxes, re-attach wires and fix labels here; anything more in draw.io`,children:`✎ touch up`}):null}function Ae(e){return(0,o.jsxs)(o.Fragment,{children:[D===e&&ce&&(0,o.jsx)(`span`,{role:`alert`,"data-testid":`drawio-touchup-problem`,className:`text-red-600 dark:text-red-400`,children:ce.message}),D===e&&ue&&(0,o.jsx)(`span`,{role:`status`,className:`text-amber-700 dark:text-amber-300`,children:ue}),D===null&&ce&&(0,o.jsxs)(`span`,{role:`alert`,className:`text-red-600 dark:text-red-400`,children:[`Could not start touch-up: `,ce.message]}),E&&(0,o.jsxs)(`span`,{role:`alert`,className:`text-red-600 dark:text-red-400`,children:[`Could not download SVG: `,E]})]})}if(n===`reply`&&g.status===`failed`)return(0,o.jsxs)(`div`,{ref:m,role:`alert`,"data-testid":`drawio-block-missing`,className:`my-2 rounded-lg border border-amber-300 bg-amber-50 px-3 py-2 text-xs text-amber-900 dark:border-amber-700 dark:bg-amber-950/40 dark:text-amber-200`,children:[`The diagram `,(0,o.jsx)(`code`,{children:e}),` could not be shown: `,g.message]});let je=r??(0,o.jsxs)(`p`,{className:`px-3 py-2 text-xs text-zinc-500`,children:[`The diagram `,(0,o.jsx)(`code`,{children:e}),` could not be drawn.`]}),Me=(0,o.jsxs)(`div`,{className:`${w} ${n===`reply`?`order-3`:`shrink-0 px-3 py-1.5`}`,children:[D!==`inline`&&(0,o.jsx)(`button`,{type:`button`,className:`text-xs text-zinc-500 underline hover:text-zinc-800 dark:hover:text-zinc-200 disabled:opacity-50`,disabled:_===null||D!==null,onClick:()=>x(!0),"aria-label":`Show diagram at full size`,children:`⤢ enlarge`}),D!==`inline`&&Oe(`inline`),n===`reply`&&p&&(0,o.jsx)(`button`,{type:`button`,className:`text-xs text-zinc-500 underline hover:text-zinc-800 dark:hover:text-zinc-200 disabled:opacity-50`,onClick:()=>p(e),title:`Open the file in the file viewer`,children:`↗ open`}),n===`viewer`&&ke(`inline`),Ae(`inline`)]});return(0,o.jsxs)(`div`,{ref:m,"data-testid":n===`reply`?`drawio-block-reply`:`drawio-block-viewer`,className:n===`reply`?`my-2 flex flex-col gap-2 rounded-lg border border-zinc-200 bg-zinc-50 p-3 dark:border-zinc-800 dark:bg-zinc-900`:`flex h-full flex-col`,children:[n===`viewer`&&Me,he.problem!==null&&(0,o.jsxs)(`p`,{role:`alert`,"data-testid":`drawio-block-page-problem`,className:`px-3 py-1.5 text-xs text-amber-800 dark:text-amber-200`,children:[`The diagram `,(0,o.jsx)(`code`,{children:e}),` `,he.problem,`; its first page is shown.`]}),_===null||!h?(0,o.jsx)(`div`,{className:`h-80 animate-pulse rounded bg-zinc-100 dark:bg-zinc-800/60`,"data-testid":`drawio-block-loading`,"aria-label":`Loading ${e}`}):(0,o.jsx)(Wp,{ref:v,xml:fe(`inline`),serverUrl:u,title:e,fallback:je,editing:D===`inline`,onTouchUpChange:ie,onPageLocked:A,onEscape:De,onRendered:T,className:n===`reply`?`flex h-80 flex-col`:`flex min-h-[24rem] flex-1 flex-col`,page:s===void 0?void 0:he.index}),n===`reply`&&Me,(0,o.jsx)(f,{label:e,testId:`drawio-enlarged`,open:b,onClose:k,anchorRef:m,actions:(0,o.jsxs)(o.Fragment,{children:[Oe(`enlarged`),ke(`enlarged`),Ae(`enlarged`)]}),children:_!==null&&(0,o.jsx)(`div`,{style:{width:`90vw`,height:`75vh`},children:(0,o.jsx)(Wp,{ref:y,xml:fe(`enlarged`),serverUrl:u,title:`${e}, full size`,fallback:je,editing:D===`enlarged`,onTouchUpChange:ie,onPageLocked:A,onEscape:De,className:`flex h-full flex-col`})})})]})}function uk(e){return typeof e==`string`&&e!==``&&!n.r(e)&&n.n(e.split(/[?#]/)[0])}function dk(e,t=``){let r=n.c(t,e);try{return decodeURIComponent(r)}catch{return r}}function fk(e){return e.tagName===`img`&&uk(e.properties.src)||e.children.some(e=>e.type===`element`&&fk(e))}function pk({node:e,children:t,...n}){return e&&fk(e)?(0,o.jsx)(`div`,{...n,children:t}):(0,o.jsx)(`p`,{...n,children:t})}function mk(e){return e===`className`||Array.isArray(e)&&e[0]===`className`}function hk(e){let t={};for(let[n,r]of Object.entries(e))t[n]=r.filter(e=>!mk(e));return t[`*`]=[...t[`*`]??[],`className`],t}var gk={...EO,tagNames:[...new Set([...EO.tagNames??[],`details`,`summary`])],attributes:hk(EO.attributes??{})},_k=[wO,[UO,gk],LC],vk=[t.n,t.t];function yk({text:e}){let[t,n]=(0,a.useState)(!1);return(0,o.jsxs)(`div`,{className:`my-1 rounded-lg border border-zinc-200 bg-zinc-50 text-sm dark:border-zinc-800/80 dark:bg-zinc-900/40`,children:[(0,o.jsxs)(`button`,{type:`button`,onClick:()=>n(!t),className:`flex w-full items-center gap-2 px-3 py-1.5 text-left text-xs text-zinc-500`,children:[(0,o.jsx)(`span`,{className:`italic`,children:`thinking`}),(0,o.jsx)(`span`,{className:`ml-auto`,children:t?`▾`:`▸`})]}),t&&(0,o.jsx)(`div`,{className:`whitespace-pre-wrap border-t border-zinc-200 px-3 py-2 text-xs italic text-zinc-500 dark:border-zinc-800/80`,children:e})]})}function bk({item:e,serverUrl:r=``,token:i=null,workspace:s,onOpenFile:c,hideReasoning:l=!1}){let d=l?e.blocks.filter(e=>e.type!==`thinking`):e.blocks,f=e.blocks.filter(e=>e.type===`text`).map(e=>e.text).join(`
|
|
536
558
|
|
|
537
|
-
`).trim(),p=(0,a.useRef)(c);p.current=c;let m=(0,a.useMemo)(()=>{function e({src:e,alt:t,...a}){if(
|
|
559
|
+
`).trim(),p=(0,a.useRef)(c);p.current=c;let m=(0,a.useMemo)(()=>{function e({src:e,alt:t,...a}){if(uk(e)){let t=dk(e);return(0,o.jsx)(lk,{path:t,variant:`reply`},t)}let c=typeof e==`string`&&e!==``&&!n.r(e)?n.o(r,n.c(``,e),i,void 0,s):e;return(0,o.jsx)(`img`,{...a,src:c,alt:t??``,loading:`lazy`,className:`max-h-96 max-w-full rounded-lg object-contain`})}function t({href:e,children:t,...r}){if(typeof e==`string`&&e!==``&&!n.r(e)&&p.current){let i=n.c(``,e);return(0,o.jsx)(`a`,{...r,href:e,onClick:e=>{e.preventDefault(),p.current?.(i)},children:t})}return(0,o.jsx)(`a`,{...r,href:e,target:`_blank`,rel:`noreferrer`,children:t})}return{pre:Dh,img:e,a:t,p:pk}},[r,i,s]);return d.length===0&&!e.errorMessage?null:(0,o.jsxs)(`div`,{className:`group max-w-none`,children:[f&&!e.streaming&&(0,o.jsx)(`div`,{className:`flex justify-end opacity-0 transition-opacity group-hover:opacity-100`,children:(0,o.jsx)(u,{text:f})}),d.map((e,n)=>e.type===`thinking`?(0,o.jsx)(yk,{text:e.text},e.contentIndex??n):(0,o.jsx)(`div`,{className:`prose-chat`,children:(0,o.jsx)(mv,{remarkPlugins:vk,rehypePlugins:_k,components:m,children:t.g(e.text)})},e.contentIndex??n)),e.errorMessage&&(0,o.jsx)(`div`,{className:`mt-2 rounded-lg border border-red-300 bg-red-50 px-3 py-2 text-sm text-red-700 dark:border-red-900/60 dark:bg-red-950/30 dark:text-red-300`,children:e.errorMessage})]})}var xk={30:`#3f3f46`,31:`#dc2626`,32:`#16a34a`,33:`#ca8a04`,34:`#2563eb`,35:`#9333ea`,36:`#0891b2`,37:`#71717a`,90:`#a1a1aa`,91:`#ef4444`,92:`#22c55e`,93:`#eab308`,94:`#3b82f6`,95:`#a855f7`,96:`#06b6d4`,97:`#d4d4d8`};function Sk(e){if(!Number.isInteger(e)||e<0||e>255)return;if(e<16)return xk[e<8?30+e:90+e-8];if(e>=232){let t=8+(e-232)*10;return`rgb(${t} ${t} ${t})`}let t=e-16,n=e=>e===0?0:55+e*40;return`rgb(${n(Math.floor(t/36))} ${n(Math.floor(t/6)%6)} ${n(t%6)})`}var Ck=/\u001B\[[0-9;:]*[A-Za-z]|\u001B[()][A-Za-z0-9]|\u001B[A-Za-z]/g;function wk(e,t){let n={...e};for(let e=0;e<t.length;e++){let r=t[e];if(r===0)for(let e of Object.keys(n))delete n[e];else if(r===1)n.bold=!0;else if(r===2)n.dim=!0;else if(r===3)n.italic=!0;else if(r===4)n.underline=!0;else if(r===22)delete n.bold,delete n.dim;else if(r===23)delete n.italic;else if(r===24)delete n.underline;else if(r===39)delete n.color;else if(xk[r]!==void 0)n.color=xk[r];else if(r===38){if(t[e+1]===2){let[r,i,a]=[t[e+2],t[e+3],t[e+4]];[r,i,a].every(e=>Number.isFinite(e))&&(n.color=`rgb(${r} ${i} ${a})`),e+=4}else if(t[e+1]===5){let r=Sk(t[e+2]);r!==void 0&&(n.color=r),e+=2}}}return n}function Tk(e){let t=[],n={},r=0;Ck.lastIndex=0;for(let i=Ck.exec(e);i!==null;i=Ck.exec(e)){i.index>r&&t.push({text:e.slice(r,i.index),...n}),r=i.index+i[0].length;let a=i[0];if(a.endsWith(`m`)){let e=a.slice(2,-1),t=e===``?[0]:e.split(/[;:]/).map(e=>e===``?0:Number(e));n=wk(n,t)}}return r<e.length&&t.push({text:e.slice(r),...n}),t}function Ek(e){return e.replace(Ck,``)}var Dk=[`off`,`minimal`,`low`,`medium`,`high`,`xhigh`],Ok=`worktree`,kk=class extends Error{kind;constructor(e,t){super(e),this.name=`HistoryError`,this.kind=t}};async function Ak(e,t){let n=[];for(;;){let r=await e(n.length,50);if(r.items.length===0||(n.unshift(...r.items),t?.(n.length),r.remaining===0))return n}}Object.defineProperty(exports,"A",{enumerable:!0,get:function(){return Eh}}),Object.defineProperty(exports,"B",{enumerable:!0,get:function(){return C}}),Object.defineProperty(exports,"C",{enumerable:!0,get:function(){return lv}}),Object.defineProperty(exports,"D",{enumerable:!0,get:function(){return pg}}),Object.defineProperty(exports,"E",{enumerable:!0,get:function(){return _g}}),Object.defineProperty(exports,"F",{enumerable:!0,get:function(){return Wp}}),Object.defineProperty(exports,"H",{enumerable:!0,get:function(){return u}}),Object.defineProperty(exports,"I",{enumerable:!0,get:function(){return Mp}}),Object.defineProperty(exports,"L",{enumerable:!0,get:function(){return Np}}),Object.defineProperty(exports,"M",{enumerable:!0,get:function(){return Sh}}),Object.defineProperty(exports,"N",{enumerable:!0,get:function(){return wh}}),Object.defineProperty(exports,"O",{enumerable:!0,get:function(){return Lh}}),Object.defineProperty(exports,"P",{enumerable:!0,get:function(){return $m}}),Object.defineProperty(exports,"R",{enumerable:!0,get:function(){return bl}}),Object.defineProperty(exports,"S",{enumerable:!0,get:function(){return mv}}),Object.defineProperty(exports,"T",{enumerable:!0,get:function(){return gg}}),Object.defineProperty(exports,"U",{enumerable:!0,get:function(){return c}}),Object.defineProperty(exports,"V",{enumerable:!0,get:function(){return d}}),Object.defineProperty(exports,"W",{enumerable:!0,get:function(){return l}}),Object.defineProperty(exports,"_",{enumerable:!0,get:function(){return UO}}),Object.defineProperty(exports,"a",{enumerable:!0,get:function(){return Tk}}),Object.defineProperty(exports,"b",{enumerable:!0,get:function(){return zC}}),Object.defineProperty(exports,"c",{enumerable:!0,get:function(){return gk}}),Object.defineProperty(exports,"d",{enumerable:!0,get:function(){return dk}}),Object.defineProperty(exports,"f",{enumerable:!0,get:function(){return lk}}),Object.defineProperty(exports,"g",{enumerable:!0,get:function(){return WO}}),Object.defineProperty(exports,"h",{enumerable:!0,get:function(){return tk}}),Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return Ok}}),Object.defineProperty(exports,"j",{enumerable:!0,get:function(){return Th}}),Object.defineProperty(exports,"k",{enumerable:!0,get:function(){return jh}}),Object.defineProperty(exports,"l",{enumerable:!0,get:function(){return pk}}),Object.defineProperty(exports,"m",{enumerable:!0,get:function(){return QO}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return Ak}}),Object.defineProperty(exports,"o",{enumerable:!0,get:function(){return Ek}}),Object.defineProperty(exports,"p",{enumerable:!0,get:function(){return ek}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return Dk}}),Object.defineProperty(exports,"s",{enumerable:!0,get:function(){return bk}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return kk}}),Object.defineProperty(exports,"u",{enumerable:!0,get:function(){return uk}}),Object.defineProperty(exports,"v",{enumerable:!0,get:function(){return wO}}),Object.defineProperty(exports,"w",{enumerable:!0,get:function(){return yg}}),Object.defineProperty(exports,"x",{enumerable:!0,get:function(){return LC}}),Object.defineProperty(exports,"y",{enumerable:!0,get:function(){return $C}}),Object.defineProperty(exports,"z",{enumerable:!0,get:function(){return ne}});
|
|
@@ -22,7 +22,7 @@ function le({ text: e, className: t, iconOnly: n = !1 }) {
|
|
|
22
22
|
onClick: a,
|
|
23
23
|
title: r ? "Copied!" : n ? "Copy code" : "Copy",
|
|
24
24
|
"aria-label": n ? r ? "Copied" : "Copy code" : void 0,
|
|
25
|
-
className: t ?? "rounded px-1.5 py-0.5 text-xs text-zinc-400 hover:bg-zinc-100 hover:text-zinc-700 dark:text-zinc-600 dark:hover:bg-zinc-800 dark:hover:text-zinc-300",
|
|
25
|
+
className: t ?? "inline-flex min-h-6 items-center justify-center rounded px-1.5 py-0.5 text-xs text-zinc-400 hover:bg-zinc-100 hover:text-zinc-700 dark:text-zinc-600 dark:hover:bg-zinc-800 dark:hover:text-zinc-300",
|
|
26
26
|
children: n ? r ? "✓" : "⧉" : r ? "✓ copied" : "⧉ copy"
|
|
27
27
|
});
|
|
28
28
|
}
|
|
@@ -9179,12 +9179,34 @@ div.mxRubberband { position: absolute; overflow: hidden; border: 1px solid #29b6
|
|
|
9179
9179
|
// After a bend goes, Delete waits for the next click: a second press, or a held key, would
|
|
9180
9180
|
// otherwise delete the wire still selected under it
|
|
9181
9181
|
var bendJustRemoved = false;
|
|
9182
|
+
// The handle's picture with its fill turned orange; the picture as it is when it is not
|
|
9183
|
+
// an SVG this can read.
|
|
9184
|
+
var orangeHandle = function (src) {
|
|
9185
|
+
var marker = ";base64,";
|
|
9186
|
+
var at = src.indexOf(marker);
|
|
9187
|
+
if (src.indexOf("data:image/svg+xml") !== 0 || at < 0) return src;
|
|
9188
|
+
try {
|
|
9189
|
+
var svg = atob(src.slice(at + marker.length));
|
|
9190
|
+
var painted = svg.split('fill="#29b6f2"').join('fill="#f97316"');
|
|
9191
|
+
return painted === svg ? src : src.slice(0, at + marker.length) + btoa(painted);
|
|
9192
|
+
} catch (error) {
|
|
9193
|
+
return src;
|
|
9194
|
+
}
|
|
9195
|
+
};
|
|
9182
9196
|
var showChosen = function (on) {
|
|
9183
9197
|
if (chosen === null) return;
|
|
9184
9198
|
var handler = graph.selectionCellsHandler.getHandler(chosen.cell);
|
|
9185
9199
|
var shape = handler && handler.bends ? handler.bends[chosen.index] : null;
|
|
9186
9200
|
if (!shape) return;
|
|
9187
|
-
|
|
9201
|
+
// draw.io draws a handle as a picture — a small SVG with its colour inside — so a
|
|
9202
|
+
// fill colour set on the shape shows nothing: the picture itself is swapped for the
|
|
9203
|
+
// same one in orange, and back.
|
|
9204
|
+
if (typeof shape.image === "string") {
|
|
9205
|
+
if (shape.plainImage === undefined) shape.plainImage = shape.image;
|
|
9206
|
+
shape.image = on ? orangeHandle(shape.plainImage) : shape.plainImage;
|
|
9207
|
+
} else {
|
|
9208
|
+
shape.fill = on ? "#f97316" : mxConstants.HANDLE_FILLCOLOR;
|
|
9209
|
+
}
|
|
9188
9210
|
shape.redraw();
|
|
9189
9211
|
};
|
|
9190
9212
|
var forget = function () { showChosen(false); chosen = null; };
|
|
@@ -25644,12 +25666,16 @@ function Bk({ path: e, xml: t, variant: n, fallback: r, onTouchUpDirtyChange: i,
|
|
|
25644
25666
|
je.current ? je.current() : ke.current === null ? Ae.current && Oe.current() : De.current();
|
|
25645
25667
|
}, []);
|
|
25646
25668
|
E(() => {
|
|
25647
|
-
if (C === null) return;
|
|
25669
|
+
if (C === null && !_) return;
|
|
25648
25670
|
function e(e) {
|
|
25649
|
-
e.key === "Escape" && (e.preventDefault(), e.stopImmediatePropagation(),
|
|
25671
|
+
e.key === "Escape" && (e.preventDefault(), e.stopImmediatePropagation(), Me());
|
|
25650
25672
|
}
|
|
25651
25673
|
return window.addEventListener("keydown", e, !0), () => window.removeEventListener("keydown", e, !0);
|
|
25652
|
-
}, [
|
|
25674
|
+
}, [
|
|
25675
|
+
C,
|
|
25676
|
+
_,
|
|
25677
|
+
Me
|
|
25678
|
+
]);
|
|
25653
25679
|
function Ne(t) {
|
|
25654
25680
|
return /* @__PURE__ */ j(k, { children: [/* @__PURE__ */ A("button", {
|
|
25655
25681
|
type: "button",
|
|
@@ -25891,40 +25917,54 @@ function Bk({ path: e, xml: t, variant: n, fallback: r, onTouchUpDirtyChange: i,
|
|
|
25891
25917
|
});
|
|
25892
25918
|
}
|
|
25893
25919
|
//#endregion
|
|
25894
|
-
//#region ../ui/src/components/
|
|
25920
|
+
//#region ../ui/src/components/markdownDrawio.tsx
|
|
25895
25921
|
function Vk(e) {
|
|
25922
|
+
return typeof e == "string" && e !== "" && !y(e) && _(e.split(/[?#]/)[0]);
|
|
25923
|
+
}
|
|
25924
|
+
function Hk(e, t = "") {
|
|
25925
|
+
let n = g(t, e);
|
|
25926
|
+
try {
|
|
25927
|
+
return decodeURIComponent(n);
|
|
25928
|
+
} catch {
|
|
25929
|
+
return n;
|
|
25930
|
+
}
|
|
25931
|
+
}
|
|
25932
|
+
function Uk(e) {
|
|
25933
|
+
return e.tagName === "img" && Vk(e.properties.src) || e.children.some((e) => e.type === "element" && Uk(e));
|
|
25934
|
+
}
|
|
25935
|
+
function Wk({ node: e, children: t, ...n }) {
|
|
25936
|
+
return e && Uk(e) ? /* @__PURE__ */ A("div", {
|
|
25937
|
+
...n,
|
|
25938
|
+
children: t
|
|
25939
|
+
}) : /* @__PURE__ */ A("p", {
|
|
25940
|
+
...n,
|
|
25941
|
+
children: t
|
|
25942
|
+
});
|
|
25943
|
+
}
|
|
25944
|
+
//#endregion
|
|
25945
|
+
//#region ../ui/src/components/AssistantMessage.tsx
|
|
25946
|
+
function Gk(e) {
|
|
25896
25947
|
return e === "className" || Array.isArray(e) && e[0] === "className";
|
|
25897
25948
|
}
|
|
25898
|
-
function
|
|
25949
|
+
function Kk(e) {
|
|
25899
25950
|
let t = {};
|
|
25900
|
-
for (let [n, r] of Object.entries(e)) t[n] = r.filter((e) => !
|
|
25951
|
+
for (let [n, r] of Object.entries(e)) t[n] = r.filter((e) => !Gk(e));
|
|
25901
25952
|
return t["*"] = [...t["*"] ?? [], "className"], t;
|
|
25902
25953
|
}
|
|
25903
|
-
var
|
|
25954
|
+
var qk = {
|
|
25904
25955
|
...rk,
|
|
25905
25956
|
tagNames: [.../* @__PURE__ */ new Set([
|
|
25906
25957
|
...rk.tagNames ?? [],
|
|
25907
25958
|
"details",
|
|
25908
25959
|
"summary"
|
|
25909
25960
|
])],
|
|
25910
|
-
attributes:
|
|
25911
|
-
},
|
|
25961
|
+
attributes: Kk(rk.attributes ?? {})
|
|
25962
|
+
}, Jk = [
|
|
25912
25963
|
tk,
|
|
25913
|
-
[bk,
|
|
25964
|
+
[bk, qk],
|
|
25914
25965
|
mw
|
|
25915
|
-
],
|
|
25916
|
-
function
|
|
25917
|
-
let t = g("", e);
|
|
25918
|
-
try {
|
|
25919
|
-
return decodeURIComponent(t);
|
|
25920
|
-
} catch {
|
|
25921
|
-
return t;
|
|
25922
|
-
}
|
|
25923
|
-
}
|
|
25924
|
-
function qk(e) {
|
|
25925
|
-
return typeof e == "string" && e !== "" && !y(e) && _(e.split(/[?#]/)[0]);
|
|
25926
|
-
}
|
|
25927
|
-
function Jk({ text: e }) {
|
|
25966
|
+
], Yk = [d, m];
|
|
25967
|
+
function Xk({ text: e }) {
|
|
25928
25968
|
let [t, n] = O(!1);
|
|
25929
25969
|
return /* @__PURE__ */ j("div", {
|
|
25930
25970
|
className: "my-1 rounded-lg border border-zinc-200 bg-zinc-50 text-sm dark:border-zinc-800/80 dark:bg-zinc-900/40",
|
|
@@ -25945,15 +25985,18 @@ function Jk({ text: e }) {
|
|
|
25945
25985
|
})]
|
|
25946
25986
|
});
|
|
25947
25987
|
}
|
|
25948
|
-
function
|
|
25988
|
+
function Zk({ item: e, serverUrl: t = "", token: n = null, workspace: r, onOpenFile: i, hideReasoning: a = !1 }) {
|
|
25949
25989
|
let o = a ? e.blocks.filter((e) => e.type !== "thinking") : e.blocks, c = e.blocks.filter((e) => e.type === "text").map((e) => e.text).join("\n\n").trim(), l = D(i);
|
|
25950
25990
|
l.current = i;
|
|
25951
25991
|
let u = ae(() => {
|
|
25952
25992
|
function e({ src: e, alt: i, ...a }) {
|
|
25953
|
-
if (
|
|
25954
|
-
|
|
25955
|
-
|
|
25956
|
-
|
|
25993
|
+
if (Vk(e)) {
|
|
25994
|
+
let t = Hk(e);
|
|
25995
|
+
return /* @__PURE__ */ A(Bk, {
|
|
25996
|
+
path: t,
|
|
25997
|
+
variant: "reply"
|
|
25998
|
+
}, t);
|
|
25999
|
+
}
|
|
25957
26000
|
let o = typeof e == "string" && e !== "" && !y(e) ? v(t, g("", e), n, void 0, r) : e;
|
|
25958
26001
|
return /* @__PURE__ */ A("img", {
|
|
25959
26002
|
...a,
|
|
@@ -25983,21 +26026,11 @@ function Yk({ item: e, serverUrl: t = "", token: n = null, workspace: r, onOpenF
|
|
|
25983
26026
|
children: t
|
|
25984
26027
|
});
|
|
25985
26028
|
}
|
|
25986
|
-
function a({ node: e, children: t, ...n }) {
|
|
25987
|
-
let r = (e?.children ?? []).filter((e) => e.type !== "text" || (e.value ?? "").trim() !== "");
|
|
25988
|
-
return r.length > 0 && r.every((e) => e.type === "element" && e.tagName === "img" && qk(e.properties?.src)) ? /* @__PURE__ */ A("div", {
|
|
25989
|
-
className: "my-2",
|
|
25990
|
-
children: t
|
|
25991
|
-
}) : /* @__PURE__ */ A("p", {
|
|
25992
|
-
...n,
|
|
25993
|
-
children: t
|
|
25994
|
-
});
|
|
25995
|
-
}
|
|
25996
26029
|
return {
|
|
25997
26030
|
pre: rg,
|
|
25998
26031
|
img: e,
|
|
25999
26032
|
a: i,
|
|
26000
|
-
p:
|
|
26033
|
+
p: Wk
|
|
26001
26034
|
};
|
|
26002
26035
|
}, [
|
|
26003
26036
|
t,
|
|
@@ -26011,11 +26044,11 @@ function Yk({ item: e, serverUrl: t = "", token: n = null, workspace: r, onOpenF
|
|
|
26011
26044
|
className: "flex justify-end opacity-0 transition-opacity group-hover:opacity-100",
|
|
26012
26045
|
children: /* @__PURE__ */ A(le, { text: c })
|
|
26013
26046
|
}),
|
|
26014
|
-
o.map((e, t) => e.type === "thinking" ? /* @__PURE__ */ A(
|
|
26047
|
+
o.map((e, t) => e.type === "thinking" ? /* @__PURE__ */ A(Xk, { text: e.text }, e.contentIndex ?? t) : /* @__PURE__ */ A("div", {
|
|
26015
26048
|
className: "prose-chat",
|
|
26016
26049
|
children: /* @__PURE__ */ A(Wv, {
|
|
26017
|
-
remarkPlugins:
|
|
26018
|
-
rehypePlugins:
|
|
26050
|
+
remarkPlugins: Yk,
|
|
26051
|
+
rehypePlugins: Jk,
|
|
26019
26052
|
components: u,
|
|
26020
26053
|
children: s(e.text)
|
|
26021
26054
|
})
|
|
@@ -26029,7 +26062,7 @@ function Yk({ item: e, serverUrl: t = "", token: n = null, workspace: r, onOpenF
|
|
|
26029
26062
|
}
|
|
26030
26063
|
//#endregion
|
|
26031
26064
|
//#region ../ui/src/util/ansi.ts
|
|
26032
|
-
var
|
|
26065
|
+
var Qk = {
|
|
26033
26066
|
30: "#3f3f46",
|
|
26034
26067
|
31: "#dc2626",
|
|
26035
26068
|
32: "#16a34a",
|
|
@@ -26047,9 +26080,9 @@ var Xk = {
|
|
|
26047
26080
|
96: "#06b6d4",
|
|
26048
26081
|
97: "#d4d4d8"
|
|
26049
26082
|
};
|
|
26050
|
-
function
|
|
26083
|
+
function $k(e) {
|
|
26051
26084
|
if (!Number.isInteger(e) || e < 0 || e > 255) return;
|
|
26052
|
-
if (e < 16) return
|
|
26085
|
+
if (e < 16) return Qk[e < 8 ? 30 + e : 90 + e - 8];
|
|
26053
26086
|
if (e >= 232) {
|
|
26054
26087
|
let t = 8 + (e - 232) * 10;
|
|
26055
26088
|
return `rgb(${t} ${t} ${t})`;
|
|
@@ -26057,8 +26090,8 @@ function Zk(e) {
|
|
|
26057
26090
|
let t = e - 16, n = (e) => e === 0 ? 0 : 55 + e * 40;
|
|
26058
26091
|
return `rgb(${n(Math.floor(t / 36))} ${n(Math.floor(t / 6) % 6)} ${n(t % 6)})`;
|
|
26059
26092
|
}
|
|
26060
|
-
var
|
|
26061
|
-
function
|
|
26093
|
+
var eA = /\u001B\[[0-9;:]*[A-Za-z]|\u001B[()][A-Za-z0-9]|\u001B[A-Za-z]/g;
|
|
26094
|
+
function tA(e, t) {
|
|
26062
26095
|
let n = { ...e };
|
|
26063
26096
|
for (let e = 0; e < t.length; e++) {
|
|
26064
26097
|
let r = t[e];
|
|
@@ -26071,7 +26104,7 @@ function $k(e, t) {
|
|
|
26071
26104
|
else if (r === 23) delete n.italic;
|
|
26072
26105
|
else if (r === 24) delete n.underline;
|
|
26073
26106
|
else if (r === 39) delete n.color;
|
|
26074
|
-
else if (
|
|
26107
|
+
else if (Qk[r] !== void 0) n.color = Qk[r];
|
|
26075
26108
|
else if (r === 38) {
|
|
26076
26109
|
if (t[e + 1] === 2) {
|
|
26077
26110
|
let [r, i, a] = [
|
|
@@ -26085,17 +26118,17 @@ function $k(e, t) {
|
|
|
26085
26118
|
a
|
|
26086
26119
|
].every((e) => Number.isFinite(e)) && (n.color = `rgb(${r} ${i} ${a})`), e += 4;
|
|
26087
26120
|
} else if (t[e + 1] === 5) {
|
|
26088
|
-
let r =
|
|
26121
|
+
let r = $k(t[e + 2]);
|
|
26089
26122
|
r !== void 0 && (n.color = r), e += 2;
|
|
26090
26123
|
}
|
|
26091
26124
|
}
|
|
26092
26125
|
}
|
|
26093
26126
|
return n;
|
|
26094
26127
|
}
|
|
26095
|
-
function
|
|
26128
|
+
function nA(e) {
|
|
26096
26129
|
let t = [], n = {}, r = 0;
|
|
26097
|
-
|
|
26098
|
-
for (let i =
|
|
26130
|
+
eA.lastIndex = 0;
|
|
26131
|
+
for (let i = eA.exec(e); i !== null; i = eA.exec(e)) {
|
|
26099
26132
|
i.index > r && t.push({
|
|
26100
26133
|
text: e.slice(r, i.index),
|
|
26101
26134
|
...n
|
|
@@ -26103,7 +26136,7 @@ function eA(e) {
|
|
|
26103
26136
|
let a = i[0];
|
|
26104
26137
|
if (a.endsWith("m")) {
|
|
26105
26138
|
let e = a.slice(2, -1), t = e === "" ? [0] : e.split(/[;:]/).map((e) => e === "" ? 0 : Number(e));
|
|
26106
|
-
n =
|
|
26139
|
+
n = tA(n, t);
|
|
26107
26140
|
}
|
|
26108
26141
|
}
|
|
26109
26142
|
return r < e.length && t.push({
|
|
@@ -26111,25 +26144,25 @@ function eA(e) {
|
|
|
26111
26144
|
...n
|
|
26112
26145
|
}), t;
|
|
26113
26146
|
}
|
|
26114
|
-
function
|
|
26115
|
-
return e.replace(
|
|
26147
|
+
function rA(e) {
|
|
26148
|
+
return e.replace(eA, "");
|
|
26116
26149
|
}
|
|
26117
26150
|
//#endregion
|
|
26118
26151
|
//#region ../shared/src/protocol.ts
|
|
26119
|
-
var
|
|
26152
|
+
var iA = [
|
|
26120
26153
|
"off",
|
|
26121
26154
|
"minimal",
|
|
26122
26155
|
"low",
|
|
26123
26156
|
"medium",
|
|
26124
26157
|
"high",
|
|
26125
26158
|
"xhigh"
|
|
26126
|
-
],
|
|
26159
|
+
], aA = "worktree", oA = class extends Error {
|
|
26127
26160
|
kind;
|
|
26128
26161
|
constructor(e, t) {
|
|
26129
26162
|
super(e), this.name = "HistoryError", this.kind = t;
|
|
26130
26163
|
}
|
|
26131
26164
|
};
|
|
26132
|
-
async function
|
|
26165
|
+
async function sA(e, t) {
|
|
26133
26166
|
let n = [];
|
|
26134
26167
|
for (;;) {
|
|
26135
26168
|
let r = await e(n.length, 50);
|
|
@@ -26137,4 +26170,4 @@ async function aA(e, t) {
|
|
|
26137
26170
|
}
|
|
26138
26171
|
}
|
|
26139
26172
|
//#endregion
|
|
26140
|
-
export {
|
|
26173
|
+
export { ng as A, Se as B, zv as C, Ug as D, qg as E, bm as F, le as H, cm as I, lm as L, Qh as M, eg as N, pg as O, kh as P, Xl as R, Wv as S, Kg as T, se as U, ue as V, ce as W, bk as _, nA as a, gw as b, qk as c, Hk as d, Bk as f, xk as g, Mk as h, aA as i, tg as j, sg as k, Wk as l, kk as m, sA as n, rA as o, jk as p, iA as r, Zk as s, oA as t, Vk as u, tk as v, Yg as w, mw as x, Aw as y, ke as z };
|