Files
mermaid-live-editor/docs/_app/pages/edit.svelte-7b5fceb2.js
T
2021-05-29 10:58:23 +00:00

2 lines
35 KiB
JavaScript

var e;import{S as t,i as a,s as n,e as s,c as i,a as o,d as r,b as l,f as c,G as d,H as h,I as u,z as f,J as m,K as g,k as p,t as v,n as $,g as w,F as b,L as x,M as E,N as y,O as k,P as I,Q as D,h as C,R as T,T as O,U as S,v as V,B as A,r as M,u as _,V as R,D as N,E as L,j as P,m as B,o as U,W as G,w as H,X as j,Y,Z as z,_ as q,$ as J,a0 as F,a1 as K,a2 as W,a3 as Z,C as X,a4 as Q,a5 as ee,a6 as te,l as ae,a7 as ne,a8 as se}from"../chunks/vendor-de807e42.js";import{c as ie,a as oe,u as re,b as le,g as ce,V as de,e as he,i as ue,s as fe,d as me}from"../chunks/util-1700c988.js";import{b as ge}from"../chunks/paths-45dac81d.js";import"../chunks/preload-helper-9f12a5fd.js";function pe(e){let t;return{c(){t=s("div"),this.h()},l(e){t=i(e,"DIV",{id:!0,class:!0}),o(t).forEach(r),this.h()},h(){l(t,"id","editor"),l(t,"class","overflow-hidden")},m(a,n){c(a,t,n),e[9](t)},p:d,i:d,o:d,d(a){a&&r(t),e[9](null)}}}function ve(e,t,a){let n;h(e,ie,(e=>a(8,n=e)));var s=this&&this.__awaiter||function(e,t,a,n){return new(a||(a=Promise))((function(s,i){function o(e){try{l(n.next(e))}catch(t){i(t)}}function r(e){try{l(n.throw(e))}catch(t){i(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof a?t:new a((function(e){e(t)}))).then(o,r)}l((n=n.apply(e,t||[])).next())}))};let i,o,r=null,{text:l}=t,{language:c}=t,{editorOptions:d={value:l,language:c,scrollBeyondLastLine:!1,minimap:{enabled:!1},theme:"myCoolTheme",overviewRulerLanes:0}}=t,{errorMarkers:g=[]}=t,p=l;const v=u();return f((()=>s(void 0,void 0,void 0,(function*(){var e;a(6,o=monaco),(e=o).languages.register({id:"mermaid"}),e.languages.setMonarchTokensProvider("mermaid",{typeKeywords:["graph","stateDiagram","sequenceDiagram","classDiagram","pie","erDiagram","flowchart","gantt","gitGraph","journey"],keywords:["patricipant","as"],arrows:["---","===","--\x3e","==>","->>","->"],tokenizer:{root:[[/[{}]/,"delimiter.bracket"],[/[a-z_$][\w$]*/,{cases:{"@typeKeywords":"keyword","@keywords":"keyword"}}],[/[-=>ox]+/,{cases:{"@arrows":"transition"}}],[/[[{(}]+.+?[)\]}]+/,"string"],[/".*"/,"string"]]},whitespace:[[/[ \t\r\n]+/,"white"],[/%%.*$/,"comment"]]}),e.editor.defineTheme("myCoolTheme",{base:"vs",inherit:!1,rules:[{token:"keyword",foreground:"880000",fontStyle:"bold"},{token:"custom-error",foreground:"ff0000",fontStyle:"bold"},{token:"string",foreground:"AA8500"},{token:"transition",foreground:"008800",fontStyle:"bold"},{token:"delimiter.bracket",foreground:"000000",fontStyle:"bold"}]}),e.languages.registerCompletionItemProvider("mermaid",{provideCompletionItems:()=>({suggestions:[{label:"simpleText",kind:e.languages.CompletionItemKind.Text,insertText:"simpleText"},{label:"testing",kind:e.languages.CompletionItemKind.Keyword,insertText:"testing(${1:condition})",insertTextRules:e.languages.CompletionItemInsertTextRule.InsertAsSnippet},{label:"ifelse",kind:e.languages.CompletionItemKind.Snippet,insertText:["if (${1:condition}) {","\t$0","} else {","\t","}"].join("\n"),insertTextRules:e.languages.CompletionItemInsertTextRule.InsertAsSnippet,documentation:"If-Else Statement"}]})}),a(5,i=o.editor.create(r,d)),i.onDidChangeModelContent((()=>s(void 0,void 0,void 0,(function*(){a(1,l=i.getValue()),v("update",{text:l})}))));return new ResizeObserver((e=>{i.layout({height:e[0].contentRect.height,width:e[0].contentRect.width})})).observe(r.parentElement),()=>{i.dispose()}})))),e.$$set=e=>{"text"in e&&a(1,l=e.text),"language"in e&&a(2,c=e.language),"editorOptions"in e&&a(3,d=e.editorOptions),"errorMarkers"in e&&a(4,g=e.errorMarkers)},e.$$.update=()=>{100&e.$$.dirty&&(null==o||o.editor.setModelLanguage(i.getModel(),c)),498&e.$$.dirty&&(l!==p&&(n.updateEditor&&(null==i||i.setValue(l)),a(7,p=l)),null==o||o.editor.setModelMarkers(i.getModel(),"test",g))},[r,l,c,d,g,i,o,p,n,function(e){m[e?"unshift":"push"]((()=>{r=e,a(0,r)}))}]}class $e extends t{constructor(e){super(),a(this,e,ve,pe,n,{text:1,language:2,editorOptions:3,errorMarkers:4})}}function we(e,t,a){const n=e.slice();return n[1]=t[a].title,n[2]=t[a].href,n[3]=t[a].icon,n}function be(e){let t,a,n,h,u,f=e[1]+"",m=e[3]&&function(e){let t;return{c(){t=s("i"),this.h()},l(e){t=i(e,"I",{class:!0}),o(t).forEach(r),this.h()},h(){l(t,"class",e[3])},m(e,a){c(e,t,a)},p:d,d(e){e&&r(t)}}}(e);return{c(){t=s("li"),a=s("a"),m&&m.c(),n=p(),h=v(f),u=p(),this.h()},l(e){t=i(e,"LI",{});var s=o(t);a=i(s,"A",{class:!0,target:!0,href:!0});var l=o(a);m&&m.l(l),n=$(l),h=w(l,f),l.forEach(r),u=$(s),s.forEach(r),this.h()},h(){l(a,"class","nav-btn"),l(a,"target","_blank"),l(a,"href",e[2])},m(e,s){c(e,t,s),b(t,a),m&&m.m(a,null),b(a,n),b(a,h),b(t,u)},p(e,t){e[3]&&m.p(e,t)},d(e){e&&r(t),m&&m.d()}}}function xe(e){let t,a,n,h,u,f,m,y,k,I,D,C,T,O,S,V,A,M,_,R,N=e[0],L=[];for(let s=0;s<N.length;s+=1)L[s]=be(we(e,N,s));return{c(){t=s("header"),a=s("div"),n=s("a"),h=v("Mermaid"),u=s("span"),f=v("v"),m=v(g),y=v(" Live Editor"),k=p(),I=s("label"),D=x("svg"),C=x("title"),T=v("menu"),O=x("path"),S=p(),V=s("input"),A=p(),M=s("div"),_=s("nav"),R=s("ul");for(let e=0;e<L.length;e+=1)L[e].c();this.h()},l(e){t=i(e,"HEADER",{class:!0});var s=o(t);a=i(s,"DIV",{class:!0});var l=o(a);n=i(l,"A",{href:!0});var c=o(n);h=w(c,"Mermaid"),u=i(c,"SPAN",{class:!0});var d=o(u);f=w(d,"v"),m=w(d,g),d.forEach(r),y=w(c," Live Editor"),c.forEach(r),l.forEach(r),k=$(s),I=i(s,"LABEL",{for:!0,class:!0});var p=o(I);D=i(p,"svg",{class:!0,xmlns:!0,width:!0,height:!0,viewBox:!0},1);var v=o(D);C=i(v,"title",{},1);var b=o(C);T=w(b,"menu"),b.forEach(r),O=i(v,"path",{d:!0},1),o(O).forEach(r),v.forEach(r),p.forEach(r),S=$(s),V=i(s,"INPUT",{class:!0,type:!0,id:!0}),A=$(s),M=i(s,"DIV",{class:!0,id:!0});var x=o(M);_=i(x,"NAV",{});var E=o(_);R=i(E,"UL",{class:!0});var N=o(R);for(let t=0;t<L.length;t+=1)L[t].l(N);N.forEach(r),E.forEach(r),x.forEach(r),s.forEach(r),this.h()},h(){l(u,"class","text-xs font-thin"),l(n,"href","/"),l(a,"class","flex-1 flex justify-between items-center"),l(O,"d","M0 3h20v2H0V3zm0 6h20v2H0V9zm0 6h20v2H0v-2z"),l(D,"class","fill-current "),l(D,"xmlns","http://www.w3.org/2000/svg"),l(D,"width","20"),l(D,"height","20"),l(D,"viewBox","0 0 20 20"),l(I,"for","menu-toggle"),l(I,"class","pointer-cursor lg:hidden block"),l(V,"class","hidden svelte-qevfgi"),l(V,"type","checkbox"),l(V,"id","menu-toggle"),l(R,"class","lg:flex items-center justify-between text-base pt-4 lg:pt-0"),l(M,"class","hidden lg:flex lg:items-center lg:w-auto w-full svelte-qevfgi"),l(M,"id","menu"),l(t,"class","p-2 bg-indigo-400 text-white font-bold flex flex-wrap items-center svelte-qevfgi")},m(e,s){c(e,t,s),b(t,a),b(a,n),b(n,h),b(n,u),b(u,f),b(u,m),b(n,y),b(t,k),b(t,I),b(I,D),b(D,C),b(C,T),b(D,O),b(t,S),b(t,V),b(t,A),b(t,M),b(M,_),b(_,R);for(let t=0;t<L.length;t+=1)L[t].m(R,null)},p(e,[t]){if(1&t){let a;for(N=e[0],a=0;a<N.length;a+=1){const n=we(e,N,a);L[a]?L[a].p(n,t):(L[a]=be(n),L[a].c(),L[a].m(R,null))}for(;a<L.length;a+=1)L[a].d(1);L.length=N.length}},i:d,o:d,d(e){e&&r(t),E(L,e)}}}function Ee(e){return[[{title:"Documentation",href:"https://mermaid-js.github.io/mermaid/#/n00b-gettingStarted"},{title:"Tutorial",href:"https://github.com/mermaid-js/mermaid/blob/develop/docs/Tutorials.md"},{title:"Mermaid",href:"https://github.com/mermaid-js/mermaid"},{title:"CLI",href:"https://github.com/mermaid-js/mermaid-cli"},{title:"",href:"https://github.com/mermaid-js/mermaid-live-editor",icon:"fab fa-github fa-lg"}]]}null==(e=oe)||e.track("version",{mermaidVersion:g});class ye extends t{constructor(e){super(),a(this,e,Ee,xe,n,{})}}function ke(e,t,a){const n=e.slice();return n[10]=t[a],n}function Ie(e){let t;return{c(){t=s("i"),this.h()},l(e){t=i(e,"I",{class:!0}),o(t).forEach(r),this.h()},h(){l(t,"class","fas fa-chevron-right icon svelte-1qkpo3v"),y(t,"isOpen",e[0])},m(e,a){c(e,t,a)},p(e,a){1&a&&y(t,"isOpen",e[0])},d(e){e&&r(t)}}}function De(e){let t,a,n,d=e[2],h=[];for(let s=0;s<d.length;s+=1)h[s]=Ce(ke(e,d,s));return{c(){t=s("ul");for(let e=0;e<h.length;e+=1)h[e].c();this.h()},l(e){t=i(e,"UL",{class:!0});var a=o(t);for(let t=0;t<h.length;t+=1)h[t].l(a);a.forEach(r),this.h()},h(){l(t,"class","flex flex-wrap flex-row")},m(e,a){c(e,t,a);for(let n=0;n<h.length;n+=1)h[n].m(t,null);n=!0},p(e,a){if(52&a){let n;for(d=e[2],n=0;n<d.length;n+=1){const s=ke(e,d,n);h[n]?h[n].p(s,a):(h[n]=Ce(s),h[n].c(),h[n].m(t,null))}for(;n<h.length;n+=1)h[n].d(1);h.length=d.length}},i(e){n||(T((()=>{a||(a=O(t,S,{},!0)),a.run(1)})),n=!0)},o(e){a||(a=O(t,S,{},!1)),a.run(0),n=!1},d(e){e&&r(t),E(h,e),e&&a&&a.end()}}}function Ce(e){let t,a,n,d,h,u,f,m,g,x,E=e[10].title+"";function y(){return e[7](e[10])}return{c(){t=s("li"),a=s("div"),n=s("i"),h=p(),u=v(E),m=p(),this.h()},l(e){t=i(e,"LI",{class:!0});var s=o(t);a=i(s,"DIV",{class:!0});var l=o(a);n=i(l,"I",{class:!0}),o(n).forEach(r),h=$(l),u=w(l,E),l.forEach(r),m=$(s),s.forEach(r),this.h()},h(){l(n,"class",d=k(e[10].icon)+" svelte-1qkpo3v"),l(a,"class",f="text cursor-pointer font-semibold min-w-16 w-auto px-2 py-1 -mb-4 rounded-t block leading-normal "+(e[4]===e[10].id?"text-indigo-500 bg-white border-white":"text-white bg-indigo-500 border-indigo-500 hover:bg-indigo-600")),l(t,"class","mr-2 last:mr-0 w-28 h-6 flex-auto text-center")},m(e,s){c(e,t,s),b(t,a),b(a,n),b(a,h),b(a,u),b(t,m),g||(x=I(a,"click",D(y)),g=!0)},p(t,s){e=t,4&s&&d!==(d=k(e[10].icon)+" svelte-1qkpo3v")&&l(n,"class",d),4&s&&E!==(E=e[10].title+"")&&C(u,E),20&s&&f!==(f="text cursor-pointer font-semibold min-w-16 w-auto px-2 py-1 -mb-4 rounded-t block leading-normal "+(e[4]===e[10].id?"text-indigo-500 bg-white border-white":"text-white bg-indigo-500 border-indigo-500 hover:bg-indigo-600"))&&l(a,"class",f)},d(e){e&&r(t),g=!1,x()}}}function Te(e){let t,a,n,d,h,u,f,m,g=e[1]&&Ie(e),x=e[0]&&e[2]&&De(e);return{c(){t=s("div"),a=s("span"),g&&g.c(),n=p(),d=v(e[3]),h=p(),x&&x.c(),this.h()},l(s){t=i(s,"DIV",{class:!0});var l=o(t);a=i(l,"SPAN",{class:!0});var c=o(a);g&&g.l(c),n=$(c),d=w(c,e[3]),c.forEach(r),h=$(l),x&&x.l(l),l.forEach(r),this.h()},h(){l(a,"class","text-white mr-2 font-semibold"),l(t,"class","flex cursor-default")},m(s,i){c(s,t,i),b(t,a),g&&g.m(a,null),b(a,n),b(a,d),b(t,h),x&&x.m(t,null),u=!0,f||(m=I(a,"click",D(e[6])),f=!0)},p(e,[s]){e[1]?g?g.p(e,s):(g=Ie(e),g.c(),g.m(a,n)):g&&(g.d(1),g=null),(!u||8&s)&&C(d,e[3]),e[0]&&e[2]?x?(x.p(e,s),5&s&&V(x,1)):(x=De(e),x.c(),V(x,1),x.m(t,null)):x&&(A(),M(x,1,1,(()=>{x=null})),_())},i(e){u||(V(x),u=!0)},o(e){M(x),u=!1},d(e){e&&r(t),g&&g.d(),x&&x.d(),f=!1,m()}}}function Oe(e,t,a){var n;let{isCloseable:s=!0}=t,{tabs:i=[]}=t,{title:o}=t,{isOpen:r=!1}=t,l=null===(n=i[0])||void 0===n?void 0:n.id;const c=u(),d=e=>{a(4,l=e.id),c("select",e)};return e.$$set=e=>{"isCloseable"in e&&a(1,s=e.isCloseable),"tabs"in e&&a(2,i=e.tabs),"title"in e&&a(3,o=e.title),"isOpen"in e&&a(0,r=e.isOpen)},[r,s,i,o,l,d,()=>a(0,r=!r),e=>d(e)]}class Se extends t{constructor(e){super(),a(this,e,Oe,Te,n,{isCloseable:1,tabs:2,title:3,isOpen:0})}}const Ve=e=>({}),Ae=e=>({});function Me(e){let t,a,n;const d=e[5].default,h=N(d,e,e[4],null);return{c(){t=s("div"),h&&h.c(),this.h()},l(e){t=i(e,"DIV",{class:!0});var a=o(t);h&&h.l(a),a.forEach(r),this.h()},h(){l(t,"class","flex-grow overflow-auto")},m(e,a){c(e,t,a),h&&h.m(t,null),n=!0},p(e,t){h&&h.p&&(!n||16&t)&&L(h,d,e,e[4],t,null,null)},i(e){n||(V(h,e),T((()=>{a||(a=O(t,j,{},!0)),a.run(1)})),n=!0)},o(e){M(h,e),a||(a=O(t,j,{},!1)),a.run(0),n=!1},d(e){e&&r(t),h&&h.d(e),e&&a&&a.end()}}}function _e(e){let t,a,n,d,h,u,f,g,v,w,x;function E(t){e[6](t)}let y={tabs:e[2],title:e[3],isCloseable:e[1]};void 0!==e[0]&&(y.isOpen=e[0]),d=new Se({props:y}),m.push((()=>R(d,"isOpen",E))),d.$on("select",e[7]);const k=e[5].actions,D=N(k,e,e[4],Ae);let C=e[0]&&Me(e);return{c(){t=s("div"),a=s("div"),n=s("div"),P(d.$$.fragment),u=p(),f=s("div"),D&&D.c(),g=p(),C&&C.c(),this.h()},l(e){t=i(e,"DIV",{class:!0});var s=o(t);a=i(s,"DIV",{class:!0});var l=o(a);n=i(l,"DIV",{class:!0});var c=o(n);B(d.$$.fragment,c),u=$(c),f=i(c,"DIV",{class:!0});var h=o(f);D&&D.l(h),h.forEach(r),c.forEach(r),l.forEach(r),g=$(s),C&&C.l(s),s.forEach(r),this.h()},h(){l(f,"class","flex gap-x-4 items-center text-white"),l(n,"class","flex justify-between"),l(a,"class","bg-indigo-400 border-gray-400 p-2 flex-none"),l(t,"class","bg-white rounded overflow-hidden shadow m-2 flex-grow flex flex-col")},m(s,i){c(s,t,i),b(t,a),b(a,n),U(d,n,null),b(n,u),b(n,f),D&&D.m(f,null),b(t,g),C&&C.m(t,null),v=!0,w||(x=I(a,"click",e[8]),w=!0)},p(e,[a]){const n={};4&a&&(n.tabs=e[2]),8&a&&(n.title=e[3]),2&a&&(n.isCloseable=e[1]),!h&&1&a&&(h=!0,n.isOpen=e[0],G((()=>h=!1))),d.$set(n),D&&D.p&&(!v||16&a)&&L(D,k,e,e[4],a,Ve,Ae),e[0]?C?(C.p(e,a),1&a&&V(C,1)):(C=Me(e),C.c(),V(C,1),C.m(t,null)):C&&(A(),M(C,1,1,(()=>{C=null})),_())},i(e){v||(V(d.$$.fragment,e),V(D,e),V(C),v=!0)},o(e){M(d.$$.fragment,e),M(D,e),M(C),v=!1},d(e){e&&r(t),H(d),D&&D.d(e),C&&C.d(),w=!1,x()}}}function Re(e,t,a){let{$$slots:n={},$$scope:s}=t,{isCloseable:i=!0}=t,{isOpen:o=!0}=t,{tabs:r=[]}=t,{title:l}=t;return e.$$set=e=>{"isCloseable"in e&&a(1,i=e.isCloseable),"isOpen"in e&&a(0,o=e.isOpen),"tabs"in e&&a(2,r=e.tabs),"title"in e&&a(3,l=e.title),"$$scope"in e&&a(4,s=e.$$scope)},e.$$.update=()=>{3&e.$$.dirty&&a(0,o=!i||o)},[o,i,r,l,s,n,function(e){o=e,a(0,o),a(1,i)},function(t){Y(e,t)},()=>a(0,o=!o)]}class Ne extends t{constructor(e){super(),a(this,e,Re,_e,n,{isCloseable:1,isOpen:0,tabs:2,title:3})}}function Le(e,t,a){const n=e.slice();return n[3]=t[a],n}function Pe(e){let t,a,n,d,h=e[3]+"";function u(){return e[2](e[3])}return{c(){t=s("button"),a=v(h),this.h()},l(e){t=i(e,"BUTTON",{class:!0});var n=o(t);a=w(n,h),n.forEach(r),this.h()},h(){l(t,"class","action-btn")},m(e,s){c(e,t,s),b(t,a),n||(d=I(t,"click",u),n=!0)},p(t,a){e=t},d(e){e&&r(t),n=!1,d()}}}function Be(e){let t,a=Object.keys(e[0]),n=[];for(let s=0;s<a.length;s+=1)n[s]=Pe(Le(e,a,s));return{c(){t=s("div");for(let e=0;e<n.length;e+=1)n[e].c();this.h()},l(e){t=i(e,"DIV",{class:!0});var a=o(t);for(let t=0;t<n.length;t+=1)n[t].l(a);a.forEach(r),this.h()},h(){l(t,"class","flex gap-2 flex-wrap p-2")},m(e,a){c(e,t,a);for(let s=0;s<n.length;s+=1)n[s].m(t,null)},p(e,s){if(3&s){let i;for(a=Object.keys(e[0]),i=0;i<a.length;i+=1){const o=Le(e,a,i);n[i]?n[i].p(o,s):(n[i]=Pe(o),n[i].c(),n[i].m(t,null))}for(;i<n.length;i+=1)n[i].d(1);n.length=a.length}},d(e){e&&r(t),E(n,e)}}}function Ue(e){let t,a;return t=new Ne({props:{title:"Sample Diagrams",isOpen:!1,$$slots:{default:[Be]},$$scope:{ctx:e}}}),{c(){P(t.$$.fragment)},l(e){B(t.$$.fragment,e)},m(e,n){U(t,e,n),a=!0},p(e,[a]){const n={};64&a&&(n.$$scope={dirty:a,ctx:e}),t.$set(n)},i(e){a||(V(t.$$.fragment,e),a=!0)},o(e){M(t.$$.fragment,e),a=!1},d(e){H(t,e)}}}function Ge(e){const t={"Flow Chart":"graph TD\n A[Christmas] --\x3e|Get money| B(Go shopping)\n B --\x3e C{Let me think}\n C --\x3e|One| D[Laptop]\n C --\x3e|Two| E[iPhone]\n C --\x3e|Three| F[fa:fa-car Car]","Sequence Diagram":"sequenceDiagram\n Alice->>+John: Hello John, how are you?\n Alice->>+John: John, can you hear me?\n John--\x3e>-Alice: Hi Alice, I can hear you!\n John--\x3e>-Alice: I feel great!\n ","Class Diagram":"classDiagram\n Animal <|-- Duck\n Animal <|-- Fish\n Animal <|-- Zebra\n Animal : +int age\n Animal : +String gender\n Animal: +isMammal()\n Animal: +mate()\n class Duck{\n +String beakColor\n +swim()\n +quack()\n }\n class Fish{\n -int sizeInFeet\n -canEat()\n }\n class Zebra{\n +bool is_wild\n +run()\n }\n ","State Diagram":"stateDiagram-v2\n [*] --\x3e Still\n Still --\x3e [*]\n Still --\x3e Moving\n Moving --\x3e Still\n Moving --\x3e Crash\n Crash --\x3e [*]\n ","Gantt Chart":"gantt\n title A Gantt Diagram\n dateFormat YYYY-MM-DD\n section Section\n A task :a1, 2014-01-01, 30d\n Another task :after a1 , 20d\n section Another\n Task in sec :2014-01-12 , 12d\n another task : 24d\n ","Pie Chart":'pie title Pets adopted by volunteers\n "Dogs" : 386\n "Cats" : 85\n "Rats" : 15\n ',"ER Diagram":'erDiagram\n CUSTOMER }|..|{ DELIVERY-ADDRESS : has\n CUSTOMER ||--o{ ORDER : places\n CUSTOMER ||--o{ INVOICE : "liable for"\n DELIVERY-ADDRESS ||--o{ ORDER : receives\n INVOICE ||--|{ ORDER : covers\n ORDER ||--|{ ORDER-ITEM : includes\n PRODUCT-CATEGORY ||--|{ PRODUCT : contains\n PRODUCT ||--o{ ORDER-ITEM : "ordered in"\n ',"Git Graph":'gitGraph:\noptions\n{\n "nodeSpacing": 150,\n "nodeRadius": 10\n}\nend\ncommit\nbranch newbranch\ncheckout newbranch\ncommit\ncommit\ncheckout master\ncommit\ncommit\nmerge newbranch\n\n ',"User Journey":" journey\n title My working day\n section Go to work\n Make tea: 5: Me\n Go upstairs: 3: Me\n Do work: 1: Me, Cat\n section Go home\n Go downstairs: 5: Me\n Sit down: 3: Me\n "},a=e=>{re(t[e],!0,!0)};return[t,a,e=>a(e)]}class He extends t{constructor(e){super(),a(this,e,Ge,Ue,n,{})}}function je(e){let t,a,n;return{c(){t=s("input"),this.h()},l(e){t=i(e,"INPUT",{id:!0,type:!0,min:!0,max:!0}),this.h()},h(){l(t,"id","height"),l(t,"type","number"),l(t,"min","3"),l(t,"max","10000")},m(s,i){c(s,t,i),z(t,e[4]),a||(n=I(t,"input",e[14]),a=!0)},p(e,a){16&a&&q(t.value)!==e[4]&&z(t,e[4])},d(e){e&&r(t),a=!1,n()}}}function Ye(e){let t,a,n,h,u,f,m,g,x,E,y,k,D,C,T,O,S,V,A,M,_,R,N,L,P,B,U,G,H,j,Y,z,q,F,K,W,Z,X,Q,ee,te,ae,ne,se,ie,oe=e[5](),re=oe&&function(e){let t,a,n,h,u;return{c(){t=s("button"),a=s("i"),n=v(" Copy Image to clipboard"),this.h()},l(e){t=i(e,"BUTTON",{class:!0});var s=o(t);a=i(s,"I",{class:!0}),o(a).forEach(r),n=w(s," Copy Image to clipboard"),s.forEach(r),this.h()},h(){l(a,"class","far fa-copy"),l(t,"class","action-btn w-full")},m(s,i){c(s,t,i),b(t,a),b(t,n),h||(u=I(t,"click",e[6]),h=!0)},p:d,d(e){e&&r(t),h=!1,u()}}}(e),le="auto"!==e[3]&&je(e);return{c(){t=s("div"),re&&re.c(),a=p(),n=s("button"),h=s("i"),u=v(" PNG"),f=p(),m=s("button"),g=s("i"),x=v(" SVG"),E=p(),y=s("button"),k=s("a"),D=s("i"),C=v(" PNG"),T=p(),O=s("button"),S=s("a"),V=s("i"),A=v(" SVG"),M=p(),_=s("div"),R=v("PNG size\n\t\t\t"),N=s("input"),L=p(),P=s("label"),B=v("Auto"),U=p(),G=s("input"),H=p(),j=s("label"),Y=v("Width"),z=p(),q=s("input"),F=p(),K=s("label"),W=v("Height"),Z=p(),le&&le.c(),X=p(),Q=s("div"),ee=s("label"),te=v("Copy Markdown"),ae=p(),ne=s("input"),this.h()},l(e){t=i(e,"DIV",{class:!0});var s=o(t);re&&re.l(s),a=$(s),n=i(s,"BUTTON",{class:!0});var l=o(n);h=i(l,"I",{class:!0}),o(h).forEach(r),u=w(l," PNG"),l.forEach(r),f=$(s),m=i(s,"BUTTON",{class:!0});var c=o(m);g=i(c,"I",{class:!0}),o(g).forEach(r),x=w(c," SVG"),c.forEach(r),E=$(s),y=i(s,"BUTTON",{class:!0});var d=o(y);k=i(d,"A",{target:!0,href:!0});var p=o(k);D=i(p,"I",{class:!0}),o(D).forEach(r),C=w(p," PNG"),p.forEach(r),d.forEach(r),T=$(s),O=i(s,"BUTTON",{class:!0});var v=o(O);S=i(v,"A",{target:!0,href:!0});var b=o(S);V=i(b,"I",{class:!0}),o(V).forEach(r),A=w(b," SVG"),b.forEach(r),v.forEach(r),M=$(s),_=i(s,"DIV",{class:!0});var I=o(_);R=w(I,"PNG size\n\t\t\t"),N=i(I,"INPUT",{type:!0,value:!0,id:!0}),L=$(I),P=i(I,"LABEL",{for:!0});var J=o(P);B=w(J,"Auto"),J.forEach(r),U=$(I),G=i(I,"INPUT",{type:!0,value:!0,id:!0}),H=$(I),j=i(I,"LABEL",{for:!0});var se=o(j);Y=w(se,"Width"),se.forEach(r),z=$(I),q=i(I,"INPUT",{type:!0,value:!0,id:!0}),F=$(I),K=i(I,"LABEL",{for:!0});var ie=o(K);W=w(ie,"Height"),ie.forEach(r),Z=$(I),le&&le.l(I),I.forEach(r),X=$(s),Q=i(s,"DIV",{class:!0});var oe=o(Q);ee=i(oe,"LABEL",{for:!0});var ce=o(ee);te=w(ce,"Copy Markdown"),ce.forEach(r),ae=$(oe),ne=i(oe,"INPUT",{class:!0,id:!0,type:!0,value:!0}),oe.forEach(r),s.forEach(r),this.h()},h(){l(h,"class","fas fa-download"),l(n,"class","action-btn flex-auto"),l(g,"class","fas fa-download"),l(m,"class","action-btn flex-auto"),l(D,"class","fas fa-external-link-alt"),l(k,"target","_blank"),l(k,"href",e[0]),l(y,"class","action-btn flex-auto"),l(V,"class","fas fa-external-link-alt"),l(S,"target","_blank"),l(S,"href",e[1]),l(O,"class","action-btn flex-auto"),l(N,"type","radio"),N.__value="auto",N.value=N.__value,l(N,"id","autosize"),e[11][0].push(N),l(P,"for","autosize"),l(G,"type","radio"),G.__value="width",G.value=G.__value,l(G,"id","width-active"),e[11][0].push(G),l(j,"for","width"),l(q,"type","radio"),q.__value="height",q.value=q.__value,l(q,"id","height-active"),e[11][0].push(q),l(K,"for","height"),l(_,"class","flex gap-2 items-center"),l(ee,"for","markdown"),l(ne,"class","flex-1"),l(ne,"id","markdown"),l(ne,"type","text"),ne.value=e[2],l(Q,"class","w-full flex gap-2 items-center"),l(t,"class","flex flex-wrap gap-2 m-2")},m(s,i){c(s,t,i),re&&re.m(t,null),b(t,a),b(t,n),b(n,h),b(n,u),b(t,f),b(t,m),b(m,g),b(m,x),b(t,E),b(t,y),b(y,k),b(k,D),b(k,C),b(t,T),b(t,O),b(O,S),b(S,V),b(S,A),b(t,M),b(t,_),b(_,R),b(_,N),N.checked=N.__value===e[3],b(_,L),b(_,P),b(P,B),b(_,U),b(_,G),G.checked=G.__value===e[3],b(_,H),b(_,j),b(j,Y),b(_,z),b(_,q),q.checked=q.__value===e[3],b(_,F),b(_,K),b(K,W),b(_,Z),le&&le.m(_,null),b(t,X),b(t,Q),b(Q,ee),b(ee,te),b(Q,ae),b(Q,ne),se||(ie=[I(n,"click",e[7]),I(m,"click",e[8]),I(N,"change",e[10]),I(G,"change",e[12]),I(q,"change",e[13]),I(ne,"click",e[9])],se=!0)},p(e,t){oe&&re.p(e,t),1&t&&l(k,"href",e[0]),2&t&&l(S,"href",e[1]),8&t&&(N.checked=N.__value===e[3]),8&t&&(G.checked=G.__value===e[3]),8&t&&(q.checked=q.__value===e[3]),"auto"!==e[3]?le?le.p(e,t):(le=je(e),le.c(),le.m(_,null)):le&&(le.d(1),le=null),4&t&&ne.value!==e[2]&&(ne.value=e[2])},d(a){a&&r(t),re&&re.d(),e[11][0].splice(e[11][0].indexOf(N),1),e[11][0].splice(e[11][0].indexOf(G),1),e[11][0].splice(e[11][0].indexOf(q),1),le&&le.d(),se=!1,J(ie)}}}function ze(e){let t,a;return t=new Ne({props:{title:"Actions",isOpen:!1,$$slots:{default:[Ye]},$$scope:{ctx:e}}}),{c(){P(t.$$.fragment)},l(e){B(t.$$.fragment,e)},m(e,n){U(t,e,n),a=!0},p(e,[a]){const n={};1048607&a&&(n.$$scope={dirty:a,ctx:e}),t.$set(n)},i(e){a||(V(t.$$.fragment,e),a=!0)},o(e){M(t.$$.fragment,e),a=!1},d(e){H(t,e)}}}function qe(e,t,a){const n=()=>{const e=document.getElementById("container").innerHTML.replaceAll("<br>","<br/>");return F(e)},s=(e,t)=>{const a=document.createElement("canvas"),s=document.querySelector("#container svg").getBoundingClientRect();if(a.width=s.width,a.height=s.height,"width"===h){const e=s.height/s.width;a.width=u,a.height=u*e}else if("height"===h){const e=s.width/s.height;a.width=u*e,a.height=u}const i=a.getContext("2d");i.fillStyle="white",i.fillRect(0,0,a.width,a.height);const o=new Image;o.onload=t(a,i,o),o.src=`data:image/svg+xml;base64,${n()}`,e.stopPropagation(),e.preventDefault()},i=(e,t)=>{const a=document.createElement("a");a.download=e,a.href=t,a.click(),a.remove()},o=(e,t,a)=>()=>{t.drawImage(a,0,0,e.width,e.height),i(`mermaid-diagram-${K().format("YYYYMMDDHHmmss")}.png`,e.toDataURL("image/png").replace("image/png","image/octet-stream"))},r=(e,t,a)=>()=>{t.drawImage(a,0,0,e.width,e.height),e.toBlob((e=>{try{navigator.clipboard.write([new ClipboardItem({[e.type]:e})])}catch(t){console.error(t)}}))};let l,c,d,h="auto",u=1080;le.subscribe((e=>{a(0,l=`https://mermaid.ink/img/${e}`),a(1,c=`https://mermaid.ink/svg/${e}`),a(2,d=`[![](${l})](${window.location.protocol}//${window.location.host}${window.location.pathname}/edit#${e})`)}));return[l,c,d,h,u,()=>Object.prototype.hasOwnProperty.call(window,"ClipboardItem"),e=>{s(e,r)},e=>{s(e,o)},()=>{i(`mermaid-diagram-${K().format("YYYYMMDDHHmmss")}.svg`,`data:image/svg+xml;base64,${n()}`)},e=>{e.target.select(),document.execCommand("Copy")},function(){h=this.__value,a(3,h)},[[]],function(){h=this.__value,a(3,h)},function(){h=this.__value,a(3,h)},function(){u=q(this.value),a(4,u)}]}class Je extends t{constructor(e){super(),a(this,e,qe,ze,n,{})}}const Fe=W(X(!0),Z(),"autoHistoryMode"),Ke=W(X([]),Z(),"autoHistoryStore"),We=W(X([]),Z(),"manualHistoryStore"),Ze=Q([Fe,Ke,We],(([e,t,a],n)=>{n(e?t:a)}));function Xe(e,t,a){const n=e.slice();return n[14]=t[a].state,n[15]=t[a].time,n[16]=t[a].name,n}function Qe(e){let t,a,n,h,u,f;return{c(){t=s("div"),a=v("No items in History"),n=s("br"),h=v("\n\t\t\t\tClick the Save button to save current state and restore it later."),u=s("br"),f=v("\n\t\t\t\tTimeline will automatically be saved every minute."),this.h()},l(e){t=i(e,"DIV",{class:!0});var s=o(t);a=w(s,"No items in History"),n=i(s,"BR",{}),h=w(s,"\n\t\t\t\tClick the Save button to save current state and restore it later."),u=i(s,"BR",{}),f=w(s,"\n\t\t\t\tTimeline will automatically be saved every minute."),s.forEach(r),this.h()},h(){l(t,"class","m-2 text-gray-600")},m(e,s){c(e,t,s),b(t,a),b(t,n),b(t,h),b(t,u),b(t,f)},p:d,d(e){e&&r(t)}}}function et(e){let t,a=e[1],n=[];for(let s=0;s<a.length;s+=1)n[s]=tt(Xe(e,a,s));return{c(){for(let e=0;e<n.length;e+=1)n[e].c();t=ae()},l(e){for(let t=0;t<n.length;t+=1)n[t].l(e);t=ae()},m(e,a){for(let t=0;t<n.length;t+=1)n[t].m(e,a);c(e,t,a)},p(e,s){if(226&s){let i;for(a=e[1],i=0;i<a.length;i+=1){const o=Xe(e,a,i);n[i]?n[i].p(o,s):(n[i]=tt(o),n[i].c(),n[i].m(t.parentNode,t))}for(;i<n.length;i+=1)n[i].d(1);n.length=a.length}},d(e){E(n,e),e&&r(t)}}}function tt(e){let t,a,n,d,h,u,f,m,g,x,E,y,k,D,T,O,S,V,A,M,_,R=e[16]+"",N=e[7](e[15])+"";function L(){return e[10](e[14])}function P(){return e[11](e[15])}return{c(){t=s("li"),a=s("div"),n=s("div"),d=s("div"),h=s("span"),u=v(R),f=p(),m=s("span"),g=v(N),x=p(),E=s("div"),y=s("button"),k=s("i"),D=v(" Restore"),T=p(),O=s("button"),S=s("i"),V=v(" Delete"),A=p(),this.h()},l(e){t=i(e,"LI",{class:!0});var s=o(t);a=i(s,"DIV",{class:!0});var l=o(a);n=i(l,"DIV",{class:!0});var c=o(n);d=i(c,"DIV",{class:!0});var p=o(d);h=i(p,"SPAN",{});var v=o(h);u=w(v,R),v.forEach(r),f=$(p),m=i(p,"SPAN",{class:!0});var b=o(m);g=w(b,N),b.forEach(r),p.forEach(r),c.forEach(r),x=$(l),E=i(l,"DIV",{class:!0});var I=o(E);y=i(I,"BUTTON",{class:!0});var C=o(y);k=i(C,"I",{class:!0}),o(k).forEach(r),D=w(C," Restore"),C.forEach(r),T=$(I),O=i(I,"BUTTON",{class:!0});var M=o(O);S=i(M,"I",{class:!0}),o(S).forEach(r),V=w(M," Delete"),M.forEach(r),I.forEach(r),l.forEach(r),A=$(s),s.forEach(r),this.h()},h(){l(m,"class","text-gray-400 text-sm"),l(d,"class","flex flex-col"),l(n,"class","flex-1"),l(k,"class","fas fa-undo"),l(y,"class","rounded px-2 w-24 bg-green-200 hover:bg-green-300"),l(S,"class","fas fa-trash-alt"),l(O,"class","rounded px-2 w-24 bg-red-200 hover:bg-red-300"),l(E,"class","flex gap-2 content-center"),l(a,"class","flex"),l(t,"class","rounded p-2 shadow flex-col")},m(e,s){c(e,t,s),b(t,a),b(a,n),b(n,d),b(d,h),b(h,u),b(d,f),b(d,m),b(m,g),b(a,x),b(a,E),b(E,y),b(y,k),b(y,D),b(E,T),b(E,O),b(O,S),b(O,V),b(t,A),M||(_=[I(y,"click",L),I(O,"click",P)],M=!0)},p(t,a){e=t,2&a&&R!==(R=e[16]+"")&&C(u,R),2&a&&N!==(N=e[7](e[15])+"")&&C(g,N)},d(e){e&&r(t),M=!1,J(_)}}}function at(e){let t;function a(e,t){return e[1].length>0?et:Qe}let n=a(e),d=n(e);return{c(){t=s("ul"),d.c(),this.h()},l(e){t=i(e,"UL",{class:!0,id:!0});var a=o(t);d.l(a),a.forEach(r),this.h()},h(){l(t,"class","p-2 space-y-2 overflow-auto h-56"),l(t,"id","historyList")},m(e,a){c(e,t,a),d.m(t,null)},p(e,s){n===(n=a(e))&&d?d.p(e,s):(d.d(1),d=n(e),d&&(d.c(),d.m(t,null)))},d(e){e&&r(t),d.d()}}}function nt(e){let t,a,n,h,u,f,m,g;return{c(){t=s("div"),a=s("button"),n=s("i"),h=p(),u=s("button"),f=s("i"),this.h()},l(e){t=i(e,"DIV",{slot:!0});var s=o(t);a=i(s,"BUTTON",{id:!0,class:!0,title:!0});var l=o(a);n=i(l,"I",{class:!0}),o(n).forEach(r),l.forEach(r),h=$(s),u=i(s,"BUTTON",{id:!0,class:!0,title:!0});var c=o(u);f=i(c,"I",{class:!0}),o(f).forEach(r),c.forEach(r),s.forEach(r),this.h()},h(){l(n,"class","far fa-save"),l(a,"id","saveHistory"),l(a,"class","btn"),l(a,"title","Save current state"),l(f,"class","fas fa-trash-alt"),l(u,"id","clearHistory"),l(u,"class","btn text-red-400"),l(u,"title","Delete all saved states"),l(t,"slot","actions")},m(s,i){c(s,t,i),b(t,a),b(a,n),b(t,h),b(t,u),b(u,f),m||(g=[I(a,"click",D(e[8])),I(u,"click",D(e[9]))],m=!0)},p:d,d(e){e&&r(t),m=!1,J(g)}}}function st(e){let t,a,n;function s(t){e[12](t)}let i={tabs:e[3],title:"History",$$slots:{actions:[nt],default:[at]},$$scope:{ctx:e}};return void 0!==e[0]&&(i.isOpen=e[0]),t=new Ne({props:i}),m.push((()=>R(t,"isOpen",s))),t.$on("select",e[2]),{c(){P(t.$$.fragment)},l(e){B(t.$$.fragment,e)},m(e,a){U(t,e,a),n=!0},p(e,[n]){const s={};524290&n&&(s.$$scope={dirty:n,ctx:e}),!a&&1&n&&(a=!0,s.isOpen=e[0],G((()=>a=!1))),t.$set(s)},i(e){n||(V(t.$$.fragment,e),n=!0)},o(e){M(t.$$.fragment,e),n=!1},d(e){H(t,e)}}}function it(e,t,a){let n,s;h(e,ie,(e=>a(13,n=e))),h(e,Ze,(e=>a(1,s=e)));const i=(e=!1)=>{const t=ce();var a;(e=>{const t=te(e?Ke:We);return t.length>0?JSON.stringify(t[0].state):""})(e)!==t?((a={state:n,time:Date.now(),auto:e}).name=ee(2),a.auto?Ke.update((e=>(30===e.length&&e.pop(),[a,...e]))):We.update((e=>[a,...e]))):e||alert("State already saved.")},o=e=>{var t;(e||confirm("Clear all saved items?"))&&(t=e,(te(Fe)?Ke:We).update((e=>e.filter((e=>t&&e.time!=t)))))},r=e=>{ie.set(Object.assign(Object.assign({},e),{updateEditor:!0,updateDiagram:!0}))};f((()=>{Fe.set(!1),setInterval((()=>{i(!0)}),6e4)}));let l=!0;return[l,s,e=>{Fe.set("timeline"===e.detail.id)},[{id:"saved",title:"Saved",icon:"far fa-bookmark"},{id:"timeline",title:"Timeline",icon:"fas fa-history"}],i,o,r,e=>{const t=new Date(e);return`${new Date(t).toLocaleString()} (${K(t).fromNow()})`},()=>i(),()=>o(),e=>r(e),e=>o(e),function(e){l=e,a(0,l)}]}class ot extends t{constructor(e){super(),a(this,e,it,st,n,{})}}function rt(e){let t,a,n;function s(t){e[10](t)}let i={language:e[2],errorMarkers:e[3]};return void 0!==e[1]&&(i.text=e[1]),t=new $e({props:i}),m.push((()=>R(t,"text",s))),t.$on("update",e[6]),{c(){P(t.$$.fragment)},l(e){B(t.$$.fragment,e)},m(e,a){U(t,e,a),n=!0},p(e,n){const s={};4&n&&(s.language=e[2]),8&n&&(s.errorMarkers=e[3]),!a&&2&n&&(a=!0,s.text=e[1],G((()=>a=!1))),t.$set(s)},i(e){n||(V(t.$$.fragment,e),n=!0)},o(e){M(t.$$.fragment,e),n=!1},d(e){H(t,e)}}}function lt(e){let t,a,n,h;return{c(){t=s("button"),a=s("i"),this.h()},l(e){t=i(e,"BUTTON",{class:!0,title:!0,"data-cy":!0});var n=o(t);a=i(n,"I",{class:!0}),o(a).forEach(r),n.forEach(r),this.h()},h(){l(a,"class","fas fa-sync"),l(t,"class","bg-indigo-500 hover:bg-indigo-700 rounded px-4 mx-2"),l(t,"title","Sync Diagram"),l(t,"data-cy","sync")},m(e,s){c(e,t,s),b(t,a),n||(h=I(t,"click",fe),n=!0)},p:d,d(e){e&&r(t),n=!1,h()}}}function ct(e){let t,a,n,d,h,u,f,m=!e[0].autoSync&&lt();return{c(){t=s("div"),m&&m.c(),a=p(),n=s("label"),d=s("input"),h=v("\n\t\t\t\t\t\tAuto sync"),this.h()},l(e){t=i(e,"DIV",{slot:!0});var s=o(t);m&&m.l(s),a=$(s),n=i(s,"LABEL",{for:!0,style:!0});var l=o(n);d=i(l,"INPUT",{type:!0,id:!0}),h=w(l,"\n\t\t\t\t\t\tAuto sync"),l.forEach(r),s.forEach(r),this.h()},h(){l(d,"type","checkbox"),l(d,"id","autoSync"),l(n,"for","autoSync"),ne(n,"white-space","nowrap"),ne(n,"overflow","hidden"),ne(n,"text-overflow","ellipsis"),l(t,"slot","actions")},m(s,i){c(s,t,i),m&&m.m(t,null),b(t,a),b(t,n),b(n,d),d.checked=e[0].autoSync,b(n,h),u||(f=I(d,"change",e[9]),u=!0)},p(e,n){e[0].autoSync?m&&(m.d(1),m=null):m?m.p(e,n):(m=lt(),m.c(),m.m(t,a)),1&n&&(d.checked=e[0].autoSync)},d(e){e&&r(t),m&&m.d(),u=!1,f()}}}function dt(e){let t,a,n;return a=new de({}),{c(){t=s("div"),P(a.$$.fragment),this.h()},l(e){t=i(e,"DIV",{class:!0});var n=o(t);B(a.$$.fragment,n),n.forEach(r),this.h()},h(){l(t,"class","flex-1 overflow-auto")},m(e,s){c(e,t,s),U(a,t,null),n=!0},i(e){n||(V(a.$$.fragment,e),n=!0)},o(e){M(a.$$.fragment,e),n=!1},d(e){e&&r(t),H(a)}}}function ht(e){let t,a,n,h,u;return{c(){t=s("button"),a=s("i"),n=v(" View"),this.h()},l(e){t=i(e,"BUTTON",{slot:!0,class:!0,title:!0});var s=o(t);a=i(s,"I",{class:!0}),o(a).forEach(r),n=w(s," View"),s.forEach(r),this.h()},h(){l(a,"class","far fa-eye"),l(t,"slot","actions"),l(t,"class","btn"),l(t,"title","View diagram in new page")},m(s,i){c(s,t,i),b(t,a),b(t,n),h||(u=I(t,"click",D(e[11])),h=!0)},p:d,d(e){e&&r(t),h=!1,u()}}}function ut(e){let t,a,n,d,h,u,f,m,g,x,E,y,k,I,D,C,T,O,S,A,_,R;return a=new ye({}),u=new Ne({props:{tabs:e[5],isCloseable:!1,title:"Mermaid",$$slots:{actions:[ct],default:[rt]},$$scope:{ctx:e}}}),u.$on("select",e[4]),g=new He({}),E=new ot({}),k=new Je({}),O=new Ne({props:{title:"Diagram",isCloseable:!1,$$slots:{actions:[ht],default:[dt]},$$scope:{ctx:e}}}),{c(){t=s("div"),P(a.$$.fragment),n=p(),d=s("div"),h=s("div"),P(u.$$.fragment),f=p(),m=s("div"),P(g.$$.fragment),x=p(),P(E.$$.fragment),y=p(),P(k.$$.fragment),I=p(),D=s("div"),C=p(),T=s("div"),P(O.$$.fragment),S=p(),A=s("div"),_=v("Code editing not supported on mobile. Please use a desktop browser."),this.h()},l(e){t=i(e,"DIV",{class:!0});var s=o(t);B(a.$$.fragment,s),n=$(s),d=i(s,"DIV",{class:!0});var l=o(d);h=i(l,"DIV",{class:!0,id:!0,style:!0});var c=o(h);B(u.$$.fragment,c),f=$(c),m=i(c,"DIV",{class:!0});var p=o(m);B(g.$$.fragment,p),x=$(p),B(E.$$.fragment,p),y=$(p),B(k.$$.fragment,p),p.forEach(r),c.forEach(r),I=$(l),D=i(l,"DIV",{id:!0,class:!0}),o(D).forEach(r),C=$(l),T=i(l,"DIV",{class:!0});var v=o(T);B(O.$$.fragment,v),S=$(v),A=i(v,"DIV",{class:!0});var b=o(A);_=w(b,"Code editing not supported on mobile. Please use a desktop browser."),b.forEach(r),v.forEach(r),l.forEach(r),s.forEach(r),this.h()},h(){l(m,"class","-mt-2"),l(h,"class","hidden md:flex flex-col"),l(h,"id","editorPane"),ne(h,"width","40%"),l(D,"id","resizeHandler"),l(D,"class","svelte-ub8fux"),l(A,"class","md:hidden bg-white rounded shadow p-2 mx-2"),l(T,"class","flex-1 flex flex-col overflow-hidden"),l(d,"class","flex-1 flex overflow-hidden"),l(t,"class","h-full flex flex-col overflow-hidden bg-gray-100")},m(e,s){c(e,t,s),U(a,t,null),b(t,n),b(t,d),b(d,h),U(u,h,null),b(h,f),b(h,m),U(g,m,null),b(m,x),U(E,m,null),b(m,y),U(k,m,null),b(d,I),b(d,D),b(d,C),b(d,T),U(O,T,null),b(T,S),b(T,A),b(A,_),R=!0},p(e,[t]){const a={};262159&t&&(a.$$scope={dirty:t,ctx:e}),u.$set(a);const n={};262144&t&&(n.$$scope={dirty:t,ctx:e}),O.$set(n)},i(e){R||(V(a.$$.fragment,e),V(u.$$.fragment,e),V(g.$$.fragment,e),V(E.$$.fragment,e),V(k.$$.fragment,e),V(O.$$.fragment,e),R=!0)},o(e){M(a.$$.fragment,e),M(u.$$.fragment,e),M(g.$$.fragment,e),M(E.$$.fragment,e),M(k.$$.fragment,e),M(O.$$.fragment,e),R=!1},d(e){e&&r(t),H(a),H(u),H(g),H(E),H(k),H(O)}}}function ft(e,t,a){let n,s;h(e,ie,(e=>a(0,n=e))),h(e,le,(e=>a(12,s=e)));var i=this&&this.__awaiter||function(e,t,a,n){return new(a||(a=Promise))((function(s,i){function o(e){try{l(n.next(e))}catch(t){i(t)}}function r(e){try{l(n.throw(e))}catch(t){i(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof a?t:new a((function(e){e(t)}))).then(o,r)}l((n=n.apply(e,t||[])).next())}))};const o=window.mermaid;let r="code";const l={code:"mermaid",config:"json"};let c="",d="mermaid",u=[];ie.subscribe((e=>{e.updateEditor&&a(1,c="code"===r?e.code:e.mermaid)}));const m=()=>i(void 0,void 0,void 0,(function*(){window.open(`${ge}/view#${s}`,"_blank").focus()}));f((()=>{ue();const e=document.getElementById("resizeHandler"),t=document.getElementById("editorPane"),a=e=>{const a=e.pageX-t.getBoundingClientRect().left;a>50&&(t.style.width=a+"px")},n=()=>{window.removeEventListener("mousemove",a)};e.addEventListener("mousedown",(e=>{e.preventDefault(),window.addEventListener("mousemove",a),window.addEventListener("mouseup",n)}))}));return e.$$.update=()=>{256&e.$$.dirty&&a(2,d=l[r]),257&e.$$.dirty&&a(1,c="code"===r?n.code:n.mermaid)},[n,c,d,u,e=>{se(ie,n.updateEditor=!0,n),a(8,r=e.detail.id)},[{id:"code",title:"Code",icon:"fas fa-code"},{id:"config",title:"Config",icon:"fas fa-cogs"}],e=>i(void 0,void 0,void 0,(function*(){try{"code"===r?yield(n=e.detail.text,i(void 0,void 0,void 0,(function*(){o.parse(n),re(n,!1)}))):(t=e.detail.text,JSON.parse(t),me(t,!1)),he.set(void 0),a(3,u=[])}catch(s){if(he.set(s),s.hash){const e={severity:8,startLineNumber:s.hash.loc.first_line,startColumn:s.hash.loc.first_column,endLineNumber:s.hash.loc.last_line,endColumn:s.hash.loc.last_column+1,message:s.str};u.push(e),a(3,u=u.filter((t=>t.startLineNumber>=e.startLineNumber&&t.startColumn>=e.startColumn)))}console.error(s)}var t,n})),m,r,function(){n.autoSync=this.checked,ie.set(n)},function(e){c=e,a(1,c),a(8,r),a(0,n)},()=>m()]}export default class extends t{constructor(e){super(),a(this,e,ft,ut,n,{})}}