From fbbde3652e45b9d142daa2b179e12ff76b306b6b Mon Sep 17 00:00:00 2001 From: github-actions Date: Sat, 29 May 2021 07:39:24 +0000 Subject: [PATCH] Release 2.0.28 --- docs/_app/chunks/util-1700c988.js | 1 + docs/_app/pages/edit.svelte-3502ecb6.js | 1 + docs/_app/pages/view.svelte-1e19d83c.js | 1 + docs/_app/start-da354362.js | 1 + docs/edit/index.html | 4 ++-- docs/index.html | 4 ++-- docs/view/index.html | 4 ++-- package.json | 2 +- 8 files changed, 11 insertions(+), 7 deletions(-) create mode 100644 docs/_app/chunks/util-1700c988.js create mode 100644 docs/_app/pages/edit.svelte-3502ecb6.js create mode 100644 docs/_app/pages/view.svelte-1e19d83c.js create mode 100644 docs/_app/start-da354362.js diff --git a/docs/_app/chunks/util-1700c988.js b/docs/_app/chunks/util-1700c988.js new file mode 100644 index 00000000..97e57490 --- /dev/null +++ b/docs/_app/chunks/util-1700c988.js @@ -0,0 +1 @@ +var e=Object.defineProperty,a=Object.defineProperties,t=Object.getOwnPropertyDescriptors,r=Object.getOwnPropertySymbols,n=Object.prototype.hasOwnProperty,o=Object.prototype.propertyIsEnumerable,s=(a,t,r)=>t in a?e(a,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):a[t]=r,i=(e,a)=>{for(var t in a||(a={}))n.call(a,t)&&s(e,t,a[t]);if(r)for(var t of r(a))o.call(a,t)&&s(e,t,a[t]);return e},c=(e,r)=>a(e,t(r));import{a2 as l,a3 as d,C as p,a4 as u,a0 as m,a6 as f,a9 as y,S as g,i as h,s as v,e as b,c as w,a as O,d as E,b as S,N as T,f as _,F as D,G as j,H as x,z as P,a8 as C,J as A}from"./vendor-de807e42.js";import{_ as I}from"./preload-helper-9f12a5fd.js";let J;let N;const L=l(p({code:"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]\n ",mermaid:JSON.stringify({theme:"default"},null,2),updateEditor:!1,autoSync:!0,updateDiagram:!0}),d(),"codeStore"),k=u([L],(([e],a)=>{a(m(JSON.stringify(e),!0))})),V=e=>{L.update((a=>i(i({},a),e)))};let G=!1;const z=(e,a,t=!1)=>{var r;r=e,J&&(clearTimeout(N),N=setTimeout((function(){const e=r.replace(/^\s*%%.*\n/g,"\n").trimStart().split(" ")[0];console.debug("ga:","send","event","render",e),J.track("render",{graphType:e})}),5e3));if((e.match(/\n/g)||"").length+1>50&&!G&&f(L).autoSync){const e=confirm("Long diagram deteced. Turn off Auto Sync? Click the sync logo to manually sync.");G=!0,e&&V({autoSync:!1})}L.update((r=>c(i({},r),{code:e,updateEditor:a,updateDiagram:t})))},B=(e,a)=>{L.update((t=>c(i({},t),{mermaid:e,updateEditor:a})))},F=()=>JSON.stringify(f(L)),H=p(void 0);function R(e){let a,t;return{c(){a=b("div"),t=b("div"),this.h()},l(e){a=w(e,"DIV",{id:!0,class:!0});var r=O(a);t=w(r,"DIV",{id:!0,class:!0}),O(t).forEach(E),r.forEach(E),this.h()},h(){S(t,"id","container"),S(t,"class","flex-1 overflow-auto"),S(a,"id","view"),S(a,"class","p-2 svelte-7vvt6c"),T(a,"error",e[1]),T(a,"outOfSync",e[2])},m(r,n){_(r,a,n),D(a,t),e[3](t)},p(e,[t]){2&t&&T(a,"error",e[1]),4&t&&T(a,"outOfSync",e[2])},i:j,o:j,d(t){t&&E(a),e[3](null)}}}function $(e,a,t){let r;x(e,L,(e=>t(6,r=e)));var n=this&&this.__awaiter||function(e,a,t,r){return new(t||(t=Promise))((function(n,o){function s(e){try{c(r.next(e))}catch(a){o(a)}}function i(e){try{c(r.throw(e))}catch(a){o(a)}}function c(e){var a;e.done?n(e.value):(a=e.value,a instanceof t?a:new t((function(e){e(a)}))).then(s,i)}c((r=r.apply(e,a||[])).next())}))};const o=window.mermaid;let s,i="",c=!1,l=!1,d=!0;return P((()=>n(void 0,void 0,void 0,(function*(){L.subscribe((e=>{try{if(s&&e&&(e.updateDiagram||e.autoSync)){e.autoSync||C(L,r.updateDiagram=!1,r),t(2,l=!1),d=!0,i=e.code;const a=s.parentElement.parentElement.parentElement.scrollTop;t(0,s.innerHTML=i,s),delete s.dataset.processed,o.initialize(Object.assign({},JSON.parse(e.mermaid))),o.init(s),o.render("graph-div",i),t(0,s.parentElement.parentElement.parentElement.scrollTop=a,s)}else d?d=!1:t(2,l=!0)}catch(a){console.log("view fail",a),t(1,c=!0)}})),H.subscribe((e=>{void 0===e?t(1,c=!1):(t(1,c=!0),console.log("Error: ",e))}))})))),[s,c,l,function(e){A[e?"unshift":"push"]((()=>{s=e,t(0,s)}))}]}class M extends g{constructor(e){super(),h(this,e,$,R,v,{})}}const U=()=>{(e=>{let a;try{const t=y(e);console.log(`Tring to load state: ${t}`),a=JSON.parse(t),"string"!=typeof a.mermaid&&(a.mermaid=JSON.stringify(a.mermaid,null,2))}catch(t){e&&console.error("Init error",t),a=f(L),console.log(a)}V(c(i({},a),{updateEditor:!0}))})(window.location.hash.slice(1))},q=()=>{V({updateDiagram:!0})},K=async()=>{U(),q(),k.subscribe((e=>{history.replaceState(void 0,void 0,`#${e}`)})),await(async()=>{if(!J)try{const{Analytics:e}=await I((()=>import("./analytics.browser.es-eaddcc60.js")),void 0),a=await I((()=>import("./analytics-plugin-ga.browser.es-9bc8c1dc.js")),void 0);J=e({app:"mermaid-live-editor",plugins:[a.init({trackingId:"UA-153180559-1"})]})}catch{console.info("Analytics blocked ;)")}})(),null==J||J.page()};export{M as V,J as a,k as b,L as c,B as d,H as e,F as g,K as i,q as s,z as u}; diff --git a/docs/_app/pages/edit.svelte-3502ecb6.js b/docs/_app/pages/edit.svelte-3502ecb6.js new file mode 100644 index 00000000..26e64b4d --- /dev/null +++ b/docs/_app/pages/edit.svelte-3502ecb6.js @@ -0,0 +1 @@ +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"../chunks/preload-helper-9f12a5fd.js";function ge(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 pe(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 ve extends t{constructor(e){super(),a(this,e,pe,ge,n,{text:1,language:2,editorOptions:3,errorMarkers:4})}}function $e(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 we(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 be(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{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 De(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 Ce(e){let t,a,n,d,h,u,f,m,g=e[1]&&ke(e),x=e[0]&&e[2]&&Ie(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=ke(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=Ie(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 Te(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 Oe extends t{constructor(e){super(),a(this,e,Te,Ce,n,{isCloseable:1,tabs:2,title:3,isOpen:0})}}const Se=e=>({}),Ve=e=>({});function Ae(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 Me(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 Oe({props:y}),m.push((()=>R(d,"isOpen",E))),d.$on("select",e[7]);const k=e[5].actions,D=N(k,e,e[4],Ve);let C=e[0]&&Ae(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,Se,Ve),e[0]?C?(C.p(e,a),1&a&&V(C,1)):(C=Ae(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 _e(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 Re extends t{constructor(e){super(),a(this,e,_e,Me,n,{isCloseable:1,isOpen:0,tabs:2,title:3})}}function Ne(e,t,a){const n=e.slice();return n[3]=t[a],n}function Le(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 Pe(e){let t,a=Object.keys(e[0]),n=[];for(let s=0;s>+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 Ge extends t{constructor(e){super(),a(this,e,Ue,Be,n,{})}}function He(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 je(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]&&He(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=He(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 Ye(e){let t,a;return t=new Re({props:{title:"Actions",isOpen:!1,$$slots:{default:[je]},$$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 ze(e,t,a){const n=()=>{const e=document.getElementById("container").innerHTML.replaceAll("
","
");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 qe extends t{constructor(e){super(),a(this,e,ze,Ye,n,{})}}const Je=W(X(!0),Z(),"autoHistoryMode"),Fe=W(X([]),Z(),"autoHistoryStore"),Ke=W(X([]),Z(),"manualHistoryStore"),We=Q([Je,Fe,Ke],(([e,t,a],n)=>{n(e?t:a)}));function Ze(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 Xe(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 Qe(e){let t,a=e[1],n=[];for(let s=0;s0?Qe:Xe}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 at(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 nt(e){let t,a,n;function s(t){e[12](t)}let i={tabs:e[3],title:"History",$$slots:{actions:[at],default:[tt]},$$scope:{ctx:e}};return void 0!==e[0]&&(i.isOpen=e[0]),t=new Re({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 st(e,t,a){let n,s;h(e,ie,(e=>a(13,n=e))),h(e,We,(e=>a(1,s=e)));const i=(e=!1)=>{const t=ce();var a;(e=>{const t=te(e?Fe:Ke);return t.length>0?JSON.stringify(t[0].state):""})(e)!==t?((a={state:n,time:Date.now(),auto:e}).name=ee(2),a.auto?Fe.update((e=>(30===e.length&&e.pop(),[a,...e]))):Ke.update((e=>[a,...e]))):e||alert("State already saved.")},o=e=>{var t;(e||confirm("Clear all saved items?"))&&(t=e,(te(Je)?Fe:Ke).update((e=>e.filter((e=>t&&e.time!=t)))))},r=e=>{ie.set(Object.assign(Object.assign({},e),{updateEditor:!0,updateDiagram:!0}))};f((()=>{Je.set(!1),setInterval((()=>{i(!0)}),6e4)}));let l=!0;return[l,s,e=>{Je.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 it extends t{constructor(e){super(),a(this,e,st,nt,n,{})}}function ot(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 ve({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 rt(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 lt(e){let t,a,n,d,h,u,f,m=!e[0].autoSync&&rt();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=rt(),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 ct(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 dt(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 ht(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 Ee({}),u=new Re({props:{tabs:e[5],isCloseable:!1,title:"Mermaid",$$slots:{actions:[lt],default:[ot]},$$scope:{ctx:e}}}),u.$on("select",e[4]),g=new Ge({}),E=new it({}),k=new qe({}),O=new Re({props:{title:"Diagram",isCloseable:!1,$$slots:{actions:[dt],default:[ct]},$$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 ut(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(`/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,ut,ht,n,{})}} diff --git a/docs/_app/pages/view.svelte-1e19d83c.js b/docs/_app/pages/view.svelte-1e19d83c.js new file mode 100644 index 00000000..1b641bb3 --- /dev/null +++ b/docs/_app/pages/view.svelte-1e19d83c.js @@ -0,0 +1 @@ +import{S as s,i as a,s as r,j as e,m as t,o as n,G as o,v as f,r as m,w as u,z as c}from"../chunks/vendor-de807e42.js";import{V as i,i as p}from"../chunks/util-1700c988.js";import"../chunks/preload-helper-9f12a5fd.js";function $(s){let a,r;return a=new i({}),{c(){e(a.$$.fragment)},l(s){t(a.$$.fragment,s)},m(s,e){n(a,s,e),r=!0},p:o,i(s){r||(f(a.$$.fragment,s),r=!0)},o(s){m(a.$$.fragment,s),r=!1},d(s){u(a,s)}}}function d(s){return c(p),[]}export default class extends s{constructor(s){super(),a(this,s,d,$,r,{})}} diff --git a/docs/_app/start-da354362.js b/docs/_app/start-da354362.js new file mode 100644 index 00000000..03e34ac3 --- /dev/null +++ b/docs/_app/start-da354362.js @@ -0,0 +1 @@ +var t=Object.defineProperty,e=Object.defineProperties,r=Object.getOwnPropertyDescriptors,s=Object.getOwnPropertySymbols,a=Object.prototype.hasOwnProperty,o=Object.prototype.propertyIsEnumerable,n=(e,r,s)=>r in e?t(e,r,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[r]=s,i=(t,e)=>{for(var r in e||(e={}))a.call(e,r)&&n(t,r,e[r]);if(s)for(var r of s(e))o.call(e,r)&&n(t,r,e[r]);return t};import{S as l,i as c,s as u,e as h,c as d,a as p,d as f,b as g,f as m,t as _,g as y,h as v,j as b,k as w,l as $,m as x,n as E,o as q,p as R,q as S,r as L,u as k,v as O,w as j,x as U,y as A,z as P,A as T,B as I,C as N}from"./chunks/vendor-de807e42.js";import{_ as C}from"./chunks/preload-helper-9f12a5fd.js";import{i as D,s as V}from"./chunks/paths-7dc55c62.js";function B(t){let e,r,s;const a=[t[2]||{}];var o=t[0][1];function n(t){let e={$$slots:{default:[M]},$$scope:{ctx:t}};for(let r=0;r{j(t,1)})),k()}o?(e=new o(n(t)),b(e.$$.fragment),O(e.$$.fragment,1),q(e,r.parentNode,r)):e=null}else o&&e.$set(i)},i(t){s||(e&&O(e.$$.fragment,t),s=!0)},o(t){e&&L(e.$$.fragment,t),s=!1},d(t){t&&f(r),e&&j(e,t)}}}function K(t){let e,r,s;const a=[t[3]||{}];var o=t[0][2];function n(t){let e={};for(let r=0;r{j(t,1)})),k()}o?(e=new o(n()),b(e.$$.fragment),O(e.$$.fragment,1),q(e,r.parentNode,r)):e=null}else o&&e.$set(i)},i(t){s||(e&&O(e.$$.fragment,t),s=!0)},o(t){e&&L(e.$$.fragment,t),s=!1},d(t){t&&f(r),e&&j(e,t)}}}function M(t){let e,r,s=t[0][2]&&K(t);return{c(){s&&s.c(),e=$()},l(t){s&&s.l(t),e=$()},m(t,a){s&&s.m(t,a),m(t,e,a),r=!0},p(t,r){t[0][2]?s?(s.p(t,r),1&r&&O(s,1)):(s=K(t),s.c(),O(s,1),s.m(e.parentNode,e)):s&&(I(),L(s,1,1,(()=>{s=null})),k())},i(t){r||(O(s),r=!0)},o(t){L(s),r=!1},d(t){s&&s.d(t),t&&f(e)}}}function W(t){let e,r,s=t[0][1]&&B(t);return{c(){s&&s.c(),e=$()},l(t){s&&s.l(t),e=$()},m(t,a){s&&s.m(t,a),m(t,e,a),r=!0},p(t,r){t[0][1]?s?(s.p(t,r),1&r&&O(s,1)):(s=B(t),s.c(),O(s,1),s.m(e.parentNode,e)):s&&(I(),L(s,1,1,(()=>{s=null})),k())},i(t){r||(O(s),r=!0)},o(t){L(s),r=!1},d(t){s&&s.d(t),t&&f(e)}}}function Y(t){let e,r=t[5]&&z(t);return{c(){e=h("div"),r&&r.c(),this.h()},l(t){e=d(t,"DIV",{id:!0,"aria-live":!0,"aria-atomic":!0,class:!0});var s=p(e);r&&r.l(s),s.forEach(f),this.h()},h(){g(e,"id","svelte-announcer"),g(e,"aria-live","assertive"),g(e,"aria-atomic","true"),g(e,"class","svelte-1pdgbjn")},m(t,s){m(t,e,s),r&&r.m(e,null)},p(t,s){t[5]?r?r.p(t,s):(r=z(t),r.c(),r.m(e,null)):r&&(r.d(1),r=null)},d(t){t&&f(e),r&&r.d()}}}function z(t){let e;return{c(){e=_(t[6])},l(r){e=y(r,t[6])},m(t,r){m(t,e,r)},p(t,r){64&r&&v(e,t[6])},d(t){t&&f(e)}}}function G(t){let e,r,s,a;const o=[t[1]||{}];var n=t[0][0];function i(t){let e={$$slots:{default:[W]},$$scope:{ctx:t}};for(let r=0;r{j(t,1)})),k()}n?(e=new n(i(t)),b(e.$$.fragment),O(e.$$.fragment,1),q(e,r.parentNode,r)):e=null}else n&&e.$set(c);t[4]?l?l.p(t,a):(l=Y(t),l.c(),l.m(s.parentNode,s)):l&&(l.d(1),l=null)},i(t){a||(e&&O(e.$$.fragment,t),a=!0)},o(t){e&&L(e.$$.fragment,t),a=!1},d(t){e&&j(e,t),t&&f(r),l&&l.d(t),t&&f(s)}}}function J(t,e,r){let{stores:s}=e,{page:a}=e,{components:o}=e,{props_0:n=null}=e,{props_1:i=null}=e,{props_2:l=null}=e;U("__svelte__",s),A(s.page.notify);let c=!1,u=!1,h=null;return P((()=>{const t=s.page.subscribe((()=>{c&&(r(5,u=!0),r(6,h=document.title||"untitled page"))}));return r(4,c=!0),t})),t.$$set=t=>{"stores"in t&&r(7,s=t.stores),"page"in t&&r(8,a=t.page),"components"in t&&r(0,o=t.components),"props_0"in t&&r(1,n=t.props_0),"props_1"in t&&r(2,i=t.props_1),"props_2"in t&&r(3,l=t.props_2)},t.$$.update=()=>{384&t.$$.dirty&&s.page.set(a)},[o,n,i,l,c,u,h,s,a]}class X extends l{constructor(t){super(),c(this,t,J,G,u,{stores:7,page:8,components:0,props_0:1,props_1:2,props_2:3})}}const F=[()=>C((()=>import("./pages/__layout.svelte-657bd90d.js")),["/mermaid-live-editor/_app/pages/__layout.svelte-657bd90d.js","/mermaid-live-editor/_app/assets/pages/__layout.svelte-2393d987.css","/mermaid-live-editor/_app/chunks/vendor-de807e42.js"]),()=>C((()=>import("./error.svelte-ea02d208.js")),["/mermaid-live-editor/_app/error.svelte-ea02d208.js","/mermaid-live-editor/_app/chunks/vendor-de807e42.js"]),()=>C((()=>import("./pages/index.svelte-6579e0d3.js")),["/mermaid-live-editor/_app/pages/index.svelte-6579e0d3.js","/mermaid-live-editor/_app/chunks/vendor-de807e42.js","/mermaid-live-editor/_app/chunks/paths-7dc55c62.js"]),()=>C((()=>import("./pages/edit.svelte-3502ecb6.js")),["/mermaid-live-editor/_app/pages/edit.svelte-3502ecb6.js","/mermaid-live-editor/_app/assets/pages/edit.svelte-05f3059c.css","/mermaid-live-editor/_app/chunks/vendor-de807e42.js","/mermaid-live-editor/_app/chunks/util-1700c988.js","/mermaid-live-editor/_app/assets/util-53f38408.css","/mermaid-live-editor/_app/chunks/preload-helper-9f12a5fd.js"]),()=>C((()=>import("./pages/view.svelte-1e19d83c.js")),["/mermaid-live-editor/_app/pages/view.svelte-1e19d83c.js","/mermaid-live-editor/_app/chunks/vendor-de807e42.js","/mermaid-live-editor/_app/chunks/util-1700c988.js","/mermaid-live-editor/_app/assets/util-53f38408.css","/mermaid-live-editor/_app/chunks/preload-helper-9f12a5fd.js"])],H=[[/^\/$/,[F[0],F[2]],[F[1]]],[/^\/edit\/?$/,[F[0],F[3]],[F[1]]],[/^\/view\/?$/,[F[0],F[4]],[F[1]]]],Q=[F[0](),F[1]()];function Z(){return{x:pageXOffset,y:pageYOffset}}function tt(t){for(;t&&"A"!==t.nodeName.toUpperCase();)t=t.parentNode;return t}class et{constructor({base:t,routes:e,trailing_slash:r}){this.base=t,this.routes=e,this.trailing_slash=r}init(t){let s;this.renderer=t,t.router=this,this.enabled=!0,"scrollRestoration"in history&&(history.scrollRestoration="manual"),addEventListener("beforeunload",(()=>{history.scrollRestoration="auto"})),addEventListener("load",(()=>{history.scrollRestoration="manual"})),addEventListener("scroll",(()=>{clearTimeout(s),s=setTimeout((()=>{const t=(s=i({},history.state||{}),a={"sveltekit:scroll":Z()},e(s,r(a)));var s,a;history.replaceState(t,document.title,window.location.href)}),50)}));const a=t=>{const e=tt(t.target);e&&e.href&&e.hasAttribute("sveltekit:prefetch")&&this.prefetch(new URL(e.href))};let o;addEventListener("touchstart",a),addEventListener("mousemove",(t=>{clearTimeout(o),o=setTimeout((()=>{a(t)}),20)})),addEventListener("click",(t=>{var e;if(!this.enabled)return;if(t.button||1!==t.which)return;if(t.metaKey||t.ctrlKey||t.shiftKey||t.altKey)return;if(t.defaultPrevented)return;const r=tt(t.target);if(!r)return;if(!r.href)return;const s="object"==typeof r.href&&"SVGAnimatedString"===r.href.constructor.name,a=String(s?r.href.baseVal:r.href);if(a===location.href)return void(location.hash||t.preventDefault());const o=null==(e=r.getAttribute("rel"))?void 0:e.split(/\s+/);if(r.hasAttribute("download")||o&&o.includes("external"))return;if(s?r.target.baseVal:r.target)return;const n=new URL(a);if(!this.owns(n))return;const i=r.hasAttribute("sveltekit:noscroll");history.pushState({},"",n.href),this._navigate(n,i?Z():null,[],n.hash),t.preventDefault()})),addEventListener("popstate",(t=>{if(t.state&&this.enabled){const e=new URL(location.href);this._navigate(e,t.state["sveltekit:scroll"],[])}})),document.body.setAttribute("tabindex","-1"),history.replaceState(history.state||{},"",location.href)}owns(t){return t.origin===location.origin&&t.pathname.startsWith(this.base)}parse(t){if(this.owns(t)){const e=decodeURIComponent(t.pathname.slice(this.base.length)||"/"),r=this.routes.filter((([t])=>t.test(e))),s=new URLSearchParams(t.search);return{id:`${e}?${s}`,routes:r,path:e,query:s}}}async goto(t,{noscroll:e=!1,replaceState:r=!1}={},s){const a=new URL(t,function(t){let e=t.baseURI;if(!e){const r=t.getElementsByTagName("base");e=r.length?r[0].href:t.URL}return e}(document));return this.enabled&&this.owns(a)?(history[r?"replaceState":"pushState"]({},"",t),this._navigate(a,e?Z():null,s,a.hash)):(location.href=a.href,new Promise((()=>{})))}enable(){this.enabled=!0}disable(){this.enabled=!1}async prefetch(t){const e=this.parse(t);if(!e)throw new Error("Attempted to prefetch a URL that does not belong to this app");return this.renderer.load(e)}async _navigate(t,e,r,s){const a=this.parse(t);if(!a)throw new Error("Attempted to navigate to a URL that does not belong to this app");if("/"!==a.path){const t=a.path.endsWith("/");(t&&"never"===this.trailing_slash||!t&&"always"===this.trailing_slash&&!a.path.split("/").pop().includes("."))&&(a.path=t?a.path.slice(0,-1):a.path+"/",history.replaceState({},"",`${a.path}${location.search}`))}this.renderer.notify({path:a.path,query:a.query}),await this.renderer.update(a,r,!1),document.body.focus();const o=s&&document.getElementById(s.slice(1));e?scrollTo(e.x,e.y):o?scrollTo(0,o.getBoundingClientRect().top+scrollY):scrollTo(0,0)}}function rt(t){const e=N(t);let r=!0;return{notify:function(){r=!0,e.update((t=>t))},set:function(t){r=!1,e.set(t)},subscribe:function(t){let s;return e.subscribe((e=>{(void 0===s||r&&e!==s)&&t(s=e)}))}}}function st(t,e){let r=`script[type="svelte-data"][url="${"string"==typeof t?t:t.url}"]`;e&&"string"==typeof e.body&&(r+=`[body="${function(t){let e=5381,r=t.length;if("string"==typeof t)for(;r;)e=33*e^t.charCodeAt(--r);else for(;r;)e=33*e^t[--r];return(e>>>0).toString(36)}(e.body)}"]`);const n=document.querySelector(r);if(n){const t=JSON.parse(n.textContent),{body:e}=t,r=((t,e)=>{var r={};for(var n in t)a.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&s)for(var n of s(t))e.indexOf(n)<0&&o.call(t,n)&&(r[n]=t[n]);return r})(t,["body"]);return Promise.resolve(new Response(e,r))}return fetch(t,e)}class at{constructor({Root:t,fallback:e,target:r,session:s,host:a}){this.Root=t,this.fallback=e,this.host=a,this.router=null,this.target=r,this.started=!1,this.session_id=1,this.invalid=new Set,this.invalidating=null,this.current={page:null,session_id:null,branch:[]},this.cache=new Map,this.loading={id:null,promise:null},this.stores={page:rt({}),navigating:N(null),session:N(s)},this.$session=null,this.root=null;let o=!1;this.stores.session.subscribe((async t=>{if(this.$session=t,!o)return;this.session_id+=1;const e=this.router.parse(new URL(location.href));this.update(e,[],!0)})),o=!0}async start({status:t,error:e,nodes:r,page:s}){const a=[];let o,n,l,c={};try{for(let o=0;o10||e.includes(t.path)))return void(this.router?this.router.goto(a.redirect,{replaceState:!0},[...e,t.path]):location.href=new URL(a.redirect,location.href).href);a=await this._load_error({status:500,error:new Error("Redirect loop"),path:t.path,query:t.query})}a.reload?location.reload():this.started?(this.current=a.state,this.root.$set(a.props),this.stores.navigating.set(null),await 0):this._init(a),dispatchEvent(new CustomEvent("sveltekit:navigation-end")),this.loading.promise=null,this.loading.id=null;const o=a.state.branch[a.state.branch.length-1];o&&!1===o.module.router?this.router.disable():this.router.enable()}load(t){return this.loading.promise=this._get_navigation_result(t,!1),this.loading.id=t.id,this.loading.promise}invalidate(t){return this.invalid.add(t),this.invalidating||(this.invalidating=Promise.resolve().then((async()=>{const t=this.router.parse(new URL(location.href));await this.update(t,[],!0),this.invalidating=null}))),this.invalidating}_init(t){this.current=t.state;const e=document.querySelector("style[data-svelte]");e&&e.remove(),this.root=new this.Root({target:this.target,props:i({stores:this.stores},t.props),hydrate:!0}),this.started=!0}async _get_navigation_result(t,e){if(this.loading.id===t.id)return this.loading.promise;for(let r=0;rt())),a+=1}const o=await this._load({route:s,path:t.path,query:t.query},e);if(o)return o}return await this._load_error({status:404,error:new Error(`Not found: ${t.path}`),path:t.path,query:t.query})}async _get_navigation_result_from_branch({page:t,branch:e}){const r=e.filter(Boolean),s={state:{page:t,branch:e,session_id:this.session_id},props:{components:r.map((t=>t.module.default))}};for(let n=0;n{this.cache.get(e)===s&&this.cache.delete(e),i(),clearTimeout(n)},n=setTimeout(a,1e3*o),i=this.stores.session.subscribe((()=>{r&&a()}));r=!0,this.cache.set(e,s)}return s}async _load_node({status:t,error:e,module:r,page:s,context:a}){const o={module:r,uses:{params:new Set,path:!1,query:!1,session:!1,context:!1,dependencies:[]},loaded:null,context:a},n={};for(const i in s.params)Object.defineProperty(n,i,{get:()=>(o.uses.params.add(i),s.params[i]),enumerable:!0});const l=this.$session;if(r.load){const{started:c}=this,u={page:{host:s.host,params:n,get path(){return o.uses.path=!0,s.path},get query(){return o.uses.query=!0,s.query}},get session(){return o.uses.session=!0,l},get context(){return o.uses.context=!0,i({},a)},fetch(t,e){const r="string"==typeof t?t:t.url,{href:a}=new URL(r,new URL(s.path,document.baseURI));return o.uses.dependencies.push(a),c?fetch(t,e):st(t,e)}};e&&(u.status=t,u.error=e);const h=await r.load.call(null,u);if(!h)return;o.loaded=function(t){if(t.error){const e="string"==typeof t.error?new Error(t.error):t.error,r=t.status;return e instanceof Error?!r||r<400||r>599?(console.warn('"error" returned from load() without a valid status code — defaulting to 500'),{status:500,error:e}):{status:r,error:e}:{status:500,error:new Error(`"error" property returned from load() must be a string or instance of Error, received type "${typeof e}"`)}}if(t.redirect){if(!t.status||3!==Math.floor(t.status/100))return{status:500,error:new Error('"redirect" property returned from load() must be accompanied by a 3xx status code')};if("string"!=typeof t.redirect)return{status:500,error:new Error('"redirect" property returned from load() must be a string')}}return t}(h),o.loaded.context&&(o.context=o.loaded.context)}return o}async _load({route:t,path:e,query:r},s){const a=`${e}?${r}`;if(!s&&this.cache.has(a))return this.cache.get(a);const[o,n,l,c]=t,u=c?c(o.exec(e)):{},h=this.current.page&&{path:e!==this.current.page.path,params:Object.keys(u).filter((t=>this.current.page.params[t]!==u[t])),query:r.toString()!==this.current.page.query.toString(),session:this.session_id!==this.current.session_id},d={host:this.host,path:e,query:r,params:u},p=[];let f={},g=!1,m=200,_=null;n.forEach((t=>t()));t:for(let v=0;vr.uses.params.has(t)))||h.query&&r.uses.query||h.session&&r.uses.session||r.uses.dependencies.some((t=>this.invalid.has(t)))||g&&r.uses.context){t=await this._load_node({module:e,page:d,context:f});const r=v===n.length-1;if(t&&t.loaded){if(t.loaded.error&&(m=t.loaded.status,_=t.loaded.error),t.loaded.redirect)return{redirect:t.loaded.redirect};t.loaded.context&&(g=!0)}else if(r&&e.load)return}else t=r}catch(y){m=500,_=y}if(_){for(;v--;)if(l[v]){let t,e,r=v;for(;!(e=p[r]);)r-=1;try{if(t=await this._load_node({status:m,error:_,module:await l[v](),page:d,context:e.context}),t.loaded.error)continue;p.push(t);break t}catch(y){continue}}return await this._load_error({status:m,error:_,path:e,query:r})}t&&t.loaded&&t.loaded.context&&(f=i(i({},f),t.loaded.context)),p.push(t)}return await this._get_navigation_result_from_branch({page:d,branch:p})}async _load_error({status:t,error:e,path:r,query:s}){const a={host:this.host,path:r,query:s,params:{}},o=await this._load_node({module:await this.fallback[0],page:a,context:{}}),n=[o,await this._load_node({status:t,error:e,module:await this.fallback[1],page:a,context:o&&o.loaded&&o.loaded.context})];return await this._get_navigation_result_from_branch({page:a,branch:n})}}async function ot({paths:t,target:e,session:r,host:s,route:a,spa:o,trailing_slash:n,hydrate:i}){const l=a&&new et({base:t.base,routes:H,trailing_slash:n}),c=new at({Root:X,fallback:Q,target:e,session:r,host:s});D(l),V(t),i&&await c.start(i),a&&l.init(c),o&&l.goto(location.href,{replaceState:!0},[]),dispatchEvent(new CustomEvent("sveltekit:start"))}export{ot as start}; diff --git a/docs/edit/index.html b/docs/edit/index.html index 6618e9bd..37169fd1 100644 --- a/docs/edit/index.html +++ b/docs/edit/index.html @@ -58,14 +58,14 @@ - +