mcard-studio 0.0.1 → 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (83) hide show
  1. package/astro.config.mjs +6 -1
  2. package/bin/mcard-studio.mjs +1 -1
  3. package/dist/client/_astro/{ChartAnalyticsViewlet.Cevj0EOs.js → ChartAnalyticsViewlet.jrwIemvb.js} +1 -1
  4. package/dist/client/_astro/ClmPcardViewlet.C-fU7oZf.js +3 -0
  5. package/dist/client/_astro/D3GraphViewlet.BCZl0b2U.js +2 -0
  6. package/dist/client/_astro/DockviewSpatialWorkbench.B_I1GJHw.js +12 -0
  7. package/dist/client/_astro/{DocumentViewlets.Dm_GL3AL.js → DocumentViewlets.B53IqmpY.js} +1 -1
  8. package/dist/client/_astro/ExcalidrawWhiteboardViewlet.CFpPYSdn.js +1 -0
  9. package/dist/client/_astro/{FaroVCardSpanInstrumenter.BIk2NhJY.js → FaroVCardSpanInstrumenter.un8kDMWv.js} +1 -1
  10. package/dist/client/_astro/{FontSpecimenViewlet.CpONhJh0.js → FontSpecimenViewlet.D7Aw2xBZ.js} +1 -1
  11. package/dist/client/_astro/HeadMeta.astro_astro_type_script_index_0_lang.VDRYJCM-.js +1 -0
  12. package/dist/client/_astro/{ImageViewlet.CHeNvX6L.js → ImageViewlet.D4FN87n_.js} +1 -1
  13. package/dist/client/_astro/{KatexFormulaViewlet.Cy_InWOK.js → KatexFormulaViewlet.CzhdIOw8.js} +1 -1
  14. package/dist/client/_astro/KoishiChatViewlet.5mepQvLX.js +16 -0
  15. package/dist/client/_astro/MCardLibraryHarness.DE8KeghO.js +2 -0
  16. package/dist/client/_astro/{MarkdownViewlet.qoPlM-TZ.js → MarkdownViewlet.CRuuXXmF.js} +1 -1
  17. package/dist/client/_astro/{MermaidDiagramViewlet.RnwDfQl6.js → MermaidDiagramViewlet.eW6sk-rF.js} +1 -1
  18. package/dist/client/_astro/PCardRendererBridge.oxVKc0gN.js +1 -0
  19. package/dist/client/_astro/RendererPCardRegistry.CWjYZs2H.js +1 -0
  20. package/dist/client/_astro/{SchemaYamlViewlet.D6HVdmrq.js → SchemaYamlViewlet.ZJBvxItR.js} +1 -1
  21. package/dist/client/_astro/{ShellContainer.astro_astro_type_script_index_0_lang.2oi8fhQo.js → ShellContainer.astro_astro_type_script_index_0_lang.j_ELcN5d.js} +1 -1
  22. package/dist/client/_astro/{Spatial3dViewlet.CCYBSSib.js → Spatial3dViewlet.DnVMBENJ.js} +1 -1
  23. package/dist/client/_astro/StudioWorkbench.Blo5oSIw.js +7 -0
  24. package/dist/client/_astro/{SvgViewlet.BxlWQ-JX.js → SvgViewlet.BCje7Qqb.js} +1 -1
  25. package/dist/client/_astro/{TerminalView.DWZR-hUa.js → TerminalView.C_Ksz6lT.js} +4 -4
  26. package/dist/client/_astro/{ThemeSettingsViewlet.Cb1r8fWw.js → ThemeSettingsViewlet.DJpjQQ0Z.js} +1 -1
  27. package/dist/client/_astro/{TikzDiagramViewlet.CqY7VTeP.js → TikzDiagramViewlet.CXb1A8nf.js} +1 -1
  28. package/dist/client/_astro/{VideoPlayerViewlet.DoSYmmoQ.js → VideoPlayerViewlet.CmECt7yT.js} +1 -1
  29. package/dist/client/_astro/{WebappZenViewlet.CQW50OhX.js → WebappZenViewlet.whCmGVHR.js} +1 -1
  30. package/dist/client/_astro/{WelcomeViewport.LwKTA6h7.js → WelcomeViewport.BiYwLh6l.js} +1 -1
  31. package/dist/client/_astro/__vite-browser-external.CQZnr-r3.js +1 -0
  32. package/dist/client/_astro/{agentIdentityCredentialService.BtKVsl2C.js → agentIdentityCredentialService.UzMMwBwv.js} +5 -5
  33. package/dist/client/_astro/cardTypeDetector.Ci4APwhX.js +1 -0
  34. package/dist/client/_astro/disposable.Dsb0sbRP.js +1 -0
  35. package/dist/client/_astro/{markdownService.D-tM2RYx.js → markdownService.BgWjyJ57.js} +1 -1
  36. package/dist/client/_astro/{mcardStore.BiAvqM-D.js → mcardStore.CT-ollfl.js} +2 -2
  37. package/dist/client/_astro/mcardVfs.2UOw9Z-r.js +3 -0
  38. package/dist/client/_astro/polyfills._3wYPjZf.js +1 -0
  39. package/dist/client/_astro/rendererEventBus.DMH9afq9.js +1 -0
  40. package/dist/client/_astro/themeStore.CEt0e54l.js +1 -0
  41. package/dist/client/_astro/{tikzCompiler.DFojjdxR.js → tikzCompiler.fe3qomFY.js} +1 -1
  42. package/dist/client/_astro/{useMCardHydration.Co47OH3D.js → useMCardHydration.7Z-HfBh5.js} +1 -1
  43. package/dist/client/_astro/vendor-ai.D6NcJ6lu.js +69 -0
  44. package/dist/client/_astro/vendor-clm-kernel.Bvk3XHk2.js +116 -0
  45. package/dist/client/_astro/vfsHandles.IX_wTpw_.js +1 -0
  46. package/dist/client/_astro/vfsPersistence.BuhXYeSb.js +1 -0
  47. package/dist/client/_astro/vfsTransactions.C_IQQg0s.js +1 -0
  48. package/dist/client/_astro/{workspaceStore.CXakha4Y.js → workspaceStore.CD0kAVAl.js} +1 -1
  49. package/dist/client/js/buffer-polyfill.js +14 -0
  50. package/dist/server/chunks/{StudioLayout_D163irJ0.mjs → StudioLayout_B5ZnlqjF.mjs} +2 -2
  51. package/dist/server/chunks/{_.._ZXsz792-.mjs → _.._5gPhVOLM.mjs} +1 -1
  52. package/dist/server/chunks/{mcard-library_DvPPUs9_.mjs → mcard-library_7Wzoihkm.mjs} +1 -1
  53. package/dist/server/chunks/{ws-server-init_CkcgcI5V.mjs → ws-server-init_DUjuR2-o.mjs} +3 -3
  54. package/dist/server/entry.mjs +8 -4
  55. package/dist/server/entry2.mjs +3 -3
  56. package/dist/server/virtual_astro_middleware.mjs +1 -1
  57. package/package.json +1 -1
  58. package/public/js/buffer-polyfill.js +14 -0
  59. package/src/layouts/StudioLayout.astro +1 -0
  60. package/src/pages/index.astro +75 -0
  61. package/src/services/inBrowserLlm/engines/litertEngine.ts +1 -1
  62. package/dist/client/_astro/ClmPcardViewlet.DW5Yft0E.js +0 -3
  63. package/dist/client/_astro/D3GraphViewlet.DAjPz1DP.js +0 -2
  64. package/dist/client/_astro/DockviewSpatialWorkbench.DyQjSoHd.js +0 -12
  65. package/dist/client/_astro/ExcalidrawWhiteboardViewlet.DrlW7B6G.js +0 -1
  66. package/dist/client/_astro/HeadMeta.astro_astro_type_script_index_0_lang.DGXU-3Lu.js +0 -1
  67. package/dist/client/_astro/KoishiChatViewlet.B0eDEMnT.js +0 -16
  68. package/dist/client/_astro/MCardLibraryHarness.CUJLJFBt.js +0 -2
  69. package/dist/client/_astro/PCardRendererBridge.BnyaE05I.js +0 -1
  70. package/dist/client/_astro/RendererPCardRegistry.CLr4j1Ub.js +0 -1
  71. package/dist/client/_astro/StudioWorkbench.CF0SOYwy.js +0 -7
  72. package/dist/client/_astro/cardTypeDetector.C9kGObMh.js +0 -1
  73. package/dist/client/_astro/disposable.66apX1Q2.js +0 -1
  74. package/dist/client/_astro/empty.DOwCrGXH.js +0 -1
  75. package/dist/client/_astro/mcardVfs.Bj-RA0p7.js +0 -2
  76. package/dist/client/_astro/path.CR60mj9W.js +0 -1
  77. package/dist/client/_astro/polyfills.DcBkS56X.js +0 -1
  78. package/dist/client/_astro/rendererEventBus.CyFnSRLk.js +0 -1
  79. package/dist/client/_astro/themeStore.zUMFLo3Q.js +0 -1
  80. package/dist/client/_astro/vendor-ai.CZe7UVVK.js +0 -69
  81. package/dist/client/_astro/vfsHandles.B-nczBRy.js +0 -1
  82. package/dist/client/_astro/vfsPersistence.D6zRzVML.js +0 -1
  83. package/dist/client/_astro/vfsTransactions.04mkEHxD.js +0 -1
