dsh-open-artifact 0.19.0 → 0.19.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 (44) hide show
  1. package/CHANGELOG.md +36 -0
  2. package/lib/client.js +1 -1
  3. package/lib/index.js +3 -3
  4. package/package.json +1 -1
  5. package/skills/open-artifact/SKILL.md +1 -1
  6. package/vendor/home/assets/RuntimeUpdate-kcFXr6yv.js +43 -0
  7. package/vendor/home/assets/{browser-models-CwzcLdx1.js → browser-models-CEM3keW0.js} +10 -10
  8. package/vendor/home/assets/library-BYyzKdnk.js +221 -0
  9. package/vendor/home/assets/main-CD6mLXro.js +5 -0
  10. package/vendor/home/assets/main-CudjUC-z.css +1 -0
  11. package/vendor/home/assets/node.browser-5FosC0Jx.js +1 -0
  12. package/vendor/home/assets/node.browser-DZzq1E_m.js +1 -0
  13. package/vendor/home/index.html +3 -2
  14. package/vendor/home/library/index.html +13 -0
  15. package/vendor/open-artifact.mjs +58 -14
  16. package/vendor/runtime.json +1 -1
  17. package/vendor/{type-server/shell/assets/browser-models-D6sLTStW.js → shell/assets/browser-models-DiCdSmg7.js} +4 -4
  18. package/vendor/shell/assets/index-CudjUC-z.css +1 -0
  19. package/vendor/{type-server/shell/assets/index-DUlkQIc2.js → shell/assets/index-K1SKNjv-.js} +19 -19
  20. package/vendor/{home/assets/node.browser-aB_4aVNC.js → shell/assets/node.browser-DF3wedOZ.js} +1 -1
  21. package/vendor/shell/assets/{node.browser-JBLNXGXd.js → node.browser-mz1-CgQF.js} +1 -1
  22. package/vendor/shell/index.html +2 -2
  23. package/vendor/type-server/cli.mjs +26 -4
  24. package/vendor/type-server/editors/design/assets/{index-CWVS8sEC.js → index-UWsnN0RP.js} +118 -118
  25. package/vendor/type-server/editors/design/index.html +1 -1
  26. package/vendor/type-server/editors/slides/assets/{index-DNd0a5AT.js → index-Cd8_0xQf.js} +103 -103
  27. package/vendor/type-server/editors/slides/assets/{src-QKaUghQ7.js → src-YYMn9WN3.js} +1 -1
  28. package/vendor/type-server/editors/slides/index.html +1 -1
  29. package/vendor/type-server/editors/whiteboard/assets/{gif-jobs-CvntHyno.js → gif-jobs-D1FISsUT.js} +1 -1
  30. package/vendor/type-server/editors/whiteboard/assets/{index-ifqwq1AR.js → index-BfYFnyuU.js} +89 -89
  31. package/vendor/type-server/editors/whiteboard/assets/{index-BIiUMoHl.js → index-C7gRSC0a.js} +2 -2
  32. package/vendor/type-server/editors/whiteboard/index.html +1 -1
  33. package/vendor/{shell/assets/browser-models-D6sLTStW.js → type-server/shell/assets/browser-models-DiCdSmg7.js} +4 -4
  34. package/vendor/type-server/shell/assets/index-CudjUC-z.css +1 -0
  35. package/vendor/{shell/assets/index-DUlkQIc2.js → type-server/shell/assets/index-K1SKNjv-.js} +19 -19
  36. package/vendor/{shell/assets/node.browser-Dom693pr.js → type-server/shell/assets/node.browser-DF3wedOZ.js} +1 -1
  37. package/vendor/type-server/shell/assets/{node.browser-JBLNXGXd.js → node.browser-mz1-CgQF.js} +1 -1
  38. package/vendor/type-server/shell/index.html +2 -2
  39. package/vendor/home/assets/index-D2T3Huww.js +0 -46
  40. package/vendor/home/assets/index-DK7ftEF8.css +0 -1
  41. package/vendor/home/assets/node.browser-CQTMP2wJ.js +0 -1
  42. package/vendor/shell/assets/index-DK7ftEF8.css +0 -1
  43. package/vendor/type-server/shell/assets/index-DK7ftEF8.css +0 -1
  44. package/vendor/type-server/shell/assets/node.browser-Dom693pr.js +0 -1
