@inkeep/open-knowledge 0.45.0 → 0.45.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 (70) hide show
  1. package/dist/{acp-harness-probe-pxi823CF.mjs → acp-harness-probe-Us0IafTi.mjs} +2 -2
  2. package/dist/assets/skills/discovery/SKILL.md +1 -1
  3. package/dist/assets/skills/project/SKILL.md +1 -1
  4. package/dist/assets/skills/write-skill/SKILL.md +1 -1
  5. package/dist/cli.mjs +6 -6
  6. package/dist/constants-Dhlj1fLH.mjs +2 -0
  7. package/dist/index.mjs +1 -1
  8. package/dist/{init-CgNWpE2S.mjs → init-BGnjPIOd.mjs} +3 -3
  9. package/dist/init-D9AKwMxQ.mjs +1 -0
  10. package/dist/{launch-json-removal-OJNI-717.mjs → launch-json-removal-kW2xJOZl.mjs} +2 -2
  11. package/dist/{loader-EGm-qx5P.mjs → loader-CLBwZqWz.mjs} +2 -2
  12. package/dist/loader-CvbPsH4q.mjs +1 -0
  13. package/dist/preview-31FJ4eKI.mjs +1 -0
  14. package/dist/{preview-BPL7w_cV.mjs → preview-BOnPQ_VV.mjs} +2 -2
  15. package/dist/public/assets/{ActivityModeContent-CcG8767K.js → ActivityModeContent-B6-70ang.js} +1 -1
  16. package/dist/public/assets/{AgentDiffPane-D8YoofwF.js → AgentDiffPane-DeWSzAp-.js} +1 -1
  17. package/dist/public/assets/{BugReportHistory-B0qbbAw0.js → BugReportHistory-DrMLEEP8.js} +1 -1
  18. package/dist/public/assets/{BugReportHistoryDialog-Bp4PHyEI.js → BugReportHistoryDialog-Cf_ZrCjH.js} +1 -1
  19. package/dist/public/assets/{CodeMirrorPropInput-B4tL-3Ht.js → CodeMirrorPropInput-CUPvWzYm.js} +1 -1
  20. package/dist/public/assets/{DocumentContext-FCJwmuAo.js → DocumentContext-B-29n_HL.js} +1 -1
  21. package/dist/public/assets/{EditorModeToggle-DcuaOmV8.js → EditorModeToggle-CigjLJ2Z.js} +1 -1
  22. package/dist/public/assets/{EnableSyncConfirmDialog-CTsdvp_5.js → EnableSyncConfirmDialog-DTG7riiK.js} +1 -1
  23. package/dist/public/assets/FeedbackForm-BtkuXFGI.js +1 -0
  24. package/dist/public/assets/{LintConfigEditor-MRWig8E3.js → LintConfigEditor-ylJ89_uD.js} +1 -1
  25. package/dist/public/assets/{ManagedArtifactProperties-DIfvPtzN.js → ManagedArtifactProperties-D3xtiDXY.js} +1 -1
  26. package/dist/public/assets/{MermaidDocEditor-DsEY1FOt.js → MermaidDocEditor-R8D5JpPi.js} +1 -1
  27. package/dist/public/assets/{PropertyPanel-DA4qhX7-.js → PropertyPanel-H098JdnP.js} +1 -1
  28. package/dist/public/assets/{RegisteredAgentIcon-C2dU04N7.js → RegisteredAgentIcon-DplzDEhh.js} +1 -1
  29. package/dist/public/assets/{ReportBugDialogBody-CgzQLCKM.js → ReportBugDialogBody-DZFX9Uby.js} +2 -2
  30. package/dist/public/assets/{SchemaConfigEditor-BdzkNqsH.js → SchemaConfigEditor-BHuEU14f.js} +1 -1
  31. package/dist/public/assets/{SettingsDialogBody-B4PW-A-w.js → SettingsDialogBody-ZYeLdOBh.js} +1 -1
  32. package/dist/public/assets/{ShareReceiveMissDialog-_26zWSVZ.js → ShareReceiveMissDialog-CIsXJHV5.js} +1 -1
  33. package/dist/public/assets/{SkillEditorActions-CBKpfxev.js → SkillEditorActions-DesRWfir.js} +1 -1
  34. package/dist/public/assets/{SourceEditor-BcRIK3Uz.js → SourceEditor-Gg4gFBXn.js} +1 -1
  35. package/dist/public/assets/{TerminalSessionsHost-B0kLulV_.js → TerminalSessionsHost-BVUmqdhT.js} +2 -2
  36. package/dist/public/assets/{TerminalWindowApp-CMdYDyv_.js → TerminalWindowApp-BrV49Q8V.js} +1 -1
  37. package/dist/public/assets/{ThreadView-DQThTEIO.js → ThreadView-DouqkaQt.js} +1 -1
  38. package/dist/public/assets/{TimelineDiffPane-CsNp0WRG.js → TimelineDiffPane-DrdY8iSv.js} +1 -1
  39. package/dist/public/assets/{auth-state-cache-EkXfX8vV.js → auth-state-cache-DOwAr8pE.js} +1 -1
  40. package/dist/public/assets/{client-version-CVjSHBE0.js → client-version-CWjw2o37.js} +1 -1
  41. package/dist/public/assets/{config-provider-CvXAYjor.js → config-provider--LBV5X-F.js} +1 -1
  42. package/dist/public/assets/globals-BtCTpjIr.css +1 -0
  43. package/dist/public/assets/{index-Dw-K4FA8.js → index-D6QuW6BA.js} +7 -7
  44. package/dist/public/assets/{pending-receive-nav-store-Da_9JJXI.js → pending-receive-nav-store-B6dtzPFx.js} +1 -1
  45. package/dist/public/assets/{selection-context-np7NtN5p.js → selection-context-B2HcUOkN.js} +1 -1
  46. package/dist/public/assets/{skill-actions-BgdyM_G0.js → skill-actions-C5Jj4vq_.js} +1 -1
  47. package/dist/public/assets/{src-D452d0cv.js → src-CttimVGm.js} +1 -1
  48. package/dist/public/assets/{telemetry-impl-C8kYleYy.js → telemetry-impl-BFTBY40l.js} +1 -1
  49. package/dist/public/assets/{telemetry-startup-CEgptpjf.js → telemetry-startup-DI3YRseI.js} +1 -1
  50. package/dist/public/assets/{typing-burst-detector-rVKisiec.js → typing-burst-detector-ZNMuwopa.js} +1 -1
  51. package/dist/public/assets/{uninstall-DnE1CJ4K.js → uninstall-940RMTvq.js} +1 -1
  52. package/dist/public/assets/{use-activity-panel-D5Ud5rAK.js → use-activity-panel-BtuJNY3q.js} +1 -1
  53. package/dist/public/assets/{use-terminal-enabled-DLUyAvNx.js → use-terminal-enabled-U4ycZNGm.js} +1 -1
  54. package/dist/public/assets/{use-timeline-entry-diff-g0StQlEH.js → use-timeline-entry-diff-DIrGiWpg.js} +1 -1
  55. package/dist/public/index.html +16 -16
  56. package/dist/public/uninstall.html +3 -3
  57. package/dist/{repair-launch-json-tGZcW42t.mjs → repair-launch-json-CX2m7PDv.mjs} +2 -2
  58. package/dist/{repair-mcp-configs-DZYAXNdR.mjs → repair-mcp-configs-CsXz4Nl2.mjs} +2 -2
  59. package/dist/{src-BfF1eLC-.mjs → src-CeSYiPkq.mjs} +2 -2
  60. package/dist/{start-HwqGYVb8.mjs → start-Cfh9vjj8.mjs} +2 -2
  61. package/dist/start-SfQAws-j.mjs +1 -0
  62. package/package.json +4 -4
  63. package/dist/constants-C5VMTJt2.mjs +0 -2
  64. package/dist/init-BWMly0Jp.mjs +0 -1
  65. package/dist/loader-DQQn8OFp.mjs +0 -1
  66. package/dist/preview-C45NNSLa.mjs +0 -1
  67. package/dist/public/assets/FeedbackForm-DamXgXPd.js +0 -1
  68. package/dist/public/assets/globals-B1VH9dVh.css +0 -1
  69. package/dist/start-DqeJbIko.mjs +0 -1
  70. /package/dist/public/assets/{globals-DLE5hh7Z.js → globals-Dsi-fA9A.js} +0 -0
@@ -1 +1 @@
1
- import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{t as n}from"./react-f2sANaYj.js";import{t as r}from"./compiler-runtime-BfE3aGVn.js";import{s as i,t as a}from"./createLucideIcon-DAkhoPjT.js";import{i as o,n as s,t as c}from"./cursor-B8rehP9c.js";var l=[[`path`,{d:`M12 8V4H8`,key:`hb8ula`}],[`rect`,{width:`16`,height:`12`,x:`4`,y:`8`,rx:`2`,key:`enze0r`}],[`path`,{d:`M2 14h2`,key:`vft8re`}],[`path`,{d:`M20 14h2`,key:`4cs60a`}],[`path`,{d:`M15 13v2`,key:`1xurst`}],[`path`,{d:`M9 13v2`,key:`rq6x2g`}]],u=a(`bot`,l),d=r(),f=e(n(),1),p=t();function m(e){let t=(0,d.c)(13),{agentId:n,iconUrl:r,className:a}=e,[l,m]=(0,f.useState)(!1),h;if(t[0]!==n||t[1]!==a){h=Symbol.for(`react.early_return_sentinel`);bb0:{let e=i(`shrink-0`,a);if(n===`claude-acp`){h=(0,p.jsx)(o,{className:i(`text-[#D97757] [--ok-brand-color:#D97757] [&_*]:![color:var(--ok-brand-color)]`,e),"aria-hidden":`true`});break bb0}if(n===`codex-acp`){h=(0,p.jsx)(s,{className:e,"aria-hidden":`true`});break bb0}if(n===`cursor`){h=(0,p.jsx)(c,{className:i(`text-[#1B1912] [--ok-brand-color:#1B1912] [&_*]:![color:var(--ok-brand-color)] dark:text-white dark:[--ok-brand-color:#FFFFFF]`,e),"aria-hidden":`true`});break bb0}}t[0]=n,t[1]=a,t[2]=h}else h=t[2];if(h!==Symbol.for(`react.early_return_sentinel`))return h;if(r===void 0||l){let e;t[3]===a?e=t[4]:(e=i(`shrink-0 text-muted-foreground`,a),t[3]=a,t[4]=e);let n;return t[5]===e?n=t[6]:(n=(0,p.jsx)(u,{className:e,"aria-hidden":`true`}),t[5]=e,t[6]=n),n}let g;t[7]===a?g=t[8]:(g=i(`shrink-0 rounded`,a),t[7]=a,t[8]=g);let _;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(_=()=>m(!0),t[9]=_):_=t[9];let v;return t[10]!==r||t[11]!==g?(v=(0,p.jsx)(`img`,{src:r,alt:``,"aria-hidden":`true`,className:g,onError:_}),t[10]=r,t[11]=g,t[12]=v):v=t[12],v}export{u as n,l as r,m as t};
1
+ import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{t as n}from"./react-f2sANaYj.js";import{t as r}from"./compiler-runtime-BfE3aGVn.js";import{s as i,t as a}from"./createLucideIcon-DAkhoPjT.js";import{i as o,n as s,t as c}from"./cursor-B8rehP9c.js";var l=[[`path`,{d:`M12 8V4H8`,key:`hb8ula`}],[`rect`,{width:`16`,height:`12`,x:`4`,y:`8`,rx:`2`,key:`enze0r`}],[`path`,{d:`M2 14h2`,key:`vft8re`}],[`path`,{d:`M20 14h2`,key:`4cs60a`}],[`path`,{d:`M15 13v2`,key:`1xurst`}],[`path`,{d:`M9 13v2`,key:`rq6x2g`}]],u=a(`bot`,l),d=r(),f=e(n(),1),p=t();function m(e){let t=(0,d.c)(13),{agentId:n,iconUrl:r,className:a}=e,[l,m]=(0,f.useState)(!1),h;if(t[0]!==n||t[1]!==a){h=Symbol.for(`react.early_return_sentinel`);bb0:{let e=i(`shrink-0`,a);if(n===`claude-acp`){h=(0,p.jsx)(o,{className:i(`text-[#D97757] [--ok-brand-color:#D97757] [&_*]:![color:var(--ok-brand-color)]`,e),"aria-hidden":`true`});break bb0}if(n===`codex-acp`){h=(0,p.jsx)(s,{className:e,"aria-hidden":`true`});break bb0}if(n===`cursor`){h=(0,p.jsx)(c,{className:i(`text-[#1B1912] [--ok-brand-color:#1B1912] [&_*]:![color:var(--ok-brand-color)] dark:text-white dark:[--ok-brand-color:#FFFFFF]`,e),"aria-hidden":`true`});break bb0}}t[0]=n,t[1]=a,t[2]=h}else h=t[2];if(h!==Symbol.for(`react.early_return_sentinel`))return h;if(r===void 0||l){let e;t[3]===a?e=t[4]:(e=i(`shrink-0 text-muted-foreground`,a),t[3]=a,t[4]=e);let n;return t[5]===e?n=t[6]:(n=(0,p.jsx)(u,{className:e,"aria-hidden":`true`}),t[5]=e,t[6]=n),n}let g;t[7]===a?g=t[8]:(g=i(`shrink-0 rounded dark:invert`,a),t[7]=a,t[8]=g);let _;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(_=()=>m(!0),t[9]=_):_=t[9];let v;return t[10]!==r||t[11]!==g?(v=(0,p.jsx)(`img`,{src:r,alt:``,"aria-hidden":`true`,className:g,onError:_}),t[10]=r,t[11]=g,t[12]=v):v=t[12],v}export{u as n,l as r,m as t};
@@ -1,3 +1,3 @@
1
- import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{t as n}from"./react-f2sANaYj.js";import{n as r,r as i}from"./dist-Nvb76hAm.js";import{t as a}from"./compiler-runtime-BfE3aGVn.js";import{t as o}from"./createLucideIcon-DAkhoPjT.js";import{t as s}from"./button-Gol9BgNB.js";import{a as c,c as l,i as u,n as d,o as f,s as p,t as m}from"./dialog-TkFkuYVg.js";import{t as h}from"./checkbox-DY-vIhnZ.js";import{o as g}from"./dist-CYN1QNvi.js";import{t as _}from"./check-GqWaoTdV.js";import{n as v,t as y}from"./CopyButton-1Q6Wnnjb.js";import{t as b}from"./loader-circle-Cg5SU7AZ.js";import{n as ee}from"./BugReportHistory-B0qbbAw0.js";import{t as te}from"./triangle-alert-Clgvyc7B.js";import{t as ne}from"./input-D0ZW0Opq.js";import{t as re}from"./badge-Dba4cvJR.js";import{t as x}from"./external-link-T4Nj1gcG.js";import{n as ie}from"./clipboard-adapter-Cxzkvc1d.js";import{t as ae}from"./textarea-tdCJViKf.js";var S=o(`archive`,[[`rect`,{width:`20`,height:`5`,x:`2`,y:`3`,rx:`1`,key:`1wp1u1`}],[`path`,{d:`M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8`,key:`1s80jp`}],[`path`,{d:`M10 12h4`,key:`a56b0p`}]]),oe=o(`shield`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}]]),se=a(),C=e(n(),1),w=t(),T=`support@inkeep.com`;function ce(e){return`mailto:${T}?subject=${encodeURIComponent(e)}`}function le(e){let t=(0,se.c)(7),{href:n}=e,r,i;t[0]===n?(r=t[1],i=t[2]):(r=e=>x(e,n),i=e=>x(e,n),t[0]=n,t[1]=r,t[2]=i);let a;return t[3]!==n||t[4]!==r||t[5]!==i?(a=(0,w.jsx)(`a`,{href:n,onClick:r,onAuxClick:i,className:`text-primary hover:underline`,children:T}),t[3]=n,t[4]=r,t[5]=i,t[6]=a):a=t[6],a}function ue(e,t){let n=e.trim();if(t===void 0)return n===``?void 0:n;let r=t.join(`
1
+ import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{t as n}from"./react-f2sANaYj.js";import{n as r,r as i}from"./dist-Nvb76hAm.js";import{t as a}from"./compiler-runtime-BfE3aGVn.js";import{t as o}from"./createLucideIcon-DAkhoPjT.js";import{t as s}from"./button-Gol9BgNB.js";import{a as c,c as l,i as u,n as d,o as f,s as p,t as m}from"./dialog-TkFkuYVg.js";import{t as h}from"./checkbox-DY-vIhnZ.js";import{o as g}from"./dist-CYN1QNvi.js";import{t as _}from"./check-GqWaoTdV.js";import{n as v,t as y}from"./CopyButton-1Q6Wnnjb.js";import{t as b}from"./loader-circle-Cg5SU7AZ.js";import{n as ee}from"./BugReportHistory-DrMLEEP8.js";import{t as te}from"./triangle-alert-Clgvyc7B.js";import{t as ne}from"./input-D0ZW0Opq.js";import{t as re}from"./badge-Dba4cvJR.js";import{t as x}from"./external-link-T4Nj1gcG.js";import{n as ie}from"./clipboard-adapter-Cxzkvc1d.js";import{t as ae}from"./textarea-tdCJViKf.js";var S=o(`archive`,[[`rect`,{width:`20`,height:`5`,x:`2`,y:`3`,rx:`1`,key:`1wp1u1`}],[`path`,{d:`M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8`,key:`1s80jp`}],[`path`,{d:`M10 12h4`,key:`a56b0p`}]]),oe=o(`shield`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}]]),se=a(),C=e(n(),1),w=t(),T=`support@inkeep.com`;function ce(e){return`mailto:${T}?subject=${encodeURIComponent(e)}`}function le(e){let t=(0,se.c)(7),{href:n}=e,r,i;t[0]===n?(r=t[1],i=t[2]):(r=e=>x(e,n),i=e=>x(e,n),t[0]=n,t[1]=r,t[2]=i);let a;return t[3]!==n||t[4]!==r||t[5]!==i?(a=(0,w.jsx)(`a`,{href:n,onClick:r,onAuxClick:i,className:`text-primary hover:underline`,children:T}),t[3]=n,t[4]=r,t[5]=i,t[6]=a):a=t[6],a}function ue(e,t){let n=e.trim();if(t===void 0)return n===``?void 0:n;let r=t.join(`
2
2
  `);return n===``?r:`${n}\n\n${r}`}var E=25;function D(e){return e.replace(/\(([^)]*)\)/,(e,t)=>{let n=t.split(/[/\\]/).pop();return n===void 0||n===``?e:`(${n})`})}function O(e){let t=e.split(`
3
- `).map(e=>D(e.trim())).filter(e=>e!==``);if(t.length===0)return[];let n=t.slice(0,E),r=t.length-n.length;return[`Component stack:`,...n,...r>0?[`... ${r} more frame(s) omitted`]:[]]}function de(e){let t=[`Crash source: ${e.source}`];return e.docName!==void 0&&t.push(`Document: ${e.docName}`),e.errorMessage!==void 0&&t.push(`Error: ${e.errorMessage}`),e.componentStack!==void 0&&t.push(...O(e.componentStack)),t}function fe(e){return[`Crash source: ${e.kind===`render-process-gone`?`renderer process crash (reason: ${e.context.reason})`:e.kind===`child-process-gone`?`${e.context.processType} process crash (reason: ${e.context.reason})`:e.context.dirtyShutdown?`previous session ended without a clean quit`:`new crash dump found from the previous session`}`,`Crash event: ${e.eventId}`]}var pe={step:`compose`,creating:!1,createError:null};function me(e){return e>=1024*1024?`${(e/(1024*1024)).toFixed(1)} MB`:e>=1024?`${Math.max(1,Math.round(e/1024))} KB`:`${e} B`}function k(e){return e.split(/[\\/]/).pop()??e}function he(e){return e.summary.files.some(e=>e.startsWith(`extra/`)&&e!==g)}function A(e){let t=(0,se.c)(93),{open:n,onOpenChange:a,systemWide:o,crashContext:x,crashInvite:S,screenshot:T}=e,E=o===void 0?!1:o,D=T===void 0?null:T,{_:O}=i(),[k,A]=(0,C.useState)(pe),[j,ye]=(0,C.useState)(``),[M,be]=(0,C.useState)(x!==void 0||S!==void 0),N=S?.minidumpAvailable===!0,[P,xe]=(0,C.useState)(N),[F,Se]=(0,C.useState)(!0),[Ce,we]=(0,C.useState)(0),I=(0,C.useRef)(0),L=(0,C.useId)(),Te=(0,C.useId)(),Ee=(0,C.useId)(),De=(0,C.useId)(),Oe=(0,C.useId)(),ke=(0,C.useId)(),Ae=(0,C.useId)(),je=(0,C.useId)(),Me=(0,C.useId)(),R=(0,C.useId)(),z=(0,C.useId)(),B=k.step===`sending`,V;t[0]!==x||t[1]!==S?(V=x===void 0?S===void 0?void 0:fe(S):de(x),t[0]=x,t[1]=S,t[2]=V):V=t[2];let H=V,U,W;t[3]===B?(U=t[4],W=t[5]):(U=()=>{if(!B)return;we(0);let e=Date.now(),t=setInterval(()=>{let t=(Date.now()-e)/1e3;we(Math.min(.9,1-Math.exp(-t/3)))},200);return()=>{clearInterval(t)}},W=[B],t[3]=B,t[4]=U,t[5]=W),(0,C.useEffect)(U,W);let Ne;t[6]!==x||t[7]!==N||t[8]!==S||t[9]!==a||t[10]!==k.step?(Ne=function(e){!e&&k.step===`sending`||(e||(I.current+=1,(k.step===`success`||k.step===`email`||k.step===`failure`)&&(ye(``),be(x!==void 0||S!==void 0),xe(N),Se(!0)),A(pe)),a(e))},t[6]=x,t[7]=N,t[8]=S,t[9]=a,t[10]=k.step,t[11]=Ne):Ne=t[11];let G=Ne,Pe;t[12]!==O||t[13]!==N||t[14]!==M||t[15]!==P||t[16]!==F||t[17]!==j||t[18]!==H||t[19]!==D?(Pe=async function(){let e=window.okDesktop?.bugReport;if(!e){A({step:`compose`,creating:!1,createError:O({id:`_0JUKX`})});return}let t=I.current+=1;A({step:`compose`,creating:!0,createError:null});let n=await e.create({level:M?`full`:`standard`,note:ue(j,H),...N?{includeCrashDump:P}:{},...D===null?{}:{includeScreenshot:F}});I.current===t&&(n.ok?A({step:`review`,report:{zipPath:n.zipPath,zipSizeBytes:n.zipSizeBytes,summary:n.summary}}):A({step:`compose`,creating:!1,createError:n.error}))},t[12]=O,t[13]=N,t[14]=M,t[15]=P,t[16]=F,t[17]=j,t[18]=H,t[19]=D,t[20]=Pe):Pe=t[20];let Fe=Pe,Ie;t[21]!==j||t[22]!==H?(Ie=async function(e){let t=window.okDesktop?.bugReport;if(!t)return;let n=I.current+=1;A({step:`sending`,report:e});let r=await t.send({zipPath:e.zipPath,metadata:{level:e.summary.level,systemWide:e.summary.systemWide,projectSlug:e.summary.projectSlug,note:ue(j,H)},includeScreenshot:e.summary.files.includes(g)});I.current===n&&(r.ok?A({step:`success`,report:e,reference:r.reference}):r.reason===`email-draft`?A({step:`email`,report:e,mailtoUrl:r.fallback.mailtoUrl}):A({step:`failure`,report:e,mailtoUrl:r.fallback.mailtoUrl}))},t[21]=j,t[22]=H,t[23]=Ie):Ie=t[23];let K=Ie,Le;t[24]===Symbol.for(`react.memo_cache_sentinel`)?(Le=function(e){I.current+=1,A({step:`review`,report:e})},t[24]=Le):Le=t[24];let Re=Le,ze;t[25]===Symbol.for(`react.memo_cache_sentinel`)?(ze=function(e){window.okDesktop?.shell.showItemInFolder(e)},t[25]=ze):ze=t[25];let Be=ze,Ve;t[26]===Symbol.for(`react.memo_cache_sentinel`)?(Ve=function(e){window.okDesktop?.shell.openExternal(e)},t[26]=Ve):Ve=t[26];let He=Ve,Ue;t[27]===Ce?Ue=t[28]:(Ue=Math.round(Ce*100),t[27]=Ce,t[28]=Ue);let We=Ue,Ge=!B,q;t[29]!==O||t[30]!==x||t[31]!==N||t[32]!==S||t[33]!==M||t[34]!==Oe||t[35]!==De||t[36]!==Ae||t[37]!==ke||t[38]!==Fe||t[39]!==G||t[40]!==P||t[41]!==F||t[42]!==Ee||t[43]!==Te||t[44]!==j||t[45]!==L||t[46]!==k.createError||t[47]!==k.creating||t[48]!==k.step||t[49]!==D||t[50]!==Me||t[51]!==je||t[52]!==E||t[53]!==z?(q=k.step===`compose`&&(0,w.jsxs)(w.Fragment,{children:[(0,w.jsxs)(p,{children:[(0,w.jsx)(l,{children:(0,w.jsx)(r,{id:`cd5EXh`})}),S===void 0&&(0,w.jsx)(c,{children:(0,w.jsx)(r,{id:`rD-woT`})})]}),(0,w.jsxs)(d,{className:`flex flex-col gap-5`,children:[S!==void 0&&(0,w.jsxs)(`div`,{className:`flex items-start gap-2.5 rounded-md border border-chart-3/35 bg-chart-3/10 px-3 py-2.5 text-sm`,children:[(0,w.jsx)(te,{className:`mt-0.5 size-4 shrink-0 text-chart-3`,"aria-hidden":`true`}),(0,w.jsxs)(`div`,{children:[(0,w.jsx)(`p`,{className:`font-medium`,children:(0,w.jsx)(r,{id:`_IGfXZ`})}),(0,w.jsx)(c,{className:`mt-0.5 text-xs`,children:(0,w.jsx)(r,{id:`03wKPg`})})]})]}),k.createError!==null&&(0,w.jsxs)(`div`,{role:`alert`,className:`flex items-start gap-2.5 rounded-md border border-destructive/35 bg-destructive/10 px-3 py-2.5 text-sm`,children:[(0,w.jsx)(v,{className:`mt-0.5 size-4 shrink-0 text-destructive`,"aria-hidden":`true`}),(0,w.jsxs)(`div`,{children:[(0,w.jsx)(`p`,{className:`font-medium`,children:(0,w.jsx)(r,{id:`wVa83H`})}),(0,w.jsx)(`p`,{className:`mt-0.5 text-xs text-muted-foreground`,children:k.createError}),(0,w.jsx)(`p`,{className:`mt-0.5 text-xs text-muted-foreground`,children:(0,w.jsx)(r,{id:`5PHgV2`,components:{0:(0,w.jsx)(`code`,{className:`font-mono`})}})})]})]}),(0,w.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,w.jsxs)(`label`,{htmlFor:L,className:`text-sm font-medium`,children:[S===void 0?(0,w.jsx)(r,{id:`y_K0Dz`}):(0,w.jsx)(r,{id:`60vpJN`}),` `,(0,w.jsx)(`span`,{className:`font-normal text-muted-foreground`,children:(0,w.jsx)(r,{id:`NzluOx`})})]}),(0,w.jsx)(ae,{id:L,value:j,onChange:e=>ye(e.target.value),placeholder:O(S===void 0?{id:`YLMBSd`}:{id:`T3j-7o`}),rows:3,className:`resize-none`,disabled:k.creating})]}),(0,w.jsxs)(`div`,{role:`group`,"aria-labelledby":z,className:`flex flex-col gap-3.5`,children:[(0,w.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,w.jsx)(`p`,{id:z,className:`text-sm font-medium`,children:(0,w.jsx)(r,{id:`WJjviG`})}),S===void 0&&(0,w.jsx)(`p`,{className:`text-1sm text-muted-foreground`,children:x===void 0?(0,w.jsx)(r,{id:`2H43L8`}):(0,w.jsx)(r,{id:`GZzDqc`})})]}),(0,w.jsxs)(`div`,{className:`flex items-start gap-2.5`,children:[(0,w.jsx)(h,{id:Te,checked:!0,disabled:!0,"aria-describedby":Ee,className:`mt-0.5`}),(0,w.jsxs)(`div`,{className:`flex flex-col gap-0.5`,children:[(0,w.jsxs)(`label`,{htmlFor:Te,className:`flex items-center gap-2 text-sm font-medium text-foreground`,children:[(0,w.jsx)(r,{id:`FgRAvd`}),(0,w.jsx)(re,{variant:`primary`,className:`text-2xs`,children:(0,w.jsx)(r,{id:`C0hoX6`})})]}),(0,w.jsx)(`p`,{id:Ee,className:`text-1sm text-muted-foreground`,children:E?(0,w.jsx)(r,{id:`ZoOlzR`}):(0,w.jsx)(r,{id:`2FnYUD`})})]})]}),(0,w.jsxs)(`div`,{className:`flex items-start gap-2.5`,children:[(0,w.jsx)(h,{id:De,checked:M,onCheckedChange:e=>be(e===!0),"aria-describedby":Oe,disabled:k.creating,className:`mt-0.5`}),(0,w.jsxs)(`div`,{className:`flex flex-col gap-0.5`,children:[(0,w.jsx)(`label`,{htmlFor:De,className:`text-sm font-medium`,children:(0,w.jsx)(r,{id:`zvjCD4`})}),(0,w.jsx)(`p`,{id:Oe,className:`text-1sm text-muted-foreground`,children:(0,w.jsx)(r,{id:`fRVBiq`})})]})]}),D!==null&&(0,w.jsxs)(`div`,{className:`flex items-start gap-2.5`,children:[(0,w.jsx)(h,{id:je,checked:F,onCheckedChange:e=>Se(e===!0),"aria-describedby":Me,disabled:k.creating,className:`mt-0.5`}),(0,w.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-0.5`,children:[(0,w.jsx)(`label`,{htmlFor:je,className:`text-sm font-medium`,children:(0,w.jsx)(r,{id:`IxyZXD`})}),(0,w.jsx)(`p`,{id:Me,className:`text-1sm text-muted-foreground`,children:(0,w.jsx)(r,{id:`yzYE4B`})}),(0,w.jsx)(`div`,{className:`mt-2 overflow-hidden rounded-md border bg-muted/40`,children:(0,w.jsx)(`img`,{src:D.dataUrl,alt:O({id:`WuntOK`}),className:`block max-h-44 w-full object-contain transition-opacity motion-reduce:transition-none ${F?`opacity-100`:`opacity-40`}`})})]})]}),N&&(0,w.jsxs)(`div`,{className:`flex items-start gap-2.5`,children:[(0,w.jsx)(h,{id:ke,checked:P,onCheckedChange:e=>xe(e===!0),"aria-describedby":Ae,disabled:k.creating,className:`mt-0.5`}),(0,w.jsxs)(`div`,{className:`flex flex-col gap-0.5`,children:[(0,w.jsx)(`label`,{htmlFor:ke,className:`text-sm font-medium`,children:(0,w.jsx)(r,{id:`8TvlHF`})}),(0,w.jsx)(`p`,{id:Ae,className:`text-1sm text-muted-foreground`,children:(0,w.jsx)(r,{id:`jnCROW`})})]})]})]}),S===void 0&&x===void 0?(0,w.jsx)(ee,{}):null]}),(0,w.jsxs)(f,{children:[(0,w.jsx)(s,{variant:`ghost`,className:`font-mono uppercase`,onClick:()=>G(!1),children:S===void 0?(0,w.jsx)(r,{id:`dEgA5A`}):(0,w.jsx)(r,{id:`PBxg_E`})}),(0,w.jsxs)(s,{onClick:()=>void Fe(),disabled:k.creating,children:[k.creating&&(0,w.jsx)(b,{className:`size-4 animate-spin motion-reduce:animate-none`,"aria-hidden":`true`}),(0,w.jsx)(r,{id:`Si7mIR`})]})]})]}),t[29]=O,t[30]=x,t[31]=N,t[32]=S,t[33]=M,t[34]=Oe,t[35]=De,t[36]=Ae,t[37]=ke,t[38]=Fe,t[39]=G,t[40]=P,t[41]=F,t[42]=Ee,t[43]=Te,t[44]=j,t[45]=L,t[46]=k.createError,t[47]=k.creating,t[48]=k.step,t[49]=D,t[50]=Me,t[51]=je,t[52]=E,t[53]=z,t[54]=q):q=t[54];let J;t[55]!==K||t[56]!==k.report||t[57]!==k.step?(J=k.step===`review`&&(0,w.jsxs)(w.Fragment,{children:[(0,w.jsxs)(p,{children:[(0,w.jsx)(l,{children:(0,w.jsx)(r,{id:`2AIVbm`})}),(0,w.jsx)(c,{children:(0,w.jsx)(r,{id:`3l_cXP`})})]}),(0,w.jsxs)(d,{className:`flex flex-col gap-4`,children:[(0,w.jsx)(ve,{zipPath:k.report.zipPath,zipSizeBytes:k.report.zipSizeBytes,fileCount:k.report.summary.files.length,rawDumpIncluded:he(k.report),onReveal:Be}),(0,w.jsxs)(`div`,{className:`flex items-start gap-2 rounded-md border bg-muted/50 px-3 py-2.5 text-xs text-muted-foreground`,children:[(0,w.jsx)(oe,{className:`size-3.5 shrink-0 text-muted-foreground`,"aria-hidden":`true`}),(0,w.jsx)(`span`,{children:(0,w.jsx)(r,{id:`-o5XAG`})})]})]}),(0,w.jsxs)(f,{className:`sm:justify-between`,children:[(0,w.jsx)(s,{variant:`ghost`,className:`font-mono uppercase`,onClick:()=>A(pe),children:(0,w.jsx)(r,{id:`iH8pgl`})}),(0,w.jsx)(s,{onClick:()=>void K(k.report),children:(0,w.jsx)(r,{id:`O9oQJS`})})]})]}),t[55]=K,t[56]=k.report,t[57]=k.step,t[58]=J):J=t[58];let Y;t[59]!==O||t[60]!==k.report||t[61]!==k.step||t[62]!==We?(Y=k.step===`sending`&&(0,w.jsxs)(w.Fragment,{children:[(0,w.jsxs)(p,{children:[(0,w.jsx)(l,{children:(0,w.jsx)(r,{id:`M5_9s2`})}),(0,w.jsx)(c,{className:`sr-only`,children:(0,w.jsx)(r,{id:`MJqRO6`})})]}),(0,w.jsxs)(d,{className:`flex flex-col gap-3`,children:[(0,w.jsxs)(`div`,{role:`status`,className:`flex items-center gap-2.5 text-sm`,children:[(0,w.jsx)(b,{className:`size-4 shrink-0 animate-spin text-primary motion-reduce:animate-none`,"aria-hidden":`true`}),(0,w.jsx)(r,{id:`qmL1UG`}),(0,w.jsx)(`span`,{className:`ml-auto text-xs text-muted-foreground`,children:(0,w.jsx)(r,{id:`JJcBCm`,values:{0:me(k.report.zipSizeBytes)}})})]}),(0,w.jsx)(`div`,{role:`progressbar`,"aria-label":O({id:`M5_9s2`}),className:`h-1.5 overflow-hidden rounded-full bg-secondary`,children:(0,w.jsx)(`div`,{className:`h-full rounded-full bg-primary`,style:{width:`${We}%`}})})]}),(0,w.jsxs)(f,{className:`sm:justify-between`,children:[(0,w.jsx)(s,{variant:`ghost`,className:`font-mono uppercase`,onClick:()=>Re(k.report),children:(0,w.jsx)(r,{id:`dEgA5A`})}),(0,w.jsx)(s,{disabled:!0,children:(0,w.jsx)(r,{id:`O9oQJS`})})]})]}),t[59]=O,t[60]=k.report,t[61]=k.step,t[62]=We,t[63]=Y):Y=t[63];let X;t[64]!==O||t[65]!==G||t[66]!==k.reference||t[67]!==k.step||t[68]!==R?(X=k.step===`success`&&(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(d,{children:(0,w.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,w.jsxs)(`div`,{role:`status`,className:`flex flex-col gap-3`,children:[(0,w.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,w.jsx)(_,{className:`size-5 shrink-0 text-primary`,"aria-hidden":`true`}),(0,w.jsx)(l,{children:(0,w.jsx)(r,{id:`IYciRC`})})]}),(0,w.jsx)(c,{children:(0,w.jsx)(r,{id:`2myNzt`})})]}),(0,w.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,w.jsx)(`label`,{htmlFor:R,className:`text-sm font-medium`,children:(0,w.jsx)(r,{id:`M-IF14`})}),(0,w.jsxs)(`div`,{className:`relative`,children:[(0,w.jsx)(ne,{id:R,readOnly:!0,value:k.reference,onFocus:_e,onClick:ge,className:`select-all bg-muted pr-9 font-mono text-sm font-medium tracking-wide`}),(0,w.jsx)(`div`,{className:`absolute inset-y-0 right-1 flex items-center`,children:(0,w.jsx)(y,{copyContent:k.reference,clipboardWrite:ie})})]})]}),(0,w.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:(0,w.jsx)(r,{id:`fxJk_6`,components:{0:(0,w.jsx)(`span`,{className:`font-medium text-foreground`}),1:(0,w.jsx)(le,{href:ce(O({id:`qEEfPk`,values:{0:k.reference}}))})}})})]})}),(0,w.jsx)(f,{children:(0,w.jsx)(s,{onClick:()=>G(!1),children:(0,w.jsx)(r,{id:`DPfwMq`})})})]}),t[64]=O,t[65]=G,t[66]=k.reference,t[67]=k.step,t[68]=R,t[69]=X):X=t[69];let Z;t[70]!==G||t[71]!==k.mailtoUrl||t[72]!==k.report||t[73]!==k.step?(Z=k.step===`email`&&(0,w.jsxs)(w.Fragment,{children:[(0,w.jsxs)(p,{children:[(0,w.jsx)(l,{children:(0,w.jsx)(r,{id:`6zzhQL`})}),(0,w.jsx)(c,{children:(0,w.jsx)(r,{id:`UTgWxm`})})]}),(0,w.jsxs)(d,{className:`flex flex-col gap-4`,children:[(0,w.jsx)(ve,{zipPath:k.report.zipPath,zipSizeBytes:k.report.zipSizeBytes,fileCount:k.report.summary.files.length,rawDumpIncluded:he(k.report),onReveal:Be}),(0,w.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:(0,w.jsx)(r,{id:`9XIEYq`,components:{0:(0,w.jsx)(le,{href:k.mailtoUrl})}})})]}),(0,w.jsxs)(f,{className:`sm:justify-between`,children:[(0,w.jsx)(s,{variant:`ghost`,className:`font-mono uppercase`,onClick:()=>G(!1),children:(0,w.jsx)(r,{id:`yz7wBu`})}),(0,w.jsx)(s,{onClick:()=>He(k.mailtoUrl),children:(0,w.jsx)(r,{id:`GuaJb-`})})]})]}),t[70]=G,t[71]=k.mailtoUrl,t[72]=k.report,t[73]=k.step,t[74]=Z):Z=t[74];let Q;t[75]!==G||t[76]!==K||t[77]!==k.mailtoUrl||t[78]!==k.report||t[79]!==k.step?(Q=k.step===`failure`&&(0,w.jsxs)(w.Fragment,{children:[(0,w.jsxs)(p,{children:[(0,w.jsx)(l,{children:(0,w.jsx)(r,{id:`Wi-VWy`})}),(0,w.jsx)(c,{className:`sr-only`,children:(0,w.jsx)(r,{id:`1OKzC_`})})]}),(0,w.jsxs)(d,{className:`flex flex-col gap-4`,children:[(0,w.jsxs)(`div`,{role:`alert`,className:`flex items-start gap-2.5 rounded-md border border-destructive/35 bg-destructive/10 px-3 py-2.5 text-sm`,children:[(0,w.jsx)(v,{className:`mt-0.5 size-4 shrink-0 text-destructive`,"aria-hidden":`true`}),(0,w.jsxs)(`div`,{children:[(0,w.jsx)(`p`,{className:`font-medium`,children:(0,w.jsx)(r,{id:`Oawo4U`})}),(0,w.jsx)(`p`,{className:`mt-0.5 text-xs text-muted-foreground`,children:(0,w.jsx)(r,{id:`2-CeZn`})})]})]}),(0,w.jsx)(ve,{zipPath:k.report.zipPath,zipSizeBytes:k.report.zipSizeBytes,fileCount:null,rawDumpIncluded:he(k.report),onReveal:Be}),(0,w.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:(0,w.jsx)(r,{id:`9XIEYq`,components:{0:(0,w.jsx)(le,{href:k.mailtoUrl})}})})]}),(0,w.jsxs)(f,{className:`sm:justify-between`,children:[(0,w.jsx)(s,{variant:`ghost`,className:`font-mono uppercase`,onClick:()=>G(!1),children:(0,w.jsx)(r,{id:`yz7wBu`})}),(0,w.jsxs)(`div`,{className:`flex flex-col-reverse gap-2 sm:flex-row`,children:[(0,w.jsx)(s,{variant:`outline`,className:`font-mono uppercase`,onClick:()=>void K(k.report),children:(0,w.jsx)(r,{id:`KDw4GX`})}),(0,w.jsx)(s,{onClick:()=>He(k.mailtoUrl),children:(0,w.jsx)(r,{id:`GuaJb-`})})]})]})]}),t[75]=G,t[76]=K,t[77]=k.mailtoUrl,t[78]=k.report,t[79]=k.step,t[80]=Q):Q=t[80];let $;t[81]!==Ge||t[82]!==q||t[83]!==J||t[84]!==Y||t[85]!==X||t[86]!==Z||t[87]!==Q?($=(0,w.jsxs)(u,{className:`sm:max-w-xl`,showCloseButton:Ge,children:[q,J,Y,X,Z,Q]}),t[81]=Ge,t[82]=q,t[83]=J,t[84]=Y,t[85]=X,t[86]=Z,t[87]=Q,t[88]=$):$=t[88];let Ke;return t[89]!==G||t[90]!==n||t[91]!==$?(Ke=(0,w.jsx)(m,{open:n,onOpenChange:G,children:$}),t[89]=G,t[90]=n,t[91]=$,t[92]=Ke):Ke=t[92],Ke}function ge(e){return e.currentTarget.select()}function _e(e){return e.currentTarget.select()}function ve(e){let t=(0,se.c)(23),{zipPath:n,zipSizeBytes:i,fileCount:a,rawDumpIncluded:o,onReveal:c}=e,l;t[0]===n?l=t[1]:(l=k(n),t[0]=n,t[1]=l);let u=l,d;t[2]===i?d=t[3]:(d=me(i),t[2]=i,t[3]=d);let f=d,p;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,w.jsx)(`div`,{className:`flex items-center justify-center size-8 rounded-md bg-muted`,children:(0,w.jsx)(S,{className:`size-4 shrink-0 text-muted-foreground`,"aria-hidden":`true`})}),t[4]=p):p=t[4];let m;t[5]===u?m=t[6]:(m=(0,w.jsx)(`p`,{className:`truncate text-1sm`,title:u,children:u}),t[5]=u,t[6]=m);let h;t[7]!==a||t[8]!==o||t[9]!==f?(h=(0,w.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:a===null?o?(0,w.jsx)(r,{id:`_FLBbi`,values:{sizeText:f}}):(0,w.jsx)(r,{id:`89y7ar`,values:{sizeText:f}}):o?(0,w.jsx)(r,{id:`sn5BEU`,values:{sizeText:f,fileCount:a}}):(0,w.jsx)(r,{id:`3DJEEt`,values:{sizeText:f,fileCount:a}})}),t[7]=a,t[8]=o,t[9]=f,t[10]=h):h=t[10];let g;t[11]!==m||t[12]!==h?(g=(0,w.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-0.5`,children:[m,h]}),t[11]=m,t[12]=h,t[13]=g):g=t[13];let _;t[14]!==c||t[15]!==n?(_=()=>c(n),t[14]=c,t[15]=n,t[16]=_):_=t[16];let v;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(v=(0,w.jsx)(r,{id:`LtSYdi`}),t[17]=v):v=t[17];let y;t[18]===_?y=t[19]:(y=(0,w.jsx)(s,{variant:`link`,className:`h-auto shrink-0 p-0 text-xs`,onClick:_,children:v}),t[18]=_,t[19]=y);let b;return t[20]!==g||t[21]!==y?(b=(0,w.jsxs)(`div`,{className:`flex items-center gap-2.5 rounded-md border px-3 py-2.5`,children:[p,g,y]}),t[20]=g,t[21]=y,t[22]=b):b=t[22],b}export{A as default};
3
+ `).map(e=>D(e.trim())).filter(e=>e!==``);if(t.length===0)return[];let n=t.slice(0,E),r=t.length-n.length;return[`Component stack:`,...n,...r>0?[`... ${r} more frame(s) omitted`]:[]]}function de(e){let t=[`Crash source: ${e.source}`];return e.docName!==void 0&&t.push(`Document: ${e.docName}`),e.errorMessage!==void 0&&t.push(`Error: ${e.errorMessage}`),e.componentStack!==void 0&&t.push(...O(e.componentStack)),t}function fe(e){return[`Crash source: ${e.kind===`render-process-gone`?`renderer process crash (reason: ${e.context.reason})`:e.kind===`child-process-gone`?`${e.context.processType} process crash (reason: ${e.context.reason})`:e.context.dirtyShutdown?`previous session ended without a clean quit`:`new crash dump found from the previous session`}`,`Crash event: ${e.eventId}`]}var pe={step:`compose`,creating:!1,createError:null};function me(e){return e>=1024*1024?`${(e/(1024*1024)).toFixed(1)} MB`:e>=1024?`${Math.max(1,Math.round(e/1024))} KB`:`${e} B`}function k(e){return e.split(/[\\/]/).pop()??e}function he(e){return e.summary.files.some(e=>e.startsWith(`extra/`)&&e!==g)}function A(e){let t=(0,se.c)(93),{open:n,onOpenChange:a,systemWide:o,crashContext:x,crashInvite:S,screenshot:T}=e,E=o===void 0?!1:o,D=T===void 0?null:T,{_:O}=i(),[k,A]=(0,C.useState)(pe),[j,ye]=(0,C.useState)(``),[M,be]=(0,C.useState)(x!==void 0||S!==void 0),N=S?.minidumpAvailable===!0,[P,xe]=(0,C.useState)(N),[F,Se]=(0,C.useState)(!0),[Ce,we]=(0,C.useState)(0),I=(0,C.useRef)(0),L=(0,C.useId)(),Te=(0,C.useId)(),Ee=(0,C.useId)(),De=(0,C.useId)(),Oe=(0,C.useId)(),ke=(0,C.useId)(),Ae=(0,C.useId)(),je=(0,C.useId)(),Me=(0,C.useId)(),R=(0,C.useId)(),z=(0,C.useId)(),B=k.step===`sending`,V;t[0]!==x||t[1]!==S?(V=x===void 0?S===void 0?void 0:fe(S):de(x),t[0]=x,t[1]=S,t[2]=V):V=t[2];let H=V,U,W;t[3]===B?(U=t[4],W=t[5]):(U=()=>{if(!B)return;we(0);let e=Date.now(),t=setInterval(()=>{let t=(Date.now()-e)/1e3;we(Math.min(.9,1-Math.exp(-t/3)))},200);return()=>{clearInterval(t)}},W=[B],t[3]=B,t[4]=U,t[5]=W),(0,C.useEffect)(U,W);let Ne;t[6]!==x||t[7]!==N||t[8]!==S||t[9]!==a||t[10]!==k.step?(Ne=function(e){!e&&k.step===`sending`||(e||(I.current+=1,(k.step===`success`||k.step===`email`||k.step===`failure`)&&(ye(``),be(x!==void 0||S!==void 0),xe(N),Se(!0)),A(pe)),a(e))},t[6]=x,t[7]=N,t[8]=S,t[9]=a,t[10]=k.step,t[11]=Ne):Ne=t[11];let G=Ne,Pe;t[12]!==O||t[13]!==N||t[14]!==M||t[15]!==P||t[16]!==F||t[17]!==j||t[18]!==H||t[19]!==D?(Pe=async function(){let e=window.okDesktop?.bugReport;if(!e){A({step:`compose`,creating:!1,createError:O({id:`_0JUKX`})});return}let t=I.current+=1;A({step:`compose`,creating:!0,createError:null});let n=await e.create({level:M?`full`:`standard`,note:ue(j,H),...N?{includeCrashDump:P}:{},...D===null?{}:{includeScreenshot:F}});I.current===t&&(n.ok?A({step:`review`,report:{zipPath:n.zipPath,zipSizeBytes:n.zipSizeBytes,summary:n.summary}}):A({step:`compose`,creating:!1,createError:n.error}))},t[12]=O,t[13]=N,t[14]=M,t[15]=P,t[16]=F,t[17]=j,t[18]=H,t[19]=D,t[20]=Pe):Pe=t[20];let Fe=Pe,Ie;t[21]!==j||t[22]!==H?(Ie=async function(e){let t=window.okDesktop?.bugReport;if(!t)return;let n=I.current+=1;A({step:`sending`,report:e});let r=await t.send({zipPath:e.zipPath,metadata:{level:e.summary.level,systemWide:e.summary.systemWide,projectSlug:e.summary.projectSlug,note:ue(j,H)},includeScreenshot:e.summary.files.includes(g)});I.current===n&&(r.ok?A({step:`success`,report:e,reference:r.reference}):r.reason===`email-draft`?A({step:`email`,report:e,mailtoUrl:r.fallback.mailtoUrl}):A({step:`failure`,report:e,mailtoUrl:r.fallback.mailtoUrl}))},t[21]=j,t[22]=H,t[23]=Ie):Ie=t[23];let K=Ie,Le;t[24]===Symbol.for(`react.memo_cache_sentinel`)?(Le=function(e){I.current+=1,A({step:`review`,report:e})},t[24]=Le):Le=t[24];let Re=Le,ze;t[25]===Symbol.for(`react.memo_cache_sentinel`)?(ze=function(e){window.okDesktop?.shell.showItemInFolder(e)},t[25]=ze):ze=t[25];let Be=ze,Ve;t[26]===Symbol.for(`react.memo_cache_sentinel`)?(Ve=function(e){window.okDesktop?.shell.openExternal(e)},t[26]=Ve):Ve=t[26];let He=Ve,Ue;t[27]===Ce?Ue=t[28]:(Ue=Math.round(Ce*100),t[27]=Ce,t[28]=Ue);let We=Ue,Ge=!B,q;t[29]!==O||t[30]!==x||t[31]!==N||t[32]!==S||t[33]!==M||t[34]!==Oe||t[35]!==De||t[36]!==Ae||t[37]!==ke||t[38]!==Fe||t[39]!==G||t[40]!==P||t[41]!==F||t[42]!==Ee||t[43]!==Te||t[44]!==j||t[45]!==L||t[46]!==k.createError||t[47]!==k.creating||t[48]!==k.step||t[49]!==D||t[50]!==Me||t[51]!==je||t[52]!==E||t[53]!==z?(q=k.step===`compose`&&(0,w.jsxs)(w.Fragment,{children:[(0,w.jsxs)(p,{children:[(0,w.jsx)(l,{children:(0,w.jsx)(r,{id:`cd5EXh`})}),S===void 0&&(0,w.jsx)(c,{children:(0,w.jsx)(r,{id:`rD-woT`})})]}),(0,w.jsxs)(d,{className:`flex flex-col gap-5`,children:[S!==void 0&&(0,w.jsxs)(`div`,{className:`flex items-start gap-2.5 rounded-md border border-chart-3/35 bg-chart-3/10 px-3 py-2.5 text-sm`,children:[(0,w.jsx)(te,{className:`mt-0.5 size-4 shrink-0 text-chart-3`,"aria-hidden":`true`}),(0,w.jsxs)(`div`,{children:[(0,w.jsx)(`p`,{className:`font-medium`,children:(0,w.jsx)(r,{id:`_IGfXZ`})}),(0,w.jsx)(c,{className:`mt-0.5 text-xs`,children:(0,w.jsx)(r,{id:`03wKPg`})})]})]}),k.createError!==null&&(0,w.jsxs)(`div`,{role:`alert`,className:`flex items-start gap-2.5 rounded-md border border-destructive/35 bg-destructive/10 px-3 py-2.5 text-sm`,children:[(0,w.jsx)(v,{className:`mt-0.5 size-4 shrink-0 text-destructive`,"aria-hidden":`true`}),(0,w.jsxs)(`div`,{children:[(0,w.jsx)(`p`,{className:`font-medium`,children:(0,w.jsx)(r,{id:`wVa83H`})}),(0,w.jsx)(`p`,{className:`mt-0.5 text-xs text-muted-foreground`,children:k.createError}),(0,w.jsx)(`p`,{className:`mt-0.5 text-xs text-muted-foreground`,children:(0,w.jsx)(r,{id:`5PHgV2`,components:{0:(0,w.jsx)(`code`,{className:`font-mono`})}})})]})]}),(0,w.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,w.jsxs)(`label`,{htmlFor:L,className:`text-sm font-medium`,children:[S===void 0?(0,w.jsx)(r,{id:`y_K0Dz`}):(0,w.jsx)(r,{id:`60vpJN`}),` `,(0,w.jsx)(`span`,{className:`font-normal text-muted-foreground`,children:(0,w.jsx)(r,{id:`NzluOx`})})]}),(0,w.jsx)(ae,{id:L,value:j,onChange:e=>ye(e.target.value),placeholder:O(S===void 0?{id:`YLMBSd`}:{id:`T3j-7o`}),rows:3,className:`resize-none`,disabled:k.creating})]}),(0,w.jsxs)(`div`,{role:`group`,"aria-labelledby":z,className:`flex flex-col gap-3.5`,children:[(0,w.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,w.jsx)(`p`,{id:z,className:`text-sm font-medium`,children:(0,w.jsx)(r,{id:`WJjviG`})}),S===void 0&&(0,w.jsx)(`p`,{className:`text-1sm text-muted-foreground`,children:x===void 0?(0,w.jsx)(r,{id:`2H43L8`}):(0,w.jsx)(r,{id:`GZzDqc`})})]}),(0,w.jsxs)(`div`,{className:`flex items-start gap-2.5`,children:[(0,w.jsx)(h,{id:Te,checked:!0,disabled:!0,"aria-describedby":Ee,className:`mt-0.5`}),(0,w.jsxs)(`div`,{className:`flex flex-col gap-0.5`,children:[(0,w.jsxs)(`label`,{htmlFor:Te,className:`flex items-center gap-2 text-sm font-medium text-foreground`,children:[(0,w.jsx)(r,{id:`FgRAvd`}),(0,w.jsx)(re,{variant:`primary`,className:`text-2xs`,children:(0,w.jsx)(r,{id:`C0hoX6`})})]}),(0,w.jsx)(`p`,{id:Ee,className:`text-1sm text-muted-foreground`,children:E?(0,w.jsx)(r,{id:`ZoOlzR`}):(0,w.jsx)(r,{id:`2FnYUD`})})]})]}),(0,w.jsxs)(`div`,{className:`flex items-start gap-2.5`,children:[(0,w.jsx)(h,{id:De,checked:M,onCheckedChange:e=>be(e===!0),"aria-describedby":Oe,disabled:k.creating,className:`mt-0.5`}),(0,w.jsxs)(`div`,{className:`flex flex-col gap-0.5`,children:[(0,w.jsx)(`label`,{htmlFor:De,className:`text-sm font-medium`,children:(0,w.jsx)(r,{id:`zvjCD4`})}),(0,w.jsx)(`p`,{id:Oe,className:`text-1sm text-muted-foreground`,children:(0,w.jsx)(r,{id:`fRVBiq`})})]})]}),D!==null&&(0,w.jsxs)(`div`,{className:`flex items-start gap-2.5`,children:[(0,w.jsx)(h,{id:je,checked:F,onCheckedChange:e=>Se(e===!0),"aria-describedby":Me,disabled:k.creating,className:`mt-0.5`}),(0,w.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-0.5`,children:[(0,w.jsx)(`label`,{htmlFor:je,className:`text-sm font-medium`,children:(0,w.jsx)(r,{id:`IxyZXD`})}),(0,w.jsx)(`p`,{id:Me,className:`text-1sm text-muted-foreground`,children:(0,w.jsx)(r,{id:`yzYE4B`})}),(0,w.jsx)(`div`,{className:`mt-2 overflow-hidden rounded-md border bg-muted/40`,children:(0,w.jsx)(`img`,{src:D.dataUrl,alt:O({id:`WuntOK`}),className:`block max-h-44 w-full object-contain transition-opacity motion-reduce:transition-none ${F?`opacity-100`:`opacity-40`}`})})]})]}),N&&(0,w.jsxs)(`div`,{className:`flex items-start gap-2.5`,children:[(0,w.jsx)(h,{id:ke,checked:P,onCheckedChange:e=>xe(e===!0),"aria-describedby":Ae,disabled:k.creating,className:`mt-0.5`}),(0,w.jsxs)(`div`,{className:`flex flex-col gap-0.5`,children:[(0,w.jsx)(`label`,{htmlFor:ke,className:`text-sm font-medium`,children:(0,w.jsx)(r,{id:`8TvlHF`})}),(0,w.jsx)(`p`,{id:Ae,className:`text-1sm text-muted-foreground`,children:(0,w.jsx)(r,{id:`jnCROW`})})]})]})]}),S===void 0&&x===void 0?(0,w.jsx)(ee,{}):null]}),(0,w.jsxs)(f,{children:[(0,w.jsx)(s,{variant:`ghost`,className:`font-mono uppercase`,onClick:()=>G(!1),children:S===void 0?(0,w.jsx)(r,{id:`dEgA5A`}):(0,w.jsx)(r,{id:`PBxg_E`})}),(0,w.jsxs)(s,{onClick:()=>void Fe(),disabled:k.creating,children:[k.creating&&(0,w.jsx)(b,{className:`size-4 animate-spin motion-reduce:animate-none`,"aria-hidden":`true`}),(0,w.jsx)(r,{id:`Si7mIR`})]})]})]}),t[29]=O,t[30]=x,t[31]=N,t[32]=S,t[33]=M,t[34]=Oe,t[35]=De,t[36]=Ae,t[37]=ke,t[38]=Fe,t[39]=G,t[40]=P,t[41]=F,t[42]=Ee,t[43]=Te,t[44]=j,t[45]=L,t[46]=k.createError,t[47]=k.creating,t[48]=k.step,t[49]=D,t[50]=Me,t[51]=je,t[52]=E,t[53]=z,t[54]=q):q=t[54];let J;t[55]!==K||t[56]!==k.report||t[57]!==k.step?(J=k.step===`review`&&(0,w.jsxs)(w.Fragment,{children:[(0,w.jsxs)(p,{children:[(0,w.jsx)(l,{children:(0,w.jsx)(r,{id:`2AIVbm`})}),(0,w.jsx)(c,{children:(0,w.jsx)(r,{id:`3l_cXP`})})]}),(0,w.jsxs)(d,{className:`flex flex-col gap-4`,children:[(0,w.jsx)(ve,{zipPath:k.report.zipPath,zipSizeBytes:k.report.zipSizeBytes,fileCount:k.report.summary.files.length,rawDumpIncluded:he(k.report),onReveal:Be}),(0,w.jsxs)(`div`,{className:`flex items-start gap-2 rounded-md border bg-muted/50 px-3 py-2.5 text-xs text-muted-foreground`,children:[(0,w.jsx)(oe,{className:`size-3.5 shrink-0 text-muted-foreground`,"aria-hidden":`true`}),(0,w.jsx)(`span`,{children:(0,w.jsx)(r,{id:`-o5XAG`})})]})]}),(0,w.jsxs)(f,{className:`sm:justify-between`,children:[(0,w.jsx)(s,{variant:`ghost`,className:`font-mono uppercase`,onClick:()=>A(pe),children:(0,w.jsx)(r,{id:`iH8pgl`})}),(0,w.jsx)(s,{onClick:()=>void K(k.report),children:(0,w.jsx)(r,{id:`O9oQJS`})})]})]}),t[55]=K,t[56]=k.report,t[57]=k.step,t[58]=J):J=t[58];let Y;t[59]!==O||t[60]!==k.report||t[61]!==k.step||t[62]!==We?(Y=k.step===`sending`&&(0,w.jsxs)(w.Fragment,{children:[(0,w.jsxs)(p,{children:[(0,w.jsx)(l,{children:(0,w.jsx)(r,{id:`M5_9s2`})}),(0,w.jsx)(c,{className:`sr-only`,children:(0,w.jsx)(r,{id:`MJqRO6`})})]}),(0,w.jsxs)(d,{className:`flex flex-col gap-3`,children:[(0,w.jsxs)(`div`,{role:`status`,className:`flex items-center gap-2.5 text-sm`,children:[(0,w.jsx)(b,{className:`size-4 shrink-0 animate-spin text-primary motion-reduce:animate-none`,"aria-hidden":`true`}),(0,w.jsx)(r,{id:`qmL1UG`}),(0,w.jsx)(`span`,{className:`ml-auto text-xs text-muted-foreground`,children:(0,w.jsx)(r,{id:`JJcBCm`,values:{0:me(k.report.zipSizeBytes)}})})]}),(0,w.jsx)(`div`,{role:`progressbar`,"aria-label":O({id:`M5_9s2`}),className:`h-1.5 overflow-hidden rounded-full bg-secondary`,children:(0,w.jsx)(`div`,{className:`h-full rounded-full bg-primary`,style:{width:`${We}%`}})})]}),(0,w.jsxs)(f,{className:`sm:justify-between`,children:[(0,w.jsx)(s,{variant:`ghost`,className:`font-mono uppercase`,onClick:()=>Re(k.report),children:(0,w.jsx)(r,{id:`dEgA5A`})}),(0,w.jsx)(s,{disabled:!0,children:(0,w.jsx)(r,{id:`O9oQJS`})})]})]}),t[59]=O,t[60]=k.report,t[61]=k.step,t[62]=We,t[63]=Y):Y=t[63];let X;t[64]!==O||t[65]!==G||t[66]!==k.reference||t[67]!==k.step||t[68]!==R?(X=k.step===`success`&&(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(d,{children:(0,w.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,w.jsxs)(`div`,{role:`status`,className:`flex flex-col gap-3`,children:[(0,w.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,w.jsx)(_,{className:`size-5 shrink-0 text-primary`,"aria-hidden":`true`}),(0,w.jsx)(l,{children:(0,w.jsx)(r,{id:`IYciRC`})})]}),(0,w.jsx)(c,{children:(0,w.jsx)(r,{id:`2myNzt`})})]}),(0,w.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,w.jsx)(`label`,{htmlFor:R,className:`text-sm font-medium`,children:(0,w.jsx)(r,{id:`M-IF14`})}),(0,w.jsxs)(`div`,{className:`relative`,children:[(0,w.jsx)(ne,{id:R,readOnly:!0,value:k.reference,onFocus:_e,onClick:ge,className:`select-all bg-muted pr-9 font-mono text-sm font-medium tracking-wide`}),(0,w.jsx)(`div`,{className:`absolute inset-y-0 right-1 flex items-center`,children:(0,w.jsx)(y,{copyContent:k.reference,clipboardWrite:ie})})]})]}),(0,w.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:(0,w.jsx)(r,{id:`fxJk_6`,components:{0:(0,w.jsx)(`span`,{className:`font-medium text-foreground`}),1:(0,w.jsx)(le,{href:ce(O({id:`qEEfPk`,values:{0:k.reference}}))})}})})]})}),(0,w.jsx)(f,{children:(0,w.jsx)(s,{onClick:()=>G(!1),children:(0,w.jsx)(r,{id:`DPfwMq`})})})]}),t[64]=O,t[65]=G,t[66]=k.reference,t[67]=k.step,t[68]=R,t[69]=X):X=t[69];let Z;t[70]!==G||t[71]!==k.mailtoUrl||t[72]!==k.report||t[73]!==k.step?(Z=k.step===`email`&&(0,w.jsxs)(w.Fragment,{children:[(0,w.jsxs)(p,{children:[(0,w.jsx)(l,{children:(0,w.jsx)(r,{id:`6zzhQL`})}),(0,w.jsx)(c,{children:(0,w.jsx)(r,{id:`UTgWxm`})})]}),(0,w.jsxs)(d,{className:`flex flex-col gap-4`,children:[(0,w.jsx)(ve,{zipPath:k.report.zipPath,zipSizeBytes:k.report.zipSizeBytes,fileCount:k.report.summary.files.length,rawDumpIncluded:he(k.report),onReveal:Be}),(0,w.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:(0,w.jsx)(r,{id:`9XIEYq`,components:{0:(0,w.jsx)(le,{href:k.mailtoUrl})}})})]}),(0,w.jsxs)(f,{className:`sm:justify-between`,children:[(0,w.jsx)(s,{variant:`ghost`,className:`font-mono uppercase`,onClick:()=>G(!1),children:(0,w.jsx)(r,{id:`yz7wBu`})}),(0,w.jsx)(s,{onClick:()=>He(k.mailtoUrl),children:(0,w.jsx)(r,{id:`GuaJb-`})})]})]}),t[70]=G,t[71]=k.mailtoUrl,t[72]=k.report,t[73]=k.step,t[74]=Z):Z=t[74];let Q;t[75]!==G||t[76]!==K||t[77]!==k.mailtoUrl||t[78]!==k.report||t[79]!==k.step?(Q=k.step===`failure`&&(0,w.jsxs)(w.Fragment,{children:[(0,w.jsxs)(p,{children:[(0,w.jsx)(l,{children:(0,w.jsx)(r,{id:`Wi-VWy`})}),(0,w.jsx)(c,{className:`sr-only`,children:(0,w.jsx)(r,{id:`1OKzC_`})})]}),(0,w.jsxs)(d,{className:`flex flex-col gap-4`,children:[(0,w.jsxs)(`div`,{role:`alert`,className:`flex items-start gap-2.5 rounded-md border border-destructive/35 bg-destructive/10 px-3 py-2.5 text-sm`,children:[(0,w.jsx)(v,{className:`mt-0.5 size-4 shrink-0 text-destructive`,"aria-hidden":`true`}),(0,w.jsxs)(`div`,{children:[(0,w.jsx)(`p`,{className:`font-medium`,children:(0,w.jsx)(r,{id:`Oawo4U`})}),(0,w.jsx)(`p`,{className:`mt-0.5 text-xs text-muted-foreground`,children:(0,w.jsx)(r,{id:`2-CeZn`})})]})]}),(0,w.jsx)(ve,{zipPath:k.report.zipPath,zipSizeBytes:k.report.zipSizeBytes,fileCount:null,rawDumpIncluded:he(k.report),onReveal:Be}),(0,w.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:(0,w.jsx)(r,{id:`9XIEYq`,components:{0:(0,w.jsx)(le,{href:k.mailtoUrl})}})})]}),(0,w.jsxs)(f,{className:`sm:justify-between`,children:[(0,w.jsx)(s,{variant:`ghost`,className:`font-mono uppercase`,onClick:()=>G(!1),children:(0,w.jsx)(r,{id:`yz7wBu`})}),(0,w.jsxs)(`div`,{className:`flex flex-col-reverse gap-2 sm:flex-row`,children:[(0,w.jsx)(s,{variant:`outline`,className:`font-mono uppercase`,onClick:()=>void K(k.report),children:(0,w.jsx)(r,{id:`KDw4GX`})}),(0,w.jsx)(s,{onClick:()=>He(k.mailtoUrl),children:(0,w.jsx)(r,{id:`GuaJb-`})})]})]})]}),t[75]=G,t[76]=K,t[77]=k.mailtoUrl,t[78]=k.report,t[79]=k.step,t[80]=Q):Q=t[80];let $;t[81]!==Ge||t[82]!==q||t[83]!==J||t[84]!==Y||t[85]!==X||t[86]!==Z||t[87]!==Q?($=(0,w.jsxs)(u,{className:`sm:max-w-2xl`,showCloseButton:Ge,children:[q,J,Y,X,Z,Q]}),t[81]=Ge,t[82]=q,t[83]=J,t[84]=Y,t[85]=X,t[86]=Z,t[87]=Q,t[88]=$):$=t[88];let Ke;return t[89]!==G||t[90]!==n||t[91]!==$?(Ke=(0,w.jsx)(m,{open:n,onOpenChange:G,children:$}),t[89]=G,t[90]=n,t[91]=$,t[92]=Ke):Ke=t[92],Ke}function ge(e){return e.currentTarget.select()}function _e(e){return e.currentTarget.select()}function ve(e){let t=(0,se.c)(23),{zipPath:n,zipSizeBytes:i,fileCount:a,rawDumpIncluded:o,onReveal:c}=e,l;t[0]===n?l=t[1]:(l=k(n),t[0]=n,t[1]=l);let u=l,d;t[2]===i?d=t[3]:(d=me(i),t[2]=i,t[3]=d);let f=d,p;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,w.jsx)(`div`,{className:`flex items-center justify-center size-8 rounded-md bg-muted`,children:(0,w.jsx)(S,{className:`size-4 shrink-0 text-muted-foreground`,"aria-hidden":`true`})}),t[4]=p):p=t[4];let m;t[5]===u?m=t[6]:(m=(0,w.jsx)(`p`,{className:`truncate text-1sm`,title:u,children:u}),t[5]=u,t[6]=m);let h;t[7]!==a||t[8]!==o||t[9]!==f?(h=(0,w.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:a===null?o?(0,w.jsx)(r,{id:`_FLBbi`,values:{sizeText:f}}):(0,w.jsx)(r,{id:`89y7ar`,values:{sizeText:f}}):o?(0,w.jsx)(r,{id:`sn5BEU`,values:{sizeText:f,fileCount:a}}):(0,w.jsx)(r,{id:`3DJEEt`,values:{sizeText:f,fileCount:a}})}),t[7]=a,t[8]=o,t[9]=f,t[10]=h):h=t[10];let g;t[11]!==m||t[12]!==h?(g=(0,w.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-0.5`,children:[m,h]}),t[11]=m,t[12]=h,t[13]=g):g=t[13];let _;t[14]!==c||t[15]!==n?(_=()=>c(n),t[14]=c,t[15]=n,t[16]=_):_=t[16];let v;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(v=(0,w.jsx)(r,{id:`LtSYdi`}),t[17]=v):v=t[17];let y;t[18]===_?y=t[19]:(y=(0,w.jsx)(s,{variant:`link`,className:`h-auto shrink-0 p-0 text-xs`,onClick:_,children:v}),t[18]=_,t[19]=y);let b;return t[20]!==g||t[21]!==y?(b=(0,w.jsxs)(`div`,{className:`flex items-center gap-2.5 rounded-md border px-3 py-2.5`,children:[p,g,y]}),t[20]=g,t[21]=y,t[22]=b):b=t[22],b}export{A as default};
@@ -1 +1 @@
1
- import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{t as n}from"./react-f2sANaYj.js";import{n as r,r as i}from"./dist-Nvb76hAm.js";import{t as a}from"./compiler-runtime-BfE3aGVn.js";import{s as o,t as s}from"./createLucideIcon-DAkhoPjT.js";import{t as c}from"./button-Gol9BgNB.js";import{t as l}from"./label-DyipnO5I.js";import{a as u,i as d,n as f,o as p,r as m,t as h}from"./switch-DYic2V-1.js";import{t as g}from"./braces-DwnwFx_V.js";import{t as _}from"./case-sensitive-nl0tWMnZ.js";import{t as v}from"./hash-DNKDqZ18.js";import{t as y}from"./trash-2-BUuL4OCw.js";import{n as b}from"./dist-BLAMau9Z.js";import{t as x}from"./input-D0ZW0Opq.js";import{d as S,f as C,o as w,r as T,s as E}from"./lint-config-client-bcseyVIk.js";import{i as D,r as ee,t as O}from"./EditorModeToggle-DcuaOmV8.js";import{t as k}from"./tag-pill-input-opUlyN8Z.js";import{t as te}from"./useLintConfigViewMode-DKPENttR.js";import{i as A,r as ne,t as re}from"./schema-fields-view-intent-D_s-Cynn.js";var j=s(`brackets`,[[`path`,{d:`M16 3h3a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1h-3`,key:`1kt8lf`}],[`path`,{d:`M8 21H5a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h3`,key:`gduv9`}]]),M=s(`list-checks`,[[`path`,{d:`M13 5h8`,key:`a7qcls`}],[`path`,{d:`M13 12h8`,key:`h98zly`}],[`path`,{d:`M13 19h8`,key:`c3s6r1`}],[`path`,{d:`m3 17 2 2 4-4`,key:`1jhpwq`}],[`path`,{d:`m3 7 2 2 4-4`,key:`1obspn`}]]),N=s(`toggle-left`,[[`circle`,{cx:`9`,cy:`12`,r:`3`,key:`u3jwor`}],[`rect`,{width:`20`,height:`14`,x:`2`,y:`5`,rx:`7`,key:`g7kal2`}]]),P=a(),F=e(n(),1),I=t(),ie=[`string`,`number`,`boolean`,`array`,`object`],L=[`string`,`number`,`boolean`,`enum`,`array`,`object`],R=[`string`,`number`,`boolean`,`enum`,`object`],z={string:{Icon:_,className:`text-green-500`},number:{Icon:v,className:`text-blue-500`},boolean:{Icon:N,className:`text-orange-500`},enum:{Icon:M,className:`text-yellow-500`},array:{Icon:j,className:`text-pink-500`},object:{Icon:g,className:`text-purple-500`}};function ae(e){let t=(0,P.c)(8),{option:n}=e,{Icon:r,className:i}=z[n],a;t[0]===i?a=t[1]:(a=o(`size-3.5 shrink-0`,i),t[0]=i,t[1]=a);let s;t[2]!==r||t[3]!==a?(s=(0,I.jsx)(r,{"aria-hidden":!0,className:a}),t[2]=r,t[3]=a,t[4]=s):s=t[4];let c;return t[5]!==n||t[6]!==s?(c=(0,I.jsxs)(`span`,{className:`flex items-center gap-2`,children:[s,n]}),t[5]=n,t[6]=s,t[7]=c):c=t[7],c}function oe(e){let t=(0,P.c)(5),{option:n}=e,{Icon:r,className:i}=z[n],a;t[0]===i?a=t[1]:(a=o(`size-4 shrink-0`,i),t[0]=i,t[1]=a);let s;return t[2]!==r||t[3]!==a?(s=(0,I.jsx)(r,{"aria-hidden":!0,className:a}),t[2]=r,t[3]=a,t[4]=s):s=t[4],s}var se=4,B=new Set([`$schema`,`type`,`properties`,`required`]),ce=new Set([`type`,`enum`,`pattern`,`format`,`items`,`description`,`properties`,`required`]);function V(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function le(e){return e===void 0?[]:Array.isArray(e)&&e.every(e=>typeof e==`string`)?e:null}function ue(e){if(Object.keys(e).some(e=>!ce.has(e)))return!0;let t=e.items;if(t!==void 0){if(!V(t))return!0;let e=new Set([`enum`,`type`,`properties`,`required`,`description`]);if(Object.keys(t).some(t=>!e.has(t)))return!0}return!1}function de(e,t){return[...e.map(e=>typeof e==`string`?e:`[]`),t].join(`.`)}function fe(e){let t=(0,P.c)(28),{file:n}=e,{_:a}=i(),{data:o}=S(),s,c,l,u,d,f,p;if(t[0]!==a||t[1]!==o?.effective.plugins.frontmatter.schemas||t[2]!==n){let e=o?.effective.plugins.frontmatter.schemas.find(e=>e.file===n)?.schema,i=V(e)?Object.keys(e).filter(pe):[],m;t[10]!==a||t[11]!==n?(m={save:(e,t,r)=>{(async()=>{let i=await C(n,e,t,r);i.ok?T():b.error(i.errorDetail??a({id:`IQgeSn`}))})()},rename:(e,t,r)=>{(async()=>{let i=await E(n,e,t,r);i.ok?T():b.error(i.errorDetail??a({id:`kooyLJ`}))})()},remove:(e,t)=>{(async()=>{let r=await w(n,e,t);r.ok?T():b.error(r.errorDetail??a({id:`qC7PwZ`}))})()}},t[10]=a,t[11]=n,t[12]=m):m=t[12],c=m,u=`space-y-3`,d=`frontmatter-field-editor-${n}`,f=e===void 0&&(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:(0,I.jsx)(r,{id:`ri6zS-`})}),t[13]!==n||t[14]!==i?(p=i.length>0&&(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,"data-testid":`frontmatter-schema-root-preserved-${n}`,children:(0,I.jsx)(r,{id:`98FP1E`,values:{0:i.join(`, `)}})}),t[13]=n,t[14]=i,t[15]=p):p=t[15],s=me,l=V(e)?e:{},t[0]=a,t[1]=o?.effective.plugins.frontmatter.schemas,t[2]=n,t[3]=s,t[4]=c,t[5]=l,t[6]=u,t[7]=d,t[8]=f,t[9]=p}else s=t[3],c=t[4],l=t[5],u=t[6],d=t[7],f=t[8],p=t[9];let m;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(m=[],t[16]=m):m=t[16];let h=`frontmatter-add-field-${n}`,g;t[17]!==s||t[18]!==c||t[19]!==l||t[20]!==h?(g=(0,I.jsx)(s,{node:l,parentPath:m,depth:0,addInputId:h,ops:c}),t[17]=s,t[18]=c,t[19]=l,t[20]=h,t[21]=g):g=t[21];let _;return t[22]!==u||t[23]!==d||t[24]!==f||t[25]!==p||t[26]!==g?(_=(0,I.jsxs)(`div`,{className:u,"data-testid":d,children:[f,p,g]}),t[22]=u,t[23]=d,t[24]=f,t[25]=p,t[26]=g,t[27]=_):_=t[27],_}function pe(e){return!B.has(e)}function me(e){let t=(0,P.c)(19),{node:n,parentPath:r,depth:i,addInputId:a,ops:o}=e,s;t[0]===n.properties?s=t[1]:(s=V(n.properties)?n.properties:{},t[0]=n.properties,t[1]=s);let c=s,l,u;if(t[2]!==i||t[3]!==n.required||t[4]!==o||t[5]!==r||t[6]!==c){let e=Array.isArray(n.required)?n.required.filter(H):[];l=`space-y-2`,u=Object.entries(c).map(t=>{let[n,a]=t;return(0,I.jsx)(he,{field:n,property:V(a)?a:{},isRequired:e.includes(n),parentPath:r,depth:i,ops:o},n)}),t[2]=i,t[3]=n.required,t[4]=o,t[5]=r,t[6]=c,t[7]=l,t[8]=u}else l=t[7],u=t[8];let d;t[9]!==o||t[10]!==r?(d=e=>o.save(e,{type:`string`},r),t[9]=o,t[10]=r,t[11]=d):d=t[11];let f;t[12]!==a||t[13]!==d?(f=(0,I.jsx)(U,{inputId:a,onAdd:d}),t[12]=a,t[13]=d,t[14]=f):f=t[14];let p;return t[15]!==l||t[16]!==u||t[17]!==f?(p=(0,I.jsxs)(`div`,{className:l,children:[u,f]}),t[15]=l,t[16]=u,t[17]=f,t[18]=p):p=t[18],p}function H(e){return typeof e==`string`}function he(e){let t=(0,P.c)(172),{field:n,property:a,isRequired:o,parentPath:s,depth:d,ops:g}=e,{_}=i(),[v,b]=(0,F.useState)(!1),[x,S]=(0,F.useState)(!1),C;t[0]!==n||t[1]!==s?(C=de(s,n),t[0]=n,t[1]=s,t[2]=C):C=t[2];let w=C,T=typeof a.type==`string`&&ie.includes(a.type)?a.type:void 0,E;t[3]===a.enum?E=t[4]:(E=le(a.enum),t[3]=a.enum,t[4]=E);let D=E,ee;t[5]===a.items?ee=t[6]:(ee=V(a.items)?a.items:{},t[5]=a.items,t[6]=ee);let O=ee,te;t[7]===O.enum?te=t[8]:(te=le(O.enum),t[7]=O.enum,t[8]=te);let A=te,ne=typeof a.pattern==`string`?a.pattern:``,re=typeof a.description==`string`?a.description:``,j;t[9]===a?j=t[10]:(j=ue(a),t[9]=a,t[10]=j);let M=j,N=T!==`array`&&D!==null&&(D.length>0||v),z=T===`object`&&d<se,ae;t[11]===O.type?ae=t[12]:(ae=typeof O.type==`string`&&R.includes(O.type)?O.type:void 0,t[11]=O.type,t[12]=ae);let B=ae,ce=B!==`object`&&A!==null&&(A.length>0||x),fe=T===`array`&&B===`object`&&d<se,pe=`frontmatter-field-row-${w}`,H;t[13]!==N||t[14]!==T?(H=(N||T!==void 0)&&(0,I.jsx)(oe,{option:N?`enum`:T}),t[13]=N,t[14]=T,t[15]=H):H=t[15];let he=`frontmatter-field-name-${w}`,U;t[16]===_?U=t[17]:(U=_({id:`nrXDdR`}),t[16]=_,t[17]=U);let W;t[18]!==n||t[19]!==g||t[20]!==s?(W=e=>{e!==``&&e!==n&&g.rename(n,e,s)},t[18]=n,t[19]=g,t[20]=s,t[21]=W):W=t[21];let G;t[22]!==n||t[23]!==U||t[24]!==W||t[25]!==he?(G=(0,I.jsx)(ve,{id:he,initial:n,ariaLabel:U,className:`h-7 w-36 shrink-0 font-mono text-sm font-medium`,onCommit:W}),t[22]=n,t[23]=U,t[24]=W,t[25]=he,t[26]=G):G=t[26];let ye=`frontmatter-field-description-${w}`,K;t[27]===_?K=t[28]:(K=_({id:`PGPGsL`}),t[27]=_,t[28]=K);let q;t[29]!==_||t[30]!==n?(q=_({id:`IFALcX`,values:{field:n}}),t[29]=_,t[30]=n,t[31]=q):q=t[31];let J;t[32]!==n||t[33]!==g||t[34]!==s?(J=e=>g.save(n,{description:e===``?null:e},s),t[32]=n,t[33]=g,t[34]=s,t[35]=J):J=t[35];let Y;t[36]!==re||t[37]!==ye||t[38]!==K||t[39]!==q||t[40]!==J?(Y=(0,I.jsx)(ve,{id:ye,initial:re,placeholder:K,ariaLabel:q,className:`h-7 min-w-0 flex-1`,onCommit:J}),t[36]=re,t[37]=ye,t[38]=K,t[39]=q,t[40]=J,t[41]=Y):Y=t[41];let be=`frontmatter-field-required-${w}`,xe;t[42]===Symbol.for(`react.memo_cache_sentinel`)?(xe=(0,I.jsx)(r,{id:`TMLAx2`}),t[42]=xe):xe=t[42];let X;t[43]===be?X=t[44]:(X=(0,I.jsx)(l,{htmlFor:be,className:`shrink-0 text-xs text-muted-foreground`,children:xe}),t[43]=be,t[44]=X);let Se=`frontmatter-field-required-${w}`,Z;t[45]!==n||t[46]!==g||t[47]!==s?(Z=e=>g.save(n,{required:e},s),t[45]=n,t[46]=g,t[47]=s,t[48]=Z):Z=t[48];let Ce=`frontmatter-field-required-${w}`,we;t[49]!==o||t[50]!==Se||t[51]!==Z||t[52]!==Ce?(we=(0,I.jsx)(h,{id:Se,checked:o,onCheckedChange:Z,"data-testid":Ce}),t[49]=o,t[50]=Se,t[51]=Z,t[52]=Ce,t[53]=we):we=t[53];let Te;t[54]!==n||t[55]!==g||t[56]!==s?(Te=()=>g.remove(n,s),t[54]=n,t[55]=g,t[56]=s,t[57]=Te):Te=t[57];let Ee;t[58]!==_||t[59]!==n?(Ee=_({id:`bF22t6`,values:{field:n}}),t[58]=_,t[59]=n,t[60]=Ee):Ee=t[60];let De=`frontmatter-field-remove-${w}`,Oe;t[61]===Symbol.for(`react.memo_cache_sentinel`)?(Oe=(0,I.jsx)(y,{"aria-hidden":!0,className:`size-4`}),t[61]=Oe):Oe=t[61];let ke;t[62]!==Te||t[63]!==Ee||t[64]!==De?(ke=(0,I.jsx)(c,{variant:`ghost`,size:`icon`,className:`size-7 shrink-0`,onClick:Te,"aria-label":Ee,"data-testid":De,children:Oe}),t[62]=Te,t[63]=Ee,t[64]=De,t[65]=ke):ke=t[65];let Ae;t[66]!==G||t[67]!==Y||t[68]!==X||t[69]!==we||t[70]!==ke||t[71]!==H?(Ae=(0,I.jsxs)(`div`,{className:`flex items-center gap-2`,children:[H,G,Y,X,we,ke]}),t[66]=G,t[67]=Y,t[68]=X,t[69]=we,t[70]=ke,t[71]=H,t[72]=Ae):Ae=t[72];let je;t[73]!==w||t[74]!==M?(je=M&&(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,"data-testid":`frontmatter-field-preserved-${w}`,children:(0,I.jsx)(r,{id:`TdlVEN`})}),t[73]=w,t[74]=M,t[75]=je):je=t[75];let Me=`frontmatter-field-type-${w}`,Ne;t[76]===Symbol.for(`react.memo_cache_sentinel`)?(Ne=(0,I.jsx)(r,{id:`-zy2Nq`}),t[76]=Ne):Ne=t[76];let Pe;t[77]===Me?Pe=t[78]:(Pe=(0,I.jsx)(l,{className:`text-xs`,htmlFor:Me,children:Ne}),t[77]=Me,t[78]=Pe);let Fe=N?`enum`:T??``,Ie;t[79]!==D?.length||t[80]!==n||t[81]!==g||t[82]!==s||t[83]!==N||t[84]!==T?(Ie=e=>{if(e===`enum`){b(!0),T===void 0&&g.save(n,{type:`string`},s);return}b(!1);let t=N&&(D?.length??0)>0?{type:e,enum:null}:{type:e};g.save(n,t,s)},t[79]=D?.length,t[80]=n,t[81]=g,t[82]=s,t[83]=N,t[84]=T,t[85]=Ie):Ie=t[85];let Le=`frontmatter-field-type-${w}`,Re=`frontmatter-field-type-${w}`,Q;t[86]===_?Q=t[87]:(Q=_({id:`EkUnmS`}),t[86]=_,t[87]=Q);let ze;t[88]===Q?ze=t[89]:(ze=(0,I.jsx)(p,{placeholder:Q}),t[88]=Q,t[89]=ze);let Be;t[90]!==Le||t[91]!==Re||t[92]!==ze?(Be=(0,I.jsx)(u,{id:Le,"data-testid":Re,children:ze}),t[90]=Le,t[91]=Re,t[92]=ze,t[93]=Be):Be=t[93];let Ve;t[94]===Symbol.for(`react.memo_cache_sentinel`)?(Ve=(0,I.jsx)(m,{children:L.map(_e)}),t[94]=Ve):Ve=t[94];let He;t[95]!==Fe||t[96]!==Ie||t[97]!==Be?(He=(0,I.jsxs)(f,{value:Fe,onValueChange:Ie,children:[Be,Ve]}),t[95]=Fe,t[96]=Ie,t[97]=Be,t[98]=He):He=t[98];let Ue;t[99]!==Pe||t[100]!==He?(Ue=(0,I.jsxs)(`div`,{className:`space-y-1`,children:[Pe,He]}),t[99]=Pe,t[100]=He,t[101]=Ue):Ue=t[101];let We=`frontmatter-field-pattern-${w}`,Ge;t[102]===Symbol.for(`react.memo_cache_sentinel`)?(Ge=(0,I.jsx)(r,{id:`cstC0z`}),t[102]=Ge):Ge=t[102];let Ke;t[103]===We?Ke=t[104]:(Ke=(0,I.jsx)(l,{className:`text-xs`,htmlFor:We,children:Ge}),t[103]=We,t[104]=Ke);let qe=`frontmatter-field-pattern-${w}`,Je;t[105]!==n||t[106]!==g||t[107]!==s?(Je=e=>g.save(n,{pattern:e===``?null:e},s),t[105]=n,t[106]=g,t[107]=s,t[108]=Je):Je=t[108];let Ye;t[109]!==ne||t[110]!==qe||t[111]!==Je?(Ye=(0,I.jsx)(ve,{id:qe,initial:ne,onCommit:Je}),t[109]=ne,t[110]=qe,t[111]=Je,t[112]=Ye):Ye=t[112];let Xe;t[113]!==Ke||t[114]!==Ye?(Xe=(0,I.jsxs)(`div`,{className:`space-y-1`,children:[Ke,Ye]}),t[113]=Ke,t[114]=Ye,t[115]=Xe):Xe=t[115];let Ze;t[116]!==Ue||t[117]!==Xe?(Ze=(0,I.jsxs)(`div`,{className:`grid grid-cols-2 gap-2`,children:[Ue,Xe]}),t[116]=Ue,t[117]=Xe,t[118]=Ze):Ze=t[118];let Qe;t[119]!==_||t[120]!==D||t[121]!==n||t[122]!==g||t[123]!==s||t[124]!==w||t[125]!==T?(Qe=T!==`array`&&T!==`object`&&D!==null&&(0,I.jsxs)(`div`,{className:`space-y-1`,children:[(0,I.jsx)(l,{className:`text-xs`,htmlFor:`frontmatter-field-enum-${w}`,children:(0,I.jsx)(r,{id:`UGeJuP`})}),(0,I.jsx)(k,{id:`frontmatter-field-enum-${w}`,value:D,grammar:`free-text`,onChange:e=>g.save(n,{enum:e.length===0?null:e},s),placeholder:_({id:`5tcmwY`}),"aria-label":_({id:`5qQr1u`,values:{field:n}})})]}),t[119]=_,t[120]=D,t[121]=n,t[122]=g,t[123]=s,t[124]=w,t[125]=T,t[126]=Qe):Qe=t[126];let $e;t[127]!==_||t[128]!==n||t[129]!==A?.length||t[130]!==B||t[131]!==g||t[132]!==s||t[133]!==w||t[134]!==ce||t[135]!==T?($e=T===`array`&&(0,I.jsx)(`div`,{className:`grid grid-cols-2 gap-2`,children:(0,I.jsxs)(`div`,{className:`space-y-1`,children:[(0,I.jsx)(l,{className:`text-xs`,htmlFor:`frontmatter-field-items-type-${w}`,children:(0,I.jsx)(r,{id:`6pe_G5`})}),(0,I.jsxs)(f,{value:ce?`enum`:B??``,onValueChange:e=>{if(e===`enum`){S(!0),B===void 0&&g.save(n,{itemsType:`string`},s);return}S(!1);let t=ce&&(A?.length??0)>0?{itemsType:e,itemsEnum:null}:{itemsType:e};g.save(n,t,s)},children:[(0,I.jsx)(u,{id:`frontmatter-field-items-type-${w}`,"data-testid":`frontmatter-field-items-type-${w}`,children:(0,I.jsx)(p,{placeholder:_({id:`EkUnmS`})})}),(0,I.jsx)(m,{children:R.map(ge)})]})]})}),t[127]=_,t[128]=n,t[129]=A?.length,t[130]=B,t[131]=g,t[132]=s,t[133]=w,t[134]=ce,t[135]=T,t[136]=$e):$e=t[136];let et;t[137]!==_||t[138]!==n||t[139]!==A||t[140]!==B||t[141]!==g||t[142]!==s||t[143]!==w||t[144]!==T?(et=T===`array`&&B!==`object`&&A!==null&&(0,I.jsxs)(`div`,{className:`space-y-1`,children:[(0,I.jsx)(l,{className:`text-xs`,htmlFor:`frontmatter-field-items-enum-${w}`,children:(0,I.jsx)(r,{id:`ezUmoU`})}),(0,I.jsx)(k,{id:`frontmatter-field-items-enum-${w}`,value:A,grammar:`free-text`,onChange:e=>g.save(n,{itemsEnum:e.length===0?null:e},s),placeholder:_({id:`5tcmwY`}),"aria-label":_({id:`e60wew`,values:{field:n}})})]}),t[137]=_,t[138]=n,t[139]=A,t[140]=B,t[141]=g,t[142]=s,t[143]=w,t[144]=T,t[145]=et):et=t[145];let tt;t[146]!==d||t[147]!==n||t[148]!==O||t[149]!==g||t[150]!==s||t[151]!==w||t[152]!==fe?(tt=fe&&(0,I.jsxs)(`div`,{className:`ml-2 space-y-1 border-l pl-3 pt-1`,"data-testid":`frontmatter-field-item-children-${w}`,children:[(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:(0,I.jsx)(r,{id:`wU8WyK`})}),(0,I.jsx)(me,{node:O,parentPath:[...s,n,{items:!0}],depth:d+1,addInputId:`frontmatter-add-field-${w}.[]`,ops:g})]}),t[146]=d,t[147]=n,t[148]=O,t[149]=g,t[150]=s,t[151]=w,t[152]=fe,t[153]=tt):tt=t[153];let $;t[154]!==d||t[155]!==n||t[156]!==g||t[157]!==s||t[158]!==w||t[159]!==a||t[160]!==z?($=z&&(0,I.jsxs)(`div`,{className:`ml-2 space-y-1 border-l pl-3 pt-1`,"data-testid":`frontmatter-field-children-${w}`,children:[(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:(0,I.jsx)(r,{id:`9nIrRp`})}),(0,I.jsx)(me,{node:a,parentPath:[...s,n],depth:d+1,addInputId:`frontmatter-add-field-${w}`,ops:g})]}),t[154]=d,t[155]=n,t[156]=g,t[157]=s,t[158]=w,t[159]=a,t[160]=z,t[161]=$):$=t[161];let nt;return t[162]!==Ae||t[163]!==je||t[164]!==Ze||t[165]!==Qe||t[166]!==$e||t[167]!==et||t[168]!==tt||t[169]!==$||t[170]!==pe?(nt=(0,I.jsxs)(`div`,{className:`space-y-2 rounded-md border p-3`,"data-testid":pe,children:[Ae,je,Ze,Qe,$e,et,tt,$]}),t[162]=Ae,t[163]=je,t[164]=Ze,t[165]=Qe,t[166]=$e,t[167]=et,t[168]=tt,t[169]=$,t[170]=pe,t[171]=nt):nt=t[171],nt}function ge(e){return(0,I.jsx)(d,{value:e,children:(0,I.jsx)(ae,{option:e})},e)}function _e(e){return(0,I.jsx)(d,{value:e,children:(0,I.jsx)(ae,{option:e})},e)}function U(e){let t=(0,P.c)(24),{inputId:n,onAdd:i}=e,[a,o]=(0,F.useState)(``),s;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,I.jsx)(r,{id:`Va3xJe`}),t[0]=s):s=t[0];let u;t[1]===n?u=t[2]:(u=(0,I.jsx)(l,{htmlFor:n,className:`text-xs`,children:s}),t[1]=n,t[2]=u);let d;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(d=e=>o(e.target.value),t[3]=d):d=t[3];let f=`${n}-input`,p;t[4]!==n||t[5]!==a||t[6]!==f?(p=(0,I.jsx)(x,{id:n,value:a,onChange:d,placeholder:`owner`,"data-testid":f}),t[4]=n,t[5]=a,t[6]=f,t[7]=p):p=t[7];let m;t[8]!==u||t[9]!==p?(m=(0,I.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-1`,children:[u,p]}),t[8]=u,t[9]=p,t[10]=m):m=t[10];let h;t[11]===a?h=t[12]:(h=a.trim(),t[11]=a,t[12]=h);let g=h===``,_;t[13]!==a||t[14]!==i?(_=()=>{i(a.trim()),o(``)},t[13]=a,t[14]=i,t[15]=_):_=t[15];let v=`${n}-save`,y;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,I.jsx)(r,{id:`m16xKo`}),t[16]=y):y=t[16];let b;t[17]!==v||t[18]!==g||t[19]!==_?(b=(0,I.jsx)(c,{size:`sm`,variant:`outline`,disabled:g,onClick:_,"data-testid":v,children:y}),t[17]=v,t[18]=g,t[19]=_,t[20]=b):b=t[20];let S;return t[21]!==b||t[22]!==m?(S=(0,I.jsxs)(`div`,{className:`flex items-end gap-2`,children:[m,b]}),t[21]=b,t[22]=m,t[23]=S):S=t[23],S}function ve(e){let t=(0,P.c)(15),{id:n,initial:r,onCommit:i,placeholder:a,ariaLabel:o,className:s}=e,[c,l]=(0,F.useState)(r),u;t[0]!==c||t[1]!==r||t[2]!==i?(u=()=>{c.trim()!==r&&i(c.trim())},t[0]=c,t[1]=r,t[2]=i,t[3]=u):u=t[3];let d=u,f;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(f=e=>l(e.target.value),t[4]=f):f=t[4];let p;t[5]===d?p=t[6]:(p=e=>{e.key===`Enter`&&d()},t[5]=d,t[6]=p);let m;return t[7]!==o||t[8]!==s||t[9]!==d||t[10]!==c||t[11]!==n||t[12]!==a||t[13]!==p?(m=(0,I.jsx)(x,{id:n,value:c,onChange:f,onBlur:d,onKeyDown:p,placeholder:a,"aria-label":o,className:s,"data-testid":n}),t[7]=o,t[8]=s,t[9]=d,t[10]=c,t[11]=n,t[12]=a,t[13]=p,t[14]=m):m=t[14],m}function W(e){return`/api/asset-text?path=${encodeURIComponent(e)}`}function G(e){let t=(0,P.c)(45),{assetPath:n}=e,{_:r}=i(),[a,o]=te(),[s,c]=(0,F.useState)(null),l=s??a,u;t[0]===o?u=t[1]:(u=e=>{c(e),o(e)},t[0]=o,t[1]=u);let d=u,f,p;t[2]===n?(f=t[3],p=t[4]):(f=()=>{let e=e=>{e===n&&re(e)&&c(`rules`)};return e(n),ne(e)},p=[n],t[2]=n,t[3]=f,t[4]=p),(0,F.useEffect)(f,p);let{data:m}=S(),h;t[5]===m?.effective.plugins.frontmatter.schemas?h=t[6]:(h=m?.effective.plugins.frontmatter.schemas??[],t[5]=m?.effective.plugins.frontmatter.schemas,t[6]=h);let g;if(t[7]!==n||t[8]!==h){let e;t[10]===n?e=t[11]:(e=e=>e.file===n,t[10]=n,t[11]=e),g=h.some(e),t[7]=n,t[8]=h,t[9]=g}else g=t[9];let _=g,v=!_||l===`source`,y;t[12]===n?y=t[13]:(y=n.split(`/`).pop()??n,t[12]=n,t[13]=y);let b=y,x;t[14]===b?x=t[15]:(x=b.includes(`.`)?(b.split(`.`).pop()??``).toLowerCase():``,t[14]=b,t[15]=x);let C=x,w;t[16]===n?w=t[17]:(w=(0,I.jsx)(ee,{entry:{kind:`asset`,path:n},className:`shrink-0 border-b bg-background px-3 py-1.5`}),t[16]=n,t[17]=w);let T;t[18]===d?T=t[19]:(T=e=>d(e===`source`?`source`:`rules`),t[18]=d,t[19]=T);let E=!_,k;t[20]===r?k=t[21]:(k=r({id:`vF68cg`}),t[20]=r,t[21]=k);let j;t[22]===r?j=t[23]:(j=r({id:`wdxz7K`}),t[22]=r,t[23]=j);let M;t[24]===r?M=t[25]:(M=r({id:`nc-ipN`}),t[24]=r,t[25]=M);let N;t[26]!==v||t[27]!==E||t[28]!==k||t[29]!==j||t[30]!==M||t[31]!==T?(N=(0,I.jsx)(O,{isSourceMode:v,onModeChange:T,wysiwygDisabled:E,wysiwygLabel:k,sourceLabel:j,wysiwygDisabledReason:M}),t[26]=v,t[27]=E,t[28]=k,t[29]=j,t[30]=M,t[31]=T,t[32]=N):N=t[32];let ie;t[33]===Symbol.for(`react.memo_cache_sentinel`)?(ie=(0,I.jsx)(A,{className:`absolute left-3 top-1/2 -translate-y-1/2`}),t[33]=ie):ie=t[33];let L;t[34]===N?L=t[35]:(L=(0,I.jsxs)(`div`,{className:`relative flex shrink-0 items-center justify-center border-b bg-background py-2`,children:[N,ie]}),t[34]=N,t[35]=L);let R;t[36]!==n||t[37]!==C||t[38]!==b||t[39]!==v?(R=v?(0,I.jsx)(`div`,{className:`min-h-0 flex-1 overflow-hidden`,children:(0,I.jsx)(D,{src:W(n),fileName:b,extension:C},n)}):(0,I.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto px-4 py-4 sm:px-6`,children:(0,I.jsx)(`div`,{className:`mx-auto w-full max-w-3xl`,children:(0,I.jsx)(fe,{file:n})})}),t[36]=n,t[37]=C,t[38]=b,t[39]=v,t[40]=R):R=t[40];let z;return t[41]!==L||t[42]!==R||t[43]!==w?(z=(0,I.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col bg-background`,"data-schema-config-editor":``,children:[w,L,R]}),t[41]=L,t[42]=R,t[43]=w,t[44]=z):z=t[44],z}export{G as SchemaConfigEditor};
1
+ import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{t as n}from"./react-f2sANaYj.js";import{n as r,r as i}from"./dist-Nvb76hAm.js";import{t as a}from"./compiler-runtime-BfE3aGVn.js";import{s as o,t as s}from"./createLucideIcon-DAkhoPjT.js";import{t as c}from"./button-Gol9BgNB.js";import{t as l}from"./label-DyipnO5I.js";import{a as u,i as d,n as f,o as p,r as m,t as h}from"./switch-DYic2V-1.js";import{t as g}from"./braces-DwnwFx_V.js";import{t as _}from"./case-sensitive-nl0tWMnZ.js";import{t as v}from"./hash-DNKDqZ18.js";import{t as y}from"./trash-2-BUuL4OCw.js";import{n as b}from"./dist-BLAMau9Z.js";import{t as x}from"./input-D0ZW0Opq.js";import{d as S,f as C,o as w,r as T,s as E}from"./lint-config-client-bcseyVIk.js";import{i as D,r as ee,t as O}from"./EditorModeToggle-CigjLJ2Z.js";import{t as k}from"./tag-pill-input-opUlyN8Z.js";import{t as te}from"./useLintConfigViewMode-DKPENttR.js";import{i as A,r as ne,t as re}from"./schema-fields-view-intent-D_s-Cynn.js";var j=s(`brackets`,[[`path`,{d:`M16 3h3a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1h-3`,key:`1kt8lf`}],[`path`,{d:`M8 21H5a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h3`,key:`gduv9`}]]),M=s(`list-checks`,[[`path`,{d:`M13 5h8`,key:`a7qcls`}],[`path`,{d:`M13 12h8`,key:`h98zly`}],[`path`,{d:`M13 19h8`,key:`c3s6r1`}],[`path`,{d:`m3 17 2 2 4-4`,key:`1jhpwq`}],[`path`,{d:`m3 7 2 2 4-4`,key:`1obspn`}]]),N=s(`toggle-left`,[[`circle`,{cx:`9`,cy:`12`,r:`3`,key:`u3jwor`}],[`rect`,{width:`20`,height:`14`,x:`2`,y:`5`,rx:`7`,key:`g7kal2`}]]),P=a(),F=e(n(),1),I=t(),ie=[`string`,`number`,`boolean`,`array`,`object`],L=[`string`,`number`,`boolean`,`enum`,`array`,`object`],R=[`string`,`number`,`boolean`,`enum`,`object`],z={string:{Icon:_,className:`text-green-500`},number:{Icon:v,className:`text-blue-500`},boolean:{Icon:N,className:`text-orange-500`},enum:{Icon:M,className:`text-yellow-500`},array:{Icon:j,className:`text-pink-500`},object:{Icon:g,className:`text-purple-500`}};function ae(e){let t=(0,P.c)(8),{option:n}=e,{Icon:r,className:i}=z[n],a;t[0]===i?a=t[1]:(a=o(`size-3.5 shrink-0`,i),t[0]=i,t[1]=a);let s;t[2]!==r||t[3]!==a?(s=(0,I.jsx)(r,{"aria-hidden":!0,className:a}),t[2]=r,t[3]=a,t[4]=s):s=t[4];let c;return t[5]!==n||t[6]!==s?(c=(0,I.jsxs)(`span`,{className:`flex items-center gap-2`,children:[s,n]}),t[5]=n,t[6]=s,t[7]=c):c=t[7],c}function oe(e){let t=(0,P.c)(5),{option:n}=e,{Icon:r,className:i}=z[n],a;t[0]===i?a=t[1]:(a=o(`size-4 shrink-0`,i),t[0]=i,t[1]=a);let s;return t[2]!==r||t[3]!==a?(s=(0,I.jsx)(r,{"aria-hidden":!0,className:a}),t[2]=r,t[3]=a,t[4]=s):s=t[4],s}var se=4,B=new Set([`$schema`,`type`,`properties`,`required`]),ce=new Set([`type`,`enum`,`pattern`,`format`,`items`,`description`,`properties`,`required`]);function V(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function le(e){return e===void 0?[]:Array.isArray(e)&&e.every(e=>typeof e==`string`)?e:null}function ue(e){if(Object.keys(e).some(e=>!ce.has(e)))return!0;let t=e.items;if(t!==void 0){if(!V(t))return!0;let e=new Set([`enum`,`type`,`properties`,`required`,`description`]);if(Object.keys(t).some(t=>!e.has(t)))return!0}return!1}function de(e,t){return[...e.map(e=>typeof e==`string`?e:`[]`),t].join(`.`)}function fe(e){let t=(0,P.c)(28),{file:n}=e,{_:a}=i(),{data:o}=S(),s,c,l,u,d,f,p;if(t[0]!==a||t[1]!==o?.effective.plugins.frontmatter.schemas||t[2]!==n){let e=o?.effective.plugins.frontmatter.schemas.find(e=>e.file===n)?.schema,i=V(e)?Object.keys(e).filter(pe):[],m;t[10]!==a||t[11]!==n?(m={save:(e,t,r)=>{(async()=>{let i=await C(n,e,t,r);i.ok?T():b.error(i.errorDetail??a({id:`IQgeSn`}))})()},rename:(e,t,r)=>{(async()=>{let i=await E(n,e,t,r);i.ok?T():b.error(i.errorDetail??a({id:`kooyLJ`}))})()},remove:(e,t)=>{(async()=>{let r=await w(n,e,t);r.ok?T():b.error(r.errorDetail??a({id:`qC7PwZ`}))})()}},t[10]=a,t[11]=n,t[12]=m):m=t[12],c=m,u=`space-y-3`,d=`frontmatter-field-editor-${n}`,f=e===void 0&&(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:(0,I.jsx)(r,{id:`ri6zS-`})}),t[13]!==n||t[14]!==i?(p=i.length>0&&(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,"data-testid":`frontmatter-schema-root-preserved-${n}`,children:(0,I.jsx)(r,{id:`98FP1E`,values:{0:i.join(`, `)}})}),t[13]=n,t[14]=i,t[15]=p):p=t[15],s=me,l=V(e)?e:{},t[0]=a,t[1]=o?.effective.plugins.frontmatter.schemas,t[2]=n,t[3]=s,t[4]=c,t[5]=l,t[6]=u,t[7]=d,t[8]=f,t[9]=p}else s=t[3],c=t[4],l=t[5],u=t[6],d=t[7],f=t[8],p=t[9];let m;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(m=[],t[16]=m):m=t[16];let h=`frontmatter-add-field-${n}`,g;t[17]!==s||t[18]!==c||t[19]!==l||t[20]!==h?(g=(0,I.jsx)(s,{node:l,parentPath:m,depth:0,addInputId:h,ops:c}),t[17]=s,t[18]=c,t[19]=l,t[20]=h,t[21]=g):g=t[21];let _;return t[22]!==u||t[23]!==d||t[24]!==f||t[25]!==p||t[26]!==g?(_=(0,I.jsxs)(`div`,{className:u,"data-testid":d,children:[f,p,g]}),t[22]=u,t[23]=d,t[24]=f,t[25]=p,t[26]=g,t[27]=_):_=t[27],_}function pe(e){return!B.has(e)}function me(e){let t=(0,P.c)(19),{node:n,parentPath:r,depth:i,addInputId:a,ops:o}=e,s;t[0]===n.properties?s=t[1]:(s=V(n.properties)?n.properties:{},t[0]=n.properties,t[1]=s);let c=s,l,u;if(t[2]!==i||t[3]!==n.required||t[4]!==o||t[5]!==r||t[6]!==c){let e=Array.isArray(n.required)?n.required.filter(H):[];l=`space-y-2`,u=Object.entries(c).map(t=>{let[n,a]=t;return(0,I.jsx)(he,{field:n,property:V(a)?a:{},isRequired:e.includes(n),parentPath:r,depth:i,ops:o},n)}),t[2]=i,t[3]=n.required,t[4]=o,t[5]=r,t[6]=c,t[7]=l,t[8]=u}else l=t[7],u=t[8];let d;t[9]!==o||t[10]!==r?(d=e=>o.save(e,{type:`string`},r),t[9]=o,t[10]=r,t[11]=d):d=t[11];let f;t[12]!==a||t[13]!==d?(f=(0,I.jsx)(U,{inputId:a,onAdd:d}),t[12]=a,t[13]=d,t[14]=f):f=t[14];let p;return t[15]!==l||t[16]!==u||t[17]!==f?(p=(0,I.jsxs)(`div`,{className:l,children:[u,f]}),t[15]=l,t[16]=u,t[17]=f,t[18]=p):p=t[18],p}function H(e){return typeof e==`string`}function he(e){let t=(0,P.c)(172),{field:n,property:a,isRequired:o,parentPath:s,depth:d,ops:g}=e,{_}=i(),[v,b]=(0,F.useState)(!1),[x,S]=(0,F.useState)(!1),C;t[0]!==n||t[1]!==s?(C=de(s,n),t[0]=n,t[1]=s,t[2]=C):C=t[2];let w=C,T=typeof a.type==`string`&&ie.includes(a.type)?a.type:void 0,E;t[3]===a.enum?E=t[4]:(E=le(a.enum),t[3]=a.enum,t[4]=E);let D=E,ee;t[5]===a.items?ee=t[6]:(ee=V(a.items)?a.items:{},t[5]=a.items,t[6]=ee);let O=ee,te;t[7]===O.enum?te=t[8]:(te=le(O.enum),t[7]=O.enum,t[8]=te);let A=te,ne=typeof a.pattern==`string`?a.pattern:``,re=typeof a.description==`string`?a.description:``,j;t[9]===a?j=t[10]:(j=ue(a),t[9]=a,t[10]=j);let M=j,N=T!==`array`&&D!==null&&(D.length>0||v),z=T===`object`&&d<se,ae;t[11]===O.type?ae=t[12]:(ae=typeof O.type==`string`&&R.includes(O.type)?O.type:void 0,t[11]=O.type,t[12]=ae);let B=ae,ce=B!==`object`&&A!==null&&(A.length>0||x),fe=T===`array`&&B===`object`&&d<se,pe=`frontmatter-field-row-${w}`,H;t[13]!==N||t[14]!==T?(H=(N||T!==void 0)&&(0,I.jsx)(oe,{option:N?`enum`:T}),t[13]=N,t[14]=T,t[15]=H):H=t[15];let he=`frontmatter-field-name-${w}`,U;t[16]===_?U=t[17]:(U=_({id:`nrXDdR`}),t[16]=_,t[17]=U);let W;t[18]!==n||t[19]!==g||t[20]!==s?(W=e=>{e!==``&&e!==n&&g.rename(n,e,s)},t[18]=n,t[19]=g,t[20]=s,t[21]=W):W=t[21];let G;t[22]!==n||t[23]!==U||t[24]!==W||t[25]!==he?(G=(0,I.jsx)(ve,{id:he,initial:n,ariaLabel:U,className:`h-7 w-36 shrink-0 font-mono text-sm font-medium`,onCommit:W}),t[22]=n,t[23]=U,t[24]=W,t[25]=he,t[26]=G):G=t[26];let ye=`frontmatter-field-description-${w}`,K;t[27]===_?K=t[28]:(K=_({id:`PGPGsL`}),t[27]=_,t[28]=K);let q;t[29]!==_||t[30]!==n?(q=_({id:`IFALcX`,values:{field:n}}),t[29]=_,t[30]=n,t[31]=q):q=t[31];let J;t[32]!==n||t[33]!==g||t[34]!==s?(J=e=>g.save(n,{description:e===``?null:e},s),t[32]=n,t[33]=g,t[34]=s,t[35]=J):J=t[35];let Y;t[36]!==re||t[37]!==ye||t[38]!==K||t[39]!==q||t[40]!==J?(Y=(0,I.jsx)(ve,{id:ye,initial:re,placeholder:K,ariaLabel:q,className:`h-7 min-w-0 flex-1`,onCommit:J}),t[36]=re,t[37]=ye,t[38]=K,t[39]=q,t[40]=J,t[41]=Y):Y=t[41];let be=`frontmatter-field-required-${w}`,xe;t[42]===Symbol.for(`react.memo_cache_sentinel`)?(xe=(0,I.jsx)(r,{id:`TMLAx2`}),t[42]=xe):xe=t[42];let X;t[43]===be?X=t[44]:(X=(0,I.jsx)(l,{htmlFor:be,className:`shrink-0 text-xs text-muted-foreground`,children:xe}),t[43]=be,t[44]=X);let Se=`frontmatter-field-required-${w}`,Z;t[45]!==n||t[46]!==g||t[47]!==s?(Z=e=>g.save(n,{required:e},s),t[45]=n,t[46]=g,t[47]=s,t[48]=Z):Z=t[48];let Ce=`frontmatter-field-required-${w}`,we;t[49]!==o||t[50]!==Se||t[51]!==Z||t[52]!==Ce?(we=(0,I.jsx)(h,{id:Se,checked:o,onCheckedChange:Z,"data-testid":Ce}),t[49]=o,t[50]=Se,t[51]=Z,t[52]=Ce,t[53]=we):we=t[53];let Te;t[54]!==n||t[55]!==g||t[56]!==s?(Te=()=>g.remove(n,s),t[54]=n,t[55]=g,t[56]=s,t[57]=Te):Te=t[57];let Ee;t[58]!==_||t[59]!==n?(Ee=_({id:`bF22t6`,values:{field:n}}),t[58]=_,t[59]=n,t[60]=Ee):Ee=t[60];let De=`frontmatter-field-remove-${w}`,Oe;t[61]===Symbol.for(`react.memo_cache_sentinel`)?(Oe=(0,I.jsx)(y,{"aria-hidden":!0,className:`size-4`}),t[61]=Oe):Oe=t[61];let ke;t[62]!==Te||t[63]!==Ee||t[64]!==De?(ke=(0,I.jsx)(c,{variant:`ghost`,size:`icon`,className:`size-7 shrink-0`,onClick:Te,"aria-label":Ee,"data-testid":De,children:Oe}),t[62]=Te,t[63]=Ee,t[64]=De,t[65]=ke):ke=t[65];let Ae;t[66]!==G||t[67]!==Y||t[68]!==X||t[69]!==we||t[70]!==ke||t[71]!==H?(Ae=(0,I.jsxs)(`div`,{className:`flex items-center gap-2`,children:[H,G,Y,X,we,ke]}),t[66]=G,t[67]=Y,t[68]=X,t[69]=we,t[70]=ke,t[71]=H,t[72]=Ae):Ae=t[72];let je;t[73]!==w||t[74]!==M?(je=M&&(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,"data-testid":`frontmatter-field-preserved-${w}`,children:(0,I.jsx)(r,{id:`TdlVEN`})}),t[73]=w,t[74]=M,t[75]=je):je=t[75];let Me=`frontmatter-field-type-${w}`,Ne;t[76]===Symbol.for(`react.memo_cache_sentinel`)?(Ne=(0,I.jsx)(r,{id:`-zy2Nq`}),t[76]=Ne):Ne=t[76];let Pe;t[77]===Me?Pe=t[78]:(Pe=(0,I.jsx)(l,{className:`text-xs`,htmlFor:Me,children:Ne}),t[77]=Me,t[78]=Pe);let Fe=N?`enum`:T??``,Ie;t[79]!==D?.length||t[80]!==n||t[81]!==g||t[82]!==s||t[83]!==N||t[84]!==T?(Ie=e=>{if(e===`enum`){b(!0),T===void 0&&g.save(n,{type:`string`},s);return}b(!1);let t=N&&(D?.length??0)>0?{type:e,enum:null}:{type:e};g.save(n,t,s)},t[79]=D?.length,t[80]=n,t[81]=g,t[82]=s,t[83]=N,t[84]=T,t[85]=Ie):Ie=t[85];let Le=`frontmatter-field-type-${w}`,Re=`frontmatter-field-type-${w}`,Q;t[86]===_?Q=t[87]:(Q=_({id:`EkUnmS`}),t[86]=_,t[87]=Q);let ze;t[88]===Q?ze=t[89]:(ze=(0,I.jsx)(p,{placeholder:Q}),t[88]=Q,t[89]=ze);let Be;t[90]!==Le||t[91]!==Re||t[92]!==ze?(Be=(0,I.jsx)(u,{id:Le,"data-testid":Re,children:ze}),t[90]=Le,t[91]=Re,t[92]=ze,t[93]=Be):Be=t[93];let Ve;t[94]===Symbol.for(`react.memo_cache_sentinel`)?(Ve=(0,I.jsx)(m,{children:L.map(_e)}),t[94]=Ve):Ve=t[94];let He;t[95]!==Fe||t[96]!==Ie||t[97]!==Be?(He=(0,I.jsxs)(f,{value:Fe,onValueChange:Ie,children:[Be,Ve]}),t[95]=Fe,t[96]=Ie,t[97]=Be,t[98]=He):He=t[98];let Ue;t[99]!==Pe||t[100]!==He?(Ue=(0,I.jsxs)(`div`,{className:`space-y-1`,children:[Pe,He]}),t[99]=Pe,t[100]=He,t[101]=Ue):Ue=t[101];let We=`frontmatter-field-pattern-${w}`,Ge;t[102]===Symbol.for(`react.memo_cache_sentinel`)?(Ge=(0,I.jsx)(r,{id:`cstC0z`}),t[102]=Ge):Ge=t[102];let Ke;t[103]===We?Ke=t[104]:(Ke=(0,I.jsx)(l,{className:`text-xs`,htmlFor:We,children:Ge}),t[103]=We,t[104]=Ke);let qe=`frontmatter-field-pattern-${w}`,Je;t[105]!==n||t[106]!==g||t[107]!==s?(Je=e=>g.save(n,{pattern:e===``?null:e},s),t[105]=n,t[106]=g,t[107]=s,t[108]=Je):Je=t[108];let Ye;t[109]!==ne||t[110]!==qe||t[111]!==Je?(Ye=(0,I.jsx)(ve,{id:qe,initial:ne,onCommit:Je}),t[109]=ne,t[110]=qe,t[111]=Je,t[112]=Ye):Ye=t[112];let Xe;t[113]!==Ke||t[114]!==Ye?(Xe=(0,I.jsxs)(`div`,{className:`space-y-1`,children:[Ke,Ye]}),t[113]=Ke,t[114]=Ye,t[115]=Xe):Xe=t[115];let Ze;t[116]!==Ue||t[117]!==Xe?(Ze=(0,I.jsxs)(`div`,{className:`grid grid-cols-2 gap-2`,children:[Ue,Xe]}),t[116]=Ue,t[117]=Xe,t[118]=Ze):Ze=t[118];let Qe;t[119]!==_||t[120]!==D||t[121]!==n||t[122]!==g||t[123]!==s||t[124]!==w||t[125]!==T?(Qe=T!==`array`&&T!==`object`&&D!==null&&(0,I.jsxs)(`div`,{className:`space-y-1`,children:[(0,I.jsx)(l,{className:`text-xs`,htmlFor:`frontmatter-field-enum-${w}`,children:(0,I.jsx)(r,{id:`UGeJuP`})}),(0,I.jsx)(k,{id:`frontmatter-field-enum-${w}`,value:D,grammar:`free-text`,onChange:e=>g.save(n,{enum:e.length===0?null:e},s),placeholder:_({id:`5tcmwY`}),"aria-label":_({id:`5qQr1u`,values:{field:n}})})]}),t[119]=_,t[120]=D,t[121]=n,t[122]=g,t[123]=s,t[124]=w,t[125]=T,t[126]=Qe):Qe=t[126];let $e;t[127]!==_||t[128]!==n||t[129]!==A?.length||t[130]!==B||t[131]!==g||t[132]!==s||t[133]!==w||t[134]!==ce||t[135]!==T?($e=T===`array`&&(0,I.jsx)(`div`,{className:`grid grid-cols-2 gap-2`,children:(0,I.jsxs)(`div`,{className:`space-y-1`,children:[(0,I.jsx)(l,{className:`text-xs`,htmlFor:`frontmatter-field-items-type-${w}`,children:(0,I.jsx)(r,{id:`6pe_G5`})}),(0,I.jsxs)(f,{value:ce?`enum`:B??``,onValueChange:e=>{if(e===`enum`){S(!0),B===void 0&&g.save(n,{itemsType:`string`},s);return}S(!1);let t=ce&&(A?.length??0)>0?{itemsType:e,itemsEnum:null}:{itemsType:e};g.save(n,t,s)},children:[(0,I.jsx)(u,{id:`frontmatter-field-items-type-${w}`,"data-testid":`frontmatter-field-items-type-${w}`,children:(0,I.jsx)(p,{placeholder:_({id:`EkUnmS`})})}),(0,I.jsx)(m,{children:R.map(ge)})]})]})}),t[127]=_,t[128]=n,t[129]=A?.length,t[130]=B,t[131]=g,t[132]=s,t[133]=w,t[134]=ce,t[135]=T,t[136]=$e):$e=t[136];let et;t[137]!==_||t[138]!==n||t[139]!==A||t[140]!==B||t[141]!==g||t[142]!==s||t[143]!==w||t[144]!==T?(et=T===`array`&&B!==`object`&&A!==null&&(0,I.jsxs)(`div`,{className:`space-y-1`,children:[(0,I.jsx)(l,{className:`text-xs`,htmlFor:`frontmatter-field-items-enum-${w}`,children:(0,I.jsx)(r,{id:`ezUmoU`})}),(0,I.jsx)(k,{id:`frontmatter-field-items-enum-${w}`,value:A,grammar:`free-text`,onChange:e=>g.save(n,{itemsEnum:e.length===0?null:e},s),placeholder:_({id:`5tcmwY`}),"aria-label":_({id:`e60wew`,values:{field:n}})})]}),t[137]=_,t[138]=n,t[139]=A,t[140]=B,t[141]=g,t[142]=s,t[143]=w,t[144]=T,t[145]=et):et=t[145];let tt;t[146]!==d||t[147]!==n||t[148]!==O||t[149]!==g||t[150]!==s||t[151]!==w||t[152]!==fe?(tt=fe&&(0,I.jsxs)(`div`,{className:`ml-2 space-y-1 border-l pl-3 pt-1`,"data-testid":`frontmatter-field-item-children-${w}`,children:[(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:(0,I.jsx)(r,{id:`wU8WyK`})}),(0,I.jsx)(me,{node:O,parentPath:[...s,n,{items:!0}],depth:d+1,addInputId:`frontmatter-add-field-${w}.[]`,ops:g})]}),t[146]=d,t[147]=n,t[148]=O,t[149]=g,t[150]=s,t[151]=w,t[152]=fe,t[153]=tt):tt=t[153];let $;t[154]!==d||t[155]!==n||t[156]!==g||t[157]!==s||t[158]!==w||t[159]!==a||t[160]!==z?($=z&&(0,I.jsxs)(`div`,{className:`ml-2 space-y-1 border-l pl-3 pt-1`,"data-testid":`frontmatter-field-children-${w}`,children:[(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:(0,I.jsx)(r,{id:`9nIrRp`})}),(0,I.jsx)(me,{node:a,parentPath:[...s,n],depth:d+1,addInputId:`frontmatter-add-field-${w}`,ops:g})]}),t[154]=d,t[155]=n,t[156]=g,t[157]=s,t[158]=w,t[159]=a,t[160]=z,t[161]=$):$=t[161];let nt;return t[162]!==Ae||t[163]!==je||t[164]!==Ze||t[165]!==Qe||t[166]!==$e||t[167]!==et||t[168]!==tt||t[169]!==$||t[170]!==pe?(nt=(0,I.jsxs)(`div`,{className:`space-y-2 rounded-md border p-3`,"data-testid":pe,children:[Ae,je,Ze,Qe,$e,et,tt,$]}),t[162]=Ae,t[163]=je,t[164]=Ze,t[165]=Qe,t[166]=$e,t[167]=et,t[168]=tt,t[169]=$,t[170]=pe,t[171]=nt):nt=t[171],nt}function ge(e){return(0,I.jsx)(d,{value:e,children:(0,I.jsx)(ae,{option:e})},e)}function _e(e){return(0,I.jsx)(d,{value:e,children:(0,I.jsx)(ae,{option:e})},e)}function U(e){let t=(0,P.c)(24),{inputId:n,onAdd:i}=e,[a,o]=(0,F.useState)(``),s;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,I.jsx)(r,{id:`Va3xJe`}),t[0]=s):s=t[0];let u;t[1]===n?u=t[2]:(u=(0,I.jsx)(l,{htmlFor:n,className:`text-xs`,children:s}),t[1]=n,t[2]=u);let d;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(d=e=>o(e.target.value),t[3]=d):d=t[3];let f=`${n}-input`,p;t[4]!==n||t[5]!==a||t[6]!==f?(p=(0,I.jsx)(x,{id:n,value:a,onChange:d,placeholder:`owner`,"data-testid":f}),t[4]=n,t[5]=a,t[6]=f,t[7]=p):p=t[7];let m;t[8]!==u||t[9]!==p?(m=(0,I.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-1`,children:[u,p]}),t[8]=u,t[9]=p,t[10]=m):m=t[10];let h;t[11]===a?h=t[12]:(h=a.trim(),t[11]=a,t[12]=h);let g=h===``,_;t[13]!==a||t[14]!==i?(_=()=>{i(a.trim()),o(``)},t[13]=a,t[14]=i,t[15]=_):_=t[15];let v=`${n}-save`,y;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,I.jsx)(r,{id:`m16xKo`}),t[16]=y):y=t[16];let b;t[17]!==v||t[18]!==g||t[19]!==_?(b=(0,I.jsx)(c,{size:`sm`,variant:`outline`,disabled:g,onClick:_,"data-testid":v,children:y}),t[17]=v,t[18]=g,t[19]=_,t[20]=b):b=t[20];let S;return t[21]!==b||t[22]!==m?(S=(0,I.jsxs)(`div`,{className:`flex items-end gap-2`,children:[m,b]}),t[21]=b,t[22]=m,t[23]=S):S=t[23],S}function ve(e){let t=(0,P.c)(15),{id:n,initial:r,onCommit:i,placeholder:a,ariaLabel:o,className:s}=e,[c,l]=(0,F.useState)(r),u;t[0]!==c||t[1]!==r||t[2]!==i?(u=()=>{c.trim()!==r&&i(c.trim())},t[0]=c,t[1]=r,t[2]=i,t[3]=u):u=t[3];let d=u,f;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(f=e=>l(e.target.value),t[4]=f):f=t[4];let p;t[5]===d?p=t[6]:(p=e=>{e.key===`Enter`&&d()},t[5]=d,t[6]=p);let m;return t[7]!==o||t[8]!==s||t[9]!==d||t[10]!==c||t[11]!==n||t[12]!==a||t[13]!==p?(m=(0,I.jsx)(x,{id:n,value:c,onChange:f,onBlur:d,onKeyDown:p,placeholder:a,"aria-label":o,className:s,"data-testid":n}),t[7]=o,t[8]=s,t[9]=d,t[10]=c,t[11]=n,t[12]=a,t[13]=p,t[14]=m):m=t[14],m}function W(e){return`/api/asset-text?path=${encodeURIComponent(e)}`}function G(e){let t=(0,P.c)(45),{assetPath:n}=e,{_:r}=i(),[a,o]=te(),[s,c]=(0,F.useState)(null),l=s??a,u;t[0]===o?u=t[1]:(u=e=>{c(e),o(e)},t[0]=o,t[1]=u);let d=u,f,p;t[2]===n?(f=t[3],p=t[4]):(f=()=>{let e=e=>{e===n&&re(e)&&c(`rules`)};return e(n),ne(e)},p=[n],t[2]=n,t[3]=f,t[4]=p),(0,F.useEffect)(f,p);let{data:m}=S(),h;t[5]===m?.effective.plugins.frontmatter.schemas?h=t[6]:(h=m?.effective.plugins.frontmatter.schemas??[],t[5]=m?.effective.plugins.frontmatter.schemas,t[6]=h);let g;if(t[7]!==n||t[8]!==h){let e;t[10]===n?e=t[11]:(e=e=>e.file===n,t[10]=n,t[11]=e),g=h.some(e),t[7]=n,t[8]=h,t[9]=g}else g=t[9];let _=g,v=!_||l===`source`,y;t[12]===n?y=t[13]:(y=n.split(`/`).pop()??n,t[12]=n,t[13]=y);let b=y,x;t[14]===b?x=t[15]:(x=b.includes(`.`)?(b.split(`.`).pop()??``).toLowerCase():``,t[14]=b,t[15]=x);let C=x,w;t[16]===n?w=t[17]:(w=(0,I.jsx)(ee,{entry:{kind:`asset`,path:n},className:`shrink-0 border-b bg-background px-3 py-1.5`}),t[16]=n,t[17]=w);let T;t[18]===d?T=t[19]:(T=e=>d(e===`source`?`source`:`rules`),t[18]=d,t[19]=T);let E=!_,k;t[20]===r?k=t[21]:(k=r({id:`vF68cg`}),t[20]=r,t[21]=k);let j;t[22]===r?j=t[23]:(j=r({id:`wdxz7K`}),t[22]=r,t[23]=j);let M;t[24]===r?M=t[25]:(M=r({id:`nc-ipN`}),t[24]=r,t[25]=M);let N;t[26]!==v||t[27]!==E||t[28]!==k||t[29]!==j||t[30]!==M||t[31]!==T?(N=(0,I.jsx)(O,{isSourceMode:v,onModeChange:T,wysiwygDisabled:E,wysiwygLabel:k,sourceLabel:j,wysiwygDisabledReason:M}),t[26]=v,t[27]=E,t[28]=k,t[29]=j,t[30]=M,t[31]=T,t[32]=N):N=t[32];let ie;t[33]===Symbol.for(`react.memo_cache_sentinel`)?(ie=(0,I.jsx)(A,{className:`absolute left-3 top-1/2 -translate-y-1/2`}),t[33]=ie):ie=t[33];let L;t[34]===N?L=t[35]:(L=(0,I.jsxs)(`div`,{className:`relative flex shrink-0 items-center justify-center border-b bg-background py-2`,children:[N,ie]}),t[34]=N,t[35]=L);let R;t[36]!==n||t[37]!==C||t[38]!==b||t[39]!==v?(R=v?(0,I.jsx)(`div`,{className:`min-h-0 flex-1 overflow-hidden`,children:(0,I.jsx)(D,{src:W(n),fileName:b,extension:C},n)}):(0,I.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto px-4 py-4 sm:px-6`,children:(0,I.jsx)(`div`,{className:`mx-auto w-full max-w-3xl`,children:(0,I.jsx)(fe,{file:n})})}),t[36]=n,t[37]=C,t[38]=b,t[39]=v,t[40]=R):R=t[40];let z;return t[41]!==L||t[42]!==R||t[43]!==w?(z=(0,I.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col bg-background`,"data-schema-config-editor":``,children:[w,L,R]}),t[41]=L,t[42]=R,t[43]=w,t[44]=z):z=t[44],z}export{G as SchemaConfigEditor};
@@ -1,4 +1,4 @@
1
- import{o as e,t}from"./chunk-CYidjpOJ.js";import{t as n}from"./jsx-runtime-BUgB2tll.js";import{Xt as r,it as i,yn as a}from"./DocumentContext-FCJwmuAo.js";import{t as o}from"./react-f2sANaYj.js";import{n as s,r as c}from"./dist-Nvb76hAm.js";import{t as l}from"./useQuery-ZeEDLtxh.js";import{n as u}from"./dist-PQ5KMVDh.js";import{t as d}from"./compiler-runtime-BfE3aGVn.js";import{a as f,c as p,l as m,s as h}from"./terminal-input-events-C5UuEsAB.js";import{s as g,t as _}from"./createLucideIcon-DAkhoPjT.js";import{t as v}from"./button-Gol9BgNB.js";import{i as y,n as b,t as x}from"./tooltip-B4J7VHmA.js";import{n as S,r as C,t as w}from"./collapsible-B1mS1n9y.js";import{a as T,c as E,i as D,n as O,o as k,r as A,s as j,t as M}from"./dialog-TkFkuYVg.js";import{t as N}from"./checkbox-DY-vIhnZ.js";import{m as P,r as F,t as I}from"./dropdown-menu-xw8WTdb-.js";import{t as L}from"./label-DyipnO5I.js";import{a as R,i as z,n as B,o as V,r as H,t as U}from"./switch-DYic2V-1.js";import{i as W,n as G,r as ee,t as te}from"./radio-group-CGEdWasQ.js";import{t as K}from"./separator-DExEeoYE.js";import{n as q,t as ne}from"./toggle-group-CjXmmTGy.js";import{C as J,a as Y,b as re,c as ie,d as ae,f as oe,h as se,l as ce,n as le,o as ue,r as de,s as fe,t as pe,u as me,y as he}from"./agent-visibility-CkDoRkF-.js";import{i as ge}from"./terminal-telemetry-KTY5c5qk.js";import{$a as _e,Ba as ve,Bt as ye,Da as be,I as xe,Ia as Se,L as Ce,Lt as we,Na as Te,Oa as Ee,Qa as De,Ra as Oe,S as ke,Ta as Ae,Ua as je,Va as Me,Vt as Ne,Wa as Pe,Xa as Fe,Za as Ie,_r as Le,b as Re,ht as ze,nt as Be,oi as Ve,qa as He,ui as Ue,yt as We}from"./dist-CYN1QNvi.js";import{a as Ge,c as Ke,d as qe,s as Je,t as Ye}from"./EnableSyncConfirmDialog-CTsdvp_5.js";import{t as Xe}from"./arrow-up-right-obRIg3Sv.js";import{t as Ze}from"./RegisteredAgentIcon-C2dU04N7.js";import{t as Qe}from"./check-GqWaoTdV.js";import{t as $e}from"./chevron-right-C8oTR6gu.js";import{i as et}from"./prop-types-B-j2FcIV.js";import{C as tt,S as nt,b as rt,c as it,h as at,i as ot,l as st,o as ct,r as lt,t as ut,v as dt,y as ft}from"./skill-actions-BgdyM_G0.js";import{A as pt,F as mt,G as ht,I as gt,M as _t,N as vt,P as yt,S as bt,U as xt,V as St,_ as Ct,b as wt,c as Tt,d as Et,f as Dt,g as Ot,h as kt,i as At,k as jt,l as Mt,m as Nt,n as Pt,o as Ft,p as It,u as Lt,x as Rt,y as zt,z as Bt}from"./auth-state-cache-EkXfX8vV.js";import{i as Vt,l as Ht,r as Ut,s as Wt}from"./workspace-paths-C4Wwi52h.js";import{t as Gt}from"./square-pen-C1vIlMAW.js";import{c as Kt,n as qt,t as Jt}from"./open-managed-artifact-tab-CG97eU0o.js";import{t as Yt}from"./info-yKMseklR.js";import{t as Xt}from"./loader-circle-Cg5SU7AZ.js";import{c as Zt,i as Qt}from"./field-DVIFAnvR.js";import{t as $t}from"./sliders-horizontal-34K0eDW2.js";import{t as en}from"./trash-2-BUuL4OCw.js";import{t as tn}from"./triangle-alert-Clgvyc7B.js";import{t as nn}from"./x-DVkpYo5d.js";import{n as X}from"./dist-BLAMau9Z.js";import{t as rn}from"./ConfigSharingInfoTooltip-DMbsfWD9.js";import{t as an}from"./input-D0ZW0Opq.js";import{c as on,d as sn,i as cn,l as ln,m as un,o as dn,s as fn}from"./use-settings-route-Ch_E9Uw0.js";import{t as pn}from"./parse-api-error-C_gwkKmG.js";import{i as mn}from"./documents-events-DUo-r8o3.js";import{o as hn}from"./doc-hash-BKfBCyjO.js";import{t as gn}from"./badge-Dba4cvJR.js";import"./config-provider-CvXAYjor.js";import{a as _n,c as vn,i as yn,l as bn,n as xn,o as Sn,s as Cn}from"./use-apply-config-color-theme-CpTf0ZSO.js";import{n as wn,r as Tn}from"./config-context-gd3BC-iY.js";import{t as En}from"./external-link-T4Nj1gcG.js";import{t as Dn}from"./use-workspace-JeP_ExdS.js";import{t as On}from"./lint-plugin-meta-J-wb-uxW.js";import{t as kn}from"./skeleton-BG12Hmzn.js";import{d as An,n as jn,r as Mn,t as Nn,u as Pn}from"./lint-config-client-bcseyVIk.js";import{a as Fn,d as In,f as Ln,i as Rn,l as zn,m as Bn,o as Vn,p as Hn,s as Un,t as Wn,u as Gn}from"./sortable.esm-C565D25d.js";import{t as Kn}from"./textarea-tdCJViKf.js";import{a as qn,f as Jn,i as Yn,n as Xn,o as Zn,p as Qn,r as $n,s as er,t as tr}from"./form-coxG-8Qw.js";import{t as nr}from"./tag-pill-input-opUlyN8Z.js";import{t as rr}from"./markdownlint-rule-browser-BfLXlhbg.js";import{i as ir,n as ar}from"./schema-fields-view-intent-D_s-Cynn.js";import{n as or,t as sr}from"./use-terminal-enabled-DLUyAvNx.js";var cr=_(`wifi-off`,[[`path`,{d:`M12 20h.01`,key:`zekei9`}],[`path`,{d:`M8.5 16.429a5 5 0 0 1 7 0`,key:`1bycff`}],[`path`,{d:`M5 12.859a10 10 0 0 1 5.17-2.69`,key:`1dl1wf`}],[`path`,{d:`M19 12.859a10 10 0 0 0-2.007-1.523`,key:`4k23kn`}],[`path`,{d:`M2 8.82a15 15 0 0 1 4.177-2.643`,key:`1grhjp`}],[`path`,{d:`M22 8.82a15 15 0 0 0-11.288-3.764`,key:`z3jwby`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]),Z=d(),Q=e(o(),1),$=n(),lr=`settings-sharing-title`;function ur(){let e=(0,Z.c)(1),t=(typeof window<`u`?window.okDesktop:void 0)?.sharing,n;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=t===void 0?(0,$.jsx)(dr,{}):(0,$.jsx)(fr,{}),e[0]=n):n=e[0],n}function dr(){let e=(0,Z.c)(2),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsx)(`h3`,{id:lr,className:`text-base font-semibold`,children:(0,$.jsx)(s,{id:`cs4mps`})}),e[0]=t):t=e[0];let n;return e[1]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,$.jsx)(`section`,{"aria-labelledby":lr,className:`space-y-3`,children:(0,$.jsxs)(`div`,{className:`space-y-1`,children:[t,(0,$.jsx)(`p`,{className:`text-1sm text-muted-foreground`,children:(0,$.jsx)(s,{id:`7YRrJ9`,components:{0:(0,$.jsx)(`code`,{}),1:(0,$.jsx)(`code`,{}),2:(0,$.jsx)(`code`,{})}})})]})}),e[1]=n):n=e[1],n}function fr(){let e=(0,Z.c)(39),{_:t}=c(),[n,r]=(0,Q.useState)(null),[i,a]=(0,Q.useState)(!1),[o,l]=(0,Q.useState)(null),u;e[0]===t?u=e[1]:(u=async function(){let e=window.okDesktop?.sharing;if(e)try{r(await e.status())}catch(e){let n=e;X.error(n instanceof Error?n.message:t({id:`K0N7zS`})),r(mr)}},e[0]=t,e[1]=u);let d=u,f;e[2]===d?f=e[3]:(f=()=>{d()},e[2]=d,e[3]=f);let p;e[4]===Symbol.for(`react.memo_cache_sentinel`)?(p=[],e[4]=p):p=e[4],(0,Q.useEffect)(f,p);let m;e[5]!==t||e[6]!==i||e[7]!==d||e[8]!==n?(m=async function(e){let r=window.okDesktop?.sharing;if(!r||n===null||i||n.mode===e)return;a(!0),l(null);let o=null,s=null;try{o=await r.setMode(e)}catch(e){s=e}if(a(!1),s!==null){X.error(s instanceof Error?s.message:t({id:`qZv5ZR`}));return}o!==null&&(o.kind===`refused-tracked`?(l({tracked:o.tracked,remediation:o.remediation}),X.error(t({id:`z2JdQ-`}),{duration:5e3})):o.kind===`no-exclude`?X.warning(o.reason===`no-git`?t({id:`YSFv5w`}):t({id:`8cS0nH`,values:{0:o.reason}})):X.success(t(e===`local-only`?{id:`VvS_k_`}:{id:`k_pade`})),await d())},e[5]=t,e[6]=i,e[7]=d,e[8]=n,e[9]=m):m=e[9];let h=m,g;e[10]!==t||e[11]!==i||e[12]!==d||e[13]!==n?(g=async function(){let e=window.okDesktop?.sharing;if(!e||n===null||i)return;a(!0);let r=null,o=null;try{r=await e.setSkillsShared(!1)}catch(e){o=e}if(a(!1),o!==null){X.error(o instanceof Error?o.message:t({id:`onTlRk`}));return}if(r!==null){if(r.kind===`no-exclude`){let e=r.reason===`no-git`?t({id:`Xwump4`}):r.reason===`inaccessible`?t({id:`PlGC6r`}):t({id:`zcmYx4`});X.warning(t({id:`4h3e0H`,values:{detail:e}}));return}X.success(t({id:`pQf2Ux`})),await d()}},e[10]=t,e[11]=i,e[12]=d,e[13]=n,e[14]=g):g=e[14];let _=g;if(n===null){let t;return e[15]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsxs)(`section`,{"aria-labelledby":lr,className:`space-y-3`,children:[(0,$.jsx)(`h3`,{id:lr,className:`text-base font-semibold`,children:(0,$.jsx)(s,{id:`cs4mps`})}),(0,$.jsx)(kn,{className:`h-24`})]}),e[15]=t):t=e[15],t}let y=n.mode===`no-git`,b;e[16]===Symbol.for(`react.memo_cache_sentinel`)?(b=(0,$.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,$.jsx)(`h3`,{id:lr,className:`text-base font-semibold`,children:(0,$.jsx)(s,{id:`cs4mps`})}),(0,$.jsx)(rn,{})]}),e[16]=b):b=e[16];let x;e[17]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,$.jsxs)(`div`,{className:`space-y-1`,children:[b,(0,$.jsx)(`p`,{className:`text-1sm text-muted-foreground`,children:(0,$.jsx)(s,{id:`N55YNr`})})]}),e[17]=x):x=e[17];let S;e[18]!==i||e[19]!==y||e[20]!==h||e[21]!==n.mode?(S=y?(0,$.jsx)(`p`,{className:`rounded-md border border-amber-300 bg-amber-50 px-3 py-2 text-sm text-amber-900 dark:border-amber-700 dark:bg-amber-950 dark:text-amber-200`,role:`status`,"data-testid":`settings-sharing-no-git`,children:(0,$.jsx)(s,{id:`ju38ms`})}):(0,$.jsxs)(te,{value:n.mode,onValueChange:e=>void h(e),disabled:i,className:`gap-2`,"aria-labelledby":lr,"data-testid":`settings-sharing-radiogroup`,children:[(0,$.jsxs)(`label`,{htmlFor:`settings-sharing-shared`,className:`flex items-start gap-2 text-sm`,children:[(0,$.jsx)(G,{id:`settings-sharing-shared`,value:`shared`,"data-testid":`settings-sharing-shared`,className:`mt-1`}),(0,$.jsxs)(`span`,{children:[(0,$.jsx)(`span`,{className:`font-medium`,children:(0,$.jsx)(s,{id:`0Gd0NU`})}),(0,$.jsx)(`span`,{className:`block text-1sm text-muted-foreground`,children:(0,$.jsx)(s,{id:`dJw2_7`})})]})]}),(0,$.jsxs)(`label`,{htmlFor:`settings-sharing-local-only`,className:`flex items-start gap-2 text-sm`,children:[(0,$.jsx)(G,{id:`settings-sharing-local-only`,value:`local-only`,"data-testid":`settings-sharing-local-only`,className:`mt-1`}),(0,$.jsxs)(`span`,{children:[(0,$.jsx)(`span`,{className:`font-medium`,children:(0,$.jsx)(s,{id:`OgyJSr`})}),(0,$.jsx)(`span`,{className:`block text-1sm text-muted-foreground`,children:(0,$.jsx)(s,{id:`cZ_8zB`})})]})]})]}),e[18]=i,e[19]=y,e[20]=h,e[21]=n.mode,e[22]=S):S=e[22];let C;e[23]!==i||e[24]!==_||e[25]!==n.mode||e[26]!==n.skillsShared?(C=n.mode===`local-only`&&n.skillsShared?(0,$.jsxs)(`div`,{className:`flex items-start justify-between gap-2 rounded-md border border-muted-foreground/30 bg-muted/40 p-3 text-sm`,"data-testid":`settings-sharing-skills-exception`,children:[(0,$.jsxs)(`span`,{children:[(0,$.jsx)(`span`,{className:`font-medium`,children:(0,$.jsx)(s,{id:`Kiytqd`})}),(0,$.jsx)(`span`,{className:`block text-1sm text-muted-foreground`,children:(0,$.jsx)(s,{id:`K0FgsP`})})]}),(0,$.jsx)(v,{variant:`outline`,size:`sm`,disabled:i,onClick:()=>void _(),children:(0,$.jsx)(s,{id:`9uI_rE`})})]}):null,e[23]=i,e[24]=_,e[25]=n.mode,e[26]=n.skillsShared,e[27]=C):C=e[27];let w;e[28]===o?w=e[29]:(w=o===null?null:(0,$.jsxs)(`div`,{className:`space-y-2 rounded-md border border-destructive bg-destructive/10 p-3 text-sm`,role:`alert`,"data-testid":`settings-sharing-refusal`,children:[(0,$.jsx)(`p`,{className:`font-semibold`,children:(0,$.jsx)(s,{id:`Kgdbkt`})}),(0,$.jsx)(`pre`,{className:`whitespace-pre-wrap font-mono text-xs leading-relaxed`,children:o.remediation}),(0,$.jsx)(v,{variant:`outline`,size:`sm`,onClick:()=>l(null),children:(0,$.jsx)(s,{id:`1QfxQT`})})]}),e[28]=o,e[29]=w);let T;e[30]!==o||e[31]!==n.mode||e[32]!==n.trackedUpstream?(T=n.trackedUpstream.length>0&&n.mode!==`no-git`&&o===null?(0,$.jsxs)(`div`,{className:`space-y-1 rounded-md border border-muted-foreground/30 bg-muted/40 p-3 text-sm`,"data-testid":`settings-sharing-tracked-info`,children:[(0,$.jsx)(`p`,{className:`font-medium`,children:(0,$.jsx)(s,{id:`LhWYpm`})}),(0,$.jsx)(`ul`,{className:`list-disc pl-5 font-mono text-xs text-muted-foreground`,children:n.trackedUpstream.map(pr)}),(0,$.jsx)(`p`,{className:`text-1sm text-muted-foreground`,children:(0,$.jsx)(s,{id:`1XSMhZ`,components:{0:(0,$.jsx)(`code`,{}),1:(0,$.jsx)(`code`,{})}})})]}):null,e[30]=o,e[31]=n.mode,e[32]=n.trackedUpstream,e[33]=T):T=e[33];let E;return e[34]!==T||e[35]!==S||e[36]!==C||e[37]!==w?(E=(0,$.jsxs)(`section`,{"aria-labelledby":lr,className:`space-y-4`,"data-testid":`settings-sharing`,children:[x,S,C,w,T]}),e[34]=T,e[35]=S,e[36]=C,e[37]=w,e[38]=E):E=e[38],E}function pr(e){return(0,$.jsx)(`li`,{children:e},e)}function mr(e){return e??{kind:`status`,mode:`no-git`,excluded:[],trackedUpstream:[],skillsShared:!1}}function hr(e){let t=(0,Z.c)(35),{authQueryTransport:n,authTransport:r}=e,{_:i}=c(),a;t[0]===n?a=t[1]:(a=n??Bt(),t[0]=n,t[1]=a);let o=a,l;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(l={phase:`loading`},t[2]=l):l=t[2];let[u,d]=(0,Q.useState)(l),[f,p]=(0,Q.useState)(!1),[m,h]=(0,Q.useState)(!1),[g,_]=(0,Q.useState)(null),y=(0,Q.useRef)(!1),b;t[3]===o?b=t[4]:(b=async function(){d({phase:`loading`});try{let e=await o.status();d({phase:`loaded`,result:e}),Pt(e.authenticated)}catch(e){console.warn(`[AccountSection] GitHub status check failed`,e),d({phase:`check-failed`})}},t[3]=o,t[4]=b);let x=b,S;t[5]===x?S=t[6]:(S=()=>{x()},t[5]=x,t[6]=S);let C;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(C=[],t[7]=C):C=t[7],(0,Q.useEffect)(S,C);let w;t[8]!==i||t[9]!==x||t[10]!==o?(w=async function(){if(y.current)return;y.current=!0,p(!1),h(!0),_(null);let e=null;try{let t=o.signout?await o.signout():{ok:!1,error:i({id:`8cpOa8`})};t.ok||(e=t.error??i({id:`8cpOa8`}))}catch(t){console.warn(`[AccountSection] GitHub disconnect failed`,t),e=i({id:`8cpOa8`})}await x(),e&&_(e),h(!1),y.current=!1},t[8]=i,t[9]=x,t[10]=o,t[11]=w):w=t[11];let T=w,E;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(E=(0,$.jsx)(`h3`,{id:`settings-account-title`,className:`text-base font-semibold`,children:(0,$.jsx)(s,{id:`AeXO77`})}),t[12]=E):E=t[12];let D;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(D=(0,$.jsxs)(`div`,{className:`space-y-1`,children:[E,(0,$.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:(0,$.jsx)(s,{id:`E6lrpp`})})]}),t[13]=D):D=t[13];let O;t[14]!==g||t[15]!==m||t[16]!==T||t[17]!==x||t[18]!==u.phase||t[19]!==u.result?(O=u.phase===`loading`?(0,$.jsxs)(`div`,{role:`status`,"aria-live":`polite`,"aria-busy":`true`,className:`space-y-2 rounded-md border p-3`,"data-testid":`settings-account-loading`,children:[(0,$.jsx)(`span`,{className:`sr-only`,children:(0,$.jsx)(s,{id:`IWGfGF`})}),(0,$.jsx)(kn,{className:`h-4 w-40`}),(0,$.jsx)(kn,{className:`h-8 w-32`})]}):u.phase===`check-failed`?(0,$.jsxs)(`div`,{className:`space-y-2 rounded-md border p-3`,"data-testid":`settings-account-check-failed`,children:[(0,$.jsx)(`p`,{role:`status`,className:`text-sm text-muted-foreground`,children:(0,$.jsx)(s,{id:`T_wG4n`})}),(0,$.jsx)(v,{variant:`outline`,size:`sm`,onClick:()=>void x(),children:(0,$.jsx)(s,{id:`KDw4GX`})})]}):u.result.authenticated?u.result.tier===`A`?(0,$.jsx)(_r,{login:u.result.login}):(0,$.jsx)(gr,{login:u.result.login,disconnecting:m,error:g,onDisconnect:()=>void T()}):(0,$.jsx)(vr,{onConnect:()=>p(!0)}),t[14]=g,t[15]=m,t[16]=T,t[17]=x,t[18]=u.phase,t[19]=u.result,t[20]=O):O=t[20];let k;t[21]===x?k=t[22]:(k=e=>{p(e),e||x()},t[21]=x,t[22]=k);let A=u.phase===`loaded`?u.result.host:void 0,j=u.phase===`loaded`?u.result.ghAvailable:void 0,M;t[23]===x?M=t[24]:(M=()=>{x()},t[23]=x,t[24]=M);let N;t[25]!==f||t[26]!==r||t[27]!==k||t[28]!==A||t[29]!==j||t[30]!==M?(N=(0,$.jsx)(gt,{open:f,onOpenChange:k,transport:r,host:A,ghAvailable:j,onSuccess:M}),t[25]=f,t[26]=r,t[27]=k,t[28]=A,t[29]=j,t[30]=M,t[31]=N):N=t[31];let P;return t[32]!==N||t[33]!==O?(P=(0,$.jsxs)(`section`,{"aria-labelledby":`settings-account-title`,className:`space-y-3`,"data-testid":`settings-account`,children:[D,O,N]}),t[32]=N,t[33]=O,t[34]=P):P=t[34],P}function gr(e){let t=(0,Z.c)(20),{login:n,disconnecting:r,error:i,onDisconnect:a}=e,o;t[0]===n?o=t[1]:(o=(0,$.jsx)(`div`,{className:`text-sm font-medium`,children:(0,$.jsx)(s,{id:`E_tNGD`,values:{login:n}})}),t[0]=n,t[1]=o);let c;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,$.jsx)(`p`,{className:`text-muted-foreground text-1sm`,children:(0,$.jsx)(s,{id:`nxlOpL`})}),t[2]=c):c=t[2];let l;t[3]===o?l=t[4]:(l=(0,$.jsxs)(`div`,{className:`min-w-0`,children:[o,c]}),t[3]=o,t[4]=l);let u;t[5]===r?u=t[6]:(u=r?(0,$.jsx)(s,{id:`rppgXF`}):(0,$.jsx)(s,{id:`-K0AvT`}),t[5]=r,t[6]=u);let d;t[7]!==r||t[8]!==a||t[9]!==u?(d=(0,$.jsx)(v,{variant:`outline`,onClick:a,disabled:r,"aria-describedby":`settings-account-disconnect-caveat`,"data-testid":`settings-account-disconnect`,children:u}),t[7]=r,t[8]=a,t[9]=u,t[10]=d):d=t[10];let f;t[11]!==l||t[12]!==d?(f=(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[l,d]}),t[11]=l,t[12]=d,t[13]=f):f=t[13];let p;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,$.jsx)(`p`,{id:`settings-account-disconnect-caveat`,className:`text-muted-foreground text-1sm`,"data-testid":`settings-account-disconnect-caveat`,children:(0,$.jsx)(s,{id:`msOK6I`})}),t[14]=p):p=t[14];let m;t[15]===i?m=t[16]:(m=i?(0,$.jsx)(`p`,{role:`alert`,className:`text-sm text-destructive`,"data-testid":`settings-account-disconnect-error`,children:i}):null,t[15]=i,t[16]=m);let h;return t[17]!==f||t[18]!==m?(h=(0,$.jsxs)(`div`,{className:`space-y-2 rounded-md border p-3`,"data-testid":`settings-account-connected`,children:[f,p,m]}),t[17]=f,t[18]=m,t[19]=h):h=t[19],h}function _r(e){let t=(0,Z.c)(5),{login:n}=e,r;t[0]===n?r=t[1]:(r=(0,$.jsx)(`div`,{className:`text-sm font-medium`,children:(0,$.jsx)(s,{id:`E_tNGD`,values:{login:n}})}),t[0]=n,t[1]=r);let i;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,$.jsx)(`p`,{className:`text-muted-foreground text-1sm`,children:(0,$.jsx)(s,{id:`ny6vNn`})}),t[2]=i):i=t[2];let a;return t[3]===r?a=t[4]:(a=(0,$.jsx)(`div`,{className:`rounded-md border p-3`,"data-testid":`settings-account-gh-cli`,children:(0,$.jsxs)(`div`,{className:`min-w-0 space-y-1`,children:[r,i]})}),t[3]=r,t[4]=a),a}function vr(e){let t=(0,Z.c)(5),{onConnect:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,$.jsx)(`div`,{className:`text-sm font-medium`,children:(0,$.jsx)(s,{id:`S33tz3`})}),t[0]=r):r=t[0];let i;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,$.jsxs)(`div`,{className:`min-w-0`,children:[r,(0,$.jsx)(`p`,{className:`text-muted-foreground text-1sm`,children:(0,$.jsx)(s,{id:`EJuO7B`})})]}),t[1]=i):i=t[1];let a;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,$.jsx)(s,{id:`5lWFkC`}),t[2]=a):a=t[2];let o;return t[3]===n?o=t[4]:(o=(0,$.jsx)(`div`,{className:`rounded-md border p-3`,"data-testid":`settings-account-disconnected`,children:(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[i,(0,$.jsx)(v,{onClick:n,"data-testid":`settings-account-connect`,children:a})]})}),t[3]=n,t[4]=o),o}function yr(e){return e.kind===`editor`?`editor:${e.id}`:e.kind===`skill`?`skill:${e.id}`:`path`}function br(e){let t=(0,Z.c)(11),{testId:n,children:r}=e,{_:i}=c(),a;t[0]===i?a=t[1]:(a=i({id:`2B6eYX`}),t[0]=i,t[1]=a);let o;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,$.jsx)(Yt,{className:`size-3.5`}),t[2]=o):o=t[2];let s;t[3]!==a||t[4]!==n?(s=(0,$.jsx)(y,{asChild:!0,children:(0,$.jsx)(v,{variant:`ghost`,size:`icon`,className:`mt-1.5 mr-1.5 h-6 w-6 shrink-0 text-muted-foreground opacity-60 hover:opacity-100`,"aria-label":a,"data-testid":n,children:o})}),t[3]=a,t[4]=n,t[5]=s):s=t[5];let l;t[6]===r?l=t[7]:(l=(0,$.jsx)(b,{side:`left`,className:`max-w-sm text-left`,children:(0,$.jsx)(`div`,{className:`flex min-w-0 flex-col gap-1`,children:r})}),t[6]=r,t[7]=l);let u;return t[8]!==s||t[9]!==l?(u=(0,$.jsxs)(x,{children:[s,l]}),t[8]=s,t[9]=l,t[10]=u):u=t[10],u}function xr(){let e=(0,Z.c)(38),{_:t}=c(),n=typeof window<`u`?window.okDesktop??null:null,[r,i]=(0,Q.useState)(null),[a,o]=(0,Q.useState)(!1),[l,u]=(0,Q.useState)(null),d,f;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(d=()=>{if(!n)return;let e=!1;return n.integrations.status().then(t=>{e||i(t)}).catch(()=>{e||o(!0)}),()=>{e=!0}},f=[n],e[0]=d,e[1]=f):(d=e[0],f=e[1]),(0,Q.useEffect)(d,f);let p;e[2]===t?p=e[3]:(p=async function(e,r){if(n){u(yr(e));try{let t=await n.integrations.setComponent({component:e,enabled:r});i(t.status),t.ok||X.error(t.error)}catch(e){let n=e;X.error(t({id:`gfdqcY`,values:{0:n instanceof Error?n.message:String(n)}}))}u(null)}},e[2]=t,e[3]=p);let m=p,h;e[4]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,$.jsx)(`h3`,{id:`settings-ai-tools-title`,className:`text-base font-semibold`,children:(0,$.jsx)(s,{id:`_5qBNl`})}),e[4]=h):h=e[4];let g;e[5]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,$.jsxs)(`div`,{className:`space-y-1`,children:[h,(0,$.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:(0,$.jsx)(s,{id:`mLAjyL`})})]}),e[5]=g):g=e[5];let _=g;if(!n||a){let t;return e[6]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsxs)(`section`,{"aria-labelledby":`settings-ai-tools-title`,className:`space-y-4`,children:[_,(0,$.jsx)(`p`,{className:`text-sm text-muted-foreground`,"data-testid":`ai-tools-unavailable`,children:(0,$.jsx)(s,{id:`O4PnDd`})})]}),e[6]=t):t=e[6],t}if(r===null){let t;return e[7]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsxs)(`section`,{"aria-labelledby":`settings-ai-tools-title`,className:`space-y-4`,children:[_,(0,$.jsxs)(`div`,{className:`space-y-2`,"data-testid":`ai-tools-loading`,children:[(0,$.jsx)(kn,{className:`h-10 w-full`}),(0,$.jsx)(kn,{className:`h-10 w-full`}),(0,$.jsx)(kn,{className:`h-10 w-full`})]})]}),e[7]=t):t=e[7],t}let v=l!==null||!r.available,y=r.path.shellDetected||r.path.installed,b;e[8]===r.available?b=e[9]:(b=!r.available&&(0,$.jsx)(`p`,{className:`text-sm text-amber-600 dark:text-amber-400`,"data-testid":`ai-tools-read-only`,children:(0,$.jsx)(s,{id:`OplnBG`})}),e[8]=r.available,e[9]=b);let x;e[10]!==t||e[11]!==m||e[12]!==v||e[13]!==y||e[14]!==r.path.installed||e[15]!==r.path.rcFilesToTouch?(x=y&&(0,$.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,$.jsx)(`span`,{className:`text-xs font-medium text-muted-foreground`,children:(0,$.jsx)(s,{id:`ALhMYW`})}),(0,$.jsxs)(`div`,{className:`flex items-start overflow-hidden rounded-md border border-border bg-card/50 hover:bg-accent`,children:[(0,$.jsxs)(L,{htmlFor:`ai-tools-path`,className:`flex flex-1 cursor-pointer items-start gap-2.5 px-3 py-2.5 font-normal`,children:[(0,$.jsx)(N,{id:`ai-tools-path`,checked:r.path.installed,disabled:v,onCheckedChange:()=>void m({kind:`path`},!r.path.installed),className:`mt-0.5`,"data-testid":`ai-tools-path-checkbox`}),(0,$.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col gap-0.5`,children:[(0,$.jsx)(`span`,{className:`text-sm font-medium text-foreground`,children:(0,$.jsx)(s,{id:`Fsx78O`,components:{0:(0,$.jsx)(`code`,{className:`inline-code`})}})}),(0,$.jsx)(`span`,{className:`text-xs text-muted-foreground`,"data-testid":`ai-tools-path-status`,children:r.path.installed?t({id:`yhdqox`}):t({id:`04XyCH`,values:{0:r.path.rcFilesToTouch.join(`, `)}})})]})]}),(0,$.jsxs)(br,{testId:`ai-tools-path-info`,children:[(0,$.jsx)(`p`,{className:`opacity-70`,children:(0,$.jsx)(s,{id:`f9lQNJ`})}),r.path.rcFilesToTouch.map(Cr),(0,$.jsx)(`p`,{className:`pt-1`,children:(0,$.jsx)(s,{id:`CWzc2T`,components:{0:(0,$.jsx)(`code`,{}),1:(0,$.jsx)(`code`,{})}})})]})]})]}),e[10]=t,e[11]=m,e[12]=v,e[13]=y,e[14]=r.path.installed,e[15]=r.path.rcFilesToTouch,e[16]=x):x=e[16];let S;e[17]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,$.jsx)(`span`,{className:`text-xs font-medium text-muted-foreground`,children:(0,$.jsx)(s,{id:`psfGPX`})}),e[17]=S):S=e[17];let C;if(e[18]!==t||e[19]!==m||e[20]!==v||e[21]!==r.editors){let n;e[23]!==t||e[24]!==m||e[25]!==v?(n=e=>{let n=e.state===`installed`||e.state===`foreign`,r=v||e.state===`unmanageable`,i=e.state===`not-installed`&&!e.detected,a=`https://openknowledge.ai/docs/integrations/${Ce[e.id]}`,o=e.state===`installed`?t({id:`eQkgKV`}):e.state===`foreign`?t({id:`AczYxH`}):e.state===`unmanageable`?t({id:`LbmLyU`}):e.detected?t({id:`bBE5tC`}):null,c=e.state===`foreign`||e.state===`unmanageable`?`text-xs text-amber-600 dark:text-amber-400`:`text-xs text-muted-foreground`;return(0,$.jsxs)(`li`,{className:r?`flex items-start`:`flex items-start hover:bg-accent`,children:[(0,$.jsxs)(L,{htmlFor:`ai-tools-editor-${e.id}`,className:r?`flex flex-1 items-start gap-2.5 px-3 py-2.5 font-normal`:`flex flex-1 cursor-pointer items-start gap-2.5 px-3 py-2.5 font-normal`,children:[(0,$.jsx)(N,{id:`ai-tools-editor-${e.id}`,checked:n,disabled:r,onCheckedChange:()=>void m({kind:`editor`,id:e.id},!n),className:`mt-0.5`,"data-testid":`ai-tools-editor-checkbox-${e.id}`}),(0,$.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col gap-0.5`,children:[(0,$.jsx)(`span`,{className:`text-sm font-medium text-foreground`,children:e.label}),o!==null&&(0,$.jsx)(`span`,{className:c,"data-testid":`ai-tools-editor-status-${e.id}`,children:o})]})]}),i&&(0,$.jsxs)(`a`,{href:a,target:`_blank`,rel:`noopener noreferrer`,onClick:e=>En(e,a),onAuxClick:e=>En(e,a),"aria-label":t({id:`D-Oh1s`,values:{0:e.label}}),className:`flex shrink-0 items-center gap-0.5 px-2 py-2.5 text-xs text-muted-foreground underline-offset-2 hover:text-foreground hover:underline`,"data-testid":`ai-tools-editor-status-${e.id}`,children:[(0,$.jsx)(s,{id:`P_bX4O`}),(0,$.jsx)(Xe,{className:`size-3`,"aria-hidden":!0})]}),(0,$.jsxs)(br,{testId:`ai-tools-editor-info-${e.id}`,children:[(0,$.jsx)(`p`,{className:`opacity-70`,children:(0,$.jsx)(s,{id:`J2eKUI`})}),(0,$.jsx)(`p`,{children:(0,$.jsx)(`code`,{className:`break-all`,children:e.configPath??t({id:`ndwmea`})})}),(0,$.jsx)(`p`,{className:`pt-1 opacity-70`,children:(0,$.jsx)(s,{id:`VIwCaD`})}),(0,$.jsx)(`p`,{children:(0,$.jsx)(`code`,{className:`break-all`,children:e.entryLocator})})]})]},e.id)},e[23]=t,e[24]=m,e[25]=v,e[26]=n):n=e[26],C=r.editors.map(n),e[18]=t,e[19]=m,e[20]=v,e[21]=r.editors,e[22]=C}else C=e[22];let w;e[27]===C?w=e[28]:(w=(0,$.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[S,(0,$.jsx)(`ul`,{className:`rounded-md border border-border bg-card/50 divide-y divide-border overflow-hidden`,children:C})]}),e[27]=C,e[28]=w);let T;e[29]!==m||e[30]!==v||e[31]!==r.skills?(T=r.skills.length>0&&(0,$.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,$.jsx)(`span`,{className:`text-xs font-medium text-muted-foreground`,children:(0,$.jsx)(s,{id:`28B21t`})}),(0,$.jsx)(`ul`,{className:`rounded-md border border-border bg-card/50 divide-y divide-border overflow-hidden`,children:r.skills.map(e=>(0,$.jsxs)(`li`,{className:`flex items-start hover:bg-accent`,children:[(0,$.jsxs)(L,{htmlFor:`ai-tools-skill-${e.id}`,className:`flex flex-1 cursor-pointer items-start gap-2.5 px-3 py-2.5 font-normal`,children:[(0,$.jsx)(N,{id:`ai-tools-skill-${e.id}`,checked:e.installed,disabled:v,onCheckedChange:()=>void m({kind:`skill`,id:e.id},!e.installed),className:`mt-0.5`,"data-testid":`ai-tools-skill-checkbox-${e.id}`}),(0,$.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col gap-0.5`,children:[(0,$.jsx)(`span`,{className:`text-sm font-medium text-foreground`,children:(0,$.jsx)(`code`,{children:e.name})}),(0,$.jsx)(`span`,{className:`text-xs text-muted-foreground`,"data-testid":`ai-tools-skill-status-${e.id}`,children:e.id===`discovery`?(0,$.jsx)(s,{id:`0inVGS`}):(0,$.jsx)(s,{id:`FXk_zY`})})]})]}),(0,$.jsxs)(br,{testId:`ai-tools-skill-info-${e.id}`,children:[(0,$.jsx)(`p`,{className:`opacity-70`,children:(0,$.jsx)(s,{id:`HSh8u_`})}),e.paths.map(Sr)]})]},e.id))})]}),e[29]=m,e[30]=v,e[31]=r.skills,e[32]=T):T=e[32];let E;return e[33]!==T||e[34]!==b||e[35]!==x||e[36]!==w?(E=(0,$.jsxs)(`section`,{"aria-labelledby":`settings-ai-tools-title`,className:`space-y-4`,children:[_,b,x,w,T]}),e[33]=T,e[34]=b,e[35]=x,e[36]=w,e[37]=E):E=e[37],E}function Sr(e){return(0,$.jsx)(`p`,{children:(0,$.jsx)(`code`,{className:`break-all`,children:e})},e)}function Cr(e){return(0,$.jsx)(`p`,{children:(0,$.jsx)(`code`,{className:`break-all`,children:e})},e)}function wr(e){return{chrome:e.sidebar,surface:e.background,bar:e.primary,line:e.border,dots:[e[`syntax-string`],e[`syntax-keyword`],e[`syntax-atom`]]}}function Tr(e,t,n){return e.id===`custom`?wr(ve(Cn(bn(t)))):e.base?wr(ve(e.base)):wr(Sn(n))}function Er(e){let t=(0,Z.c)(36),{theme:n,customSeed:r,defaultMode:i}=e,a,o,s,c,l,u,d,f,p;t[0]!==r||t[1]!==i||t[2]!==n?(a=Tr(n,r,i),u=!0,d=`aspect-[4/3] w-full overflow-hidden rounded-md border`,f={backgroundColor:a.surface,borderColor:a.line},p=(0,$.jsxs)(`div`,{className:`flex h-1/3 items-center gap-1 px-1.5`,style:{backgroundColor:a.chrome,borderBottom:`1px solid ${a.line}`},children:[(0,$.jsx)(`span`,{className:`h-1.5 w-5 rounded-full`,style:{backgroundColor:a.bar}}),(0,$.jsx)(`span`,{className:`h-1.5 flex-1 rounded-full opacity-50`,style:{backgroundColor:a.line}})]}),l=`flex h-2/3`,o=`flex w-1/4 flex-col items-center justify-center gap-1`,s={backgroundColor:a.chrome,borderRight:`1px solid ${a.line}`},c=a.dots.map(Dr),t[0]=r,t[1]=i,t[2]=n,t[3]=a,t[4]=o,t[5]=s,t[6]=c,t[7]=l,t[8]=u,t[9]=d,t[10]=f,t[11]=p):(a=t[3],o=t[4],s=t[5],c=t[6],l=t[7],u=t[8],d=t[9],f=t[10],p=t[11]);let m;t[12]!==o||t[13]!==s||t[14]!==c?(m=(0,$.jsx)(`div`,{className:o,style:s,children:c}),t[12]=o,t[13]=s,t[14]=c,t[15]=m):m=t[15];let h;t[16]===a.dots[1]?h=t[17]:(h=(0,$.jsx)(`span`,{className:`h-1.5 w-3/4 rounded-full`,style:{backgroundColor:a.dots[1]}}),t[16]=a.dots[1],t[17]=h);let g;t[18]===a.line?g=t[19]:(g=(0,$.jsx)(`span`,{className:`h-1.5 w-1/2 rounded-full opacity-60`,style:{backgroundColor:a.line}}),t[18]=a.line,t[19]=g);let _;t[20]===a.dots[0]?_=t[21]:(_=(0,$.jsx)(`span`,{className:`h-1.5 w-2/3 rounded-full`,style:{backgroundColor:a.dots[0]}}),t[20]=a.dots[0],t[21]=_);let v;t[22]!==h||t[23]!==g||t[24]!==_?(v=(0,$.jsxs)(`div`,{className:`flex flex-1 flex-col justify-center gap-1 px-1.5`,children:[h,g,_]}),t[22]=h,t[23]=g,t[24]=_,t[25]=v):v=t[25];let y;t[26]!==v||t[27]!==l||t[28]!==m?(y=(0,$.jsxs)(`div`,{className:l,children:[m,v]}),t[26]=v,t[27]=l,t[28]=m,t[29]=y):y=t[29];let b;return t[30]!==y||t[31]!==u||t[32]!==d||t[33]!==f||t[34]!==p?(b=(0,$.jsxs)(`div`,{"aria-hidden":u,className:d,style:f,children:[p,y]}),t[30]=y,t[31]=u,t[32]=d,t[33]=f,t[34]=p,t[35]=b):b=t[35],b}function Dr(e,t){return(0,$.jsx)(`span`,{className:`size-1.5 rounded-full`,style:{backgroundColor:e}},t)}function Or(e){let t=(0,Z.c)(11),{value:n,onSelect:r,customSeed:i,defaultMode:a,id:o,"aria-label":s,"aria-describedby":l}=e,u=a===void 0?`light`:a,{_:d}=c(),f=Te.some(e=>e.id===n)?n:`default`,p;t[0]!==d||t[1]!==i||t[2]!==u?(p=Te.map(e=>(0,$.jsxs)(ee,{value:e.id,className:g(`group/tile flex flex-col gap-1.5 rounded-lg border-2 border-transparent p-1 text-left outline-none`,`hover:bg-accent/50 focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring/40`,`data-checked:border-primary`),children:[(0,$.jsx)(Er,{theme:e,customSeed:i,defaultMode:u}),(0,$.jsxs)(`div`,{className:`flex items-center justify-between px-0.5`,children:[(0,$.jsx)(`span`,{className:`text-1sm font-medium text-foreground`,children:e.label}),(0,$.jsx)(`span`,{className:`text-[10px] font-medium uppercase tracking-wide text-muted-foreground`,children:e.id===`custom`?_n(bn(i))===`dark`?d({id:`pvnfJD`}):d({id:`1njn7W`}):e.kind===`system`?d({id:`R9Khdg`}):e.kind===`light`?d({id:`1njn7W`}):d({id:`pvnfJD`})})]})]},e.id)),t[0]=d,t[1]=i,t[2]=u,t[3]=p):p=t[3];let m;return t[4]!==l||t[5]!==s||t[6]!==o||t[7]!==r||t[8]!==f||t[9]!==p?(m=(0,$.jsx)(W,{id:o,"aria-label":s,"aria-describedby":l,value:f,onValueChange:r,className:`grid w-full grid-cols-2 gap-2 sm:grid-cols-3`,children:p}),t[4]=l,t[5]=s,t[6]=o,t[7]=r,t[8]=f,t[9]=p,t[10]=m):m=t[10],m}function kr(e,t){if(e.length===0)throw Error(`buildPatch: path must be non-empty`);let[n,...r]=e;return r.length===0?{[String(n)]:t}:{[String(n)]:kr(r,t)}}function Ar(e){let t=e;for(let e=0;e<16;e++){if(t==null)return;let e=t?._zod?.def;if(e?.type===`default`){let t=e.defaultValue;return typeof t==`function`?t():t}let n=t?._zod?.def?.innerType;if(n===void 0)return;t=n}}function jr(e){let t=e;for(let e=0;e<16;e++){if(t==null)return;let e=t?._zod?.def;if(!e)return;if(e.type===`default`||e.type===`optional`||e.type===`nullable`){t=e.innerType;continue}return e.type}}function Mr(e){let t=e;for(let e=0;e<16;e++){if(t==null)return;let e=t?._zod?.def;if(!e)return;if(e.type===`enum`)return e.entries?Object.values(e.entries):void 0;if(e.innerType!==void 0){t=e.innerType;continue}return}}function Nr(e){if(!Pe(e)||e.code!==`SCHEMA_INVALID`)return null;let t=e.issues[0];return!t||t.path.length===0?null:t.path.map(String).join(`.`)}function Pr(){let e=(0,Z.c)(3),t,n;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsx)(kn,{className:`h-5 w-32`}),n=(0,$.jsx)(kn,{className:`h-4 w-64`}),e[0]=t,e[1]=n):(t=e[0],n=e[1]);let r;return e[2]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,$.jsxs)(`div`,{className:`space-y-3`,children:[t,n,(0,$.jsxs)(`div`,{className:`space-y-2`,children:[(0,$.jsx)(kn,{className:`h-9 w-full`}),(0,$.jsx)(kn,{className:`h-9 w-full`})]})]}),e[2]=r):r=e[2],r}function Fr({field:e,scope:t,commitField:n,isFlashed:r}){"use no memo";let{_:i}=c(),a=Qn(),o=De(Ae,e.path),l=o?jr(o):void 0,u=o?Ar(o):void 0,d=o?Mr(o):void 0,f=o?Me(o):void 0,p=f?.scope===`project`&&t!==`project`||f?.scope===`user`&&t!==`user`,m=e.path.join(`.`),h=i(e.label),[_,S]=(0,Q.useState)(!1),C=(0,Q.useRef)(null);(0,Q.useEffect)(()=>()=>{C.current&&clearTimeout(C.current)},[]);let w=()=>{S(!0),C.current&&clearTimeout(C.current),C.current=setTimeout(()=>S(!1),1200)},T=()=>{let e=n(m);return e&&w(),e},E=()=>a.getFieldState(m).isDirty?T():!0,D=()=>{let e=u===void 0?null:u;a.setValue(m,e,{shouldDirty:!1}),T()},O=g(`relative`,r&&`animate-settings-flash`);return(0,$.jsx)(Yn,{control:a.control,name:m,render:({field:n})=>{let r=!p&&(u!==void 0||n.value!==void 0);return(0,$.jsxs)(qn,{className:O,"data-field":e.path.join(`.`),"data-scope":t,children:[(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,$.jsx)(Zn,{className:`text-sm font-medium`,children:h}),r?(0,$.jsxs)(x,{children:[(0,$.jsx)(y,{asChild:!0,children:(0,$.jsx)(v,{variant:`ghost`,size:`icon`,className:`h-5 w-5 text-muted-foreground opacity-60 hover:opacity-100`,onClick:D,"aria-label":i({id:`lhjq3G`,values:{labelText:h}}),children:(0,$.jsx)(Zt,{className:`size-3.5`})})}),(0,$.jsx)(b,{children:(0,$.jsx)(s,{id:`L-rMC9`})})]}):null]}),e.description?(0,$.jsx)($n,{className:`text-muted-foreground text-1sm`,children:i(e.description)}):null,(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,$.jsx)(Xn,{children:(0,$.jsx)(Ir,{field:e,ctl:n,typeTag:l,enumOptions:d,onCommit:E})}),(0,$.jsx)(Br,{visible:_,srOnly:e.control===`theme-tiles`})]}),(0,$.jsx)(er,{"data-field-error":e.path.join(`.`)})]})}})}function Ir({field:e,ctl:t,typeTag:n,enumOptions:r,onCommit:i,...a}){"use no memo";let{_:o}=c(),{setTheme:s,systemTheme:l}=u(),d=Tn()?.merged??null;if(e.control===`theme-tiles`){let{id:n,...r}=a,c=d?.appearance?.customTheme,u=d?.appearance?.theme,f=u===`light`||u===`dark`?u:l===`dark`?`dark`:`light`;return(0,$.jsx)(Or,{...r,id:n,value:typeof t.value==`string`?t.value:`default`,customSeed:c,defaultMode:f,"aria-label":o(e.label),onSelect:e=>{if(xn(e,c),e===`custom`)s(_n(bn(c))===`dark`?`dark`:`light`);else{let t=Oe(e);t&&s(t)}t.onChange(e),i()}})}if(n===`boolean`)return(0,$.jsx)(U,{...a,checked:!!t.value,ref:t.ref,onCheckedChange:e=>{t.onChange(e),i()},onBlur:t.onBlur});if(n===`enum`&&r&&r.length>0&&(e.control===`enum-toggle`||r.length<=4)){let{id:n,...c}=a,l=e.path[0]===`appearance`&&e.path[1]===`theme`;return(0,$.jsx)(ne,{...c,type:`single`,value:typeof t.value==`string`?t.value:``,ref:t.ref,onValueChange:e=>{e&&(l&&s(e),t.onChange(e),i())},onBlur:t.onBlur,variant:`segmented`,size:`sm`,spacing:1,className:`bg-muted dark:bg-background p-0.5 rounded-lg`,"aria-label":o(e.label),children:r.map((e,t)=>(0,$.jsx)(q,{value:e,id:t===0?n:void 0,className:`text-1sm capitalize`,children:e},e))})}return n===`number`||n===`int`?(0,$.jsx)(Rr,{ctl:t,onCommit:i,...a}):n===`array`?(0,$.jsx)(zr,{ctl:t,onCommit:i,...a}):(0,$.jsx)(Lr,{ctl:t,onCommit:i,...a})}function Lr({ctl:e,onCommit:t,...n}){"use no memo";return(0,$.jsx)(an,{...n,value:typeof e.value==`string`?e.value:``,ref:e.ref,onChange:t=>e.onChange(t.target.value),onBlur:()=>{e.onBlur(),t()},onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),t())},className:`h-8 text-sm`})}function Rr({ctl:e,onCommit:t,...n}){"use no memo";let[r,i]=(0,Q.useState)(e.value===void 0?``:String(e.value)),a=(0,Q.useRef)(e.value);(0,Q.useEffect)(()=>{a.current!==e.value&&(i(e.value===void 0?``:String(e.value)),a.current=e.value)},[e.value]);let o=()=>{let n=Number(r);if(!Number.isFinite(n)){e.onChange(r),t();return}e.onChange(n),t(),a.current=n};return(0,$.jsx)(an,{...n,type:`number`,value:r,ref:e.ref,onChange:e=>i(e.target.value),onBlur:()=>{e.onBlur(),o()},onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),o())},className:`h-8 w-28 text-sm tabular-nums`})}function zr({ctl:e,onCommit:t,...n}){"use no memo";let r=Array.isArray(e.value)?e.value.join(`
1
+ import{o as e,t}from"./chunk-CYidjpOJ.js";import{t as n}from"./jsx-runtime-BUgB2tll.js";import{Xt as r,it as i,yn as a}from"./DocumentContext-B-29n_HL.js";import{t as o}from"./react-f2sANaYj.js";import{n as s,r as c}from"./dist-Nvb76hAm.js";import{t as l}from"./useQuery-ZeEDLtxh.js";import{n as u}from"./dist-PQ5KMVDh.js";import{t as d}from"./compiler-runtime-BfE3aGVn.js";import{a as f,c as p,l as m,s as h}from"./terminal-input-events-C5UuEsAB.js";import{s as g,t as _}from"./createLucideIcon-DAkhoPjT.js";import{t as v}from"./button-Gol9BgNB.js";import{i as y,n as b,t as x}from"./tooltip-B4J7VHmA.js";import{n as S,r as C,t as w}from"./collapsible-B1mS1n9y.js";import{a as T,c as E,i as D,n as O,o as k,r as A,s as j,t as M}from"./dialog-TkFkuYVg.js";import{t as N}from"./checkbox-DY-vIhnZ.js";import{m as P,r as F,t as I}from"./dropdown-menu-xw8WTdb-.js";import{t as L}from"./label-DyipnO5I.js";import{a as R,i as z,n as B,o as V,r as H,t as U}from"./switch-DYic2V-1.js";import{i as W,n as G,r as ee,t as te}from"./radio-group-CGEdWasQ.js";import{t as K}from"./separator-DExEeoYE.js";import{n as q,t as ne}from"./toggle-group-CjXmmTGy.js";import{C as J,a as Y,b as re,c as ie,d as ae,f as oe,h as se,l as ce,n as le,o as ue,r as de,s as fe,t as pe,u as me,y as he}from"./agent-visibility-CkDoRkF-.js";import{i as ge}from"./terminal-telemetry-KTY5c5qk.js";import{$a as _e,Ba as ve,Bt as ye,Da as be,I as xe,Ia as Se,L as Ce,Lt as we,Na as Te,Oa as Ee,Qa as De,Ra as Oe,S as ke,Ta as Ae,Ua as je,Va as Me,Vt as Ne,Wa as Pe,Xa as Fe,Za as Ie,_r as Le,b as Re,ht as ze,nt as Be,oi as Ve,qa as He,ui as Ue,yt as We}from"./dist-CYN1QNvi.js";import{a as Ge,c as Ke,d as qe,s as Je,t as Ye}from"./EnableSyncConfirmDialog-DTG7riiK.js";import{t as Xe}from"./arrow-up-right-obRIg3Sv.js";import{t as Ze}from"./RegisteredAgentIcon-DplzDEhh.js";import{t as Qe}from"./check-GqWaoTdV.js";import{t as $e}from"./chevron-right-C8oTR6gu.js";import{i as et}from"./prop-types-B-j2FcIV.js";import{C as tt,S as nt,b as rt,c as it,h as at,i as ot,l as st,o as ct,r as lt,t as ut,v as dt,y as ft}from"./skill-actions-C5Jj4vq_.js";import{A as pt,F as mt,G as ht,I as gt,M as _t,N as vt,P as yt,S as bt,U as xt,V as St,_ as Ct,b as wt,c as Tt,d as Et,f as Dt,g as Ot,h as kt,i as At,k as jt,l as Mt,m as Nt,n as Pt,o as Ft,p as It,u as Lt,x as Rt,y as zt,z as Bt}from"./auth-state-cache-DOwAr8pE.js";import{i as Vt,l as Ht,r as Ut,s as Wt}from"./workspace-paths-C4Wwi52h.js";import{t as Gt}from"./square-pen-C1vIlMAW.js";import{c as Kt,n as qt,t as Jt}from"./open-managed-artifact-tab-CG97eU0o.js";import{t as Yt}from"./info-yKMseklR.js";import{t as Xt}from"./loader-circle-Cg5SU7AZ.js";import{c as Zt,i as Qt}from"./field-DVIFAnvR.js";import{t as $t}from"./sliders-horizontal-34K0eDW2.js";import{t as en}from"./trash-2-BUuL4OCw.js";import{t as tn}from"./triangle-alert-Clgvyc7B.js";import{t as nn}from"./x-DVkpYo5d.js";import{n as X}from"./dist-BLAMau9Z.js";import{t as rn}from"./ConfigSharingInfoTooltip-DMbsfWD9.js";import{t as an}from"./input-D0ZW0Opq.js";import{c as on,d as sn,i as cn,l as ln,m as un,o as dn,s as fn}from"./use-settings-route-Ch_E9Uw0.js";import{t as pn}from"./parse-api-error-C_gwkKmG.js";import{i as mn}from"./documents-events-DUo-r8o3.js";import{o as hn}from"./doc-hash-BKfBCyjO.js";import{t as gn}from"./badge-Dba4cvJR.js";import"./config-provider--LBV5X-F.js";import{a as _n,c as vn,i as yn,l as bn,n as xn,o as Sn,s as Cn}from"./use-apply-config-color-theme-CpTf0ZSO.js";import{n as wn,r as Tn}from"./config-context-gd3BC-iY.js";import{t as En}from"./external-link-T4Nj1gcG.js";import{t as Dn}from"./use-workspace-JeP_ExdS.js";import{t as On}from"./lint-plugin-meta-J-wb-uxW.js";import{t as kn}from"./skeleton-BG12Hmzn.js";import{d as An,n as jn,r as Mn,t as Nn,u as Pn}from"./lint-config-client-bcseyVIk.js";import{a as Fn,d as In,f as Ln,i as Rn,l as zn,m as Bn,o as Vn,p as Hn,s as Un,t as Wn,u as Gn}from"./sortable.esm-C565D25d.js";import{t as Kn}from"./textarea-tdCJViKf.js";import{a as qn,f as Jn,i as Yn,n as Xn,o as Zn,p as Qn,r as $n,s as er,t as tr}from"./form-coxG-8Qw.js";import{t as nr}from"./tag-pill-input-opUlyN8Z.js";import{t as rr}from"./markdownlint-rule-browser-BfLXlhbg.js";import{i as ir,n as ar}from"./schema-fields-view-intent-D_s-Cynn.js";import{n as or,t as sr}from"./use-terminal-enabled-U4ycZNGm.js";var cr=_(`wifi-off`,[[`path`,{d:`M12 20h.01`,key:`zekei9`}],[`path`,{d:`M8.5 16.429a5 5 0 0 1 7 0`,key:`1bycff`}],[`path`,{d:`M5 12.859a10 10 0 0 1 5.17-2.69`,key:`1dl1wf`}],[`path`,{d:`M19 12.859a10 10 0 0 0-2.007-1.523`,key:`4k23kn`}],[`path`,{d:`M2 8.82a15 15 0 0 1 4.177-2.643`,key:`1grhjp`}],[`path`,{d:`M22 8.82a15 15 0 0 0-11.288-3.764`,key:`z3jwby`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]),Z=d(),Q=e(o(),1),$=n(),lr=`settings-sharing-title`;function ur(){let e=(0,Z.c)(1),t=(typeof window<`u`?window.okDesktop:void 0)?.sharing,n;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=t===void 0?(0,$.jsx)(dr,{}):(0,$.jsx)(fr,{}),e[0]=n):n=e[0],n}function dr(){let e=(0,Z.c)(2),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsx)(`h3`,{id:lr,className:`text-base font-semibold`,children:(0,$.jsx)(s,{id:`cs4mps`})}),e[0]=t):t=e[0];let n;return e[1]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,$.jsx)(`section`,{"aria-labelledby":lr,className:`space-y-3`,children:(0,$.jsxs)(`div`,{className:`space-y-1`,children:[t,(0,$.jsx)(`p`,{className:`text-1sm text-muted-foreground`,children:(0,$.jsx)(s,{id:`7YRrJ9`,components:{0:(0,$.jsx)(`code`,{}),1:(0,$.jsx)(`code`,{}),2:(0,$.jsx)(`code`,{})}})})]})}),e[1]=n):n=e[1],n}function fr(){let e=(0,Z.c)(39),{_:t}=c(),[n,r]=(0,Q.useState)(null),[i,a]=(0,Q.useState)(!1),[o,l]=(0,Q.useState)(null),u;e[0]===t?u=e[1]:(u=async function(){let e=window.okDesktop?.sharing;if(e)try{r(await e.status())}catch(e){let n=e;X.error(n instanceof Error?n.message:t({id:`K0N7zS`})),r(mr)}},e[0]=t,e[1]=u);let d=u,f;e[2]===d?f=e[3]:(f=()=>{d()},e[2]=d,e[3]=f);let p;e[4]===Symbol.for(`react.memo_cache_sentinel`)?(p=[],e[4]=p):p=e[4],(0,Q.useEffect)(f,p);let m;e[5]!==t||e[6]!==i||e[7]!==d||e[8]!==n?(m=async function(e){let r=window.okDesktop?.sharing;if(!r||n===null||i||n.mode===e)return;a(!0),l(null);let o=null,s=null;try{o=await r.setMode(e)}catch(e){s=e}if(a(!1),s!==null){X.error(s instanceof Error?s.message:t({id:`qZv5ZR`}));return}o!==null&&(o.kind===`refused-tracked`?(l({tracked:o.tracked,remediation:o.remediation}),X.error(t({id:`z2JdQ-`}),{duration:5e3})):o.kind===`no-exclude`?X.warning(o.reason===`no-git`?t({id:`YSFv5w`}):t({id:`8cS0nH`,values:{0:o.reason}})):X.success(t(e===`local-only`?{id:`VvS_k_`}:{id:`k_pade`})),await d())},e[5]=t,e[6]=i,e[7]=d,e[8]=n,e[9]=m):m=e[9];let h=m,g;e[10]!==t||e[11]!==i||e[12]!==d||e[13]!==n?(g=async function(){let e=window.okDesktop?.sharing;if(!e||n===null||i)return;a(!0);let r=null,o=null;try{r=await e.setSkillsShared(!1)}catch(e){o=e}if(a(!1),o!==null){X.error(o instanceof Error?o.message:t({id:`onTlRk`}));return}if(r!==null){if(r.kind===`no-exclude`){let e=r.reason===`no-git`?t({id:`Xwump4`}):r.reason===`inaccessible`?t({id:`PlGC6r`}):t({id:`zcmYx4`});X.warning(t({id:`4h3e0H`,values:{detail:e}}));return}X.success(t({id:`pQf2Ux`})),await d()}},e[10]=t,e[11]=i,e[12]=d,e[13]=n,e[14]=g):g=e[14];let _=g;if(n===null){let t;return e[15]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsxs)(`section`,{"aria-labelledby":lr,className:`space-y-3`,children:[(0,$.jsx)(`h3`,{id:lr,className:`text-base font-semibold`,children:(0,$.jsx)(s,{id:`cs4mps`})}),(0,$.jsx)(kn,{className:`h-24`})]}),e[15]=t):t=e[15],t}let y=n.mode===`no-git`,b;e[16]===Symbol.for(`react.memo_cache_sentinel`)?(b=(0,$.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,$.jsx)(`h3`,{id:lr,className:`text-base font-semibold`,children:(0,$.jsx)(s,{id:`cs4mps`})}),(0,$.jsx)(rn,{})]}),e[16]=b):b=e[16];let x;e[17]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,$.jsxs)(`div`,{className:`space-y-1`,children:[b,(0,$.jsx)(`p`,{className:`text-1sm text-muted-foreground`,children:(0,$.jsx)(s,{id:`N55YNr`})})]}),e[17]=x):x=e[17];let S;e[18]!==i||e[19]!==y||e[20]!==h||e[21]!==n.mode?(S=y?(0,$.jsx)(`p`,{className:`rounded-md border border-amber-300 bg-amber-50 px-3 py-2 text-sm text-amber-900 dark:border-amber-700 dark:bg-amber-950 dark:text-amber-200`,role:`status`,"data-testid":`settings-sharing-no-git`,children:(0,$.jsx)(s,{id:`ju38ms`})}):(0,$.jsxs)(te,{value:n.mode,onValueChange:e=>void h(e),disabled:i,className:`gap-2`,"aria-labelledby":lr,"data-testid":`settings-sharing-radiogroup`,children:[(0,$.jsxs)(`label`,{htmlFor:`settings-sharing-shared`,className:`flex items-start gap-2 text-sm`,children:[(0,$.jsx)(G,{id:`settings-sharing-shared`,value:`shared`,"data-testid":`settings-sharing-shared`,className:`mt-1`}),(0,$.jsxs)(`span`,{children:[(0,$.jsx)(`span`,{className:`font-medium`,children:(0,$.jsx)(s,{id:`0Gd0NU`})}),(0,$.jsx)(`span`,{className:`block text-1sm text-muted-foreground`,children:(0,$.jsx)(s,{id:`dJw2_7`})})]})]}),(0,$.jsxs)(`label`,{htmlFor:`settings-sharing-local-only`,className:`flex items-start gap-2 text-sm`,children:[(0,$.jsx)(G,{id:`settings-sharing-local-only`,value:`local-only`,"data-testid":`settings-sharing-local-only`,className:`mt-1`}),(0,$.jsxs)(`span`,{children:[(0,$.jsx)(`span`,{className:`font-medium`,children:(0,$.jsx)(s,{id:`OgyJSr`})}),(0,$.jsx)(`span`,{className:`block text-1sm text-muted-foreground`,children:(0,$.jsx)(s,{id:`cZ_8zB`})})]})]})]}),e[18]=i,e[19]=y,e[20]=h,e[21]=n.mode,e[22]=S):S=e[22];let C;e[23]!==i||e[24]!==_||e[25]!==n.mode||e[26]!==n.skillsShared?(C=n.mode===`local-only`&&n.skillsShared?(0,$.jsxs)(`div`,{className:`flex items-start justify-between gap-2 rounded-md border border-muted-foreground/30 bg-muted/40 p-3 text-sm`,"data-testid":`settings-sharing-skills-exception`,children:[(0,$.jsxs)(`span`,{children:[(0,$.jsx)(`span`,{className:`font-medium`,children:(0,$.jsx)(s,{id:`Kiytqd`})}),(0,$.jsx)(`span`,{className:`block text-1sm text-muted-foreground`,children:(0,$.jsx)(s,{id:`K0FgsP`})})]}),(0,$.jsx)(v,{variant:`outline`,size:`sm`,disabled:i,onClick:()=>void _(),children:(0,$.jsx)(s,{id:`9uI_rE`})})]}):null,e[23]=i,e[24]=_,e[25]=n.mode,e[26]=n.skillsShared,e[27]=C):C=e[27];let w;e[28]===o?w=e[29]:(w=o===null?null:(0,$.jsxs)(`div`,{className:`space-y-2 rounded-md border border-destructive bg-destructive/10 p-3 text-sm`,role:`alert`,"data-testid":`settings-sharing-refusal`,children:[(0,$.jsx)(`p`,{className:`font-semibold`,children:(0,$.jsx)(s,{id:`Kgdbkt`})}),(0,$.jsx)(`pre`,{className:`whitespace-pre-wrap font-mono text-xs leading-relaxed`,children:o.remediation}),(0,$.jsx)(v,{variant:`outline`,size:`sm`,onClick:()=>l(null),children:(0,$.jsx)(s,{id:`1QfxQT`})})]}),e[28]=o,e[29]=w);let T;e[30]!==o||e[31]!==n.mode||e[32]!==n.trackedUpstream?(T=n.trackedUpstream.length>0&&n.mode!==`no-git`&&o===null?(0,$.jsxs)(`div`,{className:`space-y-1 rounded-md border border-muted-foreground/30 bg-muted/40 p-3 text-sm`,"data-testid":`settings-sharing-tracked-info`,children:[(0,$.jsx)(`p`,{className:`font-medium`,children:(0,$.jsx)(s,{id:`LhWYpm`})}),(0,$.jsx)(`ul`,{className:`list-disc pl-5 font-mono text-xs text-muted-foreground`,children:n.trackedUpstream.map(pr)}),(0,$.jsx)(`p`,{className:`text-1sm text-muted-foreground`,children:(0,$.jsx)(s,{id:`1XSMhZ`,components:{0:(0,$.jsx)(`code`,{}),1:(0,$.jsx)(`code`,{})}})})]}):null,e[30]=o,e[31]=n.mode,e[32]=n.trackedUpstream,e[33]=T):T=e[33];let E;return e[34]!==T||e[35]!==S||e[36]!==C||e[37]!==w?(E=(0,$.jsxs)(`section`,{"aria-labelledby":lr,className:`space-y-4`,"data-testid":`settings-sharing`,children:[x,S,C,w,T]}),e[34]=T,e[35]=S,e[36]=C,e[37]=w,e[38]=E):E=e[38],E}function pr(e){return(0,$.jsx)(`li`,{children:e},e)}function mr(e){return e??{kind:`status`,mode:`no-git`,excluded:[],trackedUpstream:[],skillsShared:!1}}function hr(e){let t=(0,Z.c)(35),{authQueryTransport:n,authTransport:r}=e,{_:i}=c(),a;t[0]===n?a=t[1]:(a=n??Bt(),t[0]=n,t[1]=a);let o=a,l;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(l={phase:`loading`},t[2]=l):l=t[2];let[u,d]=(0,Q.useState)(l),[f,p]=(0,Q.useState)(!1),[m,h]=(0,Q.useState)(!1),[g,_]=(0,Q.useState)(null),y=(0,Q.useRef)(!1),b;t[3]===o?b=t[4]:(b=async function(){d({phase:`loading`});try{let e=await o.status();d({phase:`loaded`,result:e}),Pt(e.authenticated)}catch(e){console.warn(`[AccountSection] GitHub status check failed`,e),d({phase:`check-failed`})}},t[3]=o,t[4]=b);let x=b,S;t[5]===x?S=t[6]:(S=()=>{x()},t[5]=x,t[6]=S);let C;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(C=[],t[7]=C):C=t[7],(0,Q.useEffect)(S,C);let w;t[8]!==i||t[9]!==x||t[10]!==o?(w=async function(){if(y.current)return;y.current=!0,p(!1),h(!0),_(null);let e=null;try{let t=o.signout?await o.signout():{ok:!1,error:i({id:`8cpOa8`})};t.ok||(e=t.error??i({id:`8cpOa8`}))}catch(t){console.warn(`[AccountSection] GitHub disconnect failed`,t),e=i({id:`8cpOa8`})}await x(),e&&_(e),h(!1),y.current=!1},t[8]=i,t[9]=x,t[10]=o,t[11]=w):w=t[11];let T=w,E;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(E=(0,$.jsx)(`h3`,{id:`settings-account-title`,className:`text-base font-semibold`,children:(0,$.jsx)(s,{id:`AeXO77`})}),t[12]=E):E=t[12];let D;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(D=(0,$.jsxs)(`div`,{className:`space-y-1`,children:[E,(0,$.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:(0,$.jsx)(s,{id:`E6lrpp`})})]}),t[13]=D):D=t[13];let O;t[14]!==g||t[15]!==m||t[16]!==T||t[17]!==x||t[18]!==u.phase||t[19]!==u.result?(O=u.phase===`loading`?(0,$.jsxs)(`div`,{role:`status`,"aria-live":`polite`,"aria-busy":`true`,className:`space-y-2 rounded-md border p-3`,"data-testid":`settings-account-loading`,children:[(0,$.jsx)(`span`,{className:`sr-only`,children:(0,$.jsx)(s,{id:`IWGfGF`})}),(0,$.jsx)(kn,{className:`h-4 w-40`}),(0,$.jsx)(kn,{className:`h-8 w-32`})]}):u.phase===`check-failed`?(0,$.jsxs)(`div`,{className:`space-y-2 rounded-md border p-3`,"data-testid":`settings-account-check-failed`,children:[(0,$.jsx)(`p`,{role:`status`,className:`text-sm text-muted-foreground`,children:(0,$.jsx)(s,{id:`T_wG4n`})}),(0,$.jsx)(v,{variant:`outline`,size:`sm`,onClick:()=>void x(),children:(0,$.jsx)(s,{id:`KDw4GX`})})]}):u.result.authenticated?u.result.tier===`A`?(0,$.jsx)(_r,{login:u.result.login}):(0,$.jsx)(gr,{login:u.result.login,disconnecting:m,error:g,onDisconnect:()=>void T()}):(0,$.jsx)(vr,{onConnect:()=>p(!0)}),t[14]=g,t[15]=m,t[16]=T,t[17]=x,t[18]=u.phase,t[19]=u.result,t[20]=O):O=t[20];let k;t[21]===x?k=t[22]:(k=e=>{p(e),e||x()},t[21]=x,t[22]=k);let A=u.phase===`loaded`?u.result.host:void 0,j=u.phase===`loaded`?u.result.ghAvailable:void 0,M;t[23]===x?M=t[24]:(M=()=>{x()},t[23]=x,t[24]=M);let N;t[25]!==f||t[26]!==r||t[27]!==k||t[28]!==A||t[29]!==j||t[30]!==M?(N=(0,$.jsx)(gt,{open:f,onOpenChange:k,transport:r,host:A,ghAvailable:j,onSuccess:M}),t[25]=f,t[26]=r,t[27]=k,t[28]=A,t[29]=j,t[30]=M,t[31]=N):N=t[31];let P;return t[32]!==N||t[33]!==O?(P=(0,$.jsxs)(`section`,{"aria-labelledby":`settings-account-title`,className:`space-y-3`,"data-testid":`settings-account`,children:[D,O,N]}),t[32]=N,t[33]=O,t[34]=P):P=t[34],P}function gr(e){let t=(0,Z.c)(20),{login:n,disconnecting:r,error:i,onDisconnect:a}=e,o;t[0]===n?o=t[1]:(o=(0,$.jsx)(`div`,{className:`text-sm font-medium`,children:(0,$.jsx)(s,{id:`E_tNGD`,values:{login:n}})}),t[0]=n,t[1]=o);let c;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,$.jsx)(`p`,{className:`text-muted-foreground text-1sm`,children:(0,$.jsx)(s,{id:`nxlOpL`})}),t[2]=c):c=t[2];let l;t[3]===o?l=t[4]:(l=(0,$.jsxs)(`div`,{className:`min-w-0`,children:[o,c]}),t[3]=o,t[4]=l);let u;t[5]===r?u=t[6]:(u=r?(0,$.jsx)(s,{id:`rppgXF`}):(0,$.jsx)(s,{id:`-K0AvT`}),t[5]=r,t[6]=u);let d;t[7]!==r||t[8]!==a||t[9]!==u?(d=(0,$.jsx)(v,{variant:`outline`,onClick:a,disabled:r,"aria-describedby":`settings-account-disconnect-caveat`,"data-testid":`settings-account-disconnect`,children:u}),t[7]=r,t[8]=a,t[9]=u,t[10]=d):d=t[10];let f;t[11]!==l||t[12]!==d?(f=(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[l,d]}),t[11]=l,t[12]=d,t[13]=f):f=t[13];let p;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,$.jsx)(`p`,{id:`settings-account-disconnect-caveat`,className:`text-muted-foreground text-1sm`,"data-testid":`settings-account-disconnect-caveat`,children:(0,$.jsx)(s,{id:`msOK6I`})}),t[14]=p):p=t[14];let m;t[15]===i?m=t[16]:(m=i?(0,$.jsx)(`p`,{role:`alert`,className:`text-sm text-destructive`,"data-testid":`settings-account-disconnect-error`,children:i}):null,t[15]=i,t[16]=m);let h;return t[17]!==f||t[18]!==m?(h=(0,$.jsxs)(`div`,{className:`space-y-2 rounded-md border p-3`,"data-testid":`settings-account-connected`,children:[f,p,m]}),t[17]=f,t[18]=m,t[19]=h):h=t[19],h}function _r(e){let t=(0,Z.c)(5),{login:n}=e,r;t[0]===n?r=t[1]:(r=(0,$.jsx)(`div`,{className:`text-sm font-medium`,children:(0,$.jsx)(s,{id:`E_tNGD`,values:{login:n}})}),t[0]=n,t[1]=r);let i;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,$.jsx)(`p`,{className:`text-muted-foreground text-1sm`,children:(0,$.jsx)(s,{id:`ny6vNn`})}),t[2]=i):i=t[2];let a;return t[3]===r?a=t[4]:(a=(0,$.jsx)(`div`,{className:`rounded-md border p-3`,"data-testid":`settings-account-gh-cli`,children:(0,$.jsxs)(`div`,{className:`min-w-0 space-y-1`,children:[r,i]})}),t[3]=r,t[4]=a),a}function vr(e){let t=(0,Z.c)(5),{onConnect:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,$.jsx)(`div`,{className:`text-sm font-medium`,children:(0,$.jsx)(s,{id:`S33tz3`})}),t[0]=r):r=t[0];let i;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,$.jsxs)(`div`,{className:`min-w-0`,children:[r,(0,$.jsx)(`p`,{className:`text-muted-foreground text-1sm`,children:(0,$.jsx)(s,{id:`EJuO7B`})})]}),t[1]=i):i=t[1];let a;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,$.jsx)(s,{id:`5lWFkC`}),t[2]=a):a=t[2];let o;return t[3]===n?o=t[4]:(o=(0,$.jsx)(`div`,{className:`rounded-md border p-3`,"data-testid":`settings-account-disconnected`,children:(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[i,(0,$.jsx)(v,{onClick:n,"data-testid":`settings-account-connect`,children:a})]})}),t[3]=n,t[4]=o),o}function yr(e){return e.kind===`editor`?`editor:${e.id}`:e.kind===`skill`?`skill:${e.id}`:`path`}function br(e){let t=(0,Z.c)(11),{testId:n,children:r}=e,{_:i}=c(),a;t[0]===i?a=t[1]:(a=i({id:`2B6eYX`}),t[0]=i,t[1]=a);let o;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,$.jsx)(Yt,{className:`size-3.5`}),t[2]=o):o=t[2];let s;t[3]!==a||t[4]!==n?(s=(0,$.jsx)(y,{asChild:!0,children:(0,$.jsx)(v,{variant:`ghost`,size:`icon`,className:`mt-1.5 mr-1.5 h-6 w-6 shrink-0 text-muted-foreground opacity-60 hover:opacity-100`,"aria-label":a,"data-testid":n,children:o})}),t[3]=a,t[4]=n,t[5]=s):s=t[5];let l;t[6]===r?l=t[7]:(l=(0,$.jsx)(b,{side:`left`,className:`max-w-sm text-left`,children:(0,$.jsx)(`div`,{className:`flex min-w-0 flex-col gap-1`,children:r})}),t[6]=r,t[7]=l);let u;return t[8]!==s||t[9]!==l?(u=(0,$.jsxs)(x,{children:[s,l]}),t[8]=s,t[9]=l,t[10]=u):u=t[10],u}function xr(){let e=(0,Z.c)(38),{_:t}=c(),n=typeof window<`u`?window.okDesktop??null:null,[r,i]=(0,Q.useState)(null),[a,o]=(0,Q.useState)(!1),[l,u]=(0,Q.useState)(null),d,f;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(d=()=>{if(!n)return;let e=!1;return n.integrations.status().then(t=>{e||i(t)}).catch(()=>{e||o(!0)}),()=>{e=!0}},f=[n],e[0]=d,e[1]=f):(d=e[0],f=e[1]),(0,Q.useEffect)(d,f);let p;e[2]===t?p=e[3]:(p=async function(e,r){if(n){u(yr(e));try{let t=await n.integrations.setComponent({component:e,enabled:r});i(t.status),t.ok||X.error(t.error)}catch(e){let n=e;X.error(t({id:`gfdqcY`,values:{0:n instanceof Error?n.message:String(n)}}))}u(null)}},e[2]=t,e[3]=p);let m=p,h;e[4]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,$.jsx)(`h3`,{id:`settings-ai-tools-title`,className:`text-base font-semibold`,children:(0,$.jsx)(s,{id:`_5qBNl`})}),e[4]=h):h=e[4];let g;e[5]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,$.jsxs)(`div`,{className:`space-y-1`,children:[h,(0,$.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:(0,$.jsx)(s,{id:`mLAjyL`})})]}),e[5]=g):g=e[5];let _=g;if(!n||a){let t;return e[6]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsxs)(`section`,{"aria-labelledby":`settings-ai-tools-title`,className:`space-y-4`,children:[_,(0,$.jsx)(`p`,{className:`text-sm text-muted-foreground`,"data-testid":`ai-tools-unavailable`,children:(0,$.jsx)(s,{id:`O4PnDd`})})]}),e[6]=t):t=e[6],t}if(r===null){let t;return e[7]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsxs)(`section`,{"aria-labelledby":`settings-ai-tools-title`,className:`space-y-4`,children:[_,(0,$.jsxs)(`div`,{className:`space-y-2`,"data-testid":`ai-tools-loading`,children:[(0,$.jsx)(kn,{className:`h-10 w-full`}),(0,$.jsx)(kn,{className:`h-10 w-full`}),(0,$.jsx)(kn,{className:`h-10 w-full`})]})]}),e[7]=t):t=e[7],t}let v=l!==null||!r.available,y=r.path.shellDetected||r.path.installed,b;e[8]===r.available?b=e[9]:(b=!r.available&&(0,$.jsx)(`p`,{className:`text-sm text-amber-600 dark:text-amber-400`,"data-testid":`ai-tools-read-only`,children:(0,$.jsx)(s,{id:`OplnBG`})}),e[8]=r.available,e[9]=b);let x;e[10]!==t||e[11]!==m||e[12]!==v||e[13]!==y||e[14]!==r.path.installed||e[15]!==r.path.rcFilesToTouch?(x=y&&(0,$.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,$.jsx)(`span`,{className:`text-xs font-medium text-muted-foreground`,children:(0,$.jsx)(s,{id:`ALhMYW`})}),(0,$.jsxs)(`div`,{className:`flex items-start overflow-hidden rounded-md border border-border bg-card/50 hover:bg-accent`,children:[(0,$.jsxs)(L,{htmlFor:`ai-tools-path`,className:`flex flex-1 cursor-pointer items-start gap-2.5 px-3 py-2.5 font-normal`,children:[(0,$.jsx)(N,{id:`ai-tools-path`,checked:r.path.installed,disabled:v,onCheckedChange:()=>void m({kind:`path`},!r.path.installed),className:`mt-0.5`,"data-testid":`ai-tools-path-checkbox`}),(0,$.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col gap-0.5`,children:[(0,$.jsx)(`span`,{className:`text-sm font-medium text-foreground`,children:(0,$.jsx)(s,{id:`Fsx78O`,components:{0:(0,$.jsx)(`code`,{className:`inline-code`})}})}),(0,$.jsx)(`span`,{className:`text-xs text-muted-foreground`,"data-testid":`ai-tools-path-status`,children:r.path.installed?t({id:`yhdqox`}):t({id:`04XyCH`,values:{0:r.path.rcFilesToTouch.join(`, `)}})})]})]}),(0,$.jsxs)(br,{testId:`ai-tools-path-info`,children:[(0,$.jsx)(`p`,{className:`opacity-70`,children:(0,$.jsx)(s,{id:`f9lQNJ`})}),r.path.rcFilesToTouch.map(Cr),(0,$.jsx)(`p`,{className:`pt-1`,children:(0,$.jsx)(s,{id:`CWzc2T`,components:{0:(0,$.jsx)(`code`,{}),1:(0,$.jsx)(`code`,{})}})})]})]})]}),e[10]=t,e[11]=m,e[12]=v,e[13]=y,e[14]=r.path.installed,e[15]=r.path.rcFilesToTouch,e[16]=x):x=e[16];let S;e[17]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,$.jsx)(`span`,{className:`text-xs font-medium text-muted-foreground`,children:(0,$.jsx)(s,{id:`psfGPX`})}),e[17]=S):S=e[17];let C;if(e[18]!==t||e[19]!==m||e[20]!==v||e[21]!==r.editors){let n;e[23]!==t||e[24]!==m||e[25]!==v?(n=e=>{let n=e.state===`installed`||e.state===`foreign`,r=v||e.state===`unmanageable`,i=e.state===`not-installed`&&!e.detected,a=`https://openknowledge.ai/docs/integrations/${Ce[e.id]}`,o=e.state===`installed`?t({id:`eQkgKV`}):e.state===`foreign`?t({id:`AczYxH`}):e.state===`unmanageable`?t({id:`LbmLyU`}):e.detected?t({id:`bBE5tC`}):null,c=e.state===`foreign`||e.state===`unmanageable`?`text-xs text-amber-600 dark:text-amber-400`:`text-xs text-muted-foreground`;return(0,$.jsxs)(`li`,{className:r?`flex items-start`:`flex items-start hover:bg-accent`,children:[(0,$.jsxs)(L,{htmlFor:`ai-tools-editor-${e.id}`,className:r?`flex flex-1 items-start gap-2.5 px-3 py-2.5 font-normal`:`flex flex-1 cursor-pointer items-start gap-2.5 px-3 py-2.5 font-normal`,children:[(0,$.jsx)(N,{id:`ai-tools-editor-${e.id}`,checked:n,disabled:r,onCheckedChange:()=>void m({kind:`editor`,id:e.id},!n),className:`mt-0.5`,"data-testid":`ai-tools-editor-checkbox-${e.id}`}),(0,$.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col gap-0.5`,children:[(0,$.jsx)(`span`,{className:`text-sm font-medium text-foreground`,children:e.label}),o!==null&&(0,$.jsx)(`span`,{className:c,"data-testid":`ai-tools-editor-status-${e.id}`,children:o})]})]}),i&&(0,$.jsxs)(`a`,{href:a,target:`_blank`,rel:`noopener noreferrer`,onClick:e=>En(e,a),onAuxClick:e=>En(e,a),"aria-label":t({id:`D-Oh1s`,values:{0:e.label}}),className:`flex shrink-0 items-center gap-0.5 px-2 py-2.5 text-xs text-muted-foreground underline-offset-2 hover:text-foreground hover:underline`,"data-testid":`ai-tools-editor-status-${e.id}`,children:[(0,$.jsx)(s,{id:`P_bX4O`}),(0,$.jsx)(Xe,{className:`size-3`,"aria-hidden":!0})]}),(0,$.jsxs)(br,{testId:`ai-tools-editor-info-${e.id}`,children:[(0,$.jsx)(`p`,{className:`opacity-70`,children:(0,$.jsx)(s,{id:`J2eKUI`})}),(0,$.jsx)(`p`,{children:(0,$.jsx)(`code`,{className:`break-all`,children:e.configPath??t({id:`ndwmea`})})}),(0,$.jsx)(`p`,{className:`pt-1 opacity-70`,children:(0,$.jsx)(s,{id:`VIwCaD`})}),(0,$.jsx)(`p`,{children:(0,$.jsx)(`code`,{className:`break-all`,children:e.entryLocator})})]})]},e.id)},e[23]=t,e[24]=m,e[25]=v,e[26]=n):n=e[26],C=r.editors.map(n),e[18]=t,e[19]=m,e[20]=v,e[21]=r.editors,e[22]=C}else C=e[22];let w;e[27]===C?w=e[28]:(w=(0,$.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[S,(0,$.jsx)(`ul`,{className:`rounded-md border border-border bg-card/50 divide-y divide-border overflow-hidden`,children:C})]}),e[27]=C,e[28]=w);let T;e[29]!==m||e[30]!==v||e[31]!==r.skills?(T=r.skills.length>0&&(0,$.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,$.jsx)(`span`,{className:`text-xs font-medium text-muted-foreground`,children:(0,$.jsx)(s,{id:`28B21t`})}),(0,$.jsx)(`ul`,{className:`rounded-md border border-border bg-card/50 divide-y divide-border overflow-hidden`,children:r.skills.map(e=>(0,$.jsxs)(`li`,{className:`flex items-start hover:bg-accent`,children:[(0,$.jsxs)(L,{htmlFor:`ai-tools-skill-${e.id}`,className:`flex flex-1 cursor-pointer items-start gap-2.5 px-3 py-2.5 font-normal`,children:[(0,$.jsx)(N,{id:`ai-tools-skill-${e.id}`,checked:e.installed,disabled:v,onCheckedChange:()=>void m({kind:`skill`,id:e.id},!e.installed),className:`mt-0.5`,"data-testid":`ai-tools-skill-checkbox-${e.id}`}),(0,$.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col gap-0.5`,children:[(0,$.jsx)(`span`,{className:`text-sm font-medium text-foreground`,children:(0,$.jsx)(`code`,{children:e.name})}),(0,$.jsx)(`span`,{className:`text-xs text-muted-foreground`,"data-testid":`ai-tools-skill-status-${e.id}`,children:e.id===`discovery`?(0,$.jsx)(s,{id:`0inVGS`}):(0,$.jsx)(s,{id:`FXk_zY`})})]})]}),(0,$.jsxs)(br,{testId:`ai-tools-skill-info-${e.id}`,children:[(0,$.jsx)(`p`,{className:`opacity-70`,children:(0,$.jsx)(s,{id:`HSh8u_`})}),e.paths.map(Sr)]})]},e.id))})]}),e[29]=m,e[30]=v,e[31]=r.skills,e[32]=T):T=e[32];let E;return e[33]!==T||e[34]!==b||e[35]!==x||e[36]!==w?(E=(0,$.jsxs)(`section`,{"aria-labelledby":`settings-ai-tools-title`,className:`space-y-4`,children:[_,b,x,w,T]}),e[33]=T,e[34]=b,e[35]=x,e[36]=w,e[37]=E):E=e[37],E}function Sr(e){return(0,$.jsx)(`p`,{children:(0,$.jsx)(`code`,{className:`break-all`,children:e})},e)}function Cr(e){return(0,$.jsx)(`p`,{children:(0,$.jsx)(`code`,{className:`break-all`,children:e})},e)}function wr(e){return{chrome:e.sidebar,surface:e.background,bar:e.primary,line:e.border,dots:[e[`syntax-string`],e[`syntax-keyword`],e[`syntax-atom`]]}}function Tr(e,t,n){return e.id===`custom`?wr(ve(Cn(bn(t)))):e.base?wr(ve(e.base)):wr(Sn(n))}function Er(e){let t=(0,Z.c)(36),{theme:n,customSeed:r,defaultMode:i}=e,a,o,s,c,l,u,d,f,p;t[0]!==r||t[1]!==i||t[2]!==n?(a=Tr(n,r,i),u=!0,d=`aspect-[4/3] w-full overflow-hidden rounded-md border`,f={backgroundColor:a.surface,borderColor:a.line},p=(0,$.jsxs)(`div`,{className:`flex h-1/3 items-center gap-1 px-1.5`,style:{backgroundColor:a.chrome,borderBottom:`1px solid ${a.line}`},children:[(0,$.jsx)(`span`,{className:`h-1.5 w-5 rounded-full`,style:{backgroundColor:a.bar}}),(0,$.jsx)(`span`,{className:`h-1.5 flex-1 rounded-full opacity-50`,style:{backgroundColor:a.line}})]}),l=`flex h-2/3`,o=`flex w-1/4 flex-col items-center justify-center gap-1`,s={backgroundColor:a.chrome,borderRight:`1px solid ${a.line}`},c=a.dots.map(Dr),t[0]=r,t[1]=i,t[2]=n,t[3]=a,t[4]=o,t[5]=s,t[6]=c,t[7]=l,t[8]=u,t[9]=d,t[10]=f,t[11]=p):(a=t[3],o=t[4],s=t[5],c=t[6],l=t[7],u=t[8],d=t[9],f=t[10],p=t[11]);let m;t[12]!==o||t[13]!==s||t[14]!==c?(m=(0,$.jsx)(`div`,{className:o,style:s,children:c}),t[12]=o,t[13]=s,t[14]=c,t[15]=m):m=t[15];let h;t[16]===a.dots[1]?h=t[17]:(h=(0,$.jsx)(`span`,{className:`h-1.5 w-3/4 rounded-full`,style:{backgroundColor:a.dots[1]}}),t[16]=a.dots[1],t[17]=h);let g;t[18]===a.line?g=t[19]:(g=(0,$.jsx)(`span`,{className:`h-1.5 w-1/2 rounded-full opacity-60`,style:{backgroundColor:a.line}}),t[18]=a.line,t[19]=g);let _;t[20]===a.dots[0]?_=t[21]:(_=(0,$.jsx)(`span`,{className:`h-1.5 w-2/3 rounded-full`,style:{backgroundColor:a.dots[0]}}),t[20]=a.dots[0],t[21]=_);let v;t[22]!==h||t[23]!==g||t[24]!==_?(v=(0,$.jsxs)(`div`,{className:`flex flex-1 flex-col justify-center gap-1 px-1.5`,children:[h,g,_]}),t[22]=h,t[23]=g,t[24]=_,t[25]=v):v=t[25];let y;t[26]!==v||t[27]!==l||t[28]!==m?(y=(0,$.jsxs)(`div`,{className:l,children:[m,v]}),t[26]=v,t[27]=l,t[28]=m,t[29]=y):y=t[29];let b;return t[30]!==y||t[31]!==u||t[32]!==d||t[33]!==f||t[34]!==p?(b=(0,$.jsxs)(`div`,{"aria-hidden":u,className:d,style:f,children:[p,y]}),t[30]=y,t[31]=u,t[32]=d,t[33]=f,t[34]=p,t[35]=b):b=t[35],b}function Dr(e,t){return(0,$.jsx)(`span`,{className:`size-1.5 rounded-full`,style:{backgroundColor:e}},t)}function Or(e){let t=(0,Z.c)(11),{value:n,onSelect:r,customSeed:i,defaultMode:a,id:o,"aria-label":s,"aria-describedby":l}=e,u=a===void 0?`light`:a,{_:d}=c(),f=Te.some(e=>e.id===n)?n:`default`,p;t[0]!==d||t[1]!==i||t[2]!==u?(p=Te.map(e=>(0,$.jsxs)(ee,{value:e.id,className:g(`group/tile flex flex-col gap-1.5 rounded-lg border-2 border-transparent p-1 text-left outline-none`,`hover:bg-accent/50 focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring/40`,`data-checked:border-primary`),children:[(0,$.jsx)(Er,{theme:e,customSeed:i,defaultMode:u}),(0,$.jsxs)(`div`,{className:`flex items-center justify-between px-0.5`,children:[(0,$.jsx)(`span`,{className:`text-1sm font-medium text-foreground`,children:e.label}),(0,$.jsx)(`span`,{className:`text-[10px] font-medium uppercase tracking-wide text-muted-foreground`,children:e.id===`custom`?_n(bn(i))===`dark`?d({id:`pvnfJD`}):d({id:`1njn7W`}):e.kind===`system`?d({id:`R9Khdg`}):e.kind===`light`?d({id:`1njn7W`}):d({id:`pvnfJD`})})]})]},e.id)),t[0]=d,t[1]=i,t[2]=u,t[3]=p):p=t[3];let m;return t[4]!==l||t[5]!==s||t[6]!==o||t[7]!==r||t[8]!==f||t[9]!==p?(m=(0,$.jsx)(W,{id:o,"aria-label":s,"aria-describedby":l,value:f,onValueChange:r,className:`grid w-full grid-cols-2 gap-2 sm:grid-cols-3`,children:p}),t[4]=l,t[5]=s,t[6]=o,t[7]=r,t[8]=f,t[9]=p,t[10]=m):m=t[10],m}function kr(e,t){if(e.length===0)throw Error(`buildPatch: path must be non-empty`);let[n,...r]=e;return r.length===0?{[String(n)]:t}:{[String(n)]:kr(r,t)}}function Ar(e){let t=e;for(let e=0;e<16;e++){if(t==null)return;let e=t?._zod?.def;if(e?.type===`default`){let t=e.defaultValue;return typeof t==`function`?t():t}let n=t?._zod?.def?.innerType;if(n===void 0)return;t=n}}function jr(e){let t=e;for(let e=0;e<16;e++){if(t==null)return;let e=t?._zod?.def;if(!e)return;if(e.type===`default`||e.type===`optional`||e.type===`nullable`){t=e.innerType;continue}return e.type}}function Mr(e){let t=e;for(let e=0;e<16;e++){if(t==null)return;let e=t?._zod?.def;if(!e)return;if(e.type===`enum`)return e.entries?Object.values(e.entries):void 0;if(e.innerType!==void 0){t=e.innerType;continue}return}}function Nr(e){if(!Pe(e)||e.code!==`SCHEMA_INVALID`)return null;let t=e.issues[0];return!t||t.path.length===0?null:t.path.map(String).join(`.`)}function Pr(){let e=(0,Z.c)(3),t,n;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsx)(kn,{className:`h-5 w-32`}),n=(0,$.jsx)(kn,{className:`h-4 w-64`}),e[0]=t,e[1]=n):(t=e[0],n=e[1]);let r;return e[2]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,$.jsxs)(`div`,{className:`space-y-3`,children:[t,n,(0,$.jsxs)(`div`,{className:`space-y-2`,children:[(0,$.jsx)(kn,{className:`h-9 w-full`}),(0,$.jsx)(kn,{className:`h-9 w-full`})]})]}),e[2]=r):r=e[2],r}function Fr({field:e,scope:t,commitField:n,isFlashed:r}){"use no memo";let{_:i}=c(),a=Qn(),o=De(Ae,e.path),l=o?jr(o):void 0,u=o?Ar(o):void 0,d=o?Mr(o):void 0,f=o?Me(o):void 0,p=f?.scope===`project`&&t!==`project`||f?.scope===`user`&&t!==`user`,m=e.path.join(`.`),h=i(e.label),[_,S]=(0,Q.useState)(!1),C=(0,Q.useRef)(null);(0,Q.useEffect)(()=>()=>{C.current&&clearTimeout(C.current)},[]);let w=()=>{S(!0),C.current&&clearTimeout(C.current),C.current=setTimeout(()=>S(!1),1200)},T=()=>{let e=n(m);return e&&w(),e},E=()=>a.getFieldState(m).isDirty?T():!0,D=()=>{let e=u===void 0?null:u;a.setValue(m,e,{shouldDirty:!1}),T()},O=g(`relative`,r&&`animate-settings-flash`);return(0,$.jsx)(Yn,{control:a.control,name:m,render:({field:n})=>{let r=!p&&(u!==void 0||n.value!==void 0);return(0,$.jsxs)(qn,{className:O,"data-field":e.path.join(`.`),"data-scope":t,children:[(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,$.jsx)(Zn,{className:`text-sm font-medium`,children:h}),r?(0,$.jsxs)(x,{children:[(0,$.jsx)(y,{asChild:!0,children:(0,$.jsx)(v,{variant:`ghost`,size:`icon`,className:`h-5 w-5 text-muted-foreground opacity-60 hover:opacity-100`,onClick:D,"aria-label":i({id:`lhjq3G`,values:{labelText:h}}),children:(0,$.jsx)(Zt,{className:`size-3.5`})})}),(0,$.jsx)(b,{children:(0,$.jsx)(s,{id:`L-rMC9`})})]}):null]}),e.description?(0,$.jsx)($n,{className:`text-muted-foreground text-1sm`,children:i(e.description)}):null,(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,$.jsx)(Xn,{children:(0,$.jsx)(Ir,{field:e,ctl:n,typeTag:l,enumOptions:d,onCommit:E})}),(0,$.jsx)(Br,{visible:_,srOnly:e.control===`theme-tiles`})]}),(0,$.jsx)(er,{"data-field-error":e.path.join(`.`)})]})}})}function Ir({field:e,ctl:t,typeTag:n,enumOptions:r,onCommit:i,...a}){"use no memo";let{_:o}=c(),{setTheme:s,systemTheme:l}=u(),d=Tn()?.merged??null;if(e.control===`theme-tiles`){let{id:n,...r}=a,c=d?.appearance?.customTheme,u=d?.appearance?.theme,f=u===`light`||u===`dark`?u:l===`dark`?`dark`:`light`;return(0,$.jsx)(Or,{...r,id:n,value:typeof t.value==`string`?t.value:`default`,customSeed:c,defaultMode:f,"aria-label":o(e.label),onSelect:e=>{if(xn(e,c),e===`custom`)s(_n(bn(c))===`dark`?`dark`:`light`);else{let t=Oe(e);t&&s(t)}t.onChange(e),i()}})}if(n===`boolean`)return(0,$.jsx)(U,{...a,checked:!!t.value,ref:t.ref,onCheckedChange:e=>{t.onChange(e),i()},onBlur:t.onBlur});if(n===`enum`&&r&&r.length>0&&(e.control===`enum-toggle`||r.length<=4)){let{id:n,...c}=a,l=e.path[0]===`appearance`&&e.path[1]===`theme`;return(0,$.jsx)(ne,{...c,type:`single`,value:typeof t.value==`string`?t.value:``,ref:t.ref,onValueChange:e=>{e&&(l&&s(e),t.onChange(e),i())},onBlur:t.onBlur,variant:`segmented`,size:`sm`,spacing:1,className:`bg-muted dark:bg-background p-0.5 rounded-lg`,"aria-label":o(e.label),children:r.map((e,t)=>(0,$.jsx)(q,{value:e,id:t===0?n:void 0,className:`text-1sm capitalize`,children:e},e))})}return n===`number`||n===`int`?(0,$.jsx)(Rr,{ctl:t,onCommit:i,...a}):n===`array`?(0,$.jsx)(zr,{ctl:t,onCommit:i,...a}):(0,$.jsx)(Lr,{ctl:t,onCommit:i,...a})}function Lr({ctl:e,onCommit:t,...n}){"use no memo";return(0,$.jsx)(an,{...n,value:typeof e.value==`string`?e.value:``,ref:e.ref,onChange:t=>e.onChange(t.target.value),onBlur:()=>{e.onBlur(),t()},onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),t())},className:`h-8 text-sm`})}function Rr({ctl:e,onCommit:t,...n}){"use no memo";let[r,i]=(0,Q.useState)(e.value===void 0?``:String(e.value)),a=(0,Q.useRef)(e.value);(0,Q.useEffect)(()=>{a.current!==e.value&&(i(e.value===void 0?``:String(e.value)),a.current=e.value)},[e.value]);let o=()=>{let n=Number(r);if(!Number.isFinite(n)){e.onChange(r),t();return}e.onChange(n),t(),a.current=n};return(0,$.jsx)(an,{...n,type:`number`,value:r,ref:e.ref,onChange:e=>i(e.target.value),onBlur:()=>{e.onBlur(),o()},onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),o())},className:`h-8 w-28 text-sm tabular-nums`})}function zr({ctl:e,onCommit:t,...n}){"use no memo";let r=Array.isArray(e.value)?e.value.join(`
2
2
  `):``,[i,a]=(0,Q.useState)(r),o=(0,Q.useRef)(r);(0,Q.useEffect)(()=>{let t=Array.isArray(e.value)?e.value.join(`
3
3
  `):``;t!==o.current&&(a(t),o.current=t)},[e.value]);let s=()=>{let n=i.split(`
4
4
  `).map(e=>e.trim()).filter(e=>e.length>0);e.onChange(n),t(),o.current=n.join(`
@@ -1 +1 @@
1
- import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{t as n}from"./react-f2sANaYj.js";import{t as r}from"./compiler-runtime-BfE3aGVn.js";import{c as i,i as a,n as o,s,t as c}from"./dialog-TkFkuYVg.js";import{a as l,i as u,n as d,r as f}from"./pending-receive-nav-store-Da_9JJXI.js";import{t as p}from"./miss-dialog-store-Bx4JLuKB.js";import{c as m,s as h}from"./doc-hash-BKfBCyjO.js";var g=r(),_=e(n(),1),v=t();function y(e){let t=e.split(`/`).filter(Boolean);return t.length>0?t[t.length-1]:e}function b(){let e=(0,g.c)(2),t=(0,_.useSyncExternalStore)(p.subscribe,p.getSnapshot,x);if(t===null)return null;let n;return e[0]===t?n=e[1]:(n=(0,v.jsx)(S,{nav:t},t.path),e[0]=t,e[1]=n),n}function x(){return null}function S(e){let t=(0,g.c)(29),{nav:n}=e,{state:r,refetch:_}=l(n),b;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(b=function(){p.dismiss()},t[0]=b):b=t[0];let x=b,S;t[1]===n.path?S=t[2]:(S=function(){window.location.hash=m(u(n.path)),x()},t[1]=n.path,t[2]=S);let C=S,w;t[3]!==n.branch||t[4]!==n.kind?(w=function(e){d.arm({kind:n.kind,path:e,branch:n.branch}),window.location.hash=n.kind===`folder`?m(e):h(e),x()},t[3]=n.branch,t[4]=n.kind,t[5]=w):w=t[5];let T=w,E;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(E=e=>{e||x()},t[6]=E):E=t[6];let D=r.phase,O=r.phase===`resolved`?r.resolution.verdict:void 0,k;t[7]===n.path?k=t[8]:(k=y(n.path),t[7]=n.path,t[8]=k);let A;t[9]===k?A=t[10]:(A=(0,v.jsx)(s,{children:(0,v.jsx)(i,{className:`truncate`,children:k})}),t[9]=k,t[10]=A);let j=r.phase===`pending`?`flex flex-col items-center justify-center gap-3 py-6 text-center text-sm text-muted-foreground`:`flex flex-col items-center justify-center gap-6 py-2 text-center`,M;t[11]!==n.path||t[12]!==T?(M=()=>T(n.path),t[11]=n.path,t[12]=T,t[13]=M):M=t[13];let N;t[14]!==C||t[15]!==n||t[16]!==T||t[17]!==_||t[18]!==r||t[19]!==M?(N=(0,v.jsx)(f,{nav:n,state:r,onBrowseFolder:C,onOpenRenamed:T,onEnableAutoSync:x,onSyncCompleted:_,onPullApplied:M}),t[14]=C,t[15]=n,t[16]=T,t[17]=_,t[18]=r,t[19]=M,t[20]=N):N=t[20];let P;t[21]!==N||t[22]!==j?(P=(0,v.jsx)(o,{className:j,children:N}),t[21]=N,t[22]=j,t[23]=P):P=t[23];let F;return t[24]!==r.phase||t[25]!==P||t[26]!==O||t[27]!==A?(F=(0,v.jsx)(c,{open:!0,onOpenChange:E,children:(0,v.jsxs)(a,{className:`sm:max-w-md`,"data-testid":`share-receive-miss-dialog`,"data-phase":D,"data-verdict":O,children:[A,P]})}),t[24]=r.phase,t[25]=P,t[26]=O,t[27]=A,t[28]=F):F=t[28],F}export{b as ShareReceiveMissDialog};
1
+ import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{t as n}from"./react-f2sANaYj.js";import{t as r}from"./compiler-runtime-BfE3aGVn.js";import{c as i,i as a,n as o,s,t as c}from"./dialog-TkFkuYVg.js";import{a as l,i as u,n as d,r as f}from"./pending-receive-nav-store-B6dtzPFx.js";import{t as p}from"./miss-dialog-store-Bx4JLuKB.js";import{c as m,s as h}from"./doc-hash-BKfBCyjO.js";var g=r(),_=e(n(),1),v=t();function y(e){let t=e.split(`/`).filter(Boolean);return t.length>0?t[t.length-1]:e}function b(){let e=(0,g.c)(2),t=(0,_.useSyncExternalStore)(p.subscribe,p.getSnapshot,x);if(t===null)return null;let n;return e[0]===t?n=e[1]:(n=(0,v.jsx)(S,{nav:t},t.path),e[0]=t,e[1]=n),n}function x(){return null}function S(e){let t=(0,g.c)(29),{nav:n}=e,{state:r,refetch:_}=l(n),b;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(b=function(){p.dismiss()},t[0]=b):b=t[0];let x=b,S;t[1]===n.path?S=t[2]:(S=function(){window.location.hash=m(u(n.path)),x()},t[1]=n.path,t[2]=S);let C=S,w;t[3]!==n.branch||t[4]!==n.kind?(w=function(e){d.arm({kind:n.kind,path:e,branch:n.branch}),window.location.hash=n.kind===`folder`?m(e):h(e),x()},t[3]=n.branch,t[4]=n.kind,t[5]=w):w=t[5];let T=w,E;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(E=e=>{e||x()},t[6]=E):E=t[6];let D=r.phase,O=r.phase===`resolved`?r.resolution.verdict:void 0,k;t[7]===n.path?k=t[8]:(k=y(n.path),t[7]=n.path,t[8]=k);let A;t[9]===k?A=t[10]:(A=(0,v.jsx)(s,{children:(0,v.jsx)(i,{className:`truncate`,children:k})}),t[9]=k,t[10]=A);let j=r.phase===`pending`?`flex flex-col items-center justify-center gap-3 py-6 text-center text-sm text-muted-foreground`:`flex flex-col items-center justify-center gap-6 py-2 text-center`,M;t[11]!==n.path||t[12]!==T?(M=()=>T(n.path),t[11]=n.path,t[12]=T,t[13]=M):M=t[13];let N;t[14]!==C||t[15]!==n||t[16]!==T||t[17]!==_||t[18]!==r||t[19]!==M?(N=(0,v.jsx)(f,{nav:n,state:r,onBrowseFolder:C,onOpenRenamed:T,onEnableAutoSync:x,onSyncCompleted:_,onPullApplied:M}),t[14]=C,t[15]=n,t[16]=T,t[17]=_,t[18]=r,t[19]=M,t[20]=N):N=t[20];let P;t[21]!==N||t[22]!==j?(P=(0,v.jsx)(o,{className:j,children:N}),t[21]=N,t[22]=j,t[23]=P):P=t[23];let F;return t[24]!==r.phase||t[25]!==P||t[26]!==O||t[27]!==A?(F=(0,v.jsx)(c,{open:!0,onOpenChange:E,children:(0,v.jsxs)(a,{className:`sm:max-w-md`,"data-testid":`share-receive-miss-dialog`,"data-phase":D,"data-verdict":O,children:[A,P]})}),t[24]=r.phase,t[25]=P,t[26]=O,t[27]=A,t[28]=F):F=t[28],F}export{b as ShareReceiveMissDialog};
@@ -1 +1 @@
1
- import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{t as n}from"./react-f2sANaYj.js";import{n as r}from"./dist-Nvb76hAm.js";import{t as i}from"./compiler-runtime-BfE3aGVn.js";import{s as ee}from"./createLucideIcon-DAkhoPjT.js";import{t as a}from"./button-Gol9BgNB.js";import{a as o,m as te,n as s,o as ne,r as c,t as re,u as l}from"./dropdown-menu-xw8WTdb-.js";import{I as ie,It as u}from"./dist-CYN1QNvi.js";import{t as d}from"./chevron-down-Bx9f3tW-.js";import{i as ae,r as oe}from"./skill-actions-BgdyM_G0.js";var se=i(),f=e(n(),1),p=t(),m=u.options;function h(e){let t=(0,se.c)(74),{scope:n,name:i}=e,u=ae(),h=oe(),g;t[0]!==i||t[1]!==n||t[2]!==u.data||t[3]!==u.status?(g=u.status===`ready`?u.data.find(e=>e.scope===n&&e.name===i):void 0,t[0]=i,t[1]=n,t[2]=u.data,t[3]=u.status,t[4]=g):g=t[4];let _=g,v;t[5]!==_||t[6]!==i||t[7]!==n?(v=_??{scope:n,name:i,path:i,description:``,installed:!1,hosts:[]},t[5]=_,t[6]=i,t[7]=n,t[8]=v):v=t[8];let y=v,b=h.installingName===i,[x,S]=(0,f.useState)(null),C=x??y.hosts,w;t[9]===C?w=t[10]:(w=new Set(C),t[9]=C,t[10]=w);let T=w,E=x?x.length>0:y.installed,D=(0,f.useRef)(y.hosts),O,k;t[11]!==x||t[12]!==y.hosts?(O=()=>{x===null&&(D.current=y.hosts)},k=[x,y.hosts],t[11]=x,t[12]=y.hosts,t[13]=O,t[14]=k):(O=t[13],k=t[14]),(0,f.useEffect)(O,k);let A;t[15]===y.hosts?A=t[16]:(A=[...y.hosts].sort().join(`,`),t[15]=y.hosts,t[16]=A);let j=A,M,N;t[17]===j?(M=t[18],N=t[19]):(M=()=>{S(e=>e&&[...e].sort().join(`,`)===j?null:e)},N=[j],t[17]=j,t[18]=M,t[19]=N),(0,f.useEffect)(M,N);let P=(0,f.useRef)(null),F,I;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(I=()=>()=>{P.current&&clearTimeout(P.current)},F=[],t[20]=F,t[21]=I):(F=t[20],I=t[21]),(0,f.useEffect)(I,F);let L,R,z,B,V,H,U,W,G;if(t[22]!==h||t[23]!==T||t[24]!==E||t[25]!==b||t[26]!==y){z=function(e,t){D.current=e,S(e),P.current&&clearTimeout(P.current);let n=async()=>{(await h.install(y,e)).ok||S(null)};t?P.current=setTimeout(()=>void n(),350):n()};let e=function(e,t){let n=new Set(D.current);t?n.add(e):n.delete(e),z([...n],!0)};G=`flex items-center gap-1.5`,R=re;let n=E?`installed`:`draft`,i=E?`border-primary/50 bg-primary/5 text-primary hover:bg-primary/10 hover:text-primary`:`border-yellow-500/40 bg-yellow-500/10 text-yellow-600 hover:bg-yellow-500/20 hover:text-yellow-600`,o;t[36]===i?o=t[37]:(o=ee(`h-6 gap-1 rounded-sm border px-1.5 font-mono text-xs uppercase shadow-none`,i),t[36]=i,t[37]=o);let l;t[38]!==E||t[39]!==b?(l=b?(0,p.jsx)(r,{id:`b4itZn`}):E?(0,p.jsx)(r,{id:`eQkgKV`}):(0,p.jsx)(r,{id:`eneWvv`}),t[38]=E,t[39]=b,t[40]=l):l=t[40];let u;t[41]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,p.jsx)(d,{"aria-hidden":!0}),t[41]=u):u=t[41],t[42]!==b||t[43]!==n||t[44]!==o||t[45]!==l?(W=(0,p.jsx)(te,{asChild:!0,children:(0,p.jsxs)(a,{variant:`outline`,size:`sm`,disabled:b,"data-testid":`skill-install-menu-trigger`,"data-state":n,className:o,children:[l,u]})}),t[42]=b,t[43]=n,t[44]=o,t[45]=l,t[46]=W):W=t[46],L=c,B=`end`,V=`min-w-52`,t[47]===Symbol.for(`react.memo_cache_sentinel`)?(H=(0,p.jsx)(ne,{children:(0,p.jsx)(r,{id:`npcziF`})}),t[47]=H):H=t[47],U=m.map(t=>(0,p.jsx)(s,{checked:T.has(t),onCheckedChange:n=>e(t,n===!0),"data-testid":`skill-install-editor-${t}`,children:ie[t]},t)),t[22]=h,t[23]=T,t[24]=E,t[25]=b,t[26]=y,t[27]=L,t[28]=R,t[29]=z,t[30]=B,t[31]=V,t[32]=H,t[33]=U,t[34]=W,t[35]=G}else L=t[27],R=t[28],z=t[29],B=t[30],V=t[31],H=t[32],U=t[33],W=t[34],G=t[35];let K;t[48]===Symbol.for(`react.memo_cache_sentinel`)?(K=(0,p.jsx)(l,{}),t[48]=K):K=t[48];let q;t[49]===z?q=t[50]:(q=()=>z([...m],!1),t[49]=z,t[50]=q);let J;t[51]===Symbol.for(`react.memo_cache_sentinel`)?(J=(0,p.jsx)(r,{id:`x-5mJ1`}),t[51]=J):J=t[51];let Y;t[52]===q?Y=t[53]:(Y=(0,p.jsx)(o,{"data-testid":`skill-install-all`,onSelect:q,children:J}),t[52]=q,t[53]=Y);let X;t[54]!==h||t[55]!==E||t[56]!==y?(X=E?(0,p.jsx)(o,{"data-testid":`skill-uninstall`,onSelect:()=>{P.current&&clearTimeout(P.current),D.current=[],S([]),(async()=>{(await h.uninstall(y)).ok||S(null)})()},children:(0,p.jsx)(r,{id:`t422_7`})}):null,t[54]=h,t[55]=E,t[56]=y,t[57]=X):X=t[57];let Z;t[58]!==L||t[59]!==B||t[60]!==V||t[61]!==H||t[62]!==U||t[63]!==Y||t[64]!==X?(Z=(0,p.jsxs)(L,{align:B,className:V,children:[H,U,K,Y,X]}),t[58]=L,t[59]=B,t[60]=V,t[61]=H,t[62]=U,t[63]=Y,t[64]=X,t[65]=Z):Z=t[65];let Q;t[66]!==R||t[67]!==W||t[68]!==Z?(Q=(0,p.jsxs)(R,{children:[W,Z]}),t[66]=R,t[67]=W,t[68]=Z,t[69]=Q):Q=t[69];let $;return t[70]!==h.dialogs||t[71]!==G||t[72]!==Q?($=(0,p.jsxs)(`div`,{className:G,children:[Q,h.dialogs]}),t[70]=h.dialogs,t[71]=G,t[72]=Q,t[73]=$):$=t[73],$}export{h as SkillEditorActions};
1
+ import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{t as n}from"./react-f2sANaYj.js";import{n as r}from"./dist-Nvb76hAm.js";import{t as i}from"./compiler-runtime-BfE3aGVn.js";import{s as ee}from"./createLucideIcon-DAkhoPjT.js";import{t as a}from"./button-Gol9BgNB.js";import{a as o,m as te,n as s,o as ne,r as c,t as re,u as l}from"./dropdown-menu-xw8WTdb-.js";import{I as ie,It as u}from"./dist-CYN1QNvi.js";import{t as d}from"./chevron-down-Bx9f3tW-.js";import{i as ae,r as oe}from"./skill-actions-C5Jj4vq_.js";var se=i(),f=e(n(),1),p=t(),m=u.options;function h(e){let t=(0,se.c)(74),{scope:n,name:i}=e,u=ae(),h=oe(),g;t[0]!==i||t[1]!==n||t[2]!==u.data||t[3]!==u.status?(g=u.status===`ready`?u.data.find(e=>e.scope===n&&e.name===i):void 0,t[0]=i,t[1]=n,t[2]=u.data,t[3]=u.status,t[4]=g):g=t[4];let _=g,v;t[5]!==_||t[6]!==i||t[7]!==n?(v=_??{scope:n,name:i,path:i,description:``,installed:!1,hosts:[]},t[5]=_,t[6]=i,t[7]=n,t[8]=v):v=t[8];let y=v,b=h.installingName===i,[x,S]=(0,f.useState)(null),C=x??y.hosts,w;t[9]===C?w=t[10]:(w=new Set(C),t[9]=C,t[10]=w);let T=w,E=x?x.length>0:y.installed,D=(0,f.useRef)(y.hosts),O,k;t[11]!==x||t[12]!==y.hosts?(O=()=>{x===null&&(D.current=y.hosts)},k=[x,y.hosts],t[11]=x,t[12]=y.hosts,t[13]=O,t[14]=k):(O=t[13],k=t[14]),(0,f.useEffect)(O,k);let A;t[15]===y.hosts?A=t[16]:(A=[...y.hosts].sort().join(`,`),t[15]=y.hosts,t[16]=A);let j=A,M,N;t[17]===j?(M=t[18],N=t[19]):(M=()=>{S(e=>e&&[...e].sort().join(`,`)===j?null:e)},N=[j],t[17]=j,t[18]=M,t[19]=N),(0,f.useEffect)(M,N);let P=(0,f.useRef)(null),F,I;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(I=()=>()=>{P.current&&clearTimeout(P.current)},F=[],t[20]=F,t[21]=I):(F=t[20],I=t[21]),(0,f.useEffect)(I,F);let L,R,z,B,V,H,U,W,G;if(t[22]!==h||t[23]!==T||t[24]!==E||t[25]!==b||t[26]!==y){z=function(e,t){D.current=e,S(e),P.current&&clearTimeout(P.current);let n=async()=>{(await h.install(y,e)).ok||S(null)};t?P.current=setTimeout(()=>void n(),350):n()};let e=function(e,t){let n=new Set(D.current);t?n.add(e):n.delete(e),z([...n],!0)};G=`flex items-center gap-1.5`,R=re;let n=E?`installed`:`draft`,i=E?`border-primary/50 bg-primary/5 text-primary hover:bg-primary/10 hover:text-primary`:`border-yellow-500/40 bg-yellow-500/10 text-yellow-600 hover:bg-yellow-500/20 hover:text-yellow-600`,o;t[36]===i?o=t[37]:(o=ee(`h-6 gap-1 rounded-sm border px-1.5 font-mono text-xs uppercase shadow-none`,i),t[36]=i,t[37]=o);let l;t[38]!==E||t[39]!==b?(l=b?(0,p.jsx)(r,{id:`b4itZn`}):E?(0,p.jsx)(r,{id:`eQkgKV`}):(0,p.jsx)(r,{id:`eneWvv`}),t[38]=E,t[39]=b,t[40]=l):l=t[40];let u;t[41]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,p.jsx)(d,{"aria-hidden":!0}),t[41]=u):u=t[41],t[42]!==b||t[43]!==n||t[44]!==o||t[45]!==l?(W=(0,p.jsx)(te,{asChild:!0,children:(0,p.jsxs)(a,{variant:`outline`,size:`sm`,disabled:b,"data-testid":`skill-install-menu-trigger`,"data-state":n,className:o,children:[l,u]})}),t[42]=b,t[43]=n,t[44]=o,t[45]=l,t[46]=W):W=t[46],L=c,B=`end`,V=`min-w-52`,t[47]===Symbol.for(`react.memo_cache_sentinel`)?(H=(0,p.jsx)(ne,{children:(0,p.jsx)(r,{id:`npcziF`})}),t[47]=H):H=t[47],U=m.map(t=>(0,p.jsx)(s,{checked:T.has(t),onCheckedChange:n=>e(t,n===!0),"data-testid":`skill-install-editor-${t}`,children:ie[t]},t)),t[22]=h,t[23]=T,t[24]=E,t[25]=b,t[26]=y,t[27]=L,t[28]=R,t[29]=z,t[30]=B,t[31]=V,t[32]=H,t[33]=U,t[34]=W,t[35]=G}else L=t[27],R=t[28],z=t[29],B=t[30],V=t[31],H=t[32],U=t[33],W=t[34],G=t[35];let K;t[48]===Symbol.for(`react.memo_cache_sentinel`)?(K=(0,p.jsx)(l,{}),t[48]=K):K=t[48];let q;t[49]===z?q=t[50]:(q=()=>z([...m],!1),t[49]=z,t[50]=q);let J;t[51]===Symbol.for(`react.memo_cache_sentinel`)?(J=(0,p.jsx)(r,{id:`x-5mJ1`}),t[51]=J):J=t[51];let Y;t[52]===q?Y=t[53]:(Y=(0,p.jsx)(o,{"data-testid":`skill-install-all`,onSelect:q,children:J}),t[52]=q,t[53]=Y);let X;t[54]!==h||t[55]!==E||t[56]!==y?(X=E?(0,p.jsx)(o,{"data-testid":`skill-uninstall`,onSelect:()=>{P.current&&clearTimeout(P.current),D.current=[],S([]),(async()=>{(await h.uninstall(y)).ok||S(null)})()},children:(0,p.jsx)(r,{id:`t422_7`})}):null,t[54]=h,t[55]=E,t[56]=y,t[57]=X):X=t[57];let Z;t[58]!==L||t[59]!==B||t[60]!==V||t[61]!==H||t[62]!==U||t[63]!==Y||t[64]!==X?(Z=(0,p.jsxs)(L,{align:B,className:V,children:[H,U,K,Y,X]}),t[58]=L,t[59]=B,t[60]=V,t[61]=H,t[62]=U,t[63]=Y,t[64]=X,t[65]=Z):Z=t[65];let Q;t[66]!==R||t[67]!==W||t[68]!==Z?(Q=(0,p.jsxs)(R,{children:[W,Z]}),t[66]=R,t[67]=W,t[68]=Z,t[69]=Q):Q=t[69];let $;return t[70]!==h.dialogs||t[71]!==G||t[72]!==Q?($=(0,p.jsxs)(`div`,{className:G,children:[Q,h.dialogs]}),t[70]=h.dialogs,t[71]=G,t[72]=Q,t[73]=$):$=t[73],$}export{h as SkillEditorActions};
@@ -1 +1 @@
1
- import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{E as n,Lt as r,N as i,mt as a,ot as o,st as s,yt as c,zt as ee}from"./DocumentContext-FCJwmuAo.js";import{t as l}from"./react-f2sANaYj.js";import{n as u}from"./dist-PQ5KMVDh.js";import{t as d}from"./compiler-runtime-BfE3aGVn.js";import{D as f,a as p,i as te,o as ne}from"./CodeMirrorPropInput-B4tL-3Ht.js";import{O as m,Yi as re,fi as h,kr as g,z as _}from"./dist-CYN1QNvi.js";import{g as ie}from"./use-settings-route-Ch_E9Uw0.js";import"./config-provider-CvXAYjor.js";import{Dt as v,E as y,Et as b,Ft as ae,It as x,J as S,N as C,Ot as oe,P as w,Q as T,X as E,_ as D,ct as O,dt as se,f as k,ft as A,ht as j,l as M,lt as N,mt as ce,nt as P,rt as F,st as I,tt as L,y as R}from"./dist-DNwOaDhC.js";import{o as le,r as z}from"./esm-HV7Pxfbn.js";import{i as B,n as V,o as H,r as U}from"./dist-CiPafPDy.js";import{n as ue}from"./config-context-gd3BC-iY.js";import{A as de,D as fe,T as pe,c as me,g as he,n as ge,r as _e,v as W,w as ve,x as ye}from"./typing-burst-detector-rVKisiec.js";import{o as be,r as xe}from"./selection-context-np7NtN5p.js";import{l as Se}from"./lint-config-client-bcseyVIk.js";import{a as Ce,i as G,n as K,o as q,r as J,t as Y}from"./dist-ChSSPf9y.js";import{n as we,t as Te}from"./src-D452d0cv.js";var X=e(l(),1),Ee=d();function De(e,t){return e.enabled?[Y(),J(async n=>Q(n.state.doc,await g(n.state.doc.toString(),e,t)),{delay:600})]:[]}function Z(e,t){let n=Math.min(Math.max(t.line+1,1),e.lines),r=e.line(n);return Math.min(r.from+Math.max(0,t.character),r.to)}function Q(e,t){let n=[];for(let r of t){let t=Z(e,r.range.start),i=Z(e,r.range.end),a={from:t,to:Math.max(i,t),severity:r.severity,message:r.message,source:`${r.source}/${r.code}`},o=$(r);o&&(a.actions=[o]),n.push(a)}return n}function $(e){let t=e.fixes;return!t||t.length===0?null:{name:`Fix`,apply(e){let n=e.state.doc;e.dispatch({changes:t.map(e=>({from:Z(n,e.range.start),to:Z(n,e.range.end),insert:e.newText}))})}}}var Oe=[A(),O(),N(),D(),P(),F(),oe.allowMultipleSelections.of(!0),y(),C(k,{fallback:!0}),M(),U(),V(),j(),L(),I(),G(),se.of([...B,...z,...q,...R,...H,...K])],ke=S.mark({class:`cm-link-ref-broken`}),Ae=/^\s{0,3}\[([^\]]+)\]:\s/,je=/\[([^\]]*)\]\[([^\]]*)\]/g,Me=new Set([`FencedCode`,`CodeBlock`,`InlineCode`]);function Ne(e,t){let n=0,r=t.length-1;for(;n<=r;){let i=n+r>>1,a=t[i];if(e<a.from)r=i-1;else if(e>=a.to)n=i+1;else return!0}return!1}function Pe(e){let t=[];return w(e).iterate({enter(e){if(Me.has(e.name))return t.push({from:e.from,to:e.to}),!1}}),t.sort((e,t)=>e.from-t.from),t}function Fe(e){let t=new Set,n=[],r=e.doc,i=Pe(e);for(let e=1;e<=r.lines;e++){let n=r.line(e);if(Ne(n.from,i))continue;let a=Ae.exec(n.text);a&&t.add(a[1].toLowerCase())}for(let e=1;e<=r.lines;e++){let t=r.line(e);if(!Ne(t.from,i)&&!Ae.test(t.text))for(je.lastIndex=0;;){let e=je.exec(t.text);if(!e)break;let r=t.from+e.index;if(Ne(r,i))continue;let a=e[2]||e[1];n.push({from:r,to:r+e[0].length,label:a.toLowerCase()})}}let a=[];for(let e of n)t.has(e.label)||a.push(ke.range(e.from,e.to));return a.sort((e,t)=>e.from-t.from),S.set(a)}var Ie=x.define({create(e){return Fe(e)},update(e,t){return t.docChanged?Fe(t.state):e},provide:e=>E.decorations.from(e)}),Le=/^(\s*(?:[-*+]|\d+[.)]) (?:\[[ x]\] )?)/,Re=S.mark({class:`cm-del`}),ze=S.line({class:`cm-table-header`,attributes:{style:`--list-hang: 2ch`}}),Be=S.line({class:`cm-table-row`,attributes:{style:`--list-hang: 2ch`}});function Ve(e){let t=0;for(let n of e)if(n===` `)t++;else if(n===` `)t+=4;else break;return t}function He(e){if(e.doc.lines<2)return null;let t=e.doc.line(1);if(!_.test(t.text))return null;for(let n=2;n<=e.doc.lines;n++){let r=e.doc.line(n);if(_.test(r.text))return{from:t.from,to:r.to}}return null}function Ue(e,t){let n=[],r=w(e),i=He(e),a=e=>i!==null&&e>=i.from&&e<=i.to;for(let{from:i,to:o}of t)r.iterate({from:i,to:o,enter(t){if(!a(t.from)){if(t.name===`Strikethrough`){let e=t.from,r=t.to,i=t.node.cursor();if(i.firstChild())do i.name===`StrikethroughMark`&&(i.from===t.from?e=i.to:r=i.from);while(i.nextSibling());return e<r&&n.push(Re.range(e,r)),!1}if(t.name===`ListItem`){let r=e.doc.lineAt(t.from),i=Le.exec(r.text),a=i?i[1].length:2,o=S.line({class:`cm-list-item`,attributes:{style:`--list-hang: ${a}ch`}});n.push(o.range(r.from));return}if(t.name===`FencedCode`){let r=e.doc.lineAt(t.from),i=e.doc.lineAt(t.to);for(let t=r.number+1;t<i.number;t++){let r=e.doc.line(t),i=Ve(r.text),a=S.line({class:`cm-fenced-code-line`,attributes:{style:`--line-indent: ${i}`}});n.push(a.range(r.from))}return!1}if(t.name===`TableHeader`){let r=e.doc.lineAt(t.from);return n.push(ze.range(r.from)),!1}if(t.name===`TableRow`){let r=e.doc.lineAt(t.from);return n.push(Be.range(r.from)),!1}if(t.name===`TableDelimiter`&&t.node.parent?.name===`Table`){let r=e.doc.lineAt(t.from);return n.push(Be.range(r.from)),!1}}}});return n.sort((e,t)=>e.from-t.from||e.value.startSide-t.value.startSide),S.set(n)}var We=class{decorations;constructor(e){this.decorations=Ue(e.state,e.visibleRanges)}update(e){(e.docChanged||e.viewportChanged||w(e.startState)!==w(e.state))&&(this.decorations=Ue(e.view.state,e.view.visibleRanges))}},Ge=T.fromClass(We,{decorations:e=>e.decorations});function Ke(){return[Ge,Ie]}var qe=t(),Je=56,Ye=ae.define();function Xe(e,t,n){let r=W(e.state.doc)[t.index];r&&c(n,()=>{e.dispatch({selection:v.cursor(r.from),effects:E.scrollIntoView(r.from,{y:`start`})}),e.focus()})}function Ze(e,t,n,r){requestAnimationFrame(()=>{if(!n())return;let i=e.state.doc,a=Math.min(t.offset,i.length);c(r,()=>{e.dispatch({selection:v.cursor(a),effects:E.scrollIntoView(a,{y:`center`})}),e.focus()})})}function Qe(e,t,n){let r=e.state.doc,i=Math.min(Math.max(t.line,1),r.lines),a=r.line(i),o=Math.min(a.from+Math.max(0,t.column-1),a.to);c(n,()=>{e.dispatch({selection:v.cursor(o),effects:E.scrollIntoView(o,{y:`start`})}),e.focus()})}function $e(e){let t=(0,Ee.c)(50),{docName:c,ytext:l,provider:d,placeholder:f,isSourceModeActive:g}=e,_=(0,X.useRef)(null),v=(0,X.useRef)(null),[y,ae]=(0,X.useState)(null);if(y)throw y;let{resolvedTheme:x}=u(),{merged:S}=ue(),C=(0,X.useRef)(g),w=S?.editor?.wordWrap??!0,{data:T}=Se(c),D;t[0]!==T?.effective||t[1]!==S?(D=T?.effective??(S?.contentRules?h(S.contentRules):m),t[0]=T?.effective,t[1]=S,t[2]=D):D=t[2];let O=D,k;t[3]===O?k=t[4]:(k=JSON.stringify(O),t[3]=O,t[4]=k);let A=k,j,M;t[5]===g?(j=t[6],M=t[7]):(j=()=>{C.current=g},M=[g],t[5]=g,t[6]=j,t[7]=M),(0,X.useEffect)(j,M);let N=(0,X.useRef)(null),P;t[8]!==c||t[9]!==O||t[10]!==f||t[11]!==d||t[12]!==x||t[13]!==w||t[14]!==l?(P=()=>{let e=_.current;if(!e)return;let t=d.configuration.name??``,u,p=tt;try{u=o({docName:t,container:e,sizeStats:{viewCount:0,bytes:l.length},factory:e=>{let r=null,o=n({ydoc:d.document,ytext:l}),s=new b,ee=new b,u=new b,ne=new b,m=new E({state:oe.create({doc:l.toString(),extensions:[Oe,Ce({scrollToMatch:e=>a(t)?E.scrollIntoView(e,{y:`start`}):Ye.of(null)}),se.of([le]),Te(l,d.awareness),se.of(we),...te({themeCompartment:s,resolvedTheme:x,ydoc:d.document,wordWrapCompartment:ee,wordWrap:w,currentDocName:t}),Ke(),de(),ne.of(De(O,c)),o,E.updateListener.of(e=>{!e.selectionSet&&!e.docChanged||(r!==null&&clearTimeout(r),r=setTimeout(()=>{r=null,ge(t,`source`,_e(e.view)),xe(t,`source`,be(e.view,t))},120))}),E.domEventHandlers({keydown:(e,t)=>!C.current||!re()||!ie(e,`edit-with-ai`)?!1:(e.preventDefault(),e.stopPropagation(),e.stopImmediatePropagation(),i(),!0)}),u.of(ce(f??``)),E.theme({"&":{height:`100%`}}),E.scrollMargins.of(et)]}),parent:e});ge(t,`source`,_e(m)),xe(t,`source`,be(m,t));let h=m.contentDOM;return h.addEventListener(`keydown`,p),h.addEventListener(`paste`,p),h.addEventListener(`drop`,p),h.addEventListener(`cut`,p),{view:m,ydoc:d.document,ytext:l,provider:d,themeCompartment:s,wordWrapCompartment:ee,placeholderCompartment:u,lintCompartment:ne}}}),N.current=u,v.current=u.view,r(c,u.view)}catch(e){let t=e;console.error(`[SourceEditor] mountCmEditor failed`,t),N.current=null,v.current=null,ae(t instanceof Error?t:Error(String(t)))}return()=>{let e=N.current;e&&(s(e),ee(c,e.view)),N.current=null,v.current=null}},t[8]=c,t[9]=O,t[10]=f,t[11]=d,t[12]=x,t[13]=w,t[14]=l,t[15]=P):P=t[15];let F;t[16]!==d||t[17]!==l?(F=[l,d],t[16]=d,t[17]=l,t[18]=F):F=t[18],(0,X.useEffect)(P,F);let I,L;t[19]===c?(I=t[20],L=t[21]):(I=()=>{},L=[c],t[19]=c,t[20]=I,t[21]=L),(0,X.useEffect)(I,L);let R,z;t[22]===x?(R=t[23],z=t[24]):(z=()=>{let e=N.current;e&&e.view.dispatch({effects:e.themeCompartment.reconfigure(x===`dark`?p:ne)})},R=[x],t[22]=x,t[23]=R,t[24]=z),(0,X.useEffect)(z,R);let B,V;t[25]===w?(B=t[26],V=t[27]):(B=()=>{let e=N.current;e&&e.view.dispatch({effects:e.wordWrapCompartment.reconfigure(w?E.lineWrapping:[])})},V=[w],t[25]=w,t[26]=B,t[27]=V),(0,X.useEffect)(B,V);let H,U;t[28]===f?(H=t[29],U=t[30]):(H=()=>{let e=N.current;e&&e.view.dispatch({effects:e.placeholderCompartment.reconfigure(ce(f??``))})},U=[f],t[28]=f,t[29]=H,t[30]=U),(0,X.useEffect)(H,U);let W;t[31]!==c||t[32]!==O?(W=()=>{let e=N.current;e&&e.view.dispatch({effects:e.lintCompartment.reconfigure(De(O,c))})},t[31]=c,t[32]=O,t[33]=W):W=t[33];let G;t[34]===A?G=t[35]:(G=[A],t[34]=A,t[35]=G),(0,X.useEffect)(W,G);let K,q;t[36]!==c||t[37]!==g?(K=()=>{let e=function(e){let t=e.detail;if(!t||t.mode!==`source`||!g)return;let n=v.current;n&&(Xe(n,t,c),ve(c))};return window.addEventListener(he,e),()=>window.removeEventListener(he,e)},q=[c,g],t[36]=c,t[37]=g,t[38]=K,t[39]=q):(K=t[38],q=t[39]),(0,X.useEffect)(K,q);let J,Y;t[40]!==c||t[41]!==g?(J=()=>{let e=function(e){let t=e.detail;if(!t||!g)return;let n=v.current;n&&(Qe(n,t,c),ve(c))};return window.addEventListener(me,e),()=>window.removeEventListener(me,e)},Y=[c,g],t[40]=c,t[41]=g,t[42]=J,t[43]=Y):(J=t[42],Y=t[43]),(0,X.useEffect)(J,Y);let Z,Q;t[44]!==c||t[45]!==g||t[46]!==d?(Z=()=>{if(!g)return;let e=v.current;if(!e)return;let t=fe(c);if(!t)return;if(t.kind!==`selection-offset`){pe(c),t.kind===`outline`?Xe(e,t.detail,c):t.kind===`lint`?Qe(e,t.detail,c):t.kind===`raw-mdx`&&Ze(e,t.detail,()=>C.current,c);return}let n=!1,r=null;return queueMicrotask(()=>{if(n)return;let t=fe(c);t?.kind===`selection-offset`&&(r=ye({view:e,docName:c,navigation:t,ydoc:d.document,transition:{from:`wysiwyg`,to:`source`}}),r&&pe(c))}),()=>{n=!0,r?.cancel(`mode-flip`)}},Q=[c,g,d],t[44]=c,t[45]=g,t[46]=d,t[47]=Z,t[48]=Q):(Z=t[47],Q=t[48]),(0,X.useEffect)(Z,Q);let $;return t[49]===Symbol.for(`react.memo_cache_sentinel`)?($=(0,qe.jsx)(`div`,{ref:_,className:`source-editor h-full pb-3`}),t[49]=$):$=t[49],$}function et(){return{top:Je}}function tt(){return f()}export{$e as SourceEditor,Ze as applyRawMdxNavigation};
1
+ import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{E as n,Lt as r,N as i,mt as a,ot as o,st as s,yt as c,zt as ee}from"./DocumentContext-B-29n_HL.js";import{t as l}from"./react-f2sANaYj.js";import{n as u}from"./dist-PQ5KMVDh.js";import{t as d}from"./compiler-runtime-BfE3aGVn.js";import{D as f,a as p,i as te,o as ne}from"./CodeMirrorPropInput-CUPvWzYm.js";import{O as m,Yi as re,fi as h,kr as g,z as _}from"./dist-CYN1QNvi.js";import{g as ie}from"./use-settings-route-Ch_E9Uw0.js";import"./config-provider--LBV5X-F.js";import{Dt as v,E as y,Et as b,Ft as ae,It as x,J as S,N as C,Ot as oe,P as w,Q as T,X as E,_ as D,ct as O,dt as se,f as k,ft as A,ht as j,l as M,lt as N,mt as ce,nt as P,rt as F,st as I,tt as L,y as R}from"./dist-DNwOaDhC.js";import{o as le,r as z}from"./esm-HV7Pxfbn.js";import{i as B,n as V,o as H,r as U}from"./dist-CiPafPDy.js";import{n as ue}from"./config-context-gd3BC-iY.js";import{A as de,D as fe,T as pe,c as me,g as he,n as ge,r as _e,v as W,w as ve,x as ye}from"./typing-burst-detector-ZNMuwopa.js";import{o as be,r as xe}from"./selection-context-B2HcUOkN.js";import{l as Se}from"./lint-config-client-bcseyVIk.js";import{a as Ce,i as G,n as K,o as q,r as J,t as Y}from"./dist-ChSSPf9y.js";import{n as we,t as Te}from"./src-CttimVGm.js";var X=e(l(),1),Ee=d();function De(e,t){return e.enabled?[Y(),J(async n=>Q(n.state.doc,await g(n.state.doc.toString(),e,t)),{delay:600})]:[]}function Z(e,t){let n=Math.min(Math.max(t.line+1,1),e.lines),r=e.line(n);return Math.min(r.from+Math.max(0,t.character),r.to)}function Q(e,t){let n=[];for(let r of t){let t=Z(e,r.range.start),i=Z(e,r.range.end),a={from:t,to:Math.max(i,t),severity:r.severity,message:r.message,source:`${r.source}/${r.code}`},o=$(r);o&&(a.actions=[o]),n.push(a)}return n}function $(e){let t=e.fixes;return!t||t.length===0?null:{name:`Fix`,apply(e){let n=e.state.doc;e.dispatch({changes:t.map(e=>({from:Z(n,e.range.start),to:Z(n,e.range.end),insert:e.newText}))})}}}var Oe=[A(),O(),N(),D(),P(),F(),oe.allowMultipleSelections.of(!0),y(),C(k,{fallback:!0}),M(),U(),V(),j(),L(),I(),G(),se.of([...B,...z,...q,...R,...H,...K])],ke=S.mark({class:`cm-link-ref-broken`}),Ae=/^\s{0,3}\[([^\]]+)\]:\s/,je=/\[([^\]]*)\]\[([^\]]*)\]/g,Me=new Set([`FencedCode`,`CodeBlock`,`InlineCode`]);function Ne(e,t){let n=0,r=t.length-1;for(;n<=r;){let i=n+r>>1,a=t[i];if(e<a.from)r=i-1;else if(e>=a.to)n=i+1;else return!0}return!1}function Pe(e){let t=[];return w(e).iterate({enter(e){if(Me.has(e.name))return t.push({from:e.from,to:e.to}),!1}}),t.sort((e,t)=>e.from-t.from),t}function Fe(e){let t=new Set,n=[],r=e.doc,i=Pe(e);for(let e=1;e<=r.lines;e++){let n=r.line(e);if(Ne(n.from,i))continue;let a=Ae.exec(n.text);a&&t.add(a[1].toLowerCase())}for(let e=1;e<=r.lines;e++){let t=r.line(e);if(!Ne(t.from,i)&&!Ae.test(t.text))for(je.lastIndex=0;;){let e=je.exec(t.text);if(!e)break;let r=t.from+e.index;if(Ne(r,i))continue;let a=e[2]||e[1];n.push({from:r,to:r+e[0].length,label:a.toLowerCase()})}}let a=[];for(let e of n)t.has(e.label)||a.push(ke.range(e.from,e.to));return a.sort((e,t)=>e.from-t.from),S.set(a)}var Ie=x.define({create(e){return Fe(e)},update(e,t){return t.docChanged?Fe(t.state):e},provide:e=>E.decorations.from(e)}),Le=/^(\s*(?:[-*+]|\d+[.)]) (?:\[[ x]\] )?)/,Re=S.mark({class:`cm-del`}),ze=S.line({class:`cm-table-header`,attributes:{style:`--list-hang: 2ch`}}),Be=S.line({class:`cm-table-row`,attributes:{style:`--list-hang: 2ch`}});function Ve(e){let t=0;for(let n of e)if(n===` `)t++;else if(n===` `)t+=4;else break;return t}function He(e){if(e.doc.lines<2)return null;let t=e.doc.line(1);if(!_.test(t.text))return null;for(let n=2;n<=e.doc.lines;n++){let r=e.doc.line(n);if(_.test(r.text))return{from:t.from,to:r.to}}return null}function Ue(e,t){let n=[],r=w(e),i=He(e),a=e=>i!==null&&e>=i.from&&e<=i.to;for(let{from:i,to:o}of t)r.iterate({from:i,to:o,enter(t){if(!a(t.from)){if(t.name===`Strikethrough`){let e=t.from,r=t.to,i=t.node.cursor();if(i.firstChild())do i.name===`StrikethroughMark`&&(i.from===t.from?e=i.to:r=i.from);while(i.nextSibling());return e<r&&n.push(Re.range(e,r)),!1}if(t.name===`ListItem`){let r=e.doc.lineAt(t.from),i=Le.exec(r.text),a=i?i[1].length:2,o=S.line({class:`cm-list-item`,attributes:{style:`--list-hang: ${a}ch`}});n.push(o.range(r.from));return}if(t.name===`FencedCode`){let r=e.doc.lineAt(t.from),i=e.doc.lineAt(t.to);for(let t=r.number+1;t<i.number;t++){let r=e.doc.line(t),i=Ve(r.text),a=S.line({class:`cm-fenced-code-line`,attributes:{style:`--line-indent: ${i}`}});n.push(a.range(r.from))}return!1}if(t.name===`TableHeader`){let r=e.doc.lineAt(t.from);return n.push(ze.range(r.from)),!1}if(t.name===`TableRow`){let r=e.doc.lineAt(t.from);return n.push(Be.range(r.from)),!1}if(t.name===`TableDelimiter`&&t.node.parent?.name===`Table`){let r=e.doc.lineAt(t.from);return n.push(Be.range(r.from)),!1}}}});return n.sort((e,t)=>e.from-t.from||e.value.startSide-t.value.startSide),S.set(n)}var We=class{decorations;constructor(e){this.decorations=Ue(e.state,e.visibleRanges)}update(e){(e.docChanged||e.viewportChanged||w(e.startState)!==w(e.state))&&(this.decorations=Ue(e.view.state,e.view.visibleRanges))}},Ge=T.fromClass(We,{decorations:e=>e.decorations});function Ke(){return[Ge,Ie]}var qe=t(),Je=56,Ye=ae.define();function Xe(e,t,n){let r=W(e.state.doc)[t.index];r&&c(n,()=>{e.dispatch({selection:v.cursor(r.from),effects:E.scrollIntoView(r.from,{y:`start`})}),e.focus()})}function Ze(e,t,n,r){requestAnimationFrame(()=>{if(!n())return;let i=e.state.doc,a=Math.min(t.offset,i.length);c(r,()=>{e.dispatch({selection:v.cursor(a),effects:E.scrollIntoView(a,{y:`center`})}),e.focus()})})}function Qe(e,t,n){let r=e.state.doc,i=Math.min(Math.max(t.line,1),r.lines),a=r.line(i),o=Math.min(a.from+Math.max(0,t.column-1),a.to);c(n,()=>{e.dispatch({selection:v.cursor(o),effects:E.scrollIntoView(o,{y:`start`})}),e.focus()})}function $e(e){let t=(0,Ee.c)(50),{docName:c,ytext:l,provider:d,placeholder:f,isSourceModeActive:g}=e,_=(0,X.useRef)(null),v=(0,X.useRef)(null),[y,ae]=(0,X.useState)(null);if(y)throw y;let{resolvedTheme:x}=u(),{merged:S}=ue(),C=(0,X.useRef)(g),w=S?.editor?.wordWrap??!0,{data:T}=Se(c),D;t[0]!==T?.effective||t[1]!==S?(D=T?.effective??(S?.contentRules?h(S.contentRules):m),t[0]=T?.effective,t[1]=S,t[2]=D):D=t[2];let O=D,k;t[3]===O?k=t[4]:(k=JSON.stringify(O),t[3]=O,t[4]=k);let A=k,j,M;t[5]===g?(j=t[6],M=t[7]):(j=()=>{C.current=g},M=[g],t[5]=g,t[6]=j,t[7]=M),(0,X.useEffect)(j,M);let N=(0,X.useRef)(null),P;t[8]!==c||t[9]!==O||t[10]!==f||t[11]!==d||t[12]!==x||t[13]!==w||t[14]!==l?(P=()=>{let e=_.current;if(!e)return;let t=d.configuration.name??``,u,p=tt;try{u=o({docName:t,container:e,sizeStats:{viewCount:0,bytes:l.length},factory:e=>{let r=null,o=n({ydoc:d.document,ytext:l}),s=new b,ee=new b,u=new b,ne=new b,m=new E({state:oe.create({doc:l.toString(),extensions:[Oe,Ce({scrollToMatch:e=>a(t)?E.scrollIntoView(e,{y:`start`}):Ye.of(null)}),se.of([le]),Te(l,d.awareness),se.of(we),...te({themeCompartment:s,resolvedTheme:x,ydoc:d.document,wordWrapCompartment:ee,wordWrap:w,currentDocName:t}),Ke(),de(),ne.of(De(O,c)),o,E.updateListener.of(e=>{!e.selectionSet&&!e.docChanged||(r!==null&&clearTimeout(r),r=setTimeout(()=>{r=null,ge(t,`source`,_e(e.view)),xe(t,`source`,be(e.view,t))},120))}),E.domEventHandlers({keydown:(e,t)=>!C.current||!re()||!ie(e,`edit-with-ai`)?!1:(e.preventDefault(),e.stopPropagation(),e.stopImmediatePropagation(),i(),!0)}),u.of(ce(f??``)),E.theme({"&":{height:`100%`}}),E.scrollMargins.of(et)]}),parent:e});ge(t,`source`,_e(m)),xe(t,`source`,be(m,t));let h=m.contentDOM;return h.addEventListener(`keydown`,p),h.addEventListener(`paste`,p),h.addEventListener(`drop`,p),h.addEventListener(`cut`,p),{view:m,ydoc:d.document,ytext:l,provider:d,themeCompartment:s,wordWrapCompartment:ee,placeholderCompartment:u,lintCompartment:ne}}}),N.current=u,v.current=u.view,r(c,u.view)}catch(e){let t=e;console.error(`[SourceEditor] mountCmEditor failed`,t),N.current=null,v.current=null,ae(t instanceof Error?t:Error(String(t)))}return()=>{let e=N.current;e&&(s(e),ee(c,e.view)),N.current=null,v.current=null}},t[8]=c,t[9]=O,t[10]=f,t[11]=d,t[12]=x,t[13]=w,t[14]=l,t[15]=P):P=t[15];let F;t[16]!==d||t[17]!==l?(F=[l,d],t[16]=d,t[17]=l,t[18]=F):F=t[18],(0,X.useEffect)(P,F);let I,L;t[19]===c?(I=t[20],L=t[21]):(I=()=>{},L=[c],t[19]=c,t[20]=I,t[21]=L),(0,X.useEffect)(I,L);let R,z;t[22]===x?(R=t[23],z=t[24]):(z=()=>{let e=N.current;e&&e.view.dispatch({effects:e.themeCompartment.reconfigure(x===`dark`?p:ne)})},R=[x],t[22]=x,t[23]=R,t[24]=z),(0,X.useEffect)(z,R);let B,V;t[25]===w?(B=t[26],V=t[27]):(B=()=>{let e=N.current;e&&e.view.dispatch({effects:e.wordWrapCompartment.reconfigure(w?E.lineWrapping:[])})},V=[w],t[25]=w,t[26]=B,t[27]=V),(0,X.useEffect)(B,V);let H,U;t[28]===f?(H=t[29],U=t[30]):(H=()=>{let e=N.current;e&&e.view.dispatch({effects:e.placeholderCompartment.reconfigure(ce(f??``))})},U=[f],t[28]=f,t[29]=H,t[30]=U),(0,X.useEffect)(H,U);let W;t[31]!==c||t[32]!==O?(W=()=>{let e=N.current;e&&e.view.dispatch({effects:e.lintCompartment.reconfigure(De(O,c))})},t[31]=c,t[32]=O,t[33]=W):W=t[33];let G;t[34]===A?G=t[35]:(G=[A],t[34]=A,t[35]=G),(0,X.useEffect)(W,G);let K,q;t[36]!==c||t[37]!==g?(K=()=>{let e=function(e){let t=e.detail;if(!t||t.mode!==`source`||!g)return;let n=v.current;n&&(Xe(n,t,c),ve(c))};return window.addEventListener(he,e),()=>window.removeEventListener(he,e)},q=[c,g],t[36]=c,t[37]=g,t[38]=K,t[39]=q):(K=t[38],q=t[39]),(0,X.useEffect)(K,q);let J,Y;t[40]!==c||t[41]!==g?(J=()=>{let e=function(e){let t=e.detail;if(!t||!g)return;let n=v.current;n&&(Qe(n,t,c),ve(c))};return window.addEventListener(me,e),()=>window.removeEventListener(me,e)},Y=[c,g],t[40]=c,t[41]=g,t[42]=J,t[43]=Y):(J=t[42],Y=t[43]),(0,X.useEffect)(J,Y);let Z,Q;t[44]!==c||t[45]!==g||t[46]!==d?(Z=()=>{if(!g)return;let e=v.current;if(!e)return;let t=fe(c);if(!t)return;if(t.kind!==`selection-offset`){pe(c),t.kind===`outline`?Xe(e,t.detail,c):t.kind===`lint`?Qe(e,t.detail,c):t.kind===`raw-mdx`&&Ze(e,t.detail,()=>C.current,c);return}let n=!1,r=null;return queueMicrotask(()=>{if(n)return;let t=fe(c);t?.kind===`selection-offset`&&(r=ye({view:e,docName:c,navigation:t,ydoc:d.document,transition:{from:`wysiwyg`,to:`source`}}),r&&pe(c))}),()=>{n=!0,r?.cancel(`mode-flip`)}},Q=[c,g,d],t[44]=c,t[45]=g,t[46]=d,t[47]=Z,t[48]=Q):(Z=t[47],Q=t[48]),(0,X.useEffect)(Z,Q);let $;return t[49]===Symbol.for(`react.memo_cache_sentinel`)?($=(0,qe.jsx)(`div`,{ref:_,className:`source-editor h-full pb-3`}),t[49]=$):$=t[49],$}function et(){return{top:Je}}function tt(){return f()}export{$e as SourceEditor,Ze as applyRawMdxNavigation};