@marimo-team/frontend 0.25.1-dev17 → 0.25.1-dev18

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 (100) hide show
  1. package/dist/assets/{ConnectedDataExplorerComponent-6WFKCUzO.js → ConnectedDataExplorerComponent-C2uC5lJf.js} +1 -1
  2. package/dist/assets/{ErrorBoundary-AmSQgV_f.js → ErrorBoundary-BVJqkhwk.js} +2 -2
  3. package/dist/assets/{LazyAnyLanguageCodeMirror-D38yVMV5.js → LazyAnyLanguageCodeMirror-BqNgl9tZ.js} +2 -2
  4. package/dist/assets/{RunButton-CmaVvEXE.js → RunButton-adYpTAaW.js} +7 -7
  5. package/dist/assets/{abnfDiagram-VCTEODGH-DbN3lc-G.js → abnfDiagram-VCTEODGH-Daqziwy1.js} +1 -1
  6. package/dist/assets/{add-cell-with-ai-DYEESV1_.js → add-cell-with-ai-CjPxSVh0.js} +10 -10
  7. package/dist/assets/{agent-panel-BBXyOr4f.js → agent-panel-mRH4isVn.js} +4 -4
  8. package/dist/assets/{ai-model-dropdown-DWp8ZCIu.js → ai-model-dropdown-BZNUB6Iv.js} +1 -1
  9. package/dist/assets/{any-language-editor-DxOWP_Dz.js → any-language-editor-DRf07PJG.js} +1 -1
  10. package/dist/assets/{app-config-button-DXferVy2.js → app-config-button-Cc7EMA4I.js} +1 -1
  11. package/dist/assets/{architectureDiagram-5GKGNRK7-CxYo7ny1.js → architectureDiagram-5GKGNRK7-YBlh_63B.js} +1 -1
  12. package/dist/assets/{blockDiagram-I7D4REHJ-XXtnxNOM.js → blockDiagram-I7D4REHJ-Ci6Gslkc.js} +1 -1
  13. package/dist/assets/{cache-panel-CDGgj_k1.js → cache-panel-BBQ7HY25.js} +1 -1
  14. package/dist/assets/{chat-display-B735hdwS.js → chat-display-ChsJwSGb.js} +1 -1
  15. package/dist/assets/{chat-panel-CRLY-8Q_.js → chat-panel-tXybKozg.js} +1 -1
  16. package/dist/assets/{chat-ui-COwKnPlV.js → chat-ui-Dj4a0ZyX.js} +1 -1
  17. package/dist/assets/{chunk-IMKFNOWR-DBsaOYkA.js → chunk-IMKFNOWR-CVUGMMR5.js} +1 -1
  18. package/dist/assets/{chunk-SHT3W25Y-NC5eClb6.js → chunk-SHT3W25Y-V-OZGYmC.js} +1 -1
  19. package/dist/assets/{chunk-SVP7TREG-zq4GRMSe.js → chunk-SVP7TREG-NYpzvObK.js} +1 -1
  20. package/dist/assets/{chunk-TICWLB2K-CtF--EWj.js → chunk-TICWLB2K-DAmEhpdA.js} +1 -1
  21. package/dist/assets/{classDiagram-ZZMXUADV-Ufnn74aN.js → classDiagram-ZZMXUADV-DmHJAfc5.js} +1 -1
  22. package/dist/assets/{classDiagram-v2-VYDZK3BY-Ufnn74aN.js → classDiagram-v2-VYDZK3BY-DmHJAfc5.js} +1 -1
  23. package/dist/assets/{code-visibility-DrRJBvIr.js → code-visibility-DEaFLO3A.js} +1 -1
  24. package/dist/assets/{command-palette-qcsu_Bp2.js → command-palette-CERIrl2Z.js} +1 -1
  25. package/dist/assets/{common-B-ub9i8J.js → common-DBH2dPfd.js} +1 -1
  26. package/dist/assets/{components-DaOSHEng.js → components-Chs3VCBR.js} +1 -1
  27. package/dist/assets/{components-BRVhsaex.js → components-CuWdJDJ8.js} +1 -1
  28. package/dist/assets/{cynefinDiagram-5FMLGOSQ-DEtkQ5VA.js → cynefinDiagram-5FMLGOSQ-DTjbXw-r.js} +1 -1
  29. package/dist/assets/{dagre-Br6SwCX-.js → dagre-4szy_3ND.js} +1 -1
  30. package/dist/assets/{dagre-GXQ25YYZ-CWfhwi40.js → dagre-GXQ25YYZ-BLLPL51D.js} +1 -1
  31. package/dist/assets/{data-grid-overlay-editor-BQ4XUYyf.js → data-grid-overlay-editor-CD6nx7Jc.js} +1 -1
  32. package/dist/assets/{dependency-graph-panel-DC7VQLMv.js → dependency-graph-panel-Dsa9_1CE.js} +1 -1
  33. package/dist/assets/{diagram-S7CK7UJ4-DgJkPXj-.js → diagram-S7CK7UJ4-BEOWs3DZ.js} +1 -1
  34. package/dist/assets/{diagram-UQ7AKVKN-BgMVSftv.js → diagram-UQ7AKVKN-DhcB9YNh.js} +1 -1
  35. package/dist/assets/{diagram-VX7I27RA-DPObfkHw.js → diagram-VX7I27RA-BZS6D99M.js} +1 -1
  36. package/dist/assets/{diagram-Z3DM3KII-BYHzWlR5.js → diagram-Z3DM3KII-Df9yG0Dr.js} +1 -1
  37. package/dist/assets/{documentation-panel-BauooX2S.js → documentation-panel-cgPFYBCG.js} +1 -1
  38. package/dist/assets/{ebnfDiagram-PWID7BFC-CoxVieSX.js → ebnfDiagram-PWID7BFC-D44ZGUpd.js} +1 -1
  39. package/dist/assets/{edit-page-DPhd7_gi.js → edit-page-5BoxMdRg.js} +8 -8
  40. package/dist/assets/{erDiagram-RLTQ6QDP-CryK8kTO.js → erDiagram-RLTQ6QDP-wMbCu1k0.js} +1 -1
  41. package/dist/assets/{error-panel-Chbt4Stb.js → error-panel-BQkG8Owp.js} +1 -1
  42. package/dist/assets/{feedback-button-DSa5c3Pq.js → feedback-button-L9wRkYQK.js} +1 -1
  43. package/dist/assets/{file-explorer-panel-BRzhiu8T.js → file-explorer-panel-BqbyZB-C.js} +1 -1
  44. package/dist/assets/{file-name-input-im0iaWXy.js → file-name-input-BIU5kyHZ.js} +1 -1
  45. package/dist/assets/{flowDiagram-HODETNUW-W7clPIx_.js → flowDiagram-HODETNUW-DXu8WHYs.js} +1 -1
  46. package/dist/assets/{gallery-page-B_5zGznh.js → gallery-page-CfV7ZAmL.js} +1 -1
  47. package/dist/assets/{glide-data-editor-CTXzjUkg.js → glide-data-editor-0wu6GiLW.js} +4 -4
  48. package/dist/assets/{graphlib-5TBKpf9f.js → graphlib-CTJqVmKw.js} +1 -1
  49. package/dist/assets/has-CGywqNo7.js +1 -0
  50. package/dist/assets/{home-page-gnNxFA7J.js → home-page-BpvVdseG.js} +1 -1
  51. package/dist/assets/{index-BGA2MQ61.js → index-D0aUt523.js} +31 -31
  52. package/dist/assets/{infoDiagram-27XIBGKW-COO_rLcz.js → infoDiagram-27XIBGKW-Cdc1u3v9.js} +1 -1
  53. package/dist/assets/{ishikawaDiagram-5VMMS53U-KrNEKYYj.js → ishikawaDiagram-5VMMS53U-CBLHwkrk.js} +1 -1
  54. package/dist/assets/{kanban-definition-UXKFOSKX-mL1vOpaC.js → kanban-definition-UXKFOSKX-B9VLtQSr.js} +1 -1
  55. package/dist/assets/{logs-panel-BKMIsY8h.js → logs-panel-bEm9k3zD.js} +1 -1
  56. package/dist/assets/{mermaid-D9cuWIJ3.js → mermaid-3TiKkcPE.js} +4 -4
  57. package/dist/assets/{mindmap-definition-YA3MSWOX-0UfzA6jE.js → mindmap-definition-YA3MSWOX-wGOfhH41.js} +1 -1
  58. package/dist/assets/{number-overlay-editor-D7NjYfe7.js → number-overlay-editor-K9e5ZWrL.js} +1 -1
  59. package/dist/assets/{outline-panel-QSMLTTpe.js → outline-panel-CffssgnN.js} +1 -1
  60. package/dist/assets/{packages-panel-DpmTy1Zj.js → packages-panel-CKmdUILr.js} +1 -1
  61. package/dist/assets/{panels-Bso8csB-.js → panels-14vO4F3h.js} +6 -6
  62. package/dist/assets/{pegDiagram-XKGWAZYB-C_Mn8HQY.js → pegDiagram-XKGWAZYB-BCEdVP7M.js} +1 -1
  63. package/dist/assets/{pieDiagram-E7YTZNPT-BCjUjlVJ.js → pieDiagram-E7YTZNPT-C8l_dDam.js} +1 -1
  64. package/dist/assets/{process-output-CEKLHiTm.js → process-output-ZDYA_DfN.js} +1 -1
  65. package/dist/assets/{railroadDiagram-O6MQD6OU-B1XuNasU.js → railroadDiagram-O6MQD6OU-t5SV0Qh9.js} +1 -1
  66. package/dist/assets/{requirementDiagram-BXWQKSXE-XekNJuFR.js → requirementDiagram-BXWQKSXE-CQaLae__.js} +1 -1
  67. package/dist/assets/{reveal-component-BYO2ErQd.js → reveal-component-Ce4laJYz.js} +1 -1
  68. package/dist/assets/{run-page-B8V4EsPe.js → run-page-BFPh-t5N.js} +1 -1
  69. package/dist/assets/{scratchpad-panel-BVRfI5pY.js → scratchpad-panel--eaSPPbI.js} +1 -1
  70. package/dist/assets/{secrets-panel-C8RCq9AF.js → secrets-panel-D5VC4iGd.js} +1 -1
  71. package/dist/assets/{sequenceDiagram-WJ2MYXX4-kkt3zDHa.js → sequenceDiagram-WJ2MYXX4-BdUEvoNa.js} +1 -1
  72. package/dist/assets/session-panel-C4xjKL7P.js +1 -0
  73. package/dist/assets/{snippets-panel-C-ljIDQt.js → snippets-panel-D5IV2SYF.js} +1 -1
  74. package/dist/assets/{stateDiagram-D77RDMKH-Bph_mhCF.js → stateDiagram-D77RDMKH-BxQBCmyb.js} +1 -1
  75. package/dist/assets/{stateDiagram-v2-MP3YSRHH-DSDmMkGt.js → stateDiagram-v2-MP3YSRHH-ldBZz7Qk.js} +1 -1
  76. package/dist/assets/{swimlanes-42K2YHIH-DOgT6SSZ.js → swimlanes-42K2YHIH-DyeulHZ_.js} +1 -1
  77. package/dist/assets/{swimlanesDiagram-VR7AAH4N-B0jZFEqF.js → swimlanesDiagram-VR7AAH4N-DtS183IV.js} +1 -1
  78. package/dist/assets/{swiper-component-D2sgxyxf.js → swiper-component-IXbGG3F9.js} +1 -1
  79. package/dist/assets/{terminal-B6gr5FPU.js → terminal-B0l9hsf7.js} +1 -1
  80. package/dist/assets/{timeline-definition-24CTP7MA-D6roMSAh.js → timeline-definition-24CTP7MA-Do_68DsI.js} +1 -1
  81. package/dist/assets/tooltip-PLkI_UfK.js +61 -0
  82. package/dist/assets/{tracing-BI61lCpo.js → tracing-CKx0JpOw.js} +1 -1
  83. package/dist/assets/{tracing-panel-BMqSLs2l.js → tracing-panel-CSkFln9f.js} +2 -2
  84. package/dist/assets/{useCellActionButton-DOqFLFDe.js → useCellActionButton-YroFjW8i.js} +1 -1
  85. package/dist/assets/{vega-component-CWmtMc1h.js → vega-component-B_nXcaF8.js} +1 -1
  86. package/dist/assets/{vega-embed-container-BDH_VhfS.js → vega-embed-container-Bwqt153O.js} +1 -1
  87. package/dist/assets/{vennDiagram-4TSXK5OY-AYIHuyE9.js → vennDiagram-4TSXK5OY-DkrPIenW.js} +1 -1
  88. package/dist/assets/{wardleyDiagram-VM6X3IG4-CogDfA2Q.js → wardleyDiagram-VM6X3IG4-Bx7dpVo2.js} +1 -1
  89. package/dist/assets/{xychartDiagram-S5SC5T6Z-D6Lub9hS.js → xychartDiagram-S5SC5T6Z-BDpyRtk7.js} +1 -1
  90. package/dist/index.html +4 -4
  91. package/package.json +1 -1
  92. package/src/components/data-table/charts/__tests__/chart-panel.test.tsx +286 -0
  93. package/src/components/data-table/charts/charts.tsx +26 -13
  94. package/src/plugins/impl/vega/__tests__/utils.test.ts +16 -1
  95. package/src/plugins/impl/vega/__tests__/vega.test.ts +37 -0
  96. package/src/plugins/impl/vega/loader.ts +23 -1
  97. package/src/plugins/impl/vega/utils.ts +5 -4
  98. package/dist/assets/has-QplVKfjH.js +0 -1
  99. package/dist/assets/session-panel-Ctbe5R3e.js +0 -1
  100. package/dist/assets/tooltip-B1vGi-z4.js +0 -61
@@ -1 +1 @@
1
- import{n as e}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import{t}from"./src-Cyu5G-Tr.js";import"./chunk-DU6HZSFF-J-califE.js";import"./mermaid-D9cuWIJ3.js";import{t as n,u as r}from"./mermaid-parser.core-3RKOfUXB.js";import{n as i,r as a,t as o}from"./chunk-SVP7TREG-zq4GRMSe.js";import{t as s}from"./chunk-JWPE2WC7-DVXcaiue.js";var c=r().RailroadPeg.parser.LangiumParser,l=e(e=>{let t=e.alternatives.map(u);return t.length===1?t[0]:{type:`choice`,alternatives:t}},`transformOrderedChoice`),u=e(e=>{let t=e.elements.map(d);return t.length===1?t[0]:{type:`sequence`,elements:t}},`transformSequence`),d=e(e=>{let t=p(e.suffix);return e.operator?{type:`special`,text:e.operator===`&`?`&${f(t)}`:`!${f(t)}`}:t},`transformPrefix`),f=e(e=>{switch(e.type){case`terminal`:return`"${e.value}"`;case`nonterminal`:return e.name;case`special`:return e.text;default:return`(...)`}},`nodeToLabel`),p=e(e=>{let t=m(e.primary);if(!e.operator)return t;switch(e.operator){case`?`:return{type:`optional`,element:t};case`*`:return{type:`repetition`,element:t,min:0,max:1/0};case`+`:return{type:`repetition`,element:t,min:1,max:1/0};default:throw Error(`Unsupported PEG suffix operator: ${e.operator}`)}},`transformSuffix`),m=e(e=>{switch(e.$type){case`PegLiteral`:return{type:`terminal`,value:e.value};case`PegIdentifier`:return{type:`nonterminal`,name:e.name};case`PegGroup`:return l(e.element);case`PegAny`:return{type:`special`,text:e.dot};default:throw Error(`Unsupported PEG primary node: ${e.$type}`)}},`transformPrimary`),h=e(e=>({name:e.name,definition:l(e.definition)}),`transformRule`),g=e(e=>{s(e,o),e.title&&o.setTitle(e.title),e.rules.map(e=>o.addRule(h(e)))},`populateDb`),_={parser:{parse:e(e=>{o.clear(),t.debug(`[PEG Parser] Starting Langium parse`);let r=c.parse(e);if(r.lexerErrors.length>0||r.parserErrors.length>0)throw new n(r);let i=r.value;t.debug(`[PEG Parser] Parsed rules:`,i.rules.length),g(i),t.debug(`[PEG Parser] Parse complete`)},`parse`),parser:{yy:o}},db:o,renderer:a,styles:i};export{_ as diagram};
1
+ import{n as e}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import{t}from"./src-Cyu5G-Tr.js";import"./chunk-DU6HZSFF-J-califE.js";import"./mermaid-3TiKkcPE.js";import{t as n,u as r}from"./mermaid-parser.core-3RKOfUXB.js";import{n as i,r as a,t as o}from"./chunk-SVP7TREG-NYpzvObK.js";import{t as s}from"./chunk-JWPE2WC7-DVXcaiue.js";var c=r().RailroadPeg.parser.LangiumParser,l=e(e=>{let t=e.alternatives.map(u);return t.length===1?t[0]:{type:`choice`,alternatives:t}},`transformOrderedChoice`),u=e(e=>{let t=e.elements.map(d);return t.length===1?t[0]:{type:`sequence`,elements:t}},`transformSequence`),d=e(e=>{let t=p(e.suffix);return e.operator?{type:`special`,text:e.operator===`&`?`&${f(t)}`:`!${f(t)}`}:t},`transformPrefix`),f=e(e=>{switch(e.type){case`terminal`:return`"${e.value}"`;case`nonterminal`:return e.name;case`special`:return e.text;default:return`(...)`}},`nodeToLabel`),p=e(e=>{let t=m(e.primary);if(!e.operator)return t;switch(e.operator){case`?`:return{type:`optional`,element:t};case`*`:return{type:`repetition`,element:t,min:0,max:1/0};case`+`:return{type:`repetition`,element:t,min:1,max:1/0};default:throw Error(`Unsupported PEG suffix operator: ${e.operator}`)}},`transformSuffix`),m=e(e=>{switch(e.$type){case`PegLiteral`:return{type:`terminal`,value:e.value};case`PegIdentifier`:return{type:`nonterminal`,name:e.name};case`PegGroup`:return l(e.element);case`PegAny`:return{type:`special`,text:e.dot};default:throw Error(`Unsupported PEG primary node: ${e.$type}`)}},`transformPrimary`),h=e(e=>({name:e.name,definition:l(e.definition)}),`transformRule`),g=e(e=>{s(e,o),e.title&&o.setTitle(e.title),e.rules.map(e=>o.addRule(h(e)))},`populateDb`),_={parser:{parse:e(e=>{o.clear(),t.debug(`[PEG Parser] Starting Langium parse`);let r=c.parse(e);if(r.lexerErrors.length>0||r.parserErrors.length>0)throw new n(r);let i=r.value;t.debug(`[PEG Parser] Parsed rules:`,i.rules.length),g(i),t.debug(`[PEG Parser] Parse complete`)},`parse`),parser:{yy:o}},db:o,renderer:a,styles:i};export{_ as diagram};
@@ -1,4 +1,4 @@
1
- import{n as e}from"./ordinal-BdBDtYTt.js";import{L as t,R as n,S as r}from"./step-CriubqJO.js";import{t as i}from"./arc-DR2VsF_m.js";import{i as a,p as o}from"./chunk-75Z2AOVW-DA_lihEi.js";import{n as s}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import{t as c}from"./src-Cyu5G-Tr.js";import{H as l,K as u,U as d,a as f,c as p,f as m,v as h,w as g,x as _,y as v}from"./chunk-DU6HZSFF-J-califE.js";import{p as y}from"./mermaid-D9cuWIJ3.js";import{n as b}from"./mermaid-parser.core-3RKOfUXB.js";import{t as x}from"./chunk-JWPE2WC7-DVXcaiue.js";function S(e,t){return t<e?-1:t>e?1:t>=e?0:NaN}function C(e){return e}function w(){var e=C,i=S,a=null,o=n(0),s=n(t),c=n(0);function l(n){var l,u=(n=r(n)).length,d,f,p=0,m=Array(u),h=Array(u),g=+o.apply(this,arguments),_=Math.min(t,Math.max(-t,s.apply(this,arguments)-g)),v,y=Math.min(Math.abs(_)/u,c.apply(this,arguments)),b=y*(_<0?-1:1),x;for(l=0;l<u;++l)(x=h[m[l]=l]=+e(n[l],l,n))>0&&(p+=x);for(i==null?a!=null&&m.sort(function(e,t){return a(n[e],n[t])}):m.sort(function(e,t){return i(h[e],h[t])}),l=0,f=p?(_-u*b)/p:0;l<u;++l,g=v)d=m[l],x=h[d],v=g+(x>0?x*f:0)+b,h[d]={data:n[d],index:l,value:x,startAngle:g,endAngle:v,padAngle:y};return h}return l.value=function(t){return arguments.length?(e=typeof t==`function`?t:n(+t),l):e},l.sortValues=function(e){return arguments.length?(i=e,a=null,l):i},l.sort=function(e){return arguments.length?(a=e,i=null,l):a},l.startAngle=function(e){return arguments.length?(o=typeof e==`function`?e:n(+e),l):o},l.endAngle=function(e){return arguments.length?(s=typeof e==`function`?e:n(+e),l):s},l.padAngle=function(e){return arguments.length?(c=typeof e==`function`?e:n(+e),l):c},l}var T=m.pie,E={sections:new Map,showData:!1,config:T},D=E.sections,O=E.showData,k=structuredClone(T),A={getConfig:s(()=>structuredClone(k),`getConfig`),clear:s(()=>{D=new Map,O=E.showData,f()},`clear`),setDiagramTitle:u,getDiagramTitle:g,setAccTitle:d,getAccTitle:v,setAccDescription:l,getAccDescription:h,addSection:s(({label:e,value:t})=>{if(t<0)throw Error(`"${e}" has invalid value: ${t}. Negative values are not allowed in pie charts. All slice values must be >= 0.`);D.has(e)||(D.set(e,t),c.debug(`added new section: ${e}, with value: ${t}`))},`addSection`),getSections:s(()=>D,`getSections`),setShowData:s(e=>{O=e},`setShowData`),getShowData:s(()=>O,`getShowData`)},j=s((e,t)=>{x(e,t),t.setShowData(e.showData),e.sections.map(t.addSection)},`populateDb`),M={parse:s(async e=>{let t=await b(`pie`,e);c.debug(t),j(t,A)},`parse`)},N=s(e=>`
1
+ import{n as e}from"./ordinal-BdBDtYTt.js";import{L as t,R as n,S as r}from"./step-CriubqJO.js";import{t as i}from"./arc-DR2VsF_m.js";import{i as a,p as o}from"./chunk-75Z2AOVW-DA_lihEi.js";import{n as s}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import{t as c}from"./src-Cyu5G-Tr.js";import{H as l,K as u,U as d,a as f,c as p,f as m,v as h,w as g,x as _,y as v}from"./chunk-DU6HZSFF-J-califE.js";import{p as y}from"./mermaid-3TiKkcPE.js";import{n as b}from"./mermaid-parser.core-3RKOfUXB.js";import{t as x}from"./chunk-JWPE2WC7-DVXcaiue.js";function S(e,t){return t<e?-1:t>e?1:t>=e?0:NaN}function C(e){return e}function w(){var e=C,i=S,a=null,o=n(0),s=n(t),c=n(0);function l(n){var l,u=(n=r(n)).length,d,f,p=0,m=Array(u),h=Array(u),g=+o.apply(this,arguments),_=Math.min(t,Math.max(-t,s.apply(this,arguments)-g)),v,y=Math.min(Math.abs(_)/u,c.apply(this,arguments)),b=y*(_<0?-1:1),x;for(l=0;l<u;++l)(x=h[m[l]=l]=+e(n[l],l,n))>0&&(p+=x);for(i==null?a!=null&&m.sort(function(e,t){return a(n[e],n[t])}):m.sort(function(e,t){return i(h[e],h[t])}),l=0,f=p?(_-u*b)/p:0;l<u;++l,g=v)d=m[l],x=h[d],v=g+(x>0?x*f:0)+b,h[d]={data:n[d],index:l,value:x,startAngle:g,endAngle:v,padAngle:y};return h}return l.value=function(t){return arguments.length?(e=typeof t==`function`?t:n(+t),l):e},l.sortValues=function(e){return arguments.length?(i=e,a=null,l):i},l.sort=function(e){return arguments.length?(a=e,i=null,l):a},l.startAngle=function(e){return arguments.length?(o=typeof e==`function`?e:n(+e),l):o},l.endAngle=function(e){return arguments.length?(s=typeof e==`function`?e:n(+e),l):s},l.padAngle=function(e){return arguments.length?(c=typeof e==`function`?e:n(+e),l):c},l}var T=m.pie,E={sections:new Map,showData:!1,config:T},D=E.sections,O=E.showData,k=structuredClone(T),A={getConfig:s(()=>structuredClone(k),`getConfig`),clear:s(()=>{D=new Map,O=E.showData,f()},`clear`),setDiagramTitle:u,getDiagramTitle:g,setAccTitle:d,getAccTitle:v,setAccDescription:l,getAccDescription:h,addSection:s(({label:e,value:t})=>{if(t<0)throw Error(`"${e}" has invalid value: ${t}. Negative values are not allowed in pie charts. All slice values must be >= 0.`);D.has(e)||(D.set(e,t),c.debug(`added new section: ${e}, with value: ${t}`))},`addSection`),getSections:s(()=>D,`getSections`),setShowData:s(e=>{O=e},`setShowData`),getShowData:s(()=>O,`getShowData`)},j=s((e,t)=>{x(e,t),t.setShowData(e.showData),e.sections.map(t.addSection)},`populateDb`),M={parse:s(async e=>{let t=await b(`pie`,e);c.debug(t),j(t,A)},`parse`)},N=s(e=>`
2
2
  .pieCircle{
3
3
  stroke: ${e.pieStrokeColor};
4
4
  stroke-width : ${e.pieStrokeWidth};
@@ -1 +1 @@
1
- import{r as e,t}from"./useEvent-Dc9HkKI2.js";import{D as n,X as r,Z as i,b as a,v as o}from"./cells-B3WiM6w3.js";import{t as s}from"./compiler-runtime-BQ9S8nyo.js";import{t as c}from"./useEventListener-BdZUApHd.js";import{t as l}from"./jsx-runtime-B74pBk57.js";import{t as u}from"./button-BoklZTGL.js";import{t as d}from"./createLucideIcon-rHn2EdoM.js";import{t as f}from"./use-toast-CC89xOwH.js";import{t as p}from"./strings-BHZPE0Mc.js";import{r as m}from"./requests-yTHMxhVa.js";import{Ct as h}from"./index-BGA2MQ61.js";var g=d(`play`,[[`path`,{d:`M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z`,key:`10ikf1`}]]),_=s(),v=l(),y=e=>{let t=(0,_.c)(7),n;t[0]===e?n=t[1]:(n=t=>{(t.ctrlKey||t.metaKey)&&t.key===`z`&&(t.preventDefault(),t.stopPropagation(),e.onClick?.(t))},t[0]=e,t[1]=n);let r;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(r={capture:!0},t[2]=r):r=t[2],c(window,`keydown`,n,r);let i=e.children??`Undo`,a;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,v.jsx)(h,{className:`ml-2`,shortcut:`cmd-z`}),t[3]=a):a=t[3];let o;return t[4]!==i||t[5]!==e?(o=(0,v.jsxs)(u,{"data-testid":`undo-button`,size:`sm`,variant:`outline`,...e,children:[i,` `,a]}),t[4]=i,t[5]=e,t[6]=o):o=t[6],o};function b(){let r=(0,_.c)(4),{deleteCell:i,undoDeleteCell:s}=n(),{sendDeleteCell:c}=m(),l;return r[0]!==i||r[1]!==c||r[2]!==s?(l=t=>{if(e.get(o))return;let{cellId:n}=t,r=(e.get(a).cellData[n]?.code??``).trim()===``;if(i({cellId:n}),c({cellId:n}).catch(()=>{s()}),!r){let{dismiss:e}=f({title:`Cell deleted`,description:`You can bring it back by clicking undo or through the command palette.`,action:(0,v.jsx)(y,{"data-testid":`undo-delete-button`,onClick:()=>{s(),t()}})}),t=e}},r[0]=i,r[1]=c,r[2]=s,r[3]=l):l=r[3],t(l)}function x(){let r=(0,_.c)(4),{deleteCell:i,undoDeleteCell:a}=n(),{sendDeleteCell:s}=m(),c;return r[0]!==i||r[1]!==s||r[2]!==a?(c=async t=>{if(e.get(o))return;let{cellIds:n}=t;for(let e of n)await s({cellId:e}).then(()=>{i({cellId:e})});let{dismiss:r}=f({title:`Cells deleted`,action:(0,v.jsx)(y,{"data-testid":`undo-delete-button`,onClick:()=>{for(let e of n)a();c()}})}),c=r},r[0]=i,r[1]=s,r[2]=a,r[3]=c):c=r[3],t(c)}function S(e){return e.mimetype.startsWith(`application/vnd.marimo`)||e.mimetype===`text/html`?i(p.asString(e.data)):r(p.asString(e.data))}export{g as a,y as i,b as n,x as r,S as t};
1
+ import{r as e,t}from"./useEvent-Dc9HkKI2.js";import{D as n,X as r,Z as i,b as a,v as o}from"./cells-B3WiM6w3.js";import{t as s}from"./compiler-runtime-BQ9S8nyo.js";import{t as c}from"./useEventListener-BdZUApHd.js";import{t as l}from"./jsx-runtime-B74pBk57.js";import{t as u}from"./button-BoklZTGL.js";import{t as d}from"./createLucideIcon-rHn2EdoM.js";import{t as f}from"./use-toast-CC89xOwH.js";import{t as p}from"./strings-BHZPE0Mc.js";import{r as m}from"./requests-yTHMxhVa.js";import{Ct as h}from"./index-D0aUt523.js";var g=d(`play`,[[`path`,{d:`M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z`,key:`10ikf1`}]]),_=s(),v=l(),y=e=>{let t=(0,_.c)(7),n;t[0]===e?n=t[1]:(n=t=>{(t.ctrlKey||t.metaKey)&&t.key===`z`&&(t.preventDefault(),t.stopPropagation(),e.onClick?.(t))},t[0]=e,t[1]=n);let r;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(r={capture:!0},t[2]=r):r=t[2],c(window,`keydown`,n,r);let i=e.children??`Undo`,a;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,v.jsx)(h,{className:`ml-2`,shortcut:`cmd-z`}),t[3]=a):a=t[3];let o;return t[4]!==i||t[5]!==e?(o=(0,v.jsxs)(u,{"data-testid":`undo-button`,size:`sm`,variant:`outline`,...e,children:[i,` `,a]}),t[4]=i,t[5]=e,t[6]=o):o=t[6],o};function b(){let r=(0,_.c)(4),{deleteCell:i,undoDeleteCell:s}=n(),{sendDeleteCell:c}=m(),l;return r[0]!==i||r[1]!==c||r[2]!==s?(l=t=>{if(e.get(o))return;let{cellId:n}=t,r=(e.get(a).cellData[n]?.code??``).trim()===``;if(i({cellId:n}),c({cellId:n}).catch(()=>{s()}),!r){let{dismiss:e}=f({title:`Cell deleted`,description:`You can bring it back by clicking undo or through the command palette.`,action:(0,v.jsx)(y,{"data-testid":`undo-delete-button`,onClick:()=>{s(),t()}})}),t=e}},r[0]=i,r[1]=c,r[2]=s,r[3]=l):l=r[3],t(l)}function x(){let r=(0,_.c)(4),{deleteCell:i,undoDeleteCell:a}=n(),{sendDeleteCell:s}=m(),c;return r[0]!==i||r[1]!==s||r[2]!==a?(c=async t=>{if(e.get(o))return;let{cellIds:n}=t;for(let e of n)await s({cellId:e}).then(()=>{i({cellId:e})});let{dismiss:r}=f({title:`Cells deleted`,action:(0,v.jsx)(y,{"data-testid":`undo-delete-button`,onClick:()=>{for(let e of n)a();c()}})}),c=r},r[0]=i,r[1]=s,r[2]=a,r[3]=c):c=r[3],t(c)}function S(e){return e.mimetype.startsWith(`application/vnd.marimo`)||e.mimetype===`text/html`?i(p.asString(e.data)):r(p.asString(e.data))}export{g as a,y as i,b as n,x as r,S as t};
@@ -1 +1 @@
1
- import{n as e}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import{t}from"./src-Cyu5G-Tr.js";import"./chunk-DU6HZSFF-J-califE.js";import"./mermaid-D9cuWIJ3.js";import{g as n,t as r}from"./mermaid-parser.core-3RKOfUXB.js";import{n as i,r as a,t as o}from"./chunk-SVP7TREG-zq4GRMSe.js";import{t as s}from"./chunk-JWPE2WC7-DVXcaiue.js";var c=n().Railroad.parser.LangiumParser,l=e(e=>{switch(e.$type){case`RailroadTerminalExpr`:return{type:`terminal`,value:e.value};case`RailroadNonTerminalExpr`:return{type:`nonterminal`,name:e.name};case`RailroadSpecialExpr`:return{type:`special`,text:e.text};case`RailroadSequenceExpr`:{let t=e.elements.map(l);return t.length===1?t[0]:{type:`sequence`,elements:t}}case`RailroadChoiceExpr`:{let t=e.alternatives.map(l);return t.length===1?t[0]:{type:`choice`,alternatives:t}}case`RailroadOptionalExpr`:return{type:`optional`,element:l(e.element)};case`RailroadOneOrMoreExpr`:return{type:`repetition`,element:l(e.element),min:1,max:1/0};case`RailroadZeroOrMoreExpr`:return{type:`repetition`,element:l(e.element),min:0,max:1/0};default:throw Error(`Unsupported railroad expression: ${e.$type}`)}},`transformExpression`),u=e(e=>({name:e.name,definition:l(e.definition)}),`transformRule`),d=e(e=>{s(e,o),e.title&&o.setTitle(e.title),e.rules.map(e=>o.addRule(u(e)))},`populateDb`),f={parser:{parse:e(e=>{o.clear(),t.debug(`[Railroad Parser] Starting Langium parse`);let n=c.parse(e);if(n.lexerErrors.length>0||n.parserErrors.length>0)throw new r(n);let i=n.value;t.debug(`[Railroad Parser] Parsed rules:`,i.rules.length),d(i),t.debug(`[Railroad Parser] Parse complete`)},`parse`),parser:{yy:o}},db:o,renderer:a,styles:i};export{f as diagram};
1
+ import{n as e}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import{t}from"./src-Cyu5G-Tr.js";import"./chunk-DU6HZSFF-J-califE.js";import"./mermaid-3TiKkcPE.js";import{g as n,t as r}from"./mermaid-parser.core-3RKOfUXB.js";import{n as i,r as a,t as o}from"./chunk-SVP7TREG-NYpzvObK.js";import{t as s}from"./chunk-JWPE2WC7-DVXcaiue.js";var c=n().Railroad.parser.LangiumParser,l=e(e=>{switch(e.$type){case`RailroadTerminalExpr`:return{type:`terminal`,value:e.value};case`RailroadNonTerminalExpr`:return{type:`nonterminal`,name:e.name};case`RailroadSpecialExpr`:return{type:`special`,text:e.text};case`RailroadSequenceExpr`:{let t=e.elements.map(l);return t.length===1?t[0]:{type:`sequence`,elements:t}}case`RailroadChoiceExpr`:{let t=e.alternatives.map(l);return t.length===1?t[0]:{type:`choice`,alternatives:t}}case`RailroadOptionalExpr`:return{type:`optional`,element:l(e.element)};case`RailroadOneOrMoreExpr`:return{type:`repetition`,element:l(e.element),min:1,max:1/0};case`RailroadZeroOrMoreExpr`:return{type:`repetition`,element:l(e.element),min:0,max:1/0};default:throw Error(`Unsupported railroad expression: ${e.$type}`)}},`transformExpression`),u=e(e=>({name:e.name,definition:l(e.definition)}),`transformRule`),d=e(e=>{s(e,o),e.title&&o.setTitle(e.title),e.rules.map(e=>o.addRule(u(e)))},`populateDb`),f={parser:{parse:e(e=>{o.clear(),t.debug(`[Railroad Parser] Starting Langium parse`);let n=c.parse(e);if(n.lexerErrors.length>0||n.parserErrors.length>0)throw new r(n);let i=n.value;t.debug(`[Railroad Parser] Parsed rules:`,i.rules.length),d(i),t.debug(`[Railroad Parser] Parse complete`)},`parse`),parser:{yy:o}},db:o,renderer:a,styles:i};export{f as diagram};
@@ -1,4 +1,4 @@
1
- import{g as e}from"./chunk-75Z2AOVW-DA_lihEi.js";import{n as t,t as n}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import{t as r}from"./src-Cyu5G-Tr.js";import{H as i,K as a,U as o,a as s,b as c,v as l,w as u,x as d,y as f}from"./chunk-DU6HZSFF-J-califE.js";import"./chunk-P2QGCYS3-DsJshZeL.js";import"./chunk-PWAF6VOD-CrFPAGFi.js";import"./chunk-GMAD6QVW-mXoq4V-T.js";import"./chunk-4HAMMTFA-F3WVmmmo.js";import"./chunk-GVQU2GXP-B-87l3Xt.js";import"./chunk-L3NEJ4N5-DLeZO9l0.js";import"./chunk-OSK3NFVY-PWoOtECb.js";import{n as p,r as m}from"./mermaid-D9cuWIJ3.js";import{t as h}from"./chunk-XXDRQBXY-BwqwIlJV.js";import{t as g}from"./chunk-POPQ4Y6H-CCg5TpSp.js";var _=(function(){var e=t(function(e,t,n,r){for(n||={},r=e.length;r--;n[e[r]]=t);return n},`o`),n=[1,3],r=[1,4],i=[1,5],a=[1,6],o=[5,6,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,77,89,90],s=[1,22],c=[2,7],l=[1,26],u=[1,27],d=[1,28],f=[1,29],p=[1,33],m=[1,34],h=[1,35],g=[1,36],_=[1,37],v=[1,38],y=[1,24],b=[1,31],x=[1,32],S=[1,30],C=[1,39],w=[1,40],T=[5,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,77,89,90],E=[1,61],D=[89,90],O=[5,8,9,11,13,21,22,23,24,27,29,41,42,43,44,45,46,54,61,63,72,74,75,76,77,80,81,82,83,84,85,86,87,88,89,90],k=[27,29],ee=[1,70],A=[1,71],te=[1,72],ne=[1,73],re=[1,74],ie=[1,75],ae=[1,76],j=[1,83],M=[1,80],N=[1,84],P=[1,85],F=[1,86],I=[1,87],L=[1,88],R=[1,89],z=[1,90],B=[1,91],V=[1,92],oe=[5,8,9,11,13,21,22,23,24,27,41,42,43,44,45,46,54,72,74,75,76,77,80,81,82,83,84,85,86,87,88,89,90],H=[63,64],se=[1,101],ce=[5,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,76,77,89,90],U=[5,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,75,76,77,80,81,82,83,84,85,86,87,88,89,90],W=[1,110],G=[1,106],K=[1,107],q=[1,108],J=[1,109],Y=[1,111],X=[1,116],Z=[1,117],Q=[1,114],$=[1,115],le={trace:t(function(){},`trace`),yy:{},symbols_:{error:2,start:3,directive:4,NEWLINE:5,RD:6,diagram:7,EOF:8,acc_title:9,acc_title_value:10,acc_descr:11,acc_descr_value:12,acc_descr_multiline_value:13,requirementDef:14,elementDef:15,relationshipDef:16,direction:17,styleStatement:18,classDefStatement:19,classStatement:20,direction_tb:21,direction_bt:22,direction_rl:23,direction_lr:24,requirementType:25,requirementName:26,STRUCT_START:27,requirementBody:28,STYLE_SEPARATOR:29,idList:30,ID:31,COLONSEP:32,id:33,TEXT:34,text:35,RISK:36,riskLevel:37,VERIFYMTHD:38,verifyType:39,STRUCT_STOP:40,REQUIREMENT:41,FUNCTIONAL_REQUIREMENT:42,INTERFACE_REQUIREMENT:43,PERFORMANCE_REQUIREMENT:44,PHYSICAL_REQUIREMENT:45,DESIGN_CONSTRAINT:46,LOW_RISK:47,MED_RISK:48,HIGH_RISK:49,VERIFY_ANALYSIS:50,VERIFY_DEMONSTRATION:51,VERIFY_INSPECTION:52,VERIFY_TEST:53,ELEMENT:54,elementName:55,elementBody:56,TYPE:57,type:58,DOCREF:59,ref:60,END_ARROW_L:61,relationship:62,LINE:63,END_ARROW_R:64,CONTAINS:65,COPIES:66,DERIVES:67,SATISFIES:68,VERIFIES:69,REFINES:70,TRACES:71,CLASSDEF:72,stylesOpt:73,CLASS:74,ALPHA:75,COMMA:76,STYLE:77,style:78,styleComponent:79,NUM:80,COLON:81,UNIT:82,SPACE:83,BRKT:84,PCT:85,MINUS:86,LABEL:87,SEMICOLON:88,unqString:89,qString:90,$accept:0,$end:1},terminals_:{2:`error`,5:`NEWLINE`,6:`RD`,8:`EOF`,9:`acc_title`,10:`acc_title_value`,11:`acc_descr`,12:`acc_descr_value`,13:`acc_descr_multiline_value`,21:`direction_tb`,22:`direction_bt`,23:`direction_rl`,24:`direction_lr`,27:`STRUCT_START`,29:`STYLE_SEPARATOR`,31:`ID`,32:`COLONSEP`,34:`TEXT`,36:`RISK`,38:`VERIFYMTHD`,40:`STRUCT_STOP`,41:`REQUIREMENT`,42:`FUNCTIONAL_REQUIREMENT`,43:`INTERFACE_REQUIREMENT`,44:`PERFORMANCE_REQUIREMENT`,45:`PHYSICAL_REQUIREMENT`,46:`DESIGN_CONSTRAINT`,47:`LOW_RISK`,48:`MED_RISK`,49:`HIGH_RISK`,50:`VERIFY_ANALYSIS`,51:`VERIFY_DEMONSTRATION`,52:`VERIFY_INSPECTION`,53:`VERIFY_TEST`,54:`ELEMENT`,57:`TYPE`,59:`DOCREF`,61:`END_ARROW_L`,63:`LINE`,64:`END_ARROW_R`,65:`CONTAINS`,66:`COPIES`,67:`DERIVES`,68:`SATISFIES`,69:`VERIFIES`,70:`REFINES`,71:`TRACES`,72:`CLASSDEF`,74:`CLASS`,75:`ALPHA`,76:`COMMA`,77:`STYLE`,80:`NUM`,81:`COLON`,82:`UNIT`,83:`SPACE`,84:`BRKT`,85:`PCT`,86:`MINUS`,87:`LABEL`,88:`SEMICOLON`,89:`unqString`,90:`qString`},productions_:[0,[3,3],[3,2],[3,4],[4,2],[4,2],[4,1],[7,0],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[17,1],[17,1],[17,1],[17,1],[14,5],[14,7],[28,5],[28,5],[28,5],[28,5],[28,2],[28,1],[25,1],[25,1],[25,1],[25,1],[25,1],[25,1],[37,1],[37,1],[37,1],[39,1],[39,1],[39,1],[39,1],[15,5],[15,7],[56,5],[56,5],[56,2],[56,1],[16,5],[16,5],[62,1],[62,1],[62,1],[62,1],[62,1],[62,1],[62,1],[19,3],[20,3],[20,3],[30,1],[30,3],[30,1],[30,3],[18,3],[73,1],[73,3],[78,1],[78,2],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[26,1],[26,1],[33,1],[33,1],[35,1],[35,1],[55,1],[55,1],[58,1],[58,1],[60,1],[60,1]],performAction:t(function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 4:this.$=a[s].trim(),r.setAccTitle(this.$);break;case 5:case 6:this.$=a[s].trim(),r.setAccDescription(this.$);break;case 7:this.$=[];break;case 17:r.setDirection(`TB`);break;case 18:r.setDirection(`BT`);break;case 19:r.setDirection(`RL`);break;case 20:r.setDirection(`LR`);break;case 21:r.addRequirement(a[s-3],a[s-4]);break;case 22:r.addRequirement(a[s-5],a[s-6]),r.setClass([a[s-5]],a[s-3]);break;case 23:r.setNewReqId(a[s-2]);break;case 24:r.setNewReqText(a[s-2]);break;case 25:r.setNewReqRisk(a[s-2]);break;case 26:r.setNewReqVerifyMethod(a[s-2]);break;case 29:this.$=r.RequirementType.REQUIREMENT;break;case 30:this.$=r.RequirementType.FUNCTIONAL_REQUIREMENT;break;case 31:this.$=r.RequirementType.INTERFACE_REQUIREMENT;break;case 32:this.$=r.RequirementType.PERFORMANCE_REQUIREMENT;break;case 33:this.$=r.RequirementType.PHYSICAL_REQUIREMENT;break;case 34:this.$=r.RequirementType.DESIGN_CONSTRAINT;break;case 35:this.$=r.RiskLevel.LOW_RISK;break;case 36:this.$=r.RiskLevel.MED_RISK;break;case 37:this.$=r.RiskLevel.HIGH_RISK;break;case 38:this.$=r.VerifyType.VERIFY_ANALYSIS;break;case 39:this.$=r.VerifyType.VERIFY_DEMONSTRATION;break;case 40:this.$=r.VerifyType.VERIFY_INSPECTION;break;case 41:this.$=r.VerifyType.VERIFY_TEST;break;case 42:r.addElement(a[s-3]);break;case 43:r.addElement(a[s-5]),r.setClass([a[s-5]],a[s-3]);break;case 44:r.setNewElementType(a[s-2]);break;case 45:r.setNewElementDocRef(a[s-2]);break;case 48:r.addRelationship(a[s-2],a[s],a[s-4]);break;case 49:r.addRelationship(a[s-2],a[s-4],a[s]);break;case 50:this.$=r.Relationships.CONTAINS;break;case 51:this.$=r.Relationships.COPIES;break;case 52:this.$=r.Relationships.DERIVES;break;case 53:this.$=r.Relationships.SATISFIES;break;case 54:this.$=r.Relationships.VERIFIES;break;case 55:this.$=r.Relationships.REFINES;break;case 56:this.$=r.Relationships.TRACES;break;case 57:this.$=a[s-2],r.defineClass(a[s-1],a[s]);break;case 58:r.setClass(a[s-1],a[s]);break;case 59:r.setClass([a[s-2]],a[s]);break;case 60:case 62:this.$=[a[s]];break;case 61:case 63:this.$=a[s-2].concat([a[s]]);break;case 64:this.$=a[s-2],r.setCssStyle(a[s-1],a[s]);break;case 65:this.$=[a[s]];break;case 66:a[s-2].push(a[s]),this.$=a[s-2];break;case 68:this.$=a[s-1]+a[s]}},`anonymous`),table:[{3:1,4:2,6:n,9:r,11:i,13:a},{1:[3]},{3:8,4:2,5:[1,7],6:n,9:r,11:i,13:a},{5:[1,9]},{10:[1,10]},{12:[1,11]},e(o,[2,6]),{3:12,4:2,6:n,9:r,11:i,13:a},{1:[2,2]},{4:17,5:s,7:13,8:c,9:r,11:i,13:a,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:d,24:f,25:23,33:25,41:p,42:m,43:h,44:g,45:_,46:v,54:y,72:b,74:x,77:S,89:C,90:w},e(o,[2,4]),e(o,[2,5]),{1:[2,1]},{8:[1,41]},{4:17,5:s,7:42,8:c,9:r,11:i,13:a,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:d,24:f,25:23,33:25,41:p,42:m,43:h,44:g,45:_,46:v,54:y,72:b,74:x,77:S,89:C,90:w},{4:17,5:s,7:43,8:c,9:r,11:i,13:a,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:d,24:f,25:23,33:25,41:p,42:m,43:h,44:g,45:_,46:v,54:y,72:b,74:x,77:S,89:C,90:w},{4:17,5:s,7:44,8:c,9:r,11:i,13:a,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:d,24:f,25:23,33:25,41:p,42:m,43:h,44:g,45:_,46:v,54:y,72:b,74:x,77:S,89:C,90:w},{4:17,5:s,7:45,8:c,9:r,11:i,13:a,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:d,24:f,25:23,33:25,41:p,42:m,43:h,44:g,45:_,46:v,54:y,72:b,74:x,77:S,89:C,90:w},{4:17,5:s,7:46,8:c,9:r,11:i,13:a,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:d,24:f,25:23,33:25,41:p,42:m,43:h,44:g,45:_,46:v,54:y,72:b,74:x,77:S,89:C,90:w},{4:17,5:s,7:47,8:c,9:r,11:i,13:a,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:d,24:f,25:23,33:25,41:p,42:m,43:h,44:g,45:_,46:v,54:y,72:b,74:x,77:S,89:C,90:w},{4:17,5:s,7:48,8:c,9:r,11:i,13:a,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:d,24:f,25:23,33:25,41:p,42:m,43:h,44:g,45:_,46:v,54:y,72:b,74:x,77:S,89:C,90:w},{4:17,5:s,7:49,8:c,9:r,11:i,13:a,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:d,24:f,25:23,33:25,41:p,42:m,43:h,44:g,45:_,46:v,54:y,72:b,74:x,77:S,89:C,90:w},{4:17,5:s,7:50,8:c,9:r,11:i,13:a,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:d,24:f,25:23,33:25,41:p,42:m,43:h,44:g,45:_,46:v,54:y,72:b,74:x,77:S,89:C,90:w},{26:51,89:[1,52],90:[1,53]},{55:54,89:[1,55],90:[1,56]},{29:[1,59],61:[1,57],63:[1,58]},e(T,[2,17]),e(T,[2,18]),e(T,[2,19]),e(T,[2,20]),{30:60,33:62,75:E,89:C,90:w},{30:63,33:62,75:E,89:C,90:w},{30:64,33:62,75:E,89:C,90:w},e(D,[2,29]),e(D,[2,30]),e(D,[2,31]),e(D,[2,32]),e(D,[2,33]),e(D,[2,34]),e(O,[2,81]),e(O,[2,82]),{1:[2,3]},{8:[2,8]},{8:[2,9]},{8:[2,10]},{8:[2,11]},{8:[2,12]},{8:[2,13]},{8:[2,14]},{8:[2,15]},{8:[2,16]},{27:[1,65],29:[1,66]},e(k,[2,79]),e(k,[2,80]),{27:[1,67],29:[1,68]},e(k,[2,85]),e(k,[2,86]),{62:69,65:ee,66:A,67:te,68:ne,69:re,70:ie,71:ae},{62:77,65:ee,66:A,67:te,68:ne,69:re,70:ie,71:ae},{30:78,33:62,75:E,89:C,90:w},{73:79,75:j,76:M,78:81,79:82,80:N,81:P,82:F,83:I,84:L,85:R,86:z,87:B,88:V},e(oe,[2,60]),e(oe,[2,62]),{73:93,75:j,76:M,78:81,79:82,80:N,81:P,82:F,83:I,84:L,85:R,86:z,87:B,88:V},{30:94,33:62,75:E,76:M,89:C,90:w},{5:[1,95]},{30:96,33:62,75:E,89:C,90:w},{5:[1,97]},{30:98,33:62,75:E,89:C,90:w},{63:[1,99]},e(H,[2,50]),e(H,[2,51]),e(H,[2,52]),e(H,[2,53]),e(H,[2,54]),e(H,[2,55]),e(H,[2,56]),{64:[1,100]},e(T,[2,59],{76:M}),e(T,[2,64],{76:se}),{33:103,75:[1,102],89:C,90:w},e(ce,[2,65],{79:104,75:j,80:N,81:P,82:F,83:I,84:L,85:R,86:z,87:B,88:V}),e(U,[2,67]),e(U,[2,69]),e(U,[2,70]),e(U,[2,71]),e(U,[2,72]),e(U,[2,73]),e(U,[2,74]),e(U,[2,75]),e(U,[2,76]),e(U,[2,77]),e(U,[2,78]),e(T,[2,57],{76:se}),e(T,[2,58],{76:M}),{5:W,28:105,31:G,34:K,36:q,38:J,40:Y},{27:[1,112],76:M},{5:X,40:Z,56:113,57:Q,59:$},{27:[1,118],76:M},{33:119,89:C,90:w},{33:120,89:C,90:w},{75:j,78:121,79:82,80:N,81:P,82:F,83:I,84:L,85:R,86:z,87:B,88:V},e(oe,[2,61]),e(oe,[2,63]),e(U,[2,68]),e(T,[2,21]),{32:[1,122]},{32:[1,123]},{32:[1,124]},{32:[1,125]},{5:W,28:126,31:G,34:K,36:q,38:J,40:Y},e(T,[2,28]),{5:[1,127]},e(T,[2,42]),{32:[1,128]},{32:[1,129]},{5:X,40:Z,56:130,57:Q,59:$},e(T,[2,47]),{5:[1,131]},e(T,[2,48]),e(T,[2,49]),e(ce,[2,66],{79:104,75:j,80:N,81:P,82:F,83:I,84:L,85:R,86:z,87:B,88:V}),{33:132,89:C,90:w},{35:133,89:[1,134],90:[1,135]},{37:136,47:[1,137],48:[1,138],49:[1,139]},{39:140,50:[1,141],51:[1,142],52:[1,143],53:[1,144]},e(T,[2,27]),{5:W,28:145,31:G,34:K,36:q,38:J,40:Y},{58:146,89:[1,147],90:[1,148]},{60:149,89:[1,150],90:[1,151]},e(T,[2,46]),{5:X,40:Z,56:152,57:Q,59:$},{5:[1,153]},{5:[1,154]},{5:[2,83]},{5:[2,84]},{5:[1,155]},{5:[2,35]},{5:[2,36]},{5:[2,37]},{5:[1,156]},{5:[2,38]},{5:[2,39]},{5:[2,40]},{5:[2,41]},e(T,[2,22]),{5:[1,157]},{5:[2,87]},{5:[2,88]},{5:[1,158]},{5:[2,89]},{5:[2,90]},e(T,[2,43]),{5:W,28:159,31:G,34:K,36:q,38:J,40:Y},{5:W,28:160,31:G,34:K,36:q,38:J,40:Y},{5:W,28:161,31:G,34:K,36:q,38:J,40:Y},{5:W,28:162,31:G,34:K,36:q,38:J,40:Y},{5:X,40:Z,56:163,57:Q,59:$},{5:X,40:Z,56:164,57:Q,59:$},e(T,[2,23]),e(T,[2,24]),e(T,[2,25]),e(T,[2,26]),e(T,[2,44]),e(T,[2,45])],defaultActions:{8:[2,2],12:[2,1],41:[2,3],42:[2,8],43:[2,9],44:[2,10],45:[2,11],46:[2,12],47:[2,13],48:[2,14],49:[2,15],50:[2,16],134:[2,83],135:[2,84],137:[2,35],138:[2,36],139:[2,37],141:[2,38],142:[2,39],143:[2,40],144:[2,41],147:[2,87],148:[2,88],150:[2,89],151:[2,90]},parseError:t(function(e,t){if(t.recoverable)this.trace(e);else{var n=Error(e);throw n.hash=t,n}},`parseError`),parse:t(function(e){var n=this,r=[0],i=[],a=[null],o=[],s=this.table,c=``,l=0,u=0,d=0,f=2,p=1,m=o.slice.call(arguments,1),h=Object.create(this.lexer),g={yy:{}};for(var _ in this.yy)Object.prototype.hasOwnProperty.call(this.yy,_)&&(g.yy[_]=this.yy[_]);h.setInput(e,g.yy),g.yy.lexer=h,g.yy.parser=this,h.yylloc===void 0&&(h.yylloc={});var v=h.yylloc;o.push(v);var y=h.options&&h.options.ranges;this.parseError=typeof g.yy.parseError==`function`?g.yy.parseError:Object.getPrototypeOf(this).parseError;function b(e){r.length-=2*e,a.length-=e,o.length-=e}t(b,`popStack`);function x(){var e=i.pop()||h.lex()||p;return typeof e!=`number`&&(e instanceof Array&&(i=e,e=i.pop()),e=n.symbols_[e]||e),e}t(x,`lex`);for(var S,C,w,T,E,D={},O,k,ee,A;;){if(w=r[r.length-1],this.defaultActions[w]?T=this.defaultActions[w]:(S??=x(),T=s[w]&&s[w][S]),T===void 0||!T.length||!T[0]){var te=``;for(O in A=[],s[w])this.terminals_[O]&&O>f&&A.push(`'`+this.terminals_[O]+`'`);te=h.showPosition?`Parse error on line `+(l+1)+`:
1
+ import{g as e}from"./chunk-75Z2AOVW-DA_lihEi.js";import{n as t,t as n}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import{t as r}from"./src-Cyu5G-Tr.js";import{H as i,K as a,U as o,a as s,b as c,v as l,w as u,x as d,y as f}from"./chunk-DU6HZSFF-J-califE.js";import"./chunk-P2QGCYS3-DsJshZeL.js";import"./chunk-PWAF6VOD-CrFPAGFi.js";import"./chunk-GMAD6QVW-mXoq4V-T.js";import"./chunk-4HAMMTFA-F3WVmmmo.js";import"./chunk-GVQU2GXP-B-87l3Xt.js";import"./chunk-L3NEJ4N5-DLeZO9l0.js";import"./chunk-OSK3NFVY-PWoOtECb.js";import{n as p,r as m}from"./mermaid-3TiKkcPE.js";import{t as h}from"./chunk-XXDRQBXY-BwqwIlJV.js";import{t as g}from"./chunk-POPQ4Y6H-CCg5TpSp.js";var _=(function(){var e=t(function(e,t,n,r){for(n||={},r=e.length;r--;n[e[r]]=t);return n},`o`),n=[1,3],r=[1,4],i=[1,5],a=[1,6],o=[5,6,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,77,89,90],s=[1,22],c=[2,7],l=[1,26],u=[1,27],d=[1,28],f=[1,29],p=[1,33],m=[1,34],h=[1,35],g=[1,36],_=[1,37],v=[1,38],y=[1,24],b=[1,31],x=[1,32],S=[1,30],C=[1,39],w=[1,40],T=[5,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,77,89,90],E=[1,61],D=[89,90],O=[5,8,9,11,13,21,22,23,24,27,29,41,42,43,44,45,46,54,61,63,72,74,75,76,77,80,81,82,83,84,85,86,87,88,89,90],k=[27,29],ee=[1,70],A=[1,71],te=[1,72],ne=[1,73],re=[1,74],ie=[1,75],ae=[1,76],j=[1,83],M=[1,80],N=[1,84],P=[1,85],F=[1,86],I=[1,87],L=[1,88],R=[1,89],z=[1,90],B=[1,91],V=[1,92],oe=[5,8,9,11,13,21,22,23,24,27,41,42,43,44,45,46,54,72,74,75,76,77,80,81,82,83,84,85,86,87,88,89,90],H=[63,64],se=[1,101],ce=[5,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,76,77,89,90],U=[5,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,75,76,77,80,81,82,83,84,85,86,87,88,89,90],W=[1,110],G=[1,106],K=[1,107],q=[1,108],J=[1,109],Y=[1,111],X=[1,116],Z=[1,117],Q=[1,114],$=[1,115],le={trace:t(function(){},`trace`),yy:{},symbols_:{error:2,start:3,directive:4,NEWLINE:5,RD:6,diagram:7,EOF:8,acc_title:9,acc_title_value:10,acc_descr:11,acc_descr_value:12,acc_descr_multiline_value:13,requirementDef:14,elementDef:15,relationshipDef:16,direction:17,styleStatement:18,classDefStatement:19,classStatement:20,direction_tb:21,direction_bt:22,direction_rl:23,direction_lr:24,requirementType:25,requirementName:26,STRUCT_START:27,requirementBody:28,STYLE_SEPARATOR:29,idList:30,ID:31,COLONSEP:32,id:33,TEXT:34,text:35,RISK:36,riskLevel:37,VERIFYMTHD:38,verifyType:39,STRUCT_STOP:40,REQUIREMENT:41,FUNCTIONAL_REQUIREMENT:42,INTERFACE_REQUIREMENT:43,PERFORMANCE_REQUIREMENT:44,PHYSICAL_REQUIREMENT:45,DESIGN_CONSTRAINT:46,LOW_RISK:47,MED_RISK:48,HIGH_RISK:49,VERIFY_ANALYSIS:50,VERIFY_DEMONSTRATION:51,VERIFY_INSPECTION:52,VERIFY_TEST:53,ELEMENT:54,elementName:55,elementBody:56,TYPE:57,type:58,DOCREF:59,ref:60,END_ARROW_L:61,relationship:62,LINE:63,END_ARROW_R:64,CONTAINS:65,COPIES:66,DERIVES:67,SATISFIES:68,VERIFIES:69,REFINES:70,TRACES:71,CLASSDEF:72,stylesOpt:73,CLASS:74,ALPHA:75,COMMA:76,STYLE:77,style:78,styleComponent:79,NUM:80,COLON:81,UNIT:82,SPACE:83,BRKT:84,PCT:85,MINUS:86,LABEL:87,SEMICOLON:88,unqString:89,qString:90,$accept:0,$end:1},terminals_:{2:`error`,5:`NEWLINE`,6:`RD`,8:`EOF`,9:`acc_title`,10:`acc_title_value`,11:`acc_descr`,12:`acc_descr_value`,13:`acc_descr_multiline_value`,21:`direction_tb`,22:`direction_bt`,23:`direction_rl`,24:`direction_lr`,27:`STRUCT_START`,29:`STYLE_SEPARATOR`,31:`ID`,32:`COLONSEP`,34:`TEXT`,36:`RISK`,38:`VERIFYMTHD`,40:`STRUCT_STOP`,41:`REQUIREMENT`,42:`FUNCTIONAL_REQUIREMENT`,43:`INTERFACE_REQUIREMENT`,44:`PERFORMANCE_REQUIREMENT`,45:`PHYSICAL_REQUIREMENT`,46:`DESIGN_CONSTRAINT`,47:`LOW_RISK`,48:`MED_RISK`,49:`HIGH_RISK`,50:`VERIFY_ANALYSIS`,51:`VERIFY_DEMONSTRATION`,52:`VERIFY_INSPECTION`,53:`VERIFY_TEST`,54:`ELEMENT`,57:`TYPE`,59:`DOCREF`,61:`END_ARROW_L`,63:`LINE`,64:`END_ARROW_R`,65:`CONTAINS`,66:`COPIES`,67:`DERIVES`,68:`SATISFIES`,69:`VERIFIES`,70:`REFINES`,71:`TRACES`,72:`CLASSDEF`,74:`CLASS`,75:`ALPHA`,76:`COMMA`,77:`STYLE`,80:`NUM`,81:`COLON`,82:`UNIT`,83:`SPACE`,84:`BRKT`,85:`PCT`,86:`MINUS`,87:`LABEL`,88:`SEMICOLON`,89:`unqString`,90:`qString`},productions_:[0,[3,3],[3,2],[3,4],[4,2],[4,2],[4,1],[7,0],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[17,1],[17,1],[17,1],[17,1],[14,5],[14,7],[28,5],[28,5],[28,5],[28,5],[28,2],[28,1],[25,1],[25,1],[25,1],[25,1],[25,1],[25,1],[37,1],[37,1],[37,1],[39,1],[39,1],[39,1],[39,1],[15,5],[15,7],[56,5],[56,5],[56,2],[56,1],[16,5],[16,5],[62,1],[62,1],[62,1],[62,1],[62,1],[62,1],[62,1],[19,3],[20,3],[20,3],[30,1],[30,3],[30,1],[30,3],[18,3],[73,1],[73,3],[78,1],[78,2],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[26,1],[26,1],[33,1],[33,1],[35,1],[35,1],[55,1],[55,1],[58,1],[58,1],[60,1],[60,1]],performAction:t(function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 4:this.$=a[s].trim(),r.setAccTitle(this.$);break;case 5:case 6:this.$=a[s].trim(),r.setAccDescription(this.$);break;case 7:this.$=[];break;case 17:r.setDirection(`TB`);break;case 18:r.setDirection(`BT`);break;case 19:r.setDirection(`RL`);break;case 20:r.setDirection(`LR`);break;case 21:r.addRequirement(a[s-3],a[s-4]);break;case 22:r.addRequirement(a[s-5],a[s-6]),r.setClass([a[s-5]],a[s-3]);break;case 23:r.setNewReqId(a[s-2]);break;case 24:r.setNewReqText(a[s-2]);break;case 25:r.setNewReqRisk(a[s-2]);break;case 26:r.setNewReqVerifyMethod(a[s-2]);break;case 29:this.$=r.RequirementType.REQUIREMENT;break;case 30:this.$=r.RequirementType.FUNCTIONAL_REQUIREMENT;break;case 31:this.$=r.RequirementType.INTERFACE_REQUIREMENT;break;case 32:this.$=r.RequirementType.PERFORMANCE_REQUIREMENT;break;case 33:this.$=r.RequirementType.PHYSICAL_REQUIREMENT;break;case 34:this.$=r.RequirementType.DESIGN_CONSTRAINT;break;case 35:this.$=r.RiskLevel.LOW_RISK;break;case 36:this.$=r.RiskLevel.MED_RISK;break;case 37:this.$=r.RiskLevel.HIGH_RISK;break;case 38:this.$=r.VerifyType.VERIFY_ANALYSIS;break;case 39:this.$=r.VerifyType.VERIFY_DEMONSTRATION;break;case 40:this.$=r.VerifyType.VERIFY_INSPECTION;break;case 41:this.$=r.VerifyType.VERIFY_TEST;break;case 42:r.addElement(a[s-3]);break;case 43:r.addElement(a[s-5]),r.setClass([a[s-5]],a[s-3]);break;case 44:r.setNewElementType(a[s-2]);break;case 45:r.setNewElementDocRef(a[s-2]);break;case 48:r.addRelationship(a[s-2],a[s],a[s-4]);break;case 49:r.addRelationship(a[s-2],a[s-4],a[s]);break;case 50:this.$=r.Relationships.CONTAINS;break;case 51:this.$=r.Relationships.COPIES;break;case 52:this.$=r.Relationships.DERIVES;break;case 53:this.$=r.Relationships.SATISFIES;break;case 54:this.$=r.Relationships.VERIFIES;break;case 55:this.$=r.Relationships.REFINES;break;case 56:this.$=r.Relationships.TRACES;break;case 57:this.$=a[s-2],r.defineClass(a[s-1],a[s]);break;case 58:r.setClass(a[s-1],a[s]);break;case 59:r.setClass([a[s-2]],a[s]);break;case 60:case 62:this.$=[a[s]];break;case 61:case 63:this.$=a[s-2].concat([a[s]]);break;case 64:this.$=a[s-2],r.setCssStyle(a[s-1],a[s]);break;case 65:this.$=[a[s]];break;case 66:a[s-2].push(a[s]),this.$=a[s-2];break;case 68:this.$=a[s-1]+a[s]}},`anonymous`),table:[{3:1,4:2,6:n,9:r,11:i,13:a},{1:[3]},{3:8,4:2,5:[1,7],6:n,9:r,11:i,13:a},{5:[1,9]},{10:[1,10]},{12:[1,11]},e(o,[2,6]),{3:12,4:2,6:n,9:r,11:i,13:a},{1:[2,2]},{4:17,5:s,7:13,8:c,9:r,11:i,13:a,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:d,24:f,25:23,33:25,41:p,42:m,43:h,44:g,45:_,46:v,54:y,72:b,74:x,77:S,89:C,90:w},e(o,[2,4]),e(o,[2,5]),{1:[2,1]},{8:[1,41]},{4:17,5:s,7:42,8:c,9:r,11:i,13:a,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:d,24:f,25:23,33:25,41:p,42:m,43:h,44:g,45:_,46:v,54:y,72:b,74:x,77:S,89:C,90:w},{4:17,5:s,7:43,8:c,9:r,11:i,13:a,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:d,24:f,25:23,33:25,41:p,42:m,43:h,44:g,45:_,46:v,54:y,72:b,74:x,77:S,89:C,90:w},{4:17,5:s,7:44,8:c,9:r,11:i,13:a,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:d,24:f,25:23,33:25,41:p,42:m,43:h,44:g,45:_,46:v,54:y,72:b,74:x,77:S,89:C,90:w},{4:17,5:s,7:45,8:c,9:r,11:i,13:a,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:d,24:f,25:23,33:25,41:p,42:m,43:h,44:g,45:_,46:v,54:y,72:b,74:x,77:S,89:C,90:w},{4:17,5:s,7:46,8:c,9:r,11:i,13:a,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:d,24:f,25:23,33:25,41:p,42:m,43:h,44:g,45:_,46:v,54:y,72:b,74:x,77:S,89:C,90:w},{4:17,5:s,7:47,8:c,9:r,11:i,13:a,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:d,24:f,25:23,33:25,41:p,42:m,43:h,44:g,45:_,46:v,54:y,72:b,74:x,77:S,89:C,90:w},{4:17,5:s,7:48,8:c,9:r,11:i,13:a,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:d,24:f,25:23,33:25,41:p,42:m,43:h,44:g,45:_,46:v,54:y,72:b,74:x,77:S,89:C,90:w},{4:17,5:s,7:49,8:c,9:r,11:i,13:a,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:d,24:f,25:23,33:25,41:p,42:m,43:h,44:g,45:_,46:v,54:y,72:b,74:x,77:S,89:C,90:w},{4:17,5:s,7:50,8:c,9:r,11:i,13:a,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:d,24:f,25:23,33:25,41:p,42:m,43:h,44:g,45:_,46:v,54:y,72:b,74:x,77:S,89:C,90:w},{26:51,89:[1,52],90:[1,53]},{55:54,89:[1,55],90:[1,56]},{29:[1,59],61:[1,57],63:[1,58]},e(T,[2,17]),e(T,[2,18]),e(T,[2,19]),e(T,[2,20]),{30:60,33:62,75:E,89:C,90:w},{30:63,33:62,75:E,89:C,90:w},{30:64,33:62,75:E,89:C,90:w},e(D,[2,29]),e(D,[2,30]),e(D,[2,31]),e(D,[2,32]),e(D,[2,33]),e(D,[2,34]),e(O,[2,81]),e(O,[2,82]),{1:[2,3]},{8:[2,8]},{8:[2,9]},{8:[2,10]},{8:[2,11]},{8:[2,12]},{8:[2,13]},{8:[2,14]},{8:[2,15]},{8:[2,16]},{27:[1,65],29:[1,66]},e(k,[2,79]),e(k,[2,80]),{27:[1,67],29:[1,68]},e(k,[2,85]),e(k,[2,86]),{62:69,65:ee,66:A,67:te,68:ne,69:re,70:ie,71:ae},{62:77,65:ee,66:A,67:te,68:ne,69:re,70:ie,71:ae},{30:78,33:62,75:E,89:C,90:w},{73:79,75:j,76:M,78:81,79:82,80:N,81:P,82:F,83:I,84:L,85:R,86:z,87:B,88:V},e(oe,[2,60]),e(oe,[2,62]),{73:93,75:j,76:M,78:81,79:82,80:N,81:P,82:F,83:I,84:L,85:R,86:z,87:B,88:V},{30:94,33:62,75:E,76:M,89:C,90:w},{5:[1,95]},{30:96,33:62,75:E,89:C,90:w},{5:[1,97]},{30:98,33:62,75:E,89:C,90:w},{63:[1,99]},e(H,[2,50]),e(H,[2,51]),e(H,[2,52]),e(H,[2,53]),e(H,[2,54]),e(H,[2,55]),e(H,[2,56]),{64:[1,100]},e(T,[2,59],{76:M}),e(T,[2,64],{76:se}),{33:103,75:[1,102],89:C,90:w},e(ce,[2,65],{79:104,75:j,80:N,81:P,82:F,83:I,84:L,85:R,86:z,87:B,88:V}),e(U,[2,67]),e(U,[2,69]),e(U,[2,70]),e(U,[2,71]),e(U,[2,72]),e(U,[2,73]),e(U,[2,74]),e(U,[2,75]),e(U,[2,76]),e(U,[2,77]),e(U,[2,78]),e(T,[2,57],{76:se}),e(T,[2,58],{76:M}),{5:W,28:105,31:G,34:K,36:q,38:J,40:Y},{27:[1,112],76:M},{5:X,40:Z,56:113,57:Q,59:$},{27:[1,118],76:M},{33:119,89:C,90:w},{33:120,89:C,90:w},{75:j,78:121,79:82,80:N,81:P,82:F,83:I,84:L,85:R,86:z,87:B,88:V},e(oe,[2,61]),e(oe,[2,63]),e(U,[2,68]),e(T,[2,21]),{32:[1,122]},{32:[1,123]},{32:[1,124]},{32:[1,125]},{5:W,28:126,31:G,34:K,36:q,38:J,40:Y},e(T,[2,28]),{5:[1,127]},e(T,[2,42]),{32:[1,128]},{32:[1,129]},{5:X,40:Z,56:130,57:Q,59:$},e(T,[2,47]),{5:[1,131]},e(T,[2,48]),e(T,[2,49]),e(ce,[2,66],{79:104,75:j,80:N,81:P,82:F,83:I,84:L,85:R,86:z,87:B,88:V}),{33:132,89:C,90:w},{35:133,89:[1,134],90:[1,135]},{37:136,47:[1,137],48:[1,138],49:[1,139]},{39:140,50:[1,141],51:[1,142],52:[1,143],53:[1,144]},e(T,[2,27]),{5:W,28:145,31:G,34:K,36:q,38:J,40:Y},{58:146,89:[1,147],90:[1,148]},{60:149,89:[1,150],90:[1,151]},e(T,[2,46]),{5:X,40:Z,56:152,57:Q,59:$},{5:[1,153]},{5:[1,154]},{5:[2,83]},{5:[2,84]},{5:[1,155]},{5:[2,35]},{5:[2,36]},{5:[2,37]},{5:[1,156]},{5:[2,38]},{5:[2,39]},{5:[2,40]},{5:[2,41]},e(T,[2,22]),{5:[1,157]},{5:[2,87]},{5:[2,88]},{5:[1,158]},{5:[2,89]},{5:[2,90]},e(T,[2,43]),{5:W,28:159,31:G,34:K,36:q,38:J,40:Y},{5:W,28:160,31:G,34:K,36:q,38:J,40:Y},{5:W,28:161,31:G,34:K,36:q,38:J,40:Y},{5:W,28:162,31:G,34:K,36:q,38:J,40:Y},{5:X,40:Z,56:163,57:Q,59:$},{5:X,40:Z,56:164,57:Q,59:$},e(T,[2,23]),e(T,[2,24]),e(T,[2,25]),e(T,[2,26]),e(T,[2,44]),e(T,[2,45])],defaultActions:{8:[2,2],12:[2,1],41:[2,3],42:[2,8],43:[2,9],44:[2,10],45:[2,11],46:[2,12],47:[2,13],48:[2,14],49:[2,15],50:[2,16],134:[2,83],135:[2,84],137:[2,35],138:[2,36],139:[2,37],141:[2,38],142:[2,39],143:[2,40],144:[2,41],147:[2,87],148:[2,88],150:[2,89],151:[2,90]},parseError:t(function(e,t){if(t.recoverable)this.trace(e);else{var n=Error(e);throw n.hash=t,n}},`parseError`),parse:t(function(e){var n=this,r=[0],i=[],a=[null],o=[],s=this.table,c=``,l=0,u=0,d=0,f=2,p=1,m=o.slice.call(arguments,1),h=Object.create(this.lexer),g={yy:{}};for(var _ in this.yy)Object.prototype.hasOwnProperty.call(this.yy,_)&&(g.yy[_]=this.yy[_]);h.setInput(e,g.yy),g.yy.lexer=h,g.yy.parser=this,h.yylloc===void 0&&(h.yylloc={});var v=h.yylloc;o.push(v);var y=h.options&&h.options.ranges;this.parseError=typeof g.yy.parseError==`function`?g.yy.parseError:Object.getPrototypeOf(this).parseError;function b(e){r.length-=2*e,a.length-=e,o.length-=e}t(b,`popStack`);function x(){var e=i.pop()||h.lex()||p;return typeof e!=`number`&&(e instanceof Array&&(i=e,e=i.pop()),e=n.symbols_[e]||e),e}t(x,`lex`);for(var S,C,w,T,E,D={},O,k,ee,A;;){if(w=r[r.length-1],this.defaultActions[w]?T=this.defaultActions[w]:(S??=x(),T=s[w]&&s[w][S]),T===void 0||!T.length||!T[0]){var te=``;for(O in A=[],s[w])this.terminals_[O]&&O>f&&A.push(`'`+this.terminals_[O]+`'`);te=h.showPosition?`Parse error on line `+(l+1)+`:
2
2
  `+h.showPosition()+`
3
3
  Expecting `+A.join(`, `)+`, got '`+(this.terminals_[S]||S)+`'`:`Parse error on line `+(l+1)+`: Unexpected `+(S==p?`end of input`:`'`+(this.terminals_[S]||S)+`'`),this.parseError(te,{text:h.match,token:this.terminals_[S]||S,line:h.yylineno,loc:v,expected:A})}if(T[0]instanceof Array&&T.length>1)throw Error(`Parse Error: multiple actions possible at state: `+w+`, token: `+S);switch(T[0]){case 1:r.push(S),a.push(h.yytext),o.push(h.yylloc),r.push(T[1]),S=null,C?(S=C,C=null):(u=h.yyleng,c=h.yytext,l=h.yylineno,v=h.yylloc,d>0&&d--);break;case 2:if(k=this.productions_[T[1]][1],D.$=a[a.length-k],D._$={first_line:o[o.length-(k||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(k||1)].first_column,last_column:o[o.length-1].last_column},y&&(D._$.range=[o[o.length-(k||1)].range[0],o[o.length-1].range[1]]),E=this.performAction.apply(D,[c,u,l,g.yy,T[1],a,o].concat(m)),E!==void 0)return E;k&&(r=r.slice(0,-1*k*2),a=a.slice(0,-1*k),o=o.slice(0,-1*k)),r.push(this.productions_[T[1]][0]),a.push(D.$),o.push(D._$),ee=s[r[r.length-2]][r[r.length-1]],r.push(ee);break;case 3:return!0}}return!0},`parse`)};le.lexer=(function(){return{EOF:1,parseError:t(function(e,t){if(this.yy.parser)this.yy.parser.parseError(e,t);else throw Error(e)},`parseError`),setInput:t(function(e,t){return this.yy=t||this.yy||{},this._input=e,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match=``,this.conditionStack=[`INITIAL`],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},`setInput`),input:t(function(){var e=this._input[0];return this.yytext+=e,this.yyleng++,this.offset++,this.match+=e,this.matched+=e,e.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),e},`input`),unput:t(function(e){var t=e.length,n=e.split(/(?:\r\n?|\n)/g);this._input=e+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-t),this.offset-=t;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-t},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-t]),this.yyleng=this.yytext.length,this},`unput`),more:t(function(){return this._more=!0,this},`more`),reject:t(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError(`Lexical error on line `+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
4
4
  `+this.showPosition(),{text:``,token:null,line:this.yylineno});return this},`reject`),less:t(function(e){this.unput(this.match.slice(e))},`less`),pastInput:t(function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(e.length>20?`...`:``)+e.substr(-20).replace(/\n/g,``)},`pastInput`),upcomingInput:t(function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(e.length>20?`...`:``)).replace(/\n/g,``)},`upcomingInput`),showPosition:t(function(){var e=this.pastInput(),t=Array(e.length+1).join(`-`);return e+this.upcomingInput()+`
@@ -1,4 +1,4 @@
1
- import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{l as t,t as n}from"./useEvent-Dc9HkKI2.js";import{t as r}from"./react-CUdNIagt.js";import{Bt as i,D as a,na as o,oa as s,rt as c,ta as l}from"./cells-B3WiM6w3.js";import{t as u}from"./compiler-runtime-BQ9S8nyo.js";import{T as d,s as f}from"./config-BxZgoFvi.js";import{g as p,t as m}from"./useEventListener-BdZUApHd.js";import{t as h}from"./utils-B4K466FK.js";import{p as g}from"./session-DXKMv4Bs.js";import{_}from"./config-DpGPGznL.js";import{t as v}from"./cn-ldLVeaqm.js";import{t as y}from"./jsx-runtime-B74pBk57.js";import{n as b}from"./fullscreen-BmzAqMKq.js";import{t as x}from"./tooltip-DR2Z2N4w.js";import{r as S,t as C}from"./button-BoklZTGL.js";import{t as w}from"./createLucideIcon-rHn2EdoM.js";import{C as T,S as E,_ as D,f as O,g as k,m as A,ot as j,v as M}from"./panels-Bso8csB-.js";import{a as N}from"./useNumberFormatter-C4-_TnkF.js";import{c as ee,i as P,l as F,n as te,t as ne}from"./RunButton-CmaVvEXE.js";import{r as re}from"./useTheme-DcnXlv0_.js";import{r as ie}from"./useDebounce-DMbg9X18.js";import{Ea as ae,Oa as oe,ai as se,gn as ce,hn as le,ji as ue,mn as de,y as fe}from"./index-BGA2MQ61.js";import{n as pe,t as me}from"./code-visibility-DrRJBvIr.js";/* empty css */var he=w(`sticky-note`,[[`path`,{d:`M21 9a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 15 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2z`,key:`1dfntj`}],[`path`,{d:`M15 3v5a1 1 0 0 0 1 1h5`,key:`6s6qgf`}]]),I=e(r(),1),ge=u(),L=(e,t)=>{for(let n in t)e[n]=t[n];return e},R=(e,t)=>Array.from(e.querySelectorAll(t)),_e=(e,t,n)=>{n?e.classList.add(t):e.classList.remove(t)},ve=e=>{if(typeof e==`string`){if(e===`null`)return null;if(e===`true`)return!0;if(e===`false`)return!1;if(e.match(/^-?[\d\.]+$/))return parseFloat(e)}return e},ye=(e,t)=>{e.style.transform=t},z=(e,t)=>{let n=e.matches||e.matchesSelector||e.msMatchesSelector;return!!(n&&n.call(e,t))},B=(e,t)=>{if(e&&typeof e.closest==`function`)return e.closest(t);for(;e;){if(z(e,t))return e;e=e.parentElement}return null},be=e=>{e||=document.documentElement;let t=e.requestFullscreen||e.webkitRequestFullscreen||e.webkitRequestFullScreen||e.mozRequestFullScreen||e.msRequestFullscreen;t&&t.apply(e)},xe=(e,t,n,r=``)=>{let i=e.querySelectorAll(`.`+n);for(let t=0;t<i.length;t++){let n=i[t];if(n.parentNode===e)return n}let a=document.createElement(t);return a.className=n,a.innerHTML=r,e.appendChild(a),a},Se=e=>{let t=document.createElement(`style`);return e&&e.length>0&&t.appendChild(document.createTextNode(e)),document.head.appendChild(t),t},Ce=()=>{let e={};location.search.replace(/[A-Z0-9]+?=([\w\.%-]*)/gi,t=>{let n=t.split(`=`).shift(),r=t.split(`=`).pop();return n&&r!==void 0&&(e[n]=r),t});for(let t in e){let n=e[t];e[t]=ve(unescape(n))}return e.dependencies!==void 0&&delete e.dependencies,e},we=(e,t=0)=>{if(e){let n,r=e.style.height;return e.style.height=`0px`,e.parentElement&&(e.parentElement.style.height=`auto`),n=t-(e.parentElement?.offsetHeight||0),e.style.height=r+`px`,e.parentElement&&e.parentElement.style.removeProperty(`height`),n}return t},V={mp4:`video/mp4`,m4a:`video/mp4`,ogv:`video/ogg`,mpeg:`video/mpeg`,webm:`video/webm`},H=(e=``)=>{let t=e.split(`.`).pop();return t?V[t]:void 0},Te=(e=``)=>encodeURI(e).replace(/%5B/g,`[`).replace(/%5D/g,`]`).replace(/[!'()*]/g,e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`),U=navigator.userAgent,Ee=/(iphone|ipod|ipad|android)/gi.test(U)||navigator.platform===`MacIntel`&&navigator.maxTouchPoints>1;/chrome/i.test(U)&&/edge/i.test(U);var De=/android/gi.test(U),Oe=function(e){if(e){var t=function(e){return[].slice.call(e)},n=0,r=1,i=2,a=3,o=[],s=null,c=`requestAnimationFrame`in e?function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{sync:!1};e.cancelAnimationFrame(s);var n=function(){return u(o.filter((function(e){return e.dirty&&e.active})))};if(t.sync)return n();s=e.requestAnimationFrame(n)}:function(){},l=function(e){return function(t){o.forEach((function(t){return t.dirty=e})),c(t)}},u=function(e){e.filter((function(e){return!e.styleComputed})).forEach((function(e){e.styleComputed=m(e)})),e.filter(h).forEach(g);var t=e.filter(p);t.forEach(f),t.forEach((function(e){g(e),d(e)})),t.forEach(_)},d=function(e){return e.dirty=n},f=function(e){e.availableWidth=e.element.parentNode.clientWidth,e.currentWidth=e.element.scrollWidth,e.previousFontSize=e.currentFontSize,e.currentFontSize=Math.min(Math.max(e.minSize,e.availableWidth/e.currentWidth*e.previousFontSize),e.maxSize),e.whiteSpace=e.multiLine&&e.currentFontSize===e.minSize?`normal`:`nowrap`},p=function(e){return e.dirty!==i||e.dirty===i&&e.element.parentNode.clientWidth!==e.availableWidth},m=function(t){var n=e.getComputedStyle(t.element,null);return t.currentFontSize=parseFloat(n.getPropertyValue(`font-size`)),t.display=n.getPropertyValue(`display`),t.whiteSpace=n.getPropertyValue(`white-space`),!0},h=function(e){var t=!1;return!e.preStyleTestCompleted&&(/inline-/.test(e.display)||(t=!0,e.display=`inline-block`),e.whiteSpace!==`nowrap`&&(t=!0,e.whiteSpace=`nowrap`),e.preStyleTestCompleted=!0,t)},g=function(e){e.element.style.whiteSpace=e.whiteSpace,e.element.style.display=e.display,e.element.style.fontSize=e.currentFontSize+`px`},_=function(e){e.element.dispatchEvent(new CustomEvent(`fit`,{detail:{oldValue:e.previousFontSize,newValue:e.currentFontSize,scaleFactor:e.currentFontSize/e.previousFontSize}}))},v=function(e,t){return function(n){e.dirty=t,e.active&&c(n)}},y=function(e){return function(){o=o.filter((function(t){return t.element!==e.element})),e.observeMutations&&e.observer.disconnect(),e.element.style.whiteSpace=e.originalStyle.whiteSpace,e.element.style.display=e.originalStyle.display,e.element.style.fontSize=e.originalStyle.fontSize}},b=function(e){return function(){e.active||(e.active=!0,c())}},x=function(e){return function(){return e.active=!1}},S=function(e){e.observeMutations&&(e.observer=new MutationObserver(v(e,r)),e.observer.observe(e.element,e.observeMutations))},C={minSize:16,maxSize:512,multiLine:!0,observeMutations:`MutationObserver`in e&&{subtree:!0,childList:!0,characterData:!0}},w=null,T=function(){e.clearTimeout(w),w=e.setTimeout(l(i),O.observeWindowDelay)},E=[`resize`,`orientationchange`];return Object.defineProperty(O,"observeWindow",{set:function(t){var n=`${t?`add`:`remove`}EventListener`;E.forEach((function(t){e[n](t,T)}))}}),O.observeWindow=!0,O.observeWindowDelay=100,O.fitAll=l(a),O}function D(e,t){var n=Object.assign({},C,t),r=e.map((function(e){var t=Object.assign({},n,{element:e,active:!0});return function(e){e.originalStyle={whiteSpace:e.element.style.whiteSpace,display:e.element.style.display,fontSize:e.element.style.fontSize},S(e),e.newbie=!0,e.dirty=!0,o.push(e)}(t),{element:e,fit:v(t,a),unfreeze:b(t),freeze:x(t),unsubscribe:y(t)}}));return c(),r}function O(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return typeof e==`string`?D(t(document.querySelectorAll(e)),n):D([e],n)[0]}}(typeof window>`u`?null:window);function W(e){"@babel/helpers - typeof";return W=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},W(e)}function ke(e,t){if(W(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(W(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function Ae(e){var t=ke(e,`string`);return W(t)==`symbol`?t:t+``}function je(e,t,n){return(t=Ae(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Me=class{constructor(e){je(this,`allowedToPlayAudio`,null),this.Reveal=e,this.startEmbeddedMedia=this.startEmbeddedMedia.bind(this),this.startEmbeddedIframe=this.startEmbeddedIframe.bind(this),this.preventIframeAutoFocus=this.preventIframeAutoFocus.bind(this),this.ensureMobileMediaPlaying=this.ensureMobileMediaPlaying.bind(this),this.failedAudioPlaybackTargets=new Set,this.failedVideoPlaybackTargets=new Set,this.failedMutedVideoPlaybackTargets=new Set,this.renderMediaPlayButton()}renderMediaPlayButton(){this.mediaPlayButton=document.createElement(`button`),this.mediaPlayButton.className=`r-overlay-button r-media-play-button`,this.mediaPlayButton.addEventListener(`click`,()=>{this.resetTemporarilyMutedMedia(),new Set([...this.failedAudioPlaybackTargets,...this.failedVideoPlaybackTargets,...this.failedMutedVideoPlaybackTargets]).forEach(e=>{this.startEmbeddedMedia({target:e})}),this.clearMediaPlaybackErrors()})}shouldPreload(e){if(this.Reveal.isScrollView())return!0;let t=this.Reveal.getConfig().preloadIframes;return typeof t!=`boolean`&&(t=e.hasAttribute(`data-preload`)),t}load(e,t={}){let n=this.Reveal.getConfig().display;if(n.includes(`!important`)){let t=n.replace(/\s*!important\s*$/,``).trim();e.style.setProperty(`display`,t,`important`)}else e.style.display=n;R(e,`img[data-src], video[data-src], audio[data-src], iframe[data-src]`).forEach(e=>{let t=e.tagName===`IFRAME`;(!t||this.shouldPreload(e))&&(e.setAttribute(`src`,e.getAttribute(`data-src`)),e.setAttribute(`data-lazy-loaded`,``),e.removeAttribute(`data-src`),t&&e.addEventListener(`load`,this.preventIframeAutoFocus))}),R(e,`video, audio`).forEach(e=>{let t=0;R(e,`source[data-src]`).forEach(e=>{e.setAttribute(`src`,e.getAttribute(`data-src`)),e.removeAttribute(`data-src`),e.setAttribute(`data-lazy-loaded`,``),t+=1}),Ee&&e.tagName===`VIDEO`&&e.setAttribute(`playsinline`,``),t>0&&e.load()});let r=e.slideBackgroundElement;if(r){r.style.display=`block`;let n=e.slideBackgroundContentElement,i=e.getAttribute(`data-background-iframe`);if(r.hasAttribute(`data-loaded`)===!1){r.setAttribute(`data-loaded`,`true`);let a=e.getAttribute(`data-background-image`),o=e.getAttribute(`data-background-video`),s=e.hasAttribute(`data-background-video-loop`),c=e.hasAttribute(`data-background-video-muted`);if(a)/^data:/.test(a.trim())?n.style.backgroundImage=`url(${a.trim()})`:n.style.backgroundImage=a.split(`,`).map(e=>`url(${Te(decodeURI(e.trim()))})`).join(`,`);else if(o){let e=document.createElement(`video`);s&&e.setAttribute(`loop`,``),(c||this.Reveal.isSpeakerNotes())&&(e.muted=!0),Ee&&e.setAttribute(`playsinline`,``),o.split(`,`).forEach(t=>{let n=document.createElement(`source`);n.setAttribute(`src`,t);let r=H(t);r&&n.setAttribute(`type`,r),e.appendChild(n)}),n.appendChild(e)}else if(i&&t.excludeIframes!==!0){let e=document.createElement(`iframe`);e.setAttribute(`allowfullscreen`,``),e.setAttribute(`mozallowfullscreen`,``),e.setAttribute(`webkitallowfullscreen`,``),e.setAttribute(`allow`,`autoplay`),e.setAttribute(`data-src`,i),e.style.width=`100%`,e.style.height=`100%`,e.style.maxHeight=`100%`,e.style.maxWidth=`100%`,n.appendChild(e)}}let a=n.querySelector(`iframe[data-src]`);a&&this.shouldPreload(r)&&!/autoplay=(1|true|yes)/gi.test(i)&&a.getAttribute(`src`)!==i&&a.setAttribute(`src`,i)}this.layout(e)}layout(e){Array.from(e.querySelectorAll(`.r-fit-text`)).forEach(e=>{Oe(e,{minSize:24,maxSize:this.Reveal.getConfig().height*.8,observeMutations:!1,observeWindow:!1})})}unload(e){e.style.display=`none`;let t=this.Reveal.getSlideBackground(e);t&&(t.style.display=`none`,R(t,`iframe[src]`).forEach(e=>{e.removeAttribute(`src`)})),R(e,`video[data-lazy-loaded][src], audio[data-lazy-loaded][src], iframe[data-lazy-loaded][src]`).forEach(e=>{e.setAttribute(`data-src`,e.getAttribute(`src`)),e.removeAttribute(`src`)}),R(e,`video[data-lazy-loaded] source[src], audio source[src]`).forEach(e=>{e.setAttribute(`data-src`,e.getAttribute(`src`)),e.removeAttribute(`src`)})}formatEmbeddedContent(){let e=(e,t,n)=>{R(this.Reveal.getSlidesElement(),`iframe[`+e+`*="`+t+`"]`).forEach(t=>{let r=t.getAttribute(e);r&&r.indexOf(n)===-1&&t.setAttribute(e,r+(/\?/.test(r)?`&`:`?`)+n)})};e(`src`,`youtube.com/embed/`,`enablejsapi=1`),e(`data-src`,`youtube.com/embed/`,`enablejsapi=1`),e(`src`,`player.vimeo.com/`,`api=1`),e(`data-src`,`player.vimeo.com/`,`api=1`)}startEmbeddedContent(e){if(e){let t=this.Reveal.isSpeakerNotes();R(e,`img[src$=".gif"]`).forEach(e=>{e.setAttribute(`src`,e.getAttribute(`src`))}),R(e,`video, audio`).forEach(e=>{if(B(e,`.fragment`)&&!B(e,`.fragment.visible`))return;let n=this.Reveal.getConfig().autoPlayMedia;if(typeof n!=`boolean`&&(n=e.hasAttribute(`data-autoplay`)||!!B(e,`.slide-background`)),n&&typeof e.play==`function`){if(t&&!e.muted)return;e.readyState>1?this.startEmbeddedMedia({target:e}):Ee?(e.addEventListener(`canplay`,this.ensureMobileMediaPlaying),this.playMediaElement(e)):(e.removeEventListener(`loadeddata`,this.startEmbeddedMedia),e.addEventListener(`loadeddata`,this.startEmbeddedMedia))}}),t||(R(e,`iframe[src]`).forEach(e=>{B(e,`.fragment`)&&!B(e,`.fragment.visible`)||this.startEmbeddedIframe({target:e})}),R(e,`iframe[data-src]`).forEach(e=>{B(e,`.fragment`)&&!B(e,`.fragment.visible`)||e.getAttribute(`src`)!==e.getAttribute(`data-src`)&&(e.removeEventListener(`load`,this.startEmbeddedIframe),e.addEventListener(`load`,this.startEmbeddedIframe),e.setAttribute(`src`,e.getAttribute(`data-src`)))}))}}ensureMobileMediaPlaying(e){let t=e.target;typeof t.getVideoPlaybackQuality==`function`&&setTimeout(()=>{let e=t.paused===!1,n=t.getVideoPlaybackQuality().totalVideoFrames;e&&n===0&&(t.load(),t.play())},1e3)}startEmbeddedMedia(e){let t=!!B(e.target,`html`),n=!!B(e.target,`.present`);t&&n&&(e.target.paused||e.target.ended)&&(e.target.currentTime=0,this.playMediaElement(e.target)),e.target.removeEventListener(`loadeddata`,this.startEmbeddedMedia)}playMediaElement(e){let t=e.play();t&&typeof t.catch==`function`&&t.then(()=>{e.muted||(this.allowedToPlayAudio=!0)}).catch(t=>{if(t.name===`NotAllowedError`){if(this.allowedToPlayAudio=!1,e.tagName===`VIDEO`){this.onVideoPlaybackNotAllowed(e);let t=!!B(e,`html`),n=!!B(e,`.present`),r=e.muted;t&&n&&!r&&(e.setAttribute(`data-muted-by-reveal`,`true`),e.muted=!0,e.play().catch(()=>{this.onMutedVideoPlaybackNotAllowed(e)}))}else e.tagName===`AUDIO`&&this.onAudioPlaybackNotAllowed(e)}})}startEmbeddedIframe(e){let t=e.target;if(this.preventIframeAutoFocus(e),t&&t.contentWindow){let n=!!B(e.target,`html`),r=!!B(e.target,`.present`);if(n&&r){let e=this.Reveal.getConfig().autoPlayMedia;typeof e!=`boolean`&&(e=t.hasAttribute(`data-autoplay`)||!!B(t,`.slide-background`)),/youtube\.com\/embed\//.test(t.getAttribute(`src`))&&e?t.contentWindow.postMessage(`{"event":"command","func":"playVideo","args":""}`,`*`):/player\.vimeo\.com\//.test(t.getAttribute(`src`))&&e?t.contentWindow.postMessage(`{"method":"play"}`,`*`):t.contentWindow.postMessage(`slide:start`,`*`)}}}stopEmbeddedContent(e,t={}){t=L({unloadIframes:!0},t),e&&e.parentNode&&(R(e,`video, audio`).forEach(e=>{!e.hasAttribute(`data-ignore`)&&typeof e.pause==`function`&&(e.setAttribute(`data-paused-by-reveal`,``),e.pause(),Ee&&e.removeEventListener(`canplay`,this.ensureMobileMediaPlaying))}),R(e,`iframe`).forEach(e=>{e.contentWindow&&e.contentWindow.postMessage(`slide:stop`,`*`),e.removeEventListener(`load`,this.preventIframeAutoFocus),e.removeEventListener(`load`,this.startEmbeddedIframe)}),R(e,`iframe[src*="youtube.com/embed/"]`).forEach(e=>{!e.hasAttribute(`data-ignore`)&&e.contentWindow&&typeof e.contentWindow.postMessage==`function`&&e.contentWindow.postMessage(`{"event":"command","func":"pauseVideo","args":""}`,`*`)}),R(e,`iframe[src*="player.vimeo.com/"]`).forEach(e=>{!e.hasAttribute(`data-ignore`)&&e.contentWindow&&typeof e.contentWindow.postMessage==`function`&&e.contentWindow.postMessage(`{"method":"pause"}`,`*`)}),t.unloadIframes===!0&&R(e,`iframe[data-src]`).forEach(e=>{e.setAttribute(`src`,`about:blank`),e.removeAttribute(`src`)}))}isAllowedToPlayAudio(){return this.allowedToPlayAudio}showPlayOrUnmuteButton(){let e=this.failedAudioPlaybackTargets.size,t=this.failedVideoPlaybackTargets.size,n=this.failedMutedVideoPlaybackTargets.size,r=`Play media`;n>0?r=`Play video`:t>0?r=`Unmute video`:e>0&&(r=`Play audio`),this.mediaPlayButton.textContent=r,this.Reveal.getRevealElement().appendChild(this.mediaPlayButton)}onAudioPlaybackNotAllowed(e){this.failedAudioPlaybackTargets.add(e),this.showPlayOrUnmuteButton(e)}onVideoPlaybackNotAllowed(e){this.failedVideoPlaybackTargets.add(e),this.showPlayOrUnmuteButton()}onMutedVideoPlaybackNotAllowed(e){this.failedMutedVideoPlaybackTargets.add(e),this.showPlayOrUnmuteButton()}resetTemporarilyMutedMedia(){new Set([...this.failedAudioPlaybackTargets,...this.failedVideoPlaybackTargets,...this.failedMutedVideoPlaybackTargets]).forEach(e=>{e.hasAttribute(`data-muted-by-reveal`)&&(e.muted=!1,e.removeAttribute(`data-muted-by-reveal`))})}clearMediaPlaybackErrors(){this.resetTemporarilyMutedMedia(),this.failedAudioPlaybackTargets.clear(),this.failedVideoPlaybackTargets.clear(),this.failedMutedVideoPlaybackTargets.clear(),this.mediaPlayButton&&this.mediaPlayButton.parentNode&&this.mediaPlayButton.remove()}preventIframeAutoFocus(e){let t=e.target;if(t&&this.Reveal.getConfig().preventIframeAutoFocus){let e=0,n=()=>{document.activeElement===t?document.activeElement.blur():e<1e3&&(e+=100,setTimeout(n,100))};setTimeout(n,100)}}afterSlideChanged(){this.clearMediaPlaybackErrors()}},Ne=`.slides section`,Pe=`.slides>section`,Fe=`.slides>section.present>section`,Ie=`.backgrounds>.slide-background`,Le=/registerPlugin|registerKeyboardShortcut|addKeyBinding|addEventListener|showPreview|previewIframe/,Re=class{constructor(e){this.Reveal=e}render(){this.element=document.createElement(`div`),this.element.className=`slide-number`,this.Reveal.getRevealElement().appendChild(this.element)}configure(e,t){let n=`none`;e.slideNumber&&!this.Reveal.isPrintView()&&(e.showSlideNumber===`all`||e.showSlideNumber===`speaker`&&this.Reveal.isSpeakerNotes())&&(n=`block`),this.element.style.display=n}update(){this.Reveal.getConfig().slideNumber&&this.element&&(this.element.innerHTML=this.getSlideNumber())}getSlideNumber(e=this.Reveal.getCurrentSlide()){let t=this.Reveal.getConfig(),n,r=`h.v`;if(typeof t.slideNumber==`function`)n=t.slideNumber(e);else{typeof t.slideNumber==`string`&&(r=t.slideNumber),!/c/.test(r)&&this.Reveal.getHorizontalSlides().length===1&&(r=`c`);let i=e&&e.dataset.visibility===`uncounted`?0:1;switch(n=[],r){case`c`:n.push(this.Reveal.getSlidePastCount(e)+i);break;case`c/t`:n.push(this.Reveal.getSlidePastCount(e)+i,`/`,this.Reveal.getTotalSlides());break;default:let t=this.Reveal.getIndices(e);n.push(t.h+i);let a=r===`h/v`?`/`:`.`;this.Reveal.isVerticalSlide(e)&&n.push(a,t.v+1)}}let i=`#`+this.Reveal.location.getHash(e);return this.formatNumber(n[0],n[1],n[2],i)}formatNumber(e,t,n,r=`#`+this.Reveal.location.getHash()){return typeof n==`number`&&!isNaN(n)?`<a href="${r}">
1
+ import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{l as t,t as n}from"./useEvent-Dc9HkKI2.js";import{t as r}from"./react-CUdNIagt.js";import{Bt as i,D as a,na as o,oa as s,rt as c,ta as l}from"./cells-B3WiM6w3.js";import{t as u}from"./compiler-runtime-BQ9S8nyo.js";import{T as d,s as f}from"./config-BxZgoFvi.js";import{g as p,t as m}from"./useEventListener-BdZUApHd.js";import{t as h}from"./utils-B4K466FK.js";import{p as g}from"./session-DXKMv4Bs.js";import{_}from"./config-DpGPGznL.js";import{t as v}from"./cn-ldLVeaqm.js";import{t as y}from"./jsx-runtime-B74pBk57.js";import{n as b}from"./fullscreen-BmzAqMKq.js";import{t as x}from"./tooltip-DR2Z2N4w.js";import{r as S,t as C}from"./button-BoklZTGL.js";import{t as w}from"./createLucideIcon-rHn2EdoM.js";import{C as T,S as E,_ as D,f as O,g as k,m as A,ot as j,v as M}from"./panels-14vO4F3h.js";import{a as N}from"./useNumberFormatter-C4-_TnkF.js";import{c as ee,i as P,l as F,n as te,t as ne}from"./RunButton-adYpTAaW.js";import{r as re}from"./useTheme-DcnXlv0_.js";import{r as ie}from"./useDebounce-DMbg9X18.js";import{Ea as ae,Oa as oe,ai as se,gn as ce,hn as le,ji as ue,mn as de,v as fe}from"./index-D0aUt523.js";import{n as pe,t as me}from"./code-visibility-DEaFLO3A.js";/* empty css */var he=w(`sticky-note`,[[`path`,{d:`M21 9a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 15 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2z`,key:`1dfntj`}],[`path`,{d:`M15 3v5a1 1 0 0 0 1 1h5`,key:`6s6qgf`}]]),I=e(r(),1),ge=u(),L=(e,t)=>{for(let n in t)e[n]=t[n];return e},R=(e,t)=>Array.from(e.querySelectorAll(t)),_e=(e,t,n)=>{n?e.classList.add(t):e.classList.remove(t)},ve=e=>{if(typeof e==`string`){if(e===`null`)return null;if(e===`true`)return!0;if(e===`false`)return!1;if(e.match(/^-?[\d\.]+$/))return parseFloat(e)}return e},ye=(e,t)=>{e.style.transform=t},z=(e,t)=>{let n=e.matches||e.matchesSelector||e.msMatchesSelector;return!!(n&&n.call(e,t))},B=(e,t)=>{if(e&&typeof e.closest==`function`)return e.closest(t);for(;e;){if(z(e,t))return e;e=e.parentElement}return null},be=e=>{e||=document.documentElement;let t=e.requestFullscreen||e.webkitRequestFullscreen||e.webkitRequestFullScreen||e.mozRequestFullScreen||e.msRequestFullscreen;t&&t.apply(e)},xe=(e,t,n,r=``)=>{let i=e.querySelectorAll(`.`+n);for(let t=0;t<i.length;t++){let n=i[t];if(n.parentNode===e)return n}let a=document.createElement(t);return a.className=n,a.innerHTML=r,e.appendChild(a),a},Se=e=>{let t=document.createElement(`style`);return e&&e.length>0&&t.appendChild(document.createTextNode(e)),document.head.appendChild(t),t},Ce=()=>{let e={};location.search.replace(/[A-Z0-9]+?=([\w\.%-]*)/gi,t=>{let n=t.split(`=`).shift(),r=t.split(`=`).pop();return n&&r!==void 0&&(e[n]=r),t});for(let t in e){let n=e[t];e[t]=ve(unescape(n))}return e.dependencies!==void 0&&delete e.dependencies,e},we=(e,t=0)=>{if(e){let n,r=e.style.height;return e.style.height=`0px`,e.parentElement&&(e.parentElement.style.height=`auto`),n=t-(e.parentElement?.offsetHeight||0),e.style.height=r+`px`,e.parentElement&&e.parentElement.style.removeProperty(`height`),n}return t},V={mp4:`video/mp4`,m4a:`video/mp4`,ogv:`video/ogg`,mpeg:`video/mpeg`,webm:`video/webm`},H=(e=``)=>{let t=e.split(`.`).pop();return t?V[t]:void 0},Te=(e=``)=>encodeURI(e).replace(/%5B/g,`[`).replace(/%5D/g,`]`).replace(/[!'()*]/g,e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`),U=navigator.userAgent,Ee=/(iphone|ipod|ipad|android)/gi.test(U)||navigator.platform===`MacIntel`&&navigator.maxTouchPoints>1;/chrome/i.test(U)&&/edge/i.test(U);var De=/android/gi.test(U),Oe=function(e){if(e){var t=function(e){return[].slice.call(e)},n=0,r=1,i=2,a=3,o=[],s=null,c=`requestAnimationFrame`in e?function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{sync:!1};e.cancelAnimationFrame(s);var n=function(){return u(o.filter((function(e){return e.dirty&&e.active})))};if(t.sync)return n();s=e.requestAnimationFrame(n)}:function(){},l=function(e){return function(t){o.forEach((function(t){return t.dirty=e})),c(t)}},u=function(e){e.filter((function(e){return!e.styleComputed})).forEach((function(e){e.styleComputed=m(e)})),e.filter(h).forEach(g);var t=e.filter(p);t.forEach(f),t.forEach((function(e){g(e),d(e)})),t.forEach(_)},d=function(e){return e.dirty=n},f=function(e){e.availableWidth=e.element.parentNode.clientWidth,e.currentWidth=e.element.scrollWidth,e.previousFontSize=e.currentFontSize,e.currentFontSize=Math.min(Math.max(e.minSize,e.availableWidth/e.currentWidth*e.previousFontSize),e.maxSize),e.whiteSpace=e.multiLine&&e.currentFontSize===e.minSize?`normal`:`nowrap`},p=function(e){return e.dirty!==i||e.dirty===i&&e.element.parentNode.clientWidth!==e.availableWidth},m=function(t){var n=e.getComputedStyle(t.element,null);return t.currentFontSize=parseFloat(n.getPropertyValue(`font-size`)),t.display=n.getPropertyValue(`display`),t.whiteSpace=n.getPropertyValue(`white-space`),!0},h=function(e){var t=!1;return!e.preStyleTestCompleted&&(/inline-/.test(e.display)||(t=!0,e.display=`inline-block`),e.whiteSpace!==`nowrap`&&(t=!0,e.whiteSpace=`nowrap`),e.preStyleTestCompleted=!0,t)},g=function(e){e.element.style.whiteSpace=e.whiteSpace,e.element.style.display=e.display,e.element.style.fontSize=e.currentFontSize+`px`},_=function(e){e.element.dispatchEvent(new CustomEvent(`fit`,{detail:{oldValue:e.previousFontSize,newValue:e.currentFontSize,scaleFactor:e.currentFontSize/e.previousFontSize}}))},v=function(e,t){return function(n){e.dirty=t,e.active&&c(n)}},y=function(e){return function(){o=o.filter((function(t){return t.element!==e.element})),e.observeMutations&&e.observer.disconnect(),e.element.style.whiteSpace=e.originalStyle.whiteSpace,e.element.style.display=e.originalStyle.display,e.element.style.fontSize=e.originalStyle.fontSize}},b=function(e){return function(){e.active||(e.active=!0,c())}},x=function(e){return function(){return e.active=!1}},S=function(e){e.observeMutations&&(e.observer=new MutationObserver(v(e,r)),e.observer.observe(e.element,e.observeMutations))},C={minSize:16,maxSize:512,multiLine:!0,observeMutations:`MutationObserver`in e&&{subtree:!0,childList:!0,characterData:!0}},w=null,T=function(){e.clearTimeout(w),w=e.setTimeout(l(i),O.observeWindowDelay)},E=[`resize`,`orientationchange`];return Object.defineProperty(O,"observeWindow",{set:function(t){var n=`${t?`add`:`remove`}EventListener`;E.forEach((function(t){e[n](t,T)}))}}),O.observeWindow=!0,O.observeWindowDelay=100,O.fitAll=l(a),O}function D(e,t){var n=Object.assign({},C,t),r=e.map((function(e){var t=Object.assign({},n,{element:e,active:!0});return function(e){e.originalStyle={whiteSpace:e.element.style.whiteSpace,display:e.element.style.display,fontSize:e.element.style.fontSize},S(e),e.newbie=!0,e.dirty=!0,o.push(e)}(t),{element:e,fit:v(t,a),unfreeze:b(t),freeze:x(t),unsubscribe:y(t)}}));return c(),r}function O(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return typeof e==`string`?D(t(document.querySelectorAll(e)),n):D([e],n)[0]}}(typeof window>`u`?null:window);function W(e){"@babel/helpers - typeof";return W=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},W(e)}function ke(e,t){if(W(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(W(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function Ae(e){var t=ke(e,`string`);return W(t)==`symbol`?t:t+``}function je(e,t,n){return(t=Ae(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Me=class{constructor(e){je(this,`allowedToPlayAudio`,null),this.Reveal=e,this.startEmbeddedMedia=this.startEmbeddedMedia.bind(this),this.startEmbeddedIframe=this.startEmbeddedIframe.bind(this),this.preventIframeAutoFocus=this.preventIframeAutoFocus.bind(this),this.ensureMobileMediaPlaying=this.ensureMobileMediaPlaying.bind(this),this.failedAudioPlaybackTargets=new Set,this.failedVideoPlaybackTargets=new Set,this.failedMutedVideoPlaybackTargets=new Set,this.renderMediaPlayButton()}renderMediaPlayButton(){this.mediaPlayButton=document.createElement(`button`),this.mediaPlayButton.className=`r-overlay-button r-media-play-button`,this.mediaPlayButton.addEventListener(`click`,()=>{this.resetTemporarilyMutedMedia(),new Set([...this.failedAudioPlaybackTargets,...this.failedVideoPlaybackTargets,...this.failedMutedVideoPlaybackTargets]).forEach(e=>{this.startEmbeddedMedia({target:e})}),this.clearMediaPlaybackErrors()})}shouldPreload(e){if(this.Reveal.isScrollView())return!0;let t=this.Reveal.getConfig().preloadIframes;return typeof t!=`boolean`&&(t=e.hasAttribute(`data-preload`)),t}load(e,t={}){let n=this.Reveal.getConfig().display;if(n.includes(`!important`)){let t=n.replace(/\s*!important\s*$/,``).trim();e.style.setProperty(`display`,t,`important`)}else e.style.display=n;R(e,`img[data-src], video[data-src], audio[data-src], iframe[data-src]`).forEach(e=>{let t=e.tagName===`IFRAME`;(!t||this.shouldPreload(e))&&(e.setAttribute(`src`,e.getAttribute(`data-src`)),e.setAttribute(`data-lazy-loaded`,``),e.removeAttribute(`data-src`),t&&e.addEventListener(`load`,this.preventIframeAutoFocus))}),R(e,`video, audio`).forEach(e=>{let t=0;R(e,`source[data-src]`).forEach(e=>{e.setAttribute(`src`,e.getAttribute(`data-src`)),e.removeAttribute(`data-src`),e.setAttribute(`data-lazy-loaded`,``),t+=1}),Ee&&e.tagName===`VIDEO`&&e.setAttribute(`playsinline`,``),t>0&&e.load()});let r=e.slideBackgroundElement;if(r){r.style.display=`block`;let n=e.slideBackgroundContentElement,i=e.getAttribute(`data-background-iframe`);if(r.hasAttribute(`data-loaded`)===!1){r.setAttribute(`data-loaded`,`true`);let a=e.getAttribute(`data-background-image`),o=e.getAttribute(`data-background-video`),s=e.hasAttribute(`data-background-video-loop`),c=e.hasAttribute(`data-background-video-muted`);if(a)/^data:/.test(a.trim())?n.style.backgroundImage=`url(${a.trim()})`:n.style.backgroundImage=a.split(`,`).map(e=>`url(${Te(decodeURI(e.trim()))})`).join(`,`);else if(o){let e=document.createElement(`video`);s&&e.setAttribute(`loop`,``),(c||this.Reveal.isSpeakerNotes())&&(e.muted=!0),Ee&&e.setAttribute(`playsinline`,``),o.split(`,`).forEach(t=>{let n=document.createElement(`source`);n.setAttribute(`src`,t);let r=H(t);r&&n.setAttribute(`type`,r),e.appendChild(n)}),n.appendChild(e)}else if(i&&t.excludeIframes!==!0){let e=document.createElement(`iframe`);e.setAttribute(`allowfullscreen`,``),e.setAttribute(`mozallowfullscreen`,``),e.setAttribute(`webkitallowfullscreen`,``),e.setAttribute(`allow`,`autoplay`),e.setAttribute(`data-src`,i),e.style.width=`100%`,e.style.height=`100%`,e.style.maxHeight=`100%`,e.style.maxWidth=`100%`,n.appendChild(e)}}let a=n.querySelector(`iframe[data-src]`);a&&this.shouldPreload(r)&&!/autoplay=(1|true|yes)/gi.test(i)&&a.getAttribute(`src`)!==i&&a.setAttribute(`src`,i)}this.layout(e)}layout(e){Array.from(e.querySelectorAll(`.r-fit-text`)).forEach(e=>{Oe(e,{minSize:24,maxSize:this.Reveal.getConfig().height*.8,observeMutations:!1,observeWindow:!1})})}unload(e){e.style.display=`none`;let t=this.Reveal.getSlideBackground(e);t&&(t.style.display=`none`,R(t,`iframe[src]`).forEach(e=>{e.removeAttribute(`src`)})),R(e,`video[data-lazy-loaded][src], audio[data-lazy-loaded][src], iframe[data-lazy-loaded][src]`).forEach(e=>{e.setAttribute(`data-src`,e.getAttribute(`src`)),e.removeAttribute(`src`)}),R(e,`video[data-lazy-loaded] source[src], audio source[src]`).forEach(e=>{e.setAttribute(`data-src`,e.getAttribute(`src`)),e.removeAttribute(`src`)})}formatEmbeddedContent(){let e=(e,t,n)=>{R(this.Reveal.getSlidesElement(),`iframe[`+e+`*="`+t+`"]`).forEach(t=>{let r=t.getAttribute(e);r&&r.indexOf(n)===-1&&t.setAttribute(e,r+(/\?/.test(r)?`&`:`?`)+n)})};e(`src`,`youtube.com/embed/`,`enablejsapi=1`),e(`data-src`,`youtube.com/embed/`,`enablejsapi=1`),e(`src`,`player.vimeo.com/`,`api=1`),e(`data-src`,`player.vimeo.com/`,`api=1`)}startEmbeddedContent(e){if(e){let t=this.Reveal.isSpeakerNotes();R(e,`img[src$=".gif"]`).forEach(e=>{e.setAttribute(`src`,e.getAttribute(`src`))}),R(e,`video, audio`).forEach(e=>{if(B(e,`.fragment`)&&!B(e,`.fragment.visible`))return;let n=this.Reveal.getConfig().autoPlayMedia;if(typeof n!=`boolean`&&(n=e.hasAttribute(`data-autoplay`)||!!B(e,`.slide-background`)),n&&typeof e.play==`function`){if(t&&!e.muted)return;e.readyState>1?this.startEmbeddedMedia({target:e}):Ee?(e.addEventListener(`canplay`,this.ensureMobileMediaPlaying),this.playMediaElement(e)):(e.removeEventListener(`loadeddata`,this.startEmbeddedMedia),e.addEventListener(`loadeddata`,this.startEmbeddedMedia))}}),t||(R(e,`iframe[src]`).forEach(e=>{B(e,`.fragment`)&&!B(e,`.fragment.visible`)||this.startEmbeddedIframe({target:e})}),R(e,`iframe[data-src]`).forEach(e=>{B(e,`.fragment`)&&!B(e,`.fragment.visible`)||e.getAttribute(`src`)!==e.getAttribute(`data-src`)&&(e.removeEventListener(`load`,this.startEmbeddedIframe),e.addEventListener(`load`,this.startEmbeddedIframe),e.setAttribute(`src`,e.getAttribute(`data-src`)))}))}}ensureMobileMediaPlaying(e){let t=e.target;typeof t.getVideoPlaybackQuality==`function`&&setTimeout(()=>{let e=t.paused===!1,n=t.getVideoPlaybackQuality().totalVideoFrames;e&&n===0&&(t.load(),t.play())},1e3)}startEmbeddedMedia(e){let t=!!B(e.target,`html`),n=!!B(e.target,`.present`);t&&n&&(e.target.paused||e.target.ended)&&(e.target.currentTime=0,this.playMediaElement(e.target)),e.target.removeEventListener(`loadeddata`,this.startEmbeddedMedia)}playMediaElement(e){let t=e.play();t&&typeof t.catch==`function`&&t.then(()=>{e.muted||(this.allowedToPlayAudio=!0)}).catch(t=>{if(t.name===`NotAllowedError`){if(this.allowedToPlayAudio=!1,e.tagName===`VIDEO`){this.onVideoPlaybackNotAllowed(e);let t=!!B(e,`html`),n=!!B(e,`.present`),r=e.muted;t&&n&&!r&&(e.setAttribute(`data-muted-by-reveal`,`true`),e.muted=!0,e.play().catch(()=>{this.onMutedVideoPlaybackNotAllowed(e)}))}else e.tagName===`AUDIO`&&this.onAudioPlaybackNotAllowed(e)}})}startEmbeddedIframe(e){let t=e.target;if(this.preventIframeAutoFocus(e),t&&t.contentWindow){let n=!!B(e.target,`html`),r=!!B(e.target,`.present`);if(n&&r){let e=this.Reveal.getConfig().autoPlayMedia;typeof e!=`boolean`&&(e=t.hasAttribute(`data-autoplay`)||!!B(t,`.slide-background`)),/youtube\.com\/embed\//.test(t.getAttribute(`src`))&&e?t.contentWindow.postMessage(`{"event":"command","func":"playVideo","args":""}`,`*`):/player\.vimeo\.com\//.test(t.getAttribute(`src`))&&e?t.contentWindow.postMessage(`{"method":"play"}`,`*`):t.contentWindow.postMessage(`slide:start`,`*`)}}}stopEmbeddedContent(e,t={}){t=L({unloadIframes:!0},t),e&&e.parentNode&&(R(e,`video, audio`).forEach(e=>{!e.hasAttribute(`data-ignore`)&&typeof e.pause==`function`&&(e.setAttribute(`data-paused-by-reveal`,``),e.pause(),Ee&&e.removeEventListener(`canplay`,this.ensureMobileMediaPlaying))}),R(e,`iframe`).forEach(e=>{e.contentWindow&&e.contentWindow.postMessage(`slide:stop`,`*`),e.removeEventListener(`load`,this.preventIframeAutoFocus),e.removeEventListener(`load`,this.startEmbeddedIframe)}),R(e,`iframe[src*="youtube.com/embed/"]`).forEach(e=>{!e.hasAttribute(`data-ignore`)&&e.contentWindow&&typeof e.contentWindow.postMessage==`function`&&e.contentWindow.postMessage(`{"event":"command","func":"pauseVideo","args":""}`,`*`)}),R(e,`iframe[src*="player.vimeo.com/"]`).forEach(e=>{!e.hasAttribute(`data-ignore`)&&e.contentWindow&&typeof e.contentWindow.postMessage==`function`&&e.contentWindow.postMessage(`{"method":"pause"}`,`*`)}),t.unloadIframes===!0&&R(e,`iframe[data-src]`).forEach(e=>{e.setAttribute(`src`,`about:blank`),e.removeAttribute(`src`)}))}isAllowedToPlayAudio(){return this.allowedToPlayAudio}showPlayOrUnmuteButton(){let e=this.failedAudioPlaybackTargets.size,t=this.failedVideoPlaybackTargets.size,n=this.failedMutedVideoPlaybackTargets.size,r=`Play media`;n>0?r=`Play video`:t>0?r=`Unmute video`:e>0&&(r=`Play audio`),this.mediaPlayButton.textContent=r,this.Reveal.getRevealElement().appendChild(this.mediaPlayButton)}onAudioPlaybackNotAllowed(e){this.failedAudioPlaybackTargets.add(e),this.showPlayOrUnmuteButton(e)}onVideoPlaybackNotAllowed(e){this.failedVideoPlaybackTargets.add(e),this.showPlayOrUnmuteButton()}onMutedVideoPlaybackNotAllowed(e){this.failedMutedVideoPlaybackTargets.add(e),this.showPlayOrUnmuteButton()}resetTemporarilyMutedMedia(){new Set([...this.failedAudioPlaybackTargets,...this.failedVideoPlaybackTargets,...this.failedMutedVideoPlaybackTargets]).forEach(e=>{e.hasAttribute(`data-muted-by-reveal`)&&(e.muted=!1,e.removeAttribute(`data-muted-by-reveal`))})}clearMediaPlaybackErrors(){this.resetTemporarilyMutedMedia(),this.failedAudioPlaybackTargets.clear(),this.failedVideoPlaybackTargets.clear(),this.failedMutedVideoPlaybackTargets.clear(),this.mediaPlayButton&&this.mediaPlayButton.parentNode&&this.mediaPlayButton.remove()}preventIframeAutoFocus(e){let t=e.target;if(t&&this.Reveal.getConfig().preventIframeAutoFocus){let e=0,n=()=>{document.activeElement===t?document.activeElement.blur():e<1e3&&(e+=100,setTimeout(n,100))};setTimeout(n,100)}}afterSlideChanged(){this.clearMediaPlaybackErrors()}},Ne=`.slides section`,Pe=`.slides>section`,Fe=`.slides>section.present>section`,Ie=`.backgrounds>.slide-background`,Le=/registerPlugin|registerKeyboardShortcut|addKeyBinding|addEventListener|showPreview|previewIframe/,Re=class{constructor(e){this.Reveal=e}render(){this.element=document.createElement(`div`),this.element.className=`slide-number`,this.Reveal.getRevealElement().appendChild(this.element)}configure(e,t){let n=`none`;e.slideNumber&&!this.Reveal.isPrintView()&&(e.showSlideNumber===`all`||e.showSlideNumber===`speaker`&&this.Reveal.isSpeakerNotes())&&(n=`block`),this.element.style.display=n}update(){this.Reveal.getConfig().slideNumber&&this.element&&(this.element.innerHTML=this.getSlideNumber())}getSlideNumber(e=this.Reveal.getCurrentSlide()){let t=this.Reveal.getConfig(),n,r=`h.v`;if(typeof t.slideNumber==`function`)n=t.slideNumber(e);else{typeof t.slideNumber==`string`&&(r=t.slideNumber),!/c/.test(r)&&this.Reveal.getHorizontalSlides().length===1&&(r=`c`);let i=e&&e.dataset.visibility===`uncounted`?0:1;switch(n=[],r){case`c`:n.push(this.Reveal.getSlidePastCount(e)+i);break;case`c/t`:n.push(this.Reveal.getSlidePastCount(e)+i,`/`,this.Reveal.getTotalSlides());break;default:let t=this.Reveal.getIndices(e);n.push(t.h+i);let a=r===`h/v`?`/`:`.`;this.Reveal.isVerticalSlide(e)&&n.push(a,t.v+1)}}let i=`#`+this.Reveal.location.getHash(e);return this.formatNumber(n[0],n[1],n[2],i)}formatNumber(e,t,n,r=`#`+this.Reveal.location.getHash()){return typeof n==`number`&&!isNaN(n)?`<a href="${r}">
2
2
  <span class="slide-number-a">${e}</span>
3
3
  <span class="slide-number-delimiter">${t}</span>
4
4
  <span class="slide-number-b">${n}</span>
@@ -1 +1 @@
1
- import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{c as t,f as n,l as r}from"./useEvent-Dc9HkKI2.js";import{t as i}from"./react-CUdNIagt.js";import{D as a,La as o,g as s,oo as c,x as l}from"./cells-B3WiM6w3.js";import{t as u}from"./compiler-runtime-BQ9S8nyo.js";import{C as d}from"./config-BxZgoFvi.js";import{r as f}from"./utils-B4K466FK.js";import{t as p}from"./session-DXKMv4Bs.js";import{T as m,_ as h,l as g,p as _}from"./config-DpGPGznL.js";import{t as v}from"./cn-ldLVeaqm.js";import{t as y}from"./jsx-runtime-B74pBk57.js";import{a as b,c as x,i as S,l as C,n as w,s as T,t as E}from"./alert-dialog-CeE3i3Qa.js";import{n as D,t as O}from"./button-BoklZTGL.js";import{n as k}from"./paths-CzfpItSz.js";import{a as A,c as j,et as ee,it as M,n as N,o as P,q as F,s as I,st as L,t as R}from"./panels-Bso8csB-.js";import{t as z}from"./copy-RyCOE8jo.js";import{Gt as te,Ut as ne,Wt as re,Xt as ie,Zt as ae,qt as B}from"./input-BDakodZ2.js";import{n as V}from"./copy-BhJktFeI.js";import{t as H}from"./use-toast-CC89xOwH.js";import{r as U}from"./requests-yTHMxhVa.js";import{Ci as W,In as G,Ln as K,Rn as q,Ti as J,ar as oe,dn as se,ei as ce,hn as le,ja as ue,mn as de,ui as fe,zn as Y,zt as pe}from"./index-BGA2MQ61.js";import{n as X}from"./code-visibility-DrRJBvIr.js";import{n as me,t as he}from"./marimo-icons-B_1oPpIE.js";var ge=e(i(),1),Z=u(),Q=y(),_e=()=>{let e=(0,Z.c)(25),[n,r]=t(F);if(n===null)return null;let i;e[0]===n?i=e[1]:(i=async()=>{try{await navigator.clipboard.writeText(n),H({title:`Copied to clipboard`,description:`Error details have been copied to your clipboard.`})}catch{H({title:`Failed to copy`,description:`Could not copy to clipboard.`,variant:`danger`})}},e[0]=n,e[1]=i);let a=i,o;e[2]===r?o=e[3]:(o=()=>{r(null)},e[2]=r,e[3]=o);let s=o,l=ve,u;e[4]===s?u=e[5]:(u=e=>!e&&s(),e[4]=s,e[5]=u);let d;e[6]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,Q.jsxs)(x,{children:[(0,Q.jsxs)(C,{className:`flex items-center gap-2 text-destructive`,children:[(0,Q.jsx)(c,{className:`h-5 w-5`}),`Kernel Startup Failed`]}),(0,Q.jsx)(b,{children:`The kernel failed to start. This usually happens when the package manager can't install your notebook's dependencies.`})]}),e[6]=d):d=e[6];let f;e[7]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,Q.jsx)(`span`,{className:`text-sm font-medium text-muted-foreground`,children:`Error Details`}),e[7]=f):f=e[7];let p;e[8]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,Q.jsx)(z,{className:`h-3 w-3`}),e[8]=p):p=e[8];let m;e[9]===a?m=e[10]:(m=(0,Q.jsxs)(`div`,{className:`flex items-center justify-between mb-2`,children:[f,(0,Q.jsxs)(O,{variant:`outline`,size:`xs`,onClick:a,className:`flex items-center gap-1`,children:[p,`Copy`]})]}),e[9]=a,e[10]=m);let h;e[11]===n?h=e[12]:(h=(0,Q.jsx)(`pre`,{className:`bg-muted p-4 rounded-md text-sm font-mono overflow-auto max-h-80`,children:n}),e[11]=n,e[12]=h);let g;e[13]!==m||e[14]!==h?(g=(0,Q.jsxs)(`div`,{className:`my-4 overflow-hidden`,children:[m,h]}),e[13]=m,e[14]=h,e[15]=g):g=e[15];let _;e[16]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,Q.jsxs)(O,{variant:`outline`,onClick:l,className:`flex items-center gap-2`,children:[(0,Q.jsx)(M,{className:`h-4 w-4`}),`Return to Home`]}),e[16]=_):_=e[16];let v;e[17]===s?v=e[18]:(v=(0,Q.jsxs)(T,{children:[_,(0,Q.jsx)(w,{onClick:s,children:`Dismiss`})]}),e[17]=s,e[18]=v);let y;e[19]!==v||e[20]!==g?(y=(0,Q.jsxs)(S,{className:`max-w-2xl`,children:[d,g,v]}),e[19]=v,e[20]=g,e[21]=y):y=e[21];let D;return e[22]!==y||e[23]!==u?(D=(0,Q.jsx)(E,{open:!0,onOpenChange:u,children:y}),e[22]=y,e[23]=u,e[24]=D):D=e[24],D};function ve(){let e=document.baseURI.split(`?`)[0];window.open(e,`_self`)}var ye=e=>{let t=(0,Z.c)(2),{reason:n}=e,r;return t[0]===n?r=t[1]:(r=(0,Q.jsx)(`div`,{className:`font-mono text-center text-base text-(--red-11)`,children:(0,Q.jsx)(`p`,{children:n})}),t[0]=n,t[1]=r),r},be=e=>{let t=(0,Z.c)(7),{connection:n,className:r,children:i}=e,a;t[0]!==n.reason||t[1]!==n.state?(a=n.state===m.CLOSED&&(0,Q.jsx)(ye,{reason:n.reason}),t[0]=n.reason,t[1]=n.state,t[2]=a):a=t[2];let o;return t[3]!==i||t[4]!==r||t[5]!==a?(o=(0,Q.jsxs)(`div`,{className:r,children:[i,a]}),t[3]=i,t[4]=r,t[5]=a,t[6]=o):o=t[6],o},xe=n(e=>e(s)||!_(e(h).state)),Se=e=>{let t=(0,Z.c)(22),{appConfig:n,hideHeader:i}=e,{setCells:o}=a(),{sendComponentValues:s}=U(),c;t[0]===s?c=t[1]:(c=()=>(A.INSTANCE.start(s),Ce),t[0]=s,t[1]=c);let u;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(u=[],t[2]=u):u=t[2],(0,ge.useEffect)(c,u);let d;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(d=p(),t[3]=d):d=t[3];let f;t[4]===o?f=t[5]:(f={autoInstantiate:!0,setCells:o,sessionId:d},t[4]=o,t[5]=f);let{connection:m,reconnect:h}=N(f),g=r(l),_;if(t[6]===Symbol.for(`react.memo_cache_sentinel`)){bb0:{if(typeof window>`u`){_=null;break bb0}let e=new URL(window.location.href);if(!e.searchParams.has(`file`)){_=null;break bb0}e.searchParams.delete(`file`);let t=e.searchParams.toString();_=t?`${e.pathname}?${t}`:e.pathname}t[6]=_}else _=t[6];let y=_,b;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(b=(0,Q.jsx)(_e,{}),t[7]=b):b=t[7];let x=i?`hidden`:`sm:pt-8`,S;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(S=y&&(0,Q.jsx)(`div`,{className:`flex items-center px-6 pt-4 sm:-mt-8`,children:(0,Q.jsxs)(`a`,{href:y,"aria-label":`Back to gallery`,className:v(D({variant:`text`,size:`sm`}),`gap-2 px-0 text-muted-foreground hover:text-foreground`),children:[(0,Q.jsx)(L,{className:`size-4`,"aria-hidden":!0}),(0,Q.jsx)(`span`,{children:`Back`})]})}),t[8]=S):S=t[8];let C;t[9]!==m||t[10]!==x?(C=(0,Q.jsx)(be,{connection:m,className:x,children:S}),t[9]=m,t[10]=x,t[11]=C):C=t[11];let w;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(w=(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(ce,{className:`mx-auto`}),(0,Q.jsx)(`p`,{className:`text-center text-sm text-muted-foreground mt-2`,children:`Connecting...`})]}),t[12]=w):w=t[12];let T;t[13]===n?T=t[14]:(T=(0,Q.jsx)(j,{requires:xe,delay:2e3,fallback:w,children:(0,Q.jsx)(P,{appConfig:n,mode:`read`})}),t[13]=n,t[14]=T);let E;return t[15]!==n.width||t[16]!==m||t[17]!==g||t[18]!==h||t[19]!==T||t[20]!==C?(E=(0,Q.jsxs)(I,{connection:m,isRunning:g,width:n.width,onReconnect:h,children:[b,C,T]}),t[15]=n.width,t[16]=m,t[17]=g,t[18]=h,t[19]=T,t[20]=C,t[21]=E):E=t[21],E};function Ce(){A.INSTANCE.stop()}var we=()=>{let e=(0,Z.c)(3),t=r(o);if(!g()||!t)return null;let n;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,Q.jsxs)(`span`,{children:[`Static`,` `,(0,Q.jsx)(`a`,{href:f.githubPage,target:`_blank`,rel:`noreferrer`,className:`text-(--sky-11) font-medium underline`,children:`marimo`}),` `,`notebook - Run or edit for full interactivity`]}),e[0]=n):n=e[0];let i;return e[1]===t?i=e[2]:(i=(0,Q.jsxs)(`div`,{className:`px-4 py-2 bg-(--sky-2) border-b border-(--sky-7) text-(--sky-11) flex justify-between items-center gap-4 print:hidden text-sm`,"data-testid":`static-notebook-banner`,children:[n,(0,Q.jsx)(`span`,{className:`shrink-0`,children:(0,Q.jsx)(Te,{code:t})})]}),e[1]=t,e[2]=i),i},Te=e=>{let t=(0,Z.c)(44),{code:n}=e,r=k.basename(oe()||`notebook.py`),[i]=d(),a=i.sharing?.molab??!0,o=Ee(window.location.href,r),s=o!==r,c=ee(o),l;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,Q.jsx)(ae,{asChild:!0,children:(0,Q.jsx)(O,{"data-testid":`static-notebook-dialog-trigger`,variant:`outline`,size:`xs`,children:`Run or Edit`})}),t[0]=l):l=t[0];let u;t[1]===r?u=t[2]:(u=(0,Q.jsx)(ie,{children:r}),t[1]=r,t[2]=u);let p;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,Q.jsx)(`a`,{href:f.githubPage,target:`_blank`,rel:`noreferrer`,className:`text-(--sky-11) hover:underline font-medium`,children:`marimo`}),t[3]=p):p=t[3];let m=s?`Run it`:`Download it, then run it`,h;t[4]===m?h=t[5]:(h=(0,Q.jsxs)(`p`,{children:[`This is a static`,` `,p,` `,`notebook. `,m,` `,`locally for full interactivity.`]}),t[4]=m,t[5]=h);let g;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,Q.jsxs)(q,{"aria-label":`Package manager`,children:[(0,Q.jsx)(Y,{value:`uv`,children:`uv`}),(0,Q.jsx)(Y,{value:`pip`,children:`pip`}),(0,Q.jsx)(Y,{value:`conda`,children:`conda`})]}),t[6]=g):g=t[6];let _=`uvx marimo edit --sandbox ${c}`,v;t[7]===_?v=t[8]:(v=(0,Q.jsx)(K,{value:`uv`,children:(0,Q.jsx)($,{command:_})}),t[7]=_,t[8]=v);let y=`pip install marimo\nmarimo edit ${c}`,b;t[9]===y?b=t[10]:(b=(0,Q.jsx)(K,{value:`pip`,children:(0,Q.jsx)($,{command:y})}),t[9]=y,t[10]=b);let x=`conda install -c conda-forge marimo\nmarimo edit ${c}`,S;t[11]===x?S=t[12]:(S=(0,Q.jsx)(K,{value:`conda`,children:(0,Q.jsx)($,{command:x})}),t[11]=x,t[12]=S);let C;t[13]!==b||t[14]!==S||t[15]!==v?(C=(0,Q.jsxs)(G,{defaultValue:`uv`,children:[g,v,b,S]}),t[13]=b,t[14]=S,t[15]=v,t[16]=C):C=t[16];let w;t[17]!==n||t[18]!==a?(w=a&&(0,Q.jsx)(De,{code:n}),t[17]=n,t[18]=a,t[19]=w):w=t[19];let T;t[20]!==C||t[21]!==w||t[22]!==h?(T=(0,Q.jsx)(te,{asChild:!0,children:(0,Q.jsxs)(`div`,{className:`pt-3 text-left space-y-3`,children:[h,C,w]})}),t[20]=C,t[21]=w,t[22]=h,t[23]=T):T=t[23];let E;t[24]!==T||t[25]!==u?(E=(0,Q.jsxs)(B,{children:[u,T]}),t[24]=T,t[25]=u,t[26]=E):E=t[26];let D;t[27]===n?D=t[28]:(D=async()=>{await V(n),H({title:`Copied to clipboard`})},t[27]=n,t[28]=D);let A;t[29]===Symbol.for(`react.memo_cache_sentinel`)?(A=(0,Q.jsx)(z,{className:`w-3 h-3 mr-2`}),t[29]=A):A=t[29];let j;t[30]===D?j=t[31]:(j=(0,Q.jsxs)(O,{"data-testid":`copy-static-notebook-dialog-button`,variant:`outline`,size:`sm`,onClick:D,children:[A,`Copy code`]}),t[30]=D,t[31]=j);let M;t[32]!==n||t[33]!==r?(M=()=>{pe(new Blob([n],{type:`text/plain`}),r)},t[32]=n,t[33]=r,t[34]=M):M=t[34];let N;t[35]===Symbol.for(`react.memo_cache_sentinel`)?(N=(0,Q.jsx)(ue,{className:`w-3 h-3 mr-2`}),t[35]=N):N=t[35];let P;t[36]===M?P=t[37]:(P=(0,Q.jsxs)(O,{"data-testid":`download-static-notebook-dialog-button`,variant:`outline`,size:`sm`,onClick:M,children:[N,`Download`]}),t[36]=M,t[37]=P);let F;t[38]!==j||t[39]!==P?(F=(0,Q.jsxs)(`div`,{className:`flex gap-3 pt-2`,children:[j,P]}),t[38]=j,t[39]=P,t[40]=F):F=t[40];let I;return t[41]!==E||t[42]!==F?(I=(0,Q.jsxs)(ne,{children:[l,(0,Q.jsxs)(re,{children:[E,F]})]}),t[41]=E,t[42]=F,t[43]=I):I=t[43],I};function Ee(e,t){let n=new URL(e);if(n.protocol!==`http:`&&n.protocol!==`https:`)return t;let r=n.pathname.endsWith(`.html`)&&n.search===``,i=n.protocol===`https:`&&(n.hostname===`marimo.app`||n.hostname===`links.marimo.app`||n.hostname===`static.marimo.app`&&n.pathname.startsWith(`/static`)||n.pathname.includes(`/notebooks/nb`));return!r&&!i?t:(n.hash=``,n.href)}var $=e=>{let t=(0,Z.c)(10),{command:n}=e,r;t[0]===n?r=t[1]:(r=(0,Q.jsx)(`pre`,{className:`p-3 pr-10 font-mono text-(--sky-11) leading-relaxed whitespace-pre-wrap break-all`,children:n}),t[0]=n,t[1]=r);let i;t[2]===n?i=t[3]:(i=async()=>{await V(n),H({title:`Command copied to clipboard`})},t[2]=n,t[3]=i);let a;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,Q.jsx)(z,{className:`w-3.5 h-3.5`}),t[4]=a):a=t[4];let o;t[5]===i?o=t[6]:(o=(0,Q.jsx)(O,{"aria-label":`Copy command`,className:`absolute right-2 top-2`,variant:`ghost`,size:`icon`,onClick:i,children:a}),t[5]=i,t[6]=o);let s;return t[7]!==r||t[8]!==o?(s=(0,Q.jsxs)(`div`,{className:`relative rounded-lg border bg-(--sky-2) border-(--sky-7)`,children:[r,o]}),t[7]=r,t[8]=o,t[9]=s):s=t[9],s},De=e=>{let t=(0,Z.c)(8),{code:n}=e,r;t[0]===n?r=t[1]:(r=fe({code:n,baseUrl:`${f.molab}/new`}),t[0]=n,t[1]=r);let i=r,a;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,Q.jsx)(me,{size:12,strokeWidth:1.5,className:`mr-1.5 mt-px text-(--grass-11)`}),t[2]=a):a=t[2];let o;t[3]===i?o=t[4]:(o=(0,Q.jsx)(O,{asChild:!0,variant:`outline`,size:`xs`,className:`shrink-0`,children:(0,Q.jsxs)(`a`,{href:i,target:`_blank`,rel:`noopener noreferrer`,children:[a,`Open in molab`]})}),t[3]=i,t[4]=o);let s;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,Q.jsxs)(`p`,{className:`text-sm text-(--sky-12)`,children:[`Run this notebook in `,(0,Q.jsx)(`span`,{className:`font-semibold`,children:`molab`}),`, marimo's cloud-hosted notebook platform.`]}),t[5]=s):s=t[5];let c;return t[6]===o?c=t[7]:(c=(0,Q.jsxs)(`div`,{className:`pt-3 border-t flex gap-2 items-center`,children:[o,s]}),t[6]=o,t[7]=c),c},Oe=e=>{let t=(0,Z.c)(17),n=r(X).kind,i=n===`static`||n===`wasm`,{selectedLayout:a}=J(),o;t[0]===a?o=t[1]:(o=W({selectedLayout:a,isReading:!0,searchParams:new URLSearchParams(window.location.search)}),t[0]=a,t[1]=o);let s=i&&o===`slides`,c;t[2]===s?c=t[3]:(c=!s&&(0,Q.jsx)(we,{}),t[2]=s,t[3]=c);let l;t[4]!==s||t[5]!==e.appConfig?(l=(0,Q.jsx)(Se,{appConfig:e.appConfig,hideHeader:s}),t[4]=s,t[5]=e.appConfig,t[6]=l):l=t[6];let u;t[7]!==i||t[8]!==s?(u=i&&!s&&(0,Q.jsx)(ke,{}),t[7]=i,t[8]=s,t[9]=u):u=t[9];let d;t[10]!==c||t[11]!==l||t[12]!==u?(d=(0,Q.jsxs)(de,{children:[c,l,u]}),t[10]=c,t[11]=l,t[12]=u,t[13]=d):d=t[13];let f;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,Q.jsx)(se,{}),t[14]=f):f=t[14];let p;return t[15]===d?p=t[16]:(p=(0,Q.jsx)(R,{children:(0,Q.jsxs)(le,{direction:`horizontal`,autoSaveId:`marimo:chrome:v1:run1`,children:[d,f]})}),t[15]=d,t[16]=p),p},ke=()=>{let e=(0,Z.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,Q.jsx)(`div`,{className:`fixed bottom-0 right-0 z-50 print:hidden`,"data-testid":`watermark`,children:(0,Q.jsxs)(`a`,{href:f.githubPage,target:`_blank`,rel:`noreferrer`,className:`text-sm text-(--grass-11) font-bold tracking-wide transition-colors bg-(--grass-4) hover:bg-(--grass-5) border-t border-l border-(--grass-8) px-3 py-1 rounded-tl-md flex items-center gap-2`,children:[(0,Q.jsx)(`span`,{children:`made with marimo`}),(0,Q.jsx)(he,{className:`h-4 w-auto`})]})}),e[0]=t):t=e[0],t};export{Oe as default};
1
+ import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{c as t,f as n,l as r}from"./useEvent-Dc9HkKI2.js";import{t as i}from"./react-CUdNIagt.js";import{D as a,La as o,g as s,oo as c,x as l}from"./cells-B3WiM6w3.js";import{t as u}from"./compiler-runtime-BQ9S8nyo.js";import{C as d}from"./config-BxZgoFvi.js";import{r as f}from"./utils-B4K466FK.js";import{t as p}from"./session-DXKMv4Bs.js";import{T as m,_ as h,l as g,p as _}from"./config-DpGPGznL.js";import{t as v}from"./cn-ldLVeaqm.js";import{t as y}from"./jsx-runtime-B74pBk57.js";import{a as b,c as x,i as S,l as C,n as w,s as T,t as E}from"./alert-dialog-CeE3i3Qa.js";import{n as D,t as O}from"./button-BoklZTGL.js";import{n as k}from"./paths-CzfpItSz.js";import{a as A,c as j,et as ee,it as M,n as N,o as P,q as F,s as I,st as L,t as R}from"./panels-14vO4F3h.js";import{t as z}from"./copy-RyCOE8jo.js";import{Gt as te,Ut as ne,Wt as re,Xt as ie,Zt as ae,qt as B}from"./input-BDakodZ2.js";import{n as V}from"./copy-BhJktFeI.js";import{t as H}from"./use-toast-CC89xOwH.js";import{r as U}from"./requests-yTHMxhVa.js";import{Ci as W,In as G,Ln as K,Rn as q,Ti as J,ar as oe,dn as se,ei as ce,hn as le,ja as ue,mn as de,ui as fe,zn as Y,zt as pe}from"./index-D0aUt523.js";import{n as X}from"./code-visibility-DEaFLO3A.js";import{n as me,t as he}from"./marimo-icons-B_1oPpIE.js";var ge=e(i(),1),Z=u(),Q=y(),_e=()=>{let e=(0,Z.c)(25),[n,r]=t(F);if(n===null)return null;let i;e[0]===n?i=e[1]:(i=async()=>{try{await navigator.clipboard.writeText(n),H({title:`Copied to clipboard`,description:`Error details have been copied to your clipboard.`})}catch{H({title:`Failed to copy`,description:`Could not copy to clipboard.`,variant:`danger`})}},e[0]=n,e[1]=i);let a=i,o;e[2]===r?o=e[3]:(o=()=>{r(null)},e[2]=r,e[3]=o);let s=o,l=ve,u;e[4]===s?u=e[5]:(u=e=>!e&&s(),e[4]=s,e[5]=u);let d;e[6]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,Q.jsxs)(x,{children:[(0,Q.jsxs)(C,{className:`flex items-center gap-2 text-destructive`,children:[(0,Q.jsx)(c,{className:`h-5 w-5`}),`Kernel Startup Failed`]}),(0,Q.jsx)(b,{children:`The kernel failed to start. This usually happens when the package manager can't install your notebook's dependencies.`})]}),e[6]=d):d=e[6];let f;e[7]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,Q.jsx)(`span`,{className:`text-sm font-medium text-muted-foreground`,children:`Error Details`}),e[7]=f):f=e[7];let p;e[8]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,Q.jsx)(z,{className:`h-3 w-3`}),e[8]=p):p=e[8];let m;e[9]===a?m=e[10]:(m=(0,Q.jsxs)(`div`,{className:`flex items-center justify-between mb-2`,children:[f,(0,Q.jsxs)(O,{variant:`outline`,size:`xs`,onClick:a,className:`flex items-center gap-1`,children:[p,`Copy`]})]}),e[9]=a,e[10]=m);let h;e[11]===n?h=e[12]:(h=(0,Q.jsx)(`pre`,{className:`bg-muted p-4 rounded-md text-sm font-mono overflow-auto max-h-80`,children:n}),e[11]=n,e[12]=h);let g;e[13]!==m||e[14]!==h?(g=(0,Q.jsxs)(`div`,{className:`my-4 overflow-hidden`,children:[m,h]}),e[13]=m,e[14]=h,e[15]=g):g=e[15];let _;e[16]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,Q.jsxs)(O,{variant:`outline`,onClick:l,className:`flex items-center gap-2`,children:[(0,Q.jsx)(M,{className:`h-4 w-4`}),`Return to Home`]}),e[16]=_):_=e[16];let v;e[17]===s?v=e[18]:(v=(0,Q.jsxs)(T,{children:[_,(0,Q.jsx)(w,{onClick:s,children:`Dismiss`})]}),e[17]=s,e[18]=v);let y;e[19]!==v||e[20]!==g?(y=(0,Q.jsxs)(S,{className:`max-w-2xl`,children:[d,g,v]}),e[19]=v,e[20]=g,e[21]=y):y=e[21];let D;return e[22]!==y||e[23]!==u?(D=(0,Q.jsx)(E,{open:!0,onOpenChange:u,children:y}),e[22]=y,e[23]=u,e[24]=D):D=e[24],D};function ve(){let e=document.baseURI.split(`?`)[0];window.open(e,`_self`)}var ye=e=>{let t=(0,Z.c)(2),{reason:n}=e,r;return t[0]===n?r=t[1]:(r=(0,Q.jsx)(`div`,{className:`font-mono text-center text-base text-(--red-11)`,children:(0,Q.jsx)(`p`,{children:n})}),t[0]=n,t[1]=r),r},be=e=>{let t=(0,Z.c)(7),{connection:n,className:r,children:i}=e,a;t[0]!==n.reason||t[1]!==n.state?(a=n.state===m.CLOSED&&(0,Q.jsx)(ye,{reason:n.reason}),t[0]=n.reason,t[1]=n.state,t[2]=a):a=t[2];let o;return t[3]!==i||t[4]!==r||t[5]!==a?(o=(0,Q.jsxs)(`div`,{className:r,children:[i,a]}),t[3]=i,t[4]=r,t[5]=a,t[6]=o):o=t[6],o},xe=n(e=>e(s)||!_(e(h).state)),Se=e=>{let t=(0,Z.c)(22),{appConfig:n,hideHeader:i}=e,{setCells:o}=a(),{sendComponentValues:s}=U(),c;t[0]===s?c=t[1]:(c=()=>(A.INSTANCE.start(s),Ce),t[0]=s,t[1]=c);let u;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(u=[],t[2]=u):u=t[2],(0,ge.useEffect)(c,u);let d;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(d=p(),t[3]=d):d=t[3];let f;t[4]===o?f=t[5]:(f={autoInstantiate:!0,setCells:o,sessionId:d},t[4]=o,t[5]=f);let{connection:m,reconnect:h}=N(f),g=r(l),_;if(t[6]===Symbol.for(`react.memo_cache_sentinel`)){bb0:{if(typeof window>`u`){_=null;break bb0}let e=new URL(window.location.href);if(!e.searchParams.has(`file`)){_=null;break bb0}e.searchParams.delete(`file`);let t=e.searchParams.toString();_=t?`${e.pathname}?${t}`:e.pathname}t[6]=_}else _=t[6];let y=_,b;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(b=(0,Q.jsx)(_e,{}),t[7]=b):b=t[7];let x=i?`hidden`:`sm:pt-8`,S;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(S=y&&(0,Q.jsx)(`div`,{className:`flex items-center px-6 pt-4 sm:-mt-8`,children:(0,Q.jsxs)(`a`,{href:y,"aria-label":`Back to gallery`,className:v(D({variant:`text`,size:`sm`}),`gap-2 px-0 text-muted-foreground hover:text-foreground`),children:[(0,Q.jsx)(L,{className:`size-4`,"aria-hidden":!0}),(0,Q.jsx)(`span`,{children:`Back`})]})}),t[8]=S):S=t[8];let C;t[9]!==m||t[10]!==x?(C=(0,Q.jsx)(be,{connection:m,className:x,children:S}),t[9]=m,t[10]=x,t[11]=C):C=t[11];let w;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(w=(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(ce,{className:`mx-auto`}),(0,Q.jsx)(`p`,{className:`text-center text-sm text-muted-foreground mt-2`,children:`Connecting...`})]}),t[12]=w):w=t[12];let T;t[13]===n?T=t[14]:(T=(0,Q.jsx)(j,{requires:xe,delay:2e3,fallback:w,children:(0,Q.jsx)(P,{appConfig:n,mode:`read`})}),t[13]=n,t[14]=T);let E;return t[15]!==n.width||t[16]!==m||t[17]!==g||t[18]!==h||t[19]!==T||t[20]!==C?(E=(0,Q.jsxs)(I,{connection:m,isRunning:g,width:n.width,onReconnect:h,children:[b,C,T]}),t[15]=n.width,t[16]=m,t[17]=g,t[18]=h,t[19]=T,t[20]=C,t[21]=E):E=t[21],E};function Ce(){A.INSTANCE.stop()}var we=()=>{let e=(0,Z.c)(3),t=r(o);if(!g()||!t)return null;let n;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,Q.jsxs)(`span`,{children:[`Static`,` `,(0,Q.jsx)(`a`,{href:f.githubPage,target:`_blank`,rel:`noreferrer`,className:`text-(--sky-11) font-medium underline`,children:`marimo`}),` `,`notebook - Run or edit for full interactivity`]}),e[0]=n):n=e[0];let i;return e[1]===t?i=e[2]:(i=(0,Q.jsxs)(`div`,{className:`px-4 py-2 bg-(--sky-2) border-b border-(--sky-7) text-(--sky-11) flex justify-between items-center gap-4 print:hidden text-sm`,"data-testid":`static-notebook-banner`,children:[n,(0,Q.jsx)(`span`,{className:`shrink-0`,children:(0,Q.jsx)(Te,{code:t})})]}),e[1]=t,e[2]=i),i},Te=e=>{let t=(0,Z.c)(44),{code:n}=e,r=k.basename(oe()||`notebook.py`),[i]=d(),a=i.sharing?.molab??!0,o=Ee(window.location.href,r),s=o!==r,c=ee(o),l;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,Q.jsx)(ae,{asChild:!0,children:(0,Q.jsx)(O,{"data-testid":`static-notebook-dialog-trigger`,variant:`outline`,size:`xs`,children:`Run or Edit`})}),t[0]=l):l=t[0];let u;t[1]===r?u=t[2]:(u=(0,Q.jsx)(ie,{children:r}),t[1]=r,t[2]=u);let p;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,Q.jsx)(`a`,{href:f.githubPage,target:`_blank`,rel:`noreferrer`,className:`text-(--sky-11) hover:underline font-medium`,children:`marimo`}),t[3]=p):p=t[3];let m=s?`Run it`:`Download it, then run it`,h;t[4]===m?h=t[5]:(h=(0,Q.jsxs)(`p`,{children:[`This is a static`,` `,p,` `,`notebook. `,m,` `,`locally for full interactivity.`]}),t[4]=m,t[5]=h);let g;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,Q.jsxs)(q,{"aria-label":`Package manager`,children:[(0,Q.jsx)(Y,{value:`uv`,children:`uv`}),(0,Q.jsx)(Y,{value:`pip`,children:`pip`}),(0,Q.jsx)(Y,{value:`conda`,children:`conda`})]}),t[6]=g):g=t[6];let _=`uvx marimo edit --sandbox ${c}`,v;t[7]===_?v=t[8]:(v=(0,Q.jsx)(K,{value:`uv`,children:(0,Q.jsx)($,{command:_})}),t[7]=_,t[8]=v);let y=`pip install marimo\nmarimo edit ${c}`,b;t[9]===y?b=t[10]:(b=(0,Q.jsx)(K,{value:`pip`,children:(0,Q.jsx)($,{command:y})}),t[9]=y,t[10]=b);let x=`conda install -c conda-forge marimo\nmarimo edit ${c}`,S;t[11]===x?S=t[12]:(S=(0,Q.jsx)(K,{value:`conda`,children:(0,Q.jsx)($,{command:x})}),t[11]=x,t[12]=S);let C;t[13]!==b||t[14]!==S||t[15]!==v?(C=(0,Q.jsxs)(G,{defaultValue:`uv`,children:[g,v,b,S]}),t[13]=b,t[14]=S,t[15]=v,t[16]=C):C=t[16];let w;t[17]!==n||t[18]!==a?(w=a&&(0,Q.jsx)(De,{code:n}),t[17]=n,t[18]=a,t[19]=w):w=t[19];let T;t[20]!==C||t[21]!==w||t[22]!==h?(T=(0,Q.jsx)(te,{asChild:!0,children:(0,Q.jsxs)(`div`,{className:`pt-3 text-left space-y-3`,children:[h,C,w]})}),t[20]=C,t[21]=w,t[22]=h,t[23]=T):T=t[23];let E;t[24]!==T||t[25]!==u?(E=(0,Q.jsxs)(B,{children:[u,T]}),t[24]=T,t[25]=u,t[26]=E):E=t[26];let D;t[27]===n?D=t[28]:(D=async()=>{await V(n),H({title:`Copied to clipboard`})},t[27]=n,t[28]=D);let A;t[29]===Symbol.for(`react.memo_cache_sentinel`)?(A=(0,Q.jsx)(z,{className:`w-3 h-3 mr-2`}),t[29]=A):A=t[29];let j;t[30]===D?j=t[31]:(j=(0,Q.jsxs)(O,{"data-testid":`copy-static-notebook-dialog-button`,variant:`outline`,size:`sm`,onClick:D,children:[A,`Copy code`]}),t[30]=D,t[31]=j);let M;t[32]!==n||t[33]!==r?(M=()=>{pe(new Blob([n],{type:`text/plain`}),r)},t[32]=n,t[33]=r,t[34]=M):M=t[34];let N;t[35]===Symbol.for(`react.memo_cache_sentinel`)?(N=(0,Q.jsx)(ue,{className:`w-3 h-3 mr-2`}),t[35]=N):N=t[35];let P;t[36]===M?P=t[37]:(P=(0,Q.jsxs)(O,{"data-testid":`download-static-notebook-dialog-button`,variant:`outline`,size:`sm`,onClick:M,children:[N,`Download`]}),t[36]=M,t[37]=P);let F;t[38]!==j||t[39]!==P?(F=(0,Q.jsxs)(`div`,{className:`flex gap-3 pt-2`,children:[j,P]}),t[38]=j,t[39]=P,t[40]=F):F=t[40];let I;return t[41]!==E||t[42]!==F?(I=(0,Q.jsxs)(ne,{children:[l,(0,Q.jsxs)(re,{children:[E,F]})]}),t[41]=E,t[42]=F,t[43]=I):I=t[43],I};function Ee(e,t){let n=new URL(e);if(n.protocol!==`http:`&&n.protocol!==`https:`)return t;let r=n.pathname.endsWith(`.html`)&&n.search===``,i=n.protocol===`https:`&&(n.hostname===`marimo.app`||n.hostname===`links.marimo.app`||n.hostname===`static.marimo.app`&&n.pathname.startsWith(`/static`)||n.pathname.includes(`/notebooks/nb`));return!r&&!i?t:(n.hash=``,n.href)}var $=e=>{let t=(0,Z.c)(10),{command:n}=e,r;t[0]===n?r=t[1]:(r=(0,Q.jsx)(`pre`,{className:`p-3 pr-10 font-mono text-(--sky-11) leading-relaxed whitespace-pre-wrap break-all`,children:n}),t[0]=n,t[1]=r);let i;t[2]===n?i=t[3]:(i=async()=>{await V(n),H({title:`Command copied to clipboard`})},t[2]=n,t[3]=i);let a;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,Q.jsx)(z,{className:`w-3.5 h-3.5`}),t[4]=a):a=t[4];let o;t[5]===i?o=t[6]:(o=(0,Q.jsx)(O,{"aria-label":`Copy command`,className:`absolute right-2 top-2`,variant:`ghost`,size:`icon`,onClick:i,children:a}),t[5]=i,t[6]=o);let s;return t[7]!==r||t[8]!==o?(s=(0,Q.jsxs)(`div`,{className:`relative rounded-lg border bg-(--sky-2) border-(--sky-7)`,children:[r,o]}),t[7]=r,t[8]=o,t[9]=s):s=t[9],s},De=e=>{let t=(0,Z.c)(8),{code:n}=e,r;t[0]===n?r=t[1]:(r=fe({code:n,baseUrl:`${f.molab}/new`}),t[0]=n,t[1]=r);let i=r,a;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,Q.jsx)(me,{size:12,strokeWidth:1.5,className:`mr-1.5 mt-px text-(--grass-11)`}),t[2]=a):a=t[2];let o;t[3]===i?o=t[4]:(o=(0,Q.jsx)(O,{asChild:!0,variant:`outline`,size:`xs`,className:`shrink-0`,children:(0,Q.jsxs)(`a`,{href:i,target:`_blank`,rel:`noopener noreferrer`,children:[a,`Open in molab`]})}),t[3]=i,t[4]=o);let s;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,Q.jsxs)(`p`,{className:`text-sm text-(--sky-12)`,children:[`Run this notebook in `,(0,Q.jsx)(`span`,{className:`font-semibold`,children:`molab`}),`, marimo's cloud-hosted notebook platform.`]}),t[5]=s):s=t[5];let c;return t[6]===o?c=t[7]:(c=(0,Q.jsxs)(`div`,{className:`pt-3 border-t flex gap-2 items-center`,children:[o,s]}),t[6]=o,t[7]=c),c},Oe=e=>{let t=(0,Z.c)(17),n=r(X).kind,i=n===`static`||n===`wasm`,{selectedLayout:a}=J(),o;t[0]===a?o=t[1]:(o=W({selectedLayout:a,isReading:!0,searchParams:new URLSearchParams(window.location.search)}),t[0]=a,t[1]=o);let s=i&&o===`slides`,c;t[2]===s?c=t[3]:(c=!s&&(0,Q.jsx)(we,{}),t[2]=s,t[3]=c);let l;t[4]!==s||t[5]!==e.appConfig?(l=(0,Q.jsx)(Se,{appConfig:e.appConfig,hideHeader:s}),t[4]=s,t[5]=e.appConfig,t[6]=l):l=t[6];let u;t[7]!==i||t[8]!==s?(u=i&&!s&&(0,Q.jsx)(ke,{}),t[7]=i,t[8]=s,t[9]=u):u=t[9];let d;t[10]!==c||t[11]!==l||t[12]!==u?(d=(0,Q.jsxs)(de,{children:[c,l,u]}),t[10]=c,t[11]=l,t[12]=u,t[13]=d):d=t[13];let f;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,Q.jsx)(se,{}),t[14]=f):f=t[14];let p;return t[15]===d?p=t[16]:(p=(0,Q.jsx)(R,{children:(0,Q.jsxs)(le,{direction:`horizontal`,autoSaveId:`marimo:chrome:v1:run1`,children:[d,f]})}),t[15]=d,t[16]=p),p},ke=()=>{let e=(0,Z.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,Q.jsx)(`div`,{className:`fixed bottom-0 right-0 z-50 print:hidden`,"data-testid":`watermark`,children:(0,Q.jsxs)(`a`,{href:f.githubPage,target:`_blank`,rel:`noreferrer`,className:`text-sm text-(--grass-11) font-bold tracking-wide transition-colors bg-(--grass-4) hover:bg-(--grass-5) border-t border-l border-(--grass-8) px-3 py-1 rounded-tl-md flex items-center gap-2`,children:[(0,Q.jsx)(`span`,{children:`made with marimo`}),(0,Q.jsx)(he,{className:`h-4 w-auto`})]})}),e[0]=t):t=e[0],t};export{Oe as default};
@@ -1 +1 @@
1
- import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{c as t,f as n,l as ee,t as r,u as te}from"./useEvent-Dc9HkKI2.js";import{t as i}from"./react-CUdNIagt.js";import{D as ne,I as re,Qr as a,Rt as ie,So as o,xo as ae}from"./cells-B3WiM6w3.js";import{t as s}from"./compiler-runtime-BQ9S8nyo.js";import{C as oe}from"./config-BxZgoFvi.js";import{_ as se}from"./useEventListener-BdZUApHd.js";import{n as ce}from"./utils-B4K466FK.js";import{O as c}from"./config-DpGPGznL.js";import{t as le}from"./cn-ldLVeaqm.js";import{t as l}from"./jsx-runtime-B74pBk57.js";import{t as u}from"./tooltip-DR2Z2N4w.js";import{t as d}from"./button-BoklZTGL.js";import{t as f}from"./createLucideIcon-rHn2EdoM.js";import{h as ue}from"./panels-Bso8csB-.js";import{n as de,t as fe}from"./LazyAnyLanguageCodeMirror-D38yVMV5.js";import{c as pe}from"./RunButton-CmaVvEXE.js";import{u as me}from"./toDate-BbJ1_N2T.js";import{a as he}from"./process-output-CEKLHiTm.js";import{r as ge}from"./requests-yTHMxhVa.js";import{r as _e}from"./useTheme-DcnXlv0_.js";import{Et as ve,Mt as ye,ei as be,gn as xe,hn as Se,mn as Ce}from"./index-BGA2MQ61.js";import{n as we,r as Te}from"./panel-context-BPaQeOuV.js";import{i as Ee}from"./edit-page-DPhd7_gi.js";var De=f(`eraser`,[[`path`,{d:`M21 21H8a2 2 0 0 1-1.42-.587l-3.994-3.999a2 2 0 0 1 0-2.828l10-10a2 2 0 0 1 2.829 0l5.999 6a2 2 0 0 1 0 2.828L12.834 21`,key:`g5wo59`}],[`path`,{d:`m5.082 11.09 8.828 8.828`,key:`1wx5vj`}]]),Oe=f(`history`,[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}],[`path`,{d:`M12 7v5l4 2`,key:`1fdv2h`}]]),p=e(i(),1),ke=s(),m=15,h=c(`marimo:scratchpadHistory:v1`,[],a),Ae=n(!1),je=n(null,(e,t,n)=>{if(n=n.trim(),!n)return;let ee=e(h);t(h,[n,...ee.filter(e=>e!==n)].slice(0,m))}),g=l(),Me={hide_code:!1,disabled:!1},_=()=>{let e=(0,ke.c)(60),n=re(),[i]=oe(),{theme:a}=_e(),s=(0,p.useRef)(null),c=ie(),{createNewCell:l,updateCellCode:f}=ne(),{sendRunScratchpad:m}=ge(),_=we(),v=Te(),y=n.cellRuntime[o],b=y?.output,x=y?.status,S=y?.consoleOutputs,C=n.cellData.__scratch__?.code??``,w=te(je),[T,E]=t(Ae),D=ee(h),O;e[0]!==w||e[1]!==C||e[2]!==m?(O=()=>{m({code:C}),w(C)},e[0]=w,e[1]=C,e[2]=m,e[3]=O):O=e[3];let k=r(O),A;e[4]!==C||e[5]!==l||e[6]!==c?(A=()=>{C.trim()&&l({code:C,before:!1,cellId:c??`__end__`})},e[4]=C,e[5]=l,e[6]=c,e[7]=A):A=e[7];let j=r(A),M;e[8]!==m||e[9]!==f?(M=()=>{f({cellId:o,code:``,formattingChange:!1}),m({code:``});let e=s.current;e&&e.dispatch({changes:{from:0,to:e.state.doc.length,insert:``}})},e[8]=m,e[9]=f,e[10]=M):M=e[10];let N=r(M),P;e[11]!==E||e[12]!==f?(P=e=>{E(!1),f({cellId:o,code:e,formattingChange:!1});let t=s.current;t&&t.dispatch({changes:{from:0,to:t.state.doc.length,insert:e}})},e[11]=E,e[12]=f,e[13]=P):P=e[13];let F=r(P),[I,Ne]=(0,p.useState)(),L;e[14]!==F||e[15]!==D||e[16]!==T||e[17]!==a?(L=()=>T?(0,g.jsx)(`div`,{className:`absolute inset-0 z-100 bg-background p-3 border-none overflow-auto`,children:(0,g.jsx)(`div`,{className:`overflow-auto flex flex-col gap-3`,children:D.map((e,t)=>(0,g.jsx)(`div`,{className:`border rounded-md hover:shadow-sm cursor-pointer hover:border-input overflow-hidden`,onClick:()=>F(e),children:(0,g.jsx)(p.Suspense,{children:(0,g.jsx)(fe,{language:`python`,theme:a,basicSetup:{highlightActiveLine:!1,highlightActiveLineGutter:!1},value:e.trim(),editable:!1,readOnly:!0})})},t))})}):null,e[14]=F,e[15]=D,e[16]=T,e[17]=a,e[18]=L):L=e[18];let R=L,z;e[19]!==N||e[20]!==j||e[21]!==k||e[22]!==D.length||e[23]!==T||e[24]!==E||e[25]!==x?(z=()=>(0,g.jsxs)(`div`,{className:`flex items-center shrink-0 border-b`,children:[(0,g.jsx)(u,{content:ve(`cell.run`),children:(0,g.jsx)(d,{"data-testid":`scratchpad-run-button`,onClick:k,disabled:T,variant:`text`,size:`xs`,children:(0,g.jsx)(he,{color:`var(--grass-11)`,size:16})})}),(0,g.jsx)(u,{content:`Clear code and outputs`,children:(0,g.jsx)(d,{disabled:T,size:`xs`,variant:`text`,onClick:N,children:(0,g.jsx)(De,{size:16})})}),(0,g.jsx)(Ee,{children:(0,g.jsx)(u,{content:`Insert code`,children:(0,g.jsx)(d,{disabled:T,size:`xs`,variant:`text`,onClick:j,children:(0,g.jsx)(de,{size:16})})})}),(x===`running`||x===`queued`)&&(0,g.jsx)(be,{className:`inline`,size:`small`}),(0,g.jsx)(`div`,{className:`flex-1`}),(0,g.jsx)(u,{content:`Toggle history`,children:(0,g.jsx)(d,{size:`xs`,variant:`text`,className:le(T&&`bg-(--sky-3) rounded-none`),onClick:()=>E(!T),disabled:D.length===0,children:(0,g.jsx)(Oe,{size:16})})}),(0,g.jsx)(u,{content:(0,g.jsx)(`span`,{className:`block max-w-prose`,children:`Use this scratchpad to experiment with code without restrictions on variable names. Variables defined here aren't saved to notebook memory, and the code is not saved in the notebook file.`}),children:(0,g.jsx)(d,{size:`xs`,variant:`text`,children:(0,g.jsx)(me,{size:16})})})]}),e[19]=N,e[20]=j,e[21]=k,e[22]=D.length,e[23]=T,e[24]=E,e[25]=x,e[26]=z):z=e[26];let B=z,Pe=_===`vertical`,V;e[27]===Symbol.for(`react.memo_cache_sentinel`)?(V=ae.create(o),e[27]=V):V=e[27];let H;e[28]===B?H=e[29]:(H=B(),e[28]=B,e[29]=H);let U;e[30]===Symbol.for(`react.memo_cache_sentinel`)?(U=e=>{s.current=e},e[30]=U):U=e[30];let W;e[31]!==C||e[32]!==k||e[33]!==I||e[34]!==a||e[35]!==i?(W=(0,g.jsx)(`div`,{className:`flex-1 overflow-auto`,children:(0,g.jsx)(pe,{theme:a,showPlaceholder:!1,id:o,code:C,config:Me,status:`idle`,serializedEditorState:null,runCell:k,userConfig:i,editorViewRef:s,setEditorView:U,hidden:!1,showHiddenCode:se.NOOP,languageAdapter:I,setLanguageAdapter:Ne})}),e[31]=C,e[32]=k,e[33]=I,e[34]=a,e[35]=i,e[36]=W):W=e[36];let G;e[37]===R?G=e[38]:(G=R(),e[37]=R,e[38]=G);let K;e[39]!==G||e[40]!==H||e[41]!==W?(K=(0,g.jsx)(Ce,{defaultSize:40,minSize:20,maxSize:70,children:(0,g.jsxs)(`div`,{className:`h-full flex flex-col overflow-hidden relative`,children:[H,W,G]})}),e[39]=G,e[40]=H,e[41]=W,e[42]=K):K=e[42];let q=Pe?`h-1`:`w-1`,J;e[43]===q?J=e[44]:(J=le(`bg-border hover:bg-primary/50 transition-colors`,q),e[43]=q,e[44]=J);let Y;e[45]===J?Y=e[46]:(Y=(0,g.jsx)(xe,{className:J}),e[45]=J,e[46]=Y);let X;e[47]===b?X=e[48]:(X=(0,g.jsx)(`div`,{className:`flex-1 overflow-auto`,children:(0,g.jsx)(ye,{allowExpand:!1,output:b,className:ce.outputArea,cellId:o,stale:!1,loading:!1})}),e[47]=b,e[48]=X);let Z;e[49]===S?Z=e[50]:(Z=(0,g.jsx)(`div`,{className:`overflow-auto shrink-0 max-h-[50%]`,children:(0,g.jsx)(ue,{consoleOutputs:S,className:`overflow-auto`,stale:!1,interrupted:!1,cellName:`_`,onSubmitDebugger:se.NOOP,cellId:o,debuggerActive:!1})}),e[49]=S,e[50]=Z);let Q;e[51]!==X||e[52]!==Z?(Q=(0,g.jsx)(Ce,{defaultSize:60,minSize:20,children:(0,g.jsxs)(`div`,{className:`h-full flex flex-col divide-y overflow-hidden`,children:[X,Z]})}),e[51]=X,e[52]=Z,e[53]=Q):Q=e[53];let $;return e[54]!==_||e[55]!==v||e[56]!==K||e[57]!==Y||e[58]!==Q?($=(0,g.jsx)(`div`,{className:`flex flex-col h-full overflow-hidden`,id:V,children:(0,g.jsxs)(Se,{direction:_,className:`h-full`,children:[K,Y,Q]},v)}),e[54]=_,e[55]=v,e[56]=K,e[57]=Y,e[58]=Q,e[59]=$):$=e[59],$},v=()=>{let e=(0,ke.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,g.jsx)(_,{}),e[0]=t):t=e[0],t};export{v as default};
1
+ import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{c as t,f as n,l as ee,t as r,u as te}from"./useEvent-Dc9HkKI2.js";import{t as i}from"./react-CUdNIagt.js";import{D as ne,I as re,Qr as a,Rt as ie,So as o,xo as ae}from"./cells-B3WiM6w3.js";import{t as s}from"./compiler-runtime-BQ9S8nyo.js";import{C as oe}from"./config-BxZgoFvi.js";import{_ as se}from"./useEventListener-BdZUApHd.js";import{n as ce}from"./utils-B4K466FK.js";import{O as c}from"./config-DpGPGznL.js";import{t as le}from"./cn-ldLVeaqm.js";import{t as l}from"./jsx-runtime-B74pBk57.js";import{t as u}from"./tooltip-DR2Z2N4w.js";import{t as d}from"./button-BoklZTGL.js";import{t as f}from"./createLucideIcon-rHn2EdoM.js";import{h as ue}from"./panels-14vO4F3h.js";import{n as de,t as fe}from"./LazyAnyLanguageCodeMirror-BqNgl9tZ.js";import{c as pe}from"./RunButton-adYpTAaW.js";import{u as me}from"./toDate-BbJ1_N2T.js";import{a as he}from"./process-output-ZDYA_DfN.js";import{r as ge}from"./requests-yTHMxhVa.js";import{r as _e}from"./useTheme-DcnXlv0_.js";import{Et as ve,Mt as ye,ei as be,gn as xe,hn as Se,mn as Ce}from"./index-D0aUt523.js";import{n as we,r as Te}from"./panel-context-BPaQeOuV.js";import{i as Ee}from"./edit-page-5BoxMdRg.js";var De=f(`eraser`,[[`path`,{d:`M21 21H8a2 2 0 0 1-1.42-.587l-3.994-3.999a2 2 0 0 1 0-2.828l10-10a2 2 0 0 1 2.829 0l5.999 6a2 2 0 0 1 0 2.828L12.834 21`,key:`g5wo59`}],[`path`,{d:`m5.082 11.09 8.828 8.828`,key:`1wx5vj`}]]),Oe=f(`history`,[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}],[`path`,{d:`M12 7v5l4 2`,key:`1fdv2h`}]]),p=e(i(),1),ke=s(),m=15,h=c(`marimo:scratchpadHistory:v1`,[],a),Ae=n(!1),je=n(null,(e,t,n)=>{if(n=n.trim(),!n)return;let ee=e(h);t(h,[n,...ee.filter(e=>e!==n)].slice(0,m))}),g=l(),Me={hide_code:!1,disabled:!1},_=()=>{let e=(0,ke.c)(60),n=re(),[i]=oe(),{theme:a}=_e(),s=(0,p.useRef)(null),c=ie(),{createNewCell:l,updateCellCode:f}=ne(),{sendRunScratchpad:m}=ge(),_=we(),v=Te(),y=n.cellRuntime[o],b=y?.output,x=y?.status,S=y?.consoleOutputs,C=n.cellData.__scratch__?.code??``,w=te(je),[T,E]=t(Ae),D=ee(h),O;e[0]!==w||e[1]!==C||e[2]!==m?(O=()=>{m({code:C}),w(C)},e[0]=w,e[1]=C,e[2]=m,e[3]=O):O=e[3];let k=r(O),A;e[4]!==C||e[5]!==l||e[6]!==c?(A=()=>{C.trim()&&l({code:C,before:!1,cellId:c??`__end__`})},e[4]=C,e[5]=l,e[6]=c,e[7]=A):A=e[7];let j=r(A),M;e[8]!==m||e[9]!==f?(M=()=>{f({cellId:o,code:``,formattingChange:!1}),m({code:``});let e=s.current;e&&e.dispatch({changes:{from:0,to:e.state.doc.length,insert:``}})},e[8]=m,e[9]=f,e[10]=M):M=e[10];let N=r(M),P;e[11]!==E||e[12]!==f?(P=e=>{E(!1),f({cellId:o,code:e,formattingChange:!1});let t=s.current;t&&t.dispatch({changes:{from:0,to:t.state.doc.length,insert:e}})},e[11]=E,e[12]=f,e[13]=P):P=e[13];let F=r(P),[I,Ne]=(0,p.useState)(),L;e[14]!==F||e[15]!==D||e[16]!==T||e[17]!==a?(L=()=>T?(0,g.jsx)(`div`,{className:`absolute inset-0 z-100 bg-background p-3 border-none overflow-auto`,children:(0,g.jsx)(`div`,{className:`overflow-auto flex flex-col gap-3`,children:D.map((e,t)=>(0,g.jsx)(`div`,{className:`border rounded-md hover:shadow-sm cursor-pointer hover:border-input overflow-hidden`,onClick:()=>F(e),children:(0,g.jsx)(p.Suspense,{children:(0,g.jsx)(fe,{language:`python`,theme:a,basicSetup:{highlightActiveLine:!1,highlightActiveLineGutter:!1},value:e.trim(),editable:!1,readOnly:!0})})},t))})}):null,e[14]=F,e[15]=D,e[16]=T,e[17]=a,e[18]=L):L=e[18];let R=L,z;e[19]!==N||e[20]!==j||e[21]!==k||e[22]!==D.length||e[23]!==T||e[24]!==E||e[25]!==x?(z=()=>(0,g.jsxs)(`div`,{className:`flex items-center shrink-0 border-b`,children:[(0,g.jsx)(u,{content:ve(`cell.run`),children:(0,g.jsx)(d,{"data-testid":`scratchpad-run-button`,onClick:k,disabled:T,variant:`text`,size:`xs`,children:(0,g.jsx)(he,{color:`var(--grass-11)`,size:16})})}),(0,g.jsx)(u,{content:`Clear code and outputs`,children:(0,g.jsx)(d,{disabled:T,size:`xs`,variant:`text`,onClick:N,children:(0,g.jsx)(De,{size:16})})}),(0,g.jsx)(Ee,{children:(0,g.jsx)(u,{content:`Insert code`,children:(0,g.jsx)(d,{disabled:T,size:`xs`,variant:`text`,onClick:j,children:(0,g.jsx)(de,{size:16})})})}),(x===`running`||x===`queued`)&&(0,g.jsx)(be,{className:`inline`,size:`small`}),(0,g.jsx)(`div`,{className:`flex-1`}),(0,g.jsx)(u,{content:`Toggle history`,children:(0,g.jsx)(d,{size:`xs`,variant:`text`,className:le(T&&`bg-(--sky-3) rounded-none`),onClick:()=>E(!T),disabled:D.length===0,children:(0,g.jsx)(Oe,{size:16})})}),(0,g.jsx)(u,{content:(0,g.jsx)(`span`,{className:`block max-w-prose`,children:`Use this scratchpad to experiment with code without restrictions on variable names. Variables defined here aren't saved to notebook memory, and the code is not saved in the notebook file.`}),children:(0,g.jsx)(d,{size:`xs`,variant:`text`,children:(0,g.jsx)(me,{size:16})})})]}),e[19]=N,e[20]=j,e[21]=k,e[22]=D.length,e[23]=T,e[24]=E,e[25]=x,e[26]=z):z=e[26];let B=z,Pe=_===`vertical`,V;e[27]===Symbol.for(`react.memo_cache_sentinel`)?(V=ae.create(o),e[27]=V):V=e[27];let H;e[28]===B?H=e[29]:(H=B(),e[28]=B,e[29]=H);let U;e[30]===Symbol.for(`react.memo_cache_sentinel`)?(U=e=>{s.current=e},e[30]=U):U=e[30];let W;e[31]!==C||e[32]!==k||e[33]!==I||e[34]!==a||e[35]!==i?(W=(0,g.jsx)(`div`,{className:`flex-1 overflow-auto`,children:(0,g.jsx)(pe,{theme:a,showPlaceholder:!1,id:o,code:C,config:Me,status:`idle`,serializedEditorState:null,runCell:k,userConfig:i,editorViewRef:s,setEditorView:U,hidden:!1,showHiddenCode:se.NOOP,languageAdapter:I,setLanguageAdapter:Ne})}),e[31]=C,e[32]=k,e[33]=I,e[34]=a,e[35]=i,e[36]=W):W=e[36];let G;e[37]===R?G=e[38]:(G=R(),e[37]=R,e[38]=G);let K;e[39]!==G||e[40]!==H||e[41]!==W?(K=(0,g.jsx)(Ce,{defaultSize:40,minSize:20,maxSize:70,children:(0,g.jsxs)(`div`,{className:`h-full flex flex-col overflow-hidden relative`,children:[H,W,G]})}),e[39]=G,e[40]=H,e[41]=W,e[42]=K):K=e[42];let q=Pe?`h-1`:`w-1`,J;e[43]===q?J=e[44]:(J=le(`bg-border hover:bg-primary/50 transition-colors`,q),e[43]=q,e[44]=J);let Y;e[45]===J?Y=e[46]:(Y=(0,g.jsx)(xe,{className:J}),e[45]=J,e[46]=Y);let X;e[47]===b?X=e[48]:(X=(0,g.jsx)(`div`,{className:`flex-1 overflow-auto`,children:(0,g.jsx)(ye,{allowExpand:!1,output:b,className:ce.outputArea,cellId:o,stale:!1,loading:!1})}),e[47]=b,e[48]=X);let Z;e[49]===S?Z=e[50]:(Z=(0,g.jsx)(`div`,{className:`overflow-auto shrink-0 max-h-[50%]`,children:(0,g.jsx)(ue,{consoleOutputs:S,className:`overflow-auto`,stale:!1,interrupted:!1,cellName:`_`,onSubmitDebugger:se.NOOP,cellId:o,debuggerActive:!1})}),e[49]=S,e[50]=Z);let Q;e[51]!==X||e[52]!==Z?(Q=(0,g.jsx)(Ce,{defaultSize:60,minSize:20,children:(0,g.jsxs)(`div`,{className:`h-full flex flex-col divide-y overflow-hidden`,children:[X,Z]})}),e[51]=X,e[52]=Z,e[53]=Q):Q=e[53];let $;return e[54]!==_||e[55]!==v||e[56]!==K||e[57]!==Y||e[58]!==Q?($=(0,g.jsx)(`div`,{className:`flex flex-col h-full overflow-hidden`,id:V,children:(0,g.jsxs)(Se,{direction:_,className:`h-full`,children:[K,Y,Q]},v)}),e[54]=_,e[55]=v,e[56]=K,e[57]=Y,e[58]=Q,e[59]=$):$=e[59],$},v=()=>{let e=(0,ke.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,g.jsx)(_,{}),e[0]=t):t=e[0],t};export{v as default};
@@ -1 +1 @@
1
- import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{t}from"./react-CUdNIagt.js";import{t as n}from"./compiler-runtime-BQ9S8nyo.js";import{t as r}from"./cn-ldLVeaqm.js";import{t as i}from"./jsx-runtime-B74pBk57.js";import{t as a}from"./check-Wea4hZ6R.js";import{t as o}from"./copy-RyCOE8jo.js";import{T as s,b as c,n as l,t as u,v as d}from"./write-secret-modal-BiG2tahJ.js";import{t as f}from"./plus-gbN72xHe.js";import{n as p}from"./copy-BhJktFeI.js";import{t as m}from"./use-toast-CC89xOwH.js";import{t as h}from"./badge-DFf033uX.js";import{n as g}from"./useAsyncData-DucTwMkf.js";import{Hn as _,Sn as v,_n as y,bn as b,ei as x,gn as S,hn as C,mn as w,vn as T,xn as E,yn as D}from"./index-BGA2MQ61.js";import{t as O}from"./empty-state-CzxjZqGW.js";var k=n(),A=e(t(),1),j=i(),M=()=>{let e=(0,k.c)(27),{openModal:t,closeModal:n}=c(),r;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=[],e[0]=r):r=e[0];let{data:i,isPending:a,error:o,refetch:l}=g(P,r);if(a){let t;return e[1]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,j.jsx)(x,{size:`medium`,centered:!0}),e[1]=t):t=e[1],t}if(o){let t;return e[2]===o?t=e[3]:(t=(0,j.jsx)(_,{error:o}),e[2]=o,e[3]=t),t}let d;e[4]===i?d=e[5]:(d=i.filter(F).map(I),e[4]=i,e[5]=d);let p=d;if(i.length===0){let t;return e[6]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,j.jsx)(O,{title:`No environment variables`,description:`No environment variables are available in this notebook.`,icon:(0,j.jsx)(s,{})}),e[6]=t):t=e[6],t}let m;e[7]!==n||e[8]!==t||e[9]!==p||e[10]!==l?(m=()=>t((0,j.jsx)(u,{providerNames:p,onSuccess:()=>{l(),n()},onClose:n})),e[7]=n,e[8]=t,e[9]=p,e[10]=l,e[11]=m):m=e[11];let h;e[12]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,j.jsx)(f,{className:`h-4 w-4`}),e[12]=h):h=e[12];let D;e[13]===m?D=e[14]:(D=(0,j.jsx)(`div`,{className:`flex justify-start h-8 border-b`,children:(0,j.jsx)(`button`,{type:`button`,className:`border-r px-2 m-0 h-full hover:bg-accent hover:text-accent-foreground`,onClick:m,children:h})}),e[13]=m,e[14]=D);let A;e[15]===Symbol.for(`react.memo_cache_sentinel`)?(A=(0,j.jsx)(E,{children:(0,j.jsxs)(v,{children:[(0,j.jsx)(b,{children:`Environment Variable`}),(0,j.jsx)(b,{children:`Source`}),(0,j.jsx)(b,{})]})}),e[15]=A):A=e[15];let M;e[16]===i?M=e[17]:(M=i.map(L),e[16]=i,e[17]=M);let N;e[18]===M?N=e[19]:(N=(0,j.jsxs)(y,{className:`overflow-auto flex-1 mb-16`,children:[A,(0,j.jsx)(T,{children:M})]}),e[18]=M,e[19]=N);let R;e[20]!==D||e[21]!==N?(R=(0,j.jsx)(w,{defaultSize:50,minSize:30,maxSize:80,children:(0,j.jsxs)(`div`,{className:`flex flex-col h-full`,children:[D,N]})}),e[20]=D,e[21]=N,e[22]=R):R=e[22];let z;e[23]===Symbol.for(`react.memo_cache_sentinel`)?(z=(0,j.jsx)(S,{className:`w-1 bg-border hover:bg-primary/50 transition-colors`}),e[23]=z):z=e[23];let B;e[24]===Symbol.for(`react.memo_cache_sentinel`)?(B=(0,j.jsx)(w,{defaultSize:50,children:(0,j.jsx)(`div`,{})}),e[24]=B):B=e[24];let V;return e[25]===R?V=e[26]:(V=(0,j.jsxs)(C,{direction:`horizontal`,className:`h-full`,children:[R,z,B]}),e[25]=R,e[26]=V),V},N=e=>{let t=(0,k.c)(9),{className:n,ariaLabel:r,onCopy:i}=e,[s,c]=A.useState(!1),l;t[0]===i?l=t[1]:(l=()=>{i(),c(!0),setTimeout(()=>c(!1),1e3)},t[0]=i,t[1]=l);let u=l,d;t[2]===s?d=t[3]:(d=s?(0,j.jsx)(a,{className:`w-3 h-3 text-green-700 rounded`}):(0,j.jsx)(o,{className:`w-3 h-3 hover:bg-muted rounded`}),t[2]=s,t[3]=d);let f;return t[4]!==r||t[5]!==n||t[6]!==u||t[7]!==d?(f=(0,j.jsx)(`button`,{type:`button`,className:n,onClick:u,"aria-label":r,children:d}),t[4]=r,t[5]=n,t[6]=u,t[7]=d,t[8]=f):f=t[8],f};async function P(){let e=await d.request({});return l(e.secrets)}function F(e){return e.provider!==`env`}function I(e){return e.name}function L(e){return e.keys.map(t=>(0,j.jsxs)(v,{className:`group`,children:[(0,j.jsx)(D,{children:t}),(0,j.jsx)(D,{children:e.provider!==`env`&&(0,j.jsx)(h,{variant:`outline`,className:`select-none`,children:e.name})}),(0,j.jsx)(D,{children:(0,j.jsx)(N,{ariaLabel:`Copy ${t}`,onCopy:async()=>{await p(`os.environ["${t}"]`),m({title:`Copied to clipboard`,description:`os.environ["${t}"] has been copied to your clipboard.`})},className:r(`float-right px-2 h-full text-xs text-muted-foreground hover:text-foreground`,`invisible group-hover:visible`)})})]},`${e.name}-${t}`))}export{M as default};
1
+ import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{t}from"./react-CUdNIagt.js";import{t as n}from"./compiler-runtime-BQ9S8nyo.js";import{t as r}from"./cn-ldLVeaqm.js";import{t as i}from"./jsx-runtime-B74pBk57.js";import{t as a}from"./check-Wea4hZ6R.js";import{t as o}from"./copy-RyCOE8jo.js";import{T as s,b as c,n as l,t as u,v as d}from"./write-secret-modal-BiG2tahJ.js";import{t as f}from"./plus-gbN72xHe.js";import{n as p}from"./copy-BhJktFeI.js";import{t as m}from"./use-toast-CC89xOwH.js";import{t as h}from"./badge-DFf033uX.js";import{n as g}from"./useAsyncData-DucTwMkf.js";import{Hn as _,Sn as v,_n as y,bn as b,ei as x,gn as S,hn as C,mn as w,vn as T,xn as E,yn as D}from"./index-D0aUt523.js";import{t as O}from"./empty-state-CzxjZqGW.js";var k=n(),A=e(t(),1),j=i(),M=()=>{let e=(0,k.c)(27),{openModal:t,closeModal:n}=c(),r;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=[],e[0]=r):r=e[0];let{data:i,isPending:a,error:o,refetch:l}=g(P,r);if(a){let t;return e[1]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,j.jsx)(x,{size:`medium`,centered:!0}),e[1]=t):t=e[1],t}if(o){let t;return e[2]===o?t=e[3]:(t=(0,j.jsx)(_,{error:o}),e[2]=o,e[3]=t),t}let d;e[4]===i?d=e[5]:(d=i.filter(F).map(I),e[4]=i,e[5]=d);let p=d;if(i.length===0){let t;return e[6]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,j.jsx)(O,{title:`No environment variables`,description:`No environment variables are available in this notebook.`,icon:(0,j.jsx)(s,{})}),e[6]=t):t=e[6],t}let m;e[7]!==n||e[8]!==t||e[9]!==p||e[10]!==l?(m=()=>t((0,j.jsx)(u,{providerNames:p,onSuccess:()=>{l(),n()},onClose:n})),e[7]=n,e[8]=t,e[9]=p,e[10]=l,e[11]=m):m=e[11];let h;e[12]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,j.jsx)(f,{className:`h-4 w-4`}),e[12]=h):h=e[12];let D;e[13]===m?D=e[14]:(D=(0,j.jsx)(`div`,{className:`flex justify-start h-8 border-b`,children:(0,j.jsx)(`button`,{type:`button`,className:`border-r px-2 m-0 h-full hover:bg-accent hover:text-accent-foreground`,onClick:m,children:h})}),e[13]=m,e[14]=D);let A;e[15]===Symbol.for(`react.memo_cache_sentinel`)?(A=(0,j.jsx)(E,{children:(0,j.jsxs)(v,{children:[(0,j.jsx)(b,{children:`Environment Variable`}),(0,j.jsx)(b,{children:`Source`}),(0,j.jsx)(b,{})]})}),e[15]=A):A=e[15];let M;e[16]===i?M=e[17]:(M=i.map(L),e[16]=i,e[17]=M);let N;e[18]===M?N=e[19]:(N=(0,j.jsxs)(y,{className:`overflow-auto flex-1 mb-16`,children:[A,(0,j.jsx)(T,{children:M})]}),e[18]=M,e[19]=N);let R;e[20]!==D||e[21]!==N?(R=(0,j.jsx)(w,{defaultSize:50,minSize:30,maxSize:80,children:(0,j.jsxs)(`div`,{className:`flex flex-col h-full`,children:[D,N]})}),e[20]=D,e[21]=N,e[22]=R):R=e[22];let z;e[23]===Symbol.for(`react.memo_cache_sentinel`)?(z=(0,j.jsx)(S,{className:`w-1 bg-border hover:bg-primary/50 transition-colors`}),e[23]=z):z=e[23];let B;e[24]===Symbol.for(`react.memo_cache_sentinel`)?(B=(0,j.jsx)(w,{defaultSize:50,children:(0,j.jsx)(`div`,{})}),e[24]=B):B=e[24];let V;return e[25]===R?V=e[26]:(V=(0,j.jsxs)(C,{direction:`horizontal`,className:`h-full`,children:[R,z,B]}),e[25]=R,e[26]=V),V},N=e=>{let t=(0,k.c)(9),{className:n,ariaLabel:r,onCopy:i}=e,[s,c]=A.useState(!1),l;t[0]===i?l=t[1]:(l=()=>{i(),c(!0),setTimeout(()=>c(!1),1e3)},t[0]=i,t[1]=l);let u=l,d;t[2]===s?d=t[3]:(d=s?(0,j.jsx)(a,{className:`w-3 h-3 text-green-700 rounded`}):(0,j.jsx)(o,{className:`w-3 h-3 hover:bg-muted rounded`}),t[2]=s,t[3]=d);let f;return t[4]!==r||t[5]!==n||t[6]!==u||t[7]!==d?(f=(0,j.jsx)(`button`,{type:`button`,className:n,onClick:u,"aria-label":r,children:d}),t[4]=r,t[5]=n,t[6]=u,t[7]=d,t[8]=f):f=t[8],f};async function P(){let e=await d.request({});return l(e.secrets)}function F(e){return e.provider!==`env`}function I(e){return e.name}function L(e){return e.keys.map(t=>(0,j.jsxs)(v,{className:`group`,children:[(0,j.jsx)(D,{children:t}),(0,j.jsx)(D,{children:e.provider!==`env`&&(0,j.jsx)(h,{variant:`outline`,className:`select-none`,children:e.name})}),(0,j.jsx)(D,{children:(0,j.jsx)(N,{ariaLabel:`Copy ${t}`,onCopy:async()=>{await p(`os.environ["${t}"]`),m({title:`Copied to clipboard`,description:`os.environ["${t}"] has been copied to your clipboard.`})},className:r(`float-right px-2 h-full text-xs text-muted-foreground hover:text-foreground`,`invisible group-hover:visible`)})})]},`${e.name}-${t}`))}export{M as default};
@@ -1,4 +1,4 @@
1
- import{g as e,p as t}from"./chunk-75Z2AOVW-DA_lihEi.js";import{u as n}from"./src-BpnPuKEN.js";import{n as r}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import{t as i}from"./src-Cyu5G-Tr.js";import{A as a,F as o,G as s,H as c,K as l,O as u,U as d,a as f,b as p,c as m,i as h,r as g,s as _,v,w as y,x as b,y as x,z as S}from"./chunk-DU6HZSFF-J-califE.js";import{t as C}from"./dist-CeoU7cfW.js";import{a as w,i as T}from"./mermaid-D9cuWIJ3.js";import{a as E,c as D,i as O,n as k,r as A,s as j}from"./chunk-F27PBJKO-BzJrz4xx.js";import{t as M}from"./chunk-2Q5K7J3B-C1jixKkw.js";var N=C(),P=(function(){var e=r(function(e,t,n,r){for(n||={},r=e.length;r--;n[e[r]]=t);return n},`o`),t=[1,2],n=[1,3],i=[1,4],a=[2,4],o=[1,9],s=[1,11],c=[1,12],l=[1,14],u=[1,15],d=[1,17],f=[1,18],p=[1,19],m=[1,25],h=[1,26],g=[1,27],_=[1,28],v=[1,29],y=[1,30],b=[1,31],x=[1,32],S=[1,33],C=[1,34],w=[1,35],T=[1,36],E=[1,37],D=[1,38],O=[1,39],k=[1,40],A=[1,42],j=[1,43],M=[1,44],N=[1,45],P=[1,46],F=[1,47],I=[1,4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,48,49,50,51,53,54,56,61,62,63,64,73],ee=[1,74],L=[1,80],R=[1,81],te=[1,82],ne=[1,83],z=[1,84],B=[1,85],V=[1,86],re=[1,87],H=[1,88],U=[1,89],W=[1,90],ie=[1,91],ae=[1,92],oe=[1,93],G=[1,94],se=[1,95],K=[1,96],ce=[1,97],le=[1,98],ue=[1,99],de=[1,100],fe=[1,101],pe=[1,102],me=[1,103],he=[1,104],ge=[1,105],_e=[2,78],ve=[4,5,17,51,53,54],ye=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,51,53,54,56,61,62,63,64,73],be=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,50,51,53,54,56,61,62,63,64,73],xe=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,49,51,53,54,56,61,62,63,64,73],Se=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,48,51,53,54,56,61,62,63,64,73],Ce=[5,52],q=[70,71,72,73],J=[1,151],we={trace:r(function(){},`trace`),yy:{},symbols_:{error:2,start:3,SPACE:4,NEWLINE:5,SD:6,document:7,line:8,statement:9,INVALID:10,box_section:11,box_line:12,participant_statement:13,create:14,box:15,restOfLine:16,end:17,signal:18,autonumber:19,NUM:20,off:21,activate:22,actor:23,deactivate:24,note_statement:25,links_statement:26,link_statement:27,properties_statement:28,details_statement:29,title:30,legacy_title:31,acc_title:32,acc_title_value:33,acc_descr:34,acc_descr_value:35,acc_descr_multiline_value:36,loop:37,rect:38,opt:39,alt:40,else_sections:41,par:42,par_sections:43,par_over:44,critical:45,option_sections:46,break:47,option:48,and:49,else:50,participant:51,AS:52,participant_actor:53,destroy:54,actor_with_config:55,note:56,placement:57,text2:58,over:59,actor_pair:60,links:61,link:62,properties:63,details:64,spaceList:65,",":66,left_of:67,right_of:68,signaltype:69,"+":70,"-":71,"()":72,ACTOR:73,config_object:74,CONFIG_START:75,CONFIG_CONTENT:76,CONFIG_END:77,SOLID_OPEN_ARROW:78,DOTTED_OPEN_ARROW:79,SOLID_ARROW:80,SOLID_ARROW_TOP:81,SOLID_ARROW_BOTTOM:82,STICK_ARROW_TOP:83,STICK_ARROW_BOTTOM:84,SOLID_ARROW_TOP_DOTTED:85,SOLID_ARROW_BOTTOM_DOTTED:86,STICK_ARROW_TOP_DOTTED:87,STICK_ARROW_BOTTOM_DOTTED:88,SOLID_ARROW_TOP_REVERSE:89,SOLID_ARROW_BOTTOM_REVERSE:90,STICK_ARROW_TOP_REVERSE:91,STICK_ARROW_BOTTOM_REVERSE:92,SOLID_ARROW_TOP_REVERSE_DOTTED:93,SOLID_ARROW_BOTTOM_REVERSE_DOTTED:94,STICK_ARROW_TOP_REVERSE_DOTTED:95,STICK_ARROW_BOTTOM_REVERSE_DOTTED:96,BIDIRECTIONAL_SOLID_ARROW:97,DOTTED_ARROW:98,BIDIRECTIONAL_DOTTED_ARROW:99,SOLID_CROSS:100,DOTTED_CROSS:101,SOLID_POINT:102,DOTTED_POINT:103,TXT:104,$accept:0,$end:1},terminals_:{2:`error`,4:`SPACE`,5:`NEWLINE`,6:`SD`,10:`INVALID`,14:`create`,15:`box`,16:`restOfLine`,17:`end`,19:`autonumber`,20:`NUM`,21:`off`,22:`activate`,24:`deactivate`,30:`title`,31:`legacy_title`,32:`acc_title`,33:`acc_title_value`,34:`acc_descr`,35:`acc_descr_value`,36:`acc_descr_multiline_value`,37:`loop`,38:`rect`,39:`opt`,40:`alt`,42:`par`,44:`par_over`,45:`critical`,47:`break`,48:`option`,49:`and`,50:`else`,51:`participant`,52:`AS`,53:`participant_actor`,54:`destroy`,56:`note`,59:`over`,61:`links`,62:`link`,63:`properties`,64:`details`,66:`,`,67:`left_of`,68:`right_of`,70:`+`,71:`-`,72:`()`,73:`ACTOR`,75:`CONFIG_START`,76:`CONFIG_CONTENT`,77:`CONFIG_END`,78:`SOLID_OPEN_ARROW`,79:`DOTTED_OPEN_ARROW`,80:`SOLID_ARROW`,81:`SOLID_ARROW_TOP`,82:`SOLID_ARROW_BOTTOM`,83:`STICK_ARROW_TOP`,84:`STICK_ARROW_BOTTOM`,85:`SOLID_ARROW_TOP_DOTTED`,86:`SOLID_ARROW_BOTTOM_DOTTED`,87:`STICK_ARROW_TOP_DOTTED`,88:`STICK_ARROW_BOTTOM_DOTTED`,89:`SOLID_ARROW_TOP_REVERSE`,90:`SOLID_ARROW_BOTTOM_REVERSE`,91:`STICK_ARROW_TOP_REVERSE`,92:`STICK_ARROW_BOTTOM_REVERSE`,93:`SOLID_ARROW_TOP_REVERSE_DOTTED`,94:`SOLID_ARROW_BOTTOM_REVERSE_DOTTED`,95:`STICK_ARROW_TOP_REVERSE_DOTTED`,96:`STICK_ARROW_BOTTOM_REVERSE_DOTTED`,97:`BIDIRECTIONAL_SOLID_ARROW`,98:`DOTTED_ARROW`,99:`BIDIRECTIONAL_DOTTED_ARROW`,100:`SOLID_CROSS`,101:`DOTTED_CROSS`,102:`SOLID_POINT`,103:`DOTTED_POINT`,104:`TXT`},productions_:[0,[3,2],[3,2],[3,2],[7,0],[7,2],[8,2],[8,1],[8,1],[8,1],[11,0],[11,2],[12,2],[12,1],[12,1],[9,1],[9,2],[9,4],[9,2],[9,4],[9,3],[9,3],[9,2],[9,3],[9,3],[9,2],[9,2],[9,2],[9,2],[9,2],[9,1],[9,1],[9,2],[9,2],[9,1],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[46,1],[46,4],[43,1],[43,4],[41,1],[41,4],[13,5],[13,3],[13,5],[13,3],[13,3],[13,5],[13,3],[13,5],[13,3],[25,4],[25,4],[26,3],[27,3],[28,3],[29,3],[65,2],[65,1],[60,3],[60,1],[57,1],[57,1],[18,5],[18,5],[18,5],[18,5],[18,6],[18,4],[55,2],[74,3],[23,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[58,1]],performAction:r(function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 3:return r.apply(a[s]),a[s];case 4:case 10:this.$=[];break;case 5:case 11:a[s-1].push(a[s]),this.$=a[s-1];break;case 6:case 7:case 12:case 13:this.$=a[s];break;case 8:case 9:case 14:this.$=[];break;case 16:a[s].type=`createParticipant`,this.$=a[s];break;case 17:a[s-1].unshift({type:`boxStart`,boxData:r.parseBoxData(a[s-2])}),a[s-1].push({type:`boxEnd`,boxText:a[s-2]}),this.$=a[s-1];break;case 19:this.$={type:`sequenceIndex`,sequenceIndex:Number(a[s-2]),sequenceIndexStep:Number(a[s-1]),sequenceVisible:!0,signalType:r.LINETYPE.AUTONUMBER};break;case 20:this.$={type:`sequenceIndex`,sequenceIndex:Number(a[s-1]),sequenceIndexStep:1,sequenceVisible:!0,signalType:r.LINETYPE.AUTONUMBER};break;case 21:this.$={type:`sequenceIndex`,sequenceVisible:!1,signalType:r.LINETYPE.AUTONUMBER};break;case 22:this.$={type:`sequenceIndex`,sequenceVisible:!0,signalType:r.LINETYPE.AUTONUMBER};break;case 23:this.$={type:`activeStart`,signalType:r.LINETYPE.ACTIVE_START,actor:a[s-1].actor};break;case 24:this.$={type:`activeEnd`,signalType:r.LINETYPE.ACTIVE_END,actor:a[s-1].actor};break;case 30:r.setDiagramTitle(a[s].substring(6)),this.$=a[s].substring(6);break;case 31:r.setDiagramTitle(a[s].substring(7)),this.$=a[s].substring(7);break;case 32:this.$=a[s].trim(),r.setAccTitle(this.$);break;case 33:case 34:this.$=a[s].trim(),r.setAccDescription(this.$);break;case 35:a[s-1].unshift({type:`loopStart`,loopText:r.parseMessage(a[s-2]),signalType:r.LINETYPE.LOOP_START}),a[s-1].push({type:`loopEnd`,loopText:a[s-2],signalType:r.LINETYPE.LOOP_END}),this.$=a[s-1];break;case 36:a[s-1].unshift({type:`rectStart`,color:r.parseMessage(a[s-2]),signalType:r.LINETYPE.RECT_START}),a[s-1].push({type:`rectEnd`,color:r.parseMessage(a[s-2]),signalType:r.LINETYPE.RECT_END}),this.$=a[s-1];break;case 37:a[s-1].unshift({type:`optStart`,optText:r.parseMessage(a[s-2]),signalType:r.LINETYPE.OPT_START}),a[s-1].push({type:`optEnd`,optText:r.parseMessage(a[s-2]),signalType:r.LINETYPE.OPT_END}),this.$=a[s-1];break;case 38:a[s-1].unshift({type:`altStart`,altText:r.parseMessage(a[s-2]),signalType:r.LINETYPE.ALT_START}),a[s-1].push({type:`altEnd`,signalType:r.LINETYPE.ALT_END}),this.$=a[s-1];break;case 39:a[s-1].unshift({type:`parStart`,parText:r.parseMessage(a[s-2]),signalType:r.LINETYPE.PAR_START}),a[s-1].push({type:`parEnd`,signalType:r.LINETYPE.PAR_END}),this.$=a[s-1];break;case 40:a[s-1].unshift({type:`parStart`,parText:r.parseMessage(a[s-2]),signalType:r.LINETYPE.PAR_OVER_START}),a[s-1].push({type:`parEnd`,signalType:r.LINETYPE.PAR_END}),this.$=a[s-1];break;case 41:a[s-1].unshift({type:`criticalStart`,criticalText:r.parseMessage(a[s-2]),signalType:r.LINETYPE.CRITICAL_START}),a[s-1].push({type:`criticalEnd`,signalType:r.LINETYPE.CRITICAL_END}),this.$=a[s-1];break;case 42:a[s-1].unshift({type:`breakStart`,breakText:r.parseMessage(a[s-2]),signalType:r.LINETYPE.BREAK_START}),a[s-1].push({type:`breakEnd`,optText:r.parseMessage(a[s-2]),signalType:r.LINETYPE.BREAK_END}),this.$=a[s-1];break;case 44:this.$=a[s-3].concat([{type:`option`,optionText:r.parseMessage(a[s-1]),signalType:r.LINETYPE.CRITICAL_OPTION},a[s]]);break;case 46:this.$=a[s-3].concat([{type:`and`,parText:r.parseMessage(a[s-1]),signalType:r.LINETYPE.PAR_AND},a[s]]);break;case 48:this.$=a[s-3].concat([{type:`else`,altText:r.parseMessage(a[s-1]),signalType:r.LINETYPE.ALT_ELSE},a[s]]);break;case 49:a[s-3].draw=`participant`,a[s-3].type=`addParticipant`,a[s-3].description=r.parseMessage(a[s-1]),this.$=a[s-3];break;case 50:a[s-1].draw=`participant`,a[s-1].type=`addParticipant`,this.$=a[s-1];break;case 51:a[s-3].draw=`actor`,a[s-3].type=`addParticipant`,a[s-3].description=r.parseMessage(a[s-1]),this.$=a[s-3];break;case 52:case 57:a[s-1].draw=`actor`,a[s-1].type=`addParticipant`,this.$=a[s-1];break;case 53:a[s-1].type=`destroyParticipant`,this.$=a[s-1];break;case 54:a[s-3].draw=`participant`,a[s-3].type=`addParticipant`,a[s-3].description=r.parseMessage(a[s-1]),this.$=a[s-3];break;case 55:a[s-1].draw=`participant`,a[s-1].type=`addParticipant`,this.$=a[s-1];break;case 56:a[s-3].draw=`actor`,a[s-3].type=`addParticipant`,a[s-3].description=r.parseMessage(a[s-1]),this.$=a[s-3];break;case 58:this.$=[a[s-1],{type:`addNote`,placement:a[s-2],actor:a[s-1].actor,text:a[s]}];break;case 59:a[s-2]=[].concat(a[s-1],a[s-1]).slice(0,2),a[s-2][0]=a[s-2][0].actor,a[s-2][1]=a[s-2][1].actor,this.$=[a[s-1],{type:`addNote`,placement:r.PLACEMENT.OVER,actor:a[s-2].slice(0,2),text:a[s]}];break;case 60:this.$=[a[s-1],{type:`addLinks`,actor:a[s-1].actor,text:a[s]}];break;case 61:this.$=[a[s-1],{type:`addALink`,actor:a[s-1].actor,text:a[s]}];break;case 62:this.$=[a[s-1],{type:`addProperties`,actor:a[s-1].actor,text:a[s]}];break;case 63:this.$=[a[s-1],{type:`addDetails`,actor:a[s-1].actor,text:a[s]}];break;case 66:this.$=[a[s-2],a[s]];break;case 67:this.$=a[s];break;case 68:this.$=r.PLACEMENT.LEFTOF;break;case 69:this.$=r.PLACEMENT.RIGHTOF;break;case 70:this.$=[a[s-4],a[s-1],{type:`addMessage`,from:a[s-4].actor,to:a[s-1].actor,signalType:a[s-3],msg:a[s],activate:!0},{type:`activeStart`,signalType:r.LINETYPE.ACTIVE_START,actor:a[s-1].actor}];break;case 71:this.$=[a[s-4],a[s-1],{type:`addMessage`,from:a[s-4].actor,to:a[s-1].actor,signalType:a[s-3],msg:a[s]},{type:`activeEnd`,signalType:r.LINETYPE.ACTIVE_END,actor:a[s-4].actor}];break;case 72:this.$=[a[s-4],a[s-1],{type:`addMessage`,from:a[s-4].actor,to:a[s-1].actor,signalType:a[s-3],msg:a[s],activate:!0,centralConnection:r.LINETYPE.CENTRAL_CONNECTION},{type:`centralConnection`,signalType:r.LINETYPE.CENTRAL_CONNECTION,actor:a[s-1].actor}];break;case 73:this.$=[a[s-4],a[s-1],{type:`addMessage`,from:a[s-4].actor,to:a[s-1].actor,signalType:a[s-2],msg:a[s],activate:!1,centralConnection:r.LINETYPE.CENTRAL_CONNECTION_REVERSE},{type:`centralConnectionReverse`,signalType:r.LINETYPE.CENTRAL_CONNECTION_REVERSE,actor:a[s-4].actor}];break;case 74:this.$=[a[s-5],a[s-1],{type:`addMessage`,from:a[s-5].actor,to:a[s-1].actor,signalType:a[s-3],msg:a[s],activate:!0,centralConnection:r.LINETYPE.CENTRAL_CONNECTION_DUAL},{type:`centralConnection`,signalType:r.LINETYPE.CENTRAL_CONNECTION,actor:a[s-1].actor},{type:`centralConnectionReverse`,signalType:r.LINETYPE.CENTRAL_CONNECTION_REVERSE,actor:a[s-5].actor}];break;case 75:this.$=[a[s-3],a[s-1],{type:`addMessage`,from:a[s-3].actor,to:a[s-1].actor,signalType:a[s-2],msg:a[s]}];break;case 76:this.$={type:`addParticipant`,actor:a[s-1],config:a[s]};break;case 77:this.$=a[s-1].trim();break;case 78:this.$={type:`addParticipant`,actor:a[s]};break;case 79:this.$=r.LINETYPE.SOLID_OPEN;break;case 80:this.$=r.LINETYPE.DOTTED_OPEN;break;case 81:this.$=r.LINETYPE.SOLID;break;case 82:this.$=r.LINETYPE.SOLID_TOP;break;case 83:this.$=r.LINETYPE.SOLID_BOTTOM;break;case 84:this.$=r.LINETYPE.STICK_TOP;break;case 85:this.$=r.LINETYPE.STICK_BOTTOM;break;case 86:this.$=r.LINETYPE.SOLID_TOP_DOTTED;break;case 87:this.$=r.LINETYPE.SOLID_BOTTOM_DOTTED;break;case 88:this.$=r.LINETYPE.STICK_TOP_DOTTED;break;case 89:this.$=r.LINETYPE.STICK_BOTTOM_DOTTED;break;case 90:this.$=r.LINETYPE.SOLID_ARROW_TOP_REVERSE;break;case 91:this.$=r.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE;break;case 92:this.$=r.LINETYPE.STICK_ARROW_TOP_REVERSE;break;case 93:this.$=r.LINETYPE.STICK_ARROW_BOTTOM_REVERSE;break;case 94:this.$=r.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED;break;case 95:this.$=r.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED;break;case 96:this.$=r.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED;break;case 97:this.$=r.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED;break;case 98:this.$=r.LINETYPE.BIDIRECTIONAL_SOLID;break;case 99:this.$=r.LINETYPE.DOTTED;break;case 100:this.$=r.LINETYPE.BIDIRECTIONAL_DOTTED;break;case 101:this.$=r.LINETYPE.SOLID_CROSS;break;case 102:this.$=r.LINETYPE.DOTTED_CROSS;break;case 103:this.$=r.LINETYPE.SOLID_POINT;break;case 104:this.$=r.LINETYPE.DOTTED_POINT;break;case 105:this.$=r.parseMessage(a[s].trim().substring(1))}},`anonymous`),table:[{3:1,4:t,5:n,6:i},{1:[3]},{3:5,4:t,5:n,6:i},{3:6,4:t,5:n,6:i},e([1,4,5,10,14,15,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,51,53,54,56,61,62,63,64,73],a,{7:7}),{1:[2,1]},{1:[2,2]},{1:[2,3],4:o,5:s,8:8,9:10,10:c,13:13,14:l,15:u,18:16,19:d,22:f,23:41,24:p,25:20,26:21,27:22,28:23,29:24,30:m,31:h,32:g,34:_,36:v,37:y,38:b,39:x,40:S,42:C,44:w,45:T,47:E,51:D,53:O,54:k,56:A,61:j,62:M,63:N,64:P,73:F},e(I,[2,5]),{9:48,13:13,14:l,15:u,18:16,19:d,22:f,23:41,24:p,25:20,26:21,27:22,28:23,29:24,30:m,31:h,32:g,34:_,36:v,37:y,38:b,39:x,40:S,42:C,44:w,45:T,47:E,51:D,53:O,54:k,56:A,61:j,62:M,63:N,64:P,73:F},e(I,[2,7]),e(I,[2,8]),e(I,[2,9]),e(I,[2,15]),{13:49,51:D,53:O,54:k},{16:[1,50]},{5:[1,51]},{5:[1,54],20:[1,52],21:[1,53]},{23:55,73:F},{23:56,73:F},{5:[1,57]},{5:[1,58]},{5:[1,59]},{5:[1,60]},{5:[1,61]},e(I,[2,30]),e(I,[2,31]),{33:[1,62]},{35:[1,63]},e(I,[2,34]),{16:[1,64]},{16:[1,65]},{16:[1,66]},{16:[1,67]},{16:[1,68]},{16:[1,69]},{16:[1,70]},{16:[1,71]},{23:72,55:73,73:ee},{23:75,55:76,73:ee},{23:77,73:F},{69:78,72:[1,79],78:L,79:R,80:te,81:ne,82:z,83:B,84:V,85:re,86:H,87:U,88:W,89:ie,90:ae,91:oe,92:G,93:se,94:K,95:ce,96:le,97:ue,98:de,99:fe,100:pe,101:me,102:he,103:ge},{57:106,59:[1,107],67:[1,108],68:[1,109]},{23:110,73:F},{23:111,73:F},{23:112,73:F},{23:113,73:F},e([5,66,72,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104],_e),e(I,[2,6]),e(I,[2,16]),e(ve,[2,10],{11:114}),e(I,[2,18]),{5:[1,116],20:[1,115]},{5:[1,117]},e(I,[2,22]),{5:[1,118]},{5:[1,119]},e(I,[2,25]),e(I,[2,26]),e(I,[2,27]),e(I,[2,28]),e(I,[2,29]),e(I,[2,32]),e(I,[2,33]),e(ye,a,{7:120}),e(ye,a,{7:121}),e(ye,a,{7:122}),e(be,a,{41:123,7:124}),e(xe,a,{43:125,7:126}),e(xe,a,{7:126,43:127}),e(Se,a,{46:128,7:129}),e(ye,a,{7:130}),{5:[1,132],52:[1,131]},{5:[1,134],52:[1,133]},e(Ce,_e,{74:135,75:[1,136]}),{5:[1,138],52:[1,137]},{5:[1,140],52:[1,139]},{5:[1,141]},{23:145,70:[1,142],71:[1,143],72:[1,144],73:F},{69:146,78:L,79:R,80:te,81:ne,82:z,83:B,84:V,85:re,86:H,87:U,88:W,89:ie,90:ae,91:oe,92:G,93:se,94:K,95:ce,96:le,97:ue,98:de,99:fe,100:pe,101:me,102:he,103:ge},e(q,[2,79]),e(q,[2,80]),e(q,[2,81]),e(q,[2,82]),e(q,[2,83]),e(q,[2,84]),e(q,[2,85]),e(q,[2,86]),e(q,[2,87]),e(q,[2,88]),e(q,[2,89]),e(q,[2,90]),e(q,[2,91]),e(q,[2,92]),e(q,[2,93]),e(q,[2,94]),e(q,[2,95]),e(q,[2,96]),e(q,[2,97]),e(q,[2,98]),e(q,[2,99]),e(q,[2,100]),e(q,[2,101]),e(q,[2,102]),e(q,[2,103]),e(q,[2,104]),{23:147,73:F},{23:149,60:148,73:F},{73:[2,68]},{73:[2,69]},{58:150,104:J},{58:152,104:J},{58:153,104:J},{58:154,104:J},{4:[1,157],5:[1,159],12:156,13:158,17:[1,155],51:D,53:O,54:k},{5:[1,160]},e(I,[2,20]),e(I,[2,21]),e(I,[2,23]),e(I,[2,24]),{4:o,5:s,8:8,9:10,10:c,13:13,14:l,15:u,17:[1,161],18:16,19:d,22:f,23:41,24:p,25:20,26:21,27:22,28:23,29:24,30:m,31:h,32:g,34:_,36:v,37:y,38:b,39:x,40:S,42:C,44:w,45:T,47:E,51:D,53:O,54:k,56:A,61:j,62:M,63:N,64:P,73:F},{4:o,5:s,8:8,9:10,10:c,13:13,14:l,15:u,17:[1,162],18:16,19:d,22:f,23:41,24:p,25:20,26:21,27:22,28:23,29:24,30:m,31:h,32:g,34:_,36:v,37:y,38:b,39:x,40:S,42:C,44:w,45:T,47:E,51:D,53:O,54:k,56:A,61:j,62:M,63:N,64:P,73:F},{4:o,5:s,8:8,9:10,10:c,13:13,14:l,15:u,17:[1,163],18:16,19:d,22:f,23:41,24:p,25:20,26:21,27:22,28:23,29:24,30:m,31:h,32:g,34:_,36:v,37:y,38:b,39:x,40:S,42:C,44:w,45:T,47:E,51:D,53:O,54:k,56:A,61:j,62:M,63:N,64:P,73:F},{17:[1,164]},{4:o,5:s,8:8,9:10,10:c,13:13,14:l,15:u,17:[2,47],18:16,19:d,22:f,23:41,24:p,25:20,26:21,27:22,28:23,29:24,30:m,31:h,32:g,34:_,36:v,37:y,38:b,39:x,40:S,42:C,44:w,45:T,47:E,50:[1,165],51:D,53:O,54:k,56:A,61:j,62:M,63:N,64:P,73:F},{17:[1,166]},{4:o,5:s,8:8,9:10,10:c,13:13,14:l,15:u,17:[2,45],18:16,19:d,22:f,23:41,24:p,25:20,26:21,27:22,28:23,29:24,30:m,31:h,32:g,34:_,36:v,37:y,38:b,39:x,40:S,42:C,44:w,45:T,47:E,49:[1,167],51:D,53:O,54:k,56:A,61:j,62:M,63:N,64:P,73:F},{17:[1,168]},{17:[1,169]},{4:o,5:s,8:8,9:10,10:c,13:13,14:l,15:u,17:[2,43],18:16,19:d,22:f,23:41,24:p,25:20,26:21,27:22,28:23,29:24,30:m,31:h,32:g,34:_,36:v,37:y,38:b,39:x,40:S,42:C,44:w,45:T,47:E,48:[1,170],51:D,53:O,54:k,56:A,61:j,62:M,63:N,64:P,73:F},{4:o,5:s,8:8,9:10,10:c,13:13,14:l,15:u,17:[1,171],18:16,19:d,22:f,23:41,24:p,25:20,26:21,27:22,28:23,29:24,30:m,31:h,32:g,34:_,36:v,37:y,38:b,39:x,40:S,42:C,44:w,45:T,47:E,51:D,53:O,54:k,56:A,61:j,62:M,63:N,64:P,73:F},{16:[1,172]},e(I,[2,50]),{16:[1,173]},e(I,[2,55]),e(Ce,[2,76]),{76:[1,174]},{16:[1,175]},e(I,[2,52]),{16:[1,176]},e(I,[2,57]),e(I,[2,53]),{23:177,73:F},{23:178,73:F},{23:179,73:F},{58:180,104:J},{23:181,72:[1,182],73:F},{58:183,104:J},{58:184,104:J},{66:[1,185],104:[2,67]},{5:[2,60]},{5:[2,105]},{5:[2,61]},{5:[2,62]},{5:[2,63]},e(I,[2,17]),e(ve,[2,11]),{13:186,51:D,53:O,54:k},e(ve,[2,13]),e(ve,[2,14]),e(I,[2,19]),e(I,[2,35]),e(I,[2,36]),e(I,[2,37]),e(I,[2,38]),{16:[1,187]},e(I,[2,39]),{16:[1,188]},e(I,[2,40]),e(I,[2,41]),{16:[1,189]},e(I,[2,42]),{5:[1,190]},{5:[1,191]},{77:[1,192]},{5:[1,193]},{5:[1,194]},{58:195,104:J},{58:196,104:J},{58:197,104:J},{5:[2,75]},{58:198,104:J},{23:199,73:F},{5:[2,58]},{5:[2,59]},{23:200,73:F},e(ve,[2,12]),e(be,a,{7:124,41:201}),e(xe,a,{7:126,43:202}),e(Se,a,{7:129,46:203}),e(I,[2,49]),e(I,[2,54]),e(Ce,[2,77]),e(I,[2,51]),e(I,[2,56]),{5:[2,70]},{5:[2,71]},{5:[2,72]},{5:[2,73]},{58:204,104:J},{104:[2,66]},{17:[2,48]},{17:[2,46]},{17:[2,44]},{5:[2,74]}],defaultActions:{5:[2,1],6:[2,2],108:[2,68],109:[2,69],150:[2,60],151:[2,105],152:[2,61],153:[2,62],154:[2,63],180:[2,75],183:[2,58],184:[2,59],195:[2,70],196:[2,71],197:[2,72],198:[2,73],200:[2,66],201:[2,48],202:[2,46],203:[2,44],204:[2,74]},parseError:r(function(e,t){if(t.recoverable)this.trace(e);else{var n=Error(e);throw n.hash=t,n}},`parseError`),parse:r(function(e){var t=this,n=[0],i=[],a=[null],o=[],s=this.table,c=``,l=0,u=0,d=0,f=2,p=1,m=o.slice.call(arguments,1),h=Object.create(this.lexer),g={yy:{}};for(var _ in this.yy)Object.prototype.hasOwnProperty.call(this.yy,_)&&(g.yy[_]=this.yy[_]);h.setInput(e,g.yy),g.yy.lexer=h,g.yy.parser=this,h.yylloc===void 0&&(h.yylloc={});var v=h.yylloc;o.push(v);var y=h.options&&h.options.ranges;this.parseError=typeof g.yy.parseError==`function`?g.yy.parseError:Object.getPrototypeOf(this).parseError;function b(e){n.length-=2*e,a.length-=e,o.length-=e}r(b,`popStack`);function x(){var e=i.pop()||h.lex()||p;return typeof e!=`number`&&(e instanceof Array&&(i=e,e=i.pop()),e=t.symbols_[e]||e),e}r(x,`lex`);for(var S,C,w,T,E,D={},O,k,A,j;;){if(w=n[n.length-1],this.defaultActions[w]?T=this.defaultActions[w]:(S??=x(),T=s[w]&&s[w][S]),T===void 0||!T.length||!T[0]){var M=``;for(O in j=[],s[w])this.terminals_[O]&&O>f&&j.push(`'`+this.terminals_[O]+`'`);M=h.showPosition?`Parse error on line `+(l+1)+`:
1
+ import{g as e,p as t}from"./chunk-75Z2AOVW-DA_lihEi.js";import{u as n}from"./src-BpnPuKEN.js";import{n as r}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import{t as i}from"./src-Cyu5G-Tr.js";import{A as a,F as o,G as s,H as c,K as l,O as u,U as d,a as f,b as p,c as m,i as h,r as g,s as _,v,w as y,x as b,y as x,z as S}from"./chunk-DU6HZSFF-J-califE.js";import{t as C}from"./dist-CeoU7cfW.js";import{a as w,i as T}from"./mermaid-3TiKkcPE.js";import{a as E,c as D,i as O,n as k,r as A,s as j}from"./chunk-F27PBJKO-BzJrz4xx.js";import{t as M}from"./chunk-2Q5K7J3B-C1jixKkw.js";var N=C(),P=(function(){var e=r(function(e,t,n,r){for(n||={},r=e.length;r--;n[e[r]]=t);return n},`o`),t=[1,2],n=[1,3],i=[1,4],a=[2,4],o=[1,9],s=[1,11],c=[1,12],l=[1,14],u=[1,15],d=[1,17],f=[1,18],p=[1,19],m=[1,25],h=[1,26],g=[1,27],_=[1,28],v=[1,29],y=[1,30],b=[1,31],x=[1,32],S=[1,33],C=[1,34],w=[1,35],T=[1,36],E=[1,37],D=[1,38],O=[1,39],k=[1,40],A=[1,42],j=[1,43],M=[1,44],N=[1,45],P=[1,46],F=[1,47],I=[1,4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,48,49,50,51,53,54,56,61,62,63,64,73],ee=[1,74],L=[1,80],R=[1,81],te=[1,82],ne=[1,83],z=[1,84],B=[1,85],V=[1,86],re=[1,87],H=[1,88],U=[1,89],W=[1,90],ie=[1,91],ae=[1,92],oe=[1,93],G=[1,94],se=[1,95],K=[1,96],ce=[1,97],le=[1,98],ue=[1,99],de=[1,100],fe=[1,101],pe=[1,102],me=[1,103],he=[1,104],ge=[1,105],_e=[2,78],ve=[4,5,17,51,53,54],ye=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,51,53,54,56,61,62,63,64,73],be=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,50,51,53,54,56,61,62,63,64,73],xe=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,49,51,53,54,56,61,62,63,64,73],Se=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,48,51,53,54,56,61,62,63,64,73],Ce=[5,52],q=[70,71,72,73],J=[1,151],we={trace:r(function(){},`trace`),yy:{},symbols_:{error:2,start:3,SPACE:4,NEWLINE:5,SD:6,document:7,line:8,statement:9,INVALID:10,box_section:11,box_line:12,participant_statement:13,create:14,box:15,restOfLine:16,end:17,signal:18,autonumber:19,NUM:20,off:21,activate:22,actor:23,deactivate:24,note_statement:25,links_statement:26,link_statement:27,properties_statement:28,details_statement:29,title:30,legacy_title:31,acc_title:32,acc_title_value:33,acc_descr:34,acc_descr_value:35,acc_descr_multiline_value:36,loop:37,rect:38,opt:39,alt:40,else_sections:41,par:42,par_sections:43,par_over:44,critical:45,option_sections:46,break:47,option:48,and:49,else:50,participant:51,AS:52,participant_actor:53,destroy:54,actor_with_config:55,note:56,placement:57,text2:58,over:59,actor_pair:60,links:61,link:62,properties:63,details:64,spaceList:65,",":66,left_of:67,right_of:68,signaltype:69,"+":70,"-":71,"()":72,ACTOR:73,config_object:74,CONFIG_START:75,CONFIG_CONTENT:76,CONFIG_END:77,SOLID_OPEN_ARROW:78,DOTTED_OPEN_ARROW:79,SOLID_ARROW:80,SOLID_ARROW_TOP:81,SOLID_ARROW_BOTTOM:82,STICK_ARROW_TOP:83,STICK_ARROW_BOTTOM:84,SOLID_ARROW_TOP_DOTTED:85,SOLID_ARROW_BOTTOM_DOTTED:86,STICK_ARROW_TOP_DOTTED:87,STICK_ARROW_BOTTOM_DOTTED:88,SOLID_ARROW_TOP_REVERSE:89,SOLID_ARROW_BOTTOM_REVERSE:90,STICK_ARROW_TOP_REVERSE:91,STICK_ARROW_BOTTOM_REVERSE:92,SOLID_ARROW_TOP_REVERSE_DOTTED:93,SOLID_ARROW_BOTTOM_REVERSE_DOTTED:94,STICK_ARROW_TOP_REVERSE_DOTTED:95,STICK_ARROW_BOTTOM_REVERSE_DOTTED:96,BIDIRECTIONAL_SOLID_ARROW:97,DOTTED_ARROW:98,BIDIRECTIONAL_DOTTED_ARROW:99,SOLID_CROSS:100,DOTTED_CROSS:101,SOLID_POINT:102,DOTTED_POINT:103,TXT:104,$accept:0,$end:1},terminals_:{2:`error`,4:`SPACE`,5:`NEWLINE`,6:`SD`,10:`INVALID`,14:`create`,15:`box`,16:`restOfLine`,17:`end`,19:`autonumber`,20:`NUM`,21:`off`,22:`activate`,24:`deactivate`,30:`title`,31:`legacy_title`,32:`acc_title`,33:`acc_title_value`,34:`acc_descr`,35:`acc_descr_value`,36:`acc_descr_multiline_value`,37:`loop`,38:`rect`,39:`opt`,40:`alt`,42:`par`,44:`par_over`,45:`critical`,47:`break`,48:`option`,49:`and`,50:`else`,51:`participant`,52:`AS`,53:`participant_actor`,54:`destroy`,56:`note`,59:`over`,61:`links`,62:`link`,63:`properties`,64:`details`,66:`,`,67:`left_of`,68:`right_of`,70:`+`,71:`-`,72:`()`,73:`ACTOR`,75:`CONFIG_START`,76:`CONFIG_CONTENT`,77:`CONFIG_END`,78:`SOLID_OPEN_ARROW`,79:`DOTTED_OPEN_ARROW`,80:`SOLID_ARROW`,81:`SOLID_ARROW_TOP`,82:`SOLID_ARROW_BOTTOM`,83:`STICK_ARROW_TOP`,84:`STICK_ARROW_BOTTOM`,85:`SOLID_ARROW_TOP_DOTTED`,86:`SOLID_ARROW_BOTTOM_DOTTED`,87:`STICK_ARROW_TOP_DOTTED`,88:`STICK_ARROW_BOTTOM_DOTTED`,89:`SOLID_ARROW_TOP_REVERSE`,90:`SOLID_ARROW_BOTTOM_REVERSE`,91:`STICK_ARROW_TOP_REVERSE`,92:`STICK_ARROW_BOTTOM_REVERSE`,93:`SOLID_ARROW_TOP_REVERSE_DOTTED`,94:`SOLID_ARROW_BOTTOM_REVERSE_DOTTED`,95:`STICK_ARROW_TOP_REVERSE_DOTTED`,96:`STICK_ARROW_BOTTOM_REVERSE_DOTTED`,97:`BIDIRECTIONAL_SOLID_ARROW`,98:`DOTTED_ARROW`,99:`BIDIRECTIONAL_DOTTED_ARROW`,100:`SOLID_CROSS`,101:`DOTTED_CROSS`,102:`SOLID_POINT`,103:`DOTTED_POINT`,104:`TXT`},productions_:[0,[3,2],[3,2],[3,2],[7,0],[7,2],[8,2],[8,1],[8,1],[8,1],[11,0],[11,2],[12,2],[12,1],[12,1],[9,1],[9,2],[9,4],[9,2],[9,4],[9,3],[9,3],[9,2],[9,3],[9,3],[9,2],[9,2],[9,2],[9,2],[9,2],[9,1],[9,1],[9,2],[9,2],[9,1],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[46,1],[46,4],[43,1],[43,4],[41,1],[41,4],[13,5],[13,3],[13,5],[13,3],[13,3],[13,5],[13,3],[13,5],[13,3],[25,4],[25,4],[26,3],[27,3],[28,3],[29,3],[65,2],[65,1],[60,3],[60,1],[57,1],[57,1],[18,5],[18,5],[18,5],[18,5],[18,6],[18,4],[55,2],[74,3],[23,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[58,1]],performAction:r(function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 3:return r.apply(a[s]),a[s];case 4:case 10:this.$=[];break;case 5:case 11:a[s-1].push(a[s]),this.$=a[s-1];break;case 6:case 7:case 12:case 13:this.$=a[s];break;case 8:case 9:case 14:this.$=[];break;case 16:a[s].type=`createParticipant`,this.$=a[s];break;case 17:a[s-1].unshift({type:`boxStart`,boxData:r.parseBoxData(a[s-2])}),a[s-1].push({type:`boxEnd`,boxText:a[s-2]}),this.$=a[s-1];break;case 19:this.$={type:`sequenceIndex`,sequenceIndex:Number(a[s-2]),sequenceIndexStep:Number(a[s-1]),sequenceVisible:!0,signalType:r.LINETYPE.AUTONUMBER};break;case 20:this.$={type:`sequenceIndex`,sequenceIndex:Number(a[s-1]),sequenceIndexStep:1,sequenceVisible:!0,signalType:r.LINETYPE.AUTONUMBER};break;case 21:this.$={type:`sequenceIndex`,sequenceVisible:!1,signalType:r.LINETYPE.AUTONUMBER};break;case 22:this.$={type:`sequenceIndex`,sequenceVisible:!0,signalType:r.LINETYPE.AUTONUMBER};break;case 23:this.$={type:`activeStart`,signalType:r.LINETYPE.ACTIVE_START,actor:a[s-1].actor};break;case 24:this.$={type:`activeEnd`,signalType:r.LINETYPE.ACTIVE_END,actor:a[s-1].actor};break;case 30:r.setDiagramTitle(a[s].substring(6)),this.$=a[s].substring(6);break;case 31:r.setDiagramTitle(a[s].substring(7)),this.$=a[s].substring(7);break;case 32:this.$=a[s].trim(),r.setAccTitle(this.$);break;case 33:case 34:this.$=a[s].trim(),r.setAccDescription(this.$);break;case 35:a[s-1].unshift({type:`loopStart`,loopText:r.parseMessage(a[s-2]),signalType:r.LINETYPE.LOOP_START}),a[s-1].push({type:`loopEnd`,loopText:a[s-2],signalType:r.LINETYPE.LOOP_END}),this.$=a[s-1];break;case 36:a[s-1].unshift({type:`rectStart`,color:r.parseMessage(a[s-2]),signalType:r.LINETYPE.RECT_START}),a[s-1].push({type:`rectEnd`,color:r.parseMessage(a[s-2]),signalType:r.LINETYPE.RECT_END}),this.$=a[s-1];break;case 37:a[s-1].unshift({type:`optStart`,optText:r.parseMessage(a[s-2]),signalType:r.LINETYPE.OPT_START}),a[s-1].push({type:`optEnd`,optText:r.parseMessage(a[s-2]),signalType:r.LINETYPE.OPT_END}),this.$=a[s-1];break;case 38:a[s-1].unshift({type:`altStart`,altText:r.parseMessage(a[s-2]),signalType:r.LINETYPE.ALT_START}),a[s-1].push({type:`altEnd`,signalType:r.LINETYPE.ALT_END}),this.$=a[s-1];break;case 39:a[s-1].unshift({type:`parStart`,parText:r.parseMessage(a[s-2]),signalType:r.LINETYPE.PAR_START}),a[s-1].push({type:`parEnd`,signalType:r.LINETYPE.PAR_END}),this.$=a[s-1];break;case 40:a[s-1].unshift({type:`parStart`,parText:r.parseMessage(a[s-2]),signalType:r.LINETYPE.PAR_OVER_START}),a[s-1].push({type:`parEnd`,signalType:r.LINETYPE.PAR_END}),this.$=a[s-1];break;case 41:a[s-1].unshift({type:`criticalStart`,criticalText:r.parseMessage(a[s-2]),signalType:r.LINETYPE.CRITICAL_START}),a[s-1].push({type:`criticalEnd`,signalType:r.LINETYPE.CRITICAL_END}),this.$=a[s-1];break;case 42:a[s-1].unshift({type:`breakStart`,breakText:r.parseMessage(a[s-2]),signalType:r.LINETYPE.BREAK_START}),a[s-1].push({type:`breakEnd`,optText:r.parseMessage(a[s-2]),signalType:r.LINETYPE.BREAK_END}),this.$=a[s-1];break;case 44:this.$=a[s-3].concat([{type:`option`,optionText:r.parseMessage(a[s-1]),signalType:r.LINETYPE.CRITICAL_OPTION},a[s]]);break;case 46:this.$=a[s-3].concat([{type:`and`,parText:r.parseMessage(a[s-1]),signalType:r.LINETYPE.PAR_AND},a[s]]);break;case 48:this.$=a[s-3].concat([{type:`else`,altText:r.parseMessage(a[s-1]),signalType:r.LINETYPE.ALT_ELSE},a[s]]);break;case 49:a[s-3].draw=`participant`,a[s-3].type=`addParticipant`,a[s-3].description=r.parseMessage(a[s-1]),this.$=a[s-3];break;case 50:a[s-1].draw=`participant`,a[s-1].type=`addParticipant`,this.$=a[s-1];break;case 51:a[s-3].draw=`actor`,a[s-3].type=`addParticipant`,a[s-3].description=r.parseMessage(a[s-1]),this.$=a[s-3];break;case 52:case 57:a[s-1].draw=`actor`,a[s-1].type=`addParticipant`,this.$=a[s-1];break;case 53:a[s-1].type=`destroyParticipant`,this.$=a[s-1];break;case 54:a[s-3].draw=`participant`,a[s-3].type=`addParticipant`,a[s-3].description=r.parseMessage(a[s-1]),this.$=a[s-3];break;case 55:a[s-1].draw=`participant`,a[s-1].type=`addParticipant`,this.$=a[s-1];break;case 56:a[s-3].draw=`actor`,a[s-3].type=`addParticipant`,a[s-3].description=r.parseMessage(a[s-1]),this.$=a[s-3];break;case 58:this.$=[a[s-1],{type:`addNote`,placement:a[s-2],actor:a[s-1].actor,text:a[s]}];break;case 59:a[s-2]=[].concat(a[s-1],a[s-1]).slice(0,2),a[s-2][0]=a[s-2][0].actor,a[s-2][1]=a[s-2][1].actor,this.$=[a[s-1],{type:`addNote`,placement:r.PLACEMENT.OVER,actor:a[s-2].slice(0,2),text:a[s]}];break;case 60:this.$=[a[s-1],{type:`addLinks`,actor:a[s-1].actor,text:a[s]}];break;case 61:this.$=[a[s-1],{type:`addALink`,actor:a[s-1].actor,text:a[s]}];break;case 62:this.$=[a[s-1],{type:`addProperties`,actor:a[s-1].actor,text:a[s]}];break;case 63:this.$=[a[s-1],{type:`addDetails`,actor:a[s-1].actor,text:a[s]}];break;case 66:this.$=[a[s-2],a[s]];break;case 67:this.$=a[s];break;case 68:this.$=r.PLACEMENT.LEFTOF;break;case 69:this.$=r.PLACEMENT.RIGHTOF;break;case 70:this.$=[a[s-4],a[s-1],{type:`addMessage`,from:a[s-4].actor,to:a[s-1].actor,signalType:a[s-3],msg:a[s],activate:!0},{type:`activeStart`,signalType:r.LINETYPE.ACTIVE_START,actor:a[s-1].actor}];break;case 71:this.$=[a[s-4],a[s-1],{type:`addMessage`,from:a[s-4].actor,to:a[s-1].actor,signalType:a[s-3],msg:a[s]},{type:`activeEnd`,signalType:r.LINETYPE.ACTIVE_END,actor:a[s-4].actor}];break;case 72:this.$=[a[s-4],a[s-1],{type:`addMessage`,from:a[s-4].actor,to:a[s-1].actor,signalType:a[s-3],msg:a[s],activate:!0,centralConnection:r.LINETYPE.CENTRAL_CONNECTION},{type:`centralConnection`,signalType:r.LINETYPE.CENTRAL_CONNECTION,actor:a[s-1].actor}];break;case 73:this.$=[a[s-4],a[s-1],{type:`addMessage`,from:a[s-4].actor,to:a[s-1].actor,signalType:a[s-2],msg:a[s],activate:!1,centralConnection:r.LINETYPE.CENTRAL_CONNECTION_REVERSE},{type:`centralConnectionReverse`,signalType:r.LINETYPE.CENTRAL_CONNECTION_REVERSE,actor:a[s-4].actor}];break;case 74:this.$=[a[s-5],a[s-1],{type:`addMessage`,from:a[s-5].actor,to:a[s-1].actor,signalType:a[s-3],msg:a[s],activate:!0,centralConnection:r.LINETYPE.CENTRAL_CONNECTION_DUAL},{type:`centralConnection`,signalType:r.LINETYPE.CENTRAL_CONNECTION,actor:a[s-1].actor},{type:`centralConnectionReverse`,signalType:r.LINETYPE.CENTRAL_CONNECTION_REVERSE,actor:a[s-5].actor}];break;case 75:this.$=[a[s-3],a[s-1],{type:`addMessage`,from:a[s-3].actor,to:a[s-1].actor,signalType:a[s-2],msg:a[s]}];break;case 76:this.$={type:`addParticipant`,actor:a[s-1],config:a[s]};break;case 77:this.$=a[s-1].trim();break;case 78:this.$={type:`addParticipant`,actor:a[s]};break;case 79:this.$=r.LINETYPE.SOLID_OPEN;break;case 80:this.$=r.LINETYPE.DOTTED_OPEN;break;case 81:this.$=r.LINETYPE.SOLID;break;case 82:this.$=r.LINETYPE.SOLID_TOP;break;case 83:this.$=r.LINETYPE.SOLID_BOTTOM;break;case 84:this.$=r.LINETYPE.STICK_TOP;break;case 85:this.$=r.LINETYPE.STICK_BOTTOM;break;case 86:this.$=r.LINETYPE.SOLID_TOP_DOTTED;break;case 87:this.$=r.LINETYPE.SOLID_BOTTOM_DOTTED;break;case 88:this.$=r.LINETYPE.STICK_TOP_DOTTED;break;case 89:this.$=r.LINETYPE.STICK_BOTTOM_DOTTED;break;case 90:this.$=r.LINETYPE.SOLID_ARROW_TOP_REVERSE;break;case 91:this.$=r.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE;break;case 92:this.$=r.LINETYPE.STICK_ARROW_TOP_REVERSE;break;case 93:this.$=r.LINETYPE.STICK_ARROW_BOTTOM_REVERSE;break;case 94:this.$=r.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED;break;case 95:this.$=r.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED;break;case 96:this.$=r.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED;break;case 97:this.$=r.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED;break;case 98:this.$=r.LINETYPE.BIDIRECTIONAL_SOLID;break;case 99:this.$=r.LINETYPE.DOTTED;break;case 100:this.$=r.LINETYPE.BIDIRECTIONAL_DOTTED;break;case 101:this.$=r.LINETYPE.SOLID_CROSS;break;case 102:this.$=r.LINETYPE.DOTTED_CROSS;break;case 103:this.$=r.LINETYPE.SOLID_POINT;break;case 104:this.$=r.LINETYPE.DOTTED_POINT;break;case 105:this.$=r.parseMessage(a[s].trim().substring(1))}},`anonymous`),table:[{3:1,4:t,5:n,6:i},{1:[3]},{3:5,4:t,5:n,6:i},{3:6,4:t,5:n,6:i},e([1,4,5,10,14,15,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,51,53,54,56,61,62,63,64,73],a,{7:7}),{1:[2,1]},{1:[2,2]},{1:[2,3],4:o,5:s,8:8,9:10,10:c,13:13,14:l,15:u,18:16,19:d,22:f,23:41,24:p,25:20,26:21,27:22,28:23,29:24,30:m,31:h,32:g,34:_,36:v,37:y,38:b,39:x,40:S,42:C,44:w,45:T,47:E,51:D,53:O,54:k,56:A,61:j,62:M,63:N,64:P,73:F},e(I,[2,5]),{9:48,13:13,14:l,15:u,18:16,19:d,22:f,23:41,24:p,25:20,26:21,27:22,28:23,29:24,30:m,31:h,32:g,34:_,36:v,37:y,38:b,39:x,40:S,42:C,44:w,45:T,47:E,51:D,53:O,54:k,56:A,61:j,62:M,63:N,64:P,73:F},e(I,[2,7]),e(I,[2,8]),e(I,[2,9]),e(I,[2,15]),{13:49,51:D,53:O,54:k},{16:[1,50]},{5:[1,51]},{5:[1,54],20:[1,52],21:[1,53]},{23:55,73:F},{23:56,73:F},{5:[1,57]},{5:[1,58]},{5:[1,59]},{5:[1,60]},{5:[1,61]},e(I,[2,30]),e(I,[2,31]),{33:[1,62]},{35:[1,63]},e(I,[2,34]),{16:[1,64]},{16:[1,65]},{16:[1,66]},{16:[1,67]},{16:[1,68]},{16:[1,69]},{16:[1,70]},{16:[1,71]},{23:72,55:73,73:ee},{23:75,55:76,73:ee},{23:77,73:F},{69:78,72:[1,79],78:L,79:R,80:te,81:ne,82:z,83:B,84:V,85:re,86:H,87:U,88:W,89:ie,90:ae,91:oe,92:G,93:se,94:K,95:ce,96:le,97:ue,98:de,99:fe,100:pe,101:me,102:he,103:ge},{57:106,59:[1,107],67:[1,108],68:[1,109]},{23:110,73:F},{23:111,73:F},{23:112,73:F},{23:113,73:F},e([5,66,72,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104],_e),e(I,[2,6]),e(I,[2,16]),e(ve,[2,10],{11:114}),e(I,[2,18]),{5:[1,116],20:[1,115]},{5:[1,117]},e(I,[2,22]),{5:[1,118]},{5:[1,119]},e(I,[2,25]),e(I,[2,26]),e(I,[2,27]),e(I,[2,28]),e(I,[2,29]),e(I,[2,32]),e(I,[2,33]),e(ye,a,{7:120}),e(ye,a,{7:121}),e(ye,a,{7:122}),e(be,a,{41:123,7:124}),e(xe,a,{43:125,7:126}),e(xe,a,{7:126,43:127}),e(Se,a,{46:128,7:129}),e(ye,a,{7:130}),{5:[1,132],52:[1,131]},{5:[1,134],52:[1,133]},e(Ce,_e,{74:135,75:[1,136]}),{5:[1,138],52:[1,137]},{5:[1,140],52:[1,139]},{5:[1,141]},{23:145,70:[1,142],71:[1,143],72:[1,144],73:F},{69:146,78:L,79:R,80:te,81:ne,82:z,83:B,84:V,85:re,86:H,87:U,88:W,89:ie,90:ae,91:oe,92:G,93:se,94:K,95:ce,96:le,97:ue,98:de,99:fe,100:pe,101:me,102:he,103:ge},e(q,[2,79]),e(q,[2,80]),e(q,[2,81]),e(q,[2,82]),e(q,[2,83]),e(q,[2,84]),e(q,[2,85]),e(q,[2,86]),e(q,[2,87]),e(q,[2,88]),e(q,[2,89]),e(q,[2,90]),e(q,[2,91]),e(q,[2,92]),e(q,[2,93]),e(q,[2,94]),e(q,[2,95]),e(q,[2,96]),e(q,[2,97]),e(q,[2,98]),e(q,[2,99]),e(q,[2,100]),e(q,[2,101]),e(q,[2,102]),e(q,[2,103]),e(q,[2,104]),{23:147,73:F},{23:149,60:148,73:F},{73:[2,68]},{73:[2,69]},{58:150,104:J},{58:152,104:J},{58:153,104:J},{58:154,104:J},{4:[1,157],5:[1,159],12:156,13:158,17:[1,155],51:D,53:O,54:k},{5:[1,160]},e(I,[2,20]),e(I,[2,21]),e(I,[2,23]),e(I,[2,24]),{4:o,5:s,8:8,9:10,10:c,13:13,14:l,15:u,17:[1,161],18:16,19:d,22:f,23:41,24:p,25:20,26:21,27:22,28:23,29:24,30:m,31:h,32:g,34:_,36:v,37:y,38:b,39:x,40:S,42:C,44:w,45:T,47:E,51:D,53:O,54:k,56:A,61:j,62:M,63:N,64:P,73:F},{4:o,5:s,8:8,9:10,10:c,13:13,14:l,15:u,17:[1,162],18:16,19:d,22:f,23:41,24:p,25:20,26:21,27:22,28:23,29:24,30:m,31:h,32:g,34:_,36:v,37:y,38:b,39:x,40:S,42:C,44:w,45:T,47:E,51:D,53:O,54:k,56:A,61:j,62:M,63:N,64:P,73:F},{4:o,5:s,8:8,9:10,10:c,13:13,14:l,15:u,17:[1,163],18:16,19:d,22:f,23:41,24:p,25:20,26:21,27:22,28:23,29:24,30:m,31:h,32:g,34:_,36:v,37:y,38:b,39:x,40:S,42:C,44:w,45:T,47:E,51:D,53:O,54:k,56:A,61:j,62:M,63:N,64:P,73:F},{17:[1,164]},{4:o,5:s,8:8,9:10,10:c,13:13,14:l,15:u,17:[2,47],18:16,19:d,22:f,23:41,24:p,25:20,26:21,27:22,28:23,29:24,30:m,31:h,32:g,34:_,36:v,37:y,38:b,39:x,40:S,42:C,44:w,45:T,47:E,50:[1,165],51:D,53:O,54:k,56:A,61:j,62:M,63:N,64:P,73:F},{17:[1,166]},{4:o,5:s,8:8,9:10,10:c,13:13,14:l,15:u,17:[2,45],18:16,19:d,22:f,23:41,24:p,25:20,26:21,27:22,28:23,29:24,30:m,31:h,32:g,34:_,36:v,37:y,38:b,39:x,40:S,42:C,44:w,45:T,47:E,49:[1,167],51:D,53:O,54:k,56:A,61:j,62:M,63:N,64:P,73:F},{17:[1,168]},{17:[1,169]},{4:o,5:s,8:8,9:10,10:c,13:13,14:l,15:u,17:[2,43],18:16,19:d,22:f,23:41,24:p,25:20,26:21,27:22,28:23,29:24,30:m,31:h,32:g,34:_,36:v,37:y,38:b,39:x,40:S,42:C,44:w,45:T,47:E,48:[1,170],51:D,53:O,54:k,56:A,61:j,62:M,63:N,64:P,73:F},{4:o,5:s,8:8,9:10,10:c,13:13,14:l,15:u,17:[1,171],18:16,19:d,22:f,23:41,24:p,25:20,26:21,27:22,28:23,29:24,30:m,31:h,32:g,34:_,36:v,37:y,38:b,39:x,40:S,42:C,44:w,45:T,47:E,51:D,53:O,54:k,56:A,61:j,62:M,63:N,64:P,73:F},{16:[1,172]},e(I,[2,50]),{16:[1,173]},e(I,[2,55]),e(Ce,[2,76]),{76:[1,174]},{16:[1,175]},e(I,[2,52]),{16:[1,176]},e(I,[2,57]),e(I,[2,53]),{23:177,73:F},{23:178,73:F},{23:179,73:F},{58:180,104:J},{23:181,72:[1,182],73:F},{58:183,104:J},{58:184,104:J},{66:[1,185],104:[2,67]},{5:[2,60]},{5:[2,105]},{5:[2,61]},{5:[2,62]},{5:[2,63]},e(I,[2,17]),e(ve,[2,11]),{13:186,51:D,53:O,54:k},e(ve,[2,13]),e(ve,[2,14]),e(I,[2,19]),e(I,[2,35]),e(I,[2,36]),e(I,[2,37]),e(I,[2,38]),{16:[1,187]},e(I,[2,39]),{16:[1,188]},e(I,[2,40]),e(I,[2,41]),{16:[1,189]},e(I,[2,42]),{5:[1,190]},{5:[1,191]},{77:[1,192]},{5:[1,193]},{5:[1,194]},{58:195,104:J},{58:196,104:J},{58:197,104:J},{5:[2,75]},{58:198,104:J},{23:199,73:F},{5:[2,58]},{5:[2,59]},{23:200,73:F},e(ve,[2,12]),e(be,a,{7:124,41:201}),e(xe,a,{7:126,43:202}),e(Se,a,{7:129,46:203}),e(I,[2,49]),e(I,[2,54]),e(Ce,[2,77]),e(I,[2,51]),e(I,[2,56]),{5:[2,70]},{5:[2,71]},{5:[2,72]},{5:[2,73]},{58:204,104:J},{104:[2,66]},{17:[2,48]},{17:[2,46]},{17:[2,44]},{5:[2,74]}],defaultActions:{5:[2,1],6:[2,2],108:[2,68],109:[2,69],150:[2,60],151:[2,105],152:[2,61],153:[2,62],154:[2,63],180:[2,75],183:[2,58],184:[2,59],195:[2,70],196:[2,71],197:[2,72],198:[2,73],200:[2,66],201:[2,48],202:[2,46],203:[2,44],204:[2,74]},parseError:r(function(e,t){if(t.recoverable)this.trace(e);else{var n=Error(e);throw n.hash=t,n}},`parseError`),parse:r(function(e){var t=this,n=[0],i=[],a=[null],o=[],s=this.table,c=``,l=0,u=0,d=0,f=2,p=1,m=o.slice.call(arguments,1),h=Object.create(this.lexer),g={yy:{}};for(var _ in this.yy)Object.prototype.hasOwnProperty.call(this.yy,_)&&(g.yy[_]=this.yy[_]);h.setInput(e,g.yy),g.yy.lexer=h,g.yy.parser=this,h.yylloc===void 0&&(h.yylloc={});var v=h.yylloc;o.push(v);var y=h.options&&h.options.ranges;this.parseError=typeof g.yy.parseError==`function`?g.yy.parseError:Object.getPrototypeOf(this).parseError;function b(e){n.length-=2*e,a.length-=e,o.length-=e}r(b,`popStack`);function x(){var e=i.pop()||h.lex()||p;return typeof e!=`number`&&(e instanceof Array&&(i=e,e=i.pop()),e=t.symbols_[e]||e),e}r(x,`lex`);for(var S,C,w,T,E,D={},O,k,A,j;;){if(w=n[n.length-1],this.defaultActions[w]?T=this.defaultActions[w]:(S??=x(),T=s[w]&&s[w][S]),T===void 0||!T.length||!T[0]){var M=``;for(O in j=[],s[w])this.terminals_[O]&&O>f&&j.push(`'`+this.terminals_[O]+`'`);M=h.showPosition?`Parse error on line `+(l+1)+`:
2
2
  `+h.showPosition()+`
3
3
  Expecting `+j.join(`, `)+`, got '`+(this.terminals_[S]||S)+`'`:`Parse error on line `+(l+1)+`: Unexpected `+(S==p?`end of input`:`'`+(this.terminals_[S]||S)+`'`),this.parseError(M,{text:h.match,token:this.terminals_[S]||S,line:h.yylineno,loc:v,expected:j})}if(T[0]instanceof Array&&T.length>1)throw Error(`Parse Error: multiple actions possible at state: `+w+`, token: `+S);switch(T[0]){case 1:n.push(S),a.push(h.yytext),o.push(h.yylloc),n.push(T[1]),S=null,C?(S=C,C=null):(u=h.yyleng,c=h.yytext,l=h.yylineno,v=h.yylloc,d>0&&d--);break;case 2:if(k=this.productions_[T[1]][1],D.$=a[a.length-k],D._$={first_line:o[o.length-(k||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(k||1)].first_column,last_column:o[o.length-1].last_column},y&&(D._$.range=[o[o.length-(k||1)].range[0],o[o.length-1].range[1]]),E=this.performAction.apply(D,[c,u,l,g.yy,T[1],a,o].concat(m)),E!==void 0)return E;k&&(n=n.slice(0,-1*k*2),a=a.slice(0,-1*k),o=o.slice(0,-1*k)),n.push(this.productions_[T[1]][0]),a.push(D.$),o.push(D._$),A=s[n[n.length-2]][n[n.length-1]],n.push(A);break;case 3:return!0}}return!0},`parse`)};we.lexer=(function(){return{EOF:1,parseError:r(function(e,t){if(this.yy.parser)this.yy.parser.parseError(e,t);else throw Error(e)},`parseError`),setInput:r(function(e,t){return this.yy=t||this.yy||{},this._input=e,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match=``,this.conditionStack=[`INITIAL`],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},`setInput`),input:r(function(){var e=this._input[0];return this.yytext+=e,this.yyleng++,this.offset++,this.match+=e,this.matched+=e,e.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),e},`input`),unput:r(function(e){var t=e.length,n=e.split(/(?:\r\n?|\n)/g);this._input=e+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-t),this.offset-=t;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-t},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-t]),this.yyleng=this.yytext.length,this},`unput`),more:r(function(){return this._more=!0,this},`more`),reject:r(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError(`Lexical error on line `+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
4
4
  `+this.showPosition(),{text:``,token:null,line:this.yylineno});return this},`reject`),less:r(function(e){this.unput(this.match.slice(e))},`less`),pastInput:r(function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(e.length>20?`...`:``)+e.substr(-20).replace(/\n/g,``)},`pastInput`),upcomingInput:r(function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(e.length>20?`...`:``)).replace(/\n/g,``)},`upcomingInput`),showPosition:r(function(){var e=this.pastInput(),t=Array(e.length+1).join(`-`);return e+this.upcomingInput()+`
@@ -0,0 +1 @@
1
+ import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{c as t,f as n,l as r,u as i}from"./useEvent-Dc9HkKI2.js";import{t as a}from"./react-CUdNIagt.js";import{$r as o,Ai as s,Bi as c,Bt as l,Cn as u,D as d,Gn as f,Ha as p,Hi as m,Ii as h,Ji as g,Ki as _,Kn as v,Li as y,M as b,Mi as x,P as S,Qr as C,Ri as w,Rn as T,Rt as E,Ui as D,Wa as O,Wi as k,Xi as A,Yi as j,Zi as M,_n as ee,c as N,fn as P,gn as F,i as I,jn as L,qi as R,qn as z,ro as te,ti as ne,to as B,yr as V,yt as H,zi as U}from"./cells-B3WiM6w3.js";import{t as W}from"./compiler-runtime-BQ9S8nyo.js";import{s as re}from"./config-BxZgoFvi.js";import{O as G}from"./config-DpGPGznL.js";import{t as K}from"./ErrorBoundary-BVJqkhwk.js";import{t as ie}from"./cn-ldLVeaqm.js";import{t as q}from"./jsx-runtime-B74pBk57.js";import{r as ae}from"./config-B4VJJibu.js";import{t as oe}from"./tooltip-DR2Z2N4w.js";import{r as se,t as ce}from"./button-BoklZTGL.js";import{t as le}from"./createLucideIcon-rHn2EdoM.js";import{i as J}from"./paths-CzfpItSz.js";import{r as ue}from"./useNumberFormatter-C4-_TnkF.js";import{R as de,j as fe}from"./RunButton-adYpTAaW.js";import{a as pe}from"./input-BDakodZ2.js";import{t as me}from"./copy-icon-DFhUGBjO.js";import{l as he}from"./arrays-BqUx5USx.js";import{i as ge}from"./strings-BHZPE0Mc.js";import{r as _e}from"./requests-yTHMxhVa.js";import{t as ve}from"./context-BFOBKCJB.js";import{n as ye}from"./useAsyncData-DucTwMkf.js";import{$t as be,An as xe,D as Se,Jt as Ce,Mn as we,Nn as Te,On as Ee,Qt as De,Sn as Oe,Xt as ke,Yt as Ae,Zt as je,_ as Me,_n as Ne,bn as Pe,da as Fe,in as Ie,jn as Le,k as Re,kn as ze,nn as Be,nr as Ve,vn as He,x as Ue,xn as We,yn as Ge}from"./index-D0aUt523.js";import{t as Ke}from"./empty-state-CzxjZqGW.js";import{n as qe,t as Je}from"./common-DBH2dPfd.js";import{a as Ye,i as Xe,n as Ze,o as Qe,r as $e,s as et,t as tt}from"./components-CuWdJDJ8.js";var nt=le(`square-equal`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M7 10h10`,key:`1101jm`}],[`path`,{d:`M7 14h10`,key:`1mhdw3`}]]),Y=W(),X=e(a(),1),Z=q(),rt=1;function it(e){return 1.75+e*rt}function at(e){return 3+e*rt}function ot(e){return 3.25+e*rt}var Q={engineEmpty:.75,engine:.75,database:1,tableLoading:2.75,tableSchemaless:2,columnLocal:1.25,columnPreview:2.5};function $(e){return{paddingLeft:`${e}rem`}}var st=n(e=>{let t=e(w),n=e(ne),r=e(I);return he(t,e=>{if(!e.variable_name)return-1;let t=Object.values(n).find(t=>t.name===e.variable_name);if(!t)return 0;let i=r.inOrderIds.indexOf(t.declaredBy[0]);return i===-1?0:i})}),ct=G(`marimo:datasources:hideEmpty`,!1,C,{getOnInit:!0});function lt(e){let t=!1,n=[];for(let r of e){if(!k(r)||!m(r)){n.push(r);continue}let e=r.child_schemas??[],i=lt(e);if(r.tables.length===0&&i.length===0){t=!0;continue}if(i===e){n.push(r);continue}t=!0,n.push({...r,child_schemas:i})}return t?n:e}function ut(e){let t=!1,n=[];for(let r of e){if(D(r)&&r.schemas.length===0){t=!0;continue}if(r.schemas.length===0){n.push(r);continue}let e=lt(r.schemas);if(e.length===0){t=!0;continue}if(e===r.schemas){n.push(r);continue}t=!0,n.push({...r,schemas:e})}return t?n:e}var dt=()=>{let e=(0,Y.c)(42),[n,a]=X.useState(``),[o,s]=t(ct),c=i(y),l=r(st),d=r(x),f;bb0:{if(!o){f=d;break bb0}let t,n;e[0]===d?(t=e[1],n=e[2]):(t=!1,n=d.map(e=>{let n=ut(e.databases);return n===e.databases?e:(t=!0,{...e,databases:n})}),e[0]=d,e[1]=t,e[2]=n),f=t?n:d}let p=f;if(l.length===0&&p.length===0){let t;return e[3]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,Z.jsx)(Ke,{title:`No tables found`,description:`Any datasets/dataframes in the global scope will be shown here.`,action:(0,Z.jsx)(Qe,{group:`database`,label:`Add database or catalog`,variant:`outline`,size:`sm`}),icon:(0,Z.jsx)(J,{})}),e[3]=t):t=e[3],t}let m;e[4]===n?m=e[5]:(m=n.trim(),e[4]=n,e[5]=m);let h=!!m,g;e[6]===c?g=e[7]:(g=e=>{c(e.length>0),a(e)},e[6]=c,e[7]=g);let _;e[8]!==n||e[9]!==g?(_=(0,Z.jsx)(F,{placeholder:`Search tables...`,className:`h-6 m-1`,value:n,onValueChange:g,rootClassName:`flex-1 border-r border-b-0`}),e[8]=n,e[9]=g,e[10]=_):_=e[10];let v;e[11]===h?v=e[12]:(v=h&&(0,Z.jsx)(`button`,{type:`button`,className:`float-right border-b px-2 m-0 h-full hover:bg-accent hover:text-accent-foreground`,onClick:()=>a(``),children:(0,Z.jsx)(ue,{className:`h-4 w-4`})}),e[11]=h,e[12]=v);let b=!o,S;e[13]!==o||e[14]!==s?(S=()=>s(!o),e[13]=o,e[14]=s,e[15]=S):S=e[15];let C;e[16]!==b||e[17]!==S?(C=(0,Z.jsx)(Ie,{"data-testid":`datasources-hide-empty-button`,isVisible:b,onToggle:S,showTooltip:`Show empty schemas and databases`,hideTooltip:`Hide empty schemas and databases`,size:`sm`,className:`px-2 rounded-none focus-visible:outline-hidden`}),e[16]=b,e[17]=S,e[18]=C):C=e[18];let w;e[19]===Symbol.for(`react.memo_cache_sentinel`)?(w=(0,Z.jsx)(Qe,{group:`database`,label:`Add database or catalog`,compact:!0,variant:`ghost`,size:`sm`,className:`px-2 rounded-none focus-visible:outline-hidden`}),e[19]=w):w=e[19];let T;e[20]!==_||e[21]!==v||e[22]!==C?(T=(0,Z.jsxs)(`div`,{className:`flex items-center w-full border-b`,children:[_,v,C,w]}),e[20]=_,e[21]=v,e[22]=C,e[23]=T):T=e[23];let E;if(e[24]!==p||e[25]!==n){let t;e[27]===n?t=e[28]:(t=e=>(0,Z.jsx)(ft,{connection:e,hasChildren:e.databases.length>0,children:e.databases.map(t=>(0,Z.jsx)(gt,{connection:e,database:t,searchValue:n},t.name))},e.name),e[27]=n,e[28]=t),E=p.map(t),e[24]=p,e[25]=n,e[26]=E}else E=e[26];let D;e[29]!==p.length||e[30]!==l.length?(D=p.length>0&&l.length>0&&(0,Z.jsxs)(Ae,{className:`pr-2`,style:$(Q.engine),children:[(0,Z.jsx)(Re,{className:`h-4 w-4 text-muted-foreground`}),(0,Z.jsx)(`span`,{className:`text-xs`,children:`Python`})]}),e[29]=p.length,e[30]=l.length,e[31]=D):D=e[31];let O;e[32]!==n||e[33]!==l?(O=l.length>0&&(0,Z.jsx)(bt,{tables:l,searchValue:n}),e[32]=n,e[33]=l,e[34]=O):O=e[34];let k;e[35]!==E||e[36]!==D||e[37]!==O?(k=(0,Z.jsxs)(u,{className:`flex flex-col`,children:[E,D,O]}),e[35]=E,e[36]=D,e[37]=O,e[38]=k):k=e[38];let A;return e[39]!==k||e[40]!==T?(A=(0,Z.jsxs)(P,{className:`border-b bg-background rounded-none h-full pb-10 overflow-auto outline-hidden`,shouldFilter:!1,children:[T,k]}),e[39]=k,e[40]=T,e[41]=A):A=e[41],A},ft=e=>{let t=(0,Y.c)(26),{connection:n,children:r,hasChildren:i}=e,a=n.name===M,o=a?`In-Memory`:n.name,{previewDataSourceConnection:c}=_e(),l;t[0]!==n.name||t[1]!==c?(l=async()=>{await c({engine:n.name})},t[0]=n.name,t[1]=c,t[2]=l):l=t[2];let u=l,d;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(d=$(Q.engine),t[3]=d):d=t[3];let f;t[4]===n.dialect?f=t[5]:(f=(0,Z.jsx)(L,{className:`h-4 w-4 text-muted-foreground`,name:n.dialect}),t[4]=n.dialect,t[5]=f);let p;t[6]===n.dialect?p=t[7]:(p=s(n.dialect),t[6]=n.dialect,t[7]=p);let m;t[8]===p?m=t[9]:(m=(0,Z.jsx)(`span`,{className:`text-xs`,children:p}),t[8]=p,t[9]=m);let h=o,g;t[10]===h?g=t[11]:(g=(0,Z.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[`(`,(0,Z.jsx)(et,{variableName:h}),`)`]}),t[10]=h,t[11]=g);let _;t[12]!==u||t[13]!==a?(_=!a&&(0,Z.jsx)(Be,{onClick:u,tooltip:`Refresh connection`,className:`ml-auto h-4 p-0`,iconClassName:`h-3.5 w-3.5`}),t[12]=u,t[13]=a,t[14]=_):_=t[14];let v;t[15]!==f||t[16]!==m||t[17]!==g||t[18]!==_?(v=(0,Z.jsxs)(Ae,{className:`pr-2`,style:d,children:[f,m,g,_]}),t[15]=f,t[16]=m,t[17]=g,t[18]=_,t[19]=v):v=t[19];let y;t[20]!==r||t[21]!==i?(y=i?r:(0,Z.jsx)(ke,{content:`No databases available`,style:$(Q.engineEmpty)}),t[20]=r,t[21]=i,t[22]=y):y=t[22];let b;return t[23]!==y||t[24]!==v?(b=(0,Z.jsxs)(Z.Fragment,{children:[v,y]}),t[23]=y,t[24]=v,t[25]=b):b=t[25],b},pt=X.createContext(null);function mt(){let e=X.useContext(pt);if(e==null)throw Error(`useDataSourceTree must be used within a DataSourceTreeContext.Provider`);return e}function ht(e,{schema:t,schemaPath:n}){return{engine:e.engineName,database:e.databaseName,schema:t,schemaPath:n,defaultSchema:e.defaultSchema,defaultDatabase:e.defaultDatabase,dialect:e.dialect}}var gt=e=>{let t=(0,Y.c)(21),{connection:n,database:r,searchValue:i}=e,a;t[0]!==n.default_database||t[1]!==n.default_schema||t[2]!==n.dialect||t[3]!==n.name||t[4]!==r.name||t[5]!==i?(a={engineName:n.name,databaseName:r.name,dialect:n.dialect,defaultSchema:n.default_schema,defaultDatabase:n.default_database,searchValue:i},t[0]=n.default_database,t[1]=n.default_schema,t[2]=n.dialect,t[3]=n.name,t[4]=r.name,t[5]=i,t[6]=a):a=t[6];let o=a,s=n.name,c=r.schemas,l;t[7]===r?l=t[8]:(l=D(r),t[7]=r,t[8]=l);let u;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(u=[],t[9]=u):u=t[9];let d;t[10]!==r.schemas||t[11]!==l?(d=(0,Z.jsx)(vt,{schemas:c,schemasResolved:l,schemaPath:u,depth:0}),t[10]=r.schemas,t[11]=l,t[12]=d):d=t[12];let f;t[13]!==d||t[14]!==o?(f=(0,Z.jsx)(pt.Provider,{value:o,children:d}),t[13]=d,t[14]=o,t[15]=f):f=t[15];let p;return t[16]!==n.name||t[17]!==r||t[18]!==i||t[19]!==f?(p=(0,Z.jsx)(_t,{engineName:s,database:r,searchValue:i,children:f}),t[16]=n.name,t[17]=r,t[18]=i,t[19]=f,t[20]=p):p=t[20],p},_t=e=>{let t=(0,Y.c)(29),{searchValue:n,engineName:r,database:i,children:a}=e,o;t[0]!==i||t[1]!==n?(o=g(i,n),t[0]=i,t[1]=n,t[2]=o):o=t[2];let s=o,[c,l]=X.useState(s),[u,d]=X.useState(!1),[f,p]=X.useState(n),[m,h]=X.useState(s);(f!==n||m!==s)&&(p(n),h(s),l(s));let _;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(_=$(Q.database),t[3]=_):_=t[3];let v;t[4]!==c||t[5]!==u?(v=()=>{l(!c),d(!u)},t[4]=c,t[5]=u,t[6]=v):v=t[6];let y=`${r}:${i.name}`,b;t[7]===c?b=t[8]:(b=(0,Z.jsx)(be,{isExpanded:c}),t[7]=c,t[8]=b);let x=u&&c?`text-foreground`:`text-muted-foreground`,S;t[9]===x?S=t[10]:(S=ie(`h-4 w-4`,x),t[9]=x,t[10]=S);let C;t[11]===S?C=t[12]:(C=(0,Z.jsx)(J,{className:S}),t[11]=S,t[12]=C);let w=u&&c&&`font-semibold`,T;t[13]===w?T=t[14]:(T=ie(w),t[13]=w,t[14]=T);let E;t[15]===i.name?E=t[16]:(E=i.name===``?(0,Z.jsx)(`i`,{children:`Not connected`}):i.name,t[15]=i.name,t[16]=E);let D;t[17]!==T||t[18]!==E?(D=(0,Z.jsx)(`span`,{className:T,children:E}),t[17]=T,t[18]=E,t[19]=D):D=t[19];let O;t[20]!==D||t[21]!==v||t[22]!==y||t[23]!==b||t[24]!==C?(O=(0,Z.jsxs)(ee,{className:`text-sm flex flex-row gap-1 items-center cursor-pointer rounded-none`,style:_,onSelect:v,value:y,children:[b,C,D]}),t[20]=D,t[21]=v,t[22]=y,t[23]=b,t[24]=C,t[25]=O):O=t[25];let k=c&&a,A;return t[26]!==O||t[27]!==k?(A=(0,Z.jsxs)(Z.Fragment,{children:[O,k]}),t[26]=O,t[27]=k,t[28]=A):A=t[28],A},vt=e=>{let{schemas:t,schemasResolved:n,depth:r}=e,i=mt(),{engineName:a,databaseName:o,searchValue:s}=i,{addSchemaList:c}=h(),l=Se(e.schemaPath),[u,d]=X.useState(!1),{isPending:p,error:m}=ye(async()=>{if(!n&&a){d(!0);try{let e=await f.request({engine:a,database:o,schemaPath:l});c({schemas:e.schemas??[],sqlSchemaContext:{engine:a,database:o,schemaPath:l}})}finally{d(!1)}}},[n,a,o,l]),g=$(it(r));return p||u?(0,Z.jsx)(De,{message:`Loading schemas...`,style:g}):m?(0,Z.jsx)(je,{error:m,style:g}):t.length===0?(0,Z.jsx)(ke,{content:`No schemas available`,style:g}):(0,Z.jsx)(Z.Fragment,{children:t.map(e=>_(e.name)?(0,Z.jsx)(bt,{tables:e.tables,tablesResolved:k(e),searchValue:s,sqlTableContext:ht(i,{schema:e.name,schemaPath:l})},e.name):(0,Z.jsx)(yt,{schema:e,schemaPath:[...l,e.name],depth:r},e.name))})},yt=e=>{let t=(0,Y.c)(41),{schema:n,schemaPath:r,depth:i}=e,a=mt(),{databaseName:o,searchValue:s}=a,c;t[0]!==n||t[1]!==s?(c=R(n,s),t[0]=n,t[1]=s,t[2]=c):c=t[2];let l=c,[u,d]=X.useState(l),[f,p]=X.useState(!1),[h,g]=X.useState(s),[_,v]=X.useState(l),y;t[3]===r?y=t[4]:(y=r.join(`.`),t[3]=r,t[4]=y);let b=`${o}:${y}`,x;t[5]===n.child_schemas?x=t[6]:(x=n.child_schemas??[],t[5]=n.child_schemas,t[6]=x);let S=x;(h!==s||_!==l)&&(g(s),v(l),d(l));let C;t[7]===i?C=t[8]:(C=$(it(i)),t[7]=i,t[8]=C);let w;t[9]!==u||t[10]!==f?(w=()=>{d(!u),p(!f)},t[9]=u,t[10]=f,t[11]=w):w=t[11];let T;t[12]===u?T=t[13]:(T=(0,Z.jsx)(be,{isExpanded:u}),t[12]=u,t[13]=T);let E=f&&u&&`text-foreground`,D;t[14]===E?D=t[15]:(D=ie(`h-4 w-4 text-muted-foreground`,E),t[14]=E,t[15]=D);let O;t[16]===D?O=t[17]:(O=(0,Z.jsx)(B,{className:D}),t[16]=D,t[17]=O);let A=f&&u&&`font-semibold`,j;t[18]===A?j=t[19]:(j=ie(A),t[18]=A,t[19]=j);let M;t[20]!==n.name||t[21]!==j?(M=(0,Z.jsx)(`span`,{className:j,children:n.name}),t[20]=n.name,t[21]=j,t[22]=M):M=t[22];let N;t[23]!==M||t[24]!==C||t[25]!==w||t[26]!==T||t[27]!==O||t[28]!==b?(N=(0,Z.jsxs)(ee,{className:`text-sm flex flex-row gap-1 items-center cursor-pointer rounded-none`,style:C,onSelect:w,value:b,children:[T,O,M]}),t[23]=M,t[24]=C,t[25]=w,t[26]=T,t[27]=O,t[28]=b,t[29]=N):N=t[29];let P;t[30]!==S||t[31]!==i||t[32]!==u||t[33]!==n||t[34]!==r||t[35]!==s||t[36]!==a?(P=u&&(0,Z.jsxs)(Z.Fragment,{children:[(S.length>0||!m(n))&&(0,Z.jsx)(vt,{schemas:S,schemasResolved:m(n),schemaPath:r,depth:i+1}),(0,Z.jsx)(bt,{tables:n.tables,tablesResolved:k(n),searchValue:s,tableIndentRem:at(i),columnIndentRem:ot(i),sqlTableContext:ht(a,{schema:n.name,schemaPath:r})})]}),t[30]=S,t[31]=i,t[32]=u,t[33]=n,t[34]=r,t[35]=s,t[36]=a,t[37]=P):P=t[37];let F;return t[38]!==N||t[39]!==P?(F=(0,Z.jsxs)(Z.Fragment,{children:[N,P]}),t[38]=N,t[39]=P,t[40]=F):F=t[40],F},bt=e=>{let t=(0,Y.c)(31),{tables:n,sqlTableContext:r,searchValue:i,tablesResolved:a,tableIndentRem:o,columnIndentRem:s}=e,c=a===void 0||a,{addTableList:l}=h(),[u,d]=X.useState(!1),f;t[0]!==l||t[1]!==r||t[2]!==c?(f=async()=>{if(!c&&r){d(!0);let{engine:e,database:t,schema:n,schemaPath:i}=r,a=await z.request({engine:e,database:t,schema:n,schemaPath:i??[]});if(!a?.tables)throw d(!1),Error(`No tables available`);l({tables:a.tables,sqlTableContext:r}),d(!1)}},t[0]=l,t[1]=r,t[2]=c,t[3]=f):f=t[3];let p;t[4]!==r||t[5]!==c?(p=[c,r],t[4]=r,t[5]=c,t[6]=p):p=t[6];let{isPending:m,error:g}=ye(f,p),_=o??Q.tableLoading,v;t[7]===_?v=t[8]:(v=$(_),t[7]=_,t[8]=v);let y=v;if(m||u){let e;return t[9]===y?e=t[10]:(e=(0,Z.jsx)(De,{message:`Loading tables...`,style:y}),t[9]=y,t[10]=e),e}if(g){let e;return t[11]!==g||t[12]!==y?(e=(0,Z.jsx)(je,{error:g,style:y}),t[11]=g,t[12]=y,t[13]=e):e=t[13],e}if(n.length===0){let e;return t[14]===y?e=t[15]:(e=(0,Z.jsx)(ke,{content:`No tables found`,style:y}),t[14]=y,t[15]=e),e}let b;if(t[16]!==s||t[17]!==i||t[18]!==r||t[19]!==o||t[20]!==n){let e;t[22]===i?e=t[23]:(e=e=>!i||e.name.toLowerCase().includes(i.toLowerCase()),t[22]=i,t[23]=e);let a=n.filter(e),c;t[24]!==s||t[25]!==i||t[26]!==r||t[27]!==o?(c=e=>(0,Z.jsx)(xt,{table:e,sqlTableContext:r,isSearching:!!i,tableIndentRem:o,columnIndentRem:s},e.name),t[24]=s,t[25]=i,t[26]=r,t[27]=o,t[28]=c):c=t[28],b=a.map(c),t[16]=s,t[17]=i,t[18]=r,t[19]=o,t[20]=n,t[21]=b}else b=t[21];let x;return t[29]===b?x=t[30]:(x=(0,Z.jsx)(Z.Fragment,{children:b}),t[29]=b,t[30]=x),x},xt=e=>{let t=(0,Y.c)(69),{table:n,sqlTableContext:i,isSearching:a,tableIndentRem:o,columnIndentRem:s}=e,{addTable:c}=h(),[u,f]=X.useState(!1),p=n.columns.length>0,m;t[0]!==c||t[1]!==u||t[2]!==i||t[3]!==n.name||t[4]!==p?(m=async()=>{if(u&&!p&&i){let{engine:e,database:t,schema:r,schemaPath:a}=i,o=await v.request({engine:e,database:t,schema:r,tableName:n.name,schemaPath:a??[]});if(!o?.table)throw Error(`No table details available`);c({table:o.table,sqlTableContext:i})}},t[0]=c,t[1]=u,t[2]=i,t[3]=n.name,t[4]=p,t[5]=m):m=t[5];let g;t[6]!==u||t[7]!==p?(g=[u,p],t[6]=u,t[7]=p,t[8]=g):g=t[8];let{isFetching:_,isPending:y,error:b}=ye(m,g),x=r(re),S=E(),{createNewCell:C}=d(),w=Ue(),T;t[9]!==w||t[10]!==x||t[11]!==C||t[12]!==S||t[13]!==i||t[14]!==n?(T=()=>{l({autoInstantiate:x,createNewCell:C,fromCellId:S}),w((()=>{if(n.source_type===`catalog`){let e=i?.database?[i.database,...i.schemaPath??[],n.name].join(`.`):n.name;return`${n.engine}.load_table("${e}")`}if(i)return j({table:n,columnName:`*`,sqlTableContext:i});switch(n.source_type){case`local`:return`mo.ui.table(${n.name})`;case`duckdb`:case`connection`:return j({table:n,columnName:`*`,sqlTableContext:i});default:return ge(n.source_type),``}})())},t[9]=w,t[10]=x,t[11]=C,t[12]=S,t[13]=i,t[14]=n,t[15]=T):T=t[15];let D=T,k;t[16]!==n.num_columns||t[17]!==n.num_rows?(k=()=>{let e=[];return n.num_rows!=null&&e.push(`${n.num_rows} rows`),n.num_columns!=null&&e.push(`${n.num_columns} columns`),e.length===0?null:(0,Z.jsx)(`div`,{className:`flex flex-row gap-2 items-center pl-6 group-hover:hidden`,children:(0,Z.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:e.join(`, `)})})},t[16]=n.num_columns,t[17]=n.num_rows,t[18]=k):k=t[18];let M=k,N;t[19]!==s||t[20]!==b||t[21]!==_||t[22]!==y||t[23]!==i||t[24]!==n?(N=()=>{let e=$(s??Q.tableLoading);if(y||_)return(0,Z.jsx)(De,{message:`Loading columns...`,style:e});if(b)return(0,Z.jsx)(je,{error:b,style:e});let t=n.columns;return t.length===0?(0,Z.jsx)(ke,{content:`No columns found`,style:e}):t.map(e=>(0,Z.jsx)(St,{table:n,column:e,sqlTableContext:i,columnIndentRem:s},e.name))},t[19]=s,t[20]=b,t[21]=_,t[22]=y,t[23]=i,t[24]=n,t[25]=N):N=t[25];let P=N,F;t[26]!==u||t[27]!==a||t[28]!==n.source_type||t[29]!==n.type?(F=()=>{if(n.source_type===`local`)return;let e=n.type===`table`?O:te;return(0,Z.jsx)(e,{className:`h-3 w-3`,strokeWidth:u||a?2.5:void 0})},t[26]=u,t[27]=a,t[28]=n.source_type,t[29]=n.type,t[30]=F):F=t[30];let I=F,L;t[31]!==i||t[32]!==n.name?(L=A(i,n.name),t[31]=i,t[32]=n.name,t[33]=L):L=t[33];let R=L,z=o??(i?Q.tableSchemaless:0),ne=(u||a)&&`font-semibold`,B;t[34]===ne?B=t[35]:(B=ie(`rounded-none group h-8 cursor-pointer`,ne),t[34]=ne,t[35]=B);let V;t[36]===z?V=t[37]:(V=$(z),t[36]=z,t[37]=V);let H;t[38]===u?H=t[39]:(H=()=>f(!u),t[38]=u,t[39]=H);let U;t[40]===I?U=t[41]:(U=I(),t[40]=I,t[41]=U);let W;t[42]===n.name?W=t[43]:(W=(0,Z.jsx)(`span`,{className:`text-sm`,children:n.name}),t[42]=n.name,t[43]=W);let G;t[44]!==U||t[45]!==W?(G=(0,Z.jsxs)(`div`,{className:`flex gap-2 items-center flex-1 pl-1`,children:[U,W]}),t[44]=U,t[45]=W,t[46]=G):G=t[46];let K;t[47]===M?K=t[48]:(K=M(),t[47]=M,t[48]=K);let q;t[49]===D?q=t[50]:(q=se.stopPropagation(()=>D()),t[49]=D,t[50]=q);let ae;t[51]===Symbol.for(`react.memo_cache_sentinel`)?(ae=(0,Z.jsx)(Fe,{className:`h-3 w-3`}),t[51]=ae):ae=t[51];let le;t[52]===q?le=t[53]:(le=(0,Z.jsx)(oe,{content:`Add table to notebook`,delayDuration:400,children:(0,Z.jsx)(ce,{className:`group-hover:inline-flex hidden`,variant:`text`,size:`icon`,onClick:q,children:ae})}),t[52]=q,t[53]=le);let J;t[54]!==u||t[55]!==V||t[56]!==H||t[57]!==G||t[58]!==K||t[59]!==le||t[60]!==B||t[61]!==R?(J=(0,Z.jsxs)(ee,{className:B,style:V,value:R,"aria-selected":u,forceMount:!0,onSelect:H,children:[G,K,le]}),t[54]=u,t[55]=V,t[56]=H,t[57]=G,t[58]=K,t[59]=le,t[60]=B,t[61]=R,t[62]=J):J=t[62];let ue;t[63]!==u||t[64]!==P?(ue=u&&P(),t[63]=u,t[64]=P,t[65]=ue):ue=t[65];let de;return t[66]!==J||t[67]!==ue?(de=(0,Z.jsxs)(Z.Fragment,{children:[J,ue]}),t[66]=J,t[67]=ue,t[68]=de):de=t[68],de},St=e=>{let t=(0,Y.c)(51),{table:n,column:a,sqlTableContext:o,columnIndentRem:s}=e,[l,u]=X.useState(!1),d=r(y),f=i(U);d&&l&&u(!1),f(l?e=>new Set([...e,`${n.name}:${a.name}`]):e=>(e.delete(`${n.name}:${a.name}`),new Set(e)));let p=Ue(),{columnsPreviews:m}=c(),h;t[0]!==a.name||t[1]!==n.primary_keys?(h=n.primary_keys?.includes(a.name)||!1,t[0]=a.name,t[1]=n.primary_keys,t[2]=h):h=t[2];let g=h,_;t[3]!==a.name||t[4]!==n.indexes?(_=n.indexes?.includes(a.name)||!1,t[3]=a.name,t[4]=n.indexes,t[5]=_):_=t[5];let v=_,b;t[6]===p?b=t[7]:(b=e=>{p(e)},t[6]=p,t[7]=b);let x=b,S=Ct,C=l?`font-semibold`:``,w;t[8]!==a.name||t[9]!==C?(w=(0,Z.jsx)(`span`,{className:C,children:a.name}),t[8]=a.name,t[9]=C,t[10]=w):w=t[10];let T=w,E=`${n.name}.${a.name}`,D=`${n.name}.${a.name}`,O;t[11]===l?O=t[12]:(O=()=>u(!l),t[11]=l,t[12]=O);let k;t[13]!==s||t[14]!==o?(k=s??(o?ot(0):Q.columnLocal),t[13]=s,t[14]=o,t[15]=k):k=t[15];let A;t[16]===k?A=t[17]:(A=$(k),t[16]=k,t[17]=A);let j;t[18]!==a.type||t[19]!==T?(j=(0,Z.jsx)(Ce,{columnName:T,dataType:a.type}),t[18]=a.type,t[19]=T,t[20]=j):j=t[20];let M;t[21]===g?M=t[22]:(M=g&&S({tooltipContent:`Primary key`,content:`PK`}),t[21]=g,t[22]=M);let N;t[23]===v?N=t[24]:(N=v&&S({tooltipContent:`Indexed`,content:`IDX`}),t[23]=v,t[24]=N);let P;t[25]!==A||t[26]!==j||t[27]!==M||t[28]!==N?(P=(0,Z.jsxs)(`div`,{className:`flex flex-row gap-2 items-center flex-1`,style:A,children:[j,M,N]}),t[25]=A,t[26]=j,t[27]=M,t[28]=N,t[29]=P):P=t[29];let F;t[30]===a.name?F=t[31]:(F=(0,Z.jsx)(oe,{content:`Copy column name`,delayDuration:400,children:(0,Z.jsx)(ce,{variant:`text`,size:`icon`,className:`group-hover:opacity-100 opacity-0 hover:bg-muted text-muted-foreground hover:text-foreground`,children:(0,Z.jsx)(me,{tooltip:!1,value:a.name,className:`h-3 w-3`})})}),t[30]=a.name,t[31]=F);let I;t[32]===a.external_type?I=t[33]:(I=(0,Z.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:a.external_type}),t[32]=a.external_type,t[33]=I);let L;t[34]!==P||t[35]!==F||t[36]!==I||t[37]!==E||t[38]!==D||t[39]!==O?(L=(0,Z.jsxs)(ee,{className:`rounded-none py-1 group cursor-pointer`,value:D,onSelect:O,children:[P,F,I]},E),t[34]=P,t[35]=F,t[36]=I,t[37]=E,t[38]=D,t[39]=O,t[40]=L):L=t[40];let R;t[41]!==a||t[42]!==m||t[43]!==x||t[44]!==l||t[45]!==o||t[46]!==n?(R=l&&(0,Z.jsx)(`div`,{className:`pr-2 py-2 bg-(--slate-1) shadow-inner border-b`,style:$(Q.columnPreview),children:(0,Z.jsx)(K,{children:(0,Z.jsx)(Me,{table:n,column:a,onAddColumnChart:x,preview:m.get(o?`${o.database}.${o.schema}.${n.name}:${a.name}`:`${n.name}:${a.name}`),sqlTableContext:o})})}),t[41]=a,t[42]=m,t[43]=x,t[44]=l,t[45]=o,t[46]=n,t[47]=R):R=t[47];let z;return t[48]!==L||t[49]!==R?(z=(0,Z.jsxs)(Z.Fragment,{children:[L,R]}),t[48]=L,t[49]=R,t[50]=z):z=t[50],z};function Ct(e){let{tooltipContent:t,content:n}=e;return(0,Z.jsx)(oe,{content:t,delayDuration:100,children:(0,Z.jsx)(`span`,{className:`text-xs text-black bg-gray-100 dark:invert rounded px-1`,children:n})})}function wt(e){return e}var Tt={name:`name`,type:`type-value`,defs:`defs-refs`},Et=[wt({id:Tt.name,accessorFn:e=>[e.name,e.declaredBy],enableSorting:!0,sortingFn:`alphanumeric`,header:({column:e})=>(0,Z.jsx)(Ee,{header:`Name`,column:e}),cell:({getValue:e})=>{let[t,n]=e();return(0,Z.jsx)(Je,{name:t,declaredBy:n})}}),wt({id:Tt.type,accessorFn:e=>[e.dataType,e.value],enableSorting:!0,sortingFn:`alphanumeric`,header:({column:e})=>(0,Z.jsx)(Ee,{header:(0,Z.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,Z.jsx)(`span`,{children:`Type`}),(0,Z.jsx)(`span`,{children:`Value`})]}),column:e}),cell:({getValue:e})=>{let[t,n]=e();return(0,Z.jsxs)(`div`,{className:`max-w-[150px]`,children:[(0,Z.jsx)(`div`,{className:`text-ellipsis overflow-hidden whitespace-nowrap text-muted-foreground font-mono text-xs`,children:t}),(0,Z.jsx)(`div`,{className:`text-ellipsis overflow-hidden whitespace-nowrap`,title:n??``,children:n})]})}}),wt({id:Tt.defs,accessorFn:e=>[e.declaredBy,e.usedBy,e.name,e.declaredByNames,e.usedByNames],enableSorting:!0,sortingFn:`basic`,header:({column:e})=>(0,Z.jsx)(Ee,{header:(0,Z.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,Z.jsx)(`span`,{children:`Declared By`}),(0,Z.jsx)(`span`,{children:`Used By`})]}),column:e}),cell:({getValue:e})=>{let[t,n,r]=e(),i=e=>{let t=N(e);t&&V(t,r)};return(0,Z.jsxs)(`div`,{className:`flex flex-col gap-1 py-1`,children:[(0,Z.jsxs)(`div`,{className:`flex flex-row overflow-auto gap-2 items-center`,children:[(0,Z.jsx)(`span`,{title:`Declared by`,children:(0,Z.jsx)(nt,{className:`w-3.5 h-3.5 text-muted-foreground`})}),t.length===1?(0,Z.jsx)(Ve,{variant:`focus`,cellId:t[0],skipScroll:!0,onClick:()=>i(t[0])}):(0,Z.jsx)(`div`,{className:`text-destructive flex flex-row gap-2`,children:t.slice(0,3).map((e,n)=>(0,Z.jsxs)(`span`,{className:`flex`,children:[(0,Z.jsx)(Ve,{variant:`focus`,cellId:e,skipScroll:!0,className:`whitespace-nowrap text-destructive`,onClick:()=>i(e)},e),n<t.length-1&&`, `]},e))})]}),(0,Z.jsxs)(`div`,{className:`flex flex-row overflow-auto gap-2 items-baseline`,children:[(0,Z.jsx)(`span`,{title:`Used by`,children:(0,Z.jsx)(de,{className:`w-3.5 h-3.5 text-muted-foreground`})}),(0,Z.jsx)(qe,{maxCount:3,cellIds:n,skipScroll:!0,onClick:i})]})]})}})];function Dt({variables:e,sort:t,cellIdToIndex:n}){t||={id:Tt.defs,desc:!1};let r=[];switch(t.id){case Tt.name:r=he(e,e=>e.name);break;case Tt.type:r=he(e,e=>e.dataType);break;case Tt.defs:r=he(e,e=>n.get(e.declaredBy[0]))}return t.desc?r.toReversed():r}var Ot=(0,X.memo)(({className:e,cellIds:t,variables:n})=>{let[r,i]=X.useState([]),[a,o]=X.useState(``),s=S(),{locale:c}=ve(),l=(0,X.useMemo)(()=>{let e=e=>{let n=s[e];return T(n)?`cell-${t.indexOf(e)}`:n??`cell-${t.indexOf(e)}`};return Object.values(n).map(t=>({...t,declaredByNames:t.declaredBy.map(e),usedByNames:t.usedBy.map(e)}))},[n,s,t]),u=(0,X.useMemo)(()=>{let e=new Map;return t.forEach((t,n)=>e.set(t,n)),Dt({variables:l,sort:r[0],cellIdToIndex:e})},[l,r,t]),d=xe({data:u,columns:Et,getCoreRowModel:Le(),onGlobalFilterChange:o,getFilteredRowModel:we(),enableFilters:!0,enableGlobalFilter:!0,enableColumnPinning:!1,getColumnCanGlobalFilter(e){return e.columnDef.enableGlobalFilter??!0},globalFilterFn:`auto`,manualSorting:!0,locale:c,onSortingChange:i,getSortedRowModel:Te(),state:{sorting:r,globalFilter:a}});return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(pe,{className:`w-full`,placeholder:`Search`,value:a,onChange:e=>o(e.target.value)}),(0,Z.jsxs)(Ne,{className:ie(`w-full text-sm flex-1 border-separate border-spacing-0`,e),children:[(0,Z.jsx)(We,{children:(0,Z.jsx)(Oe,{className:`whitespace-nowrap text-xs`,children:d.getFlatHeaders().map(e=>(0,Z.jsx)(Pe,{className:`sticky top-0 bg-background border-b`,children:ze(e.column.columnDef.header,e.getContext())},e.id))})}),(0,Z.jsx)(He,{children:d.getRowModel().rows.map(e=>(0,Z.jsx)(Oe,{className:`hover:bg-accent`,children:e.getVisibleCells().map(e=>(0,Z.jsx)(Ge,{className:`border-b`,children:ze(e.column.columnDef.cell,e.getContext())},e.id))},e.id))})]})]})});Ot.displayName=`VariableTable`;var kt=()=>{let e=(0,Y.c)(30),n=o(),i=b(),a=r(w),s=r(x),c=H(`database`),[l,u]=t(fe),d=a.length+s.length,f;e[0]!==d||e[1]!==l.hasUserInteracted||e[2]!==l.openSections?(f=!l.hasUserInteracted&&d>0?[...new Set([...l.openSections,`datasources`])]:l.openSections,e[0]=d,e[1]=l.hasUserInteracted,e[2]=l.openSections,e[3]=f):f=e[3];let m=f,h;e[4]===u?h=e[5]:(h=e=>{u({openSections:e,hasUserInteracted:!0})},e[4]=u,e[5]=h);let g=h,_;e[6]===m?_=e[7]:(_=m.includes(`datasources`),e[6]=m,e[7]=_);let v=!_&&d>0,y=c.length>0,S;e[8]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,Z.jsx)(J,{className:`w-4 h-4`}),e[8]=S):S=e[8];let C;e[9]!==d||e[10]!==v?(C=v&&(0,Z.jsx)(Ye,{children:d}),e[9]=d,e[10]=v,e[11]=C):C=e[11];let T;e[12]!==c.length||e[13]!==y?(T=y&&(0,Z.jsx)(tt,{count:c.length,type:`database`}),e[12]=c.length,e[13]=y,e[14]=T):T=e[14];let E;e[15]!==C||e[16]!==T?(E=(0,Z.jsxs)(Xe,{children:[S,`Data sources`,C,T]}),e[15]=C,e[16]=T,e[17]=E):E=e[17];let D;e[18]===Symbol.for(`react.memo_cache_sentinel`)?(D=(0,Z.jsx)(Ze,{children:(0,Z.jsx)(dt,{})}),e[18]=D):D=e[18];let O;e[19]===E?O=e[20]:(O=(0,Z.jsxs)($e,{value:`datasources`,children:[E,D]}),e[19]=E,e[20]=O);let k;e[21]===Symbol.for(`react.memo_cache_sentinel`)?(k=(0,Z.jsxs)(Xe,{children:[(0,Z.jsx)(p,{className:`w-4 h-4`}),`Variables`]}),e[21]=k):k=e[21];let A;e[22]!==i||e[23]!==n?(A=(0,Z.jsxs)($e,{value:`variables`,lastItem:!0,children:[k,(0,Z.jsx)(Ze,{children:Object.keys(n).length===0?(0,Z.jsx)(`div`,{className:`px-3 py-4 text-sm text-muted-foreground`,children:`No variables defined`}):(0,Z.jsx)(Ot,{cellIds:i.inOrderIds,variables:n})})]}),e[22]=i,e[23]=n,e[24]=A):A=e[24];let j;return e[25]!==g||e[26]!==m||e[27]!==A||e[28]!==O?(j=(0,Z.jsxs)(ae,{type:`multiple`,value:m,onValueChange:g,className:`flex flex-col h-full overflow-auto`,children:[O,A]}),e[25]=g,e[26]=m,e[27]=A,e[28]=O,e[29]=j):j=e[29],j};export{kt as default};
@@ -1 +1 @@
1
- import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{t}from"./react-CUdNIagt.js";import{Cn as n,D as r,Rt as i,_n as a,fn as o,gn as s,mn as c}from"./cells-B3WiM6w3.js";import{t as l}from"./compiler-runtime-BQ9S8nyo.js";import{n as u}from"./useEventListener-BdZUApHd.js";import{r as d}from"./utils-B4K466FK.js";import{t as f}from"./cn-ldLVeaqm.js";import{t as p}from"./jsx-runtime-B74pBk57.js";import{t as m}from"./tooltip-DR2Z2N4w.js";import{t as h}from"./button-BoklZTGL.js";import{m as g}from"./panels-Bso8csB-.js";import{n as _,t as v}from"./LazyAnyLanguageCodeMirror-D38yVMV5.js";import{r as y}from"./useNumberFormatter-C4-_TnkF.js";import{b}from"./write-secret-modal-BiG2tahJ.js";import{t as x}from"./plus-gbN72xHe.js";import{Gt as S,Kt as C,Wt as w,Xt as T,qt as E}from"./input-BDakodZ2.js";import{st as D}from"./dist-BczecT6V.js";import{r as O}from"./requests-yTHMxhVa.js";import{r as k}from"./useTheme-DcnXlv0_.js";import{n as A}from"./useAsyncData-DucTwMkf.js";import{Hn as j,Oi as M,ei as N,gn as P,hn as F,mn as I}from"./index-BGA2MQ61.js";import{t as L}from"./empty-state-CzxjZqGW.js";import{n as R,r as z}from"./panel-context-BPaQeOuV.js";import{i as B}from"./edit-page-DPhd7_gi.js";var V=e(t(),1),H=l(),U=p(),W=u,G=e=>{let t=(0,H.c)(6),{children:n}=e,{openModal:r,closeModal:i}=b(),a;t[0]!==i||t[1]!==r?(a=()=>r((0,U.jsx)(K,{onClose:i})),t[0]=i,t[1]=r,t[2]=a):a=t[2];let o;return t[3]!==n||t[4]!==a?(o=(0,U.jsx)(W,{onClick:a,children:n}),t[3]=n,t[4]=a,t[5]=o):o=t[5],o},K=e=>{let t=(0,H.c)(4),{onClose:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,U.jsx)(T,{children:`Contribute a Snippet`}),t[0]=r):r=t[0];let i;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,U.jsxs)(E,{children:[r,(0,U.jsxs)(S,{children:[`Have a useful snippet you want to share with the community? Make a pull request`,` `,(0,U.jsx)(`a`,{href:d.githubPage,target:`_blank`,rel:`noreferrer`,className:`underline`,children:`on GitHub`}),`.`]})]}),t[1]=i):i=t[1];let a;return t[2]===n?a=t[3]:(a=(0,U.jsxs)(w,{className:`max-w-md`,children:[i,(0,U.jsx)(C,{children:(0,U.jsx)(h,{"data-testid":`snippet-close-button`,variant:`default`,onClick:n,children:`Close`})})]}),t[2]=n,t[3]=a),a},q=[D.lineWrapping],J=()=>{let e=(0,H.c)(24),{readSnippets:t}=O(),[n,r]=V.useState(),i=R(),a=z(),l;e[0]===t?l=e[1]:(l=()=>t(),e[0]=t,e[1]=l);let u;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(u=[],e[2]=u):u=e[2];let{data:d,error:p,isPending:m}=A(l,u);if(p){let t;return e[3]===p?t=e[4]:(t=(0,U.jsx)(j,{error:p}),e[3]=p,e[4]=t),t}if(m||!d){let t;return e[5]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,U.jsx)(N,{size:`medium`,centered:!0}),e[5]=t):t=e[5],t}let h=i===`vertical`,g;e[6]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,U.jsx)(s,{placeholder:`Search snippets...`,className:`h-6 m-1`,rootClassName:`flex-1 border-r`}),e[6]=g):g=e[6];let _,v;e[7]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,U.jsxs)(`div`,{className:`flex items-center w-full border-b`,children:[g,(0,U.jsx)(G,{children:(0,U.jsx)(`button`,{className:`float-right px-2 m-0 h-full hover:bg-accent hover:text-accent-foreground`,children:(0,U.jsx)(x,{className:`h-4 w-4`})})})]}),v=(0,U.jsx)(c,{children:`No results`}),e[7]=_,e[8]=v):(_=e[7],v=e[8]);let y;e[9]===Symbol.for(`react.memo_cache_sentinel`)?(y=e=>r(e),e[9]=y):y=e[9];let b;e[10]===d.snippets?b=e[11]:(b=(0,U.jsx)(I,{defaultSize:40,minSize:20,maxSize:70,children:(0,U.jsxs)(o,{className:`h-full rounded-none`,children:[_,v,(0,U.jsx)(X,{onSelect:y,snippets:d.snippets})]})}),e[10]=d.snippets,e[11]=b);let S=h?`h-1`:`w-1`,C;e[12]===S?C=e[13]:(C=f(`bg-border hover:bg-primary/50 transition-colors`,S),e[12]=S,e[13]=C);let w;e[14]===C?w=e[15]:(w=(0,U.jsx)(P,{className:C}),e[14]=C,e[15]=w);let T;e[16]===n?T=e[17]:(T=(0,U.jsx)(I,{defaultSize:60,minSize:20,children:(0,U.jsx)(V.Suspense,{children:(0,U.jsx)(`div`,{className:`h-full snippet-viewer flex flex-col overflow-hidden`,children:n?(0,U.jsx)(Y,{snippet:n,onClose:()=>r(void 0)},n.title):(0,U.jsx)(L,{title:``,description:`Click on a snippet to view its content.`})})})}),e[16]=n,e[17]=T);let E;return e[18]!==i||e[19]!==a||e[20]!==T||e[21]!==b||e[22]!==w?(E=(0,U.jsx)(`div`,{className:`flex-1 overflow-hidden h-full`,children:(0,U.jsxs)(F,{direction:i,className:`h-full`,children:[b,w,T]},a)}),e[18]=i,e[19]=a,e[20]=T,e[21]=b,e[22]=w,e[23]=E):E=e[23],E},Y=e=>{let t=(0,H.c)(33),{snippet:n,onClose:a}=e,{theme:o}=k(),{createNewCell:s}=r(),c=i(),l;t[0]!==s||t[1]!==c||t[2]!==n.sections?(l=()=>{for(let e of n.sections.toReversed())e.code&&s({code:e.code,before:!1,cellId:c??`__end__`,skipIfCodeExists:!0})},t[0]=s,t[1]=c,t[2]=n.sections,t[3]=l):l=t[3];let u=l,d;t[4]!==s||t[5]!==c?(d=e=>{s({code:e,before:!1,cellId:c??`__end__`})},t[4]=s,t[5]=c,t[6]=d):d=t[6];let f=d,p;t[7]===n.title?p=t[8]:(p=(0,U.jsx)(`span`,{children:n.title}),t[7]=n.title,t[8]=p);let b;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(b=(0,U.jsx)(y,{className:`h-4 w-4`}),t[9]=b):b=t[9];let x;t[10]===a?x=t[11]:(x=(0,U.jsx)(h,{size:`sm`,variant:`ghost`,onClick:a,className:`h-6 w-6 p-0 hover:bg-muted-foreground/10`,children:b}),t[10]=a,t[11]=x);let S;t[12]!==p||t[13]!==x?(S=(0,U.jsxs)(`div`,{className:`text-sm font-semibold bg-muted border-y px-2 py-1 flex justify-between items-center`,children:[p,x]}),t[12]=p,t[13]=x,t[14]=S):S=t[14];let C;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(C=(0,U.jsx)(_,{className:`ml-2 h-4 w-4`}),t[15]=C):C=t[15];let w;t[16]===u?w=t[17]:(w=(0,U.jsx)(`div`,{className:`flex justify-end`,children:(0,U.jsx)(B,{children:(0,U.jsxs)(h,{className:`float-right`,size:`xs`,variant:`outline`,onClick:u,children:[`Insert snippet`,C]})})}),t[16]=u,t[17]=w);let T;if(t[18]!==f||t[19]!==n.sections||t[20]!==n.title||t[21]!==o){let e;t[23]!==f||t[24]!==n.title||t[25]!==o?(e=e=>{let{code:t,html:r,id:i}=e;if(r)return(0,U.jsx)(`div`,{children:M({html:r})},`${n.title}-${i}`);if(!t)return null;let{language:a,code:s}=g(t);return(0,U.jsxs)(`div`,{className:`relative hover-actions-parent pr-2`,children:[(0,U.jsx)(B,{children:(0,U.jsx)(m,{content:`Insert snippet`,children:(0,U.jsx)(h,{className:`absolute -top-2 -right-1 z-10 hover-action px-2 bg-background`,size:`sm`,variant:`outline`,onClick:()=>{f(t)},children:(0,U.jsx)(_,{className:`h-5 w-5`})})})}),(0,U.jsx)(V.Suspense,{children:(0,U.jsx)(v,{theme:o===`dark`?`dark`:`light`,language:a,className:`cm border rounded overflow-hidden`,extensions:q,value:s,readOnly:!0},`${n.title}-${i}`)})]},`${n.title}-${i}`)},t[23]=f,t[24]=n.title,t[25]=o,t[26]=e):e=t[26],T=n.sections.map(e),t[18]=f,t[19]=n.sections,t[20]=n.title,t[21]=o,t[22]=T}else T=t[22];let E;t[27]!==w||t[28]!==T?(E=(0,U.jsxs)(`div`,{className:`px-2 py-2 space-y-4 overflow-auto flex-1`,children:[w,T]}),t[27]=w,t[28]=T,t[29]=E):E=t[29];let D;return t[30]!==E||t[31]!==S?(D=(0,U.jsxs)(U.Fragment,{children:[S,E]}),t[30]=E,t[31]=S,t[32]=D):D=t[32],D},X=e=>{let t=(0,H.c)(7),{snippets:r,onSelect:i}=e,o;if(t[0]!==i||t[1]!==r){let e;t[3]===i?e=t[4]:(e=e=>(0,U.jsx)(a,{className:`rounded-none`,onSelect:()=>i(e),children:(0,U.jsx)(`div`,{className:`flex flex-row gap-2 items-center`,children:(0,U.jsx)(`span`,{className:`mt-1 text-accent-foreground`,children:e.title})})},e.title),t[3]=i,t[4]=e),o=r.map(e),t[0]=i,t[1]=r,t[2]=o}else o=t[2];let s;return t[5]===o?s=t[6]:(s=(0,U.jsx)(n,{className:`flex flex-col overflow-auto`,children:o}),t[5]=o,t[6]=s),s};export{J as default};
1
+ import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{t}from"./react-CUdNIagt.js";import{Cn as n,D as r,Rt as i,_n as a,fn as o,gn as s,mn as c}from"./cells-B3WiM6w3.js";import{t as l}from"./compiler-runtime-BQ9S8nyo.js";import{n as u}from"./useEventListener-BdZUApHd.js";import{r as d}from"./utils-B4K466FK.js";import{t as f}from"./cn-ldLVeaqm.js";import{t as p}from"./jsx-runtime-B74pBk57.js";import{t as m}from"./tooltip-DR2Z2N4w.js";import{t as h}from"./button-BoklZTGL.js";import{m as g}from"./panels-14vO4F3h.js";import{n as _,t as v}from"./LazyAnyLanguageCodeMirror-BqNgl9tZ.js";import{r as y}from"./useNumberFormatter-C4-_TnkF.js";import{b}from"./write-secret-modal-BiG2tahJ.js";import{t as x}from"./plus-gbN72xHe.js";import{Gt as S,Kt as C,Wt as w,Xt as T,qt as E}from"./input-BDakodZ2.js";import{st as D}from"./dist-BczecT6V.js";import{r as O}from"./requests-yTHMxhVa.js";import{r as k}from"./useTheme-DcnXlv0_.js";import{n as A}from"./useAsyncData-DucTwMkf.js";import{Hn as j,Oi as M,ei as N,gn as P,hn as F,mn as I}from"./index-D0aUt523.js";import{t as L}from"./empty-state-CzxjZqGW.js";import{n as R,r as z}from"./panel-context-BPaQeOuV.js";import{i as B}from"./edit-page-5BoxMdRg.js";var V=e(t(),1),H=l(),U=p(),W=u,G=e=>{let t=(0,H.c)(6),{children:n}=e,{openModal:r,closeModal:i}=b(),a;t[0]!==i||t[1]!==r?(a=()=>r((0,U.jsx)(K,{onClose:i})),t[0]=i,t[1]=r,t[2]=a):a=t[2];let o;return t[3]!==n||t[4]!==a?(o=(0,U.jsx)(W,{onClick:a,children:n}),t[3]=n,t[4]=a,t[5]=o):o=t[5],o},K=e=>{let t=(0,H.c)(4),{onClose:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,U.jsx)(T,{children:`Contribute a Snippet`}),t[0]=r):r=t[0];let i;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,U.jsxs)(E,{children:[r,(0,U.jsxs)(S,{children:[`Have a useful snippet you want to share with the community? Make a pull request`,` `,(0,U.jsx)(`a`,{href:d.githubPage,target:`_blank`,rel:`noreferrer`,className:`underline`,children:`on GitHub`}),`.`]})]}),t[1]=i):i=t[1];let a;return t[2]===n?a=t[3]:(a=(0,U.jsxs)(w,{className:`max-w-md`,children:[i,(0,U.jsx)(C,{children:(0,U.jsx)(h,{"data-testid":`snippet-close-button`,variant:`default`,onClick:n,children:`Close`})})]}),t[2]=n,t[3]=a),a},q=[D.lineWrapping],J=()=>{let e=(0,H.c)(24),{readSnippets:t}=O(),[n,r]=V.useState(),i=R(),a=z(),l;e[0]===t?l=e[1]:(l=()=>t(),e[0]=t,e[1]=l);let u;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(u=[],e[2]=u):u=e[2];let{data:d,error:p,isPending:m}=A(l,u);if(p){let t;return e[3]===p?t=e[4]:(t=(0,U.jsx)(j,{error:p}),e[3]=p,e[4]=t),t}if(m||!d){let t;return e[5]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,U.jsx)(N,{size:`medium`,centered:!0}),e[5]=t):t=e[5],t}let h=i===`vertical`,g;e[6]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,U.jsx)(s,{placeholder:`Search snippets...`,className:`h-6 m-1`,rootClassName:`flex-1 border-r`}),e[6]=g):g=e[6];let _,v;e[7]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,U.jsxs)(`div`,{className:`flex items-center w-full border-b`,children:[g,(0,U.jsx)(G,{children:(0,U.jsx)(`button`,{className:`float-right px-2 m-0 h-full hover:bg-accent hover:text-accent-foreground`,children:(0,U.jsx)(x,{className:`h-4 w-4`})})})]}),v=(0,U.jsx)(c,{children:`No results`}),e[7]=_,e[8]=v):(_=e[7],v=e[8]);let y;e[9]===Symbol.for(`react.memo_cache_sentinel`)?(y=e=>r(e),e[9]=y):y=e[9];let b;e[10]===d.snippets?b=e[11]:(b=(0,U.jsx)(I,{defaultSize:40,minSize:20,maxSize:70,children:(0,U.jsxs)(o,{className:`h-full rounded-none`,children:[_,v,(0,U.jsx)(X,{onSelect:y,snippets:d.snippets})]})}),e[10]=d.snippets,e[11]=b);let S=h?`h-1`:`w-1`,C;e[12]===S?C=e[13]:(C=f(`bg-border hover:bg-primary/50 transition-colors`,S),e[12]=S,e[13]=C);let w;e[14]===C?w=e[15]:(w=(0,U.jsx)(P,{className:C}),e[14]=C,e[15]=w);let T;e[16]===n?T=e[17]:(T=(0,U.jsx)(I,{defaultSize:60,minSize:20,children:(0,U.jsx)(V.Suspense,{children:(0,U.jsx)(`div`,{className:`h-full snippet-viewer flex flex-col overflow-hidden`,children:n?(0,U.jsx)(Y,{snippet:n,onClose:()=>r(void 0)},n.title):(0,U.jsx)(L,{title:``,description:`Click on a snippet to view its content.`})})})}),e[16]=n,e[17]=T);let E;return e[18]!==i||e[19]!==a||e[20]!==T||e[21]!==b||e[22]!==w?(E=(0,U.jsx)(`div`,{className:`flex-1 overflow-hidden h-full`,children:(0,U.jsxs)(F,{direction:i,className:`h-full`,children:[b,w,T]},a)}),e[18]=i,e[19]=a,e[20]=T,e[21]=b,e[22]=w,e[23]=E):E=e[23],E},Y=e=>{let t=(0,H.c)(33),{snippet:n,onClose:a}=e,{theme:o}=k(),{createNewCell:s}=r(),c=i(),l;t[0]!==s||t[1]!==c||t[2]!==n.sections?(l=()=>{for(let e of n.sections.toReversed())e.code&&s({code:e.code,before:!1,cellId:c??`__end__`,skipIfCodeExists:!0})},t[0]=s,t[1]=c,t[2]=n.sections,t[3]=l):l=t[3];let u=l,d;t[4]!==s||t[5]!==c?(d=e=>{s({code:e,before:!1,cellId:c??`__end__`})},t[4]=s,t[5]=c,t[6]=d):d=t[6];let f=d,p;t[7]===n.title?p=t[8]:(p=(0,U.jsx)(`span`,{children:n.title}),t[7]=n.title,t[8]=p);let b;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(b=(0,U.jsx)(y,{className:`h-4 w-4`}),t[9]=b):b=t[9];let x;t[10]===a?x=t[11]:(x=(0,U.jsx)(h,{size:`sm`,variant:`ghost`,onClick:a,className:`h-6 w-6 p-0 hover:bg-muted-foreground/10`,children:b}),t[10]=a,t[11]=x);let S;t[12]!==p||t[13]!==x?(S=(0,U.jsxs)(`div`,{className:`text-sm font-semibold bg-muted border-y px-2 py-1 flex justify-between items-center`,children:[p,x]}),t[12]=p,t[13]=x,t[14]=S):S=t[14];let C;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(C=(0,U.jsx)(_,{className:`ml-2 h-4 w-4`}),t[15]=C):C=t[15];let w;t[16]===u?w=t[17]:(w=(0,U.jsx)(`div`,{className:`flex justify-end`,children:(0,U.jsx)(B,{children:(0,U.jsxs)(h,{className:`float-right`,size:`xs`,variant:`outline`,onClick:u,children:[`Insert snippet`,C]})})}),t[16]=u,t[17]=w);let T;if(t[18]!==f||t[19]!==n.sections||t[20]!==n.title||t[21]!==o){let e;t[23]!==f||t[24]!==n.title||t[25]!==o?(e=e=>{let{code:t,html:r,id:i}=e;if(r)return(0,U.jsx)(`div`,{children:M({html:r})},`${n.title}-${i}`);if(!t)return null;let{language:a,code:s}=g(t);return(0,U.jsxs)(`div`,{className:`relative hover-actions-parent pr-2`,children:[(0,U.jsx)(B,{children:(0,U.jsx)(m,{content:`Insert snippet`,children:(0,U.jsx)(h,{className:`absolute -top-2 -right-1 z-10 hover-action px-2 bg-background`,size:`sm`,variant:`outline`,onClick:()=>{f(t)},children:(0,U.jsx)(_,{className:`h-5 w-5`})})})}),(0,U.jsx)(V.Suspense,{children:(0,U.jsx)(v,{theme:o===`dark`?`dark`:`light`,language:a,className:`cm border rounded overflow-hidden`,extensions:q,value:s,readOnly:!0},`${n.title}-${i}`)})]},`${n.title}-${i}`)},t[23]=f,t[24]=n.title,t[25]=o,t[26]=e):e=t[26],T=n.sections.map(e),t[18]=f,t[19]=n.sections,t[20]=n.title,t[21]=o,t[22]=T}else T=t[22];let E;t[27]!==w||t[28]!==T?(E=(0,U.jsxs)(`div`,{className:`px-2 py-2 space-y-4 overflow-auto flex-1`,children:[w,T]}),t[27]=w,t[28]=T,t[29]=E):E=t[29];let D;return t[30]!==E||t[31]!==S?(D=(0,U.jsxs)(U.Fragment,{children:[S,E]}),t[30]=E,t[31]=S,t[32]=D):D=t[32],D},X=e=>{let t=(0,H.c)(7),{snippets:r,onSelect:i}=e,o;if(t[0]!==i||t[1]!==r){let e;t[3]===i?e=t[4]:(e=e=>(0,U.jsx)(a,{className:`rounded-none`,onSelect:()=>i(e),children:(0,U.jsx)(`div`,{className:`flex flex-row gap-2 items-center`,children:(0,U.jsx)(`span`,{className:`mt-1 text-accent-foreground`,children:e.title})})},e.title),t[3]=i,t[4]=e),o=r.map(e),t[0]=i,t[1]=r,t[2]=o}else o=t[2];let s;return t[5]===o?s=t[6]:(s=(0,U.jsx)(n,{className:`flex flex-col overflow-auto`,children:o}),t[5]=o,t[6]=s),s};export{J as default};