@@ -0,0 +1,221 @@
1
+ import{j as e,r as g,aT as Qe,bC as At,bD as Pt,b3 as Lt,b5 as Ne,aY as Ot,aV as zt,aW as E,aU as Ft,bE as Dt,bw as Rt,bA as It,b4 as $t,aZ as _t,bF as Bt,bG as Ut,bH as Ht,a$ as Wt,bI as Kt,bJ as We}from"./RuntimeUpdate-kcFXr6yv.js";const Yt={},Vt={getSnapshot:()=>Yt,subscribe:()=>()=>{}},Gt={updates:[],phase:"idle",to:"",restart:!1,failure:null,dismissed:""},qt={getSnapshot:()=>Gt,subscribe:()=>()=>{},start(){},later(){},close(){},reopen(){},t:t=>t},Xe=g.createContext(null);function Zt({env:t,children:a}){return e.jsx(Xe.Provider,{value:t,children:a})}function T(){const t=g.useContext(Xe);if(t===null)throw new Error("usePageEnv needs an EnvProvider");return t}function Jt(){const{sessions:t}=T(),a=g.useSyncExternalStore(t.subscribe,t.getSnapshot,t.getSnapshot);return g.useCallback(o=>a.byId?.[o]?.title?.trim()??"",[a])}function te(){const t=T().updates??qt;return{...g.useSyncExternalStore(t.subscribe,t.getSnapshot),offer:t}}const ee=Object.freeze({sort:"opened",types:[],projects:[],date:"any",sharing:"any",pinned:!1}),Qt=["opened","updated","created","name"],Xt=["any","today","yesterday","week","month"],ea=["any","shared","private"];function fe(t){return t.types.length>0||t.projects.length>0||t.date!=="any"||t.sharing!=="any"||t.pinned}const Ke=864e5;function ta(t,a,o){if(a==="any")return!0;const n=Date.parse(t);if(!Number.isFinite(n))return!1;const r=new Date(o),l=new Date(r.getFullYear(),r.getMonth(),r.getDate()).getTime();switch(a){case"today":return n>=l;case"yesterday":return n>=new Date(r.getFullYear(),r.getMonth(),r.getDate()-1).getTime()&&n<l;case"week":return n>=o-7*Ke;case"month":return n>=o-30*Ke}}function aa(t,a,o){if(a==="name")return[...t].sort((r,l)=>r.title.localeCompare(l.title,o));const n=a==="updated"?"updatedAt":a==="created"?"createdAt":"openedAt";return[...t].sort((r,l)=>r[n]<l[n]?1:r[n]>l[n]?-1:0)}function oa(t,{filters:a,query:o,now:n,locale:r,sessionTitle:l}){const d=o.trim().toLowerCase(),u=t.filter(c=>{if(a.types.length>0&&!a.types.includes(c.type)||a.projects.length>0&&!a.projects.includes(c.project??Qe)||a.pinned&&!c.pinned||a.sharing!=="any"&&c.shared!==(a.sharing==="shared")||!ta(c.openedAt,a.date,n))return!1;if(!d)return!0;const p=c.sessionId&&l?l(c.sessionId):"";return c.title.toLowerCase().includes(d)||p.toLowerCase().includes(d)||c.root.toLowerCase().includes(d)||(c.project??"").toLowerCase().includes(d)});return aa(u,a.sort,r)}function na(t){const a=new Map;for(const o of t)a.set(o.type,(a.get(o.type)??0)+1);return a}const et={panel:"Open Artifact",title:"Open Artifact","time.locale":"zh-CN",search:"搜索作品","search.clear":"清除搜索","type.slides":"幻灯片","type.design":"设计","type.design-system":"设计系统","type.data":"数据","type.docs":"文档","type.motion":"动画","type.whiteboard":"白板","type.sheets":"表格","create.heading":"新建","create.new":"新建","create.session":"新会话","view.list":"列表视图","view.grid":"网格视图","filter.button":"排序和筛选","filter.sort":"排序方式","filter.type":"类型","filter.project":"项目","filter.noProject":"不属于项目","filter.date":"打开时间","filter.sharing":"共享","filter.pinned":"已固定","filter.any":"不限","filter.some":"{count} 项","filter.clear":"清除筛选","sort.opened":"最近打开","sort.updated":"最近修改","sort.created":"创建时间","sort.name":"名称","date.any":"不限","date.today":"今天","date.yesterday":"昨天","date.week":"最近 7 天","date.month":"最近 30 天","sharing.any":"不限","sharing.shared":"已共享","sharing.private":"未共享","card.opened":"{time}打开","card.justNow":"刚刚打开","card.opening":"正在打开…","card.shared":"已在局域网共享","action.more":"更多操作","action.pin":"固定","action.unpin":"取消固定","action.rename":"重命名","action.copy":"复制链接","action.share":"分享…","action.delete":"删除","rename.title":"重命名作品","rename.save":"保存","dialog.cancel":"取消","dialog.close":"关闭","changelog.title":"更新日志","changelog.new":"Open Artifact {version} 更新了这些","changelog.all":"更新日志","changelog.gotIt":"知道了","changelog.more":"展开其余 {count} 条","changelog.version":"Open Artifact {version}","changelog.installed":"当前版本","changelog.available":"可更新","changelog.none":"还没有更新日志。","changelog.releases":"在 GitHub 上查看","changelog.section.added":"新增","changelog.section.changed":"改进","changelog.section.fixed":"修复","changelog.section.removed":"移除","delete.title":"删除“{title}”?","delete.moves":"这会移除这个作品,它的文件夹移到 Open Artifact 的回收站,可以在提示里撤销。","delete.confirm":"删除","toast.copied":"链接已复制到剪贴板。","toast.copyRemote":"作品的链接只在运行 Open Artifact 的电脑上能打开,这里打开的那个是你本人的入口,不能给别人。要分享,在作品页面里点“分享”。","toast.deleted":"已删除“{title}”。","toast.removed":"已从作品里移除“{title}”,文件夹还在原处。","toast.undo":"撤销","toast.close":"关闭","empty.title":"还没有作品","empty.body":"本机任意 Agent 用 Artifact 工具做出来的东西都会出现在这里。点上面的入口开始做一个。","empty.noMatches":"没有符合条件的作品","load.error":"读取作品列表失败:{message}","load.retry":"重试","open.typeMissing":"没有安装「{type}」类型,打不开这个作品。","open.failed":"打不开:{message}","open.noSession":"原来的对话已不在,作品在新窗口里打开了。","open.blocked":"浏览器拦下了新窗口:允许这个网站弹出窗口后再试。","action.failed":"没有做成:{message}","tile.beta":"Beta","peek.by":"来自 Open Artifact","peek.start":"从提示词开始","about.docs":"团队一起读、评论、直接修改的文档,Agent 负责让它保持最新。","about.slides":"能直接演示的幻灯片,可以套用设计系统换风格,也能导出成 PowerPoint。","about.sheets":"带公式和格式的表格,你和 Agent 一起填。","about.design":"界面、流程和图形,作为画板排在同一张画布上,也可以动手改。","about.design-system":"颜色、字体、组件和素材,幻灯片和设计都照着它来做。","about.data":"用你的数据做的图表、数字和表格,每一项都标明出处。","about.whiteboard":"方框、箭头和便利贴,你和 Agent 都能在上面画。","about.motion":"一段在页面里直接播放的短动画,可以导出成 MP4、GIF 或网页。"},Se=t=>Object.prototype.hasOwnProperty.call(et,t),tt={panel:"Open Artifact",title:"Open Artifact","time.locale":"en",search:"Search artifacts","search.clear":"Clear search","type.slides":"Slides","type.design":"Design","type.design-system":"Design system","type.data":"Data","type.docs":"Docs","type.motion":"Motion","type.whiteboard":"Whiteboard","type.sheets":"Sheets","create.heading":"Make something new","create.new":"New","create.session":"New session","view.list":"List view","view.grid":"Grid view","filter.button":"Sort and filter","filter.sort":"Sort by","filter.type":"Type","filter.project":"Project","filter.noProject":"No project","filter.date":"Date opened","filter.sharing":"Sharing","filter.pinned":"Pinned","filter.any":"Any","filter.some":"{count} selected","filter.clear":"Clear filters","sort.opened":"Last opened","sort.updated":"Last edited","sort.created":"Date created","sort.name":"Name","date.any":"Any time","date.today":"Today","date.yesterday":"Yesterday","date.week":"Past 7 days","date.month":"Past 30 days","sharing.any":"Any","sharing.shared":"Shared","sharing.private":"Not shared","card.opened":"Opened {time}","card.justNow":"Opened just now","card.opening":"Opening…","card.shared":"Shared on the local network","action.more":"More actions","action.pin":"Pin","action.unpin":"Unpin","action.rename":"Rename","action.copy":"Copy link","action.share":"Share…","action.delete":"Delete","rename.title":"Rename artifact","rename.save":"Save","dialog.cancel":"Cancel","dialog.close":"Close","changelog.title":"Changelog","changelog.new":"What's new in Open Artifact {version}","changelog.all":"Changelog","changelog.gotIt":"Got it","changelog.more":"Show {count} more","changelog.version":"Open Artifact {version}","changelog.installed":"Installed","changelog.available":"Available","changelog.none":"No release notes yet.","changelog.releases":"View on GitHub","changelog.section.added":"Added","changelog.section.changed":"Changed","changelog.section.fixed":"Fixed","changelog.section.removed":"Removed","delete.title":"Delete {title}?","delete.moves":"This removes the artifact and moves its folder to Open Artifact's trash. You can undo it from the notice.","delete.confirm":"Delete","toast.copied":"Link copied to clipboard.","toast.copyRemote":"An artifact's link opens only on the computer that runs Open Artifact, and the one opened here is your own way in, not for others. To share it, use Share on its page.","toast.deleted":"Deleted “{title}”.","toast.removed":"Took “{title}” off your artifacts. Its folder stays where it is.","toast.undo":"Undo","toast.close":"Close","empty.title":"No artifacts yet","empty.body":"What an agent on this computer makes with the Artifact tool shows up here. Start one with a tile above.","empty.noMatches":"No artifacts match","load.error":"Could not read the artifacts: {message}","load.retry":"Try again","open.typeMissing":"The {type} type is not installed, so this artifact cannot open.","open.failed":"Could not open it: {message}","open.noSession":"The conversation is gone, so the artifact opened in a new window.","open.blocked":"The browser blocked the new window: allow pop-ups for this site and try again.","action.failed":"That did not work: {message}","tile.beta":"Beta","peek.by":"By Open Artifact","peek.start":"Start with a prompt","about.docs":"A document your team reads, comments on and edits in place while the agent keeps it current.","about.slides":"A deck you can present, restyle with a design system and export to PowerPoint.","about.sheets":"A grid with formulas and formatting that you and the agent fill in together.","about.design":"Screens, flows and graphics laid out as artboards on one canvas you can edit by hand.","about.design-system":"Colors, type, components and assets that your decks and designs are built from.","about.data":"Charts, numbers and tables from your data, each marked with its source.","about.whiteboard":"Boxes, arrows and sticky notes you and the agent both draw on.","about.motion":"A short animated film that plays in place and exports as MP4, GIF or HTML."};function at(t,a={}){return t.replace(/\{(\w+)\}/g,(o,n)=>a[n]??o)}const Ye=(t,a)=>at(tt[t]??t,a);function ra(t){return typeof t!="function"?Ye:(a,o)=>{const n=t(a,o);return typeof n=="string"&&n!==a?at(n,o):Ye(a,o)}}const be=["docs","slides","sheets","design","design-system","data","whiteboard","motion"],ot=t=>be.includes(t);function Ve(t){const a=[...new Set(t)],o=n=>ot(n)?be.indexOf(n):be.length+a.indexOf(n);return a.sort((n,r)=>o(n)-o(r))}const ia={docs:{wash:"#cce3fd",ink:"#1757ac",tint:"#3f8ef0"},slides:{wash:"#f7d9ca",ink:"#903710",tint:"#e8703a"},sheets:{wash:"#caecc8",ink:"#016c0f",tint:"#3d9e3a"},design:{wash:"#e4deff",ink:"#5437b8",tint:"#7a5cf0"},"design-system":{wash:"#fbe6bd",ink:"#865400",tint:"#c79a1b"},data:{wash:"#fbd4d4",ink:"#a42528",tint:"#e5484d"},whiteboard:{wash:"#fbd6e5",ink:"#902552",tint:"#d6409f"},motion:{wash:"#bfeee5",ink:"#006458",tint:"#14a38b"}},sa={page:{wash:"#d6e4ee",ink:"#2c5672",tint:"#4f86ad"}},la={wash:"#ececec",ink:"#555555",tint:"#8a8a8a"},W=t=>{const a=ot(t)?ia[t]:sa[t]??la;return{"--oa-tint":a.tint,"--oa-wash":a.wash,"--oa-ink":a.ink}},ca=["whiteboard","data","sheets","motion"],K=t=>({display:"block",width:t,height:t,flex:"none"});function da({size:t=16}){return e.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",style:K(t),children:[e.jsx("path",{d:"M15 9V6a3 3 0 0 0-3-3H6a3 3 0 0 0-3 3v6a3 3 0 0 0 3 3h3"}),e.jsx("rect",{x:"9",y:"9",width:"12",height:"12",rx:"3"}),e.jsx("circle",{cx:"15",cy:"15",r:"2",fill:"currentColor",stroke:"none"})]})}function ae({type:t,size:a=18}){const o={stroke:"currentColor",strokeWidth:1.6,strokeLinecap:"round",strokeLinejoin:"round"},n=(()=>{switch(t){case"docs":return e.jsxs(e.Fragment,{children:[e.jsx("path",{d:"M6 2.25h5.6c.4 0 .78.16 1.06.44l3.65 3.65c.28.28.44.66.44 1.06v7.85A2.75 2.75 0 0 1 14 18H6a2.75 2.75 0 0 1-2.75-2.75V5A2.75 2.75 0 0 1 6 2.25Z",...o}),e.jsx("path",{d:"M12 2.4v2.85a2 2 0 0 0 2 2h2.6",...o})]});case"slides":return e.jsx(e.Fragment,{children:e.jsx("path",{d:"M1.25 2.75h17.5M2.75 2.75v8.75A2.25 2.25 0 0 0 5 13.75h10a2.25 2.25 0 0 0 2.25-2.25V2.75M10 13.75l-3 4M10 13.75l3 4",...o})});case"sheets":return e.jsxs(e.Fragment,{children:[e.jsx("rect",{x:"2.25",y:"2.25",width:"15.5",height:"15.5",rx:"3",...o}),e.jsx("path",{d:"M2.25 7.5h15.5M2.25 12.5h15.5M7 2.25v15.5",...o})]});case"design":return e.jsxs(e.Fragment,{children:[e.jsx("path",{d:"M10 2.25c-4.75 0-8.5 3.3-8.5 7.6 0 4.5 3.55 8.150 8.2 8.15 3.1 0 5.55-1.25 5.55-3.4 0-1.25-1.15-1.75-1.15-2.8 0-1.2 1.050-1.6 2.25-2.2 1.3-.65 2.15-1.5 2.15-3C18.5 3.95 14.6 2.25 10 2.25Z",...o}),e.jsx("circle",{cx:"8",cy:"6.6",r:"1.35",fill:"currentColor"}),e.jsx("circle",{cx:"12.4",cy:"6.9",r:"1.35",fill:"currentColor"}),e.jsx("circle",{cx:"5.2",cy:"10.3",r:"1.35",fill:"currentColor"})]});case"design-system":return e.jsxs(e.Fragment,{children:[e.jsx("rect",{x:"2.25",y:"2.25",width:"6.75",height:"6.75",rx:"1.75",...o}),e.jsx("circle",{cx:"14.4",cy:"5.6",r:"3.4",...o}),e.jsx("circle",{cx:"5.6",cy:"14.4",r:"3.4",...o}),e.jsx("rect",{x:"11",y:"11",width:"6.75",height:"6.75",rx:"1.75",...o})]});case"data":return e.jsxs(e.Fragment,{children:[e.jsx("path",{d:"M1.75 16.25V11.5c0-.97.78-1.75 1.75-1.750H7V4c0-.97.78-1.75 1.75-1.75h2c.97 0 1.75.78 1.75 1.75v2.25h3.75c.97 0 1.75.78 1.75 1.75v8.25c0 .97-.78 1.75-1.75 1.75H3.5c-.97 0-1.75-.78-1.75-1.75Z",...o}),e.jsx("path",{d:"M7 9.75V18M12.5 6.25V18",...o})]});case"whiteboard":return e.jsxs(e.Fragment,{children:[e.jsx("path",{d:"M11.52 8.25A5 5 0 1 0 8.25 11.52",...o}),e.jsx("rect",{x:"8.25",y:"8.25",width:"10",height:"10",rx:"2.25",...o})]});case"motion":return e.jsxs(e.Fragment,{children:[e.jsx("path",{d:"M3.75 6.6h2M1.5 10H5M3.75 13.4h2",...o}),e.jsx("circle",{cx:"13.75",cy:"10",r:"4.75",...o})]});case"page":return e.jsxs(e.Fragment,{children:[e.jsx("rect",{x:"2.25",y:"3.25",width:"15.5",height:"13.5",rx:"2.75",...o}),e.jsx("path",{d:"M2.25 7.25h15.5",...o}),e.jsx("circle",{cx:"5",cy:"5.25",r:".8",fill:"currentColor",stroke:"none"}),e.jsx("circle",{cx:"7.4",cy:"5.25",r:".8",fill:"currentColor",stroke:"none"}),e.jsx("path",{d:"m8 10.25-2 1.75 2 1.75M12 10.25l2 1.75-2 1.75",...o})]});default:return e.jsx("rect",{x:"3",y:"3",width:"14",height:"14",rx:"2",...o})}})();return e.jsx("svg",{viewBox:"0 0 20 20",fill:"none","aria-hidden":"true",style:K(a),children:n})}function pa({type:t}){const a=`oa-chalk-${t.replace(/[^\w-]/g,"_")}`,o={fill:"none",stroke:"currentColor",strokeWidth:7,strokeLinecap:"round",strokeLinejoin:"round"},n=(()=>{switch(t){case"docs":return e.jsx("path",{d:"M12 28c5 14 10 27 15 38 7-10 14-21 20-31 4 9 8 19 11 28M84 74c9-10 18-20 27-30 4 11 7 23 11 34 6-8 12-15 20-23",...o});case"slides":return e.jsxs(e.Fragment,{children:[e.jsx("rect",{x:"-14",y:"45",width:"107",height:"72",rx:"11",...o}),e.jsx("rect",{x:"4",y:"66",width:"116",height:"52",rx:"11",...o}),e.jsx("path",{d:"M17 86h55",...o})]});case"sheets":return e.jsx("path",{d:"M9 -6v94M51 -6v94M90 -6v94M-6 23h122M-6 57h122",...o});case"design":return e.jsxs(e.Fragment,{children:[e.jsx("rect",{x:"15",y:"18",width:"106",height:"64",...o}),[[15,18],[121,18],[15,82],[121,82]].map(([r,l])=>e.jsx("rect",{x:r-7,y:l-7,width:"14",height:"14",rx:"2",...o},`${r},${l}`))]});case"design-system":return e.jsxs(e.Fragment,{children:[e.jsx("circle",{cx:"20",cy:"22",r:"13",...o}),e.jsx("rect",{x:"98",y:"6",width:"32",height:"26",rx:"6",...o}),e.jsx("rect",{x:"8",y:"66",width:"34",height:"28",rx:"6",...o}),e.jsx("circle",{cx:"118",cy:"76",r:"15",...o})]});case"data":return e.jsx("path",{d:"M38 94v20M70 81v33M101 67v47M132 48v66",...o,strokeWidth:11});case"whiteboard":return e.jsxs(e.Fragment,{children:[e.jsx("rect",{x:"-12",y:"60",width:"46",height:"31",rx:"7",...o}),e.jsx("path",{d:"M36 81c22-3 42-12 62-36 8-10 16-19 25-25M104 25l20-6 2 26",...o})]});case"motion":return e.jsx("path",{d:"M19 44c13-4 26-5 38-4 14 1 23 13 34 15 16 3 33-5 49-4M19 68c13 1 26 3 38 5 16 3 26 13 42 14 15 1 28-6 41-7",...o});default:return e.jsx("path",{d:"M18 30h50M18 52h80M18 74h36",...o})}})();return e.jsxs("svg",{className:"oa-tile-doodle",viewBox:"0 0 140 100",preserveAspectRatio:"xMidYMid slice","aria-hidden":"true",children:[e.jsxs("filter",{id:a,x:"-10%",y:"-10%",width:"120%",height:"120%",children:[e.jsx("feTurbulence",{type:"fractalNoise",baseFrequency:"0.9",numOctaves:2,seed:3,result:"noise"}),e.jsx("feDisplacementMap",{in:"SourceGraphic",in2:"noise",scale:3,xChannelSelector:"R",yChannelSelector:"G",result:"rough"}),e.jsx("feColorMatrix",{in:"noise",type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2.4 -0.7",result:"grain"}),e.jsx("feComposite",{in:"rough",in2:"grain",operator:"in"})]}),e.jsx("g",{filter:`url(#${a})`,children:n})]})}function k({d:t,size:a=16,fill:o}){return e.jsx("svg",{viewBox:"0 0 16 16",fill:o?"currentColor":"none",stroke:o?void 0:"currentColor",strokeWidth:"1.3",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",style:K(a),children:typeof t=="string"?e.jsx("path",{d:t}):t})}const v={search:e.jsxs(e.Fragment,{children:[e.jsx("circle",{cx:"7",cy:"7",r:"4.5"}),e.jsx("path",{d:"m10.5 10.5 3 3"})]}),clear:"m4.5 4.5 7 7m0-7-7 7",filter:"M2.5 4.5h11M4.5 8h7M6.5 11.5h3",list:e.jsxs(e.Fragment,{children:[e.jsx("path",{d:"M5.75 4h7.75M5.75 8h7.75M5.75 12h7.75"}),e.jsx("path",{d:"M2.5 4h.01M2.5 8h.01M2.5 12h.01",strokeWidth:"1.8"})]}),grid:e.jsxs(e.Fragment,{children:[e.jsx("rect",{x:"2.5",y:"2.5",width:"4.5",height:"4.5",rx:"1"}),e.jsx("rect",{x:"9",y:"2.5",width:"4.5",height:"4.5",rx:"1"}),e.jsx("rect",{x:"2.5",y:"9",width:"4.5",height:"4.5",rx:"1"}),e.jsx("rect",{x:"9",y:"9",width:"4.5",height:"4.5",rx:"1"})]}),plus:"M8 3v10M3 8h10",chat:"M3 3.5h10a1 1 0 0 1 1 1v6a1 1 0 0 1-1 1H8.2L5.4 13.8a.3.3 0 0 1-.5-.23V11.5H3a1 1 0 0 1-1-1v-6a1 1 0 0 1 1-1Z",pin:"M9.75 2.25 13.75 6.25M10.75 3.25 7 6.25 4.5 6.5 9.5 11.5 9.75 9 12.75 5.25M7 9l-4 4",more:e.jsxs(e.Fragment,{children:[e.jsx("circle",{cx:"3.5",cy:"8",r:".6",fill:"currentColor"}),e.jsx("circle",{cx:"8",cy:"8",r:".6",fill:"currentColor"}),e.jsx("circle",{cx:"12.5",cy:"8",r:".6",fill:"currentColor"})]}),rename:"M10.5 3 13 5.5 5.5 13 2.5 13.5 3 10.5 10.5 3Z",link:"M6.75 9.25a2.5 2.5 0 0 0 3.54 0l2.25-2.25a2.5 2.5 0 0 0-3.54-3.54L8.250 4.2M9.25 6.75a2.5 2.5 0 0 0-3.54 0L3.46 9a2.5 2.5 0 0 0 3.54 3.54l.75-.75",share:"M8 2.5v7.5M5 5.25 8 2.5l3 2.75M3.5 8.5v4a1 1 0 0 0 1 1h7a1 1 0 0 0 1-1v-4",trash:"M2.75 4.25h10.5M6.25 4.25V3a.75.75 0 0 1 .75-.75h2a.75.75 0 0 1 .75.75v1.25M4 4.25l.6 8.6a1 1 0 0 0 1 .9h4.8a1 1 0 0 0 1-.9l.6-8.6M6.75 7v4M9.25 7v4",info:e.jsxs(e.Fragment,{children:[e.jsx("circle",{cx:"8",cy:"8",r:"6"}),e.jsx("path",{d:"M8 7.5v3.25M8 5.25h.01"})]}),chevron:"m6 3.5 4.5 4.5L6 12.5",tick:"m3 8.5 3.25 3.25L13 4.75",people:e.jsxs(e.Fragment,{children:[e.jsx("circle",{cx:"6",cy:"5.5",r:"2.25"}),e.jsx("path",{d:"M2 13c0-2.2 1.8-3.75 4-3.75S10 10.8 10 13M10.5 3.5a2.25 2.25 0 0 1 0 4M12 9.5c1.3.45 2.25 1.75 2.25 3.5"})]})};function ua({type:t,title:a}){const o=e.jsx("div",{className:"oa-paper-title",children:a});switch(t){case"slides":return e.jsxs("div",{className:"oa-slide",children:[o,e.jsx("div",{className:"oa-line"})]});case"motion":return e.jsxs("div",{className:"oa-film",children:[e.jsx("div",{className:"oa-film-title",children:a}),e.jsx("svg",{viewBox:"0 0 20 20","aria-hidden":"true",style:K(22),children:e.jsx("path",{d:"M7 5.5v9l7.5-4.5L7 5.5Z",fill:"currentColor"})}),e.jsx("div",{className:"oa-film-bar"})]});case"whiteboard":return e.jsxs("div",{className:"oa-paper",children:[o,e.jsxs("svg",{className:"oa-flow",viewBox:"0 0 120 36","aria-hidden":"true",children:[e.jsx("rect",{x:"1",y:"3",width:"30",height:"15",rx:"3"}),e.jsx("rect",{x:"45",y:"3",width:"30",height:"15",rx:"3"}),e.jsx("rect",{x:"89",y:"19",width:"30",height:"15",rx:"3"}),e.jsx("path",{d:"M31 10.5h14M75 10.5h12a3 3 0 0 1 3 3v5.5"})]})]});case"sheets":return e.jsxs("div",{className:"oa-paper",children:[o,e.jsxs("svg",{className:"oa-cells",viewBox:"0 0 120 48","aria-hidden":"true",children:[e.jsx("rect",{className:"oa-cells-head",x:".5",y:".5",width:"119",height:"9.5"}),e.jsx("rect",{className:"oa-cells-pick",x:"40",y:"19.5",width:"40",height:"9.5"}),e.jsx("path",{d:"M.5 .5h119v47H.5ZM.5 10h119M.5 19.5h119M.5 29h119M.5 38.5h119M40 .5v47M80 .5v47"})]})]});case"design":return e.jsxs("div",{className:"oa-paper",children:[o,e.jsxs("div",{className:"oa-boards",children:[e.jsx("div",{className:"oa-board"}),e.jsx("div",{className:"oa-board"})]})]});case"design-system":return e.jsxs("div",{className:"oa-paper",children:[o,e.jsxs("div",{className:"oa-swatches",children:[e.jsx("span",{className:"oa-swatch"}),e.jsx("span",{className:"oa-swatch"}),e.jsx("span",{className:"oa-swatch"}),e.jsx("span",{className:"oa-swatch"})]}),e.jsx("div",{className:"oa-specimen",children:"Aa"})]});case"data":return e.jsxs("div",{className:"oa-paper",children:[o,e.jsxs("div",{className:"oa-kpis",children:[e.jsx("span",{className:"oa-kpi"}),e.jsx("span",{className:"oa-kpi"}),e.jsx("span",{className:"oa-kpi"})]}),e.jsx("div",{className:"oa-bars",children:[45,70,55,90,65,80].map((n,r)=>e.jsx("span",{className:"oa-bar",style:{height:`${n}%`}},r))})]});default:return e.jsxs("div",{className:"oa-paper",children:[o,[92,100,84,96,70].map((n,r)=>e.jsx("div",{className:"oa-line",style:{width:`${n}%`}},r))]})}}const nt="open-artifact.view";function ha(t,a,o){try{const n=new URL(t);return n.searchParams.set(a,o),n.href}catch{return t}}function ga(t){try{return t?.getItem(nt)==="list"?"list":"grid"}catch{return"grid"}}function xa({api:t,host:a,t:o,eventDelayMs:n=300}){let r=0,l=null;const d=new Set;let u=null,c=!1;return At()((p,h)=>{const x=(i,m)=>p({artifacts:h().artifacts.map(f=>f.id===i?{...f,...m}:f)}),b=i=>h().showToast(o("action.failed",{message:i.message}),"error"),w=i=>i.openable?!0:(h().showToast(o("open.typeMissing",{type:i.typeTitle||i.type}),"error"),!1),N=()=>{const i=a.capture;if(c||u===null||i===void 0)return;const m=u.signal;c=!0,(async()=>{try{for(;;){if(m.aborted||!a.visible())return;const f=h().artifacts.find(y=>y.thumbnail!==y.updatedAt&&y.openable&&!d.has(`${y.id}\0${y.updatedAt}`));if(f===void 0)return;d.add(`${f.id}\0${f.updatedAt}`);try{const y=await t.preview(f.id);if(typeof y!="string")throw new Error("no address");const A=await i(y,f.type,m),P=await t.saveThumbnail(f.id,f.updatedAt,A);x(f.id,{thumbnail:P??f.updatedAt})}catch(y){m.aborted||console.warn(`Open Artifact page: no thumbnail for ${f.root}:`,y)}}}finally{c=!1}})()};return{status:"loading",artifacts:[],types:[],error:"",opening:null,toast:null,filters:ee,query:"",layout:ga(a.storage),menuFor:null,dialog:null,live:!1,searchFocus:0,reload(){return l||(h().artifacts.length===0&&p({status:"loading"}),l=(async()=>{try{const{artifacts:i,types:m}=await t.list();p({status:"ready",artifacts:i,types:m,error:""}),N()}catch(i){p({status:"error",error:i.message})}})().finally(()=>{l=null}),l)},setFilters:i=>p({filters:{...h().filters,...i}}),clearFilters:()=>p({filters:{...ee,sort:h().filters.sort}}),setQuery:i=>p({query:i}),focusSearch:()=>p({searchFocus:h().searchFocus+1}),setLayout(i){p({layout:i});try{a.storage?.setItem(nt,i)}catch{}},setMenuFor:i=>p({menuFor:i}),openDialog:i=>p({dialog:i,menuFor:null}),closeDialog:()=>p({dialog:null}),showToast:(i,m="info",f)=>p({toast:{id:++r,message:i,kind:m,...f?{undo:f}:{}}}),dismissToast:()=>p({toast:null}),async open(i,m){if(h().opening!==null||!w(i))return;const f=a.away(),y=f?a.pendingWindow():null;if(f&&y===null)return h().showToast(o("open.blocked"),"error");p({opening:i.id,toast:null});try{const A=await t.open(i.id),P=m?{...A,url:ha(A.url,"panel",m)}:A,{sessionGone:V}=await a.show({...P,sessionId:P.sessionId||i.sessionId},y);p({opening:null}),V&&(P.sessionId||i.sessionId)&&h().showToast(o("open.noSession")),h().reload()}catch(A){y?.close(),p({opening:null}),h().showToast(o("open.failed",{message:A.message}),"error")}},share:i=>h().open(i,"share"),create(i){if(a.canCreate()){if(i===void 0)return a.create();a.create({id:i,title:h().types.find(m=>m.id===i)?.title||i})}},async pin(i,m){if(w(i)){x(i.id,{pinned:m});try{await t.update(i.id,{pinned:m})}catch(f){x(i.id,{pinned:i.pinned}),b(f)}}},async rename(i,m){const f=m.trim();if(!(!f||f===i.title||!w(i))){x(i.id,{title:f});try{const y=await t.update(i.id,{title:f});y&&typeof y.id=="string"&&y.id&&x(i.id,y)}catch(y){x(i.id,{title:i.title}),b(y)}}},async copyLink(i){if(w(i)){if(a.away())return h().showToast(o("toast.copyRemote"));try{await a.copy(i.viewUrl),h().showToast(o("toast.copied"))}catch(m){b(m)}}},async remove(i){try{const{trash:m,path:f}=await t.remove(i.id);p({artifacts:h().artifacts.filter(y=>y.id!==i.id),dialog:null}),h().showToast(o(f?"toast.removed":"toast.deleted",{title:i.title}),"info",m)}catch(m){b(m)}},async undo(i){p({toast:null});try{await t.restore(i),await h().reload()}catch(m){b(m)}},watchEvents(){let i;const m=t.events(()=>{h().live||p({live:!0}),clearTimeout(i),i=setTimeout(()=>{h().reload()},n)},()=>p({live:!1}));return()=>{clearTimeout(i),m?.(),p({live:!1})}},watchThumbnails(){const i=new AbortController;return u=i,N(),()=>{i.abort(new Error("the page closed")),u===i&&(u=null)}}}})}const rt=g.createContext(null);function ma({store:t,children:a}){return g.createElement(rt.Provider,{value:t},a)}function S(t){const a=g.useContext(rt);if(a===null)throw new Error("usePage needs a StoreProvider");return Pt(a,t)}function O(t,a){const o=l=>{const[d="",u]=l.split("+")[0].split(/-(.*)/s);return{numbers:d.split(".").map(c=>Number.parseInt(c,10)||0),pre:u}},n=o(t),r=o(a);for(let l=0;l<3;l++){const d=(n.numbers[l]??0)-(r.numbers[l]??0);if(d!==0)return d>0}return n.pre===void 0||r.pre===void 0?n.pre===void 0&&r.pre!==void 0:n.pre.localeCompare(r.pre,"en",{numeric:!0})>0}const Me=t=>t.reduce((a,o)=>a===""||O(o.latest,a)?o.latest:a,"");function fa(t,a,o){return t.filter(n=>!O(n.version,o)&&(a===""||O(n.version,a))).sort((n,r)=>O(n.version,r.version)?-1:O(r.version,n.version)?1:0)}const ba=/`([^`]+)`|\*\*([^*]+)\*\*|\[([^\]]+)\]\(([^)\s]+)\)/g;function ya(t){const a=[];let o=0;for(const n of t.matchAll(ba))n.index>o&&a.push({kind:"text",text:t.slice(o,n.index)}),n[1]!==void 0?a.push({kind:"code",text:n[1]}):n[2]!==void 0?a.push({kind:"strong",text:n[2]}):/^https?:\/\//i.test(n[4])?a.push({kind:"link",text:n[3],href:n[4]}):a.push({kind:"text",text:n[3]}),o=n.index+n[0].length;return o<t.length&&a.push({kind:"text",text:t.slice(o)}),a}const it="open-artifact.changelog.seen";function va(){try{return localStorage.getItem(it)}catch{return null}}let z={version:"",releases:[],upcoming:[],upcomingFor:"",seen:va(),open:!1};const ye=new Set;function R(t){z={...z,...t};for(const a of[...ye])a()}const wa=t=>(ye.add(t),()=>{ye.delete(t)}),ja=()=>z;async function ge(t){const a=await t(!1);if(a===null)return;const o=z.upcoming.filter(n=>O(n.version,a.version));R({version:a.version,releases:a.releases,upcoming:o})}async function st(t,a){if(t===""||t===z.upcomingFor)return;R({upcomingFor:t});const o=await a(!0);if(o===null||z.upcomingFor!==t){z.upcomingFor===t&&R({upcomingFor:""});return}R({version:o.version,releases:o.releases,upcoming:o.upcoming})}function ka({version:t,releases:a,seen:o}){return t===""||o===t?[]:o===null?a.filter(n=>n.version===t):O(o,t)?[]:fa(a,o,t)}function Na(){const{version:t}=z;if(t!==""){try{localStorage.setItem(it,t)}catch{}R({seen:t})}}const Ce=()=>R({open:!0}),lt=()=>R({open:!1}),Y=()=>g.useSyncExternalStore(wa,ja);function Ge({text:t}){return e.jsx(e.Fragment,{children:ya(t).map((a,o)=>a.kind==="code"?e.jsx("code",{children:a.text},o):a.kind==="strong"?e.jsx("strong",{children:a.text},o):a.kind==="link"?e.jsx("a",{href:a.href,target:"_blank",rel:"noopener noreferrer",children:a.text},o):e.jsx("span",{children:a.text},o))})}const Sa=(t,a)=>{const o=`changelog.section.${a.toLowerCase()}`;return Se(o)?t(o):a},xe=4;function Ee({releases:t,headings:a,fold:o=!1,tag:n}){const{t:r}=T(),[l,d]=g.useState(!o),u=t.reduce((p,h)=>p+h.sections.reduce((x,b)=>x+b.items.length,0),0);let c=l?1/0:xe;return e.jsxs("div",{className:"oa-notes",children:[t.map(p=>c<=0?null:e.jsxs("article",{className:"oa-release","data-version":p.version,children:[a&&e.jsxs("h3",{className:"oa-release-head",children:[e.jsx("span",{className:"oa-release-version",children:p.version}),p.date&&e.jsx("span",{className:"oa-release-date",children:p.date}),n?.(p)]}),p.summary.map((h,x)=>e.jsx("p",{className:"oa-release-summary",children:e.jsx(Ge,{text:h})},x)),p.sections.map(h=>{if(c<=0||h.items.length===0)return null;const x=h.items.slice(0,c);return c-=x.length,e.jsxs("section",{className:"oa-release-section",children:[e.jsx("h4",{children:Sa(r,h.title)}),e.jsx("ul",{children:x.map((b,w)=>e.jsx("li",{children:e.jsx(Ge,{text:b})},w))})]},h.title)})]},p.version)),!l&&u>xe&&e.jsx("button",{type:"button",className:"oau-show",onClick:()=>d(!0),children:r("changelog.more",{count:String(u-xe)})})]})}function Ma(){const{phase:t}=te(),{changelog:a}=T();g.useEffect(()=>{a&&ge(a)},[a]),g.useEffect(()=>{if(t!=="done"||!a)return;ge(a);const o=setTimeout(()=>{ge(a)},5e3);return()=>clearTimeout(o)},[t,a])}function Ca(){const{t}=T();Ma();const a=Y(),o=ka(a);return o.length===0?null:e.jsxs("section",{className:"oau-panel oa-news",role:"status","aria-label":t("changelog.new",{version:a.version}),"data-testid":"open-artifact-whats-new",children:[e.jsxs("div",{className:"oau-head",children:[e.jsx("div",{className:"oau-head-text",children:e.jsx("div",{className:"oau-title",children:t("changelog.new",{version:a.version})})}),e.jsxs("div",{className:"oau-actions",children:[e.jsx("button",{type:"button",className:"oa-btn",onClick:Ce,children:t("changelog.all")}),e.jsx("button",{type:"button",className:"oa-btn","data-primary":"true",onClick:Na,children:t("changelog.gotIt")})]})]}),e.jsx(Ee,{releases:o,headings:o.length>1,fold:!0})]})}function Ea(){const{t,changelog:a}=T(),o=Me(te().updates),{upcoming:n}=Y();return g.useEffect(()=>{a&&st(o,a)},[o,a]),n.length===0?null:e.jsxs("div",{className:"oa-news-upcoming",children:[e.jsx(Ee,{releases:n,headings:n.length>1,fold:!0}),e.jsx("button",{type:"button",className:"oau-show",onClick:Ce,children:t("changelog.all")})]})}function Ta(){const{t}=T(),{version:a}=Y();return a===""?null:e.jsxs("footer",{className:"oa-foot",children:[e.jsx("span",{children:t("changelog.version",{version:a})}),e.jsx("span",{"aria-hidden":"true",children:"·"}),e.jsx("button",{type:"button",className:"oau-show",onClick:Ce,"data-testid":"open-artifact-changelog",children:t("changelog.title")})]})}function Aa(){const{t,changelog:a}=T(),{version:o,releases:n,upcoming:r}=Y(),l=Me(te().updates);g.useEffect(()=>{a&&st(l,a)},[l,a]);const d=u=>u.version===o?e.jsx("span",{className:"oau-tag","data-tone":"neutral",children:t("changelog.installed")}):r.includes(u)?e.jsx("span",{className:"oau-tag",children:t("changelog.available")}):null;return e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"oa-dialog-head",children:e.jsx("h2",{children:t("changelog.title")})}),e.jsx("div",{className:"oa-changelog",children:r.length+n.length===0?e.jsx("p",{children:t("changelog.none")}):e.jsx(Ee,{releases:[...r,...n],headings:!0,tag:d})}),e.jsxs("div",{className:"oa-dialog-actions",children:[e.jsx("a",{className:"oa-btn oa-btn-link",href:"https://github.com/JimLiu/open-artifact/releases",target:"_blank",rel:"noopener noreferrer",children:t("changelog.releases")}),e.jsx("button",{type:"button",className:"oa-btn","data-primary":"true",autoFocus:!0,onClick:lt,children:t("dialog.close")})]})]})}function _({primary:t,onClick:a,children:o,label:n,disabled:r}){return e.jsx("button",{type:"button",className:"oa-btn",...t?{"data-primary":"true"}:{},...n?{"aria-label":n}:{},disabled:r,onClick:a,children:o})}function Pa(){const{phase:t,updates:a,to:o,restart:n,failure:r,dismissed:l,offer:d}=te(),{t:u,start:c,later:p,close:h,reopen:x}=d,b=Me(a);if(t==="idle"&&b==="")return null;if(t==="idle"&&b===l)return e.jsxs("div",{className:"oau-line","data-testid":"open-artifact-update-line",children:[e.jsx("span",{children:u("available",{version:b})}),e.jsx("button",{type:"button",className:"oau-show",onClick:x,children:u("show")})]});let w,N=null,i=null;return t==="running"?w=u("busy"):t==="done"?(w=u("done",{version:o}),N=u(n?"done.restart":"done.session"),i=e.jsxs(e.Fragment,{children:[e.jsx(_,{onClick:h,children:u("close")}),n&&d.restart&&e.jsx(_,{primary:!0,onClick:()=>d.restart?.(),children:u("restart")})]})):t==="failed"&&r?(w=u("failed"),N=`${r.message} ${u(r.left==="unknown"?"failed.unknown":"failed.kept")}`,i=e.jsxs(e.Fragment,{children:[e.jsx(_,{onClick:h,children:u("close")}),a.length>0&&e.jsx(_,{primary:!0,onClick:c,children:u("retry")})]})):(w=u("available",{version:b}),N=u("current",{version:a[0]?.version??""}),i=e.jsxs(e.Fragment,{children:[e.jsx(_,{onClick:p,children:u("later")}),e.jsx(_,{primary:!0,onClick:c,label:u("update.one",{version:b}),children:u("update")})]})),e.jsxs("section",{className:"oau-panel",role:t==="failed"?"alert":"status","data-testid":"open-artifact-update","data-phase":t,children:[e.jsxs("div",{className:"oau-head",children:[e.jsxs("div",{className:"oau-head-text",children:[e.jsx("div",{className:"oau-title",children:w}),N!==null&&e.jsx("div",{className:"oau-text",children:N})]}),i!==null&&e.jsx("div",{className:"oau-actions",children:i})]}),t==="idle"&&e.jsx(Ea,{})]})}const La=[["minute",60],["hour",3600],["day",86400],["week",604800],["month",2629800],["year",31557600]];function ct(t,a,o){const n=Date.parse(t);if(!Number.isFinite(n))return"";const r=Math.round((n-a)/1e3);if(r>-60)return o("card.justNow");let l="minute",d=60;for(const[c,p]of La)-r>=p&&([l,d]=[c,p]);let u;try{u=new Intl.RelativeTimeFormat(o("time.locale"),{numeric:"auto"})}catch{u=new Intl.RelativeTimeFormat("en",{numeric:"auto"})}return o("card.opened",{time:u.format(Math.round(r/d),l)})}function Oa(t=6e4){const[a,o]=g.useState(()=>Date.now());return g.useEffect(()=>{const n=setInterval(()=>o(Date.now()),t);return()=>clearInterval(n)},[t]),a}function oe(t,a,o){const n=`type.${a}`;return Se(n)?t(n):o||a}function za(t,a,o){const n=`about.${a}`;return Se(n)?t(n):o||""}function Fa({artifact:t}){const{api:a}=T(),o=t.thumbnail===null?null:a.thumbnailUrl(t.id,t.thumbnail),[n,r]=g.useState(null),l=o!==null&&n!==o;return e.jsx("span",{className:"oa-preview","data-stack":l&&t.type==="docs",children:l?e.jsx("span",{className:"oa-sheet",children:e.jsx("img",{src:o,alt:"",draggable:!1,onError:()=>r(o)})}):e.jsx(ua,{type:t.type,title:t.title})})}const Te="[role^=menuitem]";function dt(t,a){if(t.key==="Escape"){t.preventDefault(),t.stopPropagation(),a();return}if(t.key!=="ArrowDown"&&t.key!=="ArrowUp")return;t.preventDefault(),t.stopPropagation();const o=[...t.currentTarget.querySelectorAll(Te)].filter(r=>r.closest("[role=menu]")===t.currentTarget),n=o.indexOf(document.activeElement);o[(n+(t.key==="ArrowDown"?1:o.length-1))%o.length]?.focus()}function Ae({anchor:t,label:a,onClose:o,onKey:n,children:r}){const l=g.useRef(null),[d,u]=g.useState({visibility:"hidden"});g.useLayoutEffect(()=>{const p=t.getBoundingClientRect(),h=l.current?.offsetHeight??0,x=l.current?.offsetWidth??0,b=Math.max(8,window.innerWidth-p.right),w=p.bottom+6+h<=window.innerHeight-8;u({right:window.innerWidth-b-x<8?window.innerWidth-x-8:b,...w?{top:p.bottom+6}:{bottom:Math.max(8,window.innerHeight-p.top+6)}})},[t]);const c=d.visibility!=="hidden";return g.useEffect(()=>{c&&l.current?.querySelector(Te)?.focus({preventScroll:!0})},[c]),g.useEffect(()=>{const p=x=>{const b=x.target;!l.current?.contains(b)&&!t.contains(b)&&o()},h=()=>o();return document.addEventListener("pointerdown",p,!0),window.addEventListener("resize",h),()=>{document.removeEventListener("pointerdown",p,!0),window.removeEventListener("resize",h)}},[t,o]),e.jsx("div",{ref:l,className:"oa-menu",role:"menu","aria-label":a,style:d,onKeyDown:p=>{if(n&&!p.metaKey&&!p.ctrlKey&&!p.altKey&&n(p.key.toLowerCase())){p.preventDefault();return}dt(p,()=>{o(),t.focus()})},children:r})}function me({label:t,on:a,count:o,onPick:n}){return e.jsxs("button",{type:"button",className:"oa-menu-item",role:"menuitemradio","aria-checked":a,onClick:n,children:[e.jsx("span",{className:"oa-menu-label",children:t}),o!==void 0&&e.jsx("span",{className:"oa-menu-count",children:o}),a&&e.jsx("span",{className:"oa-tick",children:e.jsx(k,{d:v.tick})})]})}function H({id:t,label:a,value:o,open:n,setOpen:r,children:l}){const d=n===t,u=g.useRef(null),[c,p]=g.useState(!1);return g.useLayoutEffect(()=>{d&&u.current&&p(u.current.getBoundingClientRect().right+(c?u.current.offsetWidth:0)>window.innerWidth-8)},[d]),e.jsxs("div",{className:"oa-menu-row",onMouseEnter:()=>r(t),children:[e.jsxs("button",{type:"button",className:"oa-menu-item",role:"menuitem","aria-haspopup":"menu","aria-expanded":d,onClick:()=>r(d?null:t),onKeyDown:h=>{(h.key==="ArrowRight"||h.key==="Enter"||h.key===" ")&&(h.preventDefault(),r(t),requestAnimationFrame(()=>u.current?.querySelector(Te)?.focus()))},children:[e.jsx("span",{className:"oa-menu-label",children:a}),e.jsx("span",{className:"oa-menu-value",children:o}),e.jsx("span",{className:"oa-menu-chev",children:e.jsx(k,{d:v.chevron,size:12})})]}),d&&e.jsx("div",{ref:u,className:"oa-submenu",role:"menu","aria-label":a,"data-flip":c,onKeyDown:h=>{if(h.key==="ArrowLeft"||h.key==="Escape"){h.preventDefault(),h.stopPropagation(),r(null),h.currentTarget.previousElementSibling?.focus();return}dt(h,()=>r(null))},children:l})]})}function Da({anchor:t,filters:a,setFilters:o,types:n,counts:r,projects:l,t:d,onClose:u}){const[c,p]=g.useState(null),h=i=>oe(d,i,n.find(m=>m.id===i)?.title),x=a.types.length===0?d("filter.any"):a.types.length===1?h(a.types[0]):d("filter.some",{count:String(a.types.length)}),b=i=>i.project===Qe?d("filter.noProject"):i.label,w=l.find(i=>i.project===a.projects[0]),N=a.projects.length===0?d("filter.any"):a.projects.length===1?w?b(w):Ne(a.projects[0]):d("filter.some",{count:String(a.projects.length)});return e.jsxs(Ae,{anchor:t,label:d("filter.button"),onClose:u,children:[e.jsx(H,{id:"sort",label:d("filter.sort"),value:d(`sort.${a.sort}`),open:c,setOpen:p,children:Qt.map(i=>e.jsx(me,{label:d(`sort.${i}`),on:a.sort===i,onPick:()=>o({...a,sort:i})},i))}),e.jsx("div",{className:"oa-menu-rule",role:"separator"}),e.jsx(H,{id:"type",label:d("filter.type"),value:x,open:c,setOpen:p,children:n.map(({id:i})=>{const m=a.types.includes(i);return e.jsxs("button",{type:"button",className:"oa-menu-item",role:"menuitemcheckbox","aria-checked":m,onClick:()=>o({...a,types:m?a.types.filter(f=>f!==i):[...a.types,i]}),children:[e.jsx("span",{className:"oa-check","data-on":m,children:e.jsx(k,{d:v.tick,size:12})}),e.jsx("span",{className:"oa-menu-label",children:h(i)}),e.jsx("span",{className:"oa-menu-count",children:r.get(i)??0})]},i)})}),l.length>0&&e.jsx(H,{id:"project",label:d("filter.project"),value:N,open:c,setOpen:p,children:l.map(i=>{const m=a.projects.includes(i.project);return e.jsxs("button",{type:"button",className:"oa-menu-item",role:"menuitemcheckbox","aria-checked":m,title:i.project||void 0,"data-project":i.project,onClick:()=>o({...a,projects:m?a.projects.filter(f=>f!==i.project):[...a.projects,i.project]}),children:[e.jsx("span",{className:"oa-check","data-on":m,children:e.jsx(k,{d:v.tick,size:12})}),e.jsx("span",{className:"oa-menu-label",children:b(i)}),e.jsx("span",{className:"oa-menu-count",children:i.count})]},i.project||"none")})}),e.jsx(H,{id:"date",label:d("filter.date"),value:d(`date.${a.date}`),open:c,setOpen:p,children:Xt.map(i=>e.jsx(me,{label:d(`date.${i}`),on:a.date===i,onPick:()=>o({...a,date:i})},i))}),e.jsx(H,{id:"sharing",label:d("filter.sharing"),value:d(`sharing.${a.sharing}`),open:c,setOpen:p,children:ea.map(i=>e.jsx(me,{label:d(`sharing.${i}`),on:a.sharing===i,onPick:()=>o({...a,sharing:i})},i))}),e.jsx("div",{className:"oa-menu-rule",role:"separator"}),e.jsxs("div",{onMouseEnter:()=>p(null),children:[e.jsxs("button",{type:"button",className:"oa-menu-item",role:"menuitemcheckbox","aria-checked":a.pinned,onClick:()=>o({...a,pinned:!a.pinned}),children:[e.jsx("span",{className:"oa-menu-label",children:d("filter.pinned")}),a.pinned&&e.jsx("span",{className:"oa-tick",children:e.jsx(k,{d:v.tick})})]}),fe(a)&&e.jsx("button",{type:"button",className:"oa-menu-item",role:"menuitem",onClick:()=>o({...ee,sort:a.sort}),children:e.jsx("span",{className:"oa-menu-label",children:d("filter.clear")})})]})]})}function Ra({anchor:t,artifact:a,t:o,onClose:n,act:r,extra:l=[],onExtra:d}){const u=(c,p,h,x)=>e.jsxs("button",{type:"button",className:"oa-menu-item",role:"menuitem","aria-keyshortcuts":x,onClick:()=>r(c),children:[e.jsx(k,{d:p}),e.jsx("span",{className:"oa-menu-label",children:h}),e.jsx("kbd",{className:"oa-menu-key",children:x})]});return e.jsxs(Ae,{anchor:t,label:o("action.more"),onClose:n,onKey:c=>{const p={p:"pin",r:"rename",c:"copy",s:"share"}[c];return p===void 0?!1:(r(p),!0)},children:[u("pin",v.pin,o(a.pinned?"action.unpin":"action.pin"),"P"),u("rename",v.rename,o("action.rename"),"R"),u("copy",v.link,o("action.copy"),"C"),u("share",v.share,o("action.share"),"S"),l.map(c=>e.jsxs("button",{type:"button",className:"oa-menu-item",role:"menuitem","data-action":c.id,onClick:()=>d?.(c),children:[e.jsx(k,{d:c.icon??""}),e.jsx("span",{className:"oa-menu-label",children:c.label})]},c.id)),e.jsx("div",{className:"oa-menu-rule",role:"separator"}),e.jsxs("button",{type:"button",className:"oa-menu-item",role:"menuitem","data-danger":"true",onClick:()=>r("delete"),children:[e.jsx(k,{d:v.trash}),e.jsx("span",{className:"oa-menu-label",children:o("action.delete")})]})]})}function Ia({anchor:t,tiles:a,canCreate:o,t:n,onClose:r,create:l}){return e.jsxs(Ae,{anchor:t,label:n("create.new"),onClose:r,children:[e.jsxs("button",{type:"button",className:"oa-menu-item",role:"menuitem",disabled:!o,onClick:()=>l(),children:[e.jsx(k,{d:v.chat}),e.jsx("span",{className:"oa-menu-label",children:n("create.session")})]}),a.length>0&&e.jsx("div",{className:"oa-menu-rule",role:"separator"}),a.map(d=>e.jsxs("button",{type:"button",className:"oa-menu-item",role:"menuitem","data-type":d.id,onClick:()=>l(d.id),style:W(d.id),children:[e.jsx("span",{className:"oa-menu-glyph",children:e.jsx(ae,{type:d.id,size:16})}),e.jsx("span",{className:"oa-menu-label",children:oe(n,d.id,d.title)})]},d.id))]})}function Pe({label:t,onClose:a,children:o,wide:n=!1}){return e.jsx("div",{className:"oa-scrim",onPointerDown:r=>{r.target===r.currentTarget&&a()},onKeyDown:r=>{r.key==="Escape"&&(r.stopPropagation(),a())},children:e.jsx("div",{className:"oa-dialog",role:"dialog","aria-modal":"true","aria-label":t,...n?{"data-wide":"true"}:{},children:o})})}function $a({artifact:t,t:a,onClose:o,onSave:n}){const[r,l]=g.useState(t.title),d=g.useRef(null);g.useEffect(()=>{d.current?.focus(),d.current?.select()},[]);const u=r.trim(),c=u!==""&&u!==t.title;return e.jsx(Pe,{label:a("rename.title"),onClose:o,children:e.jsxs("form",{onSubmit:p=>{p.preventDefault(),c&&n(u)},children:[e.jsx("h2",{children:a("rename.title")}),e.jsx("input",{ref:d,value:r,"aria-label":a("rename.title"),maxLength:200,onChange:p=>l(p.target.value)}),e.jsxs("div",{className:"oa-dialog-actions",children:[e.jsx("button",{type:"button",className:"oa-btn",onClick:o,children:a("dialog.cancel")}),e.jsx("button",{type:"submit",className:"oa-btn","data-primary":"true",disabled:!c,children:a("rename.save")})]})]})})}function _a({artifact:t,t:a,onClose:o,onDelete:n}){const r=g.useRef(null);g.useEffect(()=>r.current?.focus(),[]);const l=a("delete.title",{title:t.title});return e.jsxs(Pe,{label:l,onClose:o,children:[e.jsx("h2",{children:l}),e.jsx("p",{children:a("delete.moves")}),e.jsxs("div",{className:"oa-dialog-actions",children:[e.jsx("button",{type:"button",className:"oa-btn",onClick:o,children:a("dialog.cancel")}),e.jsx("button",{ref:r,type:"button",className:"oa-btn","data-danger":"true",onClick:n,children:a("delete.confirm")})]})]})}function Ba(){const{t}=T(),a=S(r=>r.toast),o=S(r=>r.dismissToast),n=S(r=>r.undo);return g.useEffect(()=>{if(a===null)return;const r=setTimeout(o,a.undo||a.kind==="error"?1e4:4e3);return()=>clearTimeout(r)},[a,o]),a===null?null:e.jsxs("div",{className:"oa-toast",role:a.kind==="error"?"alert":"status","data-kind":a.kind,children:[e.jsx(k,{d:v.info}),e.jsx("span",{className:"oa-toast-text",children:a.message}),a.undo&&e.jsx("button",{type:"button",className:"oa-toast-undo",onClick:()=>{n(a.undo)},children:t("toast.undo")}),e.jsx("button",{type:"button",className:"oa-toast-close","aria-label":t("toast.close"),onClick:o,children:e.jsx(k,{d:v.clear,size:14})})]},a.id)}const pt=(t,a)=>[t.root,t.project&&!t.root.startsWith(t.project)?t.project:"",a].filter(Boolean).join(`
2
+ `);function ut({artifact:t,t:a,onPin:o}){const n=a(t.pinned?"action.unpin":"action.pin");return e.jsx("button",{type:"button",className:"oa-act","data-on":t.pinned,"aria-pressed":t.pinned,"aria-label":n,title:n,onClick:()=>o(t),children:t.pinned?e.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",style:K(16),children:e.jsx("path",{d:"M9.75 2.25 13.75 6.25M10.75 3.25 7 6.25 4.5 6.5 9.5 11.5 9.75 9 12.75 5.25M7 9l-4 4",fill:"currentColor",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round",strokeLinejoin:"round"})}):e.jsx(k,{d:v.pin})})}function ht({artifact:t,t:a,menuOpen:o,onMenu:n,extra:r}){return e.jsx("button",{type:"button",className:`oa-act ${r??""}`,"aria-label":a("action.more"),title:a("action.more"),"aria-haspopup":"menu","aria-expanded":o,onClick:l=>n(t,l.currentTarget),children:e.jsx(k,{d:v.more})})}function Ua({artifact:t,opening:a,conversation:o,now:n,t:r,onOpen:l,onPin:d,menuOpen:u,onMenu:c}){const p=a===t.id;return e.jsxs("li",{className:"oa-item","data-menu":u,style:W(t.type),children:[e.jsxs("button",{type:"button",className:"oa-card",disabled:a!==null,"aria-busy":p,title:pt(t,o),onClick:()=>l(t),"data-type":t.type,children:[e.jsxs("span",{className:"oa-preview-wrap",style:{display:"block",position:"relative",width:"100%"},children:[e.jsx(Fa,{artifact:t}),p&&e.jsxs("span",{className:"oa-busy",children:[e.jsx("span",{className:"oa-spinner"}),r("card.opening")]})]}),e.jsxs("span",{className:"oa-info",children:[e.jsx("span",{className:"oa-glyph",children:e.jsx(ae,{type:t.type})}),e.jsxs("span",{className:"oa-text",children:[e.jsx("span",{className:"oa-name",children:t.title}),e.jsxs("span",{className:"oa-meta",children:[t.project?e.jsxs("span",{className:"oa-project","data-project":t.project,children:[Ne(t.project)," · "]}):null,ct(t.openedAt,n,r)]})]})]})]}),e.jsxs("div",{className:"oa-actions",children:[e.jsx(ht,{artifact:t,t:r,menuOpen:u,onMenu:c}),e.jsx(ut,{artifact:t,t:r,onPin:d})]})]})}function Ha({artifact:t,opening:a,conversation:o,now:n,t:r,onOpen:l,onPin:d,menuOpen:u,onMenu:c}){const p=a===t.id;return e.jsxs("li",{className:"oa-item","data-menu":u,style:W(t.type),children:[e.jsxs("button",{type:"button",className:"oa-row",disabled:a!==null,"aria-busy":p,title:pt(t,o),onClick:()=>l(t),"data-type":t.type,children:[e.jsx("span",{className:"oa-glyph",children:p?e.jsx("span",{className:"oa-spinner"}):e.jsx(ae,{type:t.type})}),e.jsx("span",{className:"oa-name",children:t.title}),e.jsx("span",{className:"oa-meta",children:p?r("card.opening"):e.jsxs(e.Fragment,{children:[t.project?e.jsxs("span",{className:"oa-project","data-project":t.project,children:[Ne(t.project)," · "]}):null,ct(t.openedAt,n,r)]})})]}),e.jsxs("div",{className:"oa-row-tools",children:[t.shared&&e.jsx("span",{className:"oa-shared",title:r("card.shared"),"aria-label":r("card.shared"),children:e.jsx(k,{d:v.people})}),e.jsx(ut,{artifact:t,t:r,onPin:d}),e.jsx(ht,{artifact:t,t:r,menuOpen:u,onMenu:c,extra:"oa-act-more"})]})]})}const Wa=350,Ka=160,gt="oa-peek-about";function Ya({tile:t,anchor:a,t:o,onAct:n,onEnter:r,onLeave:l,onClose:d}){const u=g.useRef(null),[c,p]=g.useState({visibility:"hidden"});g.useLayoutEffect(()=>{const x=a.getBoundingClientRect(),b=u.current?.offsetWidth??0,w=u.current?.offsetHeight??0,N=x.bottom+8;p({left:Math.max(8,Math.min(x.left,window.innerWidth-b-8)),top:N+w<=window.innerHeight-8?N:Math.max(8,x.top-8-w)})},[a]),g.useEffect(()=>{const x=()=>d();return window.addEventListener("scroll",x,!0),window.addEventListener("resize",x),()=>{window.removeEventListener("scroll",x,!0),window.removeEventListener("resize",x)}},[d]);const h=oe(o,t.id,t.title);return e.jsxs("div",{ref:u,className:"oa-peek",role:"group","aria-label":h,"data-testid":"open-artifact-peek","data-type":t.id,style:{...W(t.id),...c},onPointerEnter:r,onPointerLeave:l,onKeyDown:x=>{x.key==="Escape"&&(d(),a.focus())},children:[e.jsx("div",{className:"oa-peek-title",children:h}),e.jsx("div",{className:"oa-peek-by",children:o("peek.by")}),e.jsx("p",{className:"oa-peek-about",id:gt,children:za(o,t.id,t.description)}),e.jsx("button",{type:"button",className:"oa-peek-act",onClick:n,children:o("peek.start")})]})}function Va(t,a){const o=new Set(a.flatMap(r=>r.types)),n=t.filter(r=>!o.has(r.id));return a.map((r,l)=>({group:r,tiles:[...r.types.map(d=>t.find(u=>u.id===d)).filter(d=>d!==void 0),...l===a.length-1?n:[]]})).filter(r=>r.tiles.length>0)}function Ga({canCreate:t,theme:a,platform:o,searchButton:n=!0,createButton:r=!0,tileGroups:l,headingTools:d,cardActions:u}){const{t:c}=T(),p=Jt(),h=S(s=>s.status),x=S(s=>s.artifacts),b=S(s=>s.types),w=S(s=>s.error),N=S(s=>s.opening),i=S(s=>s.filters),m=S(s=>s.query),f=S(s=>s.layout),y=S(s=>s.dialog),A=S(s=>s.searchFocus),{reload:P,watchEvents:V,watchThumbnails:ze,setFilters:Fe,setQuery:ne,setLayout:vt,openDialog:wt,closeDialog:G,open:jt,create:De,pin:Re,rename:kt,copyLink:Nt,share:St,remove:Mt}=S(s=>s),[F,re]=g.useState(null),D=g.useRef(void 0),q=g.useRef(!1),[ie,Z]=g.useState(!1),[M,I]=g.useState(null),B=g.useRef(null),se=Oa(),Ct=Y().open;g.useEffect(()=>{P();const s=()=>{document.visibilityState==="visible"&&P()};return document.addEventListener("visibilitychange",s),()=>document.removeEventListener("visibilitychange",s)},[P]),g.useEffect(()=>V(),[V]),g.useEffect(()=>ze(),[ze]),g.useEffect(()=>{ie&&B.current?.focus()},[ie]),g.useEffect(()=>{A!==0&&(Z(!0),B.current?.focus(),B.current?.select())},[A]);const le=g.useMemo(()=>na(x),[x]),Et=g.useMemo(()=>Lt(x,c("time.locale")),[x,c]),U=g.useMemo(()=>Ve(b.map(s=>s.id)).map(s=>b.find(j=>j.id===s)),[b]),Tt=g.useMemo(()=>Ve([...b.map(s=>s.id),...le.keys()]).map(s=>({id:s,title:b.find(j=>j.id===s)?.title||x.find(j=>j.type===s)?.typeTitle||s})),[b,le,x]),ce=g.useMemo(()=>()=>{clearTimeout(D.current),q.current=!1,re(null)},[]);g.useEffect(()=>()=>clearTimeout(D.current),[]);const Ie=(s,j,C=!1)=>{clearTimeout(D.current),D.current=setTimeout(()=>re({id:s,anchor:j}),C||F!==null?0:Wa)},de=()=>{clearTimeout(D.current),D.current=setTimeout(()=>re(null),Ka)},$e=s=>{ce(),De(s)},pe=g.useMemo(()=>oa(x,{filters:i,query:m,now:se,locale:c("time.locale"),sessionTitle:p}),[x,i,m,se,c,p]),ue=g.useMemo(()=>()=>I(null),[]),L=M?.kind==="actions"?x.find(s=>s.id===M.id):void 0,$=y?x.find(s=>s.id===y.id):void 0,he=F===null?void 0:U.find(s=>s.id===F.id),_e=s=>({artifact:s,opening:N,conversation:p(s.sessionId),now:se,t:c,onOpen:j=>{jt(j)},onPin:j=>{Re(j,!j.pinned)},menuOpen:M?.kind==="actions"&&M.id===s.id,onMenu:(j,C)=>I(He=>He?.kind==="actions"&&He.id===j.id?null:{kind:"actions",anchor:C,id:j.id})}),Be=s=>{const j=F?.id===s.id;return e.jsx("li",{onPointerEnter:C=>C.pointerType!=="touch"&&Ie(s.id,C.currentTarget.firstElementChild),onPointerLeave:de,children:e.jsxs("button",{type:"button",className:"oa-tile","data-type":s.id,...j?{"data-peek":"true","aria-describedby":gt}:{},style:W(s.id),onClick:()=>$e(s.id),onFocus:C=>{C.currentTarget.matches(":focus-visible")&&Ie(s.id,C.currentTarget,!0)},onBlur:()=>{q.current||de()},onKeyDown:C=>{C.key==="Escape"&&F!==null&&ce()},children:[e.jsxs("span",{className:"oa-tile-art",children:[e.jsx(pa,{type:s.id}),e.jsx(ae,{type:s.id,size:42}),ca.includes(s.id)&&e.jsx("span",{className:"oa-tile-beta",children:c("tile.beta")})]}),e.jsx("span",{className:"oa-tile-label",children:oe(c,s.id,s.title)})]})},s.id)},Ue=(s,j)=>I(C=>C?.kind===s?null:{kind:s,anchor:j});return e.jsxs("section",{className:"oa-page","aria-label":c("title"),"data-testid":"open-artifact-page","data-theme":a,"data-platform":o,children:[e.jsx("div",{className:"oa-scroll",children:e.jsxs("div",{className:"oa-content",children:[e.jsxs("div",{className:"oa-heading",children:[e.jsx("h1",{children:c("title")}),e.jsxs("div",{className:"oa-tools",children:[d,ie||m?e.jsxs("label",{className:"oa-search",children:[e.jsx(k,{d:v.search,size:14}),e.jsx("input",{ref:B,type:"search",value:m,placeholder:c("search"),"aria-label":c("search"),onChange:s=>ne(s.target.value),onBlur:()=>{m||Z(!1)},onKeyDown:s=>{s.nativeEvent.isComposing||s.keyCode===229||s.key==="Escape"&&(ne(""),Z(!1))}}),m&&e.jsx("button",{type:"button","aria-label":c("search.clear"),onClick:()=>{ne(""),B.current?.focus()},children:e.jsx(k,{d:v.clear,size:12})})]}):n?e.jsx("button",{type:"button",className:"oa-tool","aria-label":c("search"),title:c("search"),onClick:()=>Z(!0),children:e.jsx(k,{d:v.search,size:18})}):null,e.jsx("button",{type:"button",className:"oa-tool","aria-label":c("filter.button"),title:c("filter.button"),"aria-haspopup":"menu","aria-expanded":M?.kind==="filter","data-active":fe(i),onClick:s=>Ue("filter",s.currentTarget),children:e.jsx(k,{d:v.filter,size:18})}),e.jsx("button",{type:"button",className:"oa-tool","aria-label":c(f==="grid"?"view.list":"view.grid"),title:c(f==="grid"?"view.list":"view.grid"),onClick:()=>vt(f==="grid"?"list":"grid"),children:e.jsx(k,{d:f==="grid"?v.list:v.grid,size:18})}),t&&r&&e.jsx("button",{type:"button",className:"oa-tool","aria-label":c("create.new"),title:c("create.new"),"aria-haspopup":"menu","aria-expanded":M?.kind==="create",onClick:s=>Ue("create",s.currentTarget),children:e.jsx(k,{d:v.plus,size:18})})]})]}),e.jsx(Pa,{}),e.jsx(Ca,{}),t&&U.length>0&&e.jsxs(e.Fragment,{children:[l===void 0?e.jsxs(e.Fragment,{children:[e.jsx("h2",{className:"oa-section-title",children:c("create.heading")}),e.jsx("ul",{className:"oa-tiles",children:U.map(Be)})]}):e.jsx("div",{className:"oa-tile-groups",children:Va(U,l).map(({group:s,tiles:j})=>e.jsxs("section",{className:"oa-tile-group","data-group":s.id,"aria-label":s.title,children:[e.jsx("h2",{className:"oa-section-title",children:s.title}),e.jsx("ul",{className:"oa-tiles",children:j.map(Be)})]},s.id))}),F!==null&&he!==void 0&&M===null&&e.jsx(Ya,{tile:he,anchor:F.anchor,t:c,onAct:()=>$e(he.id),onEnter:()=>{q.current=!0,clearTimeout(D.current)},onLeave:()=>{q.current=!1,de()},onClose:ce})]}),h==="loading"&&x.length===0?e.jsx("ul",{className:"oa-grid oa-skeleton","aria-hidden":"true",children:[0,1,2].map(s=>e.jsx("li",{className:"oa-item",children:e.jsxs("div",{className:"oa-card",children:[e.jsx("div",{className:"oa-preview"}),e.jsx("div",{className:"oa-line"})]})},s))}):h==="error"&&x.length===0?e.jsxs("div",{className:"oa-empty",role:"alert",children:[e.jsx("p",{children:c("load.error",{message:w})}),e.jsx("button",{type:"button",className:"oa-retry",onClick:()=>{P()},children:c("load.retry")})]}):x.length===0?e.jsxs("div",{className:"oa-empty",children:[e.jsx(da,{size:28}),e.jsx("h2",{children:c("empty.title")}),e.jsx("p",{children:c("empty.body")})]}):pe.length===0?e.jsxs("div",{className:"oa-empty",children:[e.jsx("p",{children:c("empty.noMatches")}),fe(i)&&e.jsx("button",{type:"button",className:"oa-retry",onClick:()=>Fe({...ee,sort:i.sort}),children:c("filter.clear")})]}):f==="grid"?e.jsx("ul",{className:"oa-grid",children:pe.map(s=>e.jsx(Ua,{..._e(s)},s.id))}):e.jsx("ul",{className:"oa-list",children:pe.map(s=>e.jsx(Ha,{..._e(s)},s.id))}),e.jsx(Ta,{})]})}),M?.kind==="filter"&&e.jsx(Da,{anchor:M.anchor,filters:i,setFilters:s=>Fe(s),types:Tt,counts:le,projects:Et,t:c,onClose:ue}),M?.kind==="create"&&e.jsx(Ia,{anchor:M.anchor,tiles:U,canCreate:t,t:c,onClose:ue,create:s=>{I(null),De(s)}}),M?.kind==="actions"&&L&&e.jsx(Ra,{anchor:M.anchor,artifact:L,t:c,onClose:ue,extra:u,onExtra:s=>{I(null),s.run(L)},act:s=>{I(null),s==="pin"?Re(L,!L.pinned):s==="copy"?Nt(L):s==="share"?St(L):wt({kind:s,id:L.id})}}),y?.kind==="rename"&&$&&e.jsx($a,{artifact:$,t:c,onClose:G,onSave:s=>{G(),kt($,s)}}),y?.kind==="delete"&&$&&e.jsx(_a,{artifact:$,t:c,onClose:G,onDelete:()=>{G(),Mt($)}}),Ct&&e.jsx(Pe,{label:c("changelog.title"),onClose:lt,wide:!0,children:e.jsx(Aa,{})}),e.jsx(Ba,{})]})}const qa=`
3
+ .oa-page{position:relative;width:100%;min-width:0;height:100%;min-height:0;color:var(--oa-page-text-primary);background:var(--oa-page-bg);font-size:14px;line-height:1.6;display:flex;flex-direction:column;overflow:hidden}
4
+ .oa-scroll{flex:1;min-height:0;overflow:auto;scrollbar-gutter:stable}
5
+ .oa-content{max-width:1120px;margin:0 auto;padding:0 clamp(24px,4vw,48px) 56px}
6
+ .oa-heading{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:12px 16px;padding-top:28px;margin-bottom:24px}
7
+ :where(.oa-page)[data-platform=darwin] .oa-heading{padding-top:calc(28px + var(--oa-page-top-clearance,0px))}
8
+ .oa-heading h1{margin:0;font-size:20px;font-weight:500;line-height:28px}
9
+ .oa-tools{display:flex;align-items:center;gap:4px;margin-left:auto}
10
+ .oa-tool{position:relative;display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;padding:0;border:0;border-radius:8px;background:none;color:var(--oa-page-text-secondary);cursor:pointer}
11
+ .oa-tool:hover,.oa-tool[aria-expanded=true]{background:var(--oa-page-hover-bg);color:var(--oa-page-text-primary)}
12
+ .oa-tool[data-active=true]::after{content:"";position:absolute;top:6px;right:6px;width:6px;height:6px;border-radius:50%;background:var(--oa-page-accent)}
13
+ .oa-search{display:flex;align-items:center;gap:6px;width:min(240px,50vw);height:32px;padding:0 8px 0 10px;border:.5px solid var(--oa-page-border);border-radius:8px;color:var(--oa-page-text-tertiary)}
14
+ .oa-search:focus-within{border-color:var(--oa-page-accent)}
15
+ .oa-search input{flex:1;min-width:0;height:100%;border:0;padding:0;background:none;color:var(--oa-page-text-primary);font:inherit;font-size:13px;outline:none}
16
+ .oa-search input::placeholder{color:var(--oa-page-text-caption)}
17
+ .oa-search input::-webkit-search-cancel-button{display:none}
18
+ .oa-search button{display:inline-flex;align-items:center;justify-content:center;width:22px;height:22px;margin-right:-4px;padding:0;border:0;border-radius:6px;background:none;color:inherit;cursor:pointer}
19
+ .oa-search button:hover{background:var(--oa-page-hover-bg)}
20
+ .oa-section-title{margin:0 0 12px;font-size:13px;font-weight:400;line-height:20px;color:var(--oa-page-text-tertiary)}
21
+ .oa-tiles{display:grid;grid-template-columns:repeat(auto-fill,minmax(112px,1fr));gap:14px 10px;margin:0 0 36px;padding:0;list-style:none}
22
+ .oa-tile-groups{display:flex;flex-wrap:wrap;gap:20px 28px;margin:0 0 36px}
23
+ .oa-tile-group{display:flex;flex-direction:column;min-width:0}
24
+ .oa-tile-group .oa-section-title{margin-bottom:10px}
25
+ .oa-tile-group .oa-tiles{display:flex;flex-wrap:wrap;gap:10px;margin:0}
26
+ .oa-tile-group .oa-tiles>li{width:112px}
27
+ .oa-tile{display:flex;flex-direction:column;gap:8px;width:100%;padding:0;border:0;background:none;color:inherit;font:inherit;text-align:left;cursor:pointer}
28
+ .oa-tile-art{position:relative;display:flex;align-items:center;justify-content:center;aspect-ratio:10/7;border-radius:14px;overflow:hidden;background:var(--oa-wash);color:var(--oa-ink);transition:transform .2s cubic-bezier(.2,.7,.3,1),background-color .15s}
29
+ .oa-tile:hover .oa-tile-art,.oa-tile[data-peek=true] .oa-tile-art{transform:scale(1.03)}
30
+ .oa-tile:focus-visible{outline:none}
31
+ .oa-tile:focus-visible .oa-tile-art{outline:var(--oa-page-focus-ring-width,2px) solid var(--oa-page-focus-ring-color,var(--oa-page-accent));outline-offset:2px}
32
+ .oa-tile-art>svg{position:relative}
33
+ .oa-tile-art>.oa-tile-doodle{position:absolute;inset:0;width:100%;height:100%;opacity:.14;pointer-events:none}
34
+ .oa-tile-beta{position:absolute;top:6px;left:6px;padding:0 6px;border-radius:999px;background:#fff;box-shadow:0 0 0 .5px var(--oa-page-border-floating,rgba(0,0,0,.16));color:var(--oa-page-text-secondary);font-size:11px;line-height:16px}
35
+ .oa-tile-label{display:flex;flex-direction:column;padding-left:2px;font-size:14px;line-height:20px}
36
+ .oa-tile-state{display:inline-flex;align-items:center;gap:5px;color:var(--oa-page-text-tertiary);font-size:12px;line-height:16px}
37
+ .oa-tile-state[data-state=failed]{color:var(--oa-page-danger)}
38
+ .oa-tile-state .oa-spinner{width:9px;height:9px;border-width:1.2px}
39
+ .oa-tile[data-missing=true] .oa-tile-art{background:color-mix(in srgb,var(--oa-wash) 45%,var(--oa-page-bg));color:color-mix(in srgb,var(--oa-ink) 55%,var(--oa-page-bg));box-shadow:inset 0 0 0 .5px color-mix(in srgb,var(--oa-ink) 22%,transparent)}
40
+ .oa-tile[data-missing=true]:hover .oa-tile-art,.oa-tile[data-missing=true][data-peek=true] .oa-tile-art{background:color-mix(in srgb,var(--oa-wash) 65%,var(--oa-page-bg))}
41
+ .oa-tile[data-missing=true] .oa-tile-doodle{opacity:.08}
42
+ .oa-tile[data-missing=true] .oa-tile-label{color:var(--oa-page-text-secondary)}
43
+ :where(.oa-page)[data-theme=dark] .oa-tile-art{background:color-mix(in srgb,var(--oa-ink) 36%,var(--oa-page-bg));color:var(--oa-wash)}
44
+ :where(.oa-page)[data-theme=dark] .oa-tile[data-missing=true] .oa-tile-art{background:color-mix(in srgb,var(--oa-ink) 16%,var(--oa-page-bg));color:color-mix(in srgb,var(--oa-wash) 55%,var(--oa-page-bg));box-shadow:inset 0 0 0 .5px color-mix(in srgb,var(--oa-wash) 18%,transparent)}
45
+ :where(.oa-page)[data-theme=dark] .oa-tile[data-missing=true]:hover .oa-tile-art,:where(.oa-page)[data-theme=dark] .oa-tile[data-missing=true][data-peek=true] .oa-tile-art{background:color-mix(in srgb,var(--oa-ink) 24%,var(--oa-page-bg))}
46
+ :where(.oa-page)[data-theme=dark] .oa-tile-art>.oa-tile-doodle{opacity:.12}
47
+ :where(.oa-page)[data-theme=dark] .oa-tile-beta{background:var(--oa-page-bg)}
48
+ .oa-peek{position:fixed;z-index:900;width:288px;max-width:calc(100vw - 16px);box-sizing:border-box;padding:16px;border:.5px solid var(--oa-page-border-floating,rgba(0,0,0,.16));border-radius:16px;background:var(--oa-page-bg);box-shadow:0 12px 32px -10px rgba(0,0,0,.22);color:var(--oa-page-text-primary);animation:oa-peek-in .14s ease-out}
49
+ .oa-peek-title{font-size:17px;line-height:24px}
50
+ .oa-peek-by{margin-top:2px;font-size:14px;line-height:20px;color:var(--oa-page-text-secondary)}
51
+ .oa-peek-about{margin:6px 0 0;font-size:14px;line-height:20px;color:var(--oa-page-text-secondary)}
52
+ .oa-peek-act{margin-top:14px;height:32px;padding:0 10px;border:0;border-radius:8px;background:color-mix(in srgb,var(--oa-page-text-primary) 6%,var(--oa-page-bg));color:var(--oa-page-text-primary);font:inherit;font-size:14px;cursor:pointer}
53
+ .oa-peek-act:hover{background:color-mix(in srgb,var(--oa-page-text-primary) 10%,var(--oa-page-bg))}
54
+ .oa-peek-act:focus-visible{outline:var(--oa-page-focus-ring-width,2px) solid var(--oa-page-focus-ring-color,var(--oa-page-accent));outline-offset:2px}
55
+ @keyframes oa-peek-in{from{opacity:0;transform:translateY(-4px)}}
56
+ .oa-dialog-head{display:flex;align-items:center;gap:12px;margin-bottom:12px}
57
+ .oa-dialog-head h2{margin:0}
58
+ .oa-dialog .oa-glyph{width:40px;height:40px}
59
+ .oa-dialog p+p{margin-top:8px}
60
+ .oa-dialog p[data-kind=error]{color:var(--oa-page-danger)}
61
+ .oa-dialog-status{display:flex;align-items:center;gap:8px}
62
+ .oa-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(260px,1fr));gap:20px;margin:0;padding:0;list-style:none}
63
+ .oa-item{position:relative;min-width:0}
64
+ .oa-card{display:flex;flex-direction:column;width:100%;padding:0;border:.5px solid var(--oa-page-border);border-radius:14px;overflow:hidden;background:var(--oa-page-bg);color:inherit;font:inherit;text-align:left;cursor:pointer;transition:background-color .15s}
65
+ .oa-item:hover .oa-card{background:var(--oa-page-hover-bg)}
66
+ .oa-card:disabled{cursor:progress}
67
+ .oa-card:focus-visible,.oa-row:focus-visible{outline:var(--oa-page-focus-ring-width,2px) solid var(--oa-page-focus-ring-color,var(--oa-page-accent));outline-offset:2px}
68
+ .oa-preview{position:relative;display:block;width:100%;aspect-ratio:2/1;overflow:hidden;background:color-mix(in srgb,var(--oa-tint) 16%,var(--oa-page-bg))}
69
+ .oa-sheet{position:absolute;left:12%;right:12%;top:13%;bottom:-8px;border-radius:8px 8px 0 0;overflow:hidden;background:var(--oa-page-bg);box-shadow:0 0 0 .5px var(--oa-page-border),0 6px 18px -8px rgba(0,0,0,.28);transition:transform .2s}
70
+ .oa-item:hover .oa-sheet{transform:translateY(-3px)}
71
+ .oa-sheet img{display:block;width:100%;height:100%;object-fit:cover;object-position:top center;user-select:none}
72
+ .oa-preview[data-stack=true] .oa-sheet{left:20%;right:20%}
73
+ .oa-preview[data-stack=true]::before{content:"";position:absolute;left:21%;right:19%;top:10%;bottom:-8px;border-radius:8px 8px 0 0;background:var(--oa-page-bg);box-shadow:0 0 0 .5px var(--oa-page-border);transform:rotate(1.6deg);transform-origin:bottom center}
74
+ .oa-paper{position:absolute;left:14%;right:14%;top:13%;bottom:-8px;border-radius:8px 8px 0 0;background:var(--oa-page-bg);box-shadow:0 0 0 .5px var(--oa-page-border),0 6px 18px -8px rgba(0,0,0,.25);padding:6% 7% 0;display:flex;flex-direction:column;gap:6px;overflow:hidden;transition:transform .2s}
75
+ .oa-item:hover .oa-paper{transform:translateY(-3px)}
76
+ .oa-paper-title{font-size:11px;line-height:1.35;font-weight:600;color:var(--oa-page-text-primary);display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;overflow-wrap:anywhere}
77
+ .oa-line{height:5px;border-radius:3px;background:var(--oa-page-border)}
78
+ .oa-slide{position:absolute;left:14%;right:14%;top:13%;aspect-ratio:16/9;border-radius:6px;background:var(--oa-page-bg);box-shadow:0 0 0 .5px var(--oa-page-border),0 6px 18px -8px rgba(0,0,0,.25);display:flex;flex-direction:column;justify-content:center;gap:6px;padding:0 9%;transition:transform .2s}
79
+ .oa-item:hover .oa-slide{transform:translateY(-3px)}
80
+ .oa-slide .oa-paper-title{font-size:12px}
81
+ .oa-slide .oa-line{width:40%;background:var(--oa-tint);opacity:.55}
82
+ .oa-boards{display:flex;gap:6px;flex:1;margin-top:2px}
83
+ .oa-board{flex:1;border-radius:3px;background:color-mix(in srgb,var(--oa-tint) 18%,var(--oa-page-bg));box-shadow:0 0 0 .5px var(--oa-page-border)}
84
+ .oa-board:nth-child(2){flex:.7;margin-top:10%}
85
+ .oa-flow{display:block;width:100%;height:auto;margin-top:4px}
86
+ .oa-flow rect{fill:color-mix(in srgb,var(--oa-tint) 18%,var(--oa-page-bg));stroke:var(--oa-page-border);stroke-width:.5}
87
+ .oa-flow path{fill:none;stroke:var(--oa-tint);stroke-width:1.2;stroke-linecap:round;stroke-linejoin:round}
88
+ .oa-cells{display:block;width:100%;height:auto;margin-top:4px}
89
+ .oa-cells path{fill:none;stroke:var(--oa-page-border);stroke-width:.75}
90
+ .oa-cells-head{fill:color-mix(in srgb,var(--oa-tint) 18%,var(--oa-page-bg))}
91
+ .oa-cells-pick{fill:none;stroke:var(--oa-tint);stroke-width:1.5}
92
+ .oa-swatches{display:flex;gap:4px}
93
+ .oa-swatch{width:16px;height:16px;border-radius:50%;background:var(--oa-tint)}
94
+ .oa-swatch:nth-child(2){opacity:.7}.oa-swatch:nth-child(3){opacity:.45}.oa-swatch:nth-child(4){opacity:.25}
95
+ .oa-specimen{font-size:20px;line-height:1;font-weight:600;color:var(--oa-page-text-secondary)}
96
+ .oa-kpis{display:flex;gap:5px}
97
+ .oa-kpi{flex:1;height:16px;border-radius:3px;box-shadow:0 0 0 .5px var(--oa-page-border)}
98
+ .oa-bars{display:flex;align-items:flex-end;gap:5px;height:34%;margin-top:2px}
99
+ .oa-bar{flex:1;border-radius:2px 2px 0 0;background:var(--oa-tint);opacity:.7}
100
+ .oa-film{position:absolute;left:14%;right:14%;top:13%;aspect-ratio:16/9;border-radius:6px;background:#1d1d1f;box-shadow:0 6px 18px -8px rgba(0,0,0,.35);display:flex;align-items:center;justify-content:center;transition:transform .2s;color:#fff}
101
+ .oa-item:hover .oa-film{transform:translateY(-3px)}
102
+ .oa-film-bar{position:absolute;left:8%;right:8%;bottom:10%;height:3px;border-radius:2px;background:rgba(255,255,255,.25)}
103
+ .oa-film-bar::after{content:"";position:absolute;left:0;top:0;bottom:0;width:38%;border-radius:2px;background:var(--oa-tint)}
104
+ .oa-film-title{position:absolute;left:8%;right:8%;top:10%;font-size:10px;font-weight:600;color:rgba(255,255,255,.85);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
105
+ .oa-busy{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;gap:8px;background:color-mix(in srgb,var(--oa-page-bg) 70%,transparent);color:var(--oa-page-text-secondary);font-size:13px}
106
+ .oa-spinner{width:14px;height:14px;border-radius:50%;border:1.5px solid currentColor;border-right-color:transparent;animation:oa-spin .8s linear infinite}
107
+ @keyframes oa-spin{to{transform:rotate(360deg)}}
108
+ .oa-info{display:flex;align-items:center;gap:12px;min-width:0;padding:12px 14px}
109
+ .oa-glyph{flex:none;display:flex;align-items:center;justify-content:center;width:36px;height:36px;border-radius:9px;background:var(--oa-wash);color:var(--oa-ink)}
110
+ :where(.oa-page)[data-theme=dark] .oa-glyph{background:color-mix(in srgb,var(--oa-ink) 36%,var(--oa-page-bg));color:var(--oa-wash)}
111
+ .oa-menu-glyph{display:flex;color:var(--oa-ink)}
112
+ :where(.oa-page)[data-theme=dark] .oa-menu-glyph{color:var(--oa-wash)}
113
+ .oa-text{display:flex;flex-direction:column;min-width:0;flex:1}
114
+ .oa-name{font-weight:500;line-height:20px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
115
+ .oa-meta{color:var(--oa-page-text-tertiary);font-size:12px;line-height:18px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
116
+ .oa-actions{position:absolute;top:10px;right:10px;display:flex;align-items:center;gap:6px}
117
+ .oa-act{display:inline-flex;align-items:center;justify-content:center;width:30px;height:30px;padding:0;border:.5px solid var(--oa-page-border);border-radius:8px;background:var(--oa-page-bg);color:var(--oa-page-text-secondary);cursor:pointer;opacity:0;transition:opacity .12s}
118
+ .oa-act:hover{color:var(--oa-page-text-primary);background:color-mix(in srgb,var(--oa-page-text-primary) 6%,var(--oa-page-bg))}
119
+ .oa-item:hover .oa-act,.oa-item:focus-within .oa-act,.oa-act[aria-expanded=true],.oa-act[data-on=true]{opacity:1}
120
+ .oa-act[data-on=true]{color:var(--oa-page-text-primary)}
121
+ .oa-list{display:flex;flex-direction:column;gap:2px;margin:0;padding:0;list-style:none}
122
+ .oa-list .oa-item{display:flex;align-items:center;border-radius:10px;padding-right:8px}
123
+ .oa-list .oa-item:hover,.oa-list .oa-item[data-menu=true]{background:var(--oa-page-hover-bg)}
124
+ .oa-row{display:flex;align-items:center;gap:12px;flex:1;min-width:0;padding:8px 10px;border:0;border-radius:10px;background:none;color:inherit;font:inherit;text-align:left;cursor:pointer}
125
+ .oa-row:disabled{cursor:progress}
126
+ .oa-row .oa-name{flex:1;min-width:0}
127
+ .oa-row .oa-meta{flex:none;max-width:45%;margin-left:16px}
128
+ .oa-row-tools{flex:none;display:flex;align-items:center;gap:2px;margin-left:4px;color:var(--oa-page-text-tertiary)}
129
+ .oa-shared{display:inline-flex;align-items:center;margin-right:6px;color:var(--oa-page-text-tertiary)}
130
+ .oa-list .oa-act{width:28px;height:28px;border:0;background:none}
131
+ .oa-list .oa-act:hover{background:color-mix(in srgb,var(--oa-page-text-primary) 8%,transparent)}
132
+ .oa-list .oa-act-more{opacity:1}
133
+ @media (max-width:560px){.oa-row .oa-meta{display:none}}
134
+ .oa-menu{position:fixed;z-index:1000;min-width:200px;padding:6px;border:.5px solid var(--oa-page-border);border-radius:12px;background:var(--oa-page-bg);box-shadow:0 8px 28px -6px rgba(0,0,0,.28);font-size:14px}
135
+ .oa-menu-item{display:flex;align-items:center;gap:10px;width:100%;min-height:34px;padding:5px 10px;border:0;border-radius:8px;background:none;color:var(--oa-page-text-primary);font:inherit;text-align:left;white-space:nowrap;cursor:pointer}
136
+ .oa-menu-item:hover,.oa-menu-item:focus-visible,.oa-menu-item[aria-expanded=true]{background:var(--oa-page-hover-bg);outline:none}
137
+ .oa-menu-item[data-danger=true]{color:var(--oa-page-danger)}
138
+ .oa-menu-item svg{flex:none}
139
+ .oa-menu-label{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis}
140
+ .oa-menu-value{margin-left:16px;color:var(--oa-page-text-tertiary)}
141
+ .oa-menu-count{margin-left:16px;color:var(--oa-page-text-tertiary);font-variant-numeric:tabular-nums}
142
+ .oa-menu-key{margin-left:20px;color:var(--oa-page-text-tertiary);font:inherit;font-size:12px}
143
+ .oa-menu-rule{height:.5px;margin:6px 4px;background:var(--oa-page-border)}
144
+ .oa-menu-chev{margin-left:6px;color:var(--oa-page-text-tertiary)}
145
+ .oa-menu-row{position:relative}
146
+ .oa-submenu{position:absolute;left:calc(100% + 12px);top:-6px;z-index:1001;min-width:190px;padding:6px;border:.5px solid var(--oa-page-border);border-radius:12px;background:var(--oa-page-bg);box-shadow:0 8px 28px -6px rgba(0,0,0,.28)}
147
+ .oa-submenu[data-flip=true]{left:auto;right:calc(100% + 12px)}
148
+ .oa-check{flex:none;display:inline-flex;align-items:center;justify-content:center;width:18px;height:18px;border:1px solid var(--oa-page-border-strong);border-radius:5px;color:transparent}
149
+ .oa-check[data-on=true]{border-color:var(--oa-page-accent);background:var(--oa-page-accent);color:#fff}
150
+ .oa-tick{flex:none;margin-left:16px;color:var(--oa-page-accent)}
151
+ .oa-scrim{position:fixed;inset:0;z-index:1100;display:flex;align-items:center;justify-content:center;padding:24px;background:rgba(0,0,0,.36)}
152
+ .oa-dialog{width:min(420px,100%);padding:20px;border-radius:16px;background:var(--oa-page-bg);box-shadow:0 18px 48px -12px rgba(0,0,0,.4)}
153
+ .oa-dialog h2{margin:0 0 12px;font-size:16px;font-weight:600;line-height:24px;overflow-wrap:anywhere}
154
+ .oa-dialog p{margin:0;color:var(--oa-page-text-secondary);font-size:14px;line-height:1.55;overflow-wrap:anywhere}
155
+ .oa-dialog input{box-sizing:border-box;width:100%;height:38px;padding:0 12px;border:1px solid var(--oa-page-border);border-radius:10px;background:none;color:var(--oa-page-text-primary);font:inherit;outline:none}
156
+ .oa-dialog input:focus{border-color:var(--oa-page-accent)}
157
+ .oa-dialog-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:20px}
158
+ .oa-btn{height:34px;padding:0 14px;border:0;border-radius:9px;background:var(--oa-page-hover-bg);color:var(--oa-page-text-primary);font:inherit;font-weight:500;cursor:pointer}
159
+ .oa-btn:hover{background:color-mix(in srgb,var(--oa-page-text-primary) 12%,var(--oa-page-bg))}
160
+ .oa-btn:disabled{color:var(--oa-page-text-caption);cursor:default;background:var(--oa-page-hover-bg)}
161
+ .oa-btn[data-primary=true]{background:var(--oa-page-accent);color:#fff}
162
+ .oa-btn[data-primary=true]:hover:not(:disabled){filter:brightness(1.08)}
163
+ .oa-btn[data-primary=true]:disabled{background:var(--oa-page-hover-bg);color:var(--oa-page-text-caption)}
164
+ .oa-btn[data-danger=true]{border:1px solid var(--oa-page-danger);background:color-mix(in srgb,var(--oa-page-danger) 10%,var(--oa-page-bg));color:var(--oa-page-danger)}
165
+ .oa-btn[data-danger=true]:hover{background:color-mix(in srgb,var(--oa-page-danger) 18%,var(--oa-page-bg))}
166
+ .oa-toast{position:absolute;left:50%;bottom:24px;z-index:900;display:flex;align-items:center;gap:10px;max-width:min(560px,calc(100% - 32px));padding:9px 10px 9px 14px;border:.5px solid var(--oa-page-border);border-radius:12px;background:var(--oa-page-bg);box-shadow:0 8px 28px -6px rgba(0,0,0,.28);transform:translateX(-50%);font-size:14px}
167
+ .oa-toast[data-kind=error]{color:var(--oa-page-danger)}
168
+ .oa-toast svg{flex:none}
169
+ .oa-toast-text{min-width:0;overflow-wrap:anywhere}
170
+ .oa-toast-undo{flex:none;padding:2px 8px;border:0;border-radius:6px;background:none;color:var(--oa-page-accent);font:inherit;font-weight:500;cursor:pointer}
171
+ .oa-toast-undo:hover{background:var(--oa-page-hover-bg)}
172
+ .oa-toast-close{flex:none;display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;padding:0;border:0;border-radius:6px;background:none;color:var(--oa-page-text-tertiary);cursor:pointer}
173
+ .oa-toast-close:hover{background:var(--oa-page-hover-bg)}
174
+ .oa-empty{display:flex;flex-direction:column;align-items:center;gap:8px;padding:56px 20px;text-align:center;color:var(--oa-page-text-tertiary)}
175
+ .oa-empty svg{color:var(--oa-page-text-caption);margin-bottom:4px}
176
+ .oa-empty h2{margin:0;font-size:14px;font-weight:500;color:var(--oa-page-text-secondary)}
177
+ .oa-empty p{margin:0;max-width:420px;font-size:13px;line-height:1.6}
178
+ .oa-retry{margin-top:8px;height:30px;padding:0 12px;border:.5px solid var(--oa-page-border);border-radius:15px;background:none;color:var(--oa-page-text-primary);font:inherit;font-size:13px;cursor:pointer}
179
+ .oa-retry:hover{background:var(--oa-page-hover-bg)}
180
+ .oa-skeleton .oa-card{cursor:default}
181
+ .oa-skeleton .oa-preview{background:var(--oa-page-skeleton-bg,var(--oa-page-hover-bg))}
182
+ .oa-skeleton .oa-line{width:60%;height:10px;margin:18px 14px}
183
+ @media (prefers-reduced-motion:reduce){.oa-sheet,.oa-paper,.oa-slide,.oa-film,.oa-act,.oa-tile-art,.oa-card{transition:none}.oa-tile:hover .oa-tile-art,.oa-tile[data-peek=true] .oa-tile-art{transform:none}.oa-peek{animation:none}.oa-spinner{animation-duration:2s}}
184
+ .oa-news .oau-head{margin-bottom:8px}
185
+ .oa-notes{display:flex;flex-direction:column;gap:12px;align-items:flex-start}
186
+ .oa-release{align-self:stretch;min-width:0}
187
+ .oa-release-head{display:flex;flex-wrap:wrap;align-items:center;gap:4px 8px;margin:0 0 4px;font-size:14px;font-weight:600;line-height:22px;color:var(--oa-page-text-primary)}
188
+ .oa-release-date{font-weight:400;color:var(--oa-page-text-tertiary);font-size:12px}
189
+ .oa-release-summary{margin:0 0 6px;color:var(--oa-page-text-primary);font-size:13px;line-height:20px;overflow-wrap:anywhere}
190
+ .oa-release-section{margin-top:6px}
191
+ .oa-release-section h4{margin:0 0 2px;font-size:12px;font-weight:500;line-height:18px;color:var(--oa-page-text-tertiary)}
192
+ .oa-release-section ul{margin:0;padding-left:18px;color:var(--oa-page-text-secondary);font-size:13px;line-height:20px}
193
+ .oa-release-section li{overflow-wrap:anywhere}
194
+ .oa-release-section li+li{margin-top:2px}
195
+ .oa-release code{padding:0 4px;border-radius:4px;background:color-mix(in srgb,var(--oa-page-text-primary) 8%,transparent);font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:12px}
196
+ .oa-release strong{font-weight:600;color:var(--oa-page-text-primary)}
197
+ .oa-release a{color:var(--oa-page-accent)}
198
+ .oa-news-upcoming{display:flex;flex-direction:column;align-items:flex-start;gap:8px;margin-top:10px;padding-top:10px;border-top:.5px solid var(--oa-page-border)}
199
+ .oa-foot{display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:4px 8px;margin-top:40px;color:var(--oa-page-text-tertiary);font-size:12px;line-height:18px}
200
+ .oa-dialog[data-wide=true]{width:min(640px,100%);display:flex;flex-direction:column;max-height:min(720px,calc(100vh - 48px))}
201
+ .oa-changelog{flex:1;min-height:0;overflow:auto;margin:0 -20px;padding:0 20px}
202
+ .oa-changelog .oa-release+.oa-release{padding-top:12px;border-top:.5px solid var(--oa-page-border)}
203
+ .oa-btn-link{display:inline-flex;align-items:center;text-decoration:none;margin-right:auto}
204
+ `,Za=`
205
+ .oau-panel{margin:0 0 24px;padding:14px 16px;border-radius:12px;background:var(--oa-page-hover-bg);color:var(--oa-page-text-primary);font-size:13px;line-height:20px}
206
+ .oau-head{display:flex;flex-wrap:wrap;align-items:flex-start;gap:8px 16px}
207
+ .oau-head-text{flex:1;min-width:200px}
208
+ .oau-title{font-weight:500;overflow-wrap:anywhere}
209
+ .oau-text{color:var(--oa-page-text-secondary);overflow-wrap:anywhere}
210
+ .oau-actions{flex:none;display:flex;gap:8px}
211
+ .oau-line{display:flex;flex-wrap:wrap;align-items:center;gap:4px 8px;margin:0 0 20px;color:var(--oa-page-text-secondary);font-size:13px;line-height:20px}
212
+ .oau-show{padding:0;border:0;background:none;color:var(--oa-page-accent);font:inherit;cursor:pointer}
213
+ .oau-show:hover{text-decoration:underline}
214
+ .oau-tag{display:inline-flex;align-items:center;padding:0 8px;border-radius:9px;font-size:12px;line-height:20px;background:color-mix(in srgb,var(--oa-page-accent) 12%,transparent);color:var(--oa-page-accent)}
215
+ .oau-tag[data-tone="neutral"]{background:var(--oa-page-hover-bg);color:var(--oa-page-text-secondary)}
216
+ `;function Ja(t,a){if(typeof document>"u"||!a)return()=>{};if(document.querySelector(`style[data-plugin-css="${t}"]`))return()=>{};const o=document.createElement("style");return o.dataset.pluginCss=t,o.textContent=a,document.head.appendChild(o),()=>o.remove()}function xt(t){if(!t)return null;if(!/^[a-z][a-z0-9+.-]*:\/\//i.test(t)&&!t.startsWith("/"))return t;try{return new URL(t,"http://localhost").searchParams.get("v")??t}catch{return t}}function Q(t,a){const o=t.createdAt??"",n=t.owner??null;return{id:t.id??"",root:t.root??"",project:t.project??"",type:t.type??"",typeTitle:t.typeTitle??t.type??"",sessionId:n?.harness===a&&typeof n.session=="string"?n.session:"",ownerStatus:n?n.live===!1?"offline":n.status??null:null,title:t.title??"",openedAt:t.openedAt??o,createdAt:o,updatedAt:t.contentAt??t.updatedAt??o,pinned:!!t.pinned,shared:!!t.shared,thumbnail:xt(t.thumbnail),openable:!t.typeMissing,viewUrl:t.view_url??""}}function Qa(t){return t.filter(a=>typeof a.id=="string"&&a.enabled!==!1&&a.runnable!==!1&&!a.shadowedBy&&!a.problems?.length).map(a=>({id:a.id,title:a.title||a.id,description:a.description??""}))}function Xa(t,a,o){return{artifacts:(t.artifacts??[]).map(n=>Q(n,o)),types:Qa(a.types??[])}}function eo(t,a){return{url:t.view_url??a.viewUrl,sessionId:a.sessionId,title:a.title}}function to(t,a){return{trash:t.deleted??a,path:t.folderKept??""}}const J="",X=(t,a)=>`/api/open-artifact.${t}${a?`?${new URLSearchParams(a)}`:""}`;async function ve(t,a,o){const n=await t(X(a,o?.query),{cache:"no-store",...o?.body!==void 0?{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(o.body)}:{}}),r=await n.json().catch(()=>({}));if(!n.ok)throw new Error(typeof r.message=="string"&&r.message?r.message:`HTTP ${n.status}`);return r}function ao(t=(...a)=>fetch(...a)){const a=(r,l)=>ve(t,r,l?{query:l}:void 0),o=(r,l)=>ve(t,r,{body:l}),n=async r=>Q(await a(E.artifact,{id:r}),J);return{async list(){const[r,l]=await Promise.all([a(E.artifacts),a(E.types)]);return Xa(r,l,J)},async open(r){const l=await o(E.open,{id:r,host:!1});return eo(l,await n(r))},preview:async r=>(await o(E.preview,{id:r})).page_url??null,update:async(r,l)=>Q(await o(E.update,{id:r,...l}),J),remove:async r=>to(await o(E.delete,{id:r}),r),restore:async r=>Q(await o(E.restore,{id:r}),J),async saveThumbnail(r,l,d){const u=await t(X(E.thumbnail,{id:r,v:l}),{method:"POST",headers:{"content-type":"image/jpeg"},body:d}),c=await u.json().catch(()=>({}));return u.ok?xt(c.thumbnail)??l:null},thumbnailUrl:(r,l)=>X(E.thumbnail,{id:r,v:l}),events(r,l){if(typeof EventSource>"u")return null;const d=new EventSource(X(E.events));return d.onmessage=()=>r(),d.onerror=()=>l(),()=>d.close()}}}function qe(t,a){const o=t.app();o?.caps.artifacts?t.toApp({openArtifact:"open_artifact",url:`open-artifact://artifact/${a.id}`,id:a.id,title:a.title,type:a.type},o.origin):t.navigate(Dt(a.id))}function oo(t){const a=t.fetcher??((...o)=>fetch(...o));return{canCreate:()=>!0,create(o){if(!o)return;const n=Ft(o.id)==="blank";ve(a,E.create,{body:{type:o.id,title:t.untitled(o.title),...n?{blank:!0}:{}}}).then(r=>{typeof r.id=="string"&&qe(t,{id:r.id,title:r.title||o.title,type:r.typeTitle||o.title})},r=>t.failed(r instanceof Error?r.message:String(r)))},away:()=>!1,pendingWindow:()=>null,async show(o){const n=/\/a\/([^/?#]+)/.exec(o.url)?.[1];if(n){const r=decodeURIComponent(n);qe(t,{id:r,title:o.title,type:t.typeOf(r)})}else t.navigate(o.url);return{sessionGone:!1}},copy:o=>t.copy(o),visible:()=>t.visible(),storage:t.storage}}function no(t,a){if(!Ot(t)||t.openArtifact!=="host_hello")return null;const o=zt(t);return!o||o.openArtifact!=="host_hello"?null:{origin:a,caps:o.caps,theme:o.theme?.scheme??null}}const ro={updates:[],phase:"idle",to:"",restart:!1,failure:null,dismissed:""};function io(t){const{status:a}=t,o=a?.check?.available??"",n=a?.running??"",r=a?.policy.update;return{updates:!!o&&r!=="off"&&r!=="bundled"&&(!n||O(o,n))?[{name:"Open Artifact",version:n,latest:o}]:[],phase:t.phase,to:t.to,restart:t.pending,failure:t.phase==="failed"?{plugin:"Open Artifact",message:t.error,left:"kept"}:null,dismissed:t.dismissed}}const so={available:"updateAvailable",current:"updateCurrent",update:"updateNow","update.one":"updateNow",later:"updateLater",busy:"updateBusy",done:"updateDone","done.session":"updateDoneCurrent","done.restart":"updateDonePending",failed:"updateFailed","failed.kept":"updateFailedKept","failed.unknown":"updateFailedKept",retry:"updateRetry",close:"updateClose",show:"updateShow",restart:"updateClose"};function lo(t){let a=null,o=ro;return{getSnapshot(){const n=t.get();if(n!==a){a=n;const r=io(n);o=JSON.stringify(r)===JSON.stringify(o)?o:r}return o},subscribe:t.subscribe,start:t.start,later:t.later,close:t.close,reopen:t.reopen,t:(n,r)=>t.words(so[n],r)}}const co=Object.freeze({"--oa-page-text-primary":["#1a1a1a","#ececea"],"--oa-page-text-secondary":["#4a4a4a","#b8b8b4"],"--oa-page-text-tertiary":["#5c5c5c","#8f8f8a"],"--oa-page-text-caption":["#8a8a8a","#6b6b67"],"--oa-page-bg":["#ffffff","#1c1c1e"],"--oa-page-hover-bg":["#f1f1f1","#2a2a2c"],"--oa-page-accent":["#2f5fe0","#5b84f0"],"--oa-page-danger":["#d1373b","#f06a6e"],"--oa-page-border-strong":["#cfcfcf","#4a4a4c"],"--oa-page-border":["#e2e2e2","#333335"],"--oa-page-border-floating":["rgba(0,0,0,.14)","rgba(255,255,255,.14)"],"--oa-page-skeleton-bg":["#f1f1f1","#2a2a2c"],"--oa-page-focus-ring-width":["2px","2px"],"--oa-page-focus-ring-color":["#2f5fe0","#5b84f0"],"--oa-page-top-clearance":["0px","0px"]}),Ze=t=>Object.entries(co).map(([a,o])=>`${a}:${o[t]}`).join(";"),po=`
217
+ :root{color-scheme:light;${Ze(0)}}
218
+ :root[data-theme=dark]{color-scheme:dark;${Ze(1)}}
219
+ html,body,#root{height:100%;margin:0}
220
+ body{background:var(--oa-page-bg);color:var(--oa-page-text-primary);font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"PingFang SC","Microsoft YaHei",sans-serif;-webkit-font-smoothing:antialiased}
221
+ `,Le=$t==="zh-CN",uo=Le?et:tt,mt=ra((t,a)=>{const o=uo[t];return o===void 0?t:o.replace(/\{(\w+)\}/g,(n,r)=>a?.[r]??n)});document.documentElement.lang=Le?"zh-CN":"en";let Oe=null;const we=new Set,ho=t=>{Oe=t;for(const a of we)a()};let ft=null;try{ft=typeof localStorage>"u"?null:localStorage}catch{}async function go(t){try{await navigator.clipboard.writeText(t)}catch{const a=document.createElement("textarea");a.value=t,a.style.cssText="position:fixed;opacity:0",document.body.append(a),a.select();const o=document.execCommand("copy");if(a.remove(),!o)throw new Error("the clipboard refused it")}}const bt=ao(),je=xa({api:bt,t:mt,host:oo({app:()=>Oe,toApp:(t,a)=>window.parent.postMessage(t,a),navigate:t=>location.assign(t),failed:t=>je.getState().showToast(t,"error"),copy:go,visible:()=>document.visibilityState==="visible",storage:ft,untitled:t=>{const a=t.replace(/\s*[((].*[))]\s*$/,"")||t;return Le?`未命名${a}`:`Untitled ${a}`},typeOf:t=>je.getState().artifacts.find(a=>a.id===t)?.typeTitle??""})}),xo=lo({get:()=>We.getState(),subscribe:t=>We.subscribe(t),start:()=>{Kt()},later:Ht,close:Ut,reopen:Bt,words:(t,a)=>Wt(t,a)}),mo={t:mt,api:bt,sessions:Vt,updates:xo},yt=window.parent!==window,fo=_t();window.addEventListener("message",t=>{if(!yt||t.source!==window.parent)return;const a=no(t.data,t.origin);a&&fo().then(({hosts:o,latest:n})=>{!n||o?.length&&!o.includes(t.origin)||(ho(a),window.parent.postMessage({openArtifact:"home_ready"},t.origin))})});yt&&window.parent.postMessage({openArtifact:"home_hello"},"*");const ke=typeof matchMedia=="function"?matchMedia("(prefers-color-scheme: dark)"):null;function bo(t){return we.add(t),ke?.addEventListener("change",t),()=>{we.delete(t),ke?.removeEventListener("change",t)}}const Je=()=>Oe?.theme??(ke?.matches?"dark":"light");function yo(){const t=g.useSyncExternalStore(bo,Je,Je);return document.documentElement.dataset.theme=t,e.jsx(Zt,{env:mo,children:e.jsx(ma,{store:je,children:e.jsx(Ga,{canCreate:!0,theme:t,createButton:!1})})})}Ja("open-artifact-library/page.css",po+qa+Za);Rt();It.createRoot(document.getElementById("root")).render(e.jsx(g.StrictMode,{children:e.jsx(yo,{})}));