@@ -1 +1 @@
1
- import{i as e}from"./rolldown-runtime.Dd_uD5pT.js";import{a as t,i as n}from"./vendor-react.DpDU3q_x.js";import{t as r}from"./useMCardHydration.Co47OH3D.js";import{n as i,t as a}from"./tikzCompiler.DFojjdxR.js";var o=e(t(),1);function s(e,t,n){if(typeof window>`u`)return;let r=new Blob([e],{type:n}),i=URL.createObjectURL(r),a=document.createElement(`a`);a.href=i,a.download=t,document.body.appendChild(a),a.click(),document.body.removeChild(a),URL.revokeObjectURL(i)}async function c(e,t=3.125){if(typeof window>`u`||typeof Image>`u`)throw Error(`Canvas rasterization requires a browser environment`);let n=new DOMParser().parseFromString(e,`image/svg+xml`).querySelector(`svg`);if(!n)throw Error(`Invalid SVG markup provided`);let r=parseFloat(n.getAttribute(`width`)||`480`),i=parseFloat(n.getAttribute(`height`)||`240`),a=n.getAttribute(`viewBox`);if(a&&(!r||!i)){let e=a.split(/\s+/).map(parseFloat);e.length===4&&(r=e[2]||480,i=e[3]||240)}let o=document.createElement(`canvas`);o.width=Math.round(r*t),o.height=Math.round(i*t);let s=o.getContext(`2d`);if(!s)throw Error(`Could not create canvas 2d context`);s.fillStyle=`#181818`,s.fillRect(0,0,o.width,o.height),s.scale(t,t);let c=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(e).replace(/'/g,`%27`).replace(/"/g,`%22`)}`;return new Promise((e,t)=>{let n=new Image;n.crossOrigin=`anonymous`,n.onload=()=>{s.drawImage(n,0,0,r,i),e(o.toDataURL(`image/png`))},n.onerror=e=>t(Error(`Failed to load SVG for rasterization: ${e}`)),n.src=c})}async function l(e){if(typeof window>`u`||!navigator.clipboard||!window.ClipboardItem)return!1;try{let t=await(await fetch(e)).blob();return await navigator.clipboard.write([new ClipboardItem({"image/png":t})]),!0}catch(e){return console.warn(`[tikzExport] Clipboard copy failed:`,e),!1}}var u=n(),d=({mcard:e,activeTab:t})=>{let[n,d]=(0,o.useState)(!1),[f,p]=(0,o.useState)(null),[m,h]=(0,o.useState)(!1),[g,_]=(0,o.useState)(`fastpath`),[v,y]=(0,o.useState)(!1),[b,x]=(0,o.useState)(null),[S,C]=(0,o.useState)(0),{content:w,isLoading:T}=r(e),[E,D]=(0,o.useState)(1),[O,k]=(0,o.useState)({x:0,y:0}),[A,j]=(0,o.useState)(!1),M=(0,o.useRef)({x:0,y:0}),N=(0,o.useRef)(null),P=w||(typeof e.content==`string`?e.content:``),F=(0,o.useMemo)(()=>{let t=(e.path||e.name||e.handle||``).toLowerCase(),n=(e.mimeType||``).toLowerCase();return t.endsWith(`.tikzcd`)||t.endsWith(`.tikz-cd`)||n===`text/x-tikzcd`},[e.path,e.name,e.handle,e.mimeType]),I=(0,o.useMemo)(()=>{let e=performance.now(),t=a(P,{isTikzCd:F});return g===`fastpath`&&C(Math.round((performance.now()-e)*10)/10),t},[P,F,g]),L=g===`tikzjax-wasm`&&b?b:I,R=async e=>{if(_(e),e===`tikzjax-wasm`){if(b)return;y(!0);let e=performance.now();try{let t=await i(P,{engine:`tikzjax-wasm`,isTikzCd:F});x(t),C(Math.round((performance.now()-e)*10)/10)}catch(e){console.warn(`[TikzDiagramViewlet] TeX WASM compilation failed:`,e)}finally{y(!1)}}};(0,o.useEffect)(()=>{let e=e=>{e.key===`Escape`&&m&&h(!1)};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[m]);let z=e=>{n||(j(!0),M.current={x:e.clientX-O.x,y:e.clientY-O.y})},B=e=>{A&&!n&&k({x:e.clientX-M.current.x,y:e.clientY-M.current.y})},V=()=>{j(!1)},H=e=>{if(n)return;e.preventDefault();let t=e.deltaY<0?1.1:.9;D(e=>Math.min(Math.max(e*t,.25),5))},U=()=>{D(1),k({x:0,y:0})},W=async()=>{if(L.svg)try{await navigator.clipboard.writeText(L.svg),p(`svg`),setTimeout(()=>p(null),2e3)}catch(e){console.error(`Failed to copy SVG`,e)}},G=()=>{if(!L.svg)return;let t=`${e.name||`diagram`}.svg`;s(L.svg,t,`image/svg+xml;charset=utf-8`)},K=async()=>{if(L.svg)try{await l(await c(L.svg,3.125))&&(p(`png`),setTimeout(()=>p(null),2e3))}catch(e){console.error(`Failed to copy PNG`,e)}},q=async()=>{if(L.svg)try{let t=await c(L.svg,3.125),n=document.createElement(`a`);n.href=t,n.download=`${e.name||`diagram`}.png`,document.body.appendChild(n),n.click(),document.body.removeChild(n)}catch(e){console.error(`Failed to export PNG`,e)}},J=t===`raw_data`||t===`raw`;return(0,u.jsxs)(`div`,{className:`card-panel-tikz-viewer ${m?`zen-mode-stage`:``}`,style:{display:`flex`,flexDirection:`column`,width:`100%`,height:`100%`,backgroundColor:`#181818`,color:`#d4d4d4`,overflow:`hidden`,position:m?`fixed`:`relative`,inset:m?0:`auto`,zIndex:m?9999:`auto`},children:[(0,u.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`,padding:`6px 14px`,backgroundColor:`var(--vscode-sideBar-background, #252526)`,borderBottom:`1px solid var(--vscode-editorGroup-border, #333333)`,fontSize:`11px`,zIndex:10},children:[(0,u.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:`8px`},children:[(0,u.jsx)(`span`,{style:{fontWeight:600,color:`#75beff`},children:e.path?.endsWith(`.tikzcd`)||e.path?.endsWith(`.tikz-cd`)?`TikZ-CD Commutative Diagram`:`TikZ Vector Graphics`}),(0,u.jsxs)(`span`,{style:{color:`#6e7681`,fontSize:`10px`},children:[Math.round(E*100),`%`]}),(0,u.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:`2px`,backgroundColor:`#1e1e1e`,padding:`1px 3px`,borderRadius:`3px`,border:`1px solid #333`},children:[(0,u.jsx)(`button`,{onClick:()=>R(`fastpath`),title:`Pure-TypeScript Fast-Path Engine (<5ms, Instant)`,style:{padding:`2px 6px`,backgroundColor:g===`fastpath`?`#0e639c`:`transparent`,color:g===`fastpath`?`#ffffff`:`#858585`,border:`none`,borderRadius:`2px`,cursor:`pointer`,fontSize:`10px`,fontWeight:g===`fastpath`?600:400},children:`⚡ Fast`}),(0,u.jsx)(`button`,{onClick:()=>R(`tikzjax-wasm`),title:`TikzJax WebAssembly Engine (Authentic Computer Modern TeX Typography)`,style:{padding:`2px 6px`,backgroundColor:g===`tikzjax-wasm`?`#0e639c`:`transparent`,color:g===`tikzjax-wasm`?`#ffffff`:`#858585`,border:`none`,borderRadius:`2px`,cursor:`pointer`,fontSize:`10px`,fontWeight:g===`tikzjax-wasm`?600:400},children:`💎 TeX WASM`})]}),v?(0,u.jsx)(`span`,{style:{fontSize:`10px`,color:`#75beff`,fontStyle:`italic`},children:`⏳ Compiling...`}):(0,u.jsxs)(`span`,{style:{fontSize:`10px`,color:`#858585`,marginLeft:`2px`},children:[S,`ms`]}),(0,u.jsx)(`button`,{onClick:()=>d(e=>!e),style:{padding:`2px 8px`,backgroundColor:n?`var(--vscode-button-background, #0e639c)`:`#333`,color:`#fff`,border:`none`,borderRadius:`2px`,cursor:`pointer`,fontSize:`11px`},children:n?`👁 Visual`:`</> Source`})]}),(0,u.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:`6px`},children:[!n&&(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(`button`,{onClick:()=>D(e=>Math.min(e*1.2,5)),title:`Zoom In`,style:{padding:`2px 6px`,background:`#333`,color:`#fff`,border:`none`,borderRadius:`2px`,cursor:`pointer`},children:`+`}),(0,u.jsx)(`button`,{onClick:()=>D(e=>Math.max(e*.8,.25)),title:`Zoom Out`,style:{padding:`2px 6px`,background:`#333`,color:`#fff`,border:`none`,borderRadius:`2px`,cursor:`pointer`},children:`-`}),(0,u.jsx)(`button`,{onClick:U,title:`Reset Viewport`,style:{padding:`2px 6px`,background:`#333`,color:`#fff`,border:`none`,borderRadius:`2px`,cursor:`pointer`},children:`⟲`}),(0,u.jsx)(`button`,{onClick:W,title:`Copy SVG Code`,style:{padding:`2px 8px`,background:`#333`,color:f===`svg`?`#89d185`:`#fff`,border:`none`,borderRadius:`2px`,cursor:`pointer`,fontSize:`11px`},children:f===`svg`?`✓ SVG Copied`:`📋 SVG`}),(0,u.jsx)(`button`,{onClick:G,title:`Download SVG File`,style:{padding:`2px 8px`,background:`#333`,color:`#fff`,border:`none`,borderRadius:`2px`,cursor:`pointer`,fontSize:`11px`},children:`⬇ SVG`}),(0,u.jsx)(`button`,{onClick:K,title:`Copy High-Res PNG (300 DPI) to Clipboard`,style:{padding:`2px 8px`,background:`#333`,color:f===`png`?`#89d185`:`#fff`,border:`none`,borderRadius:`2px`,cursor:`pointer`,fontSize:`11px`},children:f===`png`?`✓ PNG Copied`:`🖼 PNG`}),(0,u.jsx)(`button`,{onClick:q,title:`Download High-Res PNG (300 DPI)`,style:{padding:`2px 8px`,background:`#333`,color:`#fff`,border:`none`,borderRadius:`2px`,cursor:`pointer`,fontSize:`11px`},children:`⬇ PNG`})]}),(0,u.jsx)(`button`,{onClick:()=>h(e=>!e),title:m?`Exit Zen Mode (Esc)`:`Full-Page Zen Mode`,style:{padding:`2px 8px`,backgroundColor:m?`#b91c1c`:`#333`,color:`#fff`,border:`none`,borderRadius:`2px`,cursor:`pointer`,fontSize:`11px`},children:m?`✕ Exit Zen`:`⛶ Zen Mode`})]})]}),(0,u.jsx)(`div`,{ref:N,onMouseDown:z,onMouseMove:B,onMouseUp:V,onWheel:H,style:{flex:1,width:`100%`,height:`100%`,overflow:`hidden`,display:`flex`,alignItems:`center`,justifyContent:`center`,cursor:n?`default`:A?`grabbing`:`grab`,position:`relative`,backgroundColor:`#181818`,backgroundImage:n?`none`:`radial-gradient(circle, #252526 1px, transparent 1px)`,backgroundSize:`24px 24px`},children:n||J?(0,u.jsx)(`div`,{style:{width:`100%`,height:`100%`,overflow:`auto`,padding:`16px`,boxSizing:`border-box`},children:(0,u.jsx)(`pre`,{style:{margin:0,fontFamily:`var(--vscode-editor-font-family, monospace)`,fontSize:`12.5px`,lineHeight:1.6,color:`#d4d4d4`},children:(0,u.jsx)(`code`,{children:P})})}):T?(0,u.jsxs)(`div`,{className:`tikz-diagram-loading-skeleton`,style:{display:`flex`,flexDirection:`column`,alignItems:`center`,justifyContent:`center`,gap:`12px`,color:`#75beff`,userSelect:`none`},children:[(0,u.jsx)(`div`,{style:{fontSize:`24px`},children:`⚡`}),(0,u.jsx)(`div`,{style:{fontSize:`12px`,letterSpacing:`0.5px`,color:`#9cdcfe`},children:`Hydrating diagram source from VFS...`})]}):(0,u.jsx)(`div`,{style:{transform:`translate(${O.x}px, ${O.y}px) scale(${E})`,transformOrigin:`center center`,transition:A?`none`:`transform 0.08s ease-out`,display:`flex`,alignItems:`center`,justifyContent:`center`},dangerouslySetInnerHTML:{__html:L.svg}})})]})};export{d as TikzDiagramViewlet,d as default};
1
+ import{i as e}from"./rolldown-runtime.Dd_uD5pT.js";import{a as t,i as n}from"./vendor-react.DpDU3q_x.js";import{t as r}from"./useMCardHydration.7Z-HfBh5.js";import{n as i,t as a}from"./tikzCompiler.fe3qomFY.js";var o=e(t(),1);function s(e,t,n){if(typeof window>`u`)return;let r=new Blob([e],{type:n}),i=URL.createObjectURL(r),a=document.createElement(`a`);a.href=i,a.download=t,document.body.appendChild(a),a.click(),document.body.removeChild(a),URL.revokeObjectURL(i)}async function c(e,t=3.125){if(typeof window>`u`||typeof Image>`u`)throw Error(`Canvas rasterization requires a browser environment`);let n=new DOMParser().parseFromString(e,`image/svg+xml`).querySelector(`svg`);if(!n)throw Error(`Invalid SVG markup provided`);let r=parseFloat(n.getAttribute(`width`)||`480`),i=parseFloat(n.getAttribute(`height`)||`240`),a=n.getAttribute(`viewBox`);if(a&&(!r||!i)){let e=a.split(/\s+/).map(parseFloat);e.length===4&&(r=e[2]||480,i=e[3]||240)}let o=document.createElement(`canvas`);o.width=Math.round(r*t),o.height=Math.round(i*t);let s=o.getContext(`2d`);if(!s)throw Error(`Could not create canvas 2d context`);s.fillStyle=`#181818`,s.fillRect(0,0,o.width,o.height),s.scale(t,t);let c=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(e).replace(/'/g,`%27`).replace(/"/g,`%22`)}`;return new Promise((e,t)=>{let n=new Image;n.crossOrigin=`anonymous`,n.onload=()=>{s.drawImage(n,0,0,r,i),e(o.toDataURL(`image/png`))},n.onerror=e=>t(Error(`Failed to load SVG for rasterization: ${e}`)),n.src=c})}async function l(e){if(typeof window>`u`||!navigator.clipboard||!window.ClipboardItem)return!1;try{let t=await(await fetch(e)).blob();return await navigator.clipboard.write([new ClipboardItem({"image/png":t})]),!0}catch(e){return console.warn(`[tikzExport] Clipboard copy failed:`,e),!1}}var u=n(),d=({mcard:e,activeTab:t})=>{let[n,d]=(0,o.useState)(!1),[f,p]=(0,o.useState)(null),[m,h]=(0,o.useState)(!1),[g,_]=(0,o.useState)(`fastpath`),[v,y]=(0,o.useState)(!1),[b,x]=(0,o.useState)(null),[S,C]=(0,o.useState)(0),{content:w,isLoading:T}=r(e),[E,D]=(0,o.useState)(1),[O,k]=(0,o.useState)({x:0,y:0}),[A,j]=(0,o.useState)(!1),M=(0,o.useRef)({x:0,y:0}),N=(0,o.useRef)(null),P=w||(typeof e.content==`string`?e.content:``),F=(0,o.useMemo)(()=>{let t=(e.path||e.name||e.handle||``).toLowerCase(),n=(e.mimeType||``).toLowerCase();return t.endsWith(`.tikzcd`)||t.endsWith(`.tikz-cd`)||n===`text/x-tikzcd`},[e.path,e.name,e.handle,e.mimeType]),I=(0,o.useMemo)(()=>{let e=performance.now(),t=a(P,{isTikzCd:F});return g===`fastpath`&&C(Math.round((performance.now()-e)*10)/10),t},[P,F,g]),L=g===`tikzjax-wasm`&&b?b:I,R=async e=>{if(_(e),e===`tikzjax-wasm`){if(b)return;y(!0);let e=performance.now();try{let t=await i(P,{engine:`tikzjax-wasm`,isTikzCd:F});x(t),C(Math.round((performance.now()-e)*10)/10)}catch(e){console.warn(`[TikzDiagramViewlet] TeX WASM compilation failed:`,e)}finally{y(!1)}}};(0,o.useEffect)(()=>{let e=e=>{e.key===`Escape`&&m&&h(!1)};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[m]);let z=e=>{n||(j(!0),M.current={x:e.clientX-O.x,y:e.clientY-O.y})},B=e=>{A&&!n&&k({x:e.clientX-M.current.x,y:e.clientY-M.current.y})},V=()=>{j(!1)},H=e=>{if(n)return;e.preventDefault();let t=e.deltaY<0?1.1:.9;D(e=>Math.min(Math.max(e*t,.25),5))},U=()=>{D(1),k({x:0,y:0})},W=async()=>{if(L.svg)try{await navigator.clipboard.writeText(L.svg),p(`svg`),setTimeout(()=>p(null),2e3)}catch(e){console.error(`Failed to copy SVG`,e)}},G=()=>{if(!L.svg)return;let t=`${e.name||`diagram`}.svg`;s(L.svg,t,`image/svg+xml;charset=utf-8`)},K=async()=>{if(L.svg)try{await l(await c(L.svg,3.125))&&(p(`png`),setTimeout(()=>p(null),2e3))}catch(e){console.error(`Failed to copy PNG`,e)}},q=async()=>{if(L.svg)try{let t=await c(L.svg,3.125),n=document.createElement(`a`);n.href=t,n.download=`${e.name||`diagram`}.png`,document.body.appendChild(n),n.click(),document.body.removeChild(n)}catch(e){console.error(`Failed to export PNG`,e)}},J=t===`raw_data`||t===`raw`;return(0,u.jsxs)(`div`,{className:`card-panel-tikz-viewer ${m?`zen-mode-stage`:``}`,style:{display:`flex`,flexDirection:`column`,width:`100%`,height:`100%`,backgroundColor:`#181818`,color:`#d4d4d4`,overflow:`hidden`,position:m?`fixed`:`relative`,inset:m?0:`auto`,zIndex:m?9999:`auto`},children:[(0,u.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`,padding:`6px 14px`,backgroundColor:`var(--vscode-sideBar-background, #252526)`,borderBottom:`1px solid var(--vscode-editorGroup-border, #333333)`,fontSize:`11px`,zIndex:10},children:[(0,u.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:`8px`},children:[(0,u.jsx)(`span`,{style:{fontWeight:600,color:`#75beff`},children:e.path?.endsWith(`.tikzcd`)||e.path?.endsWith(`.tikz-cd`)?`TikZ-CD Commutative Diagram`:`TikZ Vector Graphics`}),(0,u.jsxs)(`span`,{style:{color:`#6e7681`,fontSize:`10px`},children:[Math.round(E*100),`%`]}),(0,u.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:`2px`,backgroundColor:`#1e1e1e`,padding:`1px 3px`,borderRadius:`3px`,border:`1px solid #333`},children:[(0,u.jsx)(`button`,{onClick:()=>R(`fastpath`),title:`Pure-TypeScript Fast-Path Engine (<5ms, Instant)`,style:{padding:`2px 6px`,backgroundColor:g===`fastpath`?`#0e639c`:`transparent`,color:g===`fastpath`?`#ffffff`:`#858585`,border:`none`,borderRadius:`2px`,cursor:`pointer`,fontSize:`10px`,fontWeight:g===`fastpath`?600:400},children:`⚡ Fast`}),(0,u.jsx)(`button`,{onClick:()=>R(`tikzjax-wasm`),title:`TikzJax WebAssembly Engine (Authentic Computer Modern TeX Typography)`,style:{padding:`2px 6px`,backgroundColor:g===`tikzjax-wasm`?`#0e639c`:`transparent`,color:g===`tikzjax-wasm`?`#ffffff`:`#858585`,border:`none`,borderRadius:`2px`,cursor:`pointer`,fontSize:`10px`,fontWeight:g===`tikzjax-wasm`?600:400},children:`💎 TeX WASM`})]}),v?(0,u.jsx)(`span`,{style:{fontSize:`10px`,color:`#75beff`,fontStyle:`italic`},children:`⏳ Compiling...`}):(0,u.jsxs)(`span`,{style:{fontSize:`10px`,color:`#858585`,marginLeft:`2px`},children:[S,`ms`]}),(0,u.jsx)(`button`,{onClick:()=>d(e=>!e),style:{padding:`2px 8px`,backgroundColor:n?`var(--vscode-button-background, #0e639c)`:`#333`,color:`#fff`,border:`none`,borderRadius:`2px`,cursor:`pointer`,fontSize:`11px`},children:n?`👁 Visual`:`</> Source`})]}),(0,u.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:`6px`},children:[!n&&(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(`button`,{onClick:()=>D(e=>Math.min(e*1.2,5)),title:`Zoom In`,style:{padding:`2px 6px`,background:`#333`,color:`#fff`,border:`none`,borderRadius:`2px`,cursor:`pointer`},children:`+`}),(0,u.jsx)(`button`,{onClick:()=>D(e=>Math.max(e*.8,.25)),title:`Zoom Out`,style:{padding:`2px 6px`,background:`#333`,color:`#fff`,border:`none`,borderRadius:`2px`,cursor:`pointer`},children:`-`}),(0,u.jsx)(`button`,{onClick:U,title:`Reset Viewport`,style:{padding:`2px 6px`,background:`#333`,color:`#fff`,border:`none`,borderRadius:`2px`,cursor:`pointer`},children:`⟲`}),(0,u.jsx)(`button`,{onClick:W,title:`Copy SVG Code`,style:{padding:`2px 8px`,background:`#333`,color:f===`svg`?`#89d185`:`#fff`,border:`none`,borderRadius:`2px`,cursor:`pointer`,fontSize:`11px`},children:f===`svg`?`✓ SVG Copied`:`📋 SVG`}),(0,u.jsx)(`button`,{onClick:G,title:`Download SVG File`,style:{padding:`2px 8px`,background:`#333`,color:`#fff`,border:`none`,borderRadius:`2px`,cursor:`pointer`,fontSize:`11px`},children:`⬇ SVG`}),(0,u.jsx)(`button`,{onClick:K,title:`Copy High-Res PNG (300 DPI) to Clipboard`,style:{padding:`2px 8px`,background:`#333`,color:f===`png`?`#89d185`:`#fff`,border:`none`,borderRadius:`2px`,cursor:`pointer`,fontSize:`11px`},children:f===`png`?`✓ PNG Copied`:`🖼 PNG`}),(0,u.jsx)(`button`,{onClick:q,title:`Download High-Res PNG (300 DPI)`,style:{padding:`2px 8px`,background:`#333`,color:`#fff`,border:`none`,borderRadius:`2px`,cursor:`pointer`,fontSize:`11px`},children:`⬇ PNG`})]}),(0,u.jsx)(`button`,{onClick:()=>h(e=>!e),title:m?`Exit Zen Mode (Esc)`:`Full-Page Zen Mode`,style:{padding:`2px 8px`,backgroundColor:m?`#b91c1c`:`#333`,color:`#fff`,border:`none`,borderRadius:`2px`,cursor:`pointer`,fontSize:`11px`},children:m?`✕ Exit Zen`:`⛶ Zen Mode`})]})]}),(0,u.jsx)(`div`,{ref:N,onMouseDown:z,onMouseMove:B,onMouseUp:V,onWheel:H,style:{flex:1,width:`100%`,height:`100%`,overflow:`hidden`,display:`flex`,alignItems:`center`,justifyContent:`center`,cursor:n?`default`:A?`grabbing`:`grab`,position:`relative`,backgroundColor:`#181818`,backgroundImage:n?`none`:`radial-gradient(circle, #252526 1px, transparent 1px)`,backgroundSize:`24px 24px`},children:n||J?(0,u.jsx)(`div`,{style:{width:`100%`,height:`100%`,overflow:`auto`,padding:`16px`,boxSizing:`border-box`},children:(0,u.jsx)(`pre`,{style:{margin:0,fontFamily:`var(--vscode-editor-font-family, monospace)`,fontSize:`12.5px`,lineHeight:1.6,color:`#d4d4d4`},children:(0,u.jsx)(`code`,{children:P})})}):T?(0,u.jsxs)(`div`,{className:`tikz-diagram-loading-skeleton`,style:{display:`flex`,flexDirection:`column`,alignItems:`center`,justifyContent:`center`,gap:`12px`,color:`#75beff`,userSelect:`none`},children:[(0,u.jsx)(`div`,{style:{fontSize:`24px`},children:`⚡`}),(0,u.jsx)(`div`,{style:{fontSize:`12px`,letterSpacing:`0.5px`,color:`#9cdcfe`},children:`Hydrating diagram source from VFS...`})]}):(0,u.jsx)(`div`,{style:{transform:`translate(${O.x}px, ${O.y}px) scale(${E})`,transformOrigin:`center center`,transition:A?`none`:`transform 0.08s ease-out`,display:`flex`,alignItems:`center`,justifyContent:`center`},dangerouslySetInnerHTML:{__html:L.svg}})})]})};export{d as TikzDiagramViewlet,d as default};
@@ -1 +1 @@
1
- import{i as e}from"./rolldown-runtime.Dd_uD5pT.js";import{a as t,i as n}from"./vendor-react.DpDU3q_x.js";import{n as r}from"./vfsHandles.B-nczBRy.js";import"./mcardVfs.Bj-RA0p7.js";import{i}from"./DockviewSpatialWorkbench.DyQjSoHd.js";var a=e(t(),1),o=n();function s(e){if(!e)return null;for(let t of[/(?:youtube\.com\/watch\?v=|youtu\.be\/|youtube\.com\/embed\/)([a-zA-Z0-9_-]{11})/,/youtube-nocookie\.com\/embed\/([a-zA-Z0-9_-]{11})/]){let n=e.match(t);if(n&&n[1])return n[1]}return null}var c=({mcard:e})=>{let t=(0,a.useRef)(null),[n,c]=(0,a.useState)(1),[l,u]=(0,a.useState)(!1),d=r(e.path,e.hash),f=typeof e.content==`string`?e.content:``,p=e.path||e.handle||``,[m,h]=(0,a.useState)(``);(0,a.useEffect)(()=>{(!f||f.startsWith(`Content-addressed MCard:`))&&d&&(e.path?.endsWith(`.txt`)||e.path?.endsWith(`.url`)||e.path?.includes(`youtube`))&&fetch(d).then(e=>e.text()).then(e=>h(e)).catch(()=>{})},[d,f,e.path]);let[g,_]=(0,a.useState)(null),v=s(f)||s(m)||s(p),y=g||v,b=typeof window<`u`&&window.location.origin?window.location.origin:`http://127.0.0.1:5320`,x=y?`https://www.youtube.com/embed/${y}?enablejsapi=1&origin=${encodeURIComponent(b)}&rel=0`:null,S=e=>{c(e),t.current&&(t.current.playbackRate=e)},C=e=>{t.current&&(t.current.currentTime=Math.max(0,t.current.currentTime+1/30*e))};return x?(0,o.jsxs)(`div`,{className:`card-panel-video-player`,style:{display:`flex`,flexDirection:`column`,width:`100%`,height:`100%`,backgroundColor:`#000000`,overflow:`hidden`,position:`relative`},children:[(0,o.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`,padding:`6px 12px`,backgroundColor:`rgba(25, 25, 25, 0.95)`,borderBottom:`1px solid #333333`,color:`#cccccc`,fontSize:`11px`,zIndex:10,flexWrap:`wrap`,gap:`6px`},children:[(0,o.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:`8px`},children:[(0,o.jsx)(`span`,{style:{color:`#ff0000`,fontWeight:700},children:`▶ YouTube`}),(0,o.jsxs)(`span`,{children:[`Video ID: `,(0,o.jsx)(`code`,{style:{color:`#75beff`},children:y})]}),g&&(0,o.jsx)(`button`,{onClick:()=>_(null),style:{fontSize:`10px`,padding:`1px 6px`,backgroundColor:`rgba(255, 255, 255, 0.1)`,color:`#aaa`,border:`1px solid #444`,borderRadius:`2px`,cursor:`pointer`},title:`Reset to card default`,children:`Reset`})]}),(0,o.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:`6px`},children:[(0,o.jsx)(`span`,{style:{fontSize:`10px`,color:`#888`},children:`Presets:`}),(0,o.jsx)(`button`,{onClick:()=>_(`M7lc1UVf-VE`),style:{fontSize:`10px`,padding:`2px 6px`,backgroundColor:y===`M7lc1UVf-VE`?`#0e639c`:`rgba(255, 255, 255, 0.06)`,color:`#ddd`,border:`1px solid #444`,borderRadius:`2px`,cursor:`pointer`},title:`Official YouTube IFrame Player Demo`,children:`Google Demo`}),(0,o.jsx)(`button`,{onClick:()=>_(`jNQXAC9IVRw`),style:{fontSize:`10px`,padding:`2px 6px`,backgroundColor:y===`jNQXAC9IVRw`?`#0e639c`:`rgba(255, 255, 255, 0.06)`,color:`#ddd`,border:`1px solid #444`,borderRadius:`2px`,cursor:`pointer`},title:`First YouTube Video (Me at the zoo)`,children:`Me at zoo`}),(0,o.jsx)(`button`,{onClick:()=>window.open(`https://www.youtube.com/watch?v=${y}`,`_blank`,`noopener,noreferrer`),style:{fontSize:`11px`,padding:`3px 8px`,backgroundColor:`transparent`,color:`#cccccc`,border:`1px solid #3c3c3c`,borderRadius:`2px`,cursor:`pointer`},children:`Watch on YouTube ↗`}),(0,o.jsx)(`button`,{onClick:()=>u(!0),style:{fontSize:`11px`,fontWeight:600,padding:`3px 10px`,backgroundColor:`var(--vscode-button-background, #0e639c)`,color:`#ffffff`,border:`none`,borderRadius:`2px`,cursor:`pointer`},children:`Zen Mode (Full-Page)`})]})]}),(0,o.jsx)(`div`,{style:{flex:1,width:`100%`,height:`100%`,position:`relative`},children:(0,o.jsx)(`iframe`,{src:x,title:e.name||`YouTube Player`,referrerPolicy:`strict-origin-when-cross-origin`,allow:`accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share`,allowFullScreen:!0,style:{width:`100%`,height:`100%`,border:`none`}})}),l&&(0,o.jsx)(i,{title:e.name||`YouTube Video`,src:x,onClose:()=>u(!1)})]}):(0,o.jsxs)(`div`,{className:`card-panel-video-player`,style:{display:`flex`,flexDirection:`column`,width:`100%`,height:`100%`,backgroundColor:`#000000`,overflow:`hidden`,position:`relative`},children:[(0,o.jsx)(`div`,{style:{flex:1,width:`100%`,height:`100%`,display:`flex`,alignItems:`center`,justifyContent:`center`,position:`relative`,overflow:`hidden`},children:(0,o.jsx)(`video`,{ref:t,src:d,controls:!0,style:{maxWidth:`100%`,maxHeight:`100%`,width:`100%`,height:`100%`,objectFit:`contain`}})}),(0,o.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`,padding:`6px 12px`,backgroundColor:`rgba(25, 25, 25, 0.95)`,borderTop:`1px solid #333333`,color:`#cccccc`,fontSize:`11px`,zIndex:5},children:[(0,o.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:`8px`},children:[(0,o.jsx)(`span`,{style:{fontWeight:600},children:`Frame Scrub:`}),(0,o.jsx)(`button`,{onClick:()=>C(-1),title:`Step Back 1 Frame`,style:{fontSize:`11px`,padding:`2px 6px`,backgroundColor:`rgba(255, 255, 255, 0.1)`,color:`#fff`,border:`1px solid #3c3c3c`,borderRadius:`2px`,cursor:`pointer`},children:`◀ 1F`}),(0,o.jsx)(`button`,{onClick:()=>C(1),title:`Step Forward 1 Frame`,style:{fontSize:`11px`,padding:`2px 6px`,backgroundColor:`rgba(255, 255, 255, 0.1)`,color:`#fff`,border:`1px solid #3c3c3c`,borderRadius:`2px`,cursor:`pointer`},children:`1F ▶`})]}),(0,o.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:`8px`},children:[(0,o.jsx)(`span`,{style:{fontWeight:600},children:`Speed:`}),[.5,1,1.5,2].map(e=>(0,o.jsxs)(`button`,{onClick:()=>S(e),style:{fontSize:`10px`,padding:`2px 5px`,backgroundColor:n===e?`var(--vscode-button-background, #0e639c)`:`transparent`,color:n===e?`#fff`:`#aaa`,border:`1px solid #3c3c3c`,borderRadius:`2px`,cursor:`pointer`},children:[e,`x`]},e)),(0,o.jsx)(`button`,{onClick:()=>u(!0),style:{fontSize:`10px`,padding:`2px 8px`,backgroundColor:`transparent`,color:`#75beff`,border:`1px solid rgba(117, 190, 255, 0.4)`,borderRadius:`2px`,cursor:`pointer`},children:`Zen Mode`})]})]}),l&&(0,o.jsx)(i,{title:e.name||`Video Player`,src:d,onClose:()=>u(!1)})]})};export{c as VideoPlayerViewlet,s as extractYouTubeId};
1
+ import{i as e}from"./rolldown-runtime.Dd_uD5pT.js";import{a as t,i as n}from"./vendor-react.DpDU3q_x.js";import{n as r}from"./vfsHandles.IX_wTpw_.js";import"./mcardVfs.2UOw9Z-r.js";import{i}from"./DockviewSpatialWorkbench.B_I1GJHw.js";var a=e(t(),1),o=n();function s(e){if(!e)return null;for(let t of[/(?:youtube\.com\/watch\?v=|youtu\.be\/|youtube\.com\/embed\/)([a-zA-Z0-9_-]{11})/,/youtube-nocookie\.com\/embed\/([a-zA-Z0-9_-]{11})/]){let n=e.match(t);if(n&&n[1])return n[1]}return null}var c=({mcard:e})=>{let t=(0,a.useRef)(null),[n,c]=(0,a.useState)(1),[l,u]=(0,a.useState)(!1),d=r(e.path,e.hash),f=typeof e.content==`string`?e.content:``,p=e.path||e.handle||``,[m,h]=(0,a.useState)(``);(0,a.useEffect)(()=>{(!f||f.startsWith(`Content-addressed MCard:`))&&d&&(e.path?.endsWith(`.txt`)||e.path?.endsWith(`.url`)||e.path?.includes(`youtube`))&&fetch(d).then(e=>e.text()).then(e=>h(e)).catch(()=>{})},[d,f,e.path]);let[g,_]=(0,a.useState)(null),v=s(f)||s(m)||s(p),y=g||v,b=typeof window<`u`&&window.location.origin?window.location.origin:`http://127.0.0.1:5320`,x=y?`https://www.youtube.com/embed/${y}?enablejsapi=1&origin=${encodeURIComponent(b)}&rel=0`:null,S=e=>{c(e),t.current&&(t.current.playbackRate=e)},C=e=>{t.current&&(t.current.currentTime=Math.max(0,t.current.currentTime+1/30*e))};return x?(0,o.jsxs)(`div`,{className:`card-panel-video-player`,style:{display:`flex`,flexDirection:`column`,width:`100%`,height:`100%`,backgroundColor:`#000000`,overflow:`hidden`,position:`relative`},children:[(0,o.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`,padding:`6px 12px`,backgroundColor:`rgba(25, 25, 25, 0.95)`,borderBottom:`1px solid #333333`,color:`#cccccc`,fontSize:`11px`,zIndex:10,flexWrap:`wrap`,gap:`6px`},children:[(0,o.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:`8px`},children:[(0,o.jsx)(`span`,{style:{color:`#ff0000`,fontWeight:700},children:`▶ YouTube`}),(0,o.jsxs)(`span`,{children:[`Video ID: `,(0,o.jsx)(`code`,{style:{color:`#75beff`},children:y})]}),g&&(0,o.jsx)(`button`,{onClick:()=>_(null),style:{fontSize:`10px`,padding:`1px 6px`,backgroundColor:`rgba(255, 255, 255, 0.1)`,color:`#aaa`,border:`1px solid #444`,borderRadius:`2px`,cursor:`pointer`},title:`Reset to card default`,children:`Reset`})]}),(0,o.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:`6px`},children:[(0,o.jsx)(`span`,{style:{fontSize:`10px`,color:`#888`},children:`Presets:`}),(0,o.jsx)(`button`,{onClick:()=>_(`M7lc1UVf-VE`),style:{fontSize:`10px`,padding:`2px 6px`,backgroundColor:y===`M7lc1UVf-VE`?`#0e639c`:`rgba(255, 255, 255, 0.06)`,color:`#ddd`,border:`1px solid #444`,borderRadius:`2px`,cursor:`pointer`},title:`Official YouTube IFrame Player Demo`,children:`Google Demo`}),(0,o.jsx)(`button`,{onClick:()=>_(`jNQXAC9IVRw`),style:{fontSize:`10px`,padding:`2px 6px`,backgroundColor:y===`jNQXAC9IVRw`?`#0e639c`:`rgba(255, 255, 255, 0.06)`,color:`#ddd`,border:`1px solid #444`,borderRadius:`2px`,cursor:`pointer`},title:`First YouTube Video (Me at the zoo)`,children:`Me at zoo`}),(0,o.jsx)(`button`,{onClick:()=>window.open(`https://www.youtube.com/watch?v=${y}`,`_blank`,`noopener,noreferrer`),style:{fontSize:`11px`,padding:`3px 8px`,backgroundColor:`transparent`,color:`#cccccc`,border:`1px solid #3c3c3c`,borderRadius:`2px`,cursor:`pointer`},children:`Watch on YouTube ↗`}),(0,o.jsx)(`button`,{onClick:()=>u(!0),style:{fontSize:`11px`,fontWeight:600,padding:`3px 10px`,backgroundColor:`var(--vscode-button-background, #0e639c)`,color:`#ffffff`,border:`none`,borderRadius:`2px`,cursor:`pointer`},children:`Zen Mode (Full-Page)`})]})]}),(0,o.jsx)(`div`,{style:{flex:1,width:`100%`,height:`100%`,position:`relative`},children:(0,o.jsx)(`iframe`,{src:x,title:e.name||`YouTube Player`,referrerPolicy:`strict-origin-when-cross-origin`,allow:`accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share`,allowFullScreen:!0,style:{width:`100%`,height:`100%`,border:`none`}})}),l&&(0,o.jsx)(i,{title:e.name||`YouTube Video`,src:x,onClose:()=>u(!1)})]}):(0,o.jsxs)(`div`,{className:`card-panel-video-player`,style:{display:`flex`,flexDirection:`column`,width:`100%`,height:`100%`,backgroundColor:`#000000`,overflow:`hidden`,position:`relative`},children:[(0,o.jsx)(`div`,{style:{flex:1,width:`100%`,height:`100%`,display:`flex`,alignItems:`center`,justifyContent:`center`,position:`relative`,overflow:`hidden`},children:(0,o.jsx)(`video`,{ref:t,src:d,controls:!0,style:{maxWidth:`100%`,maxHeight:`100%`,width:`100%`,height:`100%`,objectFit:`contain`}})}),(0,o.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`,padding:`6px 12px`,backgroundColor:`rgba(25, 25, 25, 0.95)`,borderTop:`1px solid #333333`,color:`#cccccc`,fontSize:`11px`,zIndex:5},children:[(0,o.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:`8px`},children:[(0,o.jsx)(`span`,{style:{fontWeight:600},children:`Frame Scrub:`}),(0,o.jsx)(`button`,{onClick:()=>C(-1),title:`Step Back 1 Frame`,style:{fontSize:`11px`,padding:`2px 6px`,backgroundColor:`rgba(255, 255, 255, 0.1)`,color:`#fff`,border:`1px solid #3c3c3c`,borderRadius:`2px`,cursor:`pointer`},children:`◀ 1F`}),(0,o.jsx)(`button`,{onClick:()=>C(1),title:`Step Forward 1 Frame`,style:{fontSize:`11px`,padding:`2px 6px`,backgroundColor:`rgba(255, 255, 255, 0.1)`,color:`#fff`,border:`1px solid #3c3c3c`,borderRadius:`2px`,cursor:`pointer`},children:`1F ▶`})]}),(0,o.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:`8px`},children:[(0,o.jsx)(`span`,{style:{fontWeight:600},children:`Speed:`}),[.5,1,1.5,2].map(e=>(0,o.jsxs)(`button`,{onClick:()=>S(e),style:{fontSize:`10px`,padding:`2px 5px`,backgroundColor:n===e?`var(--vscode-button-background, #0e639c)`:`transparent`,color:n===e?`#fff`:`#aaa`,border:`1px solid #3c3c3c`,borderRadius:`2px`,cursor:`pointer`},children:[e,`x`]},e)),(0,o.jsx)(`button`,{onClick:()=>u(!0),style:{fontSize:`10px`,padding:`2px 8px`,backgroundColor:`transparent`,color:`#75beff`,border:`1px solid rgba(117, 190, 255, 0.4)`,borderRadius:`2px`,cursor:`pointer`},children:`Zen Mode`})]})]}),l&&(0,o.jsx)(i,{title:e.name||`Video Player`,src:d,onClose:()=>u(!1)})]})};export{c as VideoPlayerViewlet,s as extractYouTubeId};
@@ -1 +1 @@
1
- import{i as e}from"./rolldown-runtime.Dd_uD5pT.js";import{a as t,i as n}from"./vendor-react.DpDU3q_x.js";import{r}from"./pathsConfig.D0hV34p7.js";import{t as i}from"./webappUrlResolver.BdblM2xU.js";import{i as a,n as o,r as s}from"./DockviewSpatialWorkbench.DyQjSoHd.js";var c=e(t(),1),l=n(),u=({useProxy:e,isAdvisoryDismissed:t,setIsAdvisoryDismissed:n,targetUrl:r})=>!e||t?null:(0,l.jsxs)(`div`,{className:`webapp-proxy-advisory-banner`,style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`,padding:`7px 14px`,backgroundColor:`rgba(217, 119, 6, 0.15)`,borderBottom:`1px solid rgba(245, 158, 11, 0.35)`,color:`#fef3c7`,fontSize:`11px`,gap:`12px`,flexShrink:0,zIndex:9,lineHeight:`1.4`},children:[(0,l.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:`8px`,minWidth:0},children:[(0,l.jsx)(`span`,{style:{fontSize:`15px`,flexShrink:0},children:`⚠️`}),(0,l.jsxs)(`div`,{style:{overflow:`hidden`},children:[(0,l.jsx)(`span`,{style:{fontWeight:600,color:`#f59e0b`,marginRight:`6px`},children:`Proxy Active: Incomplete website or missing styles?`}),(0,l.jsxs)(`span`,{style:{opacity:.9},children:[`Complex webapps often restrict subresources, fonts, or scripts when embedded. Use the `,(0,l.jsx)(`strong`,{children:`Tab`}),` feature for the full interactive website.`]})]})]}),(0,l.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:`8px`,flexShrink:0},children:[(0,l.jsx)(`button`,{onClick:()=>window.open(r,`_blank`,`noopener,noreferrer`),style:{display:`inline-flex`,alignItems:`center`,gap:`5px`,backgroundColor:`#d97706`,color:`#ffffff`,border:`none`,borderRadius:`3px`,padding:`4px 10px`,fontSize:`11px`,fontWeight:600,cursor:`pointer`,boxShadow:`0 1px 4px rgba(0,0,0,0.3)`,whiteSpace:`nowrap`},title:`Open full site in external browser tab`,children:(0,l.jsx)(`span`,{children:`↗ Open in Tab`})}),(0,l.jsx)(`button`,{onClick:()=>n(!0),style:{backgroundColor:`transparent`,border:`none`,color:`#9ca3af`,cursor:`pointer`,fontSize:`13px`,padding:`2px 4px`,lineHeight:1},title:`Dismiss notice`,children:`✕`})]})]}),d=({appName:e,viewportStyles:t,probeData:n,forceDirectEmbed:r,setForceDirectEmbed:i,targetUrl:a,activeSrc:o,useProxy:c,setUseProxy:u,isLoading:d,setIsLoading:f,hasShieldError:p,setHasShieldError:m,iframeKey:h})=>(0,l.jsxs)(`div`,{style:{flex:1,width:`100%`,height:`100%`,position:`relative`,backgroundColor:`#121212`,overflow:`auto`,display:`flex`,justifyContent:`center`,alignItems:`center`},children:[d&&!(n?.shouldBlockEmbed&&!c&&!r)&&(0,l.jsxs)(`div`,{style:{position:`absolute`,top:`12px`,right:`12px`,zIndex:5,backgroundColor:`rgba(0, 0, 0, 0.75)`,padding:`4px 10px`,borderRadius:`12px`,display:`flex`,alignItems:`center`,gap:`6px`,color:`#75beff`,fontSize:`11px`,pointerEvents:`none`,backdropFilter:`blur(4px)`},children:[(0,l.jsx)(`span`,{style:{display:`inline-block`,animation:`spin 1s linear infinite`},children:`⏳`}),(0,l.jsx)(`span`,{children:`Loading App...`})]}),(0,l.jsx)(`div`,{style:t,children:n?.shouldBlockEmbed&&!c&&!r?(0,l.jsx)(s,{url:n.finalUrl||a,name:e||`WebApp MCard`,reason:n.reason,status:n.status,xFrameOptions:n.xFrameOptions,onUseProxy:()=>{u(!0),f(!0)},onForceEmbed:()=>{i(!0),f(!0)}}):p?(0,l.jsx)(s,{url:a,name:e||`WebApp MCard`,reason:`The browser or remote server blocked inline embedding of this resource.`,status:n?.status||403,xFrameOptions:n?.xFrameOptions,onUseProxy:()=>{u(!0),m(!1),f(!0)},onForceEmbed:()=>{i(!0),m(!1)}}):(0,l.jsx)(`iframe`,{src:o,title:e||`WebApp MCard`,sandbox:`allow-scripts allow-same-origin allow-forms allow-popups allow-downloads`,onLoad:()=>f(!1),onError:()=>{f(!1),m(!0)},style:{width:`100%`,height:`100%`,border:`none`,backgroundColor:`#ffffff`,display:`block`}},h)}),c&&(0,l.jsxs)(`div`,{className:`webapp-floating-tab-helper`,style:{position:`absolute`,bottom:`16px`,right:`20px`,zIndex:15,display:`flex`,alignItems:`center`,gap:`8px`,backgroundColor:`rgba(24, 24, 27, 0.92)`,border:`1px solid rgba(245, 158, 11, 0.5)`,borderRadius:`16px`,padding:`5px 12px`,boxShadow:`0 4px 16px rgba(0, 0, 0, 0.6)`,backdropFilter:`blur(6px)`,fontSize:`11px`,color:`#fef3c7`},children:[(0,l.jsx)(`span`,{style:{fontSize:`13px`},children:`⚠️`}),(0,l.jsx)(`span`,{style:{opacity:.9},children:`Website unstyled or incomplete?`}),(0,l.jsx)(`button`,{onClick:()=>window.open(a,`_blank`,`noopener,noreferrer`),style:{backgroundColor:`#d97706`,color:`#ffffff`,border:`none`,borderRadius:`10px`,padding:`2px 8px`,fontSize:`10px`,fontWeight:600,cursor:`pointer`,display:`inline-flex`,alignItems:`center`,gap:`3px`},title:`Open complete website in external tab`,children:(0,l.jsx)(`span`,{children:`↗ Use Tab`})})]})]});function f(e){let[t,n]=(0,c.useState)(!1),[i,a]=(0,c.useState)(!1),[o,s]=(0,c.useState)(!1),[l,u]=(0,c.useState)(null),[d,f]=(0,c.useState)(!1),[p,m]=(0,c.useState)(!1);return(0,c.useEffect)(()=>{n(!1),a(!1),s(!1),u(null),f(!1);let t=!0;return m(!0),fetch(`${r(`vfs_probe`)}?url=${encodeURIComponent(e)}`).then(e=>{if(!e.ok)throw Error(`Probe failed with status ${e.status}`);return e.json()}).then(e=>{t&&(u(e),m(!1))}).catch(e=>{t&&(m(!1),console.warn(`URL security probe failed:`,e))}),()=>{t=!1}},[e]),{probeData:l,isProbing:p,useProxy:t,setUseProxy:n,hasShieldError:i,setHasShieldError:a,isAdvisoryDismissed:o,setIsAdvisoryDismissed:s,forceDirectEmbed:d,setForceDirectEmbed:f,activeSrc:(0,c.useMemo)(()=>t?`${r(`vfs_proxy`)}?url=${encodeURIComponent(e)}`:e,[e,t])}}function p(){let e=(0,c.useRef)(null),t=(0,c.useRef)(null);return(0,c.useEffect)(()=>()=>{t.current!==null&&(cancelAnimationFrame(t.current),t.current=null),e.current&&e.current.state!==`closed`&&(e.current.close().catch(e=>{console.warn(`[useZenAudioTeardown] AudioContext close error:`,e)}),e.current=null)},[]),{audioContextRef:e,animationFrameRef:t}}var m=({mcard:e})=>{let[t,n]=(0,c.useState)(!1),[r,s]=(0,c.useState)(`desktop`),[m,h]=(0,c.useState)(!0),[g,_]=(0,c.useState)(0),[v,y]=(0,c.useState)(!1);p();let b=(0,c.useMemo)(()=>i(e.content,e.path,e.name),[e.content,e.path,e.name]),{probeData:x,useProxy:S,setUseProxy:C,hasShieldError:w,setHasShieldError:T,isAdvisoryDismissed:E,setIsAdvisoryDismissed:D,forceDirectEmbed:O,setForceDirectEmbed:k,activeSrc:A}=f(b);c.useEffect(()=>{let e=e=>{(e.detail?.useProxy||x?.shouldBlockEmbed)&&C(!0)};return window.addEventListener(`clm:fullscreen-split-requested`,e),()=>{window.removeEventListener(`clm:fullscreen-split-requested`,e)}},[x?.shouldBlockEmbed,C]);let j=async()=>{try{await navigator.clipboard.writeText(b),y(!0),setTimeout(()=>y(!1),2e3)}catch{}},M=()=>{h(!0),_(e=>e+1)},N=(0,c.useMemo)(()=>{switch(r){case`tablet`:return{width:`768px`,maxWidth:`100%`,height:`100%`,margin:`0 auto`,boxShadow:`0 0 24px rgba(0, 0, 0, 0.6)`,borderLeft:`1px solid #3c3c3c`,borderRight:`1px solid #3c3c3c`};case`mobile`:return{width:`375px`,maxWidth:`100%`,height:`100%`,margin:`0 auto`,boxShadow:`0 0 28px rgba(0, 0, 0, 0.7)`,borderLeft:`1px solid #3c3c3c`,borderRight:`1px solid #3c3c3c`};default:return{width:`100%`,height:`100%`}}},[r]);return(0,l.jsxs)(`div`,{className:`webapp-zen-viewlet`,style:{display:`flex`,flexDirection:`column`,height:`100%`,width:`100%`,backgroundColor:`#181818`,color:`#cccccc`,position:`relative`,overflow:`hidden`},children:[(0,l.jsx)(o,{appName:e.name,forceDirectEmbed:O,targetUrl:b,activeSrc:A,useProxy:S,setUseProxy:C,viewportMode:r,setViewportMode:s,isLoading:m,setIsLoading:h,copied:v,handleReload:M,handleCopyUrl:j,setIsZenOpen:n,probeData:x,hasShieldError:w}),(0,l.jsx)(u,{useProxy:S,isAdvisoryDismissed:E,setIsAdvisoryDismissed:D,targetUrl:b}),(0,l.jsx)(d,{appName:e.name,viewportStyles:N,probeData:x,forceDirectEmbed:O,setForceDirectEmbed:k,targetUrl:b,activeSrc:A,useProxy:S,setUseProxy:C,isLoading:m,setIsLoading:h,hasShieldError:w,setHasShieldError:T,iframeKey:g}),t&&(0,l.jsx)(a,{onClose:()=>n(!1),src:A,title:e.name||`Webapp Zen View`})]})},h=m;export{m as WebappZenViewlet,h as default};
1
+ import{i as e}from"./rolldown-runtime.Dd_uD5pT.js";import{a as t,i as n}from"./vendor-react.DpDU3q_x.js";import{r}from"./pathsConfig.D0hV34p7.js";import{t as i}from"./webappUrlResolver.BdblM2xU.js";import{i as a,n as o,r as s}from"./DockviewSpatialWorkbench.B_I1GJHw.js";var c=e(t(),1),l=n(),u=({useProxy:e,isAdvisoryDismissed:t,setIsAdvisoryDismissed:n,targetUrl:r})=>!e||t?null:(0,l.jsxs)(`div`,{className:`webapp-proxy-advisory-banner`,style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`,padding:`7px 14px`,backgroundColor:`rgba(217, 119, 6, 0.15)`,borderBottom:`1px solid rgba(245, 158, 11, 0.35)`,color:`#fef3c7`,fontSize:`11px`,gap:`12px`,flexShrink:0,zIndex:9,lineHeight:`1.4`},children:[(0,l.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:`8px`,minWidth:0},children:[(0,l.jsx)(`span`,{style:{fontSize:`15px`,flexShrink:0},children:`⚠️`}),(0,l.jsxs)(`div`,{style:{overflow:`hidden`},children:[(0,l.jsx)(`span`,{style:{fontWeight:600,color:`#f59e0b`,marginRight:`6px`},children:`Proxy Active: Incomplete website or missing styles?`}),(0,l.jsxs)(`span`,{style:{opacity:.9},children:[`Complex webapps often restrict subresources, fonts, or scripts when embedded. Use the `,(0,l.jsx)(`strong`,{children:`Tab`}),` feature for the full interactive website.`]})]})]}),(0,l.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:`8px`,flexShrink:0},children:[(0,l.jsx)(`button`,{onClick:()=>window.open(r,`_blank`,`noopener,noreferrer`),style:{display:`inline-flex`,alignItems:`center`,gap:`5px`,backgroundColor:`#d97706`,color:`#ffffff`,border:`none`,borderRadius:`3px`,padding:`4px 10px`,fontSize:`11px`,fontWeight:600,cursor:`pointer`,boxShadow:`0 1px 4px rgba(0,0,0,0.3)`,whiteSpace:`nowrap`},title:`Open full site in external browser tab`,children:(0,l.jsx)(`span`,{children:`↗ Open in Tab`})}),(0,l.jsx)(`button`,{onClick:()=>n(!0),style:{backgroundColor:`transparent`,border:`none`,color:`#9ca3af`,cursor:`pointer`,fontSize:`13px`,padding:`2px 4px`,lineHeight:1},title:`Dismiss notice`,children:`✕`})]})]}),d=({appName:e,viewportStyles:t,probeData:n,forceDirectEmbed:r,setForceDirectEmbed:i,targetUrl:a,activeSrc:o,useProxy:c,setUseProxy:u,isLoading:d,setIsLoading:f,hasShieldError:p,setHasShieldError:m,iframeKey:h})=>(0,l.jsxs)(`div`,{style:{flex:1,width:`100%`,height:`100%`,position:`relative`,backgroundColor:`#121212`,overflow:`auto`,display:`flex`,justifyContent:`center`,alignItems:`center`},children:[d&&!(n?.shouldBlockEmbed&&!c&&!r)&&(0,l.jsxs)(`div`,{style:{position:`absolute`,top:`12px`,right:`12px`,zIndex:5,backgroundColor:`rgba(0, 0, 0, 0.75)`,padding:`4px 10px`,borderRadius:`12px`,display:`flex`,alignItems:`center`,gap:`6px`,color:`#75beff`,fontSize:`11px`,pointerEvents:`none`,backdropFilter:`blur(4px)`},children:[(0,l.jsx)(`span`,{style:{display:`inline-block`,animation:`spin 1s linear infinite`},children:`⏳`}),(0,l.jsx)(`span`,{children:`Loading App...`})]}),(0,l.jsx)(`div`,{style:t,children:n?.shouldBlockEmbed&&!c&&!r?(0,l.jsx)(s,{url:n.finalUrl||a,name:e||`WebApp MCard`,reason:n.reason,status:n.status,xFrameOptions:n.xFrameOptions,onUseProxy:()=>{u(!0),f(!0)},onForceEmbed:()=>{i(!0),f(!0)}}):p?(0,l.jsx)(s,{url:a,name:e||`WebApp MCard`,reason:`The browser or remote server blocked inline embedding of this resource.`,status:n?.status||403,xFrameOptions:n?.xFrameOptions,onUseProxy:()=>{u(!0),m(!1),f(!0)},onForceEmbed:()=>{i(!0),m(!1)}}):(0,l.jsx)(`iframe`,{src:o,title:e||`WebApp MCard`,sandbox:`allow-scripts allow-same-origin allow-forms allow-popups allow-downloads`,onLoad:()=>f(!1),onError:()=>{f(!1),m(!0)},style:{width:`100%`,height:`100%`,border:`none`,backgroundColor:`#ffffff`,display:`block`}},h)}),c&&(0,l.jsxs)(`div`,{className:`webapp-floating-tab-helper`,style:{position:`absolute`,bottom:`16px`,right:`20px`,zIndex:15,display:`flex`,alignItems:`center`,gap:`8px`,backgroundColor:`rgba(24, 24, 27, 0.92)`,border:`1px solid rgba(245, 158, 11, 0.5)`,borderRadius:`16px`,padding:`5px 12px`,boxShadow:`0 4px 16px rgba(0, 0, 0, 0.6)`,backdropFilter:`blur(6px)`,fontSize:`11px`,color:`#fef3c7`},children:[(0,l.jsx)(`span`,{style:{fontSize:`13px`},children:`⚠️`}),(0,l.jsx)(`span`,{style:{opacity:.9},children:`Website unstyled or incomplete?`}),(0,l.jsx)(`button`,{onClick:()=>window.open(a,`_blank`,`noopener,noreferrer`),style:{backgroundColor:`#d97706`,color:`#ffffff`,border:`none`,borderRadius:`10px`,padding:`2px 8px`,fontSize:`10px`,fontWeight:600,cursor:`pointer`,display:`inline-flex`,alignItems:`center`,gap:`3px`},title:`Open complete website in external tab`,children:(0,l.jsx)(`span`,{children:`↗ Use Tab`})})]})]});function f(e){let[t,n]=(0,c.useState)(!1),[i,a]=(0,c.useState)(!1),[o,s]=(0,c.useState)(!1),[l,u]=(0,c.useState)(null),[d,f]=(0,c.useState)(!1),[p,m]=(0,c.useState)(!1);return(0,c.useEffect)(()=>{n(!1),a(!1),s(!1),u(null),f(!1);let t=!0;return m(!0),fetch(`${r(`vfs_probe`)}?url=${encodeURIComponent(e)}`).then(e=>{if(!e.ok)throw Error(`Probe failed with status ${e.status}`);return e.json()}).then(e=>{t&&(u(e),m(!1))}).catch(e=>{t&&(m(!1),console.warn(`URL security probe failed:`,e))}),()=>{t=!1}},[e]),{probeData:l,isProbing:p,useProxy:t,setUseProxy:n,hasShieldError:i,setHasShieldError:a,isAdvisoryDismissed:o,setIsAdvisoryDismissed:s,forceDirectEmbed:d,setForceDirectEmbed:f,activeSrc:(0,c.useMemo)(()=>t?`${r(`vfs_proxy`)}?url=${encodeURIComponent(e)}`:e,[e,t])}}function p(){let e=(0,c.useRef)(null),t=(0,c.useRef)(null);return(0,c.useEffect)(()=>()=>{t.current!==null&&(cancelAnimationFrame(t.current),t.current=null),e.current&&e.current.state!==`closed`&&(e.current.close().catch(e=>{console.warn(`[useZenAudioTeardown] AudioContext close error:`,e)}),e.current=null)},[]),{audioContextRef:e,animationFrameRef:t}}var m=({mcard:e})=>{let[t,n]=(0,c.useState)(!1),[r,s]=(0,c.useState)(`desktop`),[m,h]=(0,c.useState)(!0),[g,_]=(0,c.useState)(0),[v,y]=(0,c.useState)(!1);p();let b=(0,c.useMemo)(()=>i(e.content,e.path,e.name),[e.content,e.path,e.name]),{probeData:x,useProxy:S,setUseProxy:C,hasShieldError:w,setHasShieldError:T,isAdvisoryDismissed:E,setIsAdvisoryDismissed:D,forceDirectEmbed:O,setForceDirectEmbed:k,activeSrc:A}=f(b);c.useEffect(()=>{let e=e=>{(e.detail?.useProxy||x?.shouldBlockEmbed)&&C(!0)};return window.addEventListener(`clm:fullscreen-split-requested`,e),()=>{window.removeEventListener(`clm:fullscreen-split-requested`,e)}},[x?.shouldBlockEmbed,C]);let j=async()=>{try{await navigator.clipboard.writeText(b),y(!0),setTimeout(()=>y(!1),2e3)}catch{}},M=()=>{h(!0),_(e=>e+1)},N=(0,c.useMemo)(()=>{switch(r){case`tablet`:return{width:`768px`,maxWidth:`100%`,height:`100%`,margin:`0 auto`,boxShadow:`0 0 24px rgba(0, 0, 0, 0.6)`,borderLeft:`1px solid #3c3c3c`,borderRight:`1px solid #3c3c3c`};case`mobile`:return{width:`375px`,maxWidth:`100%`,height:`100%`,margin:`0 auto`,boxShadow:`0 0 28px rgba(0, 0, 0, 0.7)`,borderLeft:`1px solid #3c3c3c`,borderRight:`1px solid #3c3c3c`};default:return{width:`100%`,height:`100%`}}},[r]);return(0,l.jsxs)(`div`,{className:`webapp-zen-viewlet`,style:{display:`flex`,flexDirection:`column`,height:`100%`,width:`100%`,backgroundColor:`#181818`,color:`#cccccc`,position:`relative`,overflow:`hidden`},children:[(0,l.jsx)(o,{appName:e.name,forceDirectEmbed:O,targetUrl:b,activeSrc:A,useProxy:S,setUseProxy:C,viewportMode:r,setViewportMode:s,isLoading:m,setIsLoading:h,copied:v,handleReload:M,handleCopyUrl:j,setIsZenOpen:n,probeData:x,hasShieldError:w}),(0,l.jsx)(u,{useProxy:S,isAdvisoryDismissed:E,setIsAdvisoryDismissed:D,targetUrl:b}),(0,l.jsx)(d,{appName:e.name,viewportStyles:N,probeData:x,forceDirectEmbed:O,setForceDirectEmbed:k,targetUrl:b,activeSrc:A,useProxy:S,setUseProxy:C,isLoading:m,setIsLoading:h,hasShieldError:w,setHasShieldError:T,iframeKey:g}),t&&(0,l.jsx)(a,{onClose:()=>n(!1),src:A,title:e.name||`Webapp Zen View`})]})},h=m;export{m as WebappZenViewlet,h as default};
@@ -1 +1 @@
1
- import"./rolldown-runtime.Dd_uD5pT.js";import{a as e,i as t}from"./vendor-react.DpDU3q_x.js";import{O as n,d as r,g as i,h as a,n as o,t as s,v as c,y as l}from"./mcardStore.BiAvqM-D.js";import{r as u}from"./disposable.66apX1Q2.js";import{t as d}from"./secureWindowOrchestrator.CIQYcH4l.js";e();var f=t(),p=({onEnterWorkbench:e,onSelectFirstExemplar:t})=>(0,f.jsxs)(`div`,{style:{padding:`32px 36px`,backgroundColor:`rgba(255, 255, 255, 0.02)`,border:`1px solid rgba(255, 255, 255, 0.08)`,borderRadius:`8px`,boxShadow:`0 8px 32px rgba(0, 0, 0, 0.4)`,textAlign:`left`},children:[(0,f.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:`12px`,marginBottom:`10px`,flexWrap:`wrap`},children:[(0,f.jsx)(`span`,{style:{fontSize:`28px`,color:`#75beff`},children:`◫`}),(0,f.jsxs)(`div`,{children:[(0,f.jsx)(`h1`,{style:{margin:0,fontSize:`24px`,fontWeight:600,color:`#ffffff`,letterSpacing:`-0.4px`},children:`Personal Knowledge Container (PKC)`}),(0,f.jsx)(`div`,{style:{fontSize:`13px`,color:`#75beff`,fontWeight:500,marginTop:`2px`},children:`Cubical Logic Model (CLM) • Sovereign Studio Workbench`})]}),(0,f.jsxs)(`div`,{style:{display:`flex`,gap:`8px`,marginLeft:`auto`},children:[(0,f.jsx)(`span`,{style:{fontSize:`10px`,fontWeight:700,padding:`3px 8px`,borderRadius:`10px`,backgroundColor:`rgba(14, 99, 156, 0.25)`,color:`#75beff`,border:`1px solid rgba(14, 99, 156, 0.5)`,textTransform:`uppercase`,letterSpacing:`0.5px`},children:`Level 1 Enclave`}),(0,f.jsx)(`span`,{style:{fontSize:`10px`,fontWeight:700,padding:`3px 8px`,borderRadius:`10px`,backgroundColor:`rgba(137, 209, 133, 0.15)`,color:`#89d185`,border:`1px solid rgba(137, 209, 133, 0.4)`,textTransform:`uppercase`,letterSpacing:`0.5px`},children:`Zero-Trust CAS`})]})]}),(0,f.jsxs)(`p`,{style:{margin:`12px 0 18px 0`,fontSize:`14px`,lineHeight:`1.6`,color:`var(--vscode-descriptionForeground, #a0a0a0)`,maxWidth:`820px`},children:[`A `,(0,f.jsx)(`strong`,{children:`Personal Knowledge Container (PKC)`}),` is an autonomous, decentralized cognitive substrate composed of interconnected `,(0,f.jsx)(`strong`,{children:`Computational Service Nodes`}),` and`,` `,(0,f.jsx)(`strong`,{children:`Storage Service Nodes`}),`. The container guarantees cryptographic provenance, local execution autonomy, and zero-trust verification across three foundational functional pillars: the `,(0,f.jsx)(`strong`,{children:`Cubical Logic Model (CLM)`}),`, the `,(0,f.jsx)(`strong`,{children:`Polynomial Type Runtime (PTR)`}),`, and `,(0,f.jsx)(`strong`,{children:`MCard Content-Addressed Storage (CAS & VFS)`}),`.`]}),(0,f.jsxs)(`div`,{style:{display:`flex`,gap:`12px`,alignItems:`center`,flexWrap:`wrap`},children:[(0,f.jsxs)(`button`,{type:`button`,"data-action":`launch-dockview-workbench`,"data-testid":`restore-dockview-btn`,onClick:e,style:{display:`inline-flex`,alignItems:`center`,gap:`8px`,padding:`9px 20px`,backgroundColor:`var(--vscode-button-background, #0e639c)`,color:`var(--vscode-button-foreground, #ffffff)`,border:`none`,borderRadius:`4px`,cursor:`pointer`,fontSize:`13px`,fontWeight:600,transition:`background-color 0.15s ease`},onMouseEnter:e=>e.currentTarget.style.backgroundColor=`var(--vscode-button-hoverBackground, #1177bb)`,onMouseLeave:e=>e.currentTarget.style.backgroundColor=`var(--vscode-button-background, #0e639c)`,children:[(0,f.jsx)(`span`,{children:`Enter DockView Spatial Workbench`}),(0,f.jsx)(`span`,{style:{fontSize:`11px`,opacity:.85},children:`→`})]}),(0,f.jsx)(`button`,{type:`button`,"data-action":`browse-seed-exemplars`,onClick:t,style:{display:`inline-flex`,alignItems:`center`,gap:`8px`,padding:`9px 18px`,backgroundColor:`rgba(255, 255, 255, 0.05)`,color:`#ffffff`,border:`1px solid rgba(255, 255, 255, 0.15)`,borderRadius:`4px`,cursor:`pointer`,fontSize:`13px`,fontWeight:500,transition:`all 0.15s ease`},onMouseEnter:e=>{e.currentTarget.style.backgroundColor=`rgba(255, 255, 255, 0.1)`},onMouseLeave:e=>{e.currentTarget.style.backgroundColor=`rgba(255, 255, 255, 0.05)`},children:(0,f.jsx)(`span`,{children:`Explore Exemplar Seeds`})}),(0,f.jsx)(`span`,{style:{fontSize:`12px`,color:`#6b7280`,marginLeft:`auto`},children:`Select any node, dimension, or exemplar below to elevate into DockView`})]})]}),m=({cardCount:e,storageBackendType:t=`IndexedDB/VFS`,peerMesh:n={},onSelectDimension:r})=>(0,f.jsxs)(`div`,{style:{padding:`24px 28px`,backgroundColor:`rgba(255, 255, 255, 0.02)`,border:`1px solid rgba(255, 255, 255, 0.08)`,borderRadius:`8px`},children:[(0,f.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`,marginBottom:`16px`,flexWrap:`wrap`,gap:`8px`},children:[(0,f.jsxs)(`div`,{children:[(0,f.jsx)(`div`,{style:{fontSize:`12px`,fontWeight:700,textTransform:`uppercase`,color:`#ffffff`,letterSpacing:`0.6px`},children:`PKC Service Nodes Architecture`}),(0,f.jsx)(`div`,{style:{fontSize:`12px`,color:`#9ca3af`,marginTop:`2px`},children:`Decentralized topology distributing state storage and algorithmic execution`})]}),(0,f.jsxs)(`span`,{style:{fontSize:`11px`,color:`#89d185`,display:`flex`,alignItems:`center`,gap:`6px`,backgroundColor:`rgba(137, 209, 133, 0.1)`,padding:`4px 10px`,borderRadius:`4px`,border:`1px solid rgba(137, 209, 133, 0.25)`},children:[(0,f.jsx)(`span`,{children:`●`}),(0,f.jsxs)(`span`,{children:[`Mesh Fabric: `,n.online?`${n.peerCount??0} Remote Peers`:`Local Substrate Active`]})]})]}),(0,f.jsxs)(`div`,{style:{display:`grid`,gridTemplateColumns:`repeat(auto-fit, minmax(360px, 1fr))`,gap:`16px`},children:[(0,f.jsxs)(`div`,{style:{padding:`18px 20px`,backgroundColor:`rgba(255, 255, 255, 0.025)`,border:`1px solid rgba(14, 99, 156, 0.3)`,borderRadius:`6px`,display:`flex`,flexDirection:`column`,gap:`12px`},children:[(0,f.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`},children:[(0,f.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:`8px`},children:[(0,f.jsx)(`span`,{style:{fontSize:`18px`},children:`🗄️`}),(0,f.jsx)(`span`,{style:{fontSize:`14px`,fontWeight:600,color:`#75beff`},children:`Storage Service Nodes`})]}),(0,f.jsxs)(`span`,{style:{fontSize:`10px`,fontWeight:700,color:`#89d185`,backgroundColor:`rgba(137, 209, 133, 0.15)`,padding:`2px 6px`,borderRadius:`4px`},children:[`ONLINE (`,e,` MCards)`]})]}),(0,f.jsx)(`p`,{style:{fontSize:`12px`,color:`#9ca3af`,margin:0,lineHeight:`1.5`},children:`Anchors state across content-addressable local and distributed stores:`}),(0,f.jsxs)(`ul`,{style:{margin:0,paddingLeft:`18px`,fontSize:`11px`,color:`#cccccc`,lineHeight:`1.6`},children:[(0,f.jsxs)(`li`,{children:[(0,f.jsx)(`strong`,{children:`Content-Addressed CAS`}),`: Cryptographic SHA-256 / Blake3 hash immutability.`]}),(0,f.jsxs)(`li`,{children:[(0,f.jsx)(`strong`,{children:`Local VFS Database`}),`: High-speed IndexedDB / SQLite persistence backend (`,t,`).`]}),(0,f.jsxs)(`li`,{children:[(0,f.jsx)(`strong`,{children:`Merkle DAG & Time Machine`}),`: Provable historical revisions and temporal scrub snapshots.`]}),(0,f.jsxs)(`li`,{children:[(0,f.jsx)(`strong`,{children:`Multi-Tier Redundancy`}),`: Local memory, S3/MinIO archival, and IPFS P2P distribution.`]})]}),(0,f.jsxs)(`button`,{type:`button`,"data-action":`inspect-storage-node`,onClick:()=>r(`abstract`),style:{marginTop:`auto`,padding:`7px 12px`,backgroundColor:`rgba(14, 99, 156, 0.15)`,color:`#75beff`,border:`1px solid rgba(14, 99, 156, 0.35)`,borderRadius:`4px`,fontSize:`11px`,fontWeight:600,cursor:`pointer`,textAlign:`left`,display:`flex`,alignItems:`center`,justifyContent:`space-between`},children:[(0,f.jsx)(`span`,{children:`Inspect MCard VFS Storage Node`}),(0,f.jsx)(`span`,{children:`→`})]})]}),(0,f.jsxs)(`div`,{style:{padding:`18px 20px`,backgroundColor:`rgba(255, 255, 255, 0.025)`,border:`1px solid rgba(137, 209, 133, 0.3)`,borderRadius:`6px`,display:`flex`,flexDirection:`column`,gap:`12px`},children:[(0,f.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`},children:[(0,f.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:`8px`},children:[(0,f.jsx)(`span`,{style:{fontSize:`18px`},children:`⚡`}),(0,f.jsx)(`span`,{style:{fontSize:`14px`,fontWeight:600,color:`#89d185`},children:`Computational Service Nodes`})]}),(0,f.jsx)(`span`,{style:{fontSize:`10px`,fontWeight:700,color:`#75beff`,backgroundColor:`rgba(14, 99, 156, 0.15)`,padding:`2px 6px`,borderRadius:`4px`},children:`ACTIVE ENCLAVE`})]}),(0,f.jsx)(`p`,{style:{fontSize:`12px`,color:`#9ca3af`,margin:0,lineHeight:`1.5`},children:`Executes formal state transformations and cognitive inference:`}),(0,f.jsxs)(`ul`,{style:{margin:0,paddingLeft:`18px`,fontSize:`11px`,color:`#cccccc`,lineHeight:`1.6`},children:[(0,f.jsxs)(`li`,{children:[(0,f.jsx)(`strong`,{children:`Polynomial Type Runtime (PTR)`}),`: Evaluates algebraic functors and PCard morphisms.`]}),(0,f.jsxs)(`li`,{children:[(0,f.jsx)(`strong`,{children:`Colored Petri Net (CPN) VM`}),`: Distributed token-flow state machine and deadlock analysis.`]}),(0,f.jsxs)(`li`,{children:[(0,f.jsx)(`strong`,{children:`VCard Invariant Witnesses`}),`: Hoare triple verification (P `,`{`,`C`,`}`,` Q) with zero false-positives.`]}),(0,f.jsxs)(`li`,{children:[(0,f.jsx)(`strong`,{children:`Local & Edge LLM Triad`}),`: In-browser WebLLM, SmolLM2, and local Ollama daemon services.`]})]}),(0,f.jsxs)(`button`,{type:`button`,"data-action":`inspect-computational-node`,onClick:()=>r(`concrete`),style:{marginTop:`auto`,padding:`7px 12px`,backgroundColor:`rgba(137, 209, 133, 0.12)`,color:`#89d185`,border:`1px solid rgba(137, 209, 133, 0.3)`,borderRadius:`4px`,fontSize:`11px`,fontWeight:600,cursor:`pointer`,textAlign:`left`,display:`flex`,alignItems:`center`,justifyContent:`space-between`},children:[(0,f.jsx)(`span`,{children:`Inspect PTR Computational Node`}),(0,f.jsx)(`span`,{children:`→`})]})]})]})]}),h={padding:`16px`,borderRadius:`6px`,display:`flex`,flexDirection:`column`,gap:`10px`},g={padding:`6px 10px`,backgroundColor:`rgba(255, 255, 255, 0.05)`,border:`1px solid rgba(255, 255, 255, 0.15)`,borderRadius:`4px`,fontSize:`11px`,cursor:`pointer`,fontWeight:600,textAlign:`left`,display:`flex`,justifyContent:`space-between`},_=({onSelectDimension:e,onSelectFirstExemplar:t})=>(0,f.jsxs)(`div`,{style:{padding:`24px 28px`,backgroundColor:`rgba(255, 255, 255, 0.02)`,border:`1px solid rgba(255, 255, 255, 0.08)`,borderRadius:`8px`},children:[(0,f.jsx)(`div`,{style:{fontSize:`12px`,fontWeight:700,textTransform:`uppercase`,color:`#ffffff`,letterSpacing:`0.6px`,marginBottom:`4px`},children:`Core Functional Areas`}),(0,f.jsx)(`div`,{style:{fontSize:`12px`,color:`var(--vscode-descriptionForeground, #9ca3af)`,marginBottom:`18px`},children:`Select any functional area or dimension to enter the corresponding spatial viewlet in DockView:`}),(0,f.jsxs)(`div`,{style:{display:`grid`,gridTemplateColumns:`repeat(auto-fit, minmax(260px, 1fr))`,gap:`14px`},children:[(0,f.jsxs)(`div`,{style:{...h,backgroundColor:`rgba(14, 99, 156, 0.08)`,border:`1px solid rgba(14, 99, 156, 0.3)`},children:[(0,f.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:`8px`},children:[(0,f.jsx)(`span`,{style:{fontSize:`18px`},children:`◫`}),(0,f.jsx)(`span`,{style:{fontSize:`14px`,fontWeight:600,color:`#75beff`},children:`1. Cubical Logic Model`})]}),(0,f.jsx)(`p`,{style:{fontSize:`12px`,color:`#9ca3af`,margin:0,lineHeight:`1.4`},children:`Three-dimensional computational lattice categorizing artifacts into orthogonal Abstract (A), Concrete (C), and Balanced Witness (B) projections.`}),(0,f.jsxs)(`div`,{style:{display:`grid`,gridTemplateColumns:`1fr 1fr`,gap:`6px`,marginTop:`auto`},children:[(0,f.jsx)(`button`,{type:`button`,"data-action":`select-dimension-abstract`,onClick:()=>e(`abstract`),style:{padding:`6px 8px`,backgroundColor:`rgba(14, 99, 156, 0.15)`,border:`1px solid rgba(14, 99, 156, 0.35)`,color:`#75beff`,borderRadius:`4px`,fontSize:`11px`,cursor:`pointer`,fontWeight:600},children:`Dim A (Abstract)`}),(0,f.jsx)(`button`,{type:`button`,"data-action":`select-dimension-concrete`,onClick:()=>e(`concrete`),style:{padding:`6px 8px`,backgroundColor:`rgba(255, 255, 255, 0.05)`,border:`1px solid rgba(255, 255, 255, 0.12)`,color:`#ffffff`,borderRadius:`4px`,fontSize:`11px`,cursor:`pointer`,fontWeight:600},children:`Dim C (Concrete)`}),(0,f.jsx)(`button`,{type:`button`,"data-action":`select-dimension-balanced`,onClick:()=>e(`balanced`),style:{padding:`6px 8px`,backgroundColor:`rgba(137, 209, 133, 0.12)`,border:`1px solid rgba(137, 209, 133, 0.3)`,color:`#89d185`,borderRadius:`4px`,fontSize:`11px`,cursor:`pointer`,fontWeight:600},children:`Dim B (Witness)`}),(0,f.jsx)(`button`,{type:`button`,"data-action":`select-dimension-topology`,onClick:()=>e(`topology`),style:{padding:`6px 8px`,backgroundColor:`rgba(251, 191, 36, 0.12)`,border:`1px solid rgba(251, 191, 36, 0.3)`,color:`#fbbf24`,borderRadius:`4px`,fontSize:`11px`,cursor:`pointer`,fontWeight:600},children:`P2P Topology`})]})]}),(0,f.jsxs)(`div`,{style:{...h,backgroundColor:`rgba(255, 255, 255, 0.03)`,border:`1px solid rgba(255, 255, 255, 0.1)`},children:[(0,f.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:`8px`},children:[(0,f.jsx)(`span`,{style:{fontSize:`18px`},children:`⚙️`}),(0,f.jsx)(`span`,{style:{fontSize:`14px`,fontWeight:600,color:`#ffffff`},children:`2. Polynomial Type Runtime`})]}),(0,f.jsx)(`p`,{style:{fontSize:`12px`,color:`#9ca3af`,margin:0,lineHeight:`1.4`},children:`Microkernel execution engine modeling computation as polynomial functors: p(y) = ∑ Aᵢ y^Bᵢ. Orchestrates sandboxed viewlets and pluggable PTR extensions.`}),(0,f.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:`6px`,marginTop:`auto`},children:[(0,f.jsxs)(`button`,{type:`button`,"data-action":`open-ptr-extensions`,onClick:()=>e(`extensions`),style:{...g,color:`#ffffff`},children:[(0,f.jsx)(`span`,{children:`Launch PTR Extension Gallery`}),(0,f.jsx)(`span`,{children:`→`})]}),(0,f.jsxs)(`button`,{type:`button`,"data-action":`run-pcard-polynomial`,onClick:()=>e(`concrete`),style:{...g,color:`#75beff`},children:[(0,f.jsx)(`span`,{children:`Inspect PCard Polynomial Transducers`}),(0,f.jsx)(`span`,{children:`→`})]})]})]}),(0,f.jsxs)(`div`,{style:{...h,backgroundColor:`rgba(255, 255, 255, 0.03)`,border:`1px solid rgba(255, 255, 255, 0.1)`},children:[(0,f.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:`8px`},children:[(0,f.jsx)(`span`,{style:{fontSize:`18px`},children:`📦`}),(0,f.jsx)(`span`,{style:{fontSize:`14px`,fontWeight:600,color:`#ffffff`},children:`3. MCard Storage (CAS VFS)`})]}),(0,f.jsx)(`p`,{style:{fontSize:`12px`,color:`#9ca3af`,margin:0,lineHeight:`1.4`},children:`Cryptographically sealed content-addressed store with atomic VFS mutations, cross-card reference propagation, and Merkle DAG versioning.`}),(0,f.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:`6px`,marginTop:`auto`},children:[(0,f.jsxs)(`button`,{type:`button`,"data-action":`browse-vfs-tree`,onClick:()=>e(`abstract`),style:{...g,color:`#ffffff`},children:[(0,f.jsx)(`span`,{children:`Browse MCard VFS Tree`}),(0,f.jsx)(`span`,{children:`→`})]}),(0,f.jsxs)(`button`,{type:`button`,"data-action":`open-time-machine`,onClick:t,style:{...g,color:`#fbbf24`},children:[(0,f.jsx)(`span`,{children:`Explore Time Machine Revisions`}),(0,f.jsx)(`span`,{children:`→`})]})]})]})]})]}),v=({onLaunchDualPreset:e,onLaunchTopologyPreset:t,onLaunchAutonomousSideWindow:n})=>(0,f.jsxs)(`div`,{style:{padding:`24px 28px`,backgroundColor:`rgba(255, 255, 255, 0.02)`,border:`1px solid rgba(255, 255, 255, 0.08)`,borderRadius:`8px`},children:[(0,f.jsx)(`div`,{style:{fontSize:`12px`,fontWeight:700,textTransform:`uppercase`,color:`#ffffff`,letterSpacing:`0.6px`,marginBottom:`4px`},children:`Spatial Workspace Presets`}),(0,f.jsx)(`div`,{style:{fontSize:`12px`,color:`var(--vscode-descriptionForeground, #9ca3af)`,marginBottom:`16px`},children:`Launch pre-configured DockView multi-viewport layouts:`}),(0,f.jsxs)(`div`,{style:{display:`grid`,gridTemplateColumns:`repeat(auto-fit, minmax(220px, 1fr))`,gap:`14px`},children:[(0,f.jsxs)(`button`,{type:`button`,"data-action":`launch-preset-dual`,className:`welcome-viewport-preset`,onClick:e,style:{display:`flex`,flexDirection:`column`,alignItems:`flex-start`,padding:`16px`,backgroundColor:`rgba(14, 99, 156, 0.12)`,border:`1px solid rgba(14, 99, 156, 0.35)`,borderRadius:`6px`,cursor:`pointer`,textAlign:`left`,transition:`all 0.15s ease`},onMouseEnter:e=>e.currentTarget.style.backgroundColor=`rgba(14, 99, 156, 0.22)`,onMouseLeave:e=>e.currentTarget.style.backgroundColor=`rgba(14, 99, 156, 0.12)`,children:[(0,f.jsxs)(`div`,{style:{fontSize:`13px`,fontWeight:600,color:`#75beff`,marginBottom:`4px`,display:`flex`,alignItems:`center`,gap:`8px`},children:[(0,f.jsx)(`span`,{children:`◫`}),(0,f.jsx)(`span`,{children:`Dual-Viewport (Code + WebApp)`})]}),(0,f.jsx)(`div`,{style:{fontSize:`11px`,color:`#9ca3af`,lineHeight:`1.4`},children:`Activates side-by-side editing between abstract specs and concrete viewlets.`})]}),(0,f.jsxs)(`button`,{type:`button`,"data-action":`launch-preset-topology`,className:`welcome-viewport-preset`,onClick:t,style:{display:`flex`,flexDirection:`column`,alignItems:`flex-start`,padding:`16px`,backgroundColor:`rgba(255, 255, 255, 0.03)`,border:`1px solid rgba(255, 255, 255, 0.1)`,borderRadius:`6px`,cursor:`pointer`,textAlign:`left`,transition:`all 0.15s ease`},onMouseEnter:e=>e.currentTarget.style.backgroundColor=`rgba(255, 255, 255, 0.08)`,onMouseLeave:e=>e.currentTarget.style.backgroundColor=`rgba(255, 255, 255, 0.03)`,children:[(0,f.jsxs)(`div`,{style:{fontSize:`13px`,fontWeight:600,color:`#ffffff`,marginBottom:`4px`,display:`flex`,alignItems:`center`,gap:`8px`},children:[(0,f.jsx)(`span`,{children:`◨`}),(0,f.jsx)(`span`,{children:`Agent Mesh + Topology Canvas`})]}),(0,f.jsx)(`div`,{style:{fontSize:`11px`,color:`#9ca3af`,lineHeight:`1.4`},children:`Inspects decentralized node presence, Petri net tokens, and live mesh gossiping.`})]}),(0,f.jsxs)(`button`,{type:`button`,"data-action":`snap-dual-windows`,"data-testid":`preset-snap-dual-windows`,className:`welcome-viewport-preset`,onClick:n,style:{display:`flex`,flexDirection:`column`,alignItems:`flex-start`,padding:`16px`,backgroundColor:`rgba(255, 255, 255, 0.03)`,border:`1px solid rgba(255, 255, 255, 0.1)`,borderRadius:`6px`,cursor:`pointer`,textAlign:`left`,transition:`all 0.15s ease`},onMouseEnter:e=>e.currentTarget.style.backgroundColor=`rgba(255, 255, 255, 0.08)`,onMouseLeave:e=>e.currentTarget.style.backgroundColor=`rgba(255, 255, 255, 0.03)`,children:[(0,f.jsxs)(`div`,{style:{fontSize:`13px`,fontWeight:600,color:`#ffffff`,marginBottom:`4px`,display:`flex`,alignItems:`center`,gap:`8px`},children:[(0,f.jsx)(`span`,{children:`🗔`}),(0,f.jsx)(`span`,{children:`Coordinated Side Window (50/50)`})]}),(0,f.jsx)(`div`,{style:{fontSize:`11px`,color:`#9ca3af`,lineHeight:`1.4`},children:`Snaps primary and secondary windows side-by-side (50% each) across the screen.`})]})]})]}),y=({cardsList:e,onSelectCard:t,onSelectFirstExemplar:n})=>(0,f.jsxs)(`div`,{style:{padding:`24px 28px`,backgroundColor:`rgba(255, 255, 255, 0.02)`,border:`1px solid rgba(255, 255, 255, 0.06)`,borderRadius:`8px`,display:`flex`,flexDirection:`column`,gap:`16px`},children:[(0,f.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`,flexWrap:`wrap`,gap:`8px`},children:[(0,f.jsxs)(`div`,{children:[(0,f.jsx)(`div`,{style:{fontSize:`12px`,fontWeight:700,textTransform:`uppercase`,color:`#ffffff`,letterSpacing:`0.6px`,marginBottom:`2px`},children:`Select Exemplar MCard Seed`}),(0,f.jsx)(`div`,{style:{fontSize:`12px`,color:`#9ca3af`},children:`Select an exemplar card to inflate directly into the active DockView editor tab:`})]}),(0,f.jsx)(`button`,{type:`button`,"data-action":`browse-seed-exemplars`,onClick:n,style:{padding:`6px 14px`,backgroundColor:`var(--vscode-button-secondaryBackground, #3a3d41)`,color:`var(--vscode-button-secondaryForeground, #ffffff)`,border:`none`,borderRadius:`4px`,fontSize:`12px`,fontWeight:600,cursor:`pointer`},children:`Load First Exemplar →`})]}),e.length>0?(0,f.jsx)(`div`,{style:{display:`grid`,gridTemplateColumns:`repeat(auto-fit, minmax(220px, 1fr))`,gap:`10px`},children:e.slice(0,4).map(e=>(0,f.jsxs)(`div`,{"data-action":`select-card`,"data-handle":e.handle,onClick:()=>t(e),style:{padding:`12px 14px`,backgroundColor:`rgba(255, 255, 255, 0.03)`,border:`1px solid rgba(255, 255, 255, 0.08)`,borderRadius:`6px`,cursor:`pointer`,transition:`all 0.15s ease`},onMouseEnter:e=>e.currentTarget.style.backgroundColor=`rgba(255, 255, 255, 0.07)`,onMouseLeave:e=>e.currentTarget.style.backgroundColor=`rgba(255, 255, 255, 0.03)`,children:[(0,f.jsxs)(`div`,{style:{fontSize:`12px`,fontWeight:600,color:`#ffffff`,marginBottom:`4px`,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`},children:[`📄 `,e.name]}),(0,f.jsx)(`div`,{style:{fontSize:`10px`,fontFamily:`monospace`,color:`#75beff`,marginBottom:`2px`},children:e.handle}),(0,f.jsxs)(`div`,{style:{fontSize:`10px`,color:`#9ca3af`},children:[`Type: `,e.detectedType,` • `,e.subclass||`MCard`]})]},e.handle||e.path))}):(0,f.jsxs)(`div`,{style:{display:`grid`,gridTemplateColumns:`repeat(auto-fit, minmax(220px, 1fr))`,gap:`10px`},children:[(0,f.jsxs)(`div`,{"data-action":`select-seed-peano`,onClick:n,style:{padding:`12px 14px`,backgroundColor:`rgba(255, 255, 255, 0.03)`,border:`1px solid rgba(255, 255, 255, 0.08)`,borderRadius:`6px`,cursor:`pointer`},children:[(0,f.jsx)(`div`,{style:{fontSize:`12px`,fontWeight:600,color:`#ffffff`},children:`📐 Peano Natural Numbers`}),(0,f.jsx)(`div`,{style:{fontSize:`11px`,color:`#9ca3af`,marginTop:`4px`},children:`Abstract knowledge specification with induction schema.`})]}),(0,f.jsxs)(`div`,{"data-action":`select-seed-kenotic`,onClick:n,style:{padding:`12px 14px`,backgroundColor:`rgba(255, 255, 255, 0.03)`,border:`1px solid rgba(255, 255, 255, 0.08)`,borderRadius:`6px`,cursor:`pointer`},children:[(0,f.jsx)(`div`,{style:{fontSize:`12px`,fontWeight:600,color:`#ffffff`},children:`⚙️ Kenotic Morphism PCard`}),(0,f.jsx)(`div`,{style:{fontSize:`11px`,color:`#9ca3af`,marginTop:`4px`},children:`Concrete polynomial degree calculation morphism.`})]}),(0,f.jsxs)(`div`,{"data-action":`select-seed-hoare`,onClick:n,style:{padding:`12px 14px`,backgroundColor:`rgba(255, 255, 255, 0.03)`,border:`1px solid rgba(255, 255, 255, 0.08)`,borderRadius:`6px`,cursor:`pointer`},children:[(0,f.jsx)(`div`,{style:{fontSize:`12px`,fontWeight:600,color:`#ffffff`},children:`🛡️ Hoare Invariant Witness VCard`}),(0,f.jsx)(`div`,{style:{fontSize:`11px`,color:`#9ca3af`,marginTop:`4px`},children:`Balanced correctness triple with pre/post assertions.`})]})]})]}),b=({cardCount:e,activeTabCount:t})=>(0,f.jsxs)(`div`,{style:{display:`grid`,gridTemplateColumns:`repeat(auto-fit, minmax(190px, 1fr))`,gap:`12px`},children:[(0,f.jsxs)(`div`,{style:{padding:`14px 16px`,backgroundColor:`rgba(255, 255, 255, 0.02)`,border:`1px solid rgba(255, 255, 255, 0.06)`,borderRadius:`6px`},children:[(0,f.jsx)(`div`,{style:{fontSize:`10px`,color:`#9ca3af`,textTransform:`uppercase`,fontWeight:600,marginBottom:`4px`},children:`VFS Content Addressable Store`}),(0,f.jsxs)(`div`,{style:{fontSize:`13px`,fontWeight:600,color:`#89d185`,display:`flex`,alignItems:`center`,gap:`6px`},children:[(0,f.jsx)(`span`,{children:`●`}),(0,f.jsxs)(`span`,{children:[`Online (`,e,` MCards)`]})]})]}),(0,f.jsxs)(`div`,{style:{padding:`14px 16px`,backgroundColor:`rgba(255, 255, 255, 0.02)`,border:`1px solid rgba(255, 255, 255, 0.06)`,borderRadius:`6px`},children:[(0,f.jsx)(`div`,{style:{fontSize:`10px`,color:`#9ca3af`,textTransform:`uppercase`,fontWeight:600,marginBottom:`4px`},children:`VCard Correctness Witness`}),(0,f.jsxs)(`div`,{style:{fontSize:`13px`,fontWeight:600,color:`#89d185`,display:`flex`,alignItems:`center`,gap:`6px`},children:[(0,f.jsx)(`span`,{children:`✓`}),(0,f.jsx)(`span`,{children:`Zero Invariant Violations`})]})]}),(0,f.jsxs)(`div`,{style:{padding:`14px 16px`,backgroundColor:`rgba(255, 255, 255, 0.02)`,border:`1px solid rgba(255, 255, 255, 0.06)`,borderRadius:`6px`},children:[(0,f.jsx)(`div`,{style:{fontSize:`10px`,color:`#9ca3af`,textTransform:`uppercase`,fontWeight:600,marginBottom:`4px`},children:`Hermetic Enclave (INV-325-01)`}),(0,f.jsxs)(`div`,{style:{fontSize:`13px`,fontWeight:600,color:`#75beff`,display:`flex`,alignItems:`center`,gap:`6px`},children:[(0,f.jsx)(`span`,{children:`🛡️`}),(0,f.jsx)(`span`,{children:`window.opener === null`})]})]}),(0,f.jsxs)(`div`,{style:{padding:`14px 16px`,backgroundColor:`rgba(255, 255, 255, 0.02)`,border:`1px solid rgba(255, 255, 255, 0.06)`,borderRadius:`6px`},children:[(0,f.jsx)(`div`,{style:{fontSize:`10px`,color:`#9ca3af`,textTransform:`uppercase`,fontWeight:600,marginBottom:`4px`},children:`DockView State (INV-325-05)`}),(0,f.jsxs)(`div`,{style:{fontSize:`13px`,fontWeight:600,color:`#fbbf24`,display:`flex`,alignItems:`center`,gap:`6px`},children:[(0,f.jsx)(`span`,{children:`◫`}),(0,f.jsxs)(`span`,{children:[`Depressed (`,t,` Tabs Hydrated)`]})]})]})]}),x=({onSelectItem:e})=>{let t=u(l),h=u(n),g=u(o),x=u(s),S=Object.values(t),C=S.length,w=t=>{i(t),a(),e?.({type:`dimension`,dimension:t})},T=()=>{a(),e?.({type:`restore-dockview`})},E=()=>{a(),r.set(`abstract`),typeof window<`u`&&window.dispatchEvent(new CustomEvent(`clm:launch-preset`,{detail:{preset:`dual-viewport`}})),e?.({type:`preset`,preset:`dual-viewport`})},D=()=>{a(),r.set(`topology`),e?.({type:`preset`,preset:`topology`})},O=()=>{let t=typeof window<`u`?`${window.location.origin}/?mode=satellite&view=presentation`:`http://localhost:3000/`,n=d(t,{ratio:.5});typeof window<`u`&&(window.dispatchEvent(new CustomEvent(`clm:viewport-tile-requested`,{detail:{url:t,result:n,geometry:n.geometry}})),(n.popupBlocked||!n.success)&&(window.dispatchEvent(new CustomEvent(`clm:popup-blocked`,{detail:{message:`Browser popup blocked. Switched to in-app split view.`}})),a(),window.dispatchEvent(new CustomEvent(`clm:launch-preset`,{detail:{preset:`dual-viewport`}})))),e?.({type:`preset`,preset:`side-window`,result:n})},k=t=>{c.set(t),a(),e?.(t)},A=()=>{let t=S[0];t?k(t):(a(),e?.({type:`exemplar`,id:`seed-default`}))};return(0,f.jsx)(`div`,{className:`welcome-viewport clm-presentation-page`,"data-viewlet":`welcome`,"data-testid":`welcome-viewport`,style:{display:`flex`,flexDirection:`column`,alignItems:`center`,justifyContent:`flex-start`,width:`100%`,height:`100%`,padding:`44px 24px 64px 24px`,backgroundColor:`var(--vscode-editor-background, #1e1e1e)`,color:`var(--vscode-foreground, #cccccc)`,fontFamily:`var(--vscode-font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif)`,overflowY:`auto`,boxSizing:`border-box`},children:(0,f.jsxs)(`div`,{style:{maxWidth:`920px`,width:`100%`,display:`flex`,flexDirection:`column`,gap:`24px`},children:[(0,f.jsx)(p,{onEnterWorkbench:T,onSelectFirstExemplar:A}),(0,f.jsx)(m,{cardCount:C,storageBackendType:g.backendType,peerMesh:x,onSelectDimension:w}),(0,f.jsx)(_,{onSelectDimension:w,onSelectFirstExemplar:A}),(0,f.jsx)(v,{onLaunchDualPreset:E,onLaunchTopologyPreset:D,onLaunchAutonomousSideWindow:O}),(0,f.jsx)(y,{cardsList:S,onSelectCard:k,onSelectFirstExemplar:A}),(0,f.jsx)(b,{cardCount:C,activeTabCount:h})]})})};export{x as t};
1
+ import"./rolldown-runtime.Dd_uD5pT.js";import{a as e,i as t}from"./vendor-react.DpDU3q_x.js";import{O as n,d as r,g as i,h as a,n as o,t as s,v as c,y as l}from"./mcardStore.CT-ollfl.js";import{r as u}from"./disposable.Dsb0sbRP.js";import{t as d}from"./secureWindowOrchestrator.CIQYcH4l.js";e();var f=t(),p=({onEnterWorkbench:e,onSelectFirstExemplar:t})=>(0,f.jsxs)(`div`,{style:{padding:`32px 36px`,backgroundColor:`rgba(255, 255, 255, 0.02)`,border:`1px solid rgba(255, 255, 255, 0.08)`,borderRadius:`8px`,boxShadow:`0 8px 32px rgba(0, 0, 0, 0.4)`,textAlign:`left`},children:[(0,f.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:`12px`,marginBottom:`10px`,flexWrap:`wrap`},children:[(0,f.jsx)(`span`,{style:{fontSize:`28px`,color:`#75beff`},children:`◫`}),(0,f.jsxs)(`div`,{children:[(0,f.jsx)(`h1`,{style:{margin:0,fontSize:`24px`,fontWeight:600,color:`#ffffff`,letterSpacing:`-0.4px`},children:`Personal Knowledge Container (PKC)`}),(0,f.jsx)(`div`,{style:{fontSize:`13px`,color:`#75beff`,fontWeight:500,marginTop:`2px`},children:`Cubical Logic Model (CLM) • Sovereign Studio Workbench`})]}),(0,f.jsxs)(`div`,{style:{display:`flex`,gap:`8px`,marginLeft:`auto`},children:[(0,f.jsx)(`span`,{style:{fontSize:`10px`,fontWeight:700,padding:`3px 8px`,borderRadius:`10px`,backgroundColor:`rgba(14, 99, 156, 0.25)`,color:`#75beff`,border:`1px solid rgba(14, 99, 156, 0.5)`,textTransform:`uppercase`,letterSpacing:`0.5px`},children:`Level 1 Enclave`}),(0,f.jsx)(`span`,{style:{fontSize:`10px`,fontWeight:700,padding:`3px 8px`,borderRadius:`10px`,backgroundColor:`rgba(137, 209, 133, 0.15)`,color:`#89d185`,border:`1px solid rgba(137, 209, 133, 0.4)`,textTransform:`uppercase`,letterSpacing:`0.5px`},children:`Zero-Trust CAS`})]})]}),(0,f.jsxs)(`p`,{style:{margin:`12px 0 18px 0`,fontSize:`14px`,lineHeight:`1.6`,color:`var(--vscode-descriptionForeground, #a0a0a0)`,maxWidth:`820px`},children:[`A `,(0,f.jsx)(`strong`,{children:`Personal Knowledge Container (PKC)`}),` is an autonomous, decentralized cognitive substrate composed of interconnected `,(0,f.jsx)(`strong`,{children:`Computational Service Nodes`}),` and`,` `,(0,f.jsx)(`strong`,{children:`Storage Service Nodes`}),`. The container guarantees cryptographic provenance, local execution autonomy, and zero-trust verification across three foundational functional pillars: the `,(0,f.jsx)(`strong`,{children:`Cubical Logic Model (CLM)`}),`, the `,(0,f.jsx)(`strong`,{children:`Polynomial Type Runtime (PTR)`}),`, and `,(0,f.jsx)(`strong`,{children:`MCard Content-Addressed Storage (CAS & VFS)`}),`.`]}),(0,f.jsxs)(`div`,{style:{display:`flex`,gap:`12px`,alignItems:`center`,flexWrap:`wrap`},children:[(0,f.jsxs)(`button`,{type:`button`,"data-action":`launch-dockview-workbench`,"data-testid":`restore-dockview-btn`,onClick:e,style:{display:`inline-flex`,alignItems:`center`,gap:`8px`,padding:`9px 20px`,backgroundColor:`var(--vscode-button-background, #0e639c)`,color:`var(--vscode-button-foreground, #ffffff)`,border:`none`,borderRadius:`4px`,cursor:`pointer`,fontSize:`13px`,fontWeight:600,transition:`background-color 0.15s ease`},onMouseEnter:e=>e.currentTarget.style.backgroundColor=`var(--vscode-button-hoverBackground, #1177bb)`,onMouseLeave:e=>e.currentTarget.style.backgroundColor=`var(--vscode-button-background, #0e639c)`,children:[(0,f.jsx)(`span`,{children:`Enter DockView Spatial Workbench`}),(0,f.jsx)(`span`,{style:{fontSize:`11px`,opacity:.85},children:`→`})]}),(0,f.jsx)(`button`,{type:`button`,"data-action":`browse-seed-exemplars`,onClick:t,style:{display:`inline-flex`,alignItems:`center`,gap:`8px`,padding:`9px 18px`,backgroundColor:`rgba(255, 255, 255, 0.05)`,color:`#ffffff`,border:`1px solid rgba(255, 255, 255, 0.15)`,borderRadius:`4px`,cursor:`pointer`,fontSize:`13px`,fontWeight:500,transition:`all 0.15s ease`},onMouseEnter:e=>{e.currentTarget.style.backgroundColor=`rgba(255, 255, 255, 0.1)`},onMouseLeave:e=>{e.currentTarget.style.backgroundColor=`rgba(255, 255, 255, 0.05)`},children:(0,f.jsx)(`span`,{children:`Explore Exemplar Seeds`})}),(0,f.jsx)(`span`,{style:{fontSize:`12px`,color:`#6b7280`,marginLeft:`auto`},children:`Select any node, dimension, or exemplar below to elevate into DockView`})]})]}),m=({cardCount:e,storageBackendType:t=`IndexedDB/VFS`,peerMesh:n={},onSelectDimension:r})=>(0,f.jsxs)(`div`,{style:{padding:`24px 28px`,backgroundColor:`rgba(255, 255, 255, 0.02)`,border:`1px solid rgba(255, 255, 255, 0.08)`,borderRadius:`8px`},children:[(0,f.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`,marginBottom:`16px`,flexWrap:`wrap`,gap:`8px`},children:[(0,f.jsxs)(`div`,{children:[(0,f.jsx)(`div`,{style:{fontSize:`12px`,fontWeight:700,textTransform:`uppercase`,color:`#ffffff`,letterSpacing:`0.6px`},children:`PKC Service Nodes Architecture`}),(0,f.jsx)(`div`,{style:{fontSize:`12px`,color:`#9ca3af`,marginTop:`2px`},children:`Decentralized topology distributing state storage and algorithmic execution`})]}),(0,f.jsxs)(`span`,{style:{fontSize:`11px`,color:`#89d185`,display:`flex`,alignItems:`center`,gap:`6px`,backgroundColor:`rgba(137, 209, 133, 0.1)`,padding:`4px 10px`,borderRadius:`4px`,border:`1px solid rgba(137, 209, 133, 0.25)`},children:[(0,f.jsx)(`span`,{children:`●`}),(0,f.jsxs)(`span`,{children:[`Mesh Fabric: `,n.online?`${n.peerCount??0} Remote Peers`:`Local Substrate Active`]})]})]}),(0,f.jsxs)(`div`,{style:{display:`grid`,gridTemplateColumns:`repeat(auto-fit, minmax(360px, 1fr))`,gap:`16px`},children:[(0,f.jsxs)(`div`,{style:{padding:`18px 20px`,backgroundColor:`rgba(255, 255, 255, 0.025)`,border:`1px solid rgba(14, 99, 156, 0.3)`,borderRadius:`6px`,display:`flex`,flexDirection:`column`,gap:`12px`},children:[(0,f.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`},children:[(0,f.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:`8px`},children:[(0,f.jsx)(`span`,{style:{fontSize:`18px`},children:`🗄️`}),(0,f.jsx)(`span`,{style:{fontSize:`14px`,fontWeight:600,color:`#75beff`},children:`Storage Service Nodes`})]}),(0,f.jsxs)(`span`,{style:{fontSize:`10px`,fontWeight:700,color:`#89d185`,backgroundColor:`rgba(137, 209, 133, 0.15)`,padding:`2px 6px`,borderRadius:`4px`},children:[`ONLINE (`,e,` MCards)`]})]}),(0,f.jsx)(`p`,{style:{fontSize:`12px`,color:`#9ca3af`,margin:0,lineHeight:`1.5`},children:`Anchors state across content-addressable local and distributed stores:`}),(0,f.jsxs)(`ul`,{style:{margin:0,paddingLeft:`18px`,fontSize:`11px`,color:`#cccccc`,lineHeight:`1.6`},children:[(0,f.jsxs)(`li`,{children:[(0,f.jsx)(`strong`,{children:`Content-Addressed CAS`}),`: Cryptographic SHA-256 / Blake3 hash immutability.`]}),(0,f.jsxs)(`li`,{children:[(0,f.jsx)(`strong`,{children:`Local VFS Database`}),`: High-speed IndexedDB / SQLite persistence backend (`,t,`).`]}),(0,f.jsxs)(`li`,{children:[(0,f.jsx)(`strong`,{children:`Merkle DAG & Time Machine`}),`: Provable historical revisions and temporal scrub snapshots.`]}),(0,f.jsxs)(`li`,{children:[(0,f.jsx)(`strong`,{children:`Multi-Tier Redundancy`}),`: Local memory, S3/MinIO archival, and IPFS P2P distribution.`]})]}),(0,f.jsxs)(`button`,{type:`button`,"data-action":`inspect-storage-node`,onClick:()=>r(`abstract`),style:{marginTop:`auto`,padding:`7px 12px`,backgroundColor:`rgba(14, 99, 156, 0.15)`,color:`#75beff`,border:`1px solid rgba(14, 99, 156, 0.35)`,borderRadius:`4px`,fontSize:`11px`,fontWeight:600,cursor:`pointer`,textAlign:`left`,display:`flex`,alignItems:`center`,justifyContent:`space-between`},children:[(0,f.jsx)(`span`,{children:`Inspect MCard VFS Storage Node`}),(0,f.jsx)(`span`,{children:`→`})]})]}),(0,f.jsxs)(`div`,{style:{padding:`18px 20px`,backgroundColor:`rgba(255, 255, 255, 0.025)`,border:`1px solid rgba(137, 209, 133, 0.3)`,borderRadius:`6px`,display:`flex`,flexDirection:`column`,gap:`12px`},children:[(0,f.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`},children:[(0,f.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:`8px`},children:[(0,f.jsx)(`span`,{style:{fontSize:`18px`},children:`⚡`}),(0,f.jsx)(`span`,{style:{fontSize:`14px`,fontWeight:600,color:`#89d185`},children:`Computational Service Nodes`})]}),(0,f.jsx)(`span`,{style:{fontSize:`10px`,fontWeight:700,color:`#75beff`,backgroundColor:`rgba(14, 99, 156, 0.15)`,padding:`2px 6px`,borderRadius:`4px`},children:`ACTIVE ENCLAVE`})]}),(0,f.jsx)(`p`,{style:{fontSize:`12px`,color:`#9ca3af`,margin:0,lineHeight:`1.5`},children:`Executes formal state transformations and cognitive inference:`}),(0,f.jsxs)(`ul`,{style:{margin:0,paddingLeft:`18px`,fontSize:`11px`,color:`#cccccc`,lineHeight:`1.6`},children:[(0,f.jsxs)(`li`,{children:[(0,f.jsx)(`strong`,{children:`Polynomial Type Runtime (PTR)`}),`: Evaluates algebraic functors and PCard morphisms.`]}),(0,f.jsxs)(`li`,{children:[(0,f.jsx)(`strong`,{children:`Colored Petri Net (CPN) VM`}),`: Distributed token-flow state machine and deadlock analysis.`]}),(0,f.jsxs)(`li`,{children:[(0,f.jsx)(`strong`,{children:`VCard Invariant Witnesses`}),`: Hoare triple verification (P `,`{`,`C`,`}`,` Q) with zero false-positives.`]}),(0,f.jsxs)(`li`,{children:[(0,f.jsx)(`strong`,{children:`Local & Edge LLM Triad`}),`: In-browser WebLLM, SmolLM2, and local Ollama daemon services.`]})]}),(0,f.jsxs)(`button`,{type:`button`,"data-action":`inspect-computational-node`,onClick:()=>r(`concrete`),style:{marginTop:`auto`,padding:`7px 12px`,backgroundColor:`rgba(137, 209, 133, 0.12)`,color:`#89d185`,border:`1px solid rgba(137, 209, 133, 0.3)`,borderRadius:`4px`,fontSize:`11px`,fontWeight:600,cursor:`pointer`,textAlign:`left`,display:`flex`,alignItems:`center`,justifyContent:`space-between`},children:[(0,f.jsx)(`span`,{children:`Inspect PTR Computational Node`}),(0,f.jsx)(`span`,{children:`→`})]})]})]})]}),h={padding:`16px`,borderRadius:`6px`,display:`flex`,flexDirection:`column`,gap:`10px`},g={padding:`6px 10px`,backgroundColor:`rgba(255, 255, 255, 0.05)`,border:`1px solid rgba(255, 255, 255, 0.15)`,borderRadius:`4px`,fontSize:`11px`,cursor:`pointer`,fontWeight:600,textAlign:`left`,display:`flex`,justifyContent:`space-between`},_=({onSelectDimension:e,onSelectFirstExemplar:t})=>(0,f.jsxs)(`div`,{style:{padding:`24px 28px`,backgroundColor:`rgba(255, 255, 255, 0.02)`,border:`1px solid rgba(255, 255, 255, 0.08)`,borderRadius:`8px`},children:[(0,f.jsx)(`div`,{style:{fontSize:`12px`,fontWeight:700,textTransform:`uppercase`,color:`#ffffff`,letterSpacing:`0.6px`,marginBottom:`4px`},children:`Core Functional Areas`}),(0,f.jsx)(`div`,{style:{fontSize:`12px`,color:`var(--vscode-descriptionForeground, #9ca3af)`,marginBottom:`18px`},children:`Select any functional area or dimension to enter the corresponding spatial viewlet in DockView:`}),(0,f.jsxs)(`div`,{style:{display:`grid`,gridTemplateColumns:`repeat(auto-fit, minmax(260px, 1fr))`,gap:`14px`},children:[(0,f.jsxs)(`div`,{style:{...h,backgroundColor:`rgba(14, 99, 156, 0.08)`,border:`1px solid rgba(14, 99, 156, 0.3)`},children:[(0,f.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:`8px`},children:[(0,f.jsx)(`span`,{style:{fontSize:`18px`},children:`◫`}),(0,f.jsx)(`span`,{style:{fontSize:`14px`,fontWeight:600,color:`#75beff`},children:`1. Cubical Logic Model`})]}),(0,f.jsx)(`p`,{style:{fontSize:`12px`,color:`#9ca3af`,margin:0,lineHeight:`1.4`},children:`Three-dimensional computational lattice categorizing artifacts into orthogonal Abstract (A), Concrete (C), and Balanced Witness (B) projections.`}),(0,f.jsxs)(`div`,{style:{display:`grid`,gridTemplateColumns:`1fr 1fr`,gap:`6px`,marginTop:`auto`},children:[(0,f.jsx)(`button`,{type:`button`,"data-action":`select-dimension-abstract`,onClick:()=>e(`abstract`),style:{padding:`6px 8px`,backgroundColor:`rgba(14, 99, 156, 0.15)`,border:`1px solid rgba(14, 99, 156, 0.35)`,color:`#75beff`,borderRadius:`4px`,fontSize:`11px`,cursor:`pointer`,fontWeight:600},children:`Dim A (Abstract)`}),(0,f.jsx)(`button`,{type:`button`,"data-action":`select-dimension-concrete`,onClick:()=>e(`concrete`),style:{padding:`6px 8px`,backgroundColor:`rgba(255, 255, 255, 0.05)`,border:`1px solid rgba(255, 255, 255, 0.12)`,color:`#ffffff`,borderRadius:`4px`,fontSize:`11px`,cursor:`pointer`,fontWeight:600},children:`Dim C (Concrete)`}),(0,f.jsx)(`button`,{type:`button`,"data-action":`select-dimension-balanced`,onClick:()=>e(`balanced`),style:{padding:`6px 8px`,backgroundColor:`rgba(137, 209, 133, 0.12)`,border:`1px solid rgba(137, 209, 133, 0.3)`,color:`#89d185`,borderRadius:`4px`,fontSize:`11px`,cursor:`pointer`,fontWeight:600},children:`Dim B (Witness)`}),(0,f.jsx)(`button`,{type:`button`,"data-action":`select-dimension-topology`,onClick:()=>e(`topology`),style:{padding:`6px 8px`,backgroundColor:`rgba(251, 191, 36, 0.12)`,border:`1px solid rgba(251, 191, 36, 0.3)`,color:`#fbbf24`,borderRadius:`4px`,fontSize:`11px`,cursor:`pointer`,fontWeight:600},children:`P2P Topology`})]})]}),(0,f.jsxs)(`div`,{style:{...h,backgroundColor:`rgba(255, 255, 255, 0.03)`,border:`1px solid rgba(255, 255, 255, 0.1)`},children:[(0,f.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:`8px`},children:[(0,f.jsx)(`span`,{style:{fontSize:`18px`},children:`⚙️`}),(0,f.jsx)(`span`,{style:{fontSize:`14px`,fontWeight:600,color:`#ffffff`},children:`2. Polynomial Type Runtime`})]}),(0,f.jsx)(`p`,{style:{fontSize:`12px`,color:`#9ca3af`,margin:0,lineHeight:`1.4`},children:`Microkernel execution engine modeling computation as polynomial functors: p(y) = ∑ Aᵢ y^Bᵢ. Orchestrates sandboxed viewlets and pluggable PTR extensions.`}),(0,f.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:`6px`,marginTop:`auto`},children:[(0,f.jsxs)(`button`,{type:`button`,"data-action":`open-ptr-extensions`,onClick:()=>e(`extensions`),style:{...g,color:`#ffffff`},children:[(0,f.jsx)(`span`,{children:`Launch PTR Extension Gallery`}),(0,f.jsx)(`span`,{children:`→`})]}),(0,f.jsxs)(`button`,{type:`button`,"data-action":`run-pcard-polynomial`,onClick:()=>e(`concrete`),style:{...g,color:`#75beff`},children:[(0,f.jsx)(`span`,{children:`Inspect PCard Polynomial Transducers`}),(0,f.jsx)(`span`,{children:`→`})]})]})]}),(0,f.jsxs)(`div`,{style:{...h,backgroundColor:`rgba(255, 255, 255, 0.03)`,border:`1px solid rgba(255, 255, 255, 0.1)`},children:[(0,f.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:`8px`},children:[(0,f.jsx)(`span`,{style:{fontSize:`18px`},children:`📦`}),(0,f.jsx)(`span`,{style:{fontSize:`14px`,fontWeight:600,color:`#ffffff`},children:`3. MCard Storage (CAS VFS)`})]}),(0,f.jsx)(`p`,{style:{fontSize:`12px`,color:`#9ca3af`,margin:0,lineHeight:`1.4`},children:`Cryptographically sealed content-addressed store with atomic VFS mutations, cross-card reference propagation, and Merkle DAG versioning.`}),(0,f.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:`6px`,marginTop:`auto`},children:[(0,f.jsxs)(`button`,{type:`button`,"data-action":`browse-vfs-tree`,onClick:()=>e(`abstract`),style:{...g,color:`#ffffff`},children:[(0,f.jsx)(`span`,{children:`Browse MCard VFS Tree`}),(0,f.jsx)(`span`,{children:`→`})]}),(0,f.jsxs)(`button`,{type:`button`,"data-action":`open-time-machine`,onClick:t,style:{...g,color:`#fbbf24`},children:[(0,f.jsx)(`span`,{children:`Explore Time Machine Revisions`}),(0,f.jsx)(`span`,{children:`→`})]})]})]})]})]}),v=({onLaunchDualPreset:e,onLaunchTopologyPreset:t,onLaunchAutonomousSideWindow:n})=>(0,f.jsxs)(`div`,{style:{padding:`24px 28px`,backgroundColor:`rgba(255, 255, 255, 0.02)`,border:`1px solid rgba(255, 255, 255, 0.08)`,borderRadius:`8px`},children:[(0,f.jsx)(`div`,{style:{fontSize:`12px`,fontWeight:700,textTransform:`uppercase`,color:`#ffffff`,letterSpacing:`0.6px`,marginBottom:`4px`},children:`Spatial Workspace Presets`}),(0,f.jsx)(`div`,{style:{fontSize:`12px`,color:`var(--vscode-descriptionForeground, #9ca3af)`,marginBottom:`16px`},children:`Launch pre-configured DockView multi-viewport layouts:`}),(0,f.jsxs)(`div`,{style:{display:`grid`,gridTemplateColumns:`repeat(auto-fit, minmax(220px, 1fr))`,gap:`14px`},children:[(0,f.jsxs)(`button`,{type:`button`,"data-action":`launch-preset-dual`,className:`welcome-viewport-preset`,onClick:e,style:{display:`flex`,flexDirection:`column`,alignItems:`flex-start`,padding:`16px`,backgroundColor:`rgba(14, 99, 156, 0.12)`,border:`1px solid rgba(14, 99, 156, 0.35)`,borderRadius:`6px`,cursor:`pointer`,textAlign:`left`,transition:`all 0.15s ease`},onMouseEnter:e=>e.currentTarget.style.backgroundColor=`rgba(14, 99, 156, 0.22)`,onMouseLeave:e=>e.currentTarget.style.backgroundColor=`rgba(14, 99, 156, 0.12)`,children:[(0,f.jsxs)(`div`,{style:{fontSize:`13px`,fontWeight:600,color:`#75beff`,marginBottom:`4px`,display:`flex`,alignItems:`center`,gap:`8px`},children:[(0,f.jsx)(`span`,{children:`◫`}),(0,f.jsx)(`span`,{children:`Dual-Viewport (Code + WebApp)`})]}),(0,f.jsx)(`div`,{style:{fontSize:`11px`,color:`#9ca3af`,lineHeight:`1.4`},children:`Activates side-by-side editing between abstract specs and concrete viewlets.`})]}),(0,f.jsxs)(`button`,{type:`button`,"data-action":`launch-preset-topology`,className:`welcome-viewport-preset`,onClick:t,style:{display:`flex`,flexDirection:`column`,alignItems:`flex-start`,padding:`16px`,backgroundColor:`rgba(255, 255, 255, 0.03)`,border:`1px solid rgba(255, 255, 255, 0.1)`,borderRadius:`6px`,cursor:`pointer`,textAlign:`left`,transition:`all 0.15s ease`},onMouseEnter:e=>e.currentTarget.style.backgroundColor=`rgba(255, 255, 255, 0.08)`,onMouseLeave:e=>e.currentTarget.style.backgroundColor=`rgba(255, 255, 255, 0.03)`,children:[(0,f.jsxs)(`div`,{style:{fontSize:`13px`,fontWeight:600,color:`#ffffff`,marginBottom:`4px`,display:`flex`,alignItems:`center`,gap:`8px`},children:[(0,f.jsx)(`span`,{children:`◨`}),(0,f.jsx)(`span`,{children:`Agent Mesh + Topology Canvas`})]}),(0,f.jsx)(`div`,{style:{fontSize:`11px`,color:`#9ca3af`,lineHeight:`1.4`},children:`Inspects decentralized node presence, Petri net tokens, and live mesh gossiping.`})]}),(0,f.jsxs)(`button`,{type:`button`,"data-action":`snap-dual-windows`,"data-testid":`preset-snap-dual-windows`,className:`welcome-viewport-preset`,onClick:n,style:{display:`flex`,flexDirection:`column`,alignItems:`flex-start`,padding:`16px`,backgroundColor:`rgba(255, 255, 255, 0.03)`,border:`1px solid rgba(255, 255, 255, 0.1)`,borderRadius:`6px`,cursor:`pointer`,textAlign:`left`,transition:`all 0.15s ease`},onMouseEnter:e=>e.currentTarget.style.backgroundColor=`rgba(255, 255, 255, 0.08)`,onMouseLeave:e=>e.currentTarget.style.backgroundColor=`rgba(255, 255, 255, 0.03)`,children:[(0,f.jsxs)(`div`,{style:{fontSize:`13px`,fontWeight:600,color:`#ffffff`,marginBottom:`4px`,display:`flex`,alignItems:`center`,gap:`8px`},children:[(0,f.jsx)(`span`,{children:`🗔`}),(0,f.jsx)(`span`,{children:`Coordinated Side Window (50/50)`})]}),(0,f.jsx)(`div`,{style:{fontSize:`11px`,color:`#9ca3af`,lineHeight:`1.4`},children:`Snaps primary and secondary windows side-by-side (50% each) across the screen.`})]})]})]}),y=({cardsList:e,onSelectCard:t,onSelectFirstExemplar:n})=>(0,f.jsxs)(`div`,{style:{padding:`24px 28px`,backgroundColor:`rgba(255, 255, 255, 0.02)`,border:`1px solid rgba(255, 255, 255, 0.06)`,borderRadius:`8px`,display:`flex`,flexDirection:`column`,gap:`16px`},children:[(0,f.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`,flexWrap:`wrap`,gap:`8px`},children:[(0,f.jsxs)(`div`,{children:[(0,f.jsx)(`div`,{style:{fontSize:`12px`,fontWeight:700,textTransform:`uppercase`,color:`#ffffff`,letterSpacing:`0.6px`,marginBottom:`2px`},children:`Select Exemplar MCard Seed`}),(0,f.jsx)(`div`,{style:{fontSize:`12px`,color:`#9ca3af`},children:`Select an exemplar card to inflate directly into the active DockView editor tab:`})]}),(0,f.jsx)(`button`,{type:`button`,"data-action":`browse-seed-exemplars`,onClick:n,style:{padding:`6px 14px`,backgroundColor:`var(--vscode-button-secondaryBackground, #3a3d41)`,color:`var(--vscode-button-secondaryForeground, #ffffff)`,border:`none`,borderRadius:`4px`,fontSize:`12px`,fontWeight:600,cursor:`pointer`},children:`Load First Exemplar →`})]}),e.length>0?(0,f.jsx)(`div`,{style:{display:`grid`,gridTemplateColumns:`repeat(auto-fit, minmax(220px, 1fr))`,gap:`10px`},children:e.slice(0,4).map(e=>(0,f.jsxs)(`div`,{"data-action":`select-card`,"data-handle":e.handle,onClick:()=>t(e),style:{padding:`12px 14px`,backgroundColor:`rgba(255, 255, 255, 0.03)`,border:`1px solid rgba(255, 255, 255, 0.08)`,borderRadius:`6px`,cursor:`pointer`,transition:`all 0.15s ease`},onMouseEnter:e=>e.currentTarget.style.backgroundColor=`rgba(255, 255, 255, 0.07)`,onMouseLeave:e=>e.currentTarget.style.backgroundColor=`rgba(255, 255, 255, 0.03)`,children:[(0,f.jsxs)(`div`,{style:{fontSize:`12px`,fontWeight:600,color:`#ffffff`,marginBottom:`4px`,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`},children:[`📄 `,e.name]}),(0,f.jsx)(`div`,{style:{fontSize:`10px`,fontFamily:`monospace`,color:`#75beff`,marginBottom:`2px`},children:e.handle}),(0,f.jsxs)(`div`,{style:{fontSize:`10px`,color:`#9ca3af`},children:[`Type: `,e.detectedType,` • `,e.subclass||`MCard`]})]},e.handle||e.path))}):(0,f.jsxs)(`div`,{style:{display:`grid`,gridTemplateColumns:`repeat(auto-fit, minmax(220px, 1fr))`,gap:`10px`},children:[(0,f.jsxs)(`div`,{"data-action":`select-seed-peano`,onClick:n,style:{padding:`12px 14px`,backgroundColor:`rgba(255, 255, 255, 0.03)`,border:`1px solid rgba(255, 255, 255, 0.08)`,borderRadius:`6px`,cursor:`pointer`},children:[(0,f.jsx)(`div`,{style:{fontSize:`12px`,fontWeight:600,color:`#ffffff`},children:`📐 Peano Natural Numbers`}),(0,f.jsx)(`div`,{style:{fontSize:`11px`,color:`#9ca3af`,marginTop:`4px`},children:`Abstract knowledge specification with induction schema.`})]}),(0,f.jsxs)(`div`,{"data-action":`select-seed-kenotic`,onClick:n,style:{padding:`12px 14px`,backgroundColor:`rgba(255, 255, 255, 0.03)`,border:`1px solid rgba(255, 255, 255, 0.08)`,borderRadius:`6px`,cursor:`pointer`},children:[(0,f.jsx)(`div`,{style:{fontSize:`12px`,fontWeight:600,color:`#ffffff`},children:`⚙️ Kenotic Morphism PCard`}),(0,f.jsx)(`div`,{style:{fontSize:`11px`,color:`#9ca3af`,marginTop:`4px`},children:`Concrete polynomial degree calculation morphism.`})]}),(0,f.jsxs)(`div`,{"data-action":`select-seed-hoare`,onClick:n,style:{padding:`12px 14px`,backgroundColor:`rgba(255, 255, 255, 0.03)`,border:`1px solid rgba(255, 255, 255, 0.08)`,borderRadius:`6px`,cursor:`pointer`},children:[(0,f.jsx)(`div`,{style:{fontSize:`12px`,fontWeight:600,color:`#ffffff`},children:`🛡️ Hoare Invariant Witness VCard`}),(0,f.jsx)(`div`,{style:{fontSize:`11px`,color:`#9ca3af`,marginTop:`4px`},children:`Balanced correctness triple with pre/post assertions.`})]})]})]}),b=({cardCount:e,activeTabCount:t})=>(0,f.jsxs)(`div`,{style:{display:`grid`,gridTemplateColumns:`repeat(auto-fit, minmax(190px, 1fr))`,gap:`12px`},children:[(0,f.jsxs)(`div`,{style:{padding:`14px 16px`,backgroundColor:`rgba(255, 255, 255, 0.02)`,border:`1px solid rgba(255, 255, 255, 0.06)`,borderRadius:`6px`},children:[(0,f.jsx)(`div`,{style:{fontSize:`10px`,color:`#9ca3af`,textTransform:`uppercase`,fontWeight:600,marginBottom:`4px`},children:`VFS Content Addressable Store`}),(0,f.jsxs)(`div`,{style:{fontSize:`13px`,fontWeight:600,color:`#89d185`,display:`flex`,alignItems:`center`,gap:`6px`},children:[(0,f.jsx)(`span`,{children:`●`}),(0,f.jsxs)(`span`,{children:[`Online (`,e,` MCards)`]})]})]}),(0,f.jsxs)(`div`,{style:{padding:`14px 16px`,backgroundColor:`rgba(255, 255, 255, 0.02)`,border:`1px solid rgba(255, 255, 255, 0.06)`,borderRadius:`6px`},children:[(0,f.jsx)(`div`,{style:{fontSize:`10px`,color:`#9ca3af`,textTransform:`uppercase`,fontWeight:600,marginBottom:`4px`},children:`VCard Correctness Witness`}),(0,f.jsxs)(`div`,{style:{fontSize:`13px`,fontWeight:600,color:`#89d185`,display:`flex`,alignItems:`center`,gap:`6px`},children:[(0,f.jsx)(`span`,{children:`✓`}),(0,f.jsx)(`span`,{children:`Zero Invariant Violations`})]})]}),(0,f.jsxs)(`div`,{style:{padding:`14px 16px`,backgroundColor:`rgba(255, 255, 255, 0.02)`,border:`1px solid rgba(255, 255, 255, 0.06)`,borderRadius:`6px`},children:[(0,f.jsx)(`div`,{style:{fontSize:`10px`,color:`#9ca3af`,textTransform:`uppercase`,fontWeight:600,marginBottom:`4px`},children:`Hermetic Enclave (INV-325-01)`}),(0,f.jsxs)(`div`,{style:{fontSize:`13px`,fontWeight:600,color:`#75beff`,display:`flex`,alignItems:`center`,gap:`6px`},children:[(0,f.jsx)(`span`,{children:`🛡️`}),(0,f.jsx)(`span`,{children:`window.opener === null`})]})]}),(0,f.jsxs)(`div`,{style:{padding:`14px 16px`,backgroundColor:`rgba(255, 255, 255, 0.02)`,border:`1px solid rgba(255, 255, 255, 0.06)`,borderRadius:`6px`},children:[(0,f.jsx)(`div`,{style:{fontSize:`10px`,color:`#9ca3af`,textTransform:`uppercase`,fontWeight:600,marginBottom:`4px`},children:`DockView State (INV-325-05)`}),(0,f.jsxs)(`div`,{style:{fontSize:`13px`,fontWeight:600,color:`#fbbf24`,display:`flex`,alignItems:`center`,gap:`6px`},children:[(0,f.jsx)(`span`,{children:`◫`}),(0,f.jsxs)(`span`,{children:[`Depressed (`,t,` Tabs Hydrated)`]})]})]})]}),x=({onSelectItem:e})=>{let t=u(l),h=u(n),g=u(o),x=u(s),S=Object.values(t),C=S.length,w=t=>{i(t),a(),e?.({type:`dimension`,dimension:t})},T=()=>{a(),e?.({type:`restore-dockview`})},E=()=>{a(),r.set(`abstract`),typeof window<`u`&&window.dispatchEvent(new CustomEvent(`clm:launch-preset`,{detail:{preset:`dual-viewport`}})),e?.({type:`preset`,preset:`dual-viewport`})},D=()=>{a(),r.set(`topology`),e?.({type:`preset`,preset:`topology`})},O=()=>{let t=typeof window<`u`?`${window.location.origin}/?mode=satellite&view=presentation`:`http://localhost:3000/`,n=d(t,{ratio:.5});typeof window<`u`&&(window.dispatchEvent(new CustomEvent(`clm:viewport-tile-requested`,{detail:{url:t,result:n,geometry:n.geometry}})),(n.popupBlocked||!n.success)&&(window.dispatchEvent(new CustomEvent(`clm:popup-blocked`,{detail:{message:`Browser popup blocked. Switched to in-app split view.`}})),a(),window.dispatchEvent(new CustomEvent(`clm:launch-preset`,{detail:{preset:`dual-viewport`}})))),e?.({type:`preset`,preset:`side-window`,result:n})},k=t=>{c.set(t),a(),e?.(t)},A=()=>{let t=S[0];t?k(t):(a(),e?.({type:`exemplar`,id:`seed-default`}))};return(0,f.jsx)(`div`,{className:`welcome-viewport clm-presentation-page`,"data-viewlet":`welcome`,"data-testid":`welcome-viewport`,style:{display:`flex`,flexDirection:`column`,alignItems:`center`,justifyContent:`flex-start`,width:`100%`,height:`100%`,padding:`44px 24px 64px 24px`,backgroundColor:`var(--vscode-editor-background, #1e1e1e)`,color:`var(--vscode-foreground, #cccccc)`,fontFamily:`var(--vscode-font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif)`,overflowY:`auto`,boxSizing:`border-box`},children:(0,f.jsxs)(`div`,{style:{maxWidth:`920px`,width:`100%`,display:`flex`,flexDirection:`column`,gap:`24px`},children:[(0,f.jsx)(p,{onEnterWorkbench:T,onSelectFirstExemplar:A}),(0,f.jsx)(m,{cardCount:C,storageBackendType:g.backendType,peerMesh:x,onSelectDimension:w}),(0,f.jsx)(_,{onSelectDimension:w,onSelectFirstExemplar:A}),(0,f.jsx)(v,{onLaunchDualPreset:E,onLaunchTopologyPreset:D,onLaunchAutonomousSideWindow:O}),(0,f.jsx)(y,{cardsList:S,onSelectCard:k,onSelectFirstExemplar:A}),(0,f.jsx)(b,{cardCount:C,activeTabCount:h})]})})};export{x as t};
@@ -0,0 +1 @@
1
+ import{t as e}from"./rolldown-runtime.Dd_uD5pT.js";var t=e(((e,t)=>{t.exports={}}));export default t();
@@ -1,7 +1,7 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["_astro/vendor-ai.CZe7UVVK.js","_astro/rolldown-runtime.Dd_uD5pT.js"])))=>i.map(i=>d[i]);
2
- import{g as e}from"./themeStore.zUMFLo3Q.js";import{R as t,o as n,u as r}from"./mcardStore.BiAvqM-D.js";import{t as i}from"./preload-helper.oCYlU9a4.js";var a={"browser:smollm2-360m":{modelId:`browser:smollm2-360m`,displayName:`SmolLM2-360M (0ms local WebGPU)`,sizeMb:230,engine:`webllm`,mlcModelId:`SmolLM2-360M-Instruct-q4f16_1-MLC`,defaultStatusText:`Checking cache...`,isPreloadCandidate:!0},"browser:qwen2.5-0.5b":{modelId:`browser:qwen2.5-0.5b`,displayName:`Qwen2.5-0.5B (0ms local WebGPU/Wasm)`,sizeMb:350,engine:`webllm`,mlcModelId:`Qwen2.5-0.5B-Instruct-q4f16_1-MLC`,defaultStatusText:`Checking cache...`},"browser:litert:gemma-4-e2b":{modelId:`browser:litert:gemma-4-e2b`,displayName:`Gemma 4 E2B (Experimental Local WebGPU, ~2.0GB)`,sizeMb:2048,engine:`litert`,litertModelUrl:`https://huggingface.co/litert-community/gemma-4-E2B-it-litert-lm/resolve/main/gemma-4-E2B-it-web.litertlm`,defaultStatusText:`Not downloaded`},"browser:window.ai":{modelId:`browser:window.ai`,displayName:`Chrome Built-in: Gemini Nano (window.ai)`,sizeMb:0,engine:`window.ai`,defaultStatusText:`System Native (0MB download)`}},o=Object.keys(a);function s(e){return a[e]?.mlcModelId??null}function c(e){return a[e]?.litertModelUrl??null}function l(){let e={};for(let[t,n]of Object.entries(a))e[t]={modelId:t,displayName:n.displayName,sizeMb:n.sizeMb,isCached:n.engine===`window.ai`,isDownloading:!1,progressPct:n.engine===`window.ai`?100:0,statusText:n.defaultStatusText,engine:n.engine};return e}var u=t(l()),d=e(null),f=new Set;function p(e){return f.add(e),()=>f.delete(e)}function m(e){let t=u.get()[e.modelId];if(t&&u.setKey(e.modelId,{...t,isDownloading:e.phase===`downloading`||e.phase===`compiling`,isCached:e.phase===`ready`||t.isCached,progressPct:e.percentage,statusText:e.text}),e.phase===`downloading`||e.phase===`compiling`)d.set({modelId:e.modelId,progressPct:e.percentage,statusText:e.text,phase:e.phase});else if(e.phase===`ready`||e.phase===`error`){let t=d.get();t&&t.modelId===e.modelId&&d.set(null)}for(let t of f)try{t(e)}catch(e){console.error(`[inBrowserLlm] Progress listener error:`,e)}}var h=new Set;function g(e){return h.add(e),()=>h.delete(e)}async function _(e){if(typeof window>`u`)return!1;if(e===`browser:window.ai`){let e=globalThis;return!!(e.window?.ai?.languageModel||e.ai?.languageModel)}let t=s(e);if(t)try{let n=await(await i(()=>import(`./vendor-ai.CZe7UVVK.js`).then(e=>e.t),__vite__mapDeps([0,1]))).hasModelInCache(t),r=u.get()[e];return r&&u.setKey(e,{...r,isCached:n,statusText:n?`Cached in OPFS`:`Not downloaded`}),n}catch{return!1}if(e.startsWith(`browser:litert:`))try{if(`caches`in window){let t=await caches.open(`clm-litertlm`),n=c(e);if(n){let r=!!await t.match(n),i=u.get()[e];return i&&u.setKey(e,{...i,isCached:r,statusText:r?`Cached in CacheStorage`:`Not downloaded`}),r}}}catch{return!1}return!1}async function v(){typeof window<`u`&&await Promise.all(o.map(e=>_(e).catch(()=>!1)))}async function y(e){if(typeof window>`u`)return;let t=s(e);if(t)try{await(await i(()=>import(`./vendor-ai.CZe7UVVK.js`).then(e=>e.t),__vite__mapDeps([0,1]))).deleteModelAllInfoInCache(t)}catch(e){console.warn(`[inBrowserLlm] Failed to delete WebLLM model from cache:`,e)}if(e.startsWith(`browser:litert:`))try{if(`caches`in window){let t=await caches.open(`clm-litertlm`),n=c(e);n&&await t.delete(n)}}catch(e){console.warn(`[inBrowserLlm] Failed to delete LiteRT model from cache:`,e)}for(let t of h)try{t(e)}catch(e){console.error(`[inBrowserLlm] Engine eviction error:`,e)}let n=u.get()[e];n&&u.setKey(e,{...n,isCached:!1,isDownloading:!1,progressPct:0,statusText:`Not downloaded`})}var b=class{#e=new Map;#t=new Map;constructor(){g(e=>{let t=s(e);t&&this.#e.delete(t)})}async getOrLoadEngine(e,t){let n=s(e);if(!n)throw Error(`Unsupported WebLLM model ID: ${e}`);if(this.#e.has(n))return this.#e.get(n);if(this.#t.has(n))return this.#t.get(n);let r=(async()=>{if(typeof window>`u`)throw Error(`WebLLM can only be executed in a browser client environment.`);if(!globalThis.navigator?.gpu){let t=`WebGPU is not available in this browser. To use WebGPU models (SmolLM2 / Qwen2.5), please use Chrome/Edge with hardware acceleration enabled.`;throw m({modelId:e,phase:`error`,text:t,percentage:0}),Error(t)}m({modelId:e,phase:`checking`,text:`Initializing WebGPU engine for ${n}...`,percentage:5}),t?.(`[Checking WebGPU runtime for ${n}...]\n`);let r=await(await i(()=>import(`./vendor-ai.CZe7UVVK.js`).then(e=>e.t),__vite__mapDeps([0,1]))).CreateMLCEngine(n,{initProgressCallback:n=>{let r=Math.round((n.progress||0)*100);m({modelId:e,phase:n.text.toLowerCase().includes(`compile`)||n.text.toLowerCase().includes(`shader`)?`compiling`:`downloading`,text:n.text,percentage:r}),t?.(`[${n.text}]\n`)}});return this.#e.set(n,r),this.#t.delete(n),m({modelId:e,phase:`ready`,text:`${n} ready in WebGPU memory.`,percentage:100}),r})().catch(e=>{throw this.#t.delete(n),e});return this.#t.set(n,r),r}async generate(e,t,n){try{let r=await this.getOrLoadEngine(e,e=>{n?.(e)});n?.(`\n[Generating completion with ${e} on WebGPU...]\n\n`);let i=await r.chat.completions.create({messages:[{role:`system`,content:`You are a helpful, accurate, and concise AI assistant running 100% locally inside the user browser via WebGPU.`},{role:`user`,content:t}],stream:!0,temperature:.6,max_tokens:512}),a=``;for await(let e of i){let t=e.choices[0]?.delta?.content||``;t&&(a+=t,n?.(t))}if(!a.trim())throw Error(`Model produced empty completion text`);return a}catch(t){let r=`[In-Browser WebGPU Execution Advisory]\n\nCould not execute ${e} on client WebGPU: ${t?.message||String(t)}\n\nTroubleshooting steps:\n1. Confirm WebGPU is supported and enabled in your browser (check chrome://gpu or edge://gpu).\n2. Ensure enough GPU VRAM is available (SmolLM2 requires ~300MB, Qwen2.5 requires ~500MB).\n3. If offline on the very first run, weights must be cached at least once with network access.`;return n?.(r),r}}evict(e){let t=s(e);t&&(this.#e.delete(t),this.#t.delete(t))}},x=class{#e=new Map;#t=new Map;constructor(){g(e=>{e.startsWith(`browser:litert:`)&&this.#e.delete(e)})}async getOrLoadEngine(e,t){let n=c(e);if(!n)throw Error(`Unsupported LiteRT-LM model ID: ${e}`);if(this.#e.has(e))return this.#e.get(e);if(this.#t.has(e))return this.#t.get(e);let r=(async()=>{if(typeof window>`u`)throw Error(`LiteRT-LM can only be executed in a browser client environment.`);if(!globalThis.navigator?.gpu){let t=`WebGPU is required for Google LiteRT-LM (Gemma 4 E2B). Please enable hardware acceleration in Chrome or Edge.`;throw m({modelId:e,phase:`error`,text:t,percentage:0}),Error(t)}m({modelId:e,phase:`checking`,text:`Loading Google AI Edge LiteRT-LM runtime...`,percentage:5}),t?.(`[Initializing Google LiteRT-LM WebGPU Runtime...]
3
- `);let r=await i(()=>import(`@litert-lm/core`),[]);m({modelId:e,phase:`downloading`,text:`Streaming Gemma 4 E2B .litertlm package (~2.0GB)...`,percentage:20}),t?.(`[Streaming Gemma 4 E2B .litertlm package (~2.0GB)...]
4
- `);let a=await r.Engine.create({model:n,backend:r.Backend.GPU_ARTISAN});return this.#e.set(e,a),this.#t.delete(e),m({modelId:e,phase:`ready`,text:`Gemma 4 E2B ready via LiteRT-LM WebGPU.`,percentage:100}),a})().catch(t=>{throw this.#t.delete(e),t});return this.#t.set(e,r),r}async generate(e,t,n){try{let r=await this.getOrLoadEngine(e,e=>{n?.(e)});n?.(`
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["_astro/vendor-ai.D6NcJ6lu.js","_astro/rolldown-runtime.Dd_uD5pT.js"])))=>i.map(i=>d[i]);
2
+ import{t as e}from"./preload-helper.oCYlU9a4.js";import{g as t}from"./themeStore.CEt0e54l.js";import{R as n,o as r,u as i}from"./mcardStore.CT-ollfl.js";var a={"browser:smollm2-360m":{modelId:`browser:smollm2-360m`,displayName:`SmolLM2-360M (0ms local WebGPU)`,sizeMb:230,engine:`webllm`,mlcModelId:`SmolLM2-360M-Instruct-q4f16_1-MLC`,defaultStatusText:`Checking cache...`,isPreloadCandidate:!0},"browser:qwen2.5-0.5b":{modelId:`browser:qwen2.5-0.5b`,displayName:`Qwen2.5-0.5B (0ms local WebGPU/Wasm)`,sizeMb:350,engine:`webllm`,mlcModelId:`Qwen2.5-0.5B-Instruct-q4f16_1-MLC`,defaultStatusText:`Checking cache...`},"browser:litert:gemma-4-e2b":{modelId:`browser:litert:gemma-4-e2b`,displayName:`Gemma 4 E2B (Experimental Local WebGPU, ~2.0GB)`,sizeMb:2048,engine:`litert`,litertModelUrl:`https://huggingface.co/litert-community/gemma-4-E2B-it-litert-lm/resolve/main/gemma-4-E2B-it-web.litertlm`,defaultStatusText:`Not downloaded`},"browser:window.ai":{modelId:`browser:window.ai`,displayName:`Chrome Built-in: Gemini Nano (window.ai)`,sizeMb:0,engine:`window.ai`,defaultStatusText:`System Native (0MB download)`}},o=Object.keys(a);function s(e){return a[e]?.mlcModelId??null}function c(e){return a[e]?.litertModelUrl??null}function l(){let e={};for(let[t,n]of Object.entries(a))e[t]={modelId:t,displayName:n.displayName,sizeMb:n.sizeMb,isCached:n.engine===`window.ai`,isDownloading:!1,progressPct:n.engine===`window.ai`?100:0,statusText:n.defaultStatusText,engine:n.engine};return e}var u=n(l()),d=t(null),f=new Set;function p(e){return f.add(e),()=>f.delete(e)}function m(e){let t=u.get()[e.modelId];if(t&&u.setKey(e.modelId,{...t,isDownloading:e.phase===`downloading`||e.phase===`compiling`,isCached:e.phase===`ready`||t.isCached,progressPct:e.percentage,statusText:e.text}),e.phase===`downloading`||e.phase===`compiling`)d.set({modelId:e.modelId,progressPct:e.percentage,statusText:e.text,phase:e.phase});else if(e.phase===`ready`||e.phase===`error`){let t=d.get();t&&t.modelId===e.modelId&&d.set(null)}for(let t of f)try{t(e)}catch(e){console.error(`[inBrowserLlm] Progress listener error:`,e)}}var h=new Set;function g(e){return h.add(e),()=>h.delete(e)}async function _(t){if(typeof window>`u`)return!1;if(t===`browser:window.ai`){let e=globalThis;return!!(e.window?.ai?.languageModel||e.ai?.languageModel)}let n=s(t);if(n)try{let r=await(await e(()=>import(`./vendor-ai.D6NcJ6lu.js`).then(e=>e.t),__vite__mapDeps([0,1]))).hasModelInCache(n),i=u.get()[t];return i&&u.setKey(t,{...i,isCached:r,statusText:r?`Cached in OPFS`:`Not downloaded`}),r}catch{return!1}if(t.startsWith(`browser:litert:`))try{if(`caches`in window){let e=await caches.open(`clm-litertlm`),n=c(t);if(n){let r=!!await e.match(n),i=u.get()[t];return i&&u.setKey(t,{...i,isCached:r,statusText:r?`Cached in CacheStorage`:`Not downloaded`}),r}}}catch{return!1}return!1}async function v(){typeof window<`u`&&await Promise.all(o.map(e=>_(e).catch(()=>!1)))}async function y(t){if(typeof window>`u`)return;let n=s(t);if(n)try{await(await e(()=>import(`./vendor-ai.D6NcJ6lu.js`).then(e=>e.t),__vite__mapDeps([0,1]))).deleteModelAllInfoInCache(n)}catch(e){console.warn(`[inBrowserLlm] Failed to delete WebLLM model from cache:`,e)}if(t.startsWith(`browser:litert:`))try{if(`caches`in window){let e=await caches.open(`clm-litertlm`),n=c(t);n&&await e.delete(n)}}catch(e){console.warn(`[inBrowserLlm] Failed to delete LiteRT model from cache:`,e)}for(let e of h)try{e(t)}catch(e){console.error(`[inBrowserLlm] Engine eviction error:`,e)}let r=u.get()[t];r&&u.setKey(t,{...r,isCached:!1,isDownloading:!1,progressPct:0,statusText:`Not downloaded`})}var b=class{#e=new Map;#t=new Map;constructor(){g(e=>{let t=s(e);t&&this.#e.delete(t)})}async getOrLoadEngine(t,n){let r=s(t);if(!r)throw Error(`Unsupported WebLLM model ID: ${t}`);if(this.#e.has(r))return this.#e.get(r);if(this.#t.has(r))return this.#t.get(r);let i=(async()=>{if(typeof window>`u`)throw Error(`WebLLM can only be executed in a browser client environment.`);if(!globalThis.navigator?.gpu){let e=`WebGPU is not available in this browser. To use WebGPU models (SmolLM2 / Qwen2.5), please use Chrome/Edge with hardware acceleration enabled.`;throw m({modelId:t,phase:`error`,text:e,percentage:0}),Error(e)}m({modelId:t,phase:`checking`,text:`Initializing WebGPU engine for ${r}...`,percentage:5}),n?.(`[Checking WebGPU runtime for ${r}...]\n`);let i=await(await e(()=>import(`./vendor-ai.D6NcJ6lu.js`).then(e=>e.t),__vite__mapDeps([0,1]))).CreateMLCEngine(r,{initProgressCallback:e=>{let r=Math.round((e.progress||0)*100);m({modelId:t,phase:e.text.toLowerCase().includes(`compile`)||e.text.toLowerCase().includes(`shader`)?`compiling`:`downloading`,text:e.text,percentage:r}),n?.(`[${e.text}]\n`)}});return this.#e.set(r,i),this.#t.delete(r),m({modelId:t,phase:`ready`,text:`${r} ready in WebGPU memory.`,percentage:100}),i})().catch(e=>{throw this.#t.delete(r),e});return this.#t.set(r,i),i}async generate(e,t,n){try{let r=await this.getOrLoadEngine(e,e=>{n?.(e)});n?.(`\n[Generating completion with ${e} on WebGPU...]\n\n`);let i=await r.chat.completions.create({messages:[{role:`system`,content:`You are a helpful, accurate, and concise AI assistant running 100% locally inside the user browser via WebGPU.`},{role:`user`,content:t}],stream:!0,temperature:.6,max_tokens:512}),a=``;for await(let e of i){let t=e.choices[0]?.delta?.content||``;t&&(a+=t,n?.(t))}if(!a.trim())throw Error(`Model produced empty completion text`);return a}catch(t){let r=`[In-Browser WebGPU Execution Advisory]\n\nCould not execute ${e} on client WebGPU: ${t?.message||String(t)}\n\nTroubleshooting steps:\n1. Confirm WebGPU is supported and enabled in your browser (check chrome://gpu or edge://gpu).\n2. Ensure enough GPU VRAM is available (SmolLM2 requires ~300MB, Qwen2.5 requires ~500MB).\n3. If offline on the very first run, weights must be cached at least once with network access.`;return n?.(r),r}}evict(e){let t=s(e);t&&(this.#e.delete(t),this.#t.delete(t))}},x=class{#e=new Map;#t=new Map;constructor(){g(e=>{e.startsWith(`browser:litert:`)&&this.#e.delete(e)})}async getOrLoadEngine(t,n){let r=c(t);if(!r)throw Error(`Unsupported LiteRT-LM model ID: ${t}`);if(this.#e.has(t))return this.#e.get(t);if(this.#t.has(t))return this.#t.get(t);let i=(async()=>{if(typeof window>`u`)throw Error(`LiteRT-LM can only be executed in a browser client environment.`);if(!globalThis.navigator?.gpu){let e=`WebGPU is required for Google LiteRT-LM (Gemma 4 E2B). Please enable hardware acceleration in Chrome or Edge.`;throw m({modelId:t,phase:`error`,text:e,percentage:0}),Error(e)}m({modelId:t,phase:`checking`,text:`Loading Google AI Edge LiteRT-LM runtime...`,percentage:5}),n?.(`[Initializing Google LiteRT-LM WebGPU Runtime...]
3
+ `);let i=await e(()=>import(`./vendor-ai.D6NcJ6lu.js`).then(e=>e.n),__vite__mapDeps([0,1]));m({modelId:t,phase:`downloading`,text:`Streaming Gemma 4 E2B .litertlm package (~2.0GB)...`,percentage:20}),n?.(`[Streaming Gemma 4 E2B .litertlm package (~2.0GB)...]
4
+ `);let a=await i.Engine.create({model:r,backend:i.Backend.GPU_ARTISAN});return this.#e.set(t,a),this.#t.delete(t),m({modelId:t,phase:`ready`,text:`Gemma 4 E2B ready via LiteRT-LM WebGPU.`,percentage:100}),a})().catch(e=>{throw this.#t.delete(t),e});return this.#t.set(t,i),i}async generate(e,t,n){try{let r=await this.getOrLoadEngine(e,e=>{n?.(e)});n?.(`
5
5
  [Generating completion with Google Gemma 4 E2B (LiteRT-LM WebGPU)...]
6
6
 
7
7
  `);let i=(await r.createConversation()).sendMessageStreaming(t).getReader(),a=``;for(;;){let{done:e,value:t}=await i.read();if(e)break;let r=typeof t?.content==`string`?t.content:``,o=r.slice(a.length);o&&(a=r,n?.(o))}if(!a.trim())throw Error(`LiteRT-LM produced empty response`);return a}catch(t){let r=`[Google LiteRT-LM Execution Advisory]\n\nCould not execute ${e} on client WebGPU: ${t?.message||String(t)}\n\nTroubleshooting steps:\n1. Gemma 4 E2B requires ~2.5GB GPU VRAM and WebGPU with GPU Artisan support.\n2. Ensure your connection allows downloading the 2.0GB model package from Hugging Face.\n3. For instant, low-overhead generation, switch to a lightweight WebGPU model or Chrome Gemini Nano.`;return n?.(r),r}}evict(e){this.#e.delete(e),this.#t.delete(e)}},S=class{isAvailable(){if(typeof window>`u`)return!1;let e=globalThis;return!!(e.window?.ai?.languageModel||e.ai?.languageModel)}async generate(e,t){let n=globalThis,r=n.window?.ai??n.ai;if(!r){let e=`[Chrome Built-in: Gemini Nano (window.ai) - Prompt API Not Found] (browser:window.ai)
@@ -17,4 +17,4 @@ Tip: You can switch to local WebGPU models for instant execution!`;return t?.(e)
17
17
  Your hardware or operating system does not currently meet Chrome's requirements for on-device Gemini Nano.
18
18
  Please use an alternative in-browser model for guaranteed WebGPU client execution.`;return t?.(e),e}e.available===`after-download`&&t?.(`[Notice: Chrome is downloading the Gemini Nano on-device model in the background...]
19
19
 
20
- `)}let i=await(n.create?n.create({systemPrompt:`You are a helpful, concise AI assistant running on-device inside Google Chrome.`}):r.createTextSession());if(i.promptStreaming){let n=i.promptStreaming(e),r=``,a=0;for await(let e of n){let n=typeof e==`string`&&e.length>=a?e.slice(a):String(e);a=typeof e==`string`?e.length:a+n.length,r+=n,n&&t?.(n)}return r||await i.prompt(e)}if(i.prompt){let n=await i.prompt(e);return t?.(n),n}throw Error(`Unknown Chrome Prompt API session interface`)}catch(e){let n=`[Chrome Prompt API Error: ${e?.message||String(e)}]\n\nEnsure chrome://flags/#prompt-api-for-gemini-nano is enabled, and 'Optimization Guide On Device Model' in chrome://components is fully downloaded.`;return t?.(n),n}}},C=new class{#e=new b;#t=new x;#n=new S;#r=!1;getMlcModelId(e){return s(e)}getLiteRtModelUrl(e){return c(e)}addProgressListener(e){return p(e)}notifyProgress(e){m(e)}async hasModelCached(e){return _(e)}async refreshAllModelStatus(){return v()}async deleteModelCache(e){return y(e)}async getOrLoadMlcEngine(e,t){return this.#e.getOrLoadEngine(e,t)}async getOrLoadLiteRtEngine(e,t){return this.#t.getOrLoadEngine(e,t)}async generateLiteRt(e,t,n){return this.#t.generate(e,t,n)}async generateWindowAi(e,t){return this.#n.generate(e,t)}async preloadModel(e,t){return e.startsWith(`browser:litert:`)?this.#t.getOrLoadEngine(e,t):this.#e.getOrLoadEngine(e,t)}async initFirstLaunchAutoPreload(){if(!(typeof window>`u`||this.#r)){this.#r=!0;try{if(!globalThis.navigator?.gpu||(await this.refreshAllModelStatus(),await this.hasModelCached(`browser:smollm2-360m`))||localStorage.getItem(`clm:inbrowser:auto_download_default`)!==`true`)return;console.log(`[InBrowserLlmService] Initiating background preload for SmolLM2-360M (~230MB)...`),this.preloadModel(`browser:smollm2-360m`).catch(e=>{console.warn(`[InBrowserLlmService] Background preload non-fatal warning:`,e)})}catch(e){console.warn(`[InBrowserLlmService] Auto preload check error:`,e)}}}async generate(e,t,n){return e===`browser:window.ai`?this.#n.generate(t,n):e.startsWith(`browser:litert:`)?this.#t.generate(e,t,n):this.#e.generate(e,t,n)}},w=`did:key:z6MkhaXgBZDvotDkL5257faiztiGiC2QtKLGpbnnEGta2doK`,T=`clm:agent_identity:credentials`,E={google:{did:`did:pkc:eoa:google:ai-studio`,name:`Google Cloud AI / Gemini`,nature:`frontier-foundation-model`,endpoint:`https://generativelanguage.googleapis.com/v1beta`},ollama:{did:`did:pkc:eoa:local:ollama-daemon`,name:`Local Ollama Daemon`,nature:`local-inference-daemon`,endpoint:`http://127.0.0.1:11434`},deepseek:{did:`did:pkc:eoa:deepseek:api`,name:`DeepSeek AI Platform`,nature:`frontier-foundation-model`,endpoint:`https://api.deepseek.com`},openai:{did:`did:pkc:eoa:openai:api`,name:`OpenAI Foundation Models`,nature:`frontier-foundation-model`,endpoint:`https://api.openai.com/v1`},anthropic:{did:`did:pkc:eoa:anthropic:api`,name:`Anthropic Claude Engine`,nature:`frontier-foundation-model`,endpoint:`https://api.anthropic.com/v1`}};function D(e){return e?e.length<=8?`********`:`${e.slice(0,6)}...${e.slice(-4)}`:``}function O(e,t=``,n){let r=E[e]||{did:`did:pkc:eoa:custom:${e}`,name:`${e.toUpperCase()} Compatible Provider`,nature:`frontier-foundation-model`,endpoint:n||`http://127.0.0.1:11434`},i=e===`google`?[`clm:llm:generate_content`,`clm:llm:stream_content`,`clm:llm:multimodal_vision`]:[`clm:llm:chat`],a=e===`google`?[`gemini-3.8-flash`,`gemini-3.8-pro`,`gemini-2.5-flash`,`gemini-1.5-pro`]:[];return{provider:e,agencyEoa:{...r,endpoint:n||r.endpoint},authN:{type:`bearer-api-key`,token:t,fingerprint:D(t),isValidated:!1},authO:{capabilities:i,allowedModels:a,quotaTier:e===`ollama`?`unlimited-local`:`pay-as-you-go`,vcardPreGateVerified:!1}}}function k(e=w){if(typeof window>`u`)return{$schema:`https://clm.govtech.sg/schemas/credentials.v2.json`,callerEoaDid:e,providers:{},lastUpdated:new Date().toISOString()};let t=localStorage.getItem(T);if(t)try{let e=JSON.parse(t);if(e&&typeof e==`object`&&e.providers)return e}catch{}return{$schema:`https://clm.govtech.sg/schemas/credentials.v2.json`,callerEoaDid:e,providers:{},lastUpdated:new Date().toISOString()}}function A(e=w,t){if(typeof window>`u`)return;let n=k(e);n.providers[t.provider]={...t,authN:{...t.authN,fingerprint:D(t.authN.token)}},n.lastUpdated=new Date().toISOString(),localStorage.setItem(T,JSON.stringify(n)),t.provider===`google`?(localStorage.setItem(`clm:llm_config:google_api_key`,t.authN.token),localStorage.setItem(`clm:chat:api_token`,t.authN.token),localStorage.setItem(`clm:gemini_api_key`,t.authN.token),localStorage.setItem(`clm:chat:endpoint`,t.agencyEoa.endpoint)):t.provider===`ollama`&&localStorage.setItem(`clm:chat:endpoint`,t.agencyEoa.endpoint),r({provider:t.provider,baseUrl:t.agencyEoa.endpoint,apiKey:t.authN.token,providerEoaDid:t.agencyEoa.did})}function j(e=w,t){return k(e).providers[t]||null}function M(e){if(typeof window>`u`)return!1;let t=!1,n=localStorage.getItem(`clm:llm_config:google_api_key`)||localStorage.getItem(`clm:chat:api_token`)||localStorage.getItem(`clm:gemini_api_key`);if(n&&(!e.providers.google||!e.providers.google.authN.token)){let r=O(`google`,n);r.authN.isValidated=!0,e.providers.google=r,t=!0}let r=localStorage.getItem(`clm:chat:endpoint`);if(r&&(!e.providers.ollama||!e.providers.ollama.agencyEoa.endpoint)){let n=O(`ollama`,``,r);e.providers.ollama=n,t=!0}return t&&(e.lastUpdated=new Date().toISOString(),localStorage.setItem(T,JSON.stringify(e))),t}function N(){if(typeof window>`u`)return;let e=k();M(e);let t=e.providers.google?.authN.token||(typeof localStorage<`u`?localStorage.getItem(`clm:llm_config:google_api_key`)||localStorage.getItem(`clm:gemini_api_key`):null),i=localStorage.getItem(`clm:chat:provider`)||(t?`google`:`ollama`),a=e.providers[i];a||(a=O(i),e.providers[i]=a,localStorage.setItem(T,JSON.stringify(e))),r({provider:i,baseUrl:a.agencyEoa.endpoint,apiKey:a.authN.token,providerEoaDid:a.agencyEoa.did});let o=localStorage.getItem(`clm:chat:active_model`);o?n.set(o):i===`google`&&a.authN.token&&(n.set(`gemini:gemini-3.8-flash`),localStorage.setItem(`clm:chat:active_model`,`gemini:gemini-3.8-flash`))}function P(){if(typeof window>`u`)return{provider:`google`,model:`gemini-3.8-flash`,baseUrl:`https://generativelanguage.googleapis.com/v1beta`,apiKey:``,temperature:.7,providerEoaDid:`did:pkc:eoa:google:ai-studio`};let e=localStorage.getItem(`clm:llm_config:google_api_key`)||localStorage.getItem(`clm:gemini_api_key`),t=localStorage.getItem(`clm:chat:provider`)||(e?`google`:`ollama`),n=j(w,t),r=E[t],i=n?.agencyEoa.endpoint||localStorage.getItem(`clm:chat:endpoint`)||r?.endpoint||`https://generativelanguage.googleapis.com/v1beta`,a=n?.authN.token||t===`google`&&localStorage.getItem(`clm:llm_config:google_api_key`)||``,o=localStorage.getItem(`clm:chat:model`);return t===`google`&&(!o||!o.startsWith(`gemini`))?o=`gemini-3.8-flash`:t===`ollama`&&(!o||o.startsWith(`gemini`))?o=`qwen2.5-coder:7b`:o||=t===`google`?`gemini-3.8-flash`:`qwen2.5-coder:7b`,{provider:t,model:o,baseUrl:i,apiKey:a,temperature:Number(localStorage.getItem(`clm:chat:temperature`))||.7,providerEoaDid:n?.agencyEoa.did||r?.did,endpoint:i,apiToken:a}}export{j as a,C as c,a as d,P as i,d as l,E as n,N as o,O as r,A as s,w as t,u};
20
+ `)}let i=await(n.create?n.create({systemPrompt:`You are a helpful, concise AI assistant running on-device inside Google Chrome.`}):r.createTextSession());if(i.promptStreaming){let n=i.promptStreaming(e),r=``,a=0;for await(let e of n){let n=typeof e==`string`&&e.length>=a?e.slice(a):String(e);a=typeof e==`string`?e.length:a+n.length,r+=n,n&&t?.(n)}return r||await i.prompt(e)}if(i.prompt){let n=await i.prompt(e);return t?.(n),n}throw Error(`Unknown Chrome Prompt API session interface`)}catch(e){let n=`[Chrome Prompt API Error: ${e?.message||String(e)}]\n\nEnsure chrome://flags/#prompt-api-for-gemini-nano is enabled, and 'Optimization Guide On Device Model' in chrome://components is fully downloaded.`;return t?.(n),n}}},C=new class{#e=new b;#t=new x;#n=new S;#r=!1;getMlcModelId(e){return s(e)}getLiteRtModelUrl(e){return c(e)}addProgressListener(e){return p(e)}notifyProgress(e){m(e)}async hasModelCached(e){return _(e)}async refreshAllModelStatus(){return v()}async deleteModelCache(e){return y(e)}async getOrLoadMlcEngine(e,t){return this.#e.getOrLoadEngine(e,t)}async getOrLoadLiteRtEngine(e,t){return this.#t.getOrLoadEngine(e,t)}async generateLiteRt(e,t,n){return this.#t.generate(e,t,n)}async generateWindowAi(e,t){return this.#n.generate(e,t)}async preloadModel(e,t){return e.startsWith(`browser:litert:`)?this.#t.getOrLoadEngine(e,t):this.#e.getOrLoadEngine(e,t)}async initFirstLaunchAutoPreload(){if(!(typeof window>`u`||this.#r)){this.#r=!0;try{if(!globalThis.navigator?.gpu||(await this.refreshAllModelStatus(),await this.hasModelCached(`browser:smollm2-360m`))||localStorage.getItem(`clm:inbrowser:auto_download_default`)!==`true`)return;console.log(`[InBrowserLlmService] Initiating background preload for SmolLM2-360M (~230MB)...`),this.preloadModel(`browser:smollm2-360m`).catch(e=>{console.warn(`[InBrowserLlmService] Background preload non-fatal warning:`,e)})}catch(e){console.warn(`[InBrowserLlmService] Auto preload check error:`,e)}}}async generate(e,t,n){return e===`browser:window.ai`?this.#n.generate(t,n):e.startsWith(`browser:litert:`)?this.#t.generate(e,t,n):this.#e.generate(e,t,n)}},w=`did:key:z6MkhaXgBZDvotDkL5257faiztiGiC2QtKLGpbnnEGta2doK`,T=`clm:agent_identity:credentials`,E={google:{did:`did:pkc:eoa:google:ai-studio`,name:`Google Cloud AI / Gemini`,nature:`frontier-foundation-model`,endpoint:`https://generativelanguage.googleapis.com/v1beta`},ollama:{did:`did:pkc:eoa:local:ollama-daemon`,name:`Local Ollama Daemon`,nature:`local-inference-daemon`,endpoint:`http://127.0.0.1:11434`},deepseek:{did:`did:pkc:eoa:deepseek:api`,name:`DeepSeek AI Platform`,nature:`frontier-foundation-model`,endpoint:`https://api.deepseek.com`},openai:{did:`did:pkc:eoa:openai:api`,name:`OpenAI Foundation Models`,nature:`frontier-foundation-model`,endpoint:`https://api.openai.com/v1`},anthropic:{did:`did:pkc:eoa:anthropic:api`,name:`Anthropic Claude Engine`,nature:`frontier-foundation-model`,endpoint:`https://api.anthropic.com/v1`}};function D(e){return e?e.length<=8?`********`:`${e.slice(0,6)}...${e.slice(-4)}`:``}function O(e,t=``,n){let r=E[e]||{did:`did:pkc:eoa:custom:${e}`,name:`${e.toUpperCase()} Compatible Provider`,nature:`frontier-foundation-model`,endpoint:n||`http://127.0.0.1:11434`},i=e===`google`?[`clm:llm:generate_content`,`clm:llm:stream_content`,`clm:llm:multimodal_vision`]:[`clm:llm:chat`],a=e===`google`?[`gemini-3.8-flash`,`gemini-3.8-pro`,`gemini-2.5-flash`,`gemini-1.5-pro`]:[];return{provider:e,agencyEoa:{...r,endpoint:n||r.endpoint},authN:{type:`bearer-api-key`,token:t,fingerprint:D(t),isValidated:!1},authO:{capabilities:i,allowedModels:a,quotaTier:e===`ollama`?`unlimited-local`:`pay-as-you-go`,vcardPreGateVerified:!1}}}function k(e=w){if(typeof window>`u`)return{$schema:`https://clm.govtech.sg/schemas/credentials.v2.json`,callerEoaDid:e,providers:{},lastUpdated:new Date().toISOString()};let t=localStorage.getItem(T);if(t)try{let e=JSON.parse(t);if(e&&typeof e==`object`&&e.providers)return e}catch{}return{$schema:`https://clm.govtech.sg/schemas/credentials.v2.json`,callerEoaDid:e,providers:{},lastUpdated:new Date().toISOString()}}function A(e=w,t){if(typeof window>`u`)return;let n=k(e);n.providers[t.provider]={...t,authN:{...t.authN,fingerprint:D(t.authN.token)}},n.lastUpdated=new Date().toISOString(),localStorage.setItem(T,JSON.stringify(n)),t.provider===`google`?(localStorage.setItem(`clm:llm_config:google_api_key`,t.authN.token),localStorage.setItem(`clm:chat:api_token`,t.authN.token),localStorage.setItem(`clm:gemini_api_key`,t.authN.token),localStorage.setItem(`clm:chat:endpoint`,t.agencyEoa.endpoint)):t.provider===`ollama`&&localStorage.setItem(`clm:chat:endpoint`,t.agencyEoa.endpoint),i({provider:t.provider,baseUrl:t.agencyEoa.endpoint,apiKey:t.authN.token,providerEoaDid:t.agencyEoa.did})}function j(e=w,t){return k(e).providers[t]||null}function M(e){if(typeof window>`u`)return!1;let t=!1,n=localStorage.getItem(`clm:llm_config:google_api_key`)||localStorage.getItem(`clm:chat:api_token`)||localStorage.getItem(`clm:gemini_api_key`);if(n&&(!e.providers.google||!e.providers.google.authN.token)){let r=O(`google`,n);r.authN.isValidated=!0,e.providers.google=r,t=!0}let r=localStorage.getItem(`clm:chat:endpoint`);if(r&&(!e.providers.ollama||!e.providers.ollama.agencyEoa.endpoint)){let n=O(`ollama`,``,r);e.providers.ollama=n,t=!0}return t&&(e.lastUpdated=new Date().toISOString(),localStorage.setItem(T,JSON.stringify(e))),t}function N(){if(typeof window>`u`)return;let e=k();M(e);let t=e.providers.google?.authN.token||(typeof localStorage<`u`?localStorage.getItem(`clm:llm_config:google_api_key`)||localStorage.getItem(`clm:gemini_api_key`):null),n=localStorage.getItem(`clm:chat:provider`)||(t?`google`:`ollama`),a=e.providers[n];a||(a=O(n),e.providers[n]=a,localStorage.setItem(T,JSON.stringify(e))),i({provider:n,baseUrl:a.agencyEoa.endpoint,apiKey:a.authN.token,providerEoaDid:a.agencyEoa.did});let o=localStorage.getItem(`clm:chat:active_model`);o?r.set(o):n===`google`&&a.authN.token&&(r.set(`gemini:gemini-3.8-flash`),localStorage.setItem(`clm:chat:active_model`,`gemini:gemini-3.8-flash`))}function P(){if(typeof window>`u`)return{provider:`google`,model:`gemini-3.8-flash`,baseUrl:`https://generativelanguage.googleapis.com/v1beta`,apiKey:``,temperature:.7,providerEoaDid:`did:pkc:eoa:google:ai-studio`};let e=localStorage.getItem(`clm:llm_config:google_api_key`)||localStorage.getItem(`clm:gemini_api_key`),t=localStorage.getItem(`clm:chat:provider`)||(e?`google`:`ollama`),n=j(w,t),r=E[t],i=n?.agencyEoa.endpoint||localStorage.getItem(`clm:chat:endpoint`)||r?.endpoint||`https://generativelanguage.googleapis.com/v1beta`,a=n?.authN.token||t===`google`&&localStorage.getItem(`clm:llm_config:google_api_key`)||``,o=localStorage.getItem(`clm:chat:model`);return t===`google`&&(!o||!o.startsWith(`gemini`))?o=`gemini-3.8-flash`:t===`ollama`&&(!o||o.startsWith(`gemini`))?o=`qwen2.5-coder:7b`:o||=t===`google`?`gemini-3.8-flash`:`qwen2.5-coder:7b`,{provider:t,model:o,baseUrl:i,apiKey:a,temperature:Number(localStorage.getItem(`clm:chat:temperature`))||.7,providerEoaDid:n?.agencyEoa.did||r?.did,endpoint:i,apiToken:a}}export{j as a,C as c,a as d,P as i,d as l,E as n,N as o,O as r,A as s,w as t,u};
@@ -0,0 +1 @@
1
+ import{D as e}from"./vendor-clm-kernel.Bvk3XHk2.js";import{n as t}from"./disposable.Dsb0sbRP.js";import{n}from"./webappUrlResolver.BdblM2xU.js";var r=(e,t,n,r,i)=>({detectedType:e,mimeType:i,category:t,subclass:n,renderer:r});function i(e){let t=e.path,n=e.content??``;return t.includes(`spotify`)||t.includes(`youtube`)||t.includes(`/audio/`)||t.includes(`:audio:`)||t.includes(`/videos/`)||t.includes(`:videos:`)||n.includes(`open.spotify.com/`)||n.includes(`spotify:`)||n.includes(`youtube.com/`)||n.includes(`youtu.be/`)}var a=[{id:`vcard`,match:e=>e.path.includes(`witness`)||e.path.includes(`vcard`)||(e.content?.includes(`output: bool`)??!1),result:e=>r(`vcard`,`code`,`VCard`,`TraceInspector`,e.mime)},{id:`pcard`,match:e=>e.path.includes(`/e2e/`)||e.path.includes(`/concrete/`)||e.path.endsWith(`.ts`)||e.path.endsWith(`.py`)||(e.content?.includes(`action: run`)??!1)||(e.content?.includes(`PCard extends MCard`)??!1),result:e=>r(`pcard`,`code`,`PCard`,`ClmViewlet`,e.mime)},{id:`schema`,match:e=>e.path.includes(`/schemas/`)||e.path.includes(`schema`)||e.path.includes(`asset:clm:schemas`),result:e=>r(`schema`,`schema`,`MCard`,`SchemaInspector`,e.mime)},{id:`profile`,match:e=>e.path.includes(`/profiles/`)||e.path.includes(`profile`)||e.path.includes(`asset:personal:profiles`),result:e=>r(`profile`,`profile`,`MCard`,`ProfileCard`,e.mime)},{id:`specification`,match:e=>e.path.includes(`/abstract/`),result:e=>r(`specification`,`document`,`MCard`,`SpecificationViewer`,e.mime)},{id:`markdown`,match:e=>e.path.endsWith(`.md`)||e.mime===`text/markdown`,result:e=>r(`markdown`,`document`,`MCard`,`MarkdownViewer`,e.mime)},{id:`pdf`,match:e=>e.mime===`application/pdf`,result:e=>r(`media`,`document`,`MCard`,`PdfViewer`,e.mime)},{id:`html`,match:e=>e.mime===`text/html`,result:e=>r(`media`,`document`,`MCard`,`HtmlViewer`,e.mime)},{id:`image`,match:e=>e.mime.startsWith(`image/`),result:e=>r(`media`,`image`,`MCard`,e.mime===`image/svg+xml`?`SvgViewer`:`ImageViewer`,e.mime)},{id:`model`,match:e=>e.mime.startsWith(`model/`),result:e=>r(`media`,`model3d`,`MCard`,`Model3dViewer`,e.mime)},{id:`audio`,match:e=>e.mime.startsWith(`audio/`)||(e.path.includes(`/audio/`)||e.path.includes(`:audio:`))&&e.path.includes(`spotify`)||(e.content?.includes(`open.spotify.com/`)??!1)||(e.content?.includes(`spotify:`)??!1),result:e=>r(`media`,`audio`,`MCard`,`AudioPlayer`,e.mime||`audio/mpeg`)},{id:`video`,match:e=>e.mime===`video/mp4`||(e.path.includes(`/videos/`)||e.path.includes(`:videos:`))&&(e.path.endsWith(`.mp4`)||e.path.includes(`youtube`))||(e.content?.includes(`youtube.com/`)??!1)||(e.content?.includes(`youtu.be/`)??!1),result:e=>r(`media`,`video`,`MCard`,`VideoPlayer`,e.mime||`video/mp4`)},{id:`csv`,match:e=>e.mime===`text/csv`,result:e=>r(`media`,`document`,`MCard`,`TableViewer`,e.mime)},{id:`xml`,match:e=>e.mime===`application/xml`||e.mime===`text/xml`,result:e=>r(`media`,`document`,`MCard`,`XmlViewer`,e.mime)},{id:`tikz`,match:e=>e.mime===`text/x-tikz`||e.mime===`text/x-tikzcd`||e.path.endsWith(`.tikz`)||e.path.endsWith(`.tikzcd`)||e.path.endsWith(`.tikz-cd`),result:e=>r(`media`,`document`,`MCard`,`TikzDiagramViewlet`,e.mime||(e.path.endsWith(`.tikzcd`)||e.path.endsWith(`.tikz-cd`)?`text/x-tikzcd`:`text/x-tikz`))},{id:`webapp`,match:(e,t)=>e.path.endsWith(`.url`)||e.path.endsWith(`.url.txt`)||e.path.includes(`.url.`)||e.path.endsWith(`_url.txt`)||e.mime===`text/uri-list`||e.path.includes(`/webapps/`)||e.path.includes(`:webapps:`)||e.path.includes(`/apps/`)||e.path.includes(`:apps:`)||(t.isWebappUrl?.(e.content,e.path,e.name)??!1),result:e=>r(`document`,`document`,`MCard`,`WebappZenViewlet`,e.mime===`text/uri-list`?e.mime:`text/uri-list`)},{id:`text`,match:e=>e.mime===`text/plain`,result:e=>r(`media`,`document`,`MCard`,`TextViewer`,e.mime)}];function o(e,t={}){for(let n of a)if(!(n.id===`webapp`&&n.match(e,t)&&i(e))&&n.match(e,t))return n.result(e);return r(`binary`,`document`,`MCard`,`HexViewer`,e.mime)}var s=new t;function c(t){let n=t.split(`.`).pop()?.toLowerCase()||``,r=t.toLowerCase();if(n===`url`||r.endsWith(`.url`)||r.endsWith(`.url.txt`))return`text/uri-list`;let i=e(new Uint8Array,n);return i===`application/octet-stream`?n===`rs`?`text/rust`:n===`sh`?`text/x-sh`:`application/octet-stream`:i}function l(e){let t=(e.path||e.handle||``).toLowerCase();return{path:t,mime:e.mimeType||c(t),content:typeof e.content==`string`?e.content:void 0}}function u(e){let{path:t,mime:r,content:i}=l(e),a=s.judge({handle:t,content:i??``,mimeHint:r});return o({path:t,mime:r,content:i,name:e.name,judgment:a},{isWebappUrl:(e,t,r)=>n(e,t,r)})}export{c as n,u as t};
@@ -0,0 +1 @@
1
+ import{i as e}from"./rolldown-runtime.Dd_uD5pT.js";import{a as t}from"./vendor-react.DpDU3q_x.js";import{E as n,T as r,c as i,d as a,i as o,l as s,m as c,u as l,z as u}from"./vendor-clm-kernel.Bvk3XHk2.js";function d(e,t){let n=p(t),r=e;for(let e of n){if(r==null)return;r=r[e]}return r}var f=/(.*)\[(\d+)\]/;function p(e){return e.split(`.`).flatMap(e=>m(e))}function m(e){if(f.test(e)){let[,t,n]=e.match(f);return[...m(t),n]}return[e]}function h(e,t,n){let r=new Set(t);return e.listen((i,a,o)=>{let s=e=>!Object.is(d(i,e),d(a,e));(o===void 0?t.some(t=>a===void 0||(e.eqKey?!e.eqKey(a[t],i[t],t):s(t))):r.has(o)||typeof o==`string`&&(r.has(o.split(/\.|\[/)[0])||!e.eqKey&&a!==void 0&&t.some(s)))&&n(i,a,o)})}var g=e(t(),1),_=(e,t)=>n=>{e.current!==n&&(e.current=n,t())};function v(e,{keys:t,deps:n=[e,t],ssr:r}={}){let i=(0,g.useRef)();i.current=e.get();let a=(0,g.useCallback)(n=>(_(i,n)(e.value),t?.length>0?h(e,t,_(i,n)):e.listen(_(i,n))),n),o=()=>i.current,s=o;return r&&`init`in e&&(s=r===`initial`?()=>e.init:r),(0,g.useSyncExternalStore)(a,o,s)}var y={process:`U1`,proof:`U2`,dialogue:`U3`,membrane:`U4`,meta:`U5`},b=/loop[_-]?gamma|epistemic[_-]?fitness|delta[_-]?e\b|epoch[_-]?state|continuous[_-]?learning|telemetry[_-]?hook/i,x=/<\s*membrane|hypermedia|viewlet|interaction[_-]?surface|presentation[_-]?membrane/i,S=/<\s*(card|execute|propose|witness|quote|at|image|audio|video|button|action)\b/i,C=/\[[^\]\n]*\]\s*\{[^}\n]*\}\s*\[[^\]\n]*\]/,w=/witness\s*:|output\s*:\s*bool|vcard|merkle|correctness[_-]?condition/i,T=/places\s*:|transitions\s*:|marking\s*:|petri|colored[_-]?petri/i;function E(e){return typeof e==`string`?e:new TextDecoder().decode(e)}function D(e){try{let t=s(e);return Array.isArray(t?.places)&&t.places.length>0}catch{return!1}}function O(e){try{return c(e).some(e=>e?.type!==void 0&&e.type!==`text`)}catch{return!1}}var k=class{resolve(e){let t=E(e);if(t){if(b.test(t))return`meta`;if(x.test(t))return`membrane`;if(S.test(t)||O(t))return`dialogue`;if(C.test(t)||w.test(t))return`proof`;if(T.test(t)||D(t))return`process`}}liftUniverse(e,t){let n=i.includes(e)?e:`U0`;if(!t)return n;let r=y[t];return i.indexOf(r)>i.indexOf(n)?r:n}},A=class{interpreter;strata;constructor(e=o.createDefault()){this.interpreter=e,this.strata=new k}judge(e){let t=typeof e.content==`string`?new TextEncoder().encode(e.content):e.content,i=e.extensionHint||(e.mimeHint&&!e.mimeHint.includes(`/`)?e.mimeHint:void 0),a=this.interpreter.judge({data:t,filename:e.handle,extHint:i}),o=this.strata.resolve(e.content),s=this.strata.liftUniverse(a.universe,o),c=typeof e.content==`string`?e.content:void 0;return{universe:s,mimeType:a.mime,category:a.category,...o?{semanticStratum:o}:{},confidence:a.confidence,matchedRule:a.matchedRule,isBinary:a.isBinary,...a.extension?{extension:a.extension}:{},...c?{dialect:r(c)}:{},...c?{epistemicStatus:n(c)}:{}}}universeFacets(){return l().map(e=>({universe:e.identifier,label:e.stratum_name}))}canEmbed(e,t){return a(i.indexOf(e),i.indexOf(t))}};new A;var j=class{_kernelList=new u;_cancelled=new Set;get size(){return this._kernelList.length}get length(){return this._kernelList.length}get isDisposed(){return this._kernelList.disposed}get disposed(){return this._kernelList.disposed}add(e){if(this._kernelList.disposed)return typeof e==`function`?e():e&&typeof e.dispose==`function`&&e.dispose(),()=>{};let t=()=>{if(!this._cancelled.has(t)){if(typeof e==`function`)return e();if(e&&typeof e.dispose==`function`)return e.dispose()}};return this._kernelList.add(t),()=>{this._cancelled.add(t)}}async dispose(){if(this._kernelList.disposed)return 0;let e=typeof performance<`u`?performance.now():Date.now();try{await this._kernelList.dispose()}catch(e){console.error(`[DisposableList] Error during kernel LIFO resource disposal:`,e)}this._cancelled.clear();let t=(typeof performance<`u`?performance.now():Date.now())-e;return t>1&&console.warn(`[DisposableList] Teardown exceeded sub-millisecond threshold: ${t.toFixed(3)}ms`),t}disposeSync(){if(this._kernelList.disposed)return 0;let e=typeof performance<`u`?performance.now():Date.now();try{this._kernelList.disposeSync()}catch(e){console.error(`[DisposableList] Error during kernel synchronous disposal:`,e)}return this._cancelled.clear(),(typeof performance<`u`?performance.now():Date.now())-e}};export{A as n,v as r,j as t};
@@ -1 +1 @@
1
- import{C as e,y as t}from"./mcardStore.BiAvqM-D.js";import{t as n}from"./vfsHandles.B-nczBRy.js";import"./mcardVfs.Bj-RA0p7.js";function r(e){if(!e.startsWith(`mcard://`))return null;let[t,n]=e.replace(`mcard://`,``).split(`?`),[r,i]=t.split(`#`),a=new URLSearchParams(n||``);return{handleOrHash:r,heading:i?decodeURIComponent(i):void 0,facet:a.get(`facet`)||void 0,action:a.get(`action`)||void 0}}function i(i){if(!i)return!1;let a=i;if(a.startsWith(`mcard://`)){let e=r(a);e&&(a=e.handleOrHash)}a=a.split(`?`)[0].split(`#`)[0];let o=t.get(),s=n(a,null,o);return s?(e(s),!0):(console.warn(`[MarkdownService] MCard target not found in VFS: ${i}`),!1)}typeof window<`u`&&(window.__CLM_NAVIGATE_MCARD__=i);function a(e){if(!e)return``;let t=e.replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`).replace(/^### (.*$)/gim,`<h3>$1</h3>`).replace(/^## (.*$)/gim,`<h2>$1</h2>`).replace(/^# (.*$)/gim,`<h1>$1</h1>`).replace(/\*\*(.*?)\*\*/gim,`<strong>$1</strong>`).replace(/\*(.*?)\*/gim,`<em>$1</em>`).replace(/==(.*?)==/gim,`<mark class="obsidian-highlight" style="background: rgba(255, 215, 0, 0.25); color: #ffe066; padding: 1px 4px; border-radius: 2px;">$1</mark>`).replace(/~~(.*?)~~/gim,`<del style="opacity: 0.6;">$1</del>`).replace(/```([\s\S]*?)```/gim,`<pre><code>$1</code></pre>`).replace(/`([^`]+)`/gim,`<code>$1</code>`).replace(/\[\[([^\]\|#]+)(?:#([^\]\|]+))?(?:\|([^\]]+))?\]\]/g,(e,t,n,r)=>{let i=(t||``).trim(),a=(n||``).trim(),o=(r||i||a).trim();return`<a href="${`mcard://${i}${a?`#`+encodeURIComponent(a):``}`}" class="obsidian-wikilink mcard-hyperlink" data-mcard-target="${i}" ${a?`data-mcard-heading="${a}"`:``} onclick="window.__CLM_NAVIGATE_MCARD__ && window.__CLM_NAVIGATE_MCARD__('${i}'); return false;" style="color: #75beff; text-decoration: none; border-bottom: 1px dashed rgba(117, 190, 255, 0.6); padding: 0 2px;"><span style="opacity: 0.7; margin-right: 3px;">📄</span>${o}</a>`}).replace(/\[(.*?)\]\((mcard:\/\/[^\)]+)\)/gim,`<a href="$2" class="mcard-hyperlink" data-mcard-uri="$2" onclick="window.__CLM_NAVIGATE_MCARD__ && window.__CLM_NAVIGATE_MCARD__('$2'); return false;">$1</a>`).replace(/\[(.*?)\]\((.*?)\)/gim,`<a href="$2" target="_blank" rel="noopener noreferrer">$1</a>`).replace(/^[ \t]*(?:(?:-[ \t]*){3,}|(?:\*[ \t]*){3,}|(?:_[ \t]*){3,})[ \t]*$/gm,`<hr class="obsidian-divider" style="border: none; border-top: 1px solid var(--vscode-editorGroup-border, rgba(255, 255, 255, 0.15)); margin: 24px 0; width: 100%; box-sizing: border-box;" />`);return t=t.replace(/((?:^[ \t]*\|.+?\|[ \t]*\r?\n)(?:^[ \t]*\|(?:\s*:?-+:?\s*\|)+\s*\r?\n)(?:^[ \t]*\|.+?\|[ \t]*(?:\r?\n|$))+)/gm,e=>{let t=e.trim().split(/\r?\n/);if(t.length<2)return e;let n=e=>{let t=e.trim();return t.startsWith(`|`)&&(t=t.slice(1)),t.endsWith(`|`)&&(t=t.slice(0,-1)),t.split(`|`).map(e=>e.trim())},r=n(t[0]),i=n(t[1]);if(!(i.length>0&&i.every(e=>/^:?-+:?$/.test(e))))return e;let a=i.map(e=>{let t=e.startsWith(`:`),n=e.endsWith(`:`);return t&&n?`center`:n?`right`:`left`}),o=`<div class="markdown-table-wrapper" style="margin: 16px 0; overflow-x: auto;"><table class="markdown-table" style="width: 100%; border-collapse: collapse; font-size: 12.5px; text-align: left;"><thead><tr>`;r.forEach((e,t)=>{o+=`<th style="padding: 8px 12px; border: 1px solid var(--vscode-editorGroup-border, #3c3c3c); font-weight: 600; text-align: ${a[t]||`left`};">${e}</th>`}),o+=`</tr></thead><tbody>`;for(let e=2;e<t.length;e++){let i=t[e].trim();if(!i)continue;let s=n(i);o+=`<tr>`,r.forEach((e,t)=>{o+=`<td style="padding: 8px 12px; border: 1px solid var(--vscode-editorGroup-border, #3c3c3c); text-align: ${a[t]||`left`};">${s[t]||``}</td>`}),o+=`</tr>`}return o+=`</tbody></table></div>`,o}),t=t.replace(/\n\n+/gim,`<br/><br/>`),t=t.replace(/(?:<br\/>\s*)+(<hr[^>]*>)(?:\s*<br\/>)+/gi,`$1`),t}export{a as n,r,i as t};
1
+ import{C as e,y as t}from"./mcardStore.CT-ollfl.js";import{t as n}from"./vfsHandles.IX_wTpw_.js";import"./mcardVfs.2UOw9Z-r.js";function r(e){if(!e.startsWith(`mcard://`))return null;let[t,n]=e.replace(`mcard://`,``).split(`?`),[r,i]=t.split(`#`),a=new URLSearchParams(n||``);return{handleOrHash:r,heading:i?decodeURIComponent(i):void 0,facet:a.get(`facet`)||void 0,action:a.get(`action`)||void 0}}function i(i){if(!i)return!1;let a=i;if(a.startsWith(`mcard://`)){let e=r(a);e&&(a=e.handleOrHash)}a=a.split(`?`)[0].split(`#`)[0];let o=t.get(),s=n(a,null,o);return s?(e(s),!0):(console.warn(`[MarkdownService] MCard target not found in VFS: ${i}`),!1)}typeof window<`u`&&(window.__CLM_NAVIGATE_MCARD__=i);function a(e){if(!e)return``;let t=e.replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`).replace(/^### (.*$)/gim,`<h3>$1</h3>`).replace(/^## (.*$)/gim,`<h2>$1</h2>`).replace(/^# (.*$)/gim,`<h1>$1</h1>`).replace(/\*\*(.*?)\*\*/gim,`<strong>$1</strong>`).replace(/\*(.*?)\*/gim,`<em>$1</em>`).replace(/==(.*?)==/gim,`<mark class="obsidian-highlight" style="background: rgba(255, 215, 0, 0.25); color: #ffe066; padding: 1px 4px; border-radius: 2px;">$1</mark>`).replace(/~~(.*?)~~/gim,`<del style="opacity: 0.6;">$1</del>`).replace(/```([\s\S]*?)```/gim,`<pre><code>$1</code></pre>`).replace(/`([^`]+)`/gim,`<code>$1</code>`).replace(/\[\[([^\]\|#]+)(?:#([^\]\|]+))?(?:\|([^\]]+))?\]\]/g,(e,t,n,r)=>{let i=(t||``).trim(),a=(n||``).trim(),o=(r||i||a).trim();return`<a href="${`mcard://${i}${a?`#`+encodeURIComponent(a):``}`}" class="obsidian-wikilink mcard-hyperlink" data-mcard-target="${i}" ${a?`data-mcard-heading="${a}"`:``} onclick="window.__CLM_NAVIGATE_MCARD__ && window.__CLM_NAVIGATE_MCARD__('${i}'); return false;" style="color: #75beff; text-decoration: none; border-bottom: 1px dashed rgba(117, 190, 255, 0.6); padding: 0 2px;"><span style="opacity: 0.7; margin-right: 3px;">📄</span>${o}</a>`}).replace(/\[(.*?)\]\((mcard:\/\/[^\)]+)\)/gim,`<a href="$2" class="mcard-hyperlink" data-mcard-uri="$2" onclick="window.__CLM_NAVIGATE_MCARD__ && window.__CLM_NAVIGATE_MCARD__('$2'); return false;">$1</a>`).replace(/\[(.*?)\]\((.*?)\)/gim,`<a href="$2" target="_blank" rel="noopener noreferrer">$1</a>`).replace(/^[ \t]*(?:(?:-[ \t]*){3,}|(?:\*[ \t]*){3,}|(?:_[ \t]*){3,})[ \t]*$/gm,`<hr class="obsidian-divider" style="border: none; border-top: 1px solid var(--vscode-editorGroup-border, rgba(255, 255, 255, 0.15)); margin: 24px 0; width: 100%; box-sizing: border-box;" />`);return t=t.replace(/((?:^[ \t]*\|.+?\|[ \t]*\r?\n)(?:^[ \t]*\|(?:\s*:?-+:?\s*\|)+\s*\r?\n)(?:^[ \t]*\|.+?\|[ \t]*(?:\r?\n|$))+)/gm,e=>{let t=e.trim().split(/\r?\n/);if(t.length<2)return e;let n=e=>{let t=e.trim();return t.startsWith(`|`)&&(t=t.slice(1)),t.endsWith(`|`)&&(t=t.slice(0,-1)),t.split(`|`).map(e=>e.trim())},r=n(t[0]),i=n(t[1]);if(!(i.length>0&&i.every(e=>/^:?-+:?$/.test(e))))return e;let a=i.map(e=>{let t=e.startsWith(`:`),n=e.endsWith(`:`);return t&&n?`center`:n?`right`:`left`}),o=`<div class="markdown-table-wrapper" style="margin: 16px 0; overflow-x: auto;"><table class="markdown-table" style="width: 100%; border-collapse: collapse; font-size: 12.5px; text-align: left;"><thead><tr>`;r.forEach((e,t)=>{o+=`<th style="padding: 8px 12px; border: 1px solid var(--vscode-editorGroup-border, #3c3c3c); font-weight: 600; text-align: ${a[t]||`left`};">${e}</th>`}),o+=`</tr></thead><tbody>`;for(let e=2;e<t.length;e++){let i=t[e].trim();if(!i)continue;let s=n(i);o+=`<tr>`,r.forEach((e,t)=>{o+=`<td style="padding: 8px 12px; border: 1px solid var(--vscode-editorGroup-border, #3c3c3c); text-align: ${a[t]||`left`};">${s[t]||``}</td>`}),o+=`</tr>`}return o+=`</tbody></table></div>`,o}),t=t.replace(/\n\n+/gim,`<br/><br/>`),t=t.replace(/(?:<br\/>\s*)+(<hr[^>]*>)(?:\s*<br\/>)+/gi,`$1`),t}export{a as n,r,i as t};