SequenceDiagram/lib/sequence-diagram.min.js

1 line
103 KiB
JavaScript

!function(){var e,t,n;!function(s){function r(e,t){return y.call(e,t)}function i(e,t){var n,s,r,i,a,o,h,l,g,d,c,u=t&&t.split("/"),p=b.map,m=p&&p["*"]||{};if(e){for(a=(e=e.split("/")).length-1,b.nodeIdCompat&&w.test(e[a])&&(e[a]=e[a].replace(w,"")),"."===e[0].charAt(0)&&u&&(e=u.slice(0,u.length-1).concat(e)),g=0;g<e.length;g++)if("."===(c=e[g]))e.splice(g,1),g-=1;else if(".."===c){if(0===g||1===g&&".."===e[2]||".."===e[g-1])continue;g>0&&(e.splice(g-1,2),g-=2)}e=e.join("/")}if((u||m)&&p){for(g=(n=e.split("/")).length;g>0;g-=1){if(s=n.slice(0,g).join("/"),u)for(d=u.length;d>0;d-=1)if((r=p[u.slice(0,d).join("/")])&&(r=r[s])){i=r,o=g;break}if(i)break;!h&&m&&m[s]&&(h=m[s],l=g)}!i&&h&&(i=h,o=l),i&&(n.splice(0,o,i),e=n.join("/"))}return e}function a(e,t){return function(){var n=k.call(arguments,0);return"string"!=typeof n[0]&&1===n.length&&n.push(null),c.apply(s,n.concat([e,t]))}}function o(e){return function(t){m[e]=t}}function h(e){if(r(f,e)){var t=f[e];delete f[e],x[e]=!0,d.apply(s,t)}if(!r(m,e)&&!r(x,e))throw new Error("No "+e);return m[e]}function l(e){var t,n=e?e.indexOf("!"):-1;return n>-1&&(t=e.substring(0,n),e=e.substring(n+1,e.length)),[t,e]}function g(e){return e?l(e):[]}var d,c,u,p,m={},f={},b={},x={},y=Object.prototype.hasOwnProperty,k=[].slice,w=/\.js$/;u=function(e,t){var n,s=l(e),r=s[0],a=t[1];return e=s[1],r&&(n=h(r=i(r,a))),r?e=n&&n.normalize?n.normalize(e,function(e){return function(t){return i(t,e)}}(a)):i(e,a):(r=(s=l(e=i(e,a)))[0],e=s[1],r&&(n=h(r))),{f:r?r+"!"+e:e,n:e,pr:r,p:n}},p={require:function(e){return a(e)},exports:function(e){var t=m[e];return void 0!==t?t:m[e]={}},module:function(e){return{id:e,uri:"",exports:m[e],config:function(e){return function(){return b&&b.config&&b.config[e]||{}}}(e)}}},d=function(e,t,n,i){var l,d,c,b,y,k,w,A=[],v=typeof n;if(i=i||e,k=g(i),"undefined"===v||"function"===v){for(t=!t.length&&n.length?["require","exports","module"]:t,y=0;y<t.length;y+=1)if(b=u(t[y],k),"require"===(d=b.f))A[y]=p.require(e);else if("exports"===d)A[y]=p.exports(e),w=!0;else if("module"===d)l=A[y]=p.module(e);else if(r(m,d)||r(f,d)||r(x,d))A[y]=h(d);else{if(!b.p)throw new Error(e+" missing "+d);b.p.load(b.n,a(i,!0),o(d),{}),A[y]=m[d]}c=n?n.apply(m[e],A):void 0,e&&(l&&l.exports!==s&&l.exports!==m[e]?m[e]=l.exports:c===s&&w||(m[e]=c))}else e&&(m[e]=n)},e=t=c=function(e,t,n,r,i){if("string"==typeof e)return p[e]?p[e](t):h(u(e,g(t)).f);if(!e.splice){if((b=e).deps&&c(b.deps,b.callback),!t)return;t.splice?(e=t,t=n,n=null):e=s}return t=t||function(){},"function"==typeof n&&(n=r,r=i),r?d(s,e,t,n):setTimeout(function(){d(s,e,t,n)},4),c},c.config=function(e){return c(e)},e._defined=m,(n=function(e,t,n){if("string"!=typeof e)throw new Error("See almond README: incorrect module build, no module name");t.splice||(n=t,t=[]),r(m,e)||r(f,e)||(f[e]=[e,t,n])}).amd={jQuery:!0}}(),n("../node_modules/almond/almond",function(){}),n("core/EventObject",[],()=>{"use strict";return class{constructor(){this.listeners=new Map,this.forwards=new Set}addEventListener(e,t){const n=this.listeners.get(e);n?n.push(t):this.listeners.set(e,[t])}removeEventListener(e,t){const n=this.listeners.get(e);if(!n)return;const s=n.indexOf(t);-1!==s&&n.splice(s,1)}countEventListeners(e){return(this.listeners.get(e)||[]).length}removeAllEventListeners(e){e?this.listeners.delete(e):this.listeners.clear()}addEventForwarding(e){this.forwards.add(e)}removeEventForwarding(e){this.forwards.delete(e)}removeAllEventForwardings(){this.forwards.clear()}trigger(e,t=[]){(this.listeners.get(e)||[]).forEach(e=>e.apply(null,t)),this.forwards.forEach(n=>n.trigger(e,t))}}}),n("core/ArrayUtilities",[],()=>{"use strict";function e(e,t,n=null){if(null===n)return e.indexOf(t);for(let s=0;s<e.length;++s)if(n(e[s],t))return s;return-1}function t(e,n,s,r){if(n>=e.length)return void r.push(s.slice());const i=e[n];if(!Array.isArray(i))return s.push(i),t(e,n+1,s,r),void s.pop();for(let a=0;a<i.length;++a)s.push(i[a]),t(e,n+1,s,r),s.pop()}return{indexOf:e,mergeSets:function(t,n=null,s=null){if(n)for(let r=0;r<n.length;++r)-1===e(t,n[r],s)&&t.push(n[r])},hasIntersection:function(t,n,s=null){for(let r=0;r<n.length;++r)if(-1!==e(t,n[r],s))return!0;return!1},removeAll:function(t,n=null,s=null){if(n)for(let r=0;r<n.length;++r){const i=e(t,n[r],s);-1!==i&&t.splice(i,1)}},remove:function(t,n,s=null){const r=e(t,n,s);-1!==r&&t.splice(r,1)},last:function(e){return e[e.length-1]},combine:function(e){const n=[];return t(e,0,[],n),n},flatMap:function(e,t){const n=[];return e.forEach(e=>{n.push(...t(e))}),n}}}),n("sequence/CodeMirrorMode",["core/ArrayUtilities"],e=>{"use strict";function t(e,t,n,s){return""===t?function(e,t,n){return"object"==typeof n.suggest&&n.suggest.global?[n.suggest]:"string"!=typeof n.suggest||t.suggest===n.suggest?null:e["known"+n.suggest]}(e,n,s):!0===s.suggest?[function(e,t){return Object.keys(t.then).length>0?e+" ":e+"\n"}(t,s)]:Array.isArray(s.suggest)?s.suggest:s.suggest?[s.suggest]:null}function n(n,s){const r=[],i=e.last(s);return Object.keys(i.then).forEach(a=>{let o=i.then[a];"number"==typeof o&&(o=s[s.length-o-1]),e.mergeSets(r,t(n,a,i,o))}),r}function s(t,n,s,{suggest:r,override:i}){n.type&&r!==n.type&&(i&&(n.type=i),e.mergeSets(t["known"+n.type],[n.value+" "]),n.type="",n.value=""),"string"==typeof r&&t["known"+r]&&(n.type=r,n.value&&(n.value+=s.s),n.value+=s.v)}function r(t,r,i){const o={type:"",value:""};let h=i;const l=[h];return t.line.forEach((r,i)=>{i===t.line.length-1&&(t.completions=n(t,l));const g=r.q?"":r.v,d=h.then[g]||h.then[""];"number"==typeof d?l.length-=d:l.push(d||a),h=e.last(l),s(t,o,r,h)}),r&&s(t,o,null,{}),t.nextCompletions=n(t,l),t.valid=Boolean(h.then["\n"])||0===Object.keys(h.then).length,h.type}function i(e){const t=e.baseToken||{};return{value:t.v||"",quoted:t.q||!1}}const a={type:"error line-error",then:{"":0}},o=(()=>{function e(e){return{type:"string",then:Object.assign({"":0},e)}}function t(e){return{type:"variable",suggest:"Agent",then:Object.assign({},e,{"":0,",":{type:"operator",suggest:!0,then:{"":1}}})}}function n(e){return{type:"keyword",suggest:[e+" of ",e+": "],then:{of:{type:"keyword",suggest:!0,then:{"":h}},":":{type:"operator",suggest:!0,then:{"":i}},"":h}}}function s(e){const t={type:"operator",suggest:!0,then:{"+":a,"-":a,"*":a,"!":a,"":e}};return{"+":{type:"operator",suggest:!0,then:{"+":a,"-":a,"*":t,"!":a,"":e}},"-":{type:"operator",suggest:!0,then:{"+":a,"-":a,"*":t,"!":{type:"operator",then:{"+":a,"-":a,"*":a,"!":a,"":e}},"":e}},"*":{type:"operator",suggest:!0,then:{"+":t,"-":t,"*":a,"!":a,"":e}},"!":t,"":e}}const r={type:"",suggest:"\n",then:{}},i=e({"\n":r}),o={type:"variable",suggest:"Agent",then:{"":0,"\n":r,",":{type:"operator",suggest:!0,then:{"":1}},as:{type:"keyword",suggest:!0,then:{"":{type:"variable",suggest:"Agent",then:{"":0,",":{type:"operator",suggest:!0,then:{"":3}},"\n":r}}}}}},h=t({":":{type:"operator",suggest:!0,then:{"":i}}}),l={type:"variable",suggest:"Agent",then:{"":0,",":{type:"operator",suggest:!0,then:{"":h}},":":a}},g={type:"variable",suggest:"Agent",then:{"":0,",":a,":":{type:"operator",suggest:!0,then:{"":i}}}},d={type:"variable",suggest:"Agent",then:{"":0,":":{type:"operator",suggest:!0,then:{"":i,"\n":{type:"",then:{}}}},"\n":r}},c={":":{type:"operator",suggest:!0,then:{"":e({as:{type:"keyword",suggest:!0,then:{"":{type:"variable",suggest:"Agent",then:{"":0,"\n":r}}}}})}}},u={type:"keyword",suggest:!0,then:Object.assign({over:{type:"keyword",suggest:!0,then:{"":t(c)}}},c)},p={title:{type:"keyword",suggest:!0,then:{"":i}},theme:{type:"keyword",suggest:!0,then:{"":{type:"string",suggest:{global:"themes",suffix:"\n"},then:{"":0,"\n":r}}}},headers:{type:"keyword",suggest:!0,then:{none:{type:"keyword",suggest:!0,then:{}},cross:{type:"keyword",suggest:!0,then:{}},box:{type:"keyword",suggest:!0,then:{}},fade:{type:"keyword",suggest:!0,then:{}},bar:{type:"keyword",suggest:!0,then:{}}}},terminators:{type:"keyword",suggest:!0,then:{none:{type:"keyword",suggest:!0,then:{}},cross:{type:"keyword",suggest:!0,then:{}},box:{type:"keyword",suggest:!0,then:{}},fade:{type:"keyword",suggest:!0,then:{}},bar:{type:"keyword",suggest:!0,then:{}}}},define:{type:"keyword",suggest:!0,then:{"":o,as:a}},begin:{type:"keyword",suggest:!0,then:{"":o,reference:u,as:a}},end:{type:"keyword",suggest:!0,then:{"":o,as:a,"\n":r}},if:{type:"keyword",suggest:!0,then:{"":i,":":{type:"operator",suggest:!0,then:{"":i}},"\n":r}},else:{type:"keyword",suggest:["else\n","else if: "],then:{if:{type:"keyword",suggest:"if: ",then:{"":i,":":{type:"operator",suggest:!0,then:{"":i}}}},"\n":r}},repeat:{type:"keyword",suggest:!0,then:{"":i,":":{type:"operator",suggest:!0,then:{"":i}},"\n":r}},note:{type:"keyword",suggest:!0,then:{over:{type:"keyword",suggest:!0,then:{"":h}},left:n("left"),right:n("right"),between:{type:"keyword",suggest:!0,then:{"":l}}}},state:{type:"keyword",suggest:"state over ",then:{over:{type:"keyword",suggest:!0,then:{"":g}}}},text:{type:"keyword",suggest:!0,then:{left:n("left"),right:n("right")}},autolabel:{type:"keyword",suggest:!0,then:{off:{type:"keyword",suggest:!0,then:{}},"":i}},simultaneously:{type:"keyword",suggest:!0,then:{":":{type:"operator",suggest:!0,then:{}},with:{type:"keyword",suggest:!0,then:{"":{type:"variable",suggest:"Label",then:{"":0,":":{type:"operator",suggest:!0,then:{}}}}}}}}};return e=>({type:"error line-error",then:Object.assign({},p,function(e){const t={type:"keyword",suggest:!0,then:s(d)},n={"":0};return e.forEach(e=>n[e]=t),n[":"]={type:"operator",suggest:!0,override:"Label",then:{}},s({type:"variable",suggest:"Agent",then:n})}(e))})})();return class{constructor(e,t){this.tokenDefinitions=e,this.commands=o(t),this.lineComment="#"}startState(){return{currentType:-1,current:"",currentSpace:"",currentQuoted:!1,knownAgent:[],knownLabel:[],beginCompletions:n({},[this.commands]),completions:[],nextCompletions:[],valid:!0,line:[],indent:0}}_matchPattern(e,t,n){return t?(t.lastIndex=0,e.match(t,n)):null}_tokenBegin(e,t){t.currentSpace="";let n="";for(;;){if(e.eol())return!1;t.currentSpace+=n;for(let n=0;n<this.tokenDefinitions.length;++n){const s=this.tokenDefinitions[n];if(this._matchPattern(e,s.start,!0)){t.currentType=n;const{value:e,quoted:r}=i(s);return t.current=e,t.currentQuoted=r,!0}}n=e.next()}}_tokenCheckEscape(e,t,n){const s=this._matchPattern(e,n.escape,!0);s&&(t.current+=n.escapeWith(s))}_addToken(e){e.line.push({v:e.current,s:e.currentSpace,q:e.currentQuoted})}_tokenEndFound(e,t,n){return t.currentType=-1,n.omit?"comment":(this._addToken(t),r(t,e.eol(),this.commands))}_tokenEOLFound(e,t,n){if(t.current+="\n",n.omit)return"comment";this._addToken(t);const s=r(t,!1,this.commands);return t.line.pop(),s}_tokenEnd(e,t){for(;;){const n=this.tokenDefinitions[t.currentType];if(this._tokenCheckEscape(e,t,n),!n.end||this._matchPattern(e,n.end,!0))return this._tokenEndFound(e,t,n);if(e.eol())return this._tokenEOLFound(e,t,n);t.current+=e.next()}}token(e,t){t.completions=t.nextCompletions,e.sol()&&-1===t.currentType&&(t.line.length=0);let n="";return(-1!==t.currentType||this._tokenBegin(e,t))&&(n=this._tokenEnd(e,t)),-1===t.currentType&&e.eol()&&!t.valid?"line-error "+n:n}indent(e){return e.indent}}}),n("sequence/Tokeniser",["./CodeMirrorMode"],e=>{"use strict";function t(e,t,n){return t.lastIndex=n,t.exec(e)}function n(e){return"n"===e[1]?"\n":e[1]}function s(e,n,s){return s?function(e,n,s){if(s.escape){const r=t(e,s.escape,n);if(r)return{newBlock:null,end:!1,appendSpace:"",appendValue:s.escapeWith(r),skip:r[0].length}}const r=t(e,s.end,n);return r?{newBlock:null,end:!0,appendSpace:"",appendValue:"",skip:r[0].length}:{newBlock:null,end:!1,appendSpace:"",appendValue:e[n],skip:1}}(e,n,s):function(e,n){for(let s=0;s<i.length;++s){const r=i[s],a=t(e,r.start,n);if(a)return{newBlock:r,end:!r.end,appendSpace:"",appendValue:"",skip:a[0].length}}return{newBlock:null,end:!1,appendSpace:e[n],appendValue:"",skip:1}}(e,n)}function r(e){return{i:e.i,ln:e.ln,ch:e.ch}}const i=[{start:/#/y,end:/(?=\n)|$/y,omit:!0},{start:/"/y,end:/"/y,escape:/\\(.)/y,escapeWith:n,baseToken:{q:!0}},{start:/'/y,end:/'/y,escape:/\\(.)/y,escapeWith:n,baseToken:{q:!0}},{start:/(?=[^ \t\r\n:+\-~*!<>,])/y,end:/(?=[ \t\r\n:+\-~*!<>,])|$/y},{start:/(?=[\-~<>])/y,end:/(?=[^\-~<>])|$/y},{start:/,/y,baseToken:{v:","}},{start:/:/y,baseToken:{v:":"}},{start:/!/y,baseToken:{v:"!"}},{start:/\+/y,baseToken:{v:"+"}},{start:/\*/y,baseToken:{v:"*"}},{start:/\n/y,baseToken:{v:"\n"}}];class a{constructor(e){this.src=e,this.block=null,this.token=null,this.pos={i:0,ln:0,ch:0},this.reset()}isOver(){return this.pos.i>this.src.length}reset(){this.token={s:"",v:"",q:!1,b:null,e:null},this.block=null}beginToken(e){this.block=e.newBlock,Object.assign(this.token,this.block.baseToken),this.token.b=r(this.pos)}endToken(){let e=null;return this.block.omit||(this.token.e=r(this.pos),e=this.token),this.reset(),e}advance(){const e=s(this.src,this.pos.i,this.block);return e.newBlock&&this.beginToken(e),this.token.s+=e.appendSpace,this.token.v+=e.appendValue,function(e,t,n){for(let s=0;s<n;++s)++e.ch,"\n"===t[e.i+s]&&(++e.ln,e.ch=0);e.i+=n}(this.pos,this.src,e.skip),e.end?this.endToken():null}}return class{tokenise(e){const t=[],n=new a(e);for(;!n.isOver();){const e=n.advance();e&&t.push(e)}if(n.block)throw new Error("Unterminated literal (began at "+function(e){return"line "+(e.ln+1)+", character "+e.ch}(n.token.b)+")");return t}getCodeMirrorMode(t){return new e(i,t)}splitLines(e){const t=[];let n=[];return e.forEach(e=>{e.q||"\n"!==e.v?n.push(e):n.length>0&&(t.push(n),n=[])}),n.length>0&&t.push(n),t}}}),n("sequence/LabelPatternParser",[],()=>{"use strict";function e(e){const t=s.exec(e);return t&&t[1]?t[1].length:0}function t(t){if("label"===t)return{token:"label"};const n=t.indexOf(" ");let s=null,r=null;return-1===n?(s=t,r=[]):(s=t.substr(0,n),r=t.substr(n+1).split(",")),"inc"===s?function(t){let n=1,s=1,r=0;return t[0]&&(n=Number(t[0]),r=Math.max(r,e(t[0]))),t[1]&&(s=Number(t[1]),r=Math.max(r,e(t[1]))),{start:n,inc:s,dp:r}}(r):"<"+t+">"}const n=/(.*?)<([^<>]*)>/g,s=/\.([0-9]*)/;return function(e){const s=[];let r=null,i=0;for(n.lastIndex=0;r=n.exec(e);)r[1]&&s.push(r[1]),r[2]&&s.push(t(r[2])),i=n.lastIndex;const a=e.substr(i);return a&&s.push(a),s}}),n("sequence/CodeMirrorHints",["core/ArrayUtilities"],e=>{"use strict";function t(e,t){return{text:e,displayText:"\n"===e?"<END>":e.trim(),className:"\n"===e?"pick-virtual":null,from:r.test(e)?t.squashFrom:t.wordFrom,to:i.test(e)?t.squashTo:t.wordTo}}function n({global:e,prefix:t="",suffix:n=""},s){const r=s[e];return r?r.map(e=>t+e+n):[]}const s=/^([ \t]*)(.*)$/,r=/^[ \t\r\n:,]/,i=/[ \t\r\n]$/;return{getHints:function(r,i){const a=r.getCursor(),o=r.getTokenAt(a);let h=o.string;o.end>a.ch&&(h=h.substr(0,a.ch-o.start));const l=s.exec(h);h=l[2];const g=o.start+l[1].length,d=a.ch>0&&o.state.line.length>0;let c=d?o.state.completions:o.state.beginCompletions;d||(c=c.concat(o.state.knownAgent)),function(t,s={}){for(let r=0;r<t.length;)if("object"==typeof t[r]){const i=n(t[r],s);e.mergeSets(t,i),t.splice(r,1)}else++r}(c,r.options.globals);const u=function(e,t,n,s){const r=e.getLine(t),i={wordFrom:{line:t,ch:n},squashFrom:{line:t,ch:n},wordTo:{line:t,ch:s},squashTo:{line:t,ch:s}};return n>0&&" "===r[n-1]&&i.squashFrom.ch--," "===r[s]&&i.squashTo.ch++,i}(r,a.line,g,o.end);let p=!1;const m=c.filter(e=>e.startsWith(h)).map(e=>e!==h+" "||i.completeSingle?t(e,u):(p=!0,null)).filter(e=>null!==e);return p&&m.length>0&&m.unshift(t(h+" ",u)),{list:m,from:u.wordFrom,to:u.wordTo}}}}),n("sequence/Parser",["core/ArrayUtilities","./Tokeniser","./LabelPatternParser","./CodeMirrorHints"],(e,t,n,s)=>{"use strict";function r(e,t=null){let n="";return t&&(n=" at line "+(t.b.ln+1)+", character "+t.b.ch),new Error(e+n)}function i(e,t=0,n=null){if(null===n&&(n=e.length),n<=t)return"";let s=e[t].v;for(let r=t+1;r<n;++r)s+=e[r].s+e[r].v;return s}function a(e){return!e||e.q?null:e.v}function o(e,t,n,s=null){for(let i=0;i<n.length;++i){const o=n[i],h=e[t+i];if(a(h)!==o){if(s)throw r(s+'; expected "'+o+'"',h);return t}}return t+n.length}function h(e,t,n=0){for(let s=n;s<e.length;++s)if(a(e[s])===t)return s;return-1}function l(t,n,s,a){let o=-1;if(a&&(o=h(t,"as",n)),(-1===o||o>=s)&&(o=s),n>=o)throw r("Missing agent name",function(t,n){if(n<t.length)return t[n];const s=e.last(t);return s?{b:s.e}:null}(t,n));return{name:i(t,n,o),alias:i(t,o+1,s)}}function g(e,t,n,{flagTypes:s={},aliases:i=!1}={}){const o=[];let h=t;for(;h<n;++h){const t=e[h],n=a(t),i=s[n];if(!i)break;if(o.includes(i))throw r("Duplicate agent flag: "+n,t);o.push(i)}const{name:g,alias:d}=l(e,h,n,i);return{name:g,alias:d,flags:o}}function d(e,t,n,s){const r=[];let i=-1;for(let o=t;o<n;++o){","===a(e[o])?-1!==i&&(r.push(g(e,i,o,s)),i=-1):-1===i&&(i=o)}return-1!==i&&r.push(g(e,i,n,s)),r}const c={if:{type:"block begin",mode:"if",skip:[]},else:{type:"block split",mode:"else",skip:["if"]},repeat:{type:"block begin",mode:"repeat",skip:[]}},u=(()=>{const t=e.combine([[{tok:"",type:0},{tok:"<",type:1},{tok:"<<",type:2}],[{tok:"-",type:"solid"},{tok:"--",type:"dash"},{tok:"~",type:"wave"}],[{tok:"",type:0},{tok:">",type:1},{tok:">>",type:2}]]).filter(e=>0!==e[0].type||0!==e[2].type),n=new Map;return t.forEach(e=>{n.set(e.map(e=>e.tok).join(""),{line:e[1].type,left:e[0].type,right:e[2].type})}),n})(),p={"*":"begin","+":"start","-":"stop","!":"end"},m=["none","box","cross","fade","bar"],f={text:{mode:"text",types:{left:{type:"note left",skip:["of"],min:0,max:null},right:{type:"note right",skip:["of"],min:0,max:null}}},note:{mode:"note",types:{over:{type:"note over",skip:[],min:0,max:null},left:{type:"note left",skip:["of"],min:0,max:null},right:{type:"note right",skip:["of"],min:0,max:null},between:{type:"note between",skip:[],min:2,max:null}}},state:{mode:"state",types:{over:{type:"note over",skip:[],min:1,max:1}}}},b={define:{type:"agent define"},begin:{type:"agent begin",mode:"box"},end:{type:"agent end",mode:"cross"}},x=[(e,t)=>"title"!==a(e[0])?null:(t.title=i(e,1),!0),(e,t)=>"theme"!==a(e[0])?null:(t.theme=i(e,1),!0),(e,t)=>{if("terminators"!==a(e[0]))return null;const n=a(e[1]);if(!n)throw r("Unspecified termination",e[0]);if(-1===m.indexOf(n))throw r('Unknown termination "'+n+'"',e[1]);return t.terminators=n,!0},(e,t)=>{if("headers"!==a(e[0]))return null;const n=a(e[1]);if(!n)throw r("Unspecified header",e[0]);if(-1===m.indexOf(n))throw r('Unknown header "'+n+'"',e[1]);return t.headers=n,!0},e=>{if("autolabel"!==a(e[0]))return null;let t=null;return t="off"===a(e[1])?"<label>":i(e,1),{type:"label pattern",pattern:n(t)}},e=>{if("end"===a(e[0])&&1===e.length)return{type:"block end"};const t=c[a(e[0])];if(!t)return null;let n=1;return e.length>n&&(n=o(e,n,t.skip,"Invalid block command")),n=o(e,n,[":"]),{type:t.type,mode:t.mode,label:i(e,n)}},e=>{if("begin"!==a(e[0])||"reference"!==a(e[1]))return null;let t=[];const n=h(e,":");if("over"===a(e[2])&&n>3)t=d(e,3,n);else if(2!==n)throw r('Expected ":" or "over"',e[2]);const s=g(e,n+1,e.length,{aliases:!0});if(!s.alias)throw r("Reference must have an alias",e[n]);return{type:"group begin",agents:t,mode:"ref",label:s.name,alias:s.alias}},e=>{const t=b[a(e[0])];return!t||e.length<=1?null:Object.assign({agents:d(e,1,e.length,{aliases:!0})},t)},t=>{if("simultaneously"!==a(t[0]))return null;if(":"!==a(e.last(t)))return null;let n="";if(t.length>2){if("with"!==a(t[1]))return null;n=i(t,2,t.length-1)}return{type:"async",target:n}},e=>{const t=f[a(e[0])],n=h(e,":");if(!t||-1===n)return null;const s=t.types[a(e[1])];if(!s)return null;let l=2;const g=d(e,l=o(e,l,s.skip),n);if(g.length<s.min)throw r("Too few agents for "+t.mode,e[0]);if(null!==s.max&&g.length>s.max)throw r("Too many agents for "+t.mode,e[0]);return{type:s.type,agents:g,mode:t.mode,label:i(e,n+1)}},e=>{let t=h(e,":");-1===t&&(t=e.length);let n=-1,s=null;for(let t=0;t<e.length;++t){const r=u.get(a(e[t]));if(r){n=t,s=r;break}}if(n<=0||n>=t-1)return null;const r={flagTypes:p};return{type:"connect",agents:[g(e,0,n,r),g(e,n+1,t,r)],label:i(e,t+1),options:s}},t=>t.length<2||":"!==a(e.last(t))?null:{type:"mark",name:i(t,0,t.length-1)}],y=new t;return class{getCodeMirrorMode(){return y.getCodeMirrorMode(Array.from(u.keys()))}getCodeMirrorHints(){return s.getHints}parseLines(e){const t={meta:{title:"",theme:"",terminators:"none",headers:"box"},stages:[]};return e.forEach(e=>(function(e,{meta:t,stages:n}){let s=null;for(let n=0;n<x.length&&!(s=x[n](e,t));++n);if(!s)throw r("Unrecognised command: "+i(e),e[0]);"object"==typeof s&&(s.ln=e[0].b.ln,n.push(s))})(e,t)),t}parse(e){const t=y.tokenise(e),n=y.splitLines(t);return this.parseLines(n)}}}),n("sequence/Generator",["core/ArrayUtilities"],e=>{"use strict";function t(e,t){const n=c[e.type];return!(!n||e.type!==t.type)&&!n.check.some(n=>e[n]!==t[n])}function n(t,n){c[t.type].merge.forEach(s=>{e.mergeSets(t[s],n[s])})}function s(e,t){for(let n=0;n<e.length;){t(e[n],n)?e.splice(n,1):++n}}function r(e){s(e,(s,r)=>{for(let i=0;i<r;++i)if(t(e[i],s))return n(e[i],s),!0;return!1})}function i(e){const t=new Set,n=e.map(({type:e})=>e);return n.forEach(e=>{const s=c[e];s&&n.every(t=>e===t||s.siblings.has(t))&&t.add(e)}),t}function a(e,r,i,a){s(a,s=>{if(!e.has(s.type)||!r.has(s.type))return!1;for(let e=0;e<i.length;++e)if(t(i[e],s))return n(i[e],s),!0;return!1})}function o(e){let t=[],n=new Set;for(let s=0;s<e.length;){const o=e[s];let h=null;r(h="parallel"===o.type?o.stages:[o]);const l=i(h);a(n,l,t,h),n=l,t=h,0===h.length?e.splice(s,1):"parallel"===o.type&&1===h.length?(e.splice(s,1,h[0]),++s):++s}}function h(e,t){if("agent begin"===e.type)return e.mode=t,!0;if("parallel"===e.type){let n=!1;return e.stages.forEach(e=>{"agent begin"===e.type&&(e.mode=t,n=!0)}),n}return!1}function l(t,n,s,r=null){e.remove(t,n,d.equals),e.remove(t,s,d.equals);let i=0,a=t.length;if(r){const n=r.map(n=>e.indexOf(t,n,d.equals)).filter(e=>-1!==e);i=n.reduce((e,t)=>Math.min(e,t),t.length),a=n.reduce((e,t)=>Math.max(e,t),i)+1}return t.splice(i,0,n),t.splice(a+1,0,s),{indexL:i,indexR:a+1}}class g{constructor({visible:e=!1,locked:t=!1,blocked:n=!1,highlighted:s=!1,group:r=null,covered:i=!1}={}){this.visible=e,this.locked=t,this.blocked=n,this.highlighted=s,this.group=r,this.covered=i}}g.LOCKED=new g({locked:!0}),g.DEFAULT=new g;const d={equals:(e,t)=>e.name===t.name,make:(e,{anchorRight:t=!1}={})=>({name:e,anchorRight:t}),getName:e=>e.name,hasFlag:(e,t=!0)=>n=>n.flags.includes(e)===t},c={"agent begin":{check:["mode"],merge:["agentNames"],siblings:new Set(["agent highlight"])},"agent end":{check:["mode"],merge:["agentNames"],siblings:new Set(["agent highlight"])},"agent highlight":{check:["highlighted"],merge:["agentNames"],siblings:new Set(["agent begin","agent end"])}},u={"note over":[{name:"[",flags:[]},{name:"]",flags:[]}],"note left":[{name:"[",flags:[]}],"note right":[{name:"]",flags:[]}]};return class{constructor(){this.agentStates=new Map,this.agentAliases=new Map,this.activeGroups=new Map,this.agents=[],this.labelPattern=null,this.blockCount=0,this.nesting=[],this.markers=new Set,this.currentSection=null,this.currentNest=null,this.stageHandlers={"block begin":this.handleBlockBegin.bind(this),"block split":this.handleBlockSplit.bind(this),"block end":this.handleBlockEnd.bind(this),"group begin":this.handleGroupBegin.bind(this),mark:this.handleMark.bind(this),async:this.handleAsync.bind(this),"agent define":this.handleAgentDefine.bind(this),"agent begin":this.handleAgentBegin.bind(this),"agent end":this.handleAgentEnd.bind(this),"label pattern":this.handleLabelPattern.bind(this),connect:this.handleConnect.bind(this),"note over":this.handleNote.bind(this),"note left":this.handleNote.bind(this),"note right":this.handleNote.bind(this),"note between":this.handleNote.bind(this)},this.expandGroupedAgent=this.expandGroupedAgent.bind(this),this.handleStage=this.handleStage.bind(this),this.convertAgent=this.convertAgent.bind(this),this.endGroup=this.endGroup.bind(this)}convertAgent({alias:e,name:t}){if(e){if(this.agentAliases.has(t))throw new Error("Cannot alias "+t+"; it is already an alias");const n=this.agentAliases.get(e);if(n&&n!==e||this.agents.some(t=>t.name===e))throw new Error("Cannot use "+e+" as an alias; it is already in use");this.agentAliases.set(e,t)}return d.make(this.agentAliases.get(t)||t)}addStage(e,t=!0){e&&(void 0===e.ln&&(e.ln=this.latestLine),this.currentSection.stages.push(e),t&&(this.currentNest.hasContent=!0))}addParallelStages(e){const t=e.filter(e=>Boolean(e));if(0!==t.length)return 1===t.length?this.addStage(t[0]):(t.forEach(e=>{void 0===e.ln&&(e.ln=this.latestLine)}),this.addStage({type:"parallel",stages:t}))}defineAgents(t){e.mergeSets(this.currentNest.agents,t,d.equals),e.mergeSets(this.agents,t,d.equals)}getAgentState(e){return this.agentStates.get(e.name)||g.DEFAULT}updateAgentState(e,t){const n=this.agentStates.get(e.name);n?Object.assign(n,t):this.agentStates.set(e.name,new g(t))}validateAgents(e,{allowGrouped:t=!1,rejectGrouped:n=!1}={}){e.forEach(e=>{const s=this.getAgentState(e);if(s.covered)throw new Error("Agent "+e.name+" is hidden behind group");if(n&&null!==s.group)throw new Error("Agent "+e.name+" is in a group");if(s.blocked&&(!t||null===s.group))throw new Error("Duplicate agent name: "+e.name);if(e.name.startsWith("__"))throw new Error(e.name+" is a reserved name")})}setAgentVis(e,t,n,s=!1){const r=new Set,i=e.filter(e=>{if(r.has(e.name))return!1;r.add(e.name);const n=this.getAgentState(e);if(n.locked||n.blocked){if(s)throw new Error("Cannot begin/end agent: "+e.name);return!1}return n.visible!==t});return 0===i.length?null:(i.forEach(e=>{this.updateAgentState(e,{visible:t})}),this.defineAgents(i),{type:t?"agent begin":"agent end",agentNames:i.map(d.getName),mode:n})}setAgentHighlight(e,t,n=!1){const s=e.filter(e=>{const s=this.getAgentState(e);if(s.locked||s.blocked){if(n)throw new Error("Cannot highlight agent: "+e.name);return!1}return s.visible&&s.highlighted!==t});return 0===s.length?null:(s.forEach(e=>{this.updateAgentState(e,{highlighted:t})}),{type:"agent highlight",agentNames:s.map(d.getName),highlighted:t})}beginNested(e,t,n,s){const r=d.make(n+"[",{anchorRight:!0}),i=d.make(n+"]"),a=[r,i],o=[];return this.currentSection={header:{type:"block begin",mode:e,label:t,left:r.name,right:i.name,ln:s},stages:o},this.currentNest={mode:e,agents:a,leftAgent:r,rightAgent:i,hasContent:!1,sections:[this.currentSection]},this.agentStates.set(r.name,g.LOCKED),this.agentStates.set(i.name,g.LOCKED),this.nesting.push(this.currentNest),{agents:a,stages:o}}nextBlockName(){const e="__BLOCK"+this.blockCount;return++this.blockCount,e}handleBlockBegin({ln:e,mode:t,label:n}){this.beginNested(t,n,this.nextBlockName(),e)}handleBlockSplit({ln:e,mode:t,label:n}){if("if"!==this.currentNest.mode)throw new Error('Invalid block nesting ("else" inside '+this.currentNest.mode+")");o(this.currentSection.stages),this.currentSection={header:{type:"block split",mode:t,label:n,left:this.currentNest.leftAgent.name,right:this.currentNest.rightAgent.name,ln:e},stages:[]},this.currentNest.sections.push(this.currentSection)}handleBlockEnd(){if(this.nesting.length<=1)throw new Error('Invalid block nesting (too many "end"s)');o(this.currentSection.stages);const t=this.nesting.pop();if(this.currentNest=e.last(this.nesting),this.currentSection=e.last(this.currentNest.sections),!t.hasContent)throw new Error("Empty block");this.defineAgents(t.agents),l(this.agents,t.leftAgent,t.rightAgent,t.agents),t.sections.forEach(e=>{this.currentSection.stages.push(e.header),this.currentSection.stages.push(...e.stages)}),this.addStage({type:"block end",left:t.leftAgent.name,right:t.rightAgent.name})}makeGroupDetails(t,n){const s=t.map(this.convertAgent);if(this.validateAgents(s,{rejectGrouped:!0}),this.agentStates.has(n))throw new Error("Duplicate agent name: "+n);const r=this.nextBlockName(),i=d.make(r+"[",{anchorRight:!0}),a=d.make(r+"]");this.agentStates.set(i.name,g.LOCKED),this.agentStates.set(a.name,g.LOCKED),this.updateAgentState({name:n},{blocked:!0,group:n}),this.defineAgents(s);const{indexL:o,indexR:h}=l(this.agents,i,a,s),c=[],u=s.slice();for(let e=o+1;e<h;++e)c.push(this.agents[e]);return e.removeAll(c,u,d.equals),{colAgents:s,leftAgent:i,rightAgent:a,agentsContained:u,agentsCovered:c}}handleGroupBegin({agents:e,mode:t,label:n,alias:s}){const r=this.makeGroupDetails(e,s);r.agentsContained.forEach(e=>{this.updateAgentState(e,{group:s})}),r.agentsCovered.forEach(e=>{this.updateAgentState(e,{covered:!0})}),this.activeGroups.set(s,r),this.addStage(this.setAgentVis(r.colAgents,!0,"box")),this.addStage({type:"block begin",mode:t,label:n,left:r.leftAgent.name,right:r.rightAgent.name})}endGroup({name:e}){const t=this.activeGroups.get(e);return t?(this.activeGroups.delete(e),t.agentsContained.forEach(e=>{this.updateAgentState(e,{group:null})}),t.agentsCovered.forEach(e=>{this.updateAgentState(e,{covered:!1})}),this.updateAgentState({name:e},{group:null}),{type:"block end",left:t.leftAgent.name,right:t.rightAgent.name}):null}handleMark({name:e}){this.markers.add(e),this.addStage({type:"mark",name:e},!1)}handleAsync({target:e}){if(""!==e&&!this.markers.has(e))throw new Error("Unknown marker: "+e);this.addStage({type:"async",target:e},!1)}handleLabelPattern({pattern:e}){this.labelPattern=e.slice();for(let e=0;e<this.labelPattern.length;++e){const t=this.labelPattern[e];"object"==typeof t&&void 0!==t.start&&(this.labelPattern[e]=Object.assign({current:t.start},t))}}applyLabelPattern(e){let t="";const n={label:e};return this.labelPattern.forEach(e=>{"string"==typeof e?t+=e:void 0!==e.token?t+=n[e.token]:void 0!==e.current&&(t+=e.current.toFixed(e.dp),e.current+=e.inc)}),t}expandGroupedAgent(e){const t=this.getAgentState(e).group;if(!t)return[e];const n=this.activeGroups.get(t);return[n.leftAgent,n.rightAgent]}expandGroupedAgentConnection(t){const n=this.expandGroupedAgent(t[0]),s=this.expandGroupedAgent(t[1]);let r=e.indexOf(this.agents,n[0],d.equals),i=e.indexOf(this.agents,s[0],d.equals);return-1===r&&(r=this.agents.length),-1===i&&(i=this.agents.length),r===i?[e.last(n),e.last(s)]:r<i?[e.last(n),s[0]]:[n[0],e.last(s)]}filterConnectFlags(t){const n=t.filter(d.hasFlag("begin")).map(this.convertAgent),s=t.filter(d.hasFlag("end")).map(this.convertAgent);if(e.hasIntersection(n,s,d.equals))throw new Error("Cannot set agent visibility multiple times");const r=t.filter(d.hasFlag("start")).map(this.convertAgent),i=t.filter(d.hasFlag("stop")).map(this.convertAgent);if(e.mergeSets(i,s),e.hasIntersection(r,i,d.equals))throw new Error("Cannot set agent highlighting multiple times");return this.validateAgents(n),this.validateAgents(s),this.validateAgents(r),this.validateAgents(i),{beginAgents:n,endAgents:s,startAgents:r,stopAgents:i}}handleConnect({agents:t,label:n,options:s}){const r=this.filterConnectFlags(t);let i=t.map(this.convertAgent);this.validateAgents(i,{allowGrouped:!0});const a=e.flatMap(i,this.expandGroupedAgent);this.defineAgents(a);const o=(i=this.expandGroupedAgentConnection(i)).map(d.getName),h=t.filter(d.hasFlag("begin",!1)).map(this.convertAgent);this.addStage(this.setAgentVis(h,!0,"box"));const l={type:"connect",agentNames:o,label:this.applyLabelPattern(n),options:s};this.addParallelStages([this.setAgentVis(r.beginAgents,!0,"box",!0),this.setAgentHighlight(r.startAgents,!0,!0),l,this.setAgentHighlight(r.stopAgents,!1,!0),this.setAgentVis(r.endAgents,!1,"cross",!0)])}handleNote({type:t,agents:n,mode:s,label:r}){let i=null;i=0===n.length?u[t]||[]:n.map(this.convertAgent),this.validateAgents(i,{allowGrouped:!0});const a=(i=e.flatMap(i,this.expandGroupedAgent)).map(d.getName),o=new Set(a).size;if("note between"===t&&o<2)throw new Error("note between requires at least 2 agents");this.addStage(this.setAgentVis(i,!0,"box")),this.defineAgents(i),this.addStage({type:t,agentNames:a,mode:s,label:r})}handleAgentDefine({agents:e}){const t=e.map(this.convertAgent);this.validateAgents(t),this.defineAgents(t)}handleAgentBegin({agents:e,mode:t}){const n=e.map(this.convertAgent);this.validateAgents(n),this.addStage(this.setAgentVis(n,!0,t,!0))}handleAgentEnd({agents:e,mode:t}){const n=e.filter(e=>this.activeGroups.has(e.name)),s=e.filter(e=>!this.activeGroups.has(e.name)).map(this.convertAgent);this.validateAgents(s),this.addParallelStages([this.setAgentHighlight(s,!1),this.setAgentVis(s,!1,t,!0),...n.map(this.endGroup)])}handleStage(e){this.latestLine=e.ln;try{const t=this.stageHandlers[e.type];if(!t)throw new Error("Unknown command: "+e.type);t(e)}catch(t){if("object"==typeof t&&t.message)throw new Error(t.message+" at line "+(e.ln+1))}}generate({stages:e,meta:t={}}){this.agentStates.clear(),this.markers.clear(),this.agentAliases.clear(),this.activeGroups.clear(),this.agents.length=0,this.blockCount=0,this.nesting.length=0,this.labelPattern=[{token:"label"}];const n=this.beginNested("global","","",0);if(e.forEach(this.handleStage),1!==this.nesting.length)throw new Error("Unterminated section at line "+(this.currentSection.header.ln+1));if(this.activeGroups.size>0)throw new Error("Unterminated group");const s=t.terminators||"none";return this.addParallelStages([this.setAgentHighlight(this.agents,!1),this.setAgentVis(this.agents,!1,s)]),l(this.agents,this.currentNest.leftAgent,this.currentNest.rightAgent),o(n.stages),function(e,t){for(let n=0;n<e.length&&!h(e[n],t);++n);}(n.stages,t.headers||"box"),{meta:{title:t.title,theme:t.theme},agents:this.agents.slice(),stages:n.stages}}}}),n("svg/SVGUtilities",[],()=>{"use strict";function e(e,n={}){const s=document.createElementNS(t,e);for(let e in n)n.hasOwnProperty(e)&&s.setAttribute(e,n[e]);return s}const t="http://www.w3.org/2000/svg";return{makeText:function(e=""){return document.createTextNode(e)},make:e,makeContainer:function(n={}){return e("svg",Object.assign({xmlns:t,version:"1.1"},n))},empty:function(e){for(;e.childNodes.length>0;)e.removeChild(e.lastChild)}}}),n("svg/SVGTextBlock",["./SVGUtilities"],e=>{"use strict";function t(e){const t=Number(e["font-size"]);return{size:t,lineHeight:t*(Number(e["line-height"])||1)}}const n=void 0!==window.InstallTrigger;class s{constructor(e,t={}){this.container=e,this.state={attrs:{},text:"",x:0,y:0},this.width=0,this.height=0,this.nodes=[],this.set(t)}_rebuildNodes(t){if(t>this.nodes.length){const n=Object.assign({x:this.state.x},this.state.attrs);for(;this.nodes.length<t;){const t=e.make("text",n),s=e.makeText();t.appendChild(s),this.container.appendChild(t),this.nodes.push({element:t,text:s})}}else for(;this.nodes.length>t;){const{element:e}=this.nodes.pop();this.container.removeChild(e)}}_reset(){this._rebuildNodes(0),this.width=0,this.height=0}_renderText(){if(!this.state.text)return void this._reset();const e=this.state.text.split("\n");this._rebuildNodes(e.length);let t=0;this.nodes.forEach(({text:n,element:s},r)=>{n.nodeValue!==e[r]&&(n.nodeValue=e[r]),t=Math.max(t,s.getComputedTextLength())}),this.width=t}_updateX(){this.nodes.forEach(({element:e})=>{e.setAttribute("x",this.state.x)})}_updateY(){const{size:e,lineHeight:n}=t(this.state.attrs);this.nodes.forEach(({element:t},s)=>{t.setAttribute("y",this.state.y+s*n+e)}),this.height=n*this.nodes.length}firstLine(){return this.nodes.length>0?this.nodes[0].element:null}set(e){const t=Object.assign({},this.state);!function(e,t){for(let n in e)e.hasOwnProperty(n)&&null!==t[n]&&void 0!==t[n]&&(e[n]=t[n])}(this.state,e),this.state.attrs!==t.attrs&&(this._reset(),t.text="");const n=this.nodes.length;this.state.text!==t.text&&this._renderText(),this.state.x!==t.x&&this._updateX(),this.state.y===t.y&&this.nodes.length===n||this._updateY()}}class r{constructor(t){this.testers=e.make("g",{display:n?"block":"none",visibility:"hidden"}),this.container=t,this.cache=new Map}measure(n,s){if(!s)return{width:0,height:0};let r=this.cache.get(n);if(!r){const t=e.makeText(),s=e.make("text",n);s.appendChild(t),this.testers.appendChild(s),r={text:t,node:s},this.cache.set(n,r)}this.testers.parentNode||this.container.appendChild(this.testers);const i=s.split("\n");let a=0;return i.forEach(e=>{r.text.nodeValue=e,a=Math.max(a,r.node.getComputedTextLength())}),{width:a,height:i.length*t(n).lineHeight}}measureHeight(e,n){if(!n)return 0;return n.split("\n").length*t(e).lineHeight}resetCache(){e.empty(this.testers),this.cache.clear()}detach(){this.testers.parentNode&&this.container.removeChild(this.testers)}}return s.SizeTester=r,s}),n("svg/SVGShapes",["./SVGUtilities","./SVGTextBlock"],(e,t)=>{"use strict";function n(t,n){return e.make("rect",Object.assign({},n,t))}return{renderBox:n,renderLine:function(t,n){return e.make("line",Object.assign({},n,t))},renderNote:function(t,n,s){const r=e.make("g"),i=s.x,a=s.x+s.width,o=s.y,h=s.y+s.height;return r.appendChild(e.make("polygon",Object.assign({points:i+" "+o+" "+(a-7)+" "+o+" "+a+" "+(o+7)+" "+a+" "+h+" "+i+" "+h},t))),r.appendChild(e.make("polyline",Object.assign({points:a-7+" "+o+" "+(a-7)+" "+(o+7)+" "+a+" "+(o+7)},n))),r},renderBoxedText:function(e,{x:s,y:r,padding:i,boxAttrs:a,labelAttrs:o,boxLayer:h,labelLayer:l,boxRenderer:g=null,SVGTextBlockClass:d=t}){if(!e)return{width:0,height:0,label:null,box:null};let c=0,u=s;switch(o["text-anchor"]){case"middle":c=.5,u+=(i.left-i.right)/2;break;case"end":c=1,u-=i.right;break;default:c=0,u+=i.left}const p=new d(l,{attrs:o,text:e,x:u,y:r+i.top}),m=p.width+i.left+i.right,f=p.height+i.top+i.bottom;let b=null;return b=g?g({x:u-p.width*c-i.left,y:r,width:m,height:f}):n(a,{x:u-p.width*c-i.left,y:r,width:m,height:f}),h===l?h.insertBefore(b,p.firstLine()):h.appendChild(b),{width:m,height:f,label:p,box:b}},TextBlock:t}}),n("sequence/components/BaseComponent",[],()=>{"use strict";class e{makeState(){}resetState(e){this.makeState(e)}separationPre(){}separation(){}renderPre(){}render(){}}e.cleanRenderPreResult=(({topShift:e=0,agentNames:t=[],asynchronousY:n=null}={},s=null)=>({topShift:e,agentNames:t,asynchronousY:null!==n?n:s}));const t=new Map;return e.register=((e,n)=>{t.set(e,n)}),e.getComponents=(()=>t),e}),n("sequence/components/Block",["./BaseComponent","core/ArrayUtilities","svg/SVGUtilities","svg/SVGShapes"],(e,t,n,s)=>{"use strict";class r extends e{separation({left:e,right:t,mode:n,label:s},r){const i=r.state.blocks.get(e),a=r.theme.getBlock(i.mode).section,o=r.textSizer.measure(a.mode.labelAttrs,n).width+a.mode.padding.left+a.mode.padding.right+r.textSizer.measure(a.label.labelAttrs,s).width+a.label.padding.left+a.label.padding.right;r.addSeparation(e,t,o)}renderPre({left:e,right:t}){return{agentNames:[e,t]}}render({left:e,right:t,mode:r,label:i},a,o=!1){const h=a.state.blocks.get(e),l=a.theme.getBlock(h.mode),g=a.agentInfos.get(e),d=a.agentInfos.get(t);let c=a.primaryY;o||(c+=l.section.padding.bottom);const u=a.makeRegion(),p=s.renderBoxedText(r,{x:g.x,y:c,padding:l.section.mode.padding,boxAttrs:l.section.mode.boxAttrs,boxRenderer:l.section.mode.boxRenderer,labelAttrs:l.section.mode.labelAttrs,boxLayer:h.hold,labelLayer:u,SVGTextBlockClass:a.SVGTextBlockClass}),m=s.renderBoxedText(i,{x:g.x+p.width,y:c,padding:l.section.label.padding,boxAttrs:{fill:"#000000"},labelAttrs:l.section.label.labelAttrs,boxLayer:a.maskLayer,labelLayer:u,SVGTextBlockClass:a.SVGTextBlockClass}),f=Math.max(p.height,m.height);return u.insertBefore(n.make("rect",{x:g.x,y:c,width:d.x-g.x,height:f,fill:"transparent"}),u.firstChild),o||h.hold.appendChild(l.sepRenderer({x1:g.x,y1:c,x2:d.x,y2:c})),c+f+l.section.padding.top}}class i extends r{makeState(e){e.blocks=new Map}resetState(e){e.blocks.clear()}storeBlockInfo(e,t){t.state.blocks.set(e.left,{mode:e.mode,hold:null,startY:null})}separationPre(e,t){this.storeBlockInfo(e,t)}separation(e,n){t.mergeSets(n.visibleAgents,[e.left,e.right]),super.separation(e,n)}renderPre(e,t){this.storeBlockInfo(e,t);const n=t.theme.getBlock(e.mode);return{agentNames:[e.left,e.right],topShift:n.margin.top}}render(e,t){const s=n.make("g");t.blockLayer.appendChild(s);const r=t.state.blocks.get(e.left);return r.hold=s,r.startY=t.primaryY,super.render(e,t,!0)}}class a extends e{separation({left:e,right:n},s){t.removeAll(s.visibleAgents,[e,n])}renderPre({left:e,right:t},n){const s=n.state.blocks.get(e);return{agentNames:[e,t],topShift:n.theme.getBlock(s.mode).section.padding.bottom}}render({left:e,right:t},n){const s=n.state.blocks.get(e),r=n.theme.getBlock(s.mode),i=n.agentInfos.get(e),a=n.agentInfos.get(t);return s.hold.appendChild(r.boxRenderer({x:i.x,y:s.startY,width:a.x-i.x,height:n.primaryY-s.startY})),n.primaryY+r.margin.bottom+n.theme.actionMargin}}return e.register("block begin",new i),e.register("block split",new r),e.register("block end",new a),{BlockBegin:i,BlockSplit:r,BlockEnd:a}}),n("sequence/components/Parallel",["./BaseComponent","core/ArrayUtilities"],(e,t)=>{"use strict";function n(e,n){return t.mergeSets(e.agentNames,n.agentNames),{topShift:Math.max(e.topShift,n.topShift),agentNames:e.agentNames,asynchronousY:function(e=null,t=null){return null===e?t:null===t?e:Math.max(e,t)}(e.asynchronousY,n.asynchronousY)}}class s extends e{separationPre(e,t){e.stages.forEach(e=>{t.components.get(e.type).separationPre(e,t)})}separation(e,t){e.stages.forEach(e=>{t.components.get(e.type).separation(e,t)})}renderPre(t,s){return t.stages.map(t=>{const n=s.components.get(t.type).renderPre(t,s);return e.cleanRenderPreResult(n)}).reduce(n,{topShift:0,agentNames:[],asynchronousY:null})}render(e,t){const n=t.makeRegion;let s=0;return e.stages.forEach(e=>{t.makeRegion=((t,s=null)=>n(t,s||e));const r=t.components.get(e.type).render(e,t)||0;s=Math.max(s,r)}),t.makeRegion=n,s}}return e.register("parallel",new s),s}),n("sequence/components/Marker",["./BaseComponent"],e=>{"use strict";class t extends e{makeState(e){e.marks=new Map}resetState(e){e.marks.clear()}render({name:e},{topY:t,state:n}){n.marks.set(e,t)}}class n extends e{renderPre({target:e},{state:t}){let n=0;return e&&t.marks&&(n=t.marks.get(e)||0),{asynchronousY:n}}}return e.register("mark",new t),e.register("async",new n),{Mark:t,Async:n}}),n("sequence/components/AgentCap",["./BaseComponent","core/ArrayUtilities","svg/SVGUtilities","svg/SVGShapes"],(e,t,n,s)=>{"use strict";class r{separation({label:e},t){const n=t.theme.agentCap.box,s=t.textSizer.measure(n.labelAttrs,e).width+n.padding.left+n.padding.right;return{left:s/2,right:s/2,radius:s/2}}topShift({label:e},t){const n=t.theme.agentCap.box,s=t.textSizer.measureHeight(n.labelAttrs,e)+n.padding.top+n.padding.bottom;return Math.max(0,s-n.arrowBottom)}render(e,{x:t,label:r},i){const a=i.theme.agentCap.box,o=i.makeRegion(),{width:h,height:l}=s.renderBoxedText(r,{x:t,y:e,padding:a.padding,boxAttrs:a.boxAttrs,boxRenderer:a.boxRenderer,labelAttrs:a.labelAttrs,boxLayer:i.shapeLayer,labelLayer:o,SVGTextBlockClass:i.SVGTextBlockClass});return o.insertBefore(n.make("rect",{x:t-h/2,y:e,width:h,height:l,fill:"transparent"}),o.firstChild),{lineTop:0,lineBottom:l,height:l}}}class i{separation(e,t){const n=t.theme.agentCap.cross;return{left:n.size/2,right:n.size/2,radius:0}}topShift(e,t){return t.theme.agentCap.cross.size/2}render(e,{x:t},s){const r=s.theme.agentCap.cross,i=r.size/2;return s.shapeLayer.appendChild(r.render({x:t,y:e+i,radius:i})),s.makeRegion().appendChild(n.make("rect",{x:t-i,y:e,width:2*i,height:2*i,fill:"transparent"})),{lineTop:i,lineBottom:i,height:2*i}}}class a{separation({label:e},t){const n=t.theme.agentCap.box,s=t.textSizer.measure(n.labelAttrs,e).width+n.padding.left+n.padding.right;return{left:s/2,right:s/2,radius:s/2}}topShift(e,t){return t.theme.agentCap.bar.height/2}render(e,{x:t,label:s},r){const i=r.theme.agentCap.box,a=r.theme.agentCap.bar,o=r.textSizer.measure(i.labelAttrs,s).width+i.padding.left+i.padding.right,h=a.height;return r.shapeLayer.appendChild(a.render({x:t-o/2,y:e,width:o,height:h})),r.makeRegion().appendChild(n.make("rect",{x:t-o/2,y:e,width:o,height:h,fill:"transparent"})),{lineTop:0,lineBottom:h,height:h}}}class o{separation({currentRad:e}){return{left:e,right:e,radius:e}}topShift(e,t,n){const s=t.theme.agentCap.fade;return n?s.height:0}render(e,{x:t,label:s},r,i){const a=r.theme.agentCap.fade,o=a.height/(a.height+a.extend),h=r.addDef(i?"FadeIn":"FadeOut",()=>{const e=n.make("linearGradient",{x1:"0%",y1:i?"100%":"0%",x2:"0%",y2:i?"0%":"100%"});return e.appendChild(n.make("stop",{offset:"0%","stop-color":"#FFFFFF"})),e.appendChild(n.make("stop",{offset:(100*o).toFixed(3)+"%","stop-color":"#000000"})),e});return r.maskLayer.appendChild(n.make("rect",{x:t-a.width/2,y:e-(i?a.extend:0),width:a.width,height:a.height+a.extend,fill:"url(#"+h+")"})),r.makeRegion().appendChild(n.make("rect",{x:t-a.width/2,y:e,width:a.width,height:a.height,fill:"transparent"})),{lineTop:a.height,lineBottom:0,height:a.height}}}class h{separation({currentRad:e}){return{left:e,right:e,radius:e}}topShift(e,t){return t.theme.agentCap.none.height}render(e,{x:t},s){const r=s.theme.agentCap.none;return s.makeRegion().appendChild(n.make("rect",{x:t-5,y:e,width:10,height:r.height,fill:"transparent"})),{lineTop:r.height,lineBottom:0,height:r.height}}}const l={box:new r,cross:new i,bar:new a,fade:new o,none:new h};class g extends e{constructor(e){super(),this.begin=e}separationPre({mode:e,agentNames:t},n){t.forEach(t=>{const s=n.agentInfos.get(t),r=l[e].separation(s,n,this.begin);n.addSpacing(t,r),s.currentMaxRad=Math.max(s.currentMaxRad,r.radius)})}separation({mode:e,agentNames:n},s){this.begin?t.mergeSets(s.visibleAgents,n):t.removeAll(s.visibleAgents,n)}renderPre({mode:e,agentNames:t},n){let s=0;return t.forEach(t=>{const r=n.agentInfos.get(t),i=l[e],a=i.topShift(r,n,this.begin);s=Math.max(s,a);const o=i.separation(r,n,this.begin).radius;r.currentMaxRad=Math.max(r.currentMaxRad,o)}),{agentNames:t,topShift:s}}render({mode:e,agentNames:t},n){let s=0;return t.forEach(t=>{const r=n.agentInfos.get(t),i=l[e],a=i.topShift(r,n,this.begin),o=n.primaryY-a,h=i.render(o,r,n,this.begin);s=Math.max(s,o+h.height),this.begin?n.drawAgentLine(t,o+h.lineBottom):n.drawAgentLine(t,o+h.lineTop,!0)}),s+n.theme.actionMargin}}return e.register("agent begin",new g(!0)),e.register("agent end",new g(!1)),g}),n("sequence/components/AgentHighlight",["./BaseComponent"],e=>{"use strict";class t extends e{radius(e,t){return e?t.theme.agentLineHighlightRadius:0}separationPre({agentNames:e,highlighted:t},n){const s=this.radius(t,n);e.forEach(e=>{const t=n.agentInfos.get(e);t.currentRad=s,t.currentMaxRad=Math.max(t.currentMaxRad,s)})}renderPre({agentNames:e,highlighted:t},n){const s=this.radius(t,n);e.forEach(e=>{const t=n.agentInfos.get(e);t.currentMaxRad=Math.max(t.currentMaxRad,s)})}render({agentNames:e,highlighted:t},n){const s=this.radius(t,n);return e.forEach(e=>{n.drawAgentLine(e,n.primaryY),n.agentInfos.get(e).currentRad=s}),n.primaryY+n.theme.actionMargin}}return e.register("agent highlight",new t),t}),n("sequence/components/Connect",["./BaseComponent","svg/SVGUtilities","svg/SVGShapes"],(e,t,n)=>{"use strict";function s(e){return[0,2*-e/3,-e,2*-e/3,0,2*e/3,e,2*e/3]}class r{constructor(e){this.propName=e}getConfig(e){return e.connect.arrow[this.propName]}short(e){const t=this.getConfig(e),n=t.attrs["stroke-linejoin"]||"miter",s=.5*t.attrs["stroke-width"],r=.5*e.agentLineAttrs["stroke-width"];if("round"===n)return r+s;{const e=t.height/2,n=t.width;return r+s*Math.sqrt(n*n/(e*e)+1)}}render(e,t,n,s){const r=this.getConfig(t);e.appendChild(r.render(r.attrs,{x:n.x+this.short(t)*s,y:n.y,dx:r.width*s,dy:r.height/2}))}width(e){return this.short(e)+this.getConfig(e).width}height(e){return this.getConfig(e).height}lineGap(e,t){const n=this.getConfig(e),s=this.short(e);if("none"===n.attrs.fill){const e=n.height/2,r=n.width;return(s+(s+t["stroke-width"]/2*(r/e)))/2}return s+n.width/2}}const i=[{render:()=>{},width:()=>0,height:()=>0,lineGap:()=>0},new r("single"),new r("double")];class a extends e{separation({label:e,agentNames:t,options:n},s){const r=s.theme.connect,a=i[n.left],o=i[n.right];let h=s.textSizer.measure(r.label.attrs,e).width;h>0&&(h+=2*r.label.padding);const l=s.agentInfos.get(t[0]);if(t[0]===t[1])s.addSpacing(t[0],{left:0,right:l.currentMaxRad+Math.max(h+a.width(s.theme),o.width(s.theme))+r.loopbackRadius});else{const e=s.agentInfos.get(t[1]);s.addSeparation(t[0],t[1],l.currentMaxRad+e.currentMaxRad+h+2*Math.max(a.width(s.theme),o.width(s.theme)))}}renderSelfConnect({label:e,agentNames:r,options:a},o){const h=o.theme.connect,l=o.agentInfos.get(r[0]),g=i[a.left],d=i[a.right],c=e?o.textSizer.measureHeight(h.label.attrs,e)+h.label.margin.top+h.label.margin.bottom:0,u=l.x+l.currentMaxRad,p=o.primaryY,m=u+g.width(o.theme)+(e?h.label.padding:0),f=o.makeRegion(),b=n.renderBoxedText(e,{x:m-h.mask.padding.left,y:p-c+h.label.margin.top,padding:h.mask.padding,boxAttrs:{fill:"#000000"},labelAttrs:h.label.loopbackAttrs,boxLayer:o.maskLayer,labelLayer:f,SVGTextBlockClass:o.SVGTextBlockClass}),x=e?b.width+h.label.padding-h.mask.padding.left-h.mask.padding.right:0,y=h.loopbackRadius,k=Math.max(u+d.width(o.theme),m+x),w=p+2*y,A=h.line[a.line],v=(A.renderRev||function({xL:e,dx1:n,dx2:r,y1:i,y2:a,xR:o},h){const l=(a-i)/2,g=h["wave-width"],d=h["wave-height"];if(!g||!d)return{shape:t.make("path",Object.assign({d:"M"+(e+n)+" "+i+"L"+o+" "+i+"A"+l+" "+l+" 0 0 1 "+o+" "+a+"L"+(e+r)+" "+a},h)),p1:{x:e,y:i},p2:{x:e,y:a}};const c=s(d),u=g/c.length;let p=0,m="";for(let t=e+n;t+u<=o;t+=u)m+=t+" "+(i+c[p++%c.length])+" ";const f=(i+a)/2;for(let e=0;e+u/l<=Math.PI;e+=u/l){const t=c[p++%c.length];m+=o+Math.sin(e)*(l-t)+" "+(f-Math.cos(e)*(l-t))+" "}for(let t=o;t-u>=e+r;t-=u)m+=t+" "+(a-c[p++%c.length])+" ";return m+=e+r+" "+a,{shape:t.make("polyline",Object.assign({points:m},h)),p1:{x:e,y:i},p2:{x:e,y:a}}})({xL:u,dx1:g.lineGap(o.theme,A.attrs),dx2:d.lineGap(o.theme,A.attrs),y1:p,y2:w,xR:k},A.attrs);o.shapeLayer.appendChild(v.shape),g.render(o.shapeLayer,o.theme,v.p1,1),d.render(o.shapeLayer,o.theme,v.p2,1);const S=Math.max(c,g.height(o.theme)/2),C=d.height(o.theme)/2;return f.insertBefore(t.make("rect",{x:u,y:p-S,width:k+y-u,height:S+2*y+C,fill:"transparent"}),f.firstChild),w+Math.max(C+o.theme.minActionMargin,o.theme.actionMargin)}renderSimpleConnect({label:e,agentNames:r,options:a},o){const h=o.theme.connect,l=o.agentInfos.get(r[0]),g=o.agentInfos.get(r[1]),d=i[a.left],c=i[a.right],u=l.x<g.x?1:-1,p=o.textSizer.measureHeight(h.label.attrs,e)+h.label.margin.top+h.label.margin.bottom,m=l.x+l.currentMaxRad*u,f=g.x-g.currentMaxRad*u,b=o.primaryY,x=o.makeRegion();n.renderBoxedText(e,{x:(m+f)/2,y:b-p+h.label.margin.top,padding:h.mask.padding,boxAttrs:{fill:"#000000"},labelAttrs:h.label.attrs,boxLayer:o.maskLayer,labelLayer:x,SVGTextBlockClass:o.SVGTextBlockClass});const y=h.line[a.line],k=(y.render||function({x1:e,dx1:n,x2:r,dx2:i,y:a},o){const h=o["wave-width"],l=o["wave-height"];if(!h||!l)return{shape:t.make("line",Object.assign({x1:e+n,y1:a,x2:r+i,y2:a},o)),p1:{x:e,y:a},p2:{x:r,y:a}};const g=s(l),d=h/g.length;let c=0,u="";const p=Math.min(e+n,r+i),m=Math.max(e+n,r+i);for(let e=p;e+d<=m;e+=d)u+=e+" "+(a+g[c++%g.length])+" ";return u+=m+" "+a,{shape:t.make("polyline",Object.assign({points:u},o)),p1:{x:e,y:a},p2:{x:r,y:a}}})({x1:m,dx1:d.lineGap(o.theme,y.attrs)*u,x2:f,dx2:-c.lineGap(o.theme,y.attrs)*u,y:b},y.attrs);o.shapeLayer.appendChild(k.shape),d.render(o.shapeLayer,o.theme,k.p1,u),c.render(o.shapeLayer,o.theme,k.p2,-u);const w=Math.max(d.height(o.theme),c.height(o.theme))/2;return x.insertBefore(t.make("rect",{x:Math.min(m,f),y:b-Math.max(p,w),width:Math.abs(f-m),height:Math.max(p,w)+w,fill:"transparent"}),x.firstChild),b+Math.max(w+o.theme.minActionMargin,o.theme.actionMargin)}renderPre({label:e,agentNames:t,options:n},s){const r=s.theme.connect,a=i[n.left],o=i[n.right],h=s.textSizer.measureHeight(r.label.attrs,e)+r.label.margin.top+r.label.margin.bottom;let l=a.height(s.theme);return t[0]!==t[1]&&(l=Math.max(l,o.height(s.theme))),{agentNames:t,topShift:Math.max(l/2,h)}}render(e,t){return e.agentNames[0]===e.agentNames[1]?this.renderSelfConnect(e,t):this.renderSimpleConnect(e,t)}}return e.register("connect",new a),a}),n("sequence/components/Note",["./BaseComponent","svg/SVGUtilities"],(e,t)=>{"use strict";function n(e,t){let n=null,s=null;return t.forEach(t=>{const r=e.get(t);(null===n||r.index<n.index)&&(n=r),(null===s||r.index>s.index)&&(s=r)}),{left:n.label,right:s.label}}class s extends e{renderPre({agentNames:e}){return{agentNames:e}}renderNote({xMid:e=null,x0:n=null,x1:s=null,anchor:r,mode:i,label:a},o){const h=o.theme.getNote(i),l=o.makeRegion(),g=o.topY+h.margin.top+h.padding.top,d=new o.SVGTextBlockClass(l,{attrs:h.labelAttrs,text:a,y:g}),c=d.width+h.padding.left+h.padding.right,u=h.padding.top+d.height+h.padding.bottom;switch(null===n&&null!==e&&(n=e-c/2),null===s&&null!==n?s=n+c:null===n&&(n=s-c),h.labelAttrs["text-anchor"]){case"middle":d.set({x:(n+h.padding.left+s-h.padding.right)/2,y:g});break;case"end":d.set({x:s-h.padding.right,y:g});break;default:d.set({x:n+h.padding.left,y:g})}return o.shapeLayer.appendChild(h.boxRenderer({x:n,y:o.topY+h.margin.top,width:s-n,height:u})),l.insertBefore(t.make("rect",{x:n,y:o.topY+h.margin.top,width:s-n,height:u,fill:"transparent"}),l.firstChild),o.topY+h.margin.top+u+h.margin.bottom+o.theme.actionMargin}}class r extends s{separation({agentNames:e,mode:t,label:s},r){const i=r.theme.getNote(t),a=r.textSizer.measure(i.labelAttrs,s).width+i.padding.left+i.padding.right,{left:o,right:h}=n(r.agentInfos,e),l=r.agentInfos.get(o),g=r.agentInfos.get(h);if(l!==g){const e=l.currentMaxRad+i.overlap.left,t=g.currentMaxRad+i.overlap.right;r.addSeparation(o,h,a-e-t),r.addSpacing(o,{left:e,right:0}),r.addSpacing(h,{left:0,right:t})}else r.addSpacing(o,{left:a/2,right:a/2})}render({agentNames:e,mode:t,label:s},r){const i=r.theme.getNote(t),{left:a,right:o}=n(r.agentInfos,e),h=r.agentInfos.get(a),l=r.agentInfos.get(o);if(h!==l)return this.renderNote({x0:h.x-h.currentMaxRad-i.overlap.left,x1:l.x+l.currentMaxRad+i.overlap.right,anchor:"middle",mode:t,label:s},r);{const e=h.x;return this.renderNote({xMid:e,anchor:"middle",mode:t,label:s},r)}}}class i extends s{constructor(e){super(),this.isRight=e}separation({agentNames:e,mode:t,label:s},r){const i=r.theme.getNote(t),{left:a,right:o}=n(r.agentInfos,e),h=r.textSizer.measure(i.labelAttrs,s).width+i.padding.left+i.padding.right+i.margin.left+i.margin.right;if(this.isRight){const e=r.agentInfos.get(o);r.addSpacing(o,{left:0,right:h+e.currentMaxRad})}else{const e=r.agentInfos.get(a);r.addSpacing(a,{left:h+e.currentMaxRad,right:0})}}render({agentNames:e,mode:t,label:s},r){const i=r.theme.getNote(t),{left:a,right:o}=n(r.agentInfos,e);if(this.isRight){const e=r.agentInfos.get(o),n=e.x+e.currentMaxRad+i.margin.left;return this.renderNote({x0:n,anchor:"start",mode:t,label:s},r)}{const e=r.agentInfos.get(a),n=e.x-e.currentMaxRad-i.margin.right;return this.renderNote({x1:n,anchor:"end",mode:t,label:s},r)}}}class a extends s{separation({agentNames:e,mode:t,label:s},r){const i=r.theme.getNote(t),{left:a,right:o}=n(r.agentInfos,e),h=r.agentInfos.get(a),l=r.agentInfos.get(o);r.addSeparation(a,o,r.textSizer.measure(i.labelAttrs,s).width+i.padding.left+i.padding.right+i.margin.left+i.margin.right+h.currentMaxRad+l.currentMaxRad)}render({agentNames:e,mode:t,label:s},r){const{left:i,right:a}=n(r.agentInfos,e),o=r.agentInfos.get(i),h=r.agentInfos.get(a),l=(o.x+o.currentMaxRad+h.x-h.currentMaxRad)/2;return this.renderNote({xMid:l,anchor:"middle",mode:t,label:s},r)}}return s.NoteOver=r,s.NoteSide=i,s.NoteBetween=a,e.register("note over",new r),e.register("note left",new i(!1)),e.register("note right",new i(!0)),e.register("note between",new a),s}),n("sequence/Renderer",["core/ArrayUtilities","core/EventObject","svg/SVGUtilities","svg/SVGShapes","./components/BaseComponent","./components/Block","./components/Parallel","./components/Marker","./components/AgentCap","./components/AgentHighlight","./components/Connect","./components/Note"],(e,t,n,s,r)=>{"use strict";function i(e,t){let n=null,s=null;return t.forEach(t=>{const r=e.get(t);(null===n||r.index<n.index)&&(n=r),(null===s||r.index>s.index)&&(s=r)}),{left:n.label,right:s.label}}let a=0;return class extends t{constructor({themes:e=[],namespace:t=null,components:n=null,SVGTextBlockClass:i=s.TextBlock}={}){super(),null===n&&(n=r.getComponents()),this.separationStage=this.separationStage.bind(this),this.renderStage=this.renderStage.bind(this),this.addSeparation=this.addSeparation.bind(this),this.addDef=this.addDef.bind(this),this.state={},this.width=0,this.height=0,this.themes=function(e){if(0===e.length)throw new Error("Cannot render without a theme");const t=new Map;return e.forEach(e=>{t.set(e.name,e)}),t.set("",e[0]),t}(e),this.theme=null,this.namespace=function(e){return null===e&&(e="R"+a,++a),e}(t),this.components=n,this.SVGTextBlockClass=i,this.knownDefs=new Set,this.highlights=new Map,this.currentHighlight=-1,this.buildStaticElements(),this.components.forEach(e=>{e.makeState(this.state)})}addTheme(e){this.themes.set(e.name,e)}buildStaticElements(){this.base=n.makeContainer(),this.defs=n.make("defs"),this.mask=n.make("mask",{id:this.namespace+"LineMask",maskUnits:"userSpaceOnUse"}),this.maskReveal=n.make("rect",{fill:"#FFFFFF"}),this.agentLines=n.make("g",{mask:"url(#"+this.namespace+"LineMask)"}),this.blocks=n.make("g"),this.actionShapes=n.make("g"),this.actionLabels=n.make("g"),this.base.appendChild(this.defs),this.base.appendChild(this.agentLines),this.base.appendChild(this.blocks),this.base.appendChild(this.actionShapes),this.base.appendChild(this.actionLabels),this.title=new this.SVGTextBlockClass(this.base),this.sizer=new this.SVGTextBlockClass.SizeTester(this.base)}addDef(e,t){const n=this.namespace+e;if(this.knownDefs.has(e))return n;this.knownDefs.add(e);const s=t();return s.setAttribute("id",n),this.defs.appendChild(s),n}addSeparation(e,t,n){const s=this.agentInfos.get(e),r=this.agentInfos.get(t),i=s.separations.get(t)||0;s.separations.set(t,Math.max(i,n));const a=r.separations.get(e)||0;r.separations.set(e,Math.max(a,n))}separationStage(t){const n=new Map,s=this.visibleAgents.slice();this.agentInfos.forEach(e=>{const t=e.currentRad;e.currentMaxRad=t,n.set(e.label,{left:t,right:t})});const r={theme:this.theme,agentInfos:this.agentInfos,visibleAgents:this.visibleAgents,textSizer:this.sizer,addSpacing:(e,{left:t,right:s})=>{const r=n.get(e);r.left=Math.max(r.left,t),r.right=Math.max(r.right,s)},addSeparation:this.addSeparation,state:this.state,components:this.components},i=this.components.get(t.type);if(!i)throw new Error("Unknown component: "+t.type);i.separationPre(t,r),i.separation(t,r),e.mergeSets(s,this.visibleAgents),s.forEach(e=>{const t=this.agentInfos.get(e),r=n.get(e);t.maxRPad=Math.max(t.maxRPad,r.right),t.maxLPad=Math.max(t.maxLPad,r.left),s.forEach(s=>{if(this.agentInfos.get(s).index>=t.index)return;const i=n.get(s);this.addSeparation(e,s,r.left+i.right+this.theme.agentMargin)})})}checkAgentRange(e,t=0){if(0===e.length)return t;const{left:n,right:s}=i(this.agentInfos,e),r=this.agentInfos.get(n).x,a=this.agentInfos.get(s).x;let o=t;return this.agentInfos.forEach(e=>{e.x>=r&&e.x<=a&&(o=Math.max(o,e.latestY))}),o}markAgentRange(e,t){if(0===e.length)return;const{left:n,right:s}=i(this.agentInfos,e),r=this.agentInfos.get(n).x,a=this.agentInfos.get(s).x;this.agentInfos.forEach(e=>{e.x>=r&&e.x<=a&&(e.latestY=t)})}drawAgentLine(e,t){null===e.latestYStart||t<=e.latestYStart||this.agentLines.appendChild(this.theme.renderAgentLine({x:e.x,y0:e.latestYStart,y1:t,width:2*e.currentRad,className:"agent-"+e.index+"-line"}))}addHighlightObject(e,t){let n=this.highlights.get(e);n||(n=[],this.highlights.set(e,n)),n.push(t)}renderStage(e){this.agentInfos.forEach(e=>{const t=e.currentRad;e.currentMaxRad=t});const t={theme:this.theme,agentInfos:this.agentInfos,textSizer:this.sizer,state:this.state,components:this.components},s=this.components.get(e.type),i=s.renderPre(e,t),{topShift:a,agentNames:o,asynchronousY:h}=r.cleanRenderPreResult(i,this.currentY),l=this.checkAgentRange(o,h),g={topY:l,primaryY:l+a,blockLayer:this.blocks,shapeLayer:this.actionShapes,labelLayer:this.actionLabels,maskLayer:this.mask,theme:this.theme,agentInfos:this.agentInfos,textSizer:this.sizer,SVGTextBlockClass:this.SVGTextBlockClass,state:this.state,drawAgentLine:(e,t,n=!1)=>{const s=this.agentInfos.get(e);this.drawAgentLine(s,t),s.latestYStart=n?null:t},addDef:this.addDef,makeRegion:(t,s=null)=>{t||(t=n.make("g"));const r=s||e;return this.addHighlightObject(r.ln,t),t.setAttribute("class","region"),t.addEventListener("mouseenter",()=>{this.trigger("mouseover",[r])}),t.addEventListener("mouseleave",()=>{this.trigger("mouseout")}),t.addEventListener("click",()=>{this.trigger("click",[r])}),this.actionLabels.appendChild(t),t},components:this.components},d=Math.max(l,s.render(e,g)||0);this.markAgentRange(o,d),this.currentY=d}positionAgents(){const e=[];this.agentInfos.forEach(t=>{let n=0;t.separations.forEach((e,s)=>{const r=this.agentInfos.get(s);r.index<t.index&&(n=Math.max(n,r.x+e))}),t.x=n,e.push(t)});let t={x:0};e.reverse().forEach(e=>{let n=t.x;t=e,e.anchorRight&&(e.separations.forEach((t,s)=>{const r=this.agentInfos.get(s);r.index>e.index&&(n=Math.min(n,r.x-t))}),e.x=n)}),this.agentInfos.forEach(({label:e,x:t,maxRPad:n,maxLPad:s})=>{this.minX=Math.min(this.minX,t-s),this.maxX=Math.max(this.maxX,t+n)})}buildAgentInfos(e,t){this.agentInfos=new Map,e.forEach((e,t)=>{this.agentInfos.set(e.name,{label:e.name,anchorRight:e.anchorRight,index:t,x:null,latestYStart:null,currentRad:0,currentMaxRad:0,latestY:0,maxRPad:0,maxLPad:0,separations:new Map})}),this.visibleAgents=["[","]"],t.forEach(this.separationStage),this.positionAgents()}updateBounds(e){const t=(this.minX+this.maxX)/2,n=this.title.height>0?-this.theme.titleMargin-this.title.height:0;this.title.set({x:t,y:n});const s=this.title.width/2,r=this.theme.outerMargin,i=Math.min(this.minX,t-s)-r,a=Math.max(this.maxX,t+s)+r,o=n-r,h=e+r;this.maskReveal.setAttribute("x",i),this.maskReveal.setAttribute("y",o),this.maskReveal.setAttribute("width",a-i),this.maskReveal.setAttribute("height",h-o),this.base.setAttribute("viewBox",i+" "+o+" "+(a-i)+" "+(h-o)),this.width=a-i,this.height=h-o}_resetState(){this.components.forEach(e=>{e.resetState(this.state)}),this.currentY=0}_reset(){this.knownDefs.clear(),this.highlights.clear(),this.currentHighlight=-1,n.empty(this.defs),n.empty(this.mask),n.empty(this.agentLines),n.empty(this.blocks),n.empty(this.actionShapes),n.empty(this.actionLabels),this.mask.appendChild(this.maskReveal),this.defs.appendChild(this.mask),this._resetState()}setHighlight(e=null){null!==e&&this.highlights.has(e)||(e=-1),this.currentHighlight!==e&&(-1!==this.currentHighlight&&this.highlights.get(this.currentHighlight).forEach(e=>{e.setAttribute("class","region")}),-1!==e&&this.highlights.get(e).forEach(e=>{e.setAttribute("class","region focus")}),this.currentHighlight=e)}render(e){const t=this.currentHighlight;this._reset();const n=e.meta.theme;this.theme=this.themes.get(n),this.theme||(this.theme=this.themes.get("")),this.theme.reset(),this.theme.addDefs(this.addDef),this.title.set({attrs:this.theme.titleAttrs,text:e.meta.title}),this.minX=0,this.maxX=0,this.buildAgentInfos(e.agents,e.stages),this._resetState(),e.stages.forEach(this.renderStage);const s=this.checkAgentRange(["[","]"],this.currentY),r=Math.max(s-this.theme.actionMargin,0);this.updateBounds(r),this.sizer.resetCache(),this.sizer.detach(),this.setHighlight(t)}getThemeNames(){return Array.from(this.themes.keys()).filter(e=>""!==e)}getThemes(){return this.getThemeNames().map(e=>this.themes.get(e))}getAgentX(e){return this.agentInfos.get(e).x}svg(){return this.base}}}),n("sequence/Exporter",[],()=>{"use strict";const e=/^((?!chrome|android).)*safari/i.test(navigator.userAgent),t=void 0!==window.InstallTrigger;return class{constructor(){this.latestSVG=null,this.latestInternalSVG=null,this.canvas=null,this.context=null,this.indexPNG=0,this.latestPNGIndex=0,this.latestPNG=null}getSVGContent(e,n=null){let s=e.svg().outerHTML;return t&&n&&(s=s.replace(/^<svg/,'<svg width="'+n.width+'" height="'+n.height+'" ')),s}getSVGBlob(e,t=null){return new Blob([this.getSVGContent(e,t)],{type:"image/svg+xml"})}getSVGURL(e,t=null){const n=this.getSVGBlob(e,t);return t?(this.latestInternalSVG&&URL.revokeObjectURL(this.latestInternalSVG),this.latestInternalSVG=URL.createObjectURL(n),this.latestInternalSVG):(this.latestSVG&&URL.revokeObjectURL(this.latestSVG),this.latestSVG=URL.createObjectURL(n),this.latestSVG)}getPNGBlob(t,n,s){this.canvas||(window.devicePixelRatio=1,this.canvas=document.createElement("canvas"),this.context=this.canvas.getContext("2d"));const r=t.width*n,i=t.height*n,a=new Image(r,i);let o=null;e&&((o=document.createElement("div")).style.position="absolute",o.style.visibility="hidden",o.appendChild(a),document.body.appendChild(o)),a.addEventListener("load",()=>{this.canvas.width=r,this.canvas.height=i,this.context.drawImage(a,0,0),o&&document.body.removeChild(o),this.canvas.toBlob(s,"image/png")},{once:!0}),a.src=this.getSVGURL(t,{width:r,height:i})}getPNGURL(e,t,n){++this.indexPNG;const s=this.indexPNG;this.getPNGBlob(e,t,e=>{const t=URL.createObjectURL(e);s>=this.latestPNGIndex?(this.latestPNG&&URL.revokeObjectURL(this.latestPNG),this.latestPNG=t,this.latestPNGIndex=s,n(t,!0)):(n(t,!1),URL.revokeObjectURL(t))})}}}),n("sequence/themes/BaseTheme",["svg/SVGUtilities"],e=>{"use strict";function t(e){if("object"!=typeof e||!e)return e;const n={};for(let s in e)e.hasOwnProperty(s)&&(n[s]=t(e[s]));return n}class n{constructor({name:e,settings:n,blocks:s,notes:r}){this.name=e,this.blocks=t(s),this.notes=t(r),Object.assign(this,t(n))}reset(){}addDefs(){}getBlock(e){return this.blocks[e]||this.blocks[""]}getNote(e){return this.notes[e]||this.notes[""]}renderAgentLine({x:t,y0:n,y1:s,width:r,className:i}){return r>0?e.make("rect",Object.assign({x:t-r/2,y:n,width:r,height:s-n,class:i},this.agentLineAttrs)):e.make("line",Object.assign({x1:t,y1:n,x2:t,y2:s,class:i},this.agentLineAttrs))}}return n.renderHorizArrowHead=((t,{x:n,y:s,dx:r,dy:i})=>e.make("none"===t.fill?"polyline":"polygon",Object.assign({points:n+r+" "+(s-i)+" "+n+" "+s+" "+(n+r)+" "+(s+i)},t))),n.renderTag=((t,{x:n,y:s,width:r,height:i})=>{const{rx:a,ry:o}=t,h=n+r,l=s+i,g="M"+h+" "+s+"L"+h+" "+(l-o)+"L"+(h-a)+" "+l+"L"+n+" "+l,d=e.make("g");return"none"!==t.fill&&d.appendChild(e.make("path",Object.assign({d:g+"L"+n+" "+s},t,{stroke:"none"}))),"none"!==t.stroke&&d.appendChild(e.make("path",Object.assign({d:g},t,{fill:"none"}))),d}),n.renderCross=((t,{x:n,y:s,radius:r})=>e.make("path",Object.assign({d:"M"+(n-r)+" "+(s-r)+"l"+2*r+" "+2*r+"m0 "+2*-r+"l"+2*-r+" "+2*r},t))),n}),n("sequence/themes/Basic",["./BaseTheme","svg/SVGUtilities","svg/SVGShapes"],(e,t,n)=>{"use strict";const s="sans-serif",r={titleMargin:10,outerMargin:5,agentMargin:10,actionMargin:10,minActionMargin:3,agentLineHighlightRadius:4,agentCap:{box:{padding:{top:5,left:10,right:10,bottom:5},arrowBottom:12.8,boxAttrs:{fill:"#FFFFFF",stroke:"#000000","stroke-width":1},labelAttrs:{"font-family":s,"font-size":12,"line-height":1.3,"text-anchor":"middle"}},cross:{size:20,render:e.renderCross.bind(null,{fill:"none",stroke:"#000000","stroke-width":1})},bar:{height:4,render:n.renderBox.bind(null,{fill:"#000000",stroke:"#000000","stroke-width":1})},fade:{width:5,height:6,extend:1},none:{height:10}},connect:{loopbackRadius:6,line:{solid:{attrs:{fill:"none",stroke:"#000000","stroke-width":1}},dash:{attrs:{fill:"none",stroke:"#000000","stroke-width":1,"stroke-dasharray":"4, 2"}},wave:{attrs:{fill:"none",stroke:"#000000","stroke-width":1,"stroke-linejoin":"round","stroke-linecap":"round","wave-width":6,"wave-height":.5}}},arrow:{single:{width:5,height:10,render:e.renderHorizArrowHead,attrs:{fill:"#000000","stroke-width":0,"stroke-linejoin":"miter"}},double:{width:4,height:6,render:e.renderHorizArrowHead,attrs:{fill:"none",stroke:"#000000","stroke-width":1,"stroke-linejoin":"miter"}}},label:{padding:6,margin:{top:2,bottom:1},attrs:{"font-family":s,"font-size":8,"line-height":1.3,"text-anchor":"middle"},loopbackAttrs:{"font-family":s,"font-size":8,"line-height":1.3}},mask:{padding:{top:0,left:3,right:3,bottom:1}}},titleAttrs:{"font-family":s,"font-size":20,"line-height":1.3,"text-anchor":"middle",class:"title"},agentLineAttrs:{fill:"none",stroke:"#000000","stroke-width":1}},i={padding:{top:3,bottom:2},mode:{padding:{top:1,left:3,right:3,bottom:0},boxRenderer:e.renderTag.bind(null,{fill:"#FFFFFF",stroke:"#000000","stroke-width":1,rx:2,ry:2}),labelAttrs:{"font-family":s,"font-weight":"bold","font-size":9,"line-height":1.3,"text-anchor":"left"}},label:{padding:{top:1,left:5,right:3,bottom:0},labelAttrs:{"font-family":s,"font-size":8,"line-height":1.3,"text-anchor":"left"}}},a={ref:{margin:{top:0,bottom:0},boxRenderer:n.renderBox.bind(null,{fill:"#FFFFFF",stroke:"#000000","stroke-width":1.5,rx:2,ry:2}),section:i},"":{margin:{top:0,bottom:0},boxRenderer:n.renderBox.bind(null,{fill:"none",stroke:"#000000","stroke-width":1.5,rx:2,ry:2}),section:i,sepRenderer:n.renderLine.bind(null,{stroke:"#000000","stroke-width":1.5,"stroke-dasharray":"4, 2"})}},o={"font-family":s,"font-size":8,"line-height":1.3},h={text:{margin:{top:0,left:2,right:2,bottom:0},padding:{top:2,left:2,right:2,bottom:2},overlap:{left:10,right:10},boxRenderer:n.renderBox.bind(null,{fill:"#FFFFFF"}),labelAttrs:o},note:{margin:{top:0,left:5,right:5,bottom:0},padding:{top:5,left:5,right:10,bottom:5},overlap:{left:10,right:10},boxRenderer:n.renderNote.bind(null,{fill:"#FFFFFF",stroke:"#000000","stroke-width":1},{fill:"none",stroke:"#000000","stroke-width":1}),labelAttrs:o},state:{margin:{top:0,left:5,right:5,bottom:0},padding:{top:7,left:7,right:7,bottom:7},overlap:{left:10,right:10},boxRenderer:n.renderBox.bind(null,{fill:"#FFFFFF",stroke:"#000000","stroke-width":1,rx:10,ry:10}),labelAttrs:o}};return class extends e{constructor(){super({name:"basic",settings:r,blocks:a,notes:h})}}}),n("sequence/themes/Chunky",["./BaseTheme","svg/SVGUtilities","svg/SVGShapes"],(e,t,n)=>{"use strict";const s="sans-serif",r={titleMargin:12,outerMargin:5,agentMargin:8,actionMargin:5,minActionMargin:5,agentLineHighlightRadius:4,agentCap:{box:{padding:{top:1,left:3,right:3,bottom:1},arrowBottom:11.1,boxAttrs:{fill:"#FFFFFF",stroke:"#000000","stroke-width":3,rx:4,ry:4},labelAttrs:{"font-family":s,"font-weight":"bold","font-size":14,"line-height":1.3,"text-anchor":"middle"}},cross:{size:20,render:e.renderCross.bind(null,{fill:"none",stroke:"#000000","stroke-width":3,"stroke-linecap":"round"})},bar:{height:4,render:n.renderBox.bind(null,{fill:"#000000",stroke:"#000000","stroke-width":3,rx:2,ry:2})},fade:{width:5,height:10,extend:1},none:{height:10}},connect:{loopbackRadius:8,line:{solid:{attrs:{fill:"none",stroke:"#000000","stroke-width":3}},dash:{attrs:{fill:"none",stroke:"#000000","stroke-width":3,"stroke-dasharray":"10, 4"}},wave:{attrs:{fill:"none",stroke:"#000000","stroke-width":3,"stroke-linejoin":"round","stroke-linecap":"round","wave-width":10,"wave-height":1}}},arrow:{single:{width:10,height:12,render:e.renderHorizArrowHead,attrs:{fill:"#000000",stroke:"#000000","stroke-width":3,"stroke-linejoin":"round"}},double:{width:10,height:12,render:e.renderHorizArrowHead,attrs:{fill:"none",stroke:"#000000","stroke-width":3,"stroke-linejoin":"round","stroke-linecap":"round"}}},label:{padding:7,margin:{top:2,bottom:3},attrs:{"font-family":s,"font-size":8,"line-height":1.3,"text-anchor":"middle"},loopbackAttrs:{"font-family":s,"font-size":8,"line-height":1.3}},mask:{padding:{top:1,left:5,right:5,bottom:3}}},titleAttrs:{"font-family":s,"font-weight":"bolder","font-size":20,"line-height":1.3,"text-anchor":"middle",class:"title"},agentLineAttrs:{fill:"none",stroke:"#000000","stroke-width":3}},i={padding:{top:3,bottom:4},mode:{padding:{top:2,left:5,right:5,bottom:1},boxRenderer:e.renderTag.bind(null,{fill:"#FFFFFF",stroke:"#000000","stroke-width":2,rx:3,ry:3}),labelAttrs:{"font-family":s,"font-weight":"bold","font-size":9,"line-height":1.3,"text-anchor":"left"}},label:{padding:{top:2,left:5,right:3,bottom:0},labelAttrs:{"font-family":s,"font-size":8,"line-height":1.3,"text-anchor":"left"}}},a={ref:{margin:{top:0,bottom:0},boxRenderer:n.renderBox.bind(null,{fill:"#FFFFFF",stroke:"#000000","stroke-width":4,rx:5,ry:5}),section:i},"":{margin:{top:0,bottom:0},boxRenderer:n.renderBox.bind(null,{fill:"none",stroke:"#000000","stroke-width":4,rx:5,ry:5}),section:i,sepRenderer:n.renderLine.bind(null,{stroke:"#000000","stroke-width":2,"stroke-dasharray":"5, 3"})}},o={"font-family":s,"font-size":8,"line-height":1.3},h={text:{margin:{top:0,left:2,right:2,bottom:0},padding:{top:2,left:2,right:2,bottom:2},overlap:{left:10,right:10},boxRenderer:n.renderBox.bind(null,{fill:"#FFFFFF"}),labelAttrs:o},note:{margin:{top:0,left:5,right:5,bottom:0},padding:{top:3,left:3,right:10,bottom:3},overlap:{left:10,right:10},boxRenderer:n.renderNote.bind(null,{fill:"#FFFFFF",stroke:"#000000","stroke-width":2,"stroke-linejoin":"round"},{fill:"none",stroke:"#000000","stroke-width":1}),labelAttrs:o},state:{margin:{top:0,left:5,right:5,bottom:0},padding:{top:5,left:7,right:7,bottom:5},overlap:{left:10,right:10},boxRenderer:n.renderBox.bind(null,{fill:"#FFFFFF",stroke:"#000000","stroke-width":3,rx:10,ry:10}),labelAttrs:o}};return class extends e{constructor(){super({name:"chunky",settings:r,blocks:a,notes:h})}}}),n("sequence/themes/HandleeFontData",[],()=>{"use strict";return{name:"Handlee",woff2:"d09GMgABAAAAAD3EAA4AAAAAi4QAAD1qAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGhYbxV4cKgZgAIF8EQgKgbpIgZNlC4MGAAE2AiQDhggEIAWEDgeDKxuhdSXsmCEeByC2jBgVNYuS+mQUpZq0k+z/vyY3BgzxIa3ugqhFRlV1T4WqHliFgkLvX+Fguaf/tXTReCMU5hvZI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sWhyNNNdm3lDK1bXdq4nbx7Rbv5Am864ZdqJRxa5GO9PHpglZjqn0ZulqqamNlzDq6nWqV1sqQ5uWZG99lRlTP3z4/iVw968DnxaQhFS/xRpWdHxXGG53OF1uj9fnPydIimZYLnARDIUjfPRyp3+9Qly8TiRT6Uw2l38kyXqD0WS2WG12hzM5JTXNle7O8GR6fVnZObl5+QWFRcVbxsZRWmHCAvOst8tco5aatNJsFy++s9uUfT5Z/09J6SJln916dWt/Z3fvttsHh/9Tudi9k8Ydc9RU19bXNWzS2NzU0tre1tHZ1dPd2993wmaDA0OGnXR/wCEPzjtDjjhu2qURx1x+3R5nnI2W/z0OAAA="}}),n("sequence/themes/Sketch",["./BaseTheme","svg/SVGUtilities","svg/SVGShapes","./HandleeFontData"],(e,t,n,s)=>{"use strict";const r="'"+s.name+"',cursive",i={stroke:"rgba(0,0,0,0.7)","stroke-width":.8,"stroke-linejoin":"round","stroke-linecap":"round"},a={stroke:"rgba(0,0,0,0.8)","stroke-width":1.2,"stroke-linejoin":"round","stroke-linecap":"round"},o={titleMargin:10,outerMargin:5,agentMargin:10,actionMargin:10,minActionMargin:3,agentLineHighlightRadius:4,agentCap:{box:{padding:{top:5,left:10,right:10,bottom:5},arrowBottom:12.8,labelAttrs:{"font-family":r,"font-size":12,"line-height":1.5,"text-anchor":"middle"},boxRenderer:null},cross:{size:15,render:null},bar:{height:6,render:null},fade:{width:Math.ceil(12),height:6,extend:Math.ceil(2.5)},none:{height:10}},connect:{loopbackRadius:6,line:{solid:{attrs:Object.assign({fill:"none"},i),render:null,renderRev:null},dash:{attrs:Object.assign({fill:"none","stroke-dasharray":"4, 2"},i),render:null,renderRev:null},wave:{attrs:Object.assign({fill:"none","stroke-linejoin":"round","stroke-linecap":"round","wave-width":6,"wave-height":.5},i),render:null,renderRev:null}},arrow:{single:{width:5,height:6,attrs:Object.assign({fill:"rgba(0,0,0,0.9)"},i),render:null},double:{width:4,height:8,attrs:Object.assign({fill:"none"},i),render:null}},label:{padding:6,margin:{top:2,bottom:1},attrs:{"font-family":r,"font-size":8,"line-height":1.5,"text-anchor":"middle"},loopbackAttrs:{"font-family":r,"font-size":8,"line-height":1.5}},mask:{padding:{top:0,left:3,right:3,bottom:1}}},titleAttrs:{"font-family":r,"font-size":20,"line-height":1.5,"text-anchor":"middle",class:"title"},agentLineAttrs:{fill:"none",stroke:"#000000","stroke-width":1}},h={padding:{top:3,bottom:2},mode:{padding:{top:2,left:3,right:5,bottom:0},boxRenderer:null,labelAttrs:{"font-family":r,"font-weight":"bold","font-size":9,"line-height":1.5,"text-anchor":"left"}},label:{padding:{top:1,left:5,right:3,bottom:0},labelAttrs:{"font-family":r,"font-size":8,"line-height":1.5,"text-anchor":"left"}}},l={ref:{margin:{top:0,bottom:0},boxRenderer:null,section:h},"":{margin:{top:0,bottom:0},boxRenderer:null,section:h,sepRenderer:null}},g={"font-family":r,"font-size":8,"line-height":1.5},d={text:{margin:{top:0,left:2,right:2,bottom:0},padding:{top:2,left:2,right:2,bottom:2},overlap:{left:10,right:10},boxRenderer:n.renderBox.bind(null,{fill:"#FFFFFF"}),labelAttrs:g},note:{margin:{top:0,left:5,right:5,bottom:0},padding:{top:5,left:5,right:10,bottom:5},overlap:{left:10,right:10},boxRenderer:null,labelAttrs:g},state:{margin:{top:0,left:5,right:5,bottom:0},padding:{top:7,left:7,right:7,bottom:7},overlap:{left:10,right:10},boxRenderer:null,labelAttrs:g}};class c{constructor(){this.s=new Uint32Array(4)}reset(){this.s[0]=394173556,this.s[1]=2926575054,this.s[2]=1022685995,this.s[3]=1178902408}nextFloat(){let e=this.s[0],t=this.s[1];const n=this.s[2],s=this.s[3];return this.s[0]=n,this.s[1]=s,e^=e<<23|t>>>9,t^=t<<23,this.s[2]=e^n^e>>>17^n>>>26,this.s[3]=t^s^(e<<15|t>>>17)^(n<<6|s>>>26),(this.s[3]+s>>>0)%4294967296/4294967296}}const u={};class p extends e{constructor(e=u){super({name:"",settings:o,blocks:l,notes:d}),e===u?(this.name="sketch",this.handedness=1):(this.name="sketch left handed",this.handedness=-1),this.random=new c,this._assignFunctions()}_assignFunctions(){this.renderBar=this.renderBar.bind(this),this.renderBox=this.renderBox.bind(this),this.renderArrowHead=this.renderArrowHead.bind(this),this.renderConnect=this.renderConnect.bind(this),this.renderTag=this.renderTag.bind(this),this.agentCap.cross.render=this.renderCross.bind(this),this.agentCap.bar.render=this.renderBar,this.agentCap.box.boxRenderer=this.renderBox,this.connect.arrow.single.render=this.renderArrowHead,this.connect.arrow.double.render=this.renderArrowHead,this.connect.line.solid.render=this.renderConnect,this.connect.line.dash.render=this.renderConnect,this.notes.note.boxRenderer=this.renderNote.bind(this),this.notes.state.boxRenderer=this.renderState.bind(this),this.blocks.ref.boxRenderer=this.renderRefBlock.bind(this),this.blocks[""].boxRenderer=this.renderBlock.bind(this),this.blocks.ref.section.mode.boxRenderer=this.renderTag,this.blocks[""].section.mode.boxRenderer=this.renderTag,this.blocks[""].sepRenderer=this.renderSeparator.bind(this)}reset(){this.random.reset()}addDefs(e){e("sketch_font",()=>{const e=document.createElement("style");return e.innerText='@font-face{font-family:"'+s.name+'";src:url("data:font/woff2;base64,'+s.woff2+'");}',e})}vary(e){if(!e)return 0;const t=this.random.nextFloat();return 2*Math.asin(2*t-1)*e/Math.PI}lineNodes(e,t,{var1:n=1,var2:s=1,varX:r=1,varY:i=1,move:a=!0}){const o=Math.sqrt((t.x-e.x)*(t.x-e.x)+(t.y-e.y)*(t.y-e.y)),h=Math.min(.2*Math.sqrt(o),5),l=e.x+this.vary(n*r*h),g=e.y+this.vary(n*i*h),d=t.x+this.vary(s*r*h),c=t.y+this.vary(s*i*h),u=Math.max(-1,Math.min(1,(g-c)/(Math.abs(l-d)+.001)))/6+.5,p=(.5+this.vary(.5))*h,m=(.5+this.vary(.5))*h,f=l*(1-u)+d*u-p*this.handedness;return{nodes:(a?"M"+l+" "+g:"")+"C"+f+" "+(g*(1-u)+c*u-m)+","+d+" "+c+","+d+" "+c,p1:{x:l,y:g},p2:{x:d,y:c}}}renderLine(e,n,s){const r=this.lineNodes(e,n,s);return t.make("path",Object.assign({d:r.nodes,fill:"none","stroke-dasharray":s.dash?"6, 5":"none"},s.thick?a:i))}renderBox({x:e,y:n,width:s,height:r},{fill:o=null,thick:h=!1}={}){const l=this.lineNodes({x:e,y:n},{x:e+s,y:n},{}),g=this.lineNodes({x:e+s,y:n+r},{x:e,y:n+r},{move:!1}),d=this.lineNodes(l.p2,g.p1,{var1:0,var2:0,move:!1}),c=this.lineNodes(g.p2,l.p1,{var1:0,var2:.3,move:!1});return t.make("path",Object.assign({d:l.nodes+d.nodes+g.nodes+c.nodes,fill:o||"#FFFFFF"},h?a:i))}renderNote({x:e,y:n,width:s,height:r}){const a=this.lineNodes({x:e,y:n},{x:e+s-5,y:n},{}),o=this.lineNodes(a.p2,{x:e+s,y:n+5},{move:!1,var1:0}),h=this.lineNodes({x:e+s,y:n+r},{x:e,y:n+r},{move:!1}),l=this.lineNodes(o.p2,h.p1,{var1:0,var2:0,move:!1}),g=this.lineNodes(h.p2,a.p1,{var1:0,var2:.3,move:!1}),d=this.lineNodes(o.p1,{x:e+s-5,y:n+5},{var1:.3}),c=this.lineNodes(d.p2,o.p2,{var1:0,move:!1}),u=t.make("g");return u.appendChild(t.make("path",Object.assign({d:a.nodes+o.nodes+l.nodes+h.nodes+g.nodes,fill:"#FFFFFF"},i))),u.appendChild(t.make("path",Object.assign({d:d.nodes+c.nodes,fill:"none"},i))),u}renderConnect({x1:e,dx1:n,x2:s,dx2:r,y:i},a){const o=this.lineNodes({x:e+n,y:i},{x:s+r,y:i},{varX:.3});return{shape:t.make("path",Object.assign({d:o.nodes},a)),p1:{x:o.p1.x-n,y:o.p2.y},p2:{x:o.p2.x-r,y:o.p2.y}}}renderArrowHead(e,{x:n,y:s,dx:r,dy:i}){const a=r*(1+this.vary(.2)),o=i*(1+this.vary(.3)),h=this.lineNodes({x:n+a,y:s-o},{x:n,y:s},{var1:2,var2:.2}),l=this.lineNodes(h.p2,{x:n+a,y:s+o},{var1:0,var2:2,move:!1}),g="none"===e.fill?{nodes:""}:this.lineNodes(l.p2,h.p1,{var1:0,var2:0,move:!1});return t.make("path",Object.assign({d:h.nodes+l.nodes+g.nodes},e))}renderState({x:e,y:t,width:n,height:s}){return this.renderBox({x:e,y:t,width:n,height:s})}renderRefBlock({x:e,y:t,width:n,height:s}){return this.renderBox({x:e,y:t,width:n,height:s},{fill:"#FFFFFF",thick:!0})}renderBlock({x:e,y:t,width:n,height:s}){return this.renderBox({x:e,y:t,width:n,height:s},{fill:"none",thick:!0})}renderTag({x:e,y:n,width:s,height:r}){const a=e+s,o=n+r,h=this.lineNodes({x:a+3,y:n},{x:a-2,y:o},{}),l=this.lineNodes(h.p2,{x:e,y:o+1},{var1:0,move:!1}),g=h.nodes+l.nodes,d=t.make("g");return d.appendChild(t.make("path",{d:g+"L"+e+" "+n,fill:"#FFFFFF"})),d.appendChild(t.make("path",Object.assign({d:g,fill:"#FFFFFF"},i))),d}renderSeparator({x1:e,y1:t,x2:n,y2:s}){return this.renderLine({x:e,y:t},{x:n,y:s},{thick:!0,dash:!0})}renderBar({x:e,y:t,width:n,height:s}){return this.renderBox({x:e,y:t,width:n,height:s},{fill:"#000000"})}renderCross({x:e,y:n,radius:s}){const r=(this.vary(.2)+1)*s,a=this.lineNodes({x:e-r,y:n-r},{x:e+r,y:n+r},{}),o=(this.vary(.2)+1)*s,h=this.lineNodes({x:e+o,y:n-o},{x:e-o,y:n+o},{});return t.make("path",Object.assign({d:a.nodes+h.nodes,fill:"none"},i))}renderAgentLine({x:e,y0:t,y1:n,width:s,className:r}){if(s>0){const i=this.renderBox({x:e-s/2,y:t,width:s,height:n-t},{fill:"none"});return i.setAttribute("class",r),i}{const s=this.renderLine({x:e,y:t},{x:e,y:n},{varY:.3});return s.setAttribute("class",r),s}}}return p.RIGHT=u,p.LEFT={},p}),n("sequence/SequenceDiagram",["core/EventObject","./Parser","./Generator","./Renderer","./Exporter","./themes/BaseTheme","./themes/Basic","./themes/Chunky","./themes/Sketch"],(e,t,n,s,r,i,a,o,h)=>{"use strict";function l(e,t="sequence"){e||(e=window.CodeMirror),e.defineMode(t,()=>p),e.registerHelper("hint",t,m)}function g(e,t=null,n={}){if("svg"===e.tagName)return null;null===t?t=e.innerText:"object"==typeof t&&(t=(n=t).code);const s=new f(t,n),r=s.dom();e.parentNode.insertBefore(r,e),e.parentNode.removeChild(e);const i=e.attributes;for(let e=0;e<i.length;++e)r.setAttribute(i[e].nodeName,i[e].nodeValue);return s}const d=[new a,new o,new h(h.RIGHT),new h(h.LEFT)],c=new t,u=new n,p=c.getCodeMirrorMode(),m=c.getCodeMirrorHints();class f extends e{constructor(e=null,t={}){super(),e&&"object"==typeof e&&(e=(t=e).code),this.registerCodeMirrorMode=l,this.code=e,this.parser=c,this.generator=u,this.renderer=new s(Object.assign({themes:d},t)),this.exporter=new r,this.renderer.addEventForwarding(this),t.container&&t.container.appendChild(this.dom()),"string"==typeof this.code&&this.render()}clone(e={}){return new f(Object.assign({code:this.code,container:null,themes:this.renderer.getThemes(),namespace:null,components:this.renderer.components,SVGTextBlockClass:this.renderer.SVGTextBlockClass},e))}set(e=""){this.code!==e&&(this.code=e,this.render())}process(e){const t=this.parser.parse(e);return this.generator.generate(t)}addTheme(e){this.renderer.addTheme(e)}setHighlight(e=null){this.renderer.setHighlight(e)}getThemeNames(){return this.renderer.getThemeNames()}getThemes(){return this.renderer.getThemes()}getSVGSynchronous(){return this.exporter.getSVGURL(this.renderer)}getSVG(){return Promise.resolve({url:this.getSVGSynchronous(),latest:!0})}getPNG({resolution:e=1,size:t=null}={}){return t&&(this.renderer.width=t.width,this.renderer.height=t.height),new Promise(t=>{this.exporter.getPNGURL(this.renderer,e,(e,n)=>{t({url:e,latest:n})})})}getSize(){return{width:this.renderer.width,height:this.renderer.height}}render(e=null){const t=this.renderer.svg(),n=t.parentNode;document.body.contains(t)||(n&&n.removeChild(t),document.body.appendChild(t));try{e||(e=this.process(this.code)),this.renderer.render(e)}finally{t.parentNode!==n&&(document.body.removeChild(t),n&&n.appendChild(t))}}setContainer(e=null){const t=this.dom();t.parentNode&&t.parentNode.removeChild(t),e&&e.appendChild(t)}dom(){return this.renderer.svg()}}return Object.assign(f,{Parser:t,Generator:n,Renderer:s,Exporter:r,BaseTheme:i,themes:d,addTheme:function(e){d.push(e)},registerCodeMirrorMode:l,convert:g,convertAll:function(e=null,t="sequence-diagram"){"string"==typeof e&&(t=e,e=null);let n=null;n=e&&void 0!==e.length?e:(e||document).getElementsByClassName(t);const s=[];for(let e=0;e<n.length;++e)s.push(n[e]);s.forEach(e=>g(e))}})}),e(["sequence/SequenceDiagram"],e=>{"use strict";const t=window.define;t&&t.amd?t(()=>e):(document.addEventListener("DOMContentLoaded",()=>{e.convertAll()},{once:!0}),window.CodeMirror&&e.registerCodeMirrorMode(window.CodeMirror),window.SequenceDiagram=e)},null,!0),n("standalone",function(){})